/* Danielle Posa: site styles.
   Most layout lives in inline styles carried over from the original design.
   This file holds the brand tokens, shared components, and mobile fixes. */

:root {
  --white: #FFFFFF;
  --ink: #1A1A1A;
  --accent: #A8321C;
  --secondary: #0F6E73;
  --panel: #F7F3EE;
  --hairline: #E6E0D8;
  --muted: #6B6763;
  --body-muted: #4A4744;
  --font-serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-sans: 'Karla', -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  --header-h: 120px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 18px;
  line-height: 1.65;
  overflow-x: hidden;
}

a { color: var(--ink); }
img { max-width: 100%; }
button { font: inherit; }

[id] { scroll-margin-top: calc(var(--header-h) + 16px); }

:focus-visible { outline: 2px solid var(--secondary); outline-offset: 3px; }

.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  padding: 12px 20px; background: var(--ink); color: var(--white);
  font-size: 14px; font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ---------------------------------------------------------------- header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: var(--white);
  padding: 20px 24px 16px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  border-bottom: 1px solid var(--hairline);
}
.site-header__bar { display: flex; justify-content: center; align-items: center; width: 100%; }
.site-logo {
  font-family: var(--font-serif); font-weight: 600; font-size: 38px;
  letter-spacing: 0.26em; text-transform: uppercase; text-decoration: none; text-align: center;
  display: inline-flex; flex-direction: column; align-items: center; gap: 6px; color: var(--ink);
}
.site-logo__name { line-height: 1; }
.site-logo__tag .nowrap { white-space: nowrap; }
.site-logo__tag {
  font-family: var(--font-sans); font-weight: 700; font-size: 14px; line-height: 1.4;
  letter-spacing: 0.2em; color: var(--muted);
}
.site-nav {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 36px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase;
}
.site-nav a { text-decoration: none; }
.site-nav a[aria-current="page"] { border-bottom: 2px solid var(--accent); }
.site-nav a:hover { color: var(--accent); }
.nav-toggle { display: none; }

/* ---------------------------------------------------------------- accordions */
.acc-btn:hover [data-action] { color: var(--accent); }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- lens grid */
.lens-card {
  display: flex; flex-direction: column; gap: 12px; padding: 0; background: none; border: 0;
  text-align: left; cursor: pointer; font-family: var(--font-sans); color: var(--ink); width: 100%;
}
.lens-card img { width: 100%; height: 380px; object-fit: cover; display: block; transition: opacity .2s ease; }
.lens-card:hover img { opacity: .9; }
.lens-card__row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; width: 100%; }
.lens-card__name { font-family: var(--font-serif); font-weight: 600; font-size: 30px; line-height: 1.1; }
.lens-card__count { font-size: 12px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); white-space: nowrap; }
.lens-card__sub { font-size: 15px; color: var(--muted); margin-top: -8px; }
.lens-card__empty {
  width: 100%; height: 380px; background: var(--panel); border: 2px dashed #CFC6B6;
  display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 15px;
}

