/* ===========================
   Fonts
   =========================== */
@font-face {
  font-family: 'Nagel VF';
  src: url('fonts/nagel-vf/nagel_regular.woff') format('woff');
  font-weight: 100 900;
  font-display: swap;
}

/* ===========================
   Variables & Reset
   =========================== */
:root {
  --bg: rgb(252, 250, 242);
  --brand: rgb(254, 97, 2);
  --text: #181818;
  --focus: #1a73e8;
}

* { box-sizing: border-box; }

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Libre Franklin', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  margin: 0;
}

/* SR-only helper */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ===========================
   Navigation Bar
   =========================== */
nav,
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  flex-wrap: wrap;
  background-color: var(--bg);
  font-family: 'Nagel VF', sans-serif;
}

.brand-logo {
  height: 50px;
  flex-shrink: 0;
}

.menu {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(8px, 1.8vw, 24px);
  list-style: none;
  padding: 0;
  margin: 0;
}

.menu a {
  text-decoration: none;
  color: var(--brand);
  font-size: clamp(0.9rem, 1.4vw, 1.375rem);
  font-weight: 500;
}

.menu a:hover { text-decoration: underline; }

/* Keyboard focus */
a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Hamburger toggle (hidden on desktop) */
.nav-toggle {
  display: none;
  background: transparent;
  border: none;
  padding: 8px;
  cursor: pointer;
}
.nav-toggle .bar {
  display: block;
  width: 26px; height: 2px;
  margin: 6px 0;
  background: var(--brand);
}

/* ===========================
   Links
   =========================== */
a { color: var(--brand); }
a:hover { text-decoration: underline; }

/* ===========================
   Shared Headings
   =========================== */
h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 20px;
  line-height: 1.25;
  font-family: 'Libre Franklin', sans-serif;
}
h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 12px;
  line-height: 1.25;
  font-family: 'Libre Franklin', sans-serif;
}

/* ===========================
   Shared Content Wrapper
   =========================== */
.content {
  padding: 40px 24px;
  max-width: 1000px;
  margin: 0 auto;
}

/* ===========================
   Hero
   =========================== */
.hero {
  width: 100%;
  min-height: clamp(220px, 36vh, 520px);
  position: relative;
  overflow: hidden;
}
.hero img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

/* ===========================
   Homepage Gallery & Ticker
   =========================== */
.home .gallery { align-items: center !important; }
.home .featured { margin-left: auto; margin-right: auto; }
.home .ticker { margin-left: auto; margin-right: auto; }

.featured {
  position: relative;
  width: 1000px;
  height: 750px;
  overflow: hidden;
  border-radius: 12px;
  background: var(--bg);
  box-shadow: 0 3px 18px rgba(0,0,0,.08);
}

.featured > img,
.featured > video,
.featured .featured-media-link > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  background: var(--bg);
  border: 0;
  outline: 0;
}

.featured .featured-media-link {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--bg);
}

/* Caption overlay */
.featured .caption {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 8px 10px;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: 0.95rem;
  border-radius: 8px;
  max-width: calc(100% - 24px);
  z-index: 1;
}
.caption .cap-title { font-weight: 600; margin-right: .25em; }
.caption .cap-credit { opacity: .8; }
.featured--overlay .cap-link {
  color: #fff;
  text-decoration: underline;
}

/* Ticker strip */
.ticker {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
  scrollbar-width: thin;
  padding: 10px 10px 10px 0;
}

.ticker .thumbs {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center;
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  --thumb-w: 128px;
  --thumb-h: 106px;
}

.ticker .thumbs > .thumb {
  width: var(--thumb-w);
  height: var(--thumb-h);
  flex: 0 0 var(--thumb-w);
}

.ticker .thumbs img {
  display: block;
  width: var(--thumb-size, 128px) !important;
  height: var(--thumb-size, 96px) !important;
  object-fit: cover;
  border-radius: 8px;
  max-width: none !important;
}

.ticker .thumbs .thumb-btn {
  position: relative;
  padding: 0; margin: 0;
  border: 2px solid transparent;
  background: transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  transform-origin: center center;
  will-change: transform;
}
.ticker .thumbs .thumb-btn:focus-visible {
  outline: none;
  border-color: var(--focus);
}
.ticker .thumbs .thumb:hover .thumb-btn {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 6px 14px rgba(0,0,0,.12);
}
.ticker .thumbs .thumb:hover img {
  transform: none;
  box-shadow: none;
  filter: grayscale(0%);
}
.ticker .thumbs .thumb:hover { z-index: 2; }

.ticker .thumbs .thumb.active .thumb-btn {
  border-color: var(--brand);
}
.ticker .thumbs .thumb.active img {
  filter: grayscale(0%);
  box-shadow: 0 6px 14px rgba(0,0,0,.12);
}

/* Play badge on video thumbs */
.ticker .thumbs .play-badge {
  position: absolute;
  right: 8px; bottom: 8px;
  width: 24px; height: 24px;
  border-radius: 999px;
  background: rgba(0,0,0,0.65);
  display: inline-block;
}
.ticker .thumbs .play-badge::before {
  content: "";
  position: absolute;
  left: 9px; top: 6px;
  border-left: 8px solid #fff;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
}

/* Edge fades (appear only when scrollable) */
.ticker::before,
.ticker::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  width: 40px;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity .2s ease;
}
.ticker::before {
  left: 0;
  background: linear-gradient(to right, var(--bg) 0%, transparent 100%);
}
.ticker::after {
  right: 0;
  background: linear-gradient(to left, var(--bg) 0%, transparent 100%);
}
.ticker.has-left::before { opacity: 1; }
.ticker.has-right::after { opacity: 1; }

