/* ============================================================
   Vietnam School of Science — Year Pages Blue & White Theme
   ============================================================ */

:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f0f4f8;
  --bg-card: #f7f9fc;
  --bg-elevated: #ffffff;
  --text-primary: #0f1d35;
  --text-secondary: #3d5271;
  --text-muted: #8096b0;
  --accent: #1a56db;
  --accent-hover: #1545b5;
  --accent-light: #dbeafe;
  --accent-lighter: #eff6ff;
  --blue-dark: #0f2b5b;
  --blue-mid: #2563eb;
  --blue-light: #60a5fa;
  --border: rgba(15, 45, 90, 0.1);
  --border-strong: rgba(15, 45, 90, 0.2);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow: 0 8px 30px rgba(15, 45, 90, 0.08);
  --max-w: 1200px;
  --gutter: clamp(1rem, 4vw, 2.5rem);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }

/* ─── Year page content ───────────────────────── */
.yr-page { max-width: 1000px; margin: 0 auto; padding: 2rem var(--gutter) 4rem; }
.yr-header { margin-bottom: 2rem; }
.yr-badge {
  display: inline-block;
  background: var(--accent); color: #ffffff;
  font-size: .75rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  padding: .25rem .7rem; border-radius: 999px; margin-bottom: .75rem;
}
.yr-header h1 { margin: .25rem 0 .5rem; font-size: 2.2rem; color: var(--text-primary); font-weight: 800; letter-spacing: -0.02em; }
.yr-theme { font-size: 1.1rem; color: var(--accent); font-style: italic; margin-bottom: .5rem; }

.yr-meta { display: flex; gap: 1.25rem; flex-wrap: wrap; margin-top: .5rem; }
.meta-item {
  display: flex; align-items: center; gap: .35rem;
  font-size: .875rem; color: var(--text-muted);
}
.meta-item svg { width: 13px; height: 13px; flex-shrink: 0; fill: currentColor; }

