/* ============================================================
   ICCABS 2027 — main stylesheet
   Matches the live Google Sites design:
   - transparent header over full-bleed photo banners (white text)
   - home banner 540px w/ 4 centered lines; inner banners 340px w/ thin title
   - 1140px content column, 16px justified body, square bullets
   - teal accent #226E93
   ============================================================ */

:root {
  --teal: #226e93;
  --teal-dark: #1e5a77;
  --ink: #212121;
  --muted: #5f6368;
  --line: #d8d8d8;
  --soft: #f2f2f2;
  --max-w: 1140px;
  --header-h: 72px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Montserrat", "Lato", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.4;
  color: var(--ink);
  background: #fff;
}

h1, h2, h3, h4 {
  font-family: "Montserrat", "Lato", sans-serif;
  line-height: 1.3;
  color: #000;
}

a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--teal-dark); text-decoration: underline; }

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

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

:focus-visible {
  outline: 2px solid var(--teal-dark);
  outline-offset: 2px;
}

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: #fff; color: var(--teal-dark); padding: 8px 16px; z-index: 100;
}
.skip-link:focus { left: 0; }

/* ---------- Header (transparent over banner) ---------- */

.site-header {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 20;
  color: #fff;
}

.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  font-family: "Lato", sans-serif;
  font-weight: 300;
  font-size: 25px;
  letter-spacing: 1px;
  color: #fff;
}
.brand:hover { text-decoration: none; }

.primary-nav > ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
}

.nav-item { position: relative; }

/* desktop nav sizing: 10 items + brand must fit ONE line at >= 1280px
   (measured: 16px/10px padding = 1136px of nav; 15px/8px = ~1040px) */
.nav-link {
  display: block;
  padding: 10px 8px;
  font-family: "Lato", sans-serif;
  font-size: 15px;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.87);
}
.nav-link:hover { color: #fff; text-decoration: none; }
.nav-link.is-active { color: #fff; font-weight: 400; }

/* dropdown */
.nav-sub {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
  min-width: 190px;
  flex-direction: column;
}
.nav-sub .nav-link { color: var(--ink); font-size: 14px; }
.nav-sub .nav-link:hover { color: var(--teal-dark); background: var(--soft); }
.nav-sub .nav-link.is-active { color: var(--teal-dark); }

.has-children > .nav-link::after {
  content: " ▾";
  font-size: 12px;
  opacity: .8;
}

@media (hover: hover) and (min-width: 1280px) {
  .nav-sub {
    display: flex;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity .15s ease, transform .15s ease, visibility 0s linear .15s;
  }
  .has-children:hover .nav-sub,
  .has-children:focus-within .nav-sub {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity .15s ease, transform .15s ease;
  }
}

/* scrolled state: solid white header */
body.scrolled .site-header {
  position: fixed;
  background: #fff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, .15);
  color: var(--ink);
}
body.scrolled .brand { color: var(--ink); background: none; }
body.scrolled .nav-toggle-box span { background: var(--ink); }
body.scrolled .nav-link { color: var(--muted); }
body.scrolled .nav-link:hover { color: var(--teal-dark); }
body.scrolled .nav-link.is-active { color: var(--teal-dark); }

/* mobile toggle */
.nav-toggle {
  display: none;
  margin-left: auto;
  background: none;
  border: 0;
  padding: 8px;
  cursor: pointer;
}
.nav-toggle-box { display: flex; flex-direction: column; gap: 4px; }
.nav-toggle-box span {
  width: 22px; height: 2px; background: #fff; display: block;
  transition: transform .18s ease, opacity .18s ease;
}
/* hamburger -> X while the menu is open (aria-expanded is the source of truth) */
.nav-toggle[aria-expanded="true"] .nav-toggle-box span {
  width: 20px;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-box span:first-child {
  transform: translateY(6px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-box span:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-box span:last-child {
  transform: translateY(-6px) rotate(-45deg);
}

/* ---------- Mobile / tablet nav: hamburger up to 1279px ----------
   (measured: the 10-item desktop nav needs ~1040px + brand + gaps,
    which first fits on one line at 1280px) */
@media (max-width: 1279px) {
  .nav-toggle { display: inline-block; }
  .primary-nav {
    display: none;
    width: 100%;
    margin: 0 0 12px;
    background: #141e28;            /* solid: menu must stay legible over page content */
    border-radius: 10px;
    padding: 6px 10px;
    box-shadow: 0 10px 26px rgba(0, 0, 0, .28);
  }
  .primary-nav.open { display: block; }
  .primary-nav ul { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-link { padding: 12px 10px; font-size: 16px; font-weight: 400; color: rgba(255,255,255,.9); }
  body.scrolled .primary-nav { background: #fff; }
  body.scrolled .primary-nav.open > ul > li > .nav-link { color: #24303e; }
  body.scrolled .primary-nav.open > ul > li > .nav-link.is-active { color: var(--teal-dark); }
  body.scrolled .nav-link { color: var(--muted); }
  .nav-sub {
    display: flex !important;
    position: static;
    box-shadow: none;
    background: transparent;
    padding: 0 0 0 18px;
    min-width: 0;
  }
  .nav-sub .nav-link { font-size: 15px; color: rgba(255,255,255,.75); }
  body.scrolled .nav-sub .nav-link { color: var(--muted); }
  .has-children > .nav-link::after { content: ""; }
}

/* room at 1400px+: go back to the design's full 16px / 10px nav
   (measured: 1136px nav + 156px brand + 24px gap = 1316px <= 1400 - 48 padding) */
@media (min-width: 1400px) {
  .nav-link { padding: 10px 10px; font-size: 16px; }
}

/* ---------- Banners ---------- */

.banner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  /* NO overflow:hidden: the header is an absolutely-positioned child of .banner,
     so clipping here cropped the opened mobile menu (banner is 340/540px tall,
     the opened menu ~650px). .banner-bg is inset:0 so nothing else needed the clip. */
}

.banner-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}
/* inner banners: darker at the top (nav + title zone), fading down */
.banner-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.62) 0%,
    rgba(0, 0, 0, 0.45) 45%,
    rgba(0, 0, 0, 0.25) 100%
  );
}

/* home hero: darker gradient from the top, where the nav + hero text sit */
.banner-home {
  background-image:
    linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.7) 0%,
      rgba(0, 0, 0, 0.5) 40%,
      rgba(0, 0, 0, 0.28) 75%,
      rgba(0, 0, 0, 0.18) 100%
    ),
    url("/assets/images/banners/banner-home.jpg");
  background-size: cover;
  background-position: center;
  min-height: 540px;
  padding: 130px 20px 60px;
}

.banner { min-height: 340px; padding: 130px 20px 48px; }

.banner-text {
  position: relative;
  z-index: 10;
  max-width: 900px;
  margin: 0 auto;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.4);
}