/* ---------------------------------------------------------------- lens viewer */
body.is-locked { overflow: hidden; }
.lens-viewer {
  position: fixed; inset: 0; z-index: 50; background: #111111; color: #FFFFFF;
  display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain;
}
.lens-viewer__top {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 16px 24px; border-bottom: 1px solid #333333;
}
.lens-viewer__title { margin: 0; font-family: var(--font-serif); font-weight: 600; font-size: 30px; line-height: 1.3; }
.lens-btn {
  min-height: 44px; padding: 0 20px; background: none; border: 1px solid #FFFFFF; color: #FFFFFF; cursor: pointer;
  font-family: var(--font-sans); font-size: 13px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
}
.lens-btn--country { padding: 0 16px; border-color: #555555; font-size: 12px; letter-spacing: 0.14em; }
.lens-btn:hover { background: rgba(255,255,255,0.08); }
.lens-viewer :focus-visible { outline-color: #FFFFFF; }
.lens-viewer__body {
  flex: 1 1 auto; display: flex; flex-wrap: wrap; gap: 24px 40px; padding: 24px; align-items: flex-start;
}
.lens-viewer__main { flex: 3 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.lens-viewer__side { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 14px; padding-top: 8px; }
.lens-stage { position: relative; width: 100%; height: min(70vh, 720px); background: #000000; }
.lens-stage img { width: 100%; height: 100%; object-fit: contain; display: block; }
.lens-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 52px; height: 52px; border-radius: 999px; border: 0;
  background: rgba(255,255,255,0.9); color: var(--ink); font-size: 26px; line-height: 1; cursor: pointer;
}
.lens-arrow--prev { left: 12px; }
.lens-arrow--next { right: 12px; }
.lens-meta { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; color: #CCCCCC; }
.lens-note { font-family: var(--font-serif); font-style: italic; font-size: 21px; line-height: 1.45; color: #EDEDED; max-width: 760px; }
.lens-counter { flex: 0 0 auto; font-size: 14px; margin-left: auto; }
.lens-thumbs { display: flex; gap: 10px; overflow-x: auto; padding: 4px 4px 6px; }
.lens-thumb { flex: 0 0 auto; padding: 0; border: 0; background: none; cursor: pointer; opacity: 0.55; }
.lens-thumb img { width: 96px; height: 72px; object-fit: cover; display: block; }
.lens-thumb[aria-current="true"] { outline: 3px solid #FFFFFF; outline-offset: 2px; opacity: 1; }
.lens-thumb:hover { opacity: 0.85; }
.lens-empty {
  width: 100%; height: 360px; border: 2px dashed #555555;
  display: flex; align-items: center; justify-content: center; color: #AAAAAA;
}
.lens-sub { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: #E9B8A9; }
.lens-story { margin: 0; font-family: var(--font-serif); font-size: 24px; line-height: 1.4; }
.lens-countries { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }

/* ---------------------------------------------------------------- tablet */
@media (max-width: 900px) {
  .home-hero__text { padding: 64px 24px 48px !important; }
  .pad-card { padding: 48px 32px !important; }
}

/* ---------------------------------------------------------------- mobile */
@media (max-width: 760px) {
  :root { --header-h: 68px; }
  body { font-size: 17px; }

  .site-header { padding: 10px 16px; gap: 0; align-items: stretch; }
  .site-header__bar { justify-content: space-between; gap: 12px; }
  .site-logo { font-size: 24px; letter-spacing: 0.18em; text-align: left; min-height: 44px; display: inline-flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px; }
  .site-logo__tag { font-size: 10px; letter-spacing: 0.12em; max-width: 240px; }
  .js .nav-toggle {
    display: inline-flex; align-items: center; gap: 10px;
    min-height: 44px; min-width: 44px; padding: 0 4px 0 12px;
    background: none; border: 0; color: var(--ink); cursor: pointer;
    font-size: 12px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase;
  }
  .nav-toggle__icon, .nav-toggle__icon::before, .nav-toggle__icon::after {
    display: block; width: 20px; height: 2px; background: var(--ink); position: relative; transition: transform .2s ease;
  }
  .nav-toggle__icon::before, .nav-toggle__icon::after { content: ""; position: absolute; left: 0; }
  .nav-toggle__icon::before { top: -6px; }
  .nav-toggle__icon::after { top: 6px; }
  .nav-toggle[aria-expanded="true"] .nav-toggle__icon { background: transparent; }
  .nav-toggle[aria-expanded="true"] .nav-toggle__icon::before { transform: translateY(6px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle__icon::after { transform: translateY(-6px) rotate(-45deg); }

  .site-nav { gap: 0 24px; padding-top: 6px; }
  .site-nav a { min-height: 44px; display: inline-flex; align-items: center; }
  .site-nav a[aria-current="page"] { border-bottom: 0; color: var(--accent); }
  .js .site-nav { display: none; }
  .js .site-nav.is-open {
    display: flex; flex-direction: column; flex-wrap: nowrap; align-items: stretch;
    gap: 0; padding: 8px 0 6px; max-height: calc(100vh - 70px); overflow-y: auto;
  }
  .js .site-nav.is-open a { border-top: 1px solid var(--hairline); }

  /* tall fixed-height photos */
  main img { max-height: 460px; }
  .home-hero__img { height: 520px !important; max-height: none; }
  .work-hero__img { height: 480px !important; max-height: none; max-width: none !important; }

  .home-hero__text { padding: 48px 24px 40px !important; gap: 22px !important; }
  .pad-card { padding: 36px 24px !important; }
  .org-divider { display: none !important; }

  /* timeline: year stacks above text */
  .tl-year { flex-basis: 100% !important; font-size: 26px !important; }

  /* accordions */
  .topic-panel { padding: 0 0 28px 0 !important; }
  .acc-btn { gap: 16px !important; }
  .topic-num { flex-basis: 28px !important; }
  .essay-btn { padding: 28px 0 !important; }
  .essay-kicker { flex-basis: 100% !important; padding-top: 0 !important; }

  .dl-link { display: inline-flex; align-items: center; min-height: 44px; }

  /* lens */
  .lens-card img, .lens-card__empty { height: 300px; }
  .lens-viewer__top { padding: 10px 16px; }
  .lens-viewer__title { font-size: 26px; }
  .lens-viewer__body { padding: 16px; }
  .lens-stage { height: min(52vh, 440px); }
  .lens-arrow { width: 44px; height: 44px; font-size: 24px; }
  .lens-arrow--prev { left: 8px; }
  .lens-arrow--next { right: 8px; }
  .lens-note { font-size: 19px; }
  .lens-story { font-size: 22px; }
  .lens-thumb img { width: 80px; height: 60px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* World map (Through My Lens) */
.lens-map-wrap { max-width: 1280px; margin: 0 auto; padding: 0 24px 72px; }
.lens-map { background: var(--panel); padding: 28px 24px; }
.lens-map__inner { position: relative; }
.lens-map__img { display: block; width: 100%; height: auto; }
.lens-pin {
  position: absolute; transform: translate(-50%, -50%);
  width: 44px; height: 44px; padding: 0; border: 0; background: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.lens-map .lens-pin { margin-left: 0; }
.lens-pin__dot {
  position: relative; width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 3px var(--white);
  transition: transform .2s ease;
}
.lens-pin__dot::after {
  content: ""; position: absolute; inset: -6px; border-radius: 50%;
  border: 2px solid var(--accent); opacity: 0; animation: lens-pulse 2.4s ease-out infinite;
}
.lens-pin:hover .lens-pin__dot, .lens-pin.is-active .lens-pin__dot, .lens-pin:focus-visible .lens-pin__dot { transform: scale(1.35); }
.lens-pin:focus-visible { outline: 2px solid var(--ink); outline-offset: -6px; border-radius: 50%; }
.lens-pin__label {
  position: absolute; top: 100%; left: 50%; transform: translate(-50%, -6px);
  font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink); white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .2s ease;
}
.lens-pin:hover .lens-pin__label, .lens-pin.is-active .lens-pin__label { opacity: 1; }
@keyframes lens-pulse { 0% { transform: scale(.6); opacity: .7; } 100% { transform: scale(1.8); opacity: 0; } }
.lens-map__card {
  position: absolute; z-index: 5; width: 280px; padding: 0 0 16px; border: 0; text-align: left;
  background: var(--white); color: var(--ink); cursor: pointer; font: inherit;
  box-shadow: 0 18px 40px rgba(26,26,26,.18); display: flex; flex-direction: column; gap: 6px;
}
.lens-map__card[hidden] { display: none; }
.lens-map__thumb { display: block; width: 100%; height: 180px; object-fit: cover; margin-bottom: 8px; }
.lens-map__meta { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 0 16px; }
.lens-map__name { font-family: var(--font-serif); font-weight: 600; font-size: 26px; line-height: 1.1; }
.lens-map__count { font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); white-space: nowrap; }
.lens-map__sub { padding: 0 16px; font-size: 14px; color: var(--muted); }
.lens-map__cta { padding: 4px 16px 0; font-size: 12px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--secondary); }
@media (prefers-reduced-motion: reduce) { .lens-pin__dot::after { animation: none; } }
@media (max-width: 700px) { .lens-map-wrap { display: none; } }