/* Shape hero (no images) */
.yr-shape-hero {
  position: relative; height: 220px; border-radius: var(--radius-md);
  overflow: hidden; background: linear-gradient(135deg, #0f2b5b 0%, #1a56db 50%, #2563eb 100%);
  margin-bottom: 2rem;
}
.yr-shape-hero .shape { position: absolute; border-radius: 50%; opacity: .2; }
.yr-shape-hero .shape--a { width: 180px; height: 180px; background: #60a5fa; top: -40px; left: -40px; }
.yr-shape-hero .shape--b { width: 140px; height: 140px; background: #93c5fd; bottom: -30px; left: 35%; }
.yr-shape-hero .shape--c { width: 110px; height: 110px; background: rgba(255,255,255,0.2); top: 20px; right: 10%; }

/* Sections */
.yr-section { margin: 2rem 0; }
.yr-section h2 { font-size: 1.35rem; color: var(--text-primary); margin: 0 0 1rem; border-bottom: 2px solid var(--accent); padding-bottom: .35rem; display: inline-block; }
.yr-intro p { font-size: 1.05rem; line-height: 1.8; color: var(--text-secondary); }

/* Stats */
.stat-row { display: flex; gap: 1.25rem; flex-wrap: wrap; margin: 1rem 0; }
.stat-card {
  flex: 1 1 120px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 1.25rem 1rem;
  text-align: center;
}
.stat-num { font-size: 2rem; font-weight: 800; color: var(--accent); line-height: 1; }
.stat-label { font-size: .8rem; color: var(--text-muted); margin-top: .35rem; }

/* Note box */
.note-box {
  background: var(--accent-lighter);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 1rem 1.25rem; margin: 1.5rem 0;
  color: var(--text-secondary); font-size: .9rem;
}
.note-icon { margin-right: .4rem; }

/* Sponsors */
.sponsor-list { list-style: none; padding: 0; margin: 0; }
.sponsor-list li { padding: .4rem 0; border-bottom: 1px solid var(--border); font-size: .9rem; color: var(--text-secondary); }
.sponsor-list li:last-child { border-bottom: none; }

/* Schedule */
.day-block { margin-bottom: 2.5rem; }
.day-heading { font-size: 1.15rem; color: var(--text-primary); margin: 0 0 .25rem; }
.day-label { font-weight: 700; }
.day-date { font-weight: 400; color: var(--text-muted); }
.day-theme { font-size: .9rem; color: var(--accent); font-weight: 600; margin-bottom: .75rem; }
.yr-theme-banner {
  background: linear-gradient(135deg, #0f2b5b, #1a56db);
  color: #ffffff; padding: 1rem 1.5rem;
  border-radius: var(--radius-md); border: 1px solid var(--border);
  font-size: 1.1rem; font-style: italic; margin-bottom: 2rem;
}
.sched-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.sched-table thead th { background: var(--blue-dark); color: #ffffff; text-align: left; padding: .5rem .75rem; font-size: .8rem; letter-spacing: .04em; }
.sched-table tbody tr { border-bottom: 1px solid var(--border); }
.sched-table td { padding: .55rem .75rem; vertical-align: top; color: var(--text-secondary); }
.s-time { white-space: nowrap; color: var(--text-muted); font-size: .8rem; width: 110px; }
.s-speaker { color: var(--accent); font-size: .82rem; width: 220px; }
.srow--break td { background: rgba(26,86,219,.04); color: var(--text-muted); font-size: .82rem; }
.srow--ceremony td { background: rgba(26,86,219,.08); font-weight: 600; }
.srow--discussion td { background: rgba(96,165,250,.06); }
.srow--activity td { background: rgba(37,99,235,.04); font-style: italic; }
.sched-img { margin: .5rem 0; border-radius: var(--radius-sm); overflow: hidden; }
.sched-img img { width: 100%; display: block; }

/* Venue */
.venue-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.75rem; }
.venue-card h2 { margin-top: 0; color: var(--text-primary); }
.venue-addr { color: var(--text-muted); font-size: .95rem; margin: .5rem 0 1rem; }
.venue-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.25rem; }
.map-btn {
  display: inline-block; padding: .6rem 1.2rem;
  border-radius: 999px; background: var(--accent); color: #ffffff;
  text-decoration: none; font-size: .875rem; font-weight: 600; transition: opacity .2s;
}
.map-btn:hover { opacity: .85; }
.map-btn.outline { background: transparent; border: 1.5px solid var(--border-strong); color: var(--text-primary); }
.map-btn.outline:hover { border-color: var(--accent); color: var(--accent); }

/* Lecturers */
.lc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }
.lc-card {
  display: flex; gap: 1rem;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 1.1rem;
  align-items: flex-start; transition: border-color .2s;
}
.lc-card:hover { border-color: var(--border-strong); }
.lc-photo { flex-shrink: 0; width: 72px; height: 72px; border-radius: 50%; overflow: hidden; }
.lc-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lc-photo--placeholder { background: linear-gradient(135deg, var(--accent), var(--blue-light)); display: flex; align-items: center; justify-content: center; }
.lc-initials { color: #ffffff; font-size: 1.15rem; font-weight: 700; }
.lc-name { margin: 0 0 .2rem; font-size: .95rem; color: var(--text-primary); font-weight: 600; }
.lc-affil { font-size: .8rem; color: var(--accent); margin-bottom: .4rem; }
.lc-bio { font-size: .8rem; color: var(--text-muted); margin: 0; line-height: 1.5; }
.org-list { list-style: none; padding: 0; margin: 0; }
.org-list li { padding: .35rem 0; border-bottom: 1px solid var(--border); font-size: .9rem; color: var(--text-secondary); }
.org-list li:last-child { border-bottom: none; }

/* Gallery (kept but styled for dark) */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.gallery-item { margin: 0; border-radius: var(--radius-md); overflow: hidden; }
.gallery-item img { width: 100%; display: block; object-fit: cover; }

/* Hero image (kept but may not be used) */
.yr-hero-img { margin: 0 0 2rem; border-radius: var(--radius-md); overflow: hidden; }
.yr-hero-img img { width: 100%; display: block; object-fit: cover; max-height: 420px; }
.yr-hero-img figcaption { font-size: .8rem; color: var(--text-muted); text-align: center; padding: .4rem; }

@media (max-width: 640px) {
  .yr-header h1 { font-size: 1.6rem; }
  .lc-grid { grid-template-columns: 1fr; }
  .sched-table { font-size: .78rem; }
  .s-speaker { display: none; }
  .stat-row { justify-content: center; }
}

/* ─── Year page shared header ─────────────────── */
.yr-site-header {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(15, 45, 90, 0.06);
  position: sticky; top: 0; z-index: 90;
}
.yr-site-header .header-wrap {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.75rem 1.4rem; max-width: var(--max-w); margin: 0 auto;
}
.yr-site-header .brand {
  display: flex; align-items: center; gap: 0.55rem;
  text-decoration: none; color: var(--blue-dark);
  font-weight: 800; flex-shrink: 0; font-size: 1.2rem;
  letter-spacing: -0.02em;
}
.yr-site-header .brand .logo-img {
  height: 36px; width: auto; display: block;
  flex-shrink: 0;
}
.yr-site-header .brand .logo-text {
  font-weight: 800; font-size: 1.1rem; letter-spacing: -0.02em; color: var(--blue-dark);
}

/* Desktop top nav */
.yr-top-nav {
  display: none; margin-left: auto;
  align-items: center; gap: 0.25rem;
}
.yr-top-nav a,
.yr-dropdown-btn {
  display: inline-block; padding: 0.45rem 0.65rem;
  font-size: 0.88rem; font-weight: 500;
  color: var(--text-secondary); text-decoration: none;
  border-radius: var(--radius-sm); background: none;
  border: none; cursor: pointer; white-space: nowrap;
  font-family: inherit; transition: color .15s;
}
.yr-top-nav a:hover,
.yr-dropdown-btn:hover { color: var(--accent); background: var(--accent-lighter); }
.yr-top-nav a.active { color: var(--accent); font-weight: 600; }
.yr-dropdown { position: relative; display: inline-block; }
.yr-dropdown-menu {
  display: none; position: absolute; right: 0;
  top: calc(100% + 4px);
  background: #ffffff; border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow);
  padding: 0.4rem; list-style: none; margin: 0;
  min-width: 120px; max-height: 70vh; overflow-y: auto;
  z-index: 100; columns: 2; column-gap: 0;
}
.yr-dropdown-menu.open,
.yr-dropdown:hover .yr-dropdown-menu,
.yr-dropdown:focus-within .yr-dropdown-menu { display: block; }
.yr-dropdown-menu li { break-inside: avoid; }
.yr-dropdown-menu a {
  display: block; padding: 0.3rem 0.6rem;
  font-size: 0.85rem; color: var(--text-secondary);
  text-decoration: none; border-radius: 5px; white-space: nowrap;
  transition: color .15s;
}
.yr-dropdown-menu a:hover { background: var(--accent-lighter); color: var(--accent); }
.yr-dropdown-menu li.active a { color: var(--accent); font-weight: 600; }

/* Hamburger for year pages */
.yr-menu-btn {
  display: block; margin-left: auto;
  background: none; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.35rem 0.7rem;
  font-size: 1rem; cursor: pointer;
  color: var(--text-primary); font-family: inherit;
}

/* Mobile nav */
.yr-mobile-nav {
  padding: 0.5rem 1rem 1rem;
  display: none; flex-direction: column; gap: 0.25rem;
  border-top: 1px solid var(--border);
  background: #ffffff;
}
.yr-mobile-nav[aria-hidden="false"],
.yr-mobile-nav:not([hidden]) {
  display: flex;
}
.yr-mobile-nav a {
  padding: 0.45rem 0.5rem; color: var(--text-secondary);
  text-decoration: none; font-size: 0.9rem;
  border-radius: var(--radius-sm); transition: color .15s;
}
.yr-mobile-nav a:hover { background: var(--accent-lighter); color: var(--accent); }
.yr-mobile-nav details > ul {
  list-style: none; margin: 0.25rem 0 0 1rem; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.15rem;
}
.yr-mobile-nav details summary {
  padding: 0.45rem 0.5rem; color: var(--text-secondary);
  font-size: 0.9rem; cursor: pointer; list-style: none;
}
.yr-mobile-nav details summary::-webkit-details-marker { display: none; }
.yr-mobile-nav details a {
  display: block; font-size: 0.82rem; padding: 0.3rem 0.4rem;
}

/* Footer for year pages */
.site-footer {
  border-top: 1px solid var(--border); margin-top: 2rem;
  color: var(--text-secondary); font-size: 0.88rem;
}
.footer-wrap {
  max-width: var(--max-w); margin: 0 auto;
  padding: 2rem var(--gutter); color: var(--text-muted); font-size: 0.88rem;
}
.footer-wrap p { margin: 0.2rem 0; }
.footer-wrap strong { color: var(--text-primary); }

@media (min-width: 860px) {
  .yr-top-nav { display: flex; }
  .yr-menu-btn { display: none; }
}

/* ─── Photo card ───────────────────────────────── */
.photo-card {
  display: inline-block; max-width: 100%;
  background: var(--bg-secondary);
  border-radius: 1.25rem;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(15,43,91,0.10);
  border: 1px solid var(--border);
}
.photo-card img {
  display: block; max-width: 100%; height: auto;
}
.photo-card figcaption {
  padding: 0.75rem 1.1rem;
  font-size: 0.875rem; color: var(--text-secondary); line-height: 1.5;
}
.photo-card--full { display: block; width: 100%; }
.photo-card--full img { width: 100%; object-fit: cover; max-height: 480px; }

/* ─── Bilingual block ──────────────────────────── */
.bilingual-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 0.75rem;
}
@media (max-width: 680px) {
  .bilingual-block { grid-template-columns: 1fr; }
}
.bilingual-block__en,
.bilingual-block__vi {
  padding: 1rem 1.15rem;
  border-radius: var(--radius-md);
  font-size: 0.93rem;
  line-height: 1.65;
}
.bilingual-block__en {
  background: #eef3fb;
  border-left: 3px solid var(--accent);
}
.bilingual-block__vi {
  background: #fff8ec;
  border-left: 3px solid #f59e0b;
}
.bilingual-block__en p,
.bilingual-block__vi p { margin: 0 0 0.65rem; }
.bilingual-block__en p:last-child,
.bilingual-block__vi p:last-child { margin-bottom: 0; }

/* Secondary text on info-cards (Vietnamese caption) */
.info-card__vi {
  font-size: 0.83rem;
  color: var(--text-secondary);
  margin-top: 0.4rem;
  padding-top: 0.4rem;
  border-top: 1px solid var(--border);
  line-height: 1.5;
  font-style: italic;
}

/* ─── Timeline ─────────────────────────────────── */
.timeline {
  list-style: none;
  padding: 0; margin: 1rem 0 0;
  border-left: 2px solid var(--border);
  padding-left: 1.5rem;
}
.timeline__item {
  position: relative;
  margin-bottom: 2rem;
}
.timeline__item::before {
  content: "";
  position: absolute;
  left: -1.85rem;
  top: 0.35rem;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--accent);
}
.timeline__year {
  display: inline-block;
  font-size: 0.78rem; font-weight: 800;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.3rem;
}
.timeline__body strong { display: block; font-size: 1rem; font-weight: 700; margin-bottom: 0.3rem; }
.timeline__body p { font-size: 0.92rem; color: var(--text-secondary); margin: 0 0 0.3rem; line-height: 1.6; }
.timeline__vi { font-size: 0.85rem; color: var(--text-secondary); font-style: italic; }

/* ─── FAQ accordion ────────────────────────────── */
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  margin-bottom: 0.6rem;
  overflow: hidden;
  transition: border-color 0.2s;
}
.faq-item:hover { border-color: var(--accent); }
.faq-item summary {
  padding: 0.9rem 1.1rem;
  font-weight: 600; font-size: 0.97rem;
  cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; align-items: center;
  color: var(--text-primary, #111827);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-size: 1.2rem; font-weight: 400; color: var(--accent);
  transition: transform 0.2s;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item > p, .faq-item > div {
  padding: 0 1.1rem 1rem;
  font-size: 0.92rem; color: var(--text-secondary); line-height: 1.6;
  margin: 0;
}
/* bilingual-block used directly inside faq-item: override padding */
.faq-item > .bilingual-block,
.faq-item > .faq-bilingual {
  padding: 0.5rem 1.1rem 1rem;
  margin-top: 0;
}
.faq-bilingual .bilingual-block__en,
.faq-bilingual .bilingual-block__vi {
  font-size: 0.92rem;
  line-height: 1.6;
}

/* ─── Card grid ────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-top: 1.25rem;
}

/* ─── Info card (reused from home) ─────────────── */
.info-card {
  border-radius: var(--radius-md); border: 1px solid var(--border);
  padding: 1.2rem; background: var(--bg-secondary);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.info-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(26,86,219,0.1); }
.info-card h4 { font-size: 1rem; font-weight: 700; margin-bottom: 0.4rem; }
.info-card p { font-size: 0.92rem; color: var(--text-secondary); line-height: 1.55; }

/* ─── Person card ──────────────────────────────── */
.person-card {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.person-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(26,86,219,0.12);
}

/* Photo area — shows placeholder when img is missing/blank */
.person-card__photo {
  width: 100%; aspect-ratio: 4/3;
  background: #dde4f0;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; position: relative;
}
/* Silhouette icon placeholder */
.person-card__photo::before {
  content: "";
  display: block;
  width: 72px; height: 72px;
  border-radius: 50%;
  background: #b3bfd6 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23f0f3f9'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 20c0-4 3.6-7 8-7s8 3 8 7'/%3E%3C/svg%3E") center 40%/56px no-repeat;
  flex-shrink: 0;
}
.person-card__photo img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  transition: opacity 0.2s;
}
/* Hide img when src is empty so placeholder shows */
.person-card__photo img[src=""],
.person-card__photo img:not([src]) {
  opacity: 0;
}

.person-card__body { padding: 1rem 1.1rem 1.2rem; }
.person-card__name { font-size: 1rem; font-weight: 700; margin: 0 0 0.2rem; color: var(--text-primary, #111827); }
.person-card__role { font-size: 0.82rem; font-weight: 600; color: var(--accent); margin: 0 0 0.55rem; text-transform: uppercase; letter-spacing: 0.04em; }
.person-card__bio  { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.55; margin: 0; }