/* ===========================
   Publication List
   =========================== */
.publication-list {
  display: flex;
  flex-direction: column;
  gap: 30px;
  margin-top: 40px;
}
.publication-item {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}
.publication-item img {
  width: 120px;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
}
.publication-text p {
  margin: 5px 0 0;
  font-size: 1rem;
}

/* ===========================
   News Archive List
   =========================== */
.news-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 30px;
}
.news-item {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  text-decoration: none;
  color: var(--text);
  padding: 16px;
  border-radius: 8px;
  transition: background 0.15s;
}
.news-item:hover { background: rgba(254,97,2,0.05); }
.news-item img {
  width: 160px;
  height: 100px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}
.news-text h2 {
  margin: 0 0 4px;
  font-size: 1.1rem;
}
.news-item:hover h2 { color: var(--brand); }
.news-date {
  margin: 0;
  font-size: 0.85rem;
  color: #888;
}
.news-desc {
  margin: 6px 0 0;
  font-size: 0.9rem;
  color: #666;
}

/* ===========================
   People Page
   =========================== */
.profile-heading {
  font-family: 'Libre Franklin', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.thumbnail-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-bottom: 40px;
}
.person { text-align: center; }
.person-thumb {
  width: 80px; height: 80px;
  border-radius: 50%;
  object-fit: cover;
  filter: grayscale(100%);
  cursor: pointer;
}
.person-name { font-size: 0.875rem; margin-top: 4px; }

.profile-display {
  display: flex;
  align-items: flex-start;
  gap: 40px;
}
.profile-image img {
  width: 200px; height: 200px;
  border-radius: 50%;
  object-fit: cover;
}

/* ===========================
   Post Pages
   =========================== */
.post,
.post-nav {
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
}
.post { margin-bottom: 60px; }
.post-nav { margin-top: 0; margin-bottom: 8px; }

/* Title, image, body, extras share the same left edge */
.post__header,
.post__cover,
.post__body,
.post__extras {
  margin-left: 0;
  margin-right: 0;
  padding-left: 0;
  padding-right: 0;
}
.post__cover { margin-top: 10px; margin-bottom: 14px; }

/* Kill default figure margins */
.post figure,
.post__cover,
.post__extras figure { margin: 0; }

/* Post images: bounded by column, no upscaling, centered, rounded */
.post .post__cover img,
.post .post__body img,
.post .post__extras img {
  display: block;
  max-width: 100%;
  width: auto;
  height: auto;
  margin-left: auto;
  margin-right: auto;
  border-radius: 12px;
}

/* Prev / Next navigation pills */
.post-nav__btn,
.post-nav__btn:link,
.post-nav__btn:visited {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.12);
  background: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--brand);
  transition: box-shadow .2s ease, background .2s ease;
}
.post-nav__btn:hover,
.post-nav__btn:focus-visible {
  background: rgba(254,97,2,.06);
  box-shadow: 0 4px 10px rgba(0,0,0,.08);
  text-decoration: none;
}

/* ===========================
   Resources Page
   =========================== */
.resources-wrap {
  max-width: 1000px;
  margin: 40px auto;
  padding: 5px 24px;
}
.resources-list { display: grid; gap: 20px; }
.resource-item {
  display: grid;
  grid-template-columns: minmax(120px, 20%) 1fr;
  align-items: center;
  gap: 16px;
  background: #fff;
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 12px;
  padding: 16px;
}
.resource-icon {
  width: 100%;
  max-width: 160px;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  display: block;
  border-radius: 8px;
}
.resource-text h2 { margin: 0 0 6px 0; font-size: 1.2rem; }
.resource-text h2 a { color: var(--brand); text-decoration: none; }
.resource-text h2 a:hover { text-decoration: underline; }
.lock-badge {
  font-size: 0.85em;
  opacity: 0.7;
  margin-left: 4px;
  color: #888;
}
.resource-text p { margin: 0; opacity: .9; }

/* ===========================
   Footer
   =========================== */
.site-footer {
  margin-top: 60px;
  padding: 24px 20px;
  border-top: 1px solid #e5e3dc;
  font-size: 0.85rem;
  color: #888;
}
.footer-inner {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.site-footer a {
  color: var(--brand);
  text-decoration: none;
}
.site-footer a:hover { text-decoration: underline; }
.footer-links {
  display: flex;
  gap: 14px;
  align-items: center;
}
.footer-links a {
  color: #888;
  transition: color 0.15s;
}
.footer-links a:hover { color: var(--brand); }

/* ===========================
   Responsive Breakpoints
   =========================== */
@media (max-width: 1000px) {
  .featured {
    width: 90%;
    height: auto;
    aspect-ratio: 4 / 3;
    background: var(--bg);
  }
  .ticker { max-width: 90%; }
}

@media (max-width: 900px) {
  .nav-toggle { display: inline-block; }
  .menu {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    margin-top: 12px;
    display: none;
    gap: 0;
    border-top: 1px solid #e5e3dc;
    padding-top: 8px;
  }
  .menu.open { display: flex; }
  .menu li { width: 100%; }
  .menu a {
    display: block;
    padding: 10px 4px;
    font-size: 1.05rem;
    border-bottom: 1px solid #f0eee6;
  }
}

@media (max-width: 768px) {
  .publication-item {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .profile-display {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

@media (max-width: 720px) {
  .resource-item { grid-template-columns: 1fr; }
  .resource-icon { max-width: 120px; }
}

@media (max-width: 600px) {
  .news-item { flex-direction: column; }
  .news-item img { width: 100%; height: auto; max-height: 200px; }
}

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