/* dual.css — CV ↔ portfolio chrome for index.php. */

:root {
  --dual-link: #0066cc;
  --dual-scroll-thumb: #c4c4c4;
  --dual-scroll-track: #f0f0f0;
  --dual-footer-h: 2.35rem;
  /* Full-size header top/bottom padding (~60% of prior 2rem) */
  --dual-chrome-pad-y: 1.2rem;
  /* Compact header + footer vertical padding */
  --dual-compact-pad-y: 0.55rem;
}

/* Scrollbars: full-height, page-right edge (on mode scroll roots) */
html {
  color-scheme: light;
  scrollbar-color: var(--dual-scroll-thumb) var(--dual-scroll-track);
  scrollbar-width: thin;
  height: 100%;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
#portfolio-mode::-webkit-scrollbar,
#gallery-mode::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track,
#portfolio-mode::-webkit-scrollbar-track,
#gallery-mode::-webkit-scrollbar-track {
  background: var(--dual-scroll-track);
}

html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb,
#portfolio-mode::-webkit-scrollbar-thumb,
#gallery-mode::-webkit-scrollbar-thumb {
  background: var(--dual-scroll-thumb);
  border-radius: 5px;
  border: 2px solid var(--dual-scroll-track);
}

body {
  height: 100%;
  overflow: hidden;
}

/* Instant mode switch — no fade / slide */
#portfolio-mode {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overflow-anchor: none;
  background: #fafafa;
  scrollbar-color: var(--dual-scroll-thumb) var(--dual-scroll-track);
  scrollbar-width: thin;
  /* Reserve space so fixed footer never covers content */
  padding-bottom: var(--dual-footer-h);
  box-sizing: border-box;
}

body.gallery-active #portfolio-mode {
  display: none;
}

body.gallery-active {
  overflow: hidden;
  background: #fafafa;
  color-scheme: light;
}

#gallery-mode {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  flex-direction: column;
  background: #fafafa;
  color: #1a1a1a;
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overflow-anchor: none;
  color-scheme: light;
  scrollbar-color: var(--dual-scroll-thumb) var(--dual-scroll-track);
  scrollbar-width: thin;
  padding-bottom: var(--dual-footer-h);
  box-sizing: border-box;
}

body.gallery-active #gallery-mode {
  display: block;
}

#portfolio-mode main {
  /* Not the scroll root — stays content-width so scrollbar sits on page edge */
  overflow: visible;
}

#gallery-mode .gallery-mode-inner {
  position: relative;
  z-index: 2;
  overflow: visible;
  padding: 0 2rem 1.5rem;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}

/* Sticky header (scrolls with full-height bar) + fixed footer.
   Compact state is binary + CSS transition (not scroll-scrubbed): scrubbing
   height against scrollTop causes sticky/anchor feedback → flicker. */
.dual-brand-header {
  --dual-header-ease: 0.38s ease;
  position: sticky;
  top: 0;
  z-index: 50;
  overflow-anchor: none;
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #1a1a1a;
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--dual-chrome-pad-y) 2rem;
  gap: 0;
  transition:
    padding var(--dual-header-ease),
    gap var(--dual-header-ease);
}

#gallery-mode .dual-brand-header .brand h1 {
  font-family: "Plus Jakarta Sans", sans-serif;
  color: #1a1a1a;
}

#gallery-mode .dual-brand-header .tagline {
  color: #555;
  font-style: italic;
}

.dual-brand-header .logomark {
  width: 120px;
  height: auto;
  display: block;
  margin-bottom: 1rem;
  flex-shrink: 0;
  transition:
    width var(--dual-header-ease),
    margin var(--dual-header-ease);
}

.dual-brand-header .brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}

.dual-brand-header .brand h1 {
  margin: 0;
  font-size: 1.75rem;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: font-size var(--dual-header-ease);
}

.dual-brand-header .tagline {
  margin: 0.25rem 0 0;
  font-size: 0.95rem;
  line-height: 1.3;
  color: #555;
  font-style: italic;
  transition:
    font-size var(--dual-header-ease),
    margin var(--dual-header-ease);
}

.dual-brand-header .mode-nav {
  margin-top: 0.75rem;
  font-size: 0.95rem;
  gap: 0.2rem;
  transition:
    margin var(--dual-header-ease),
    font-size var(--dual-header-ease),
    gap var(--dual-header-ease);
}

/* Compact: logomark on the right; text flush-right against it */
.dual-brand-header.is-compact {
  flex-direction: row;
  align-items: center;
  justify-content: center;
  text-align: right;
  padding: var(--dual-compact-pad-y) 1.5rem;
  gap: 0.85rem;
}

