/* =========================================================
 * 01 Settings & Tokens
 * ========================================================= */
:root {
  font-size: 16px;
  /* Core theme tokens */
  --bs-primary: #0065A4;    /* CTU Blue */
  --bs-secondary: #00A3E0;  /* Light CTU Blue */
  --bs-dark: #0B1726;       /* Deep navy for navbar/footer */
  --bs-body-bg: #F6F9FC;
  --bs-body-color: #0B1726;

  /* Provide explicit alias used elsewhere */
  --primary-dark: var(--bs-dark);
  --primary: var(--bs-dark);
  --secondary: var(--bs-primary);
  --accent: #8AA3B1;
  --muted: #EEF4F8;
  --text: var(--bs-body-color);
  --text-light: #3A4952;
  --background: var(--bs-body-bg);
  --border: #D7E2EA;
  --copper: #A66B39;
  --copper-rgb: 166, 107, 57;
  --sand-rgb: 214, 207, 190;
  --ink-rgb: 26, 23, 21;

  /* Shadows */
  --shadow: 0 12px 32px rgba(11, 23, 38, 0.12); 
  --shadow-sm: 0 8px 18px rgba(var(--ink-rgb), 0.10);
  --shadow-lg: 0 18px 38px rgba(var(--ink-rgb), 0.22);

  /* Layout */
  --radius: 12px;
  --transition: 0.2s ease-in-out;
  --header-offset: 150px;
}

/* =========================================================
 * 02 Base Elements & Reset
 * ========================================================= */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-padding-top: var(--header-offset); }

@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background-color: var(--background);
  line-height: 1.6;
}

a { color: var(--secondary); text-decoration: none; }

a:hover,
a:focus { color: var(--primary); text-decoration: underline; }

/* Accessibility */
.skip-link {
  position: absolute;
  left: -999px;
  top: 1rem;
  background-color: var(--primary);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 0.25rem;
}

.skip-link:focus {
  left: 1rem;
}

/* =========================================================
 * 03 Layout & Navigation
 * ========================================================= */
.site-header { position: sticky; top: 0; z-index: 10; }

.navbar .navbar-nav { gap: 0.85rem; }

.navbar .navbar-nav .nav-link { padding-inline: 0.5rem; }

@media (max-width: 640px) { .site-header .navbar { padding-top: 0.5rem; padding-bottom: 0.5rem; } }

/* =========================================================
 * 04 Component: Hero
 * ========================================================= */
.hero {
  padding: 0 0 4rem;
  background: linear-gradient(180deg, rgba(var(--copper-rgb), 0.10), rgba(255, 255, 255, 0.95) 65%);
  scroll-margin-top: var(--header-offset);
}

.hero-image {
  margin: 0;
  position: relative;
  max-height: 420px;
  overflow: hidden;
  border-bottom: 1px solid rgba(var(--sand-rgb), 0.40);
  box-shadow: var(--shadow-lg);
}

.hero-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(var(--ink-rgb), 0.15), rgba(var(--ink-rgb), 0.42));
  pointer-events: none;
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(105%);
  border-radius: 0; /* No rounded corners */
}

.hero-credit {
  position: absolute;
  right: 1.25rem;
  bottom: 1.1rem;
  margin: 0;
  font-size: 0.625rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
  font-weight: 600;
}

.hero-content {
  display: grid;
  gap: 2.5rem;
  align-items: start;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin-top: 3rem;
}

.hero h1 {
  font-size: clamp(2rem, 3vw + 0.5rem, 3.2rem);
  margin-top: 0;
  margin-bottom: 1rem;
  color: var(--primary-dark);
}

.hero p {
  font-size: 1.08rem;
  margin-bottom: 1.5rem;
  color: var(--text-light);
}

/* Ensure hero-overlay positions over the image at all sizes */
.hero-overlay {
  position: absolute;
  right: 1rem;
  top: 1rem;
  max-width: min(90%, 660px);
  padding: 0;
  border-radius: 0; /* square corners */
  text-align: right;
  z-index: 2;
}

@media (max-width: 640px) {
  .hero-image { height: 300px; max-height: none; overflow: hidden; }
  .hero-credit { right: 0.9rem; bottom: 0.75rem; font-size: 0.5rem; }
  .hero-content { margin-top: 2rem; gap: 2rem; }
  .hero-overlay { top: 0.75rem; right: 0.75rem; max-width: min(95%, 660px); }
  .hero h1 { font-size: 1.5rem; }
  .hero p { font-size: 1rem; }
}

/* Hero panel backgrounds */
.bg-hero-panel {
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 0.85rem 1rem;
}

.bg-hero-copper {
  background: rgba(var(--copper-rgb), 0.90);
  color: #fff;
  border: 1px solid rgba(var(--copper-rgb), 0.35);
  box-shadow: var(--shadow);
  padding: 0.85rem 1rem;
}