/* home hero lines (sizes/weights from the live DOM) */
.hero-kicker {
  margin: 0;
  font-family: "Montserrat", sans-serif;
  font-size: clamp(22px, 2.3vw, 32px);
  font-weight: 500;
  letter-spacing: 2px;
  line-height: 1.4;
}

.hero-name {
  margin: 6px 0 0;
  font-family: "Montserrat", sans-serif;
  font-size: clamp(24px, 2.3vw, 32px);
  font-weight: 500;
}

.hero-loc {
  margin: 44px 0 0;
  font-family: "Calibri", "Lato", sans-serif;
  font-size: clamp(20px, 2.3vw, 32px);
  font-weight: 400;
}

.hero-dates {
  margin: 10px 0 0;
  font-family: "Calibri", "Lato", sans-serif;
  font-size: clamp(18px, 1.7vw, 24px);
  font-weight: 400;
}

/* inner page title */
.banner-title {
  margin: 0;
  font-family: "Lato", sans-serif;
  font-size: clamp(30px, 4.5vw, 45px);
  font-weight: 300;
  letter-spacing: 0.5px;
  line-height: 1.1;
  color: #fff;
}

/* hairline under banner, spanning content column */
.content {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 40px 24px 80px;
  border-top: 1px solid var(--line);
}

/* ---------- Content ---------- */

.content h2 {
  font-size: 26px;
  font-weight: 700;
  margin: 40px 0 12px;
}
.content h2:first-child { margin-top: 0; }
.content h3 { font-size: 20px; font-weight: 700; margin: 28px 0 10px; }

.content p { margin: 0 0 20px; text-align: justify; hyphens: auto; }
.content ul:not(.people):not(.workshop-list),
.content ol { margin: 0 0 20px; padding-left: 30px; }
.content ul:not(.people):not(.workshop-list) { list-style-type: square; }
.content li { margin-bottom: 8px; }

/* justified text rivers at phone width — left-align instead */
@media (max-width: 639px) {
  .content p { text-align: left; hyphens: manual; }
}

.tbd {
  color: var(--muted);
  font-weight: 700;
}

.key-dates {
  font-family: "Montserrat", sans-serif;
  font-size: 24px;
  font-weight: 400;
  margin: 32px 0 12px;
}

/* people / committees */
.people { list-style: none; padding: 0; }
.people li {
  padding: 8px 0;
  border-bottom: 1px solid #eee;
  margin: 0;
}
.people li:last-child { border-bottom: 0; }
.people .affil { color: var(--muted); font-size: 15px; }
.people .role {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--teal-dark);
  background: #e8f1f6;
  border-radius: 4px;
  padding: 2px 8px;
  margin-left: 8px;
  vertical-align: middle;
}

/* workshop cards */
.workshop-list { list-style: none; padding: 0; }
.workshop-list li { margin: 0; }
.workshop-list a {
  display: block;
  padding: 14px 18px;
  margin-bottom: 12px;
  background: var(--soft);
  border-radius: 8px;
  font-weight: 700;
  color: var(--teal-dark);
}
.workshop-list a:hover { background: #e8f1f6; text-decoration: none; }
.workshop-list .ws-sub {
  display: block;
  font-weight: 400;
  font-size: 14px;
  color: var(--muted);
}

/* sponsors: proportional logo wall — every logo scales to the same box
   height, aspect ratio preserved (object-fit: contain); wide logos are
   clamped by the cell width. The odd (5th) logo spans + centres. */
.sponsors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px 32px;
  align-items: center;
  justify-items: center;
  padding: 12px 0 24px;
}
.sponsors img {
  width: auto;
  height: 96px;
  max-width: 100%;
  object-fit: contain;
}
.sponsors .span2 { grid-column: 1 / -1; }
@media (max-width: 719px) {
  .sponsors { grid-template-columns: 1fr; }
  .sponsors img { height: 72px; }
}

/* CTA button */
.btn {
  display: inline-block;
  background: var(--teal);
  color: #fff;
  font-weight: 700;
  padding: 12px 26px;
  border-radius: 8px;
  font-size: 16px;
  transition: background-color .15s ease;
}
.btn:hover { background: var(--teal-dark); color: #fff; text-decoration: none; }

/* past conferences */
.past-list { list-style: square; }

/* venue map (live site embeds a Google Map) */
.map {
  display: block;
  width: 100%;
  height: 400px;
  border: 0;
  margin-top: 20px;
}

/* accessibility: honour reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