.dual-brand-header.is-compact .logomark {
  order: 2;
  width: 52px;
  margin-bottom: 0;
}

.dual-brand-header.is-compact .brand {
  order: 1;
  align-items: flex-end;
  text-align: right;
}

.dual-brand-header.is-compact .brand h1 {
  font-size: 1.15rem;
  line-height: 1.2;
}

.dual-brand-header.is-compact .tagline {
  margin: 0.3rem 0 0;
  font-size: 0.8rem;
}

.dual-brand-header.is-compact .mode-nav {
  align-items: flex-end;
  margin-top: 0.15rem;
  font-size: 0.82rem;
  gap: 0.1rem;
}

.dual-brand-header.is-compact .mode-nav-row {
  justify-content: flex-end;
  gap: 0.3rem;
}

#portfolio-mode > .site-footer,
#gallery-mode > .site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 60;
  margin: 0;
  padding: var(--dual-compact-pad-y) 1rem;
  line-height: 1.3;
  border-top: 1px solid #e0e0e0;
  background: #fff;
  text-align: center;
  font-size: 0.8rem;
  color: #666;
  box-sizing: border-box;
}

#portfolio-mode > .site-footer p,
#gallery-mode > .site-footer p {
  margin: 0;
}

.mode-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  margin-top: 0.75rem;
  font-size: 0.95rem;
}

.mode-nav-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.mode-nav-sep {
  color: #999;
  user-select: none;
}

.mode-nav-link {
  color: #555;
  text-decoration: none;
  font-weight: 500;
  padding: 0.15rem 0.1rem;
}

.mode-nav-link:hover,
.mode-nav-link:focus-visible {
  color: #111;
  text-decoration: underline;
  outline: none;
}

.mode-nav-link.is-active {
  color: #111;
  font-weight: 600;
  text-decoration: none;
  cursor: default;
  pointer-events: none;
}

/* Slim inventory blurb — counts + collectors only */
#gallery-mode .gallery-inventory {
  text-align: center;
  max-width: 56rem;
  margin: 1.25rem auto 0.5rem;
  padding: 0;
  color: #444;
  font-size: 0.95rem;
  line-height: 1.5;
  background: transparent;
  border: none;
}

#gallery-mode .gallery-inventory p {
  margin: 0.35rem 0;
}

#gallery-mode .gallery-inventory a {
  color: var(--dual-link);
}

a.dual-bridge {
  color: var(--dual-link);
}
a.dual-bridge:hover {
  text-decoration: underline;
}

/* Wide viewports: winding thumbnail path ≤ 70% of available width */
@media (min-width: 1101px) and (orientation: landscape) {
  #gallery-mode .gallery-grid {
    max-width: min(1800px, 70%);
    width: 100%;
  }
}

@media (max-width: 720px) {
  :root {
    --dual-chrome-pad-y: 0.75rem; /* ~60% of prior 1.25rem mobile header pad */
    --dual-compact-pad-y: 0.5rem;
  }

  .dual-brand-header {
    padding: var(--dual-chrome-pad-y) 1rem;
  }

  .dual-brand-header .logomark {
    width: 96px;
  }

  .dual-brand-header .brand h1 {
    font-size: 1.45rem;
  }

  .dual-brand-header .tagline {
    font-size: 0.85rem;
  }

  .dual-brand-header .mode-nav {
    font-size: 0.82rem;
    gap: 0.15rem;
  }

  .dual-brand-header .mode-nav-row {
    gap: 0.3rem;
  }

  .dual-brand-header.is-compact {
    padding: var(--dual-compact-pad-y) 0.85rem;
    gap: 0.65rem;
  }

  .dual-brand-header.is-compact .logomark {
    width: 44px;
  }

  .dual-brand-header.is-compact .brand h1 {
    font-size: 1rem;
  }

  .dual-brand-header.is-compact .mode-nav {
    font-size: 0.75rem;
    gap: 0.08rem;
  }

  #gallery-mode .gallery-mode-inner {
    padding: 0 0.75rem 1.25rem;
  }

  #portfolio-mode > .site-footer,
  #gallery-mode > .site-footer {
    padding: var(--dual-compact-pad-y) 0.75rem;
    font-size: 0.75rem;
  }
}

@media print {
  body {
    height: auto;
    overflow: visible;
  }

  #portfolio-mode {
    position: static;
    display: block;
    overflow: visible;
    padding-bottom: 0;
  }

  #portfolio-mode > .site-footer,
  #gallery-mode > .site-footer {
    position: static;
  }

  .dual-brand-header {
    position: static;
  }

  .dual-brand-header.is-compact {
    flex-direction: column;
    text-align: center;
  }
}