/* Per-line hero chips (square corners) */
.hero-chip {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 0;
  box-shadow: var(--shadow);
  border: 1px solid transparent;
}

.hero-chip + .hero-chip,
.hero-chip + br + .hero-chip {
  margin-top: 0.35rem;
}

.hero-chip--copper {
  background: rgba(var(--copper-rgb), 0.92);
  color: #fff;
  border-color: rgba(var(--copper-rgb), 0.35);
}

.hero-chip--light {
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  border-color: var(--border);
}

.hero-copy .cta-group { justify-content: flex-start; gap: 0.85rem; }

.eyebrow { text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.2em; margin: 0; color: var(--secondary); }
.value { margin: 0.5rem 0 0; font-size: 1.1rem; font-weight: 600; }

/* =========================================================
 * 05 Layout Sections
 * ========================================================= */
.section {
  padding: 4rem 0;
  scroll-margin-top: var(--header-offset);
  position: relative; /* needed for bottom gradient divider */
}

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

/* Alternate backgrounds for all content sections to keep them visually differentiated.
   We exclude the hero section, which has its own styling. */
main > .section:not(.hero):nth-of-type(odd) {
  background-color: #fff;
  background-image: linear-gradient(
    180deg,
    rgba(var(--copper-rgb), 0.06) 0%,
    rgba(var(--copper-rgb), 0.0) 40%,
    rgba(var(--copper-rgb), 0.0) 60%,
    rgba(var(--copper-rgb), 0.06) 100%
  );
  background-repeat: no-repeat;
}
main > .section:not(.hero):nth-of-type(even) {
  background-color: var(--muted);
  background-image: linear-gradient(
    180deg,
    rgba(var(--copper-rgb), 0.08) 0%,
    rgba(var(--copper-rgb), 0.0) 40%,
    rgba(var(--copper-rgb), 0.0) 60%,
    rgba(var(--copper-rgb), 0.08) 100%
  );
  background-repeat: no-repeat;
}

.section h2 { margin-top: 0; font-size: 2rem; color: var(--primary-dark); }

/* =========================================================
 * 06 Component: Map Embed
 * ========================================================= */
.map-embed {
  margin-top: 2.5rem;
  border: 1px solid rgba(var(--sand-rgb), 0.60);
  border-radius: var(--radius);
  overflow: hidden;
  background-color: #fff;
  box-shadow: var(--shadow);
  position: relative;
  z-index: 0;
}
@media (max-width: 640px) { .map-embed { margin-top: 2rem; box-shadow: var(--shadow-sm); } }

.leaflet-map { min-height: 360px; }

.map-embed__caption { margin: 0; padding: 0.85rem 1.25rem; font-size: 0.9rem; color: var(--text-light); }

.map-embed__caption a { color: var(--secondary); font-weight: 600; }

.registration-aside { gap: 1.25rem; }

.highlight-list,
.data-list,
.steps { padding-left: 1.25rem; margin-top: 1rem; color: var(--text-light); }

.data-list { list-style: none; padding-left: 0; }

.data-list li { padding: 0.65rem 0; border-bottom: 1px solid var(--border); }

.data-list li span { font-weight: 600; color: var(--text); display: block; }

.data-list li:last-child { border-bottom: none; }

/* =========================================================
 * 07 Component: Timeline
 * ========================================================= */
/* Simplified Timeline
   Markup contract:
   <dl class="timeline [timeline--inline]">
     <div class="timeline-entry">
       <span class="timeline-marker" aria-hidden="true"></span>
       <dt class="timeline-date">Date</dt>
       <dd class="timeline-text">Description</dd>
     </div>
   </dl>
   Variant .timeline--inline puts date + text inline while keeping marker column.
*/

/* Tokens (scoped to component for clarity) */
:root {
  --timeline-marker-size: 12px;
  --timeline-marker-ring: 4px;
  --timeline-line-width: 2px;
}

.timeline {
  position: relative;
  margin: 1rem 0;
  display: grid;
  gap: 0.85rem; /* compact vertical spacing between entries */
}
@media (max-width: 640px) { .timeline { padding-left: 1rem; gap: 0.6rem; } }

.timeline-entry {
  display: grid;
  grid-template-columns: var(--timeline-marker-size) 1fr; /* marker | content */
  gap: 0.75rem;
  align-items: start;
  position: relative;
}
@media (max-width: 640px) { .timeline-entry { gap: 0.65rem; } }

.timeline-marker {
  width: var(--timeline-marker-size);
  height: var(--timeline-marker-size);
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--secondary);
  box-shadow: 0 0 0 var(--timeline-marker-ring) rgba(var(--sand-rgb), 0.35);
  margin-top: 0.25rem;
  position: relative;
  justify-self: center;
}

