/* ===========================
   Google Fonts
   =========================== */
@import url('https://fonts.googleapis.com/css2?family=Lora:wght@400;600;700&family=Inter:wght@400;500;600;700&display=swap');

/* ===========================
   Custom Properties
   =========================== */
:root {
  --color-navy:       #003087;
  --color-navy-dark:  #002060;
  --color-gold:       #C9A84C;
  --color-gold-dark:  #a8872d;
  --color-white:      #ffffff;
  --color-off-white:  #F7F7F7;
  --color-text:       #1a1a1a;
  --color-text-muted: #555555;
  --color-muted:      #888888;
  --color-border:     #dde3ea;

  --font-heading: 'Lora', Georgia, serif;
  --font-body:    'Inter', system-ui, -apple-system, sans-serif;

  --fs-xs:   0.8rem;
  --fs-sm:   0.9rem;
  --fs-base: 1rem;
  --fs-lg:   1.125rem;
  --fs-xl:   1.35rem;
  --fs-2xl:  1.75rem;
  --fs-3xl:  2.25rem;
  --fs-4xl:  3rem;

  --space-xs:  0.5rem;
  --space-sm:  1rem;
  --space-md:  1.5rem;
  --space-lg:  2rem;
  --space-xl:  3rem;
  --space-2xl: 5rem;

  --section-pad: 5rem;
  --radius:      8px;
  --radius-sm:   4px;
  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.08);
  --nav-height:  68px;
  --max-width:   1140px;
}

/* ===========================
   Reset
   =========================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-white);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-navy);
  text-decoration: underline;
}

a:hover {
  color: var(--color-gold-dark);
}

ul {
  list-style: none;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  line-height: 1.25;
}

/* ===========================
   Navigation
   =========================== */
#navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--color-navy);
  color: var(--color-white);
  height: var(--nav-height);
  display: flex;
  align-items: center;
  padding: 0 var(--space-lg);
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.nav-inner {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--color-white);
}

.nav-brand img {
  height: 40px;
  width: auto;
}

.nav-brand-name {
  font-family: var(--font-heading);
  font-size: var(--fs-lg);
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--color-white);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.nav-links a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: var(--fs-sm);
  font-weight: 500;
  padding: 0.25rem 0.1rem;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--color-gold);
  border-bottom-color: var(--color-gold);
}

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-white);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}

/* Mobile nav open */
.nav-open .nav-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-open .nav-toggle span:nth-child(2) {
  opacity: 0;
}
.nav-open .nav-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ===========================
   Hero
   =========================== */
#hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background-image: url('../images/hero.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: var(--color-white);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 30, 70, 0.65);
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: var(--space-lg);
  max-width: 820px;
}

.hero-chinese {
  font-family: var(--font-heading);
  font-size: var(--fs-xl);
  color: var(--color-gold);
  margin-bottom: var(--space-sm);
  display: block;
  letter-spacing: 0.05em;
}

.hero-content h1 {
  font-size: var(--fs-3xl);
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: var(--space-sm);
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.hero-tagline {
  font-size: var(--fs-lg);
  color: rgba(255,255,255,0.9);
  margin-bottom: var(--space-xl);
}

/* ===========================
   Buttons
   =========================== */
.btn {
  display: inline-block;
  background: var(--color-gold);
  color: var(--color-navy);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  font-weight: 700;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  line-height: 1.4;
}

.btn:hover {
  background: var(--color-gold-dark);
  color: var(--color-navy);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--color-gold);
  color: var(--color-gold);
}

.btn-outline:hover {
  background: var(--color-gold);
  color: var(--color-navy);
}

/* ===========================
   Sections — shared
   =========================== */
.section {
  padding: var(--section-pad) var(--space-lg);
}

.section-white {
  background: var(--color-white);
}

.section-grey {
  background: var(--color-off-white);
}

.section-navy {
  background: var(--color-navy);
  color: var(--color-white);
}

.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-heading {
  font-size: var(--fs-2xl);
  color: var(--color-navy);
  margin-bottom: 0.5rem;
}

.section-navy .section-heading {
  color: var(--color-white);
}

.section-lead {
  font-size: var(--fs-lg);
  color: var(--color-text-muted);
  margin-bottom: var(--space-xl);
  max-width: 680px;
}

.section-navy .section-lead {
  color: rgba(255,255,255,0.8);
}