/* Connector line from bottom of marker to next marker */
.timeline-entry:not(:last-child)::after {
  content: "";
  position: absolute;
  left: calc(var(--timeline-marker-size) / 2 - var(--timeline-line-width) / 2);
  top: calc(var(--timeline-marker-size) + 0.25rem);
  bottom: -0.5rem; /* tightened to match reduced gap */
  width: var(--timeline-line-width);
  background: linear-gradient(180deg, rgba(var(--copper-rgb), 0.45), rgba(var(--copper-rgb), 0.05));
}

.timeline-date {
  margin: 0;
  font-weight: 700;
  color: var(--secondary);
  font-size: 1rem;
}

.timeline-text {
  margin: 0.15rem 0 0; /* slightly tighter spacing below date */
  color: var(--text-light);
  font-size: 0.95rem;
}

/* Inline variant: date and description on one line, with a colon */
.timeline--inline .timeline-entry { grid-template-columns: var(--timeline-marker-size) minmax(11ch, 20ch) 1fr; }
.timeline--inline .timeline-date,
.timeline--inline .timeline-text { display: inline; margin: 0; line-height: 1.2; }
.timeline--inline .timeline-date { font-size: 0.95rem; }
.timeline--inline .timeline-date::after { content: ": "; font-weight: 400; color: var(--text-light); }
.timeline--inline .timeline-text { font-size: 0.92rem; }

@media (max-width: 640px) {
  .timeline--inline .timeline-entry { grid-template-columns: var(--timeline-marker-size) minmax(9ch, 18ch) 1fr; }
}

.card-meta { font-size: 0.9rem; color: var(--text-light); }

/* =========================================================
 * 08 Component: Committees & Steps
 * ========================================================= */
.committee-list { padding-left: 0; list-style: none; }
.committee-list li { margin-bottom: 0.35rem; }
.committee-name { font-weight: 400; }

.committee-list .card-meta { color: var(--text); }
.committee-list .text-muted { color: var(--text); }

/* Two-column layout for scientific committee on medium+ screens */
@media (min-width: 768px) { .committee-list--two-col { columns: 2; column-gap: 1.5rem; } .committee-list--two-col li { break-inside: avoid; } }

.steps { counter-reset: step; }

.steps li { counter-increment: step; margin-bottom: 0.75rem; }

.steps li::marker { content: counter(step) ". "; font-weight: 700; color: var(--secondary); }

.sponsor-placeholder {
  margin-top: 2rem;
  padding: 2rem;
  border: 2px dashed rgba(var(--copper-rgb), 0.40);
  border-radius: var(--radius);
  text-align: center;
  color: var(--text-light);
  background: rgba(var(--copper-rgb), 0.05);
}

.sponsor-placeholder p {
  margin-bottom: 0;
}

.note { color: var(--text-light); }

/* =========================================================
 * 09 Utilities
 * ========================================================= */
.small-print { font-size: 0.85rem; padding-left: 0; color: var(--text-light); }

/* Highlighted Save-the-Date box */
.save-date.save-date--highlight {
  background: linear-gradient(135deg, rgba(var(--copper-rgb), 0.12), rgba(var(--copper-rgb), 0.04) 45%, rgba(var(--sand-rgb), 0.20));
  border: 2px solid rgba(var(--copper-rgb), 0.35);
  padding: 1.1rem 1.25rem 1rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.save-date.save-date--highlight::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 18% 22%, rgba(var(--copper-rgb), 0.22), transparent 60%);
  pointer-events: none;
  opacity: 0.35;
}

.save-date.save-date--highlight strong {
  font-size: 1rem;
  letter-spacing: 0.5px;
  color: var(--primary-dark);
  margin-bottom: 0.5rem !important;
}

.save-date.save-date--highlight .btn {
  box-shadow: none;
}

.save-date.save-date--highlight a.small,
.save-date.save-date--highlight .small a {
  font-weight: 600;
  text-decoration: none;
  color: var(--secondary);
}

.save-date.save-date--highlight a.small:hover,
.save-date.save-date--highlight a.small:focus { text-decoration: underline; }

@media (max-width: 640px) {
  .save-date.save-date--highlight { padding: 0.9rem 1rem 0.85rem; }
  .save-date.save-date--highlight strong { font-size: 0.95rem; }
}

/* =========================================================
 * 10 Component: Footer
 * ========================================================= */
.site-footer {
  background-color: var(--background);
  color: #5f5f5f;
  padding: 2rem 0;
  margin-top: 0;
}

.site-footer p { margin: 0.35rem 0; text-align: center; }

.site-footer .small-print,
.site-footer .small-print p,
.site-footer .small-print h3 { text-align: left; }

.footer-links { display: flex; gap: 0.75rem; justify-content: center; align-items: center; flex-wrap: wrap; margin: 0.75rem 0 0; }

.site-footer a { text-decoration: underline; text-underline-offset: 2px; }