.section-divider {
  width: 56px;
  height: 3px;
  background: var(--color-gold);
  margin: 0.75rem 0 var(--space-xl);
  border: none;
}

/* ===========================
   Cards (events & gallery)
   =========================== */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}

.card {
  background: var(--color-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  border-top: 4px solid var(--color-gold);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card-img-wrap {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  background: #c8cdd3;
  overflow: hidden;
}

.card-img-wrap img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Photo-coming-soon overlay */
.card-img-wrap .photo-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #c8cdd3;
  color: #666;
  font-size: var(--fs-sm);
  font-style: italic;
  text-align: center;
  padding: var(--space-sm);
}

.card-img-wrap img.broken {
  display: none;
}

.card-body {
  padding: var(--space-md);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-title {
  font-family: var(--font-heading);
  font-size: var(--fs-xl);
  color: var(--color-navy);
  margin-bottom: 0.25rem;
}

.card-subtitle {
  font-size: var(--fs-sm);
  color: var(--color-gold-dark);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.card-date {
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
  margin-bottom: 0.75rem;
}

.card-desc {
  font-size: var(--fs-base);
  color: var(--color-text);
  flex: 1;
}

.events-cta {
  margin-top: var(--space-xl);
  text-align: center;
}

/* ===========================
   About section
   =========================== */
.about-text {
  max-width: 780px;
  font-size: var(--fs-lg);
  line-height: 1.8;
  color: var(--color-text);
}

/* ===========================
   Find a classmate
   =========================== */
.find-classmate-text {
  max-width: 640px;
  font-size: var(--fs-lg);
  margin-bottom: var(--space-lg);
  color: var(--color-text);
}

/* ===========================
   Useful Links
   =========================== */
.links-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}

.links-card {
  background: var(--color-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  border-top: 4px solid var(--color-gold);
  padding: var(--space-md);
}

.links-card h3 {
  font-family: var(--font-heading);
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--color-navy);
  margin-bottom: var(--space-sm);
}

.links-card ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.links-card ul li a {
  color: var(--color-navy);
  font-size: var(--fs-base);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, color 0.2s;
}

.links-card ul li a:hover {
  color: var(--color-gold-dark);
  border-bottom-color: var(--color-gold);
}

.links-placeholder {
  color: var(--color-muted);
  font-style: italic;
  font-size: var(--fs-base);
}

/* ===========================
   Contact / Get Involved
   =========================== */
.contact-blocks {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.contact-block {
  background: rgba(255,255,255,0.08);
  border-radius: var(--radius);
  padding: var(--space-md);
  border: 1px solid rgba(255,255,255,0.15);
}

.contact-block-icon {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
  display: block;
}

.contact-block h3 {
  font-family: var(--font-heading);
  font-size: var(--fs-lg);
  color: var(--color-gold);
  margin-bottom: 0.4rem;
}

.contact-block p {
  color: rgba(255,255,255,0.85);
  font-size: var(--fs-base);
}

.contact-email {
  font-size: var(--fs-lg);
  color: var(--color-white);
}

.contact-email a {
  color: var(--color-gold);
  text-decoration: none;
  border-bottom: 1px solid var(--color-gold);
  transition: color 0.2s;
}

.contact-email a:hover {
  color: var(--color-gold-dark);
}

/* ===========================
   Footer
   =========================== */
footer {
  background: var(--color-navy);
  color: rgba(255,255,255,0.8);
  padding: var(--space-2xl) var(--space-lg) var(--space-lg);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-brand img {
  height: 60px;
  width: auto;
  object-fit: contain;
}

.footer-brand-name-en {
  font-family: var(--font-heading);
  font-size: var(--fs-base);
  color: var(--color-white);
  font-weight: 700;
}

.footer-brand-name-zh {
  font-size: var(--fs-sm);
  color: rgba(255,255,255,0.65);
}

.footer-nav h4,
.footer-contact h4 {
  font-family: var(--font-heading);
  font-size: var(--fs-base);
  color: var(--color-gold);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.footer-nav ul {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.footer-nav ul li a {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: var(--fs-sm);
  transition: color 0.2s;
}

.footer-nav ul li a:hover {
  color: var(--color-gold);
}

.footer-contact p {
  font-size: var(--fs-sm);
  color: rgba(255,255,255,0.75);
  margin-bottom: 0.4rem;
}

.footer-contact a {
  color: var(--color-gold);
  text-decoration: none;
}

.footer-contact a:hover {
  color: var(--color-gold-dark);
}

.footer-bottom {
  max-width: var(--max-width);
  margin: var(--space-xl) auto 0;
  padding-top: var(--space-sm);
  border-top: 1px solid rgba(255,255,255,0.15);
  font-size: var(--fs-xs);
  color: rgba(255,255,255,0.5);
  text-align: center;
}

/* ===========================
   Inner page hero (non-home)
   =========================== */
.page-hero {
  background: var(--color-navy);
  color: var(--color-white);
  padding: var(--space-2xl) var(--space-lg) var(--space-xl);
  text-align: center;
}

.page-hero h1 {
  font-size: var(--fs-3xl);
  color: var(--color-white);
  margin-bottom: 0.5rem;
}

.page-hero p {
  font-size: var(--fs-lg);
  color: rgba(255,255,255,0.8);
  max-width: 640px;
  margin: 0 auto;
}

/* ===========================
   Gallery page
   =========================== */
.gallery-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}

.gallery-card {
  background: var(--color-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  border-top: 4px solid var(--color-gold);
  overflow: hidden;
}

.gallery-card .card-img-wrap {
  padding-top: 62%;
  cursor: pointer;
}

.gallery-card-body {
  padding: var(--space-md);
}

.gallery-card-body h3 {
  font-family: var(--font-heading);
  font-size: var(--fs-xl);
  color: var(--color-navy);
  margin-bottom: 0.25rem;
}

.gallery-card-body .card-date {
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
}

/* ===========================
   Lightbox
   =========================== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox-img {
  max-width: 95vw;
  max-height: 95vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
  display: block;
}

.lightbox-close {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background: rgba(0, 0, 0, 0.55);
  border: 2px solid rgba(255, 255, 255, 0.55);
  color: var(--color-white);
  font-size: 1.4rem;
  line-height: 1;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2001;
  transition: background 0.15s, border-color 0.15s;
  font-family: var(--font-body);
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.9);
}

.lightbox-close:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 3px;
}

/* ===========================
   Directory page
   =========================== */
.year-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: var(--space-xl);
}

.year-btn {
  padding: 0.4rem 1rem;
  background: var(--color-white);
  border: 2px solid var(--color-navy);
  color: var(--color-navy);
  font-size: var(--fs-sm);
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.year-btn:hover,
.year-btn.active {
  background: var(--color-navy);
  color: var(--color-white);
}

.year-group {
  margin-bottom: var(--space-xl);
  scroll-margin-top: calc(var(--nav-height) + 1.5rem);
}

.year-group-heading {
  font-family: var(--font-heading);
  font-size: var(--fs-2xl);
  color: var(--color-navy);
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-gold);
  margin-bottom: var(--space-md);
}

.year-group.highlighted .year-group-heading {
  color: var(--color-gold-dark);
}

.directory-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-sm);
}

.directory-card {
  background: var(--color-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-sm);
  border-left: 4px solid var(--color-gold);
}

.directory-card-info h3 {
  font-family: var(--font-heading);
  font-size: var(--fs-lg);
  color: var(--color-navy);
}

.directory-card-info .card-meta {
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
}

.directory-card-action a {
  color: var(--color-text-muted);
  font-size: var(--fs-sm);
  text-decoration: none;
  word-break: break-all;
}

/* ===========================
   Responsive — 768px
   =========================== */
@media (min-width: 768px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .links-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .contact-blocks {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-inner {
    grid-template-columns: 2fr 1fr 1fr;
  }

  .directory-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-content h1 {
    font-size: var(--fs-4xl);
  }
}

/* ===========================
   Responsive — 1024px
   =========================== */
@media (min-width: 1024px) {
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .contact-blocks {
    grid-template-columns: repeat(3, 1fr);
  }

  .directory-cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ===========================
   Mobile nav
   =========================== */
@media (max-width: 767px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--color-navy-dark);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .nav-links a {
    padding: 0.85rem var(--space-lg);
    width: 100%;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    font-size: var(--fs-base);
  }

  .nav-open .nav-links {
    max-height: 400px;
  }

  #navbar {
    position: sticky;
    overflow: visible;
  }
}

/* ===========================
   Utilities
   =========================== */
.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;
}
