/* CEAI Website — shared styles */

:root {
  /* Brand palette — exact hex values */
  --navy: #4F536B;            /* derived dark for backgrounds and nav */
  --navy-dark: #33374A;       /* darkest shade — heading text, footer */
  --navy-light: #737896;      /* brand slate — muted purple-grey (used for text labels) */
  --blue: #7ab2d4;            /* 5th brand color — lighter blue, distinct from slate in accents */
  --purple: #8a7795;          /* brand purple */
  --purple-light: #C9C0CE;
  --olive: #d7cc5e;           /* brand yellow-olive */
  --olive-light: #E8E19A;
  --green: #899e72;           /* brand green */
  --green-light: #C5D0B6;
  /* Tints for backgrounds */
  --bg: #F3F4F7;
  --bg-tint-purple: #F5F3F5;
  --bg-tint-olive:  #FAF8E4;
  --bg-tint-green:  #F2F5EC;
  --accent: var(--purple);
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --max-wide: 1100px;
  --max-prose: 720px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--text);
  line-height: 1.6;
  background: #fff;
}

h1, h2, h3, h4 {
  color: var(--navy-dark);
  line-height: 1.25;
  margin: 0 0 0.6em;
  font-weight: 600;
}

h1 { font-size: 2.25rem; position: relative; }
h1::after {
  content: "";
  display: block;
  width: 60px; height: 4px;
  background-image: linear-gradient(
    to right,
    var(--purple) 0%, var(--purple) 25%,
    var(--olive) 25%, var(--olive) 50%,
    var(--blue) 50%, var(--blue) 75%,
    var(--green) 75%, var(--green) 100%
  );
  border-radius: 2px;
  margin-top: 0.55em;
}
.hero h1::after, .no-accent::after { display: none; }
h2 { font-size: 1.6rem; margin-top: 2em; padding-left: 0.7em; border-left: 4px solid var(--purple); }
h2:nth-of-type(4n+1) { border-left-color: var(--purple); }
h2:nth-of-type(4n+2) { border-left-color: var(--olive); }
h2:nth-of-type(4n+3) { border-left-color: var(--blue); }
h2:nth-of-type(4n+4) { border-left-color: var(--green); }
.no-bar h2 { border-left: 0; padding-left: 0; }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; }

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

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

/* ========== Layout containers ========== */
.container,
.container-wide {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 0 1.25rem;
}
.container-prose {
  max-width: var(--max-prose);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ========== Nav ========== */
.site-nav {
  background: #fff;
  border-bottom: 1px solid var(--border);
  /* Colored accent strip below the nav, pulled from logo */
  background-image:
    linear-gradient(
      to right,
      var(--purple) 0%, var(--purple) 25%,
      var(--olive)  25%, var(--olive)  50%,
      var(--blue)   50%, var(--blue)   75%,
      var(--green)  75%, var(--green)  100%
    );
  background-repeat: no-repeat;
  background-position: bottom;
  background-size: 100% 4px;
}
.nav-inner {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}
.brand img {
  height: 56px;
  width: auto;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { color: var(--navy-dark); font-weight: 700; font-size: 1rem; }
.brand-tag  { color: var(--navy-light); font-style: italic; font-size: 0.85rem; }

.nav-links {
  list-style: none;
  margin: 0; padding: 0;
  display: flex; flex-wrap: wrap;
  gap: 1.25rem;
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  padding-bottom: 0.25rem;
  border-bottom: 2px solid transparent;
}
.nav-links a:hover {
  color: var(--navy-dark);
  border-bottom-color: var(--navy-light);
}
.nav-links a.active {
  color: var(--navy-dark);
  border-bottom-color: var(--navy);
}

/* ========== Hero ========== */
.hero {
  background:
    radial-gradient(circle at 85% 15%, rgba(168, 184, 74, 0.12), transparent 45%),
    radial-gradient(circle at 10% 90%, rgba(142, 122, 168, 0.12), transparent 50%),
    linear-gradient(180deg, var(--bg) 0%, #e8eef7 100%);
  border-bottom: 1px solid var(--border);
  padding: 4rem 0;
}
.eyebrow.eb-purple { color: var(--purple); }
.eyebrow.eb-olive  { color: var(--olive); }
.eyebrow.eb-green  { color: var(--green); }
.eyebrow.eb-blue   { color: var(--blue); }
.hero-grid {
  display: grid;
  gap: 2rem;
  align-items: center;
}
@media (min-width: 768px) {
  .hero-grid { grid-template-columns: 1fr 1fr; }
}
.eyebrow {
  color: var(--navy-light);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.8rem;
  margin: 0;
}
.hero .eyebrow {
  font-size: 1.2rem;   /* 50% larger than default 0.8rem */
  letter-spacing: 0.18em;
}
.hero h1 {
  font-size: 2.5rem;
  margin-top: 0.5em;
}
@media (min-width: 640px) { .hero h1 { font-size: 3rem; } }
.hero-lead {
  font-size: 1.25rem;
  color: var(--text);
  margin-top: 0.5em;
}
.hero-sub { color: var(--text-muted); margin-top: 0.25em; }
.hero img {
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  width: 100%;
  height: 300px;
  object-fit: cover;
}

/* ========== Buttons ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.25rem;
  border-radius: 0.4rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  margin-right: 0.5rem;
  margin-top: 0.25rem;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn-primary {
  background: var(--navy);
  color: #fff;
}
.btn-primary:hover { background: var(--navy-dark); text-decoration: none; }
.btn-secondary {
  background: transparent;
  color: var(--navy);
  border-color: var(--navy);
}
.btn-secondary:hover { background: var(--navy); color: #fff; text-decoration: none; }

/* ========== Sections ========== */
.section { padding: 4rem 0; }
.section-muted { background: var(--bg); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-tint-purple { background: var(--bg-tint-purple); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-tint-olive  { background: var(--bg-tint-olive);  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-tint-green  { background: var(--bg-tint-green);  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-center { text-align: center; }

/* ========== Cards / grids ========== */
.card-grid {
  display: grid;
  gap: 1.5rem;
  margin-top: 1.5rem;
}
@media (min-width: 640px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }

.card {
  border: 1px solid var(--border);
  border-top: 4px solid var(--purple);
  border-radius: 0.5rem;
  overflow: hidden;
  background: #fff;
  transition: box-shadow 0.15s, transform 0.15s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.card:hover { box-shadow: 0 6px 18px rgba(74, 90, 138, 0.15); transform: translateY(-2px); text-decoration: none; }
/* Each card cycles through logo colors on its top border */
.card-grid > .card:nth-child(4n+1) { border-top-color: var(--purple); }
.card-grid > .card:nth-child(4n+2) { border-top-color: var(--olive); }
.card-grid > .card:nth-child(4n+3) { border-top-color: var(--blue); }
.card-grid > .card:nth-child(4n+4) { border-top-color: var(--green); }
.card > img { height: 180px; width: 100%; object-fit: cover; }
.card-body { padding: 1.25rem; }
.card h3 { margin: 0.25rem 0; }

/* ========== Course list ========== */
.course-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.course-list li { border-bottom: 1px solid var(--border); position: relative; }
.course-list li:last-child { border-bottom: none; }
.course-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  width: 4px; height: 60%;
  transform: translateY(-50%);
  border-radius: 2px;
  background: var(--navy-light);
  opacity: 0.7;
}
.course-list li:nth-child(4n+1)::before { background: var(--purple); }
.course-list li:nth-child(4n+2)::before { background: var(--olive); }
.course-list li:nth-child(4n+3)::before { background: var(--blue); }
.course-list li:nth-child(4n+4)::before { background: var(--green); }
.course-list a {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 1rem 1rem;
  text-decoration: none;
  color: inherit;
  border-radius: 0.25rem;
  transition: background 0.15s;
}
.course-list a:hover { background: var(--bg); text-decoration: none; }
.course-list .year {
  color: var(--navy-light);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9rem;
}
.course-list .title { font-weight: 600; color: var(--navy-dark); }
.course-list .dates { color: var(--text-muted); font-size: 0.9rem; }

/* ========== Board ========== */
.board-member {
  display: grid;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
  grid-template-columns: 1fr;
  padding: 1.75rem;
  border-radius: 0.75rem;
  background: #fff;
  border: 1px solid var(--border);
  border-left: 6px solid var(--purple);
  box-shadow: 0 1px 3px rgba(74, 90, 138, 0.05);
}
.board-member:nth-child(4n+1) { border-left-color: var(--purple); background: linear-gradient(90deg, var(--bg-tint-purple), #fff 30%); }
.board-member:nth-child(4n+2) { border-left-color: var(--olive);  background: linear-gradient(90deg, var(--bg-tint-olive), #fff 30%); }
.board-member:nth-child(4n+3) { border-left-color: var(--blue); background: linear-gradient(90deg, #e8f4fb, #fff 30%); }
.board-member:nth-child(4n+4) { border-left-color: var(--green);  background: linear-gradient(90deg, var(--bg-tint-green), #fff 30%); }
/* Suppress the generic h2 color-bar inside board cards since the card itself has one */
.board-member h2 { border-left: 0; padding-left: 0; }
@media (min-width: 720px) {
  .board-member { grid-template-columns: 200px 1fr; gap: 2.5rem; padding: 2rem 2.5rem; }
}
.board-member img {
  width: 100%;
  max-width: 200px;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 0.5rem;
  background: var(--bg);
  border: 3px solid var(--purple);
  padding: 3px;
}
/* Cycle photo accent colors through the logo palette */
.board-member:nth-child(4n+1) img { border-color: var(--purple); }
.board-member:nth-child(4n+2) img { border-color: var(--olive); }
.board-member:nth-child(4n+3) img { border-color: var(--blue); }
.board-member:nth-child(4n+4) img { border-color: var(--green); }
.board-member h2 { margin-top: 0; }
.board-member .role { color: var(--navy-light); font-weight: 400; }
.board-member .affiliation { color: var(--text-muted); margin-top: 0; }

/* ========== Timeline ========== */
.timeline {
  position: relative;
  border-left: 2px solid rgba(122, 138, 184, 0.4);
  margin: 2rem 0 0 0.75rem;
  padding: 0;
  list-style: none;
}
.timeline li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 2.5rem;
}
.timeline li::before {
  content: "";
  position: absolute;
  left: -9px;
  top: 0.4rem;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--navy);
  box-shadow: 0 0 0 4px #fff;
}
.timeline li:nth-child(4n+1)::before { background: var(--purple); }
.timeline li:nth-child(4n+2)::before { background: var(--olive); }
.timeline li:nth-child(4n+3)::before { background: var(--blue); }
.timeline li:nth-child(4n+4)::before { background: var(--green); }
.timeline .t-year {
  color: var(--navy-light);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9rem;
  margin: 0;
}
.timeline h3 { margin: 0.25rem 0 0.5rem; }

/* ========== Course detail sections ========== */
.keynote-box {
  background: var(--bg-tint-olive);
  border-left: 4px solid var(--olive);
  border-radius: 0.5rem;
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
}
.keynote-box h2 { margin-top: 0; }

.lecture-list, .lab-list, .sponsor-list, .instructor-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}
.lecture-list li {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}
.lecture-list .instructor { color: var(--text-muted); }

.lab-list li {
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}
.lab-list h3 { margin: 0 0 0.25rem; }

.sponsor-list { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.sponsor-list li {
  background: var(--bg);
  padding: 0.5rem 0.85rem;
  border-radius: 0.4rem;
  font-size: 0.9rem;
  border-left: 3px solid var(--purple);
}
.sponsor-list li:nth-child(4n+1) { border-left-color: var(--purple); }
.sponsor-list li:nth-child(4n+2) { border-left-color: var(--olive); }
.sponsor-list li:nth-child(4n+3) { border-left-color: var(--blue); }
.sponsor-list li:nth-child(4n+4) { border-left-color: var(--green); }
.instructor-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.25rem 1.5rem;
}
@media (min-width: 640px) { .instructor-list { grid-template-columns: 1fr 1fr; } }

/* ========== Gallery ========== */
.gallery-empty {
  border: 2px dashed var(--border);
  border-radius: 0.5rem;
  padding: 3rem;
  text-align: center;
  color: var(--text-muted);
  margin-top: 2rem;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-top: 1.25rem;
}
@media (min-width: 640px) { .gallery-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .gallery-grid { grid-template-columns: repeat(4, 1fr); } }
.gallery-grid a { display: block; aspect-ratio: 1 / 1; overflow: hidden; border-radius: 0.25rem; }
.gallery-grid img { width: 100%; height: 100%; object-fit: cover; transition: opacity 0.15s; }
.gallery-grid a:hover img { opacity: 0.9; }

/* ========== Footer ========== */
.site-footer {
  margin-top: 5rem;
  background:
    linear-gradient(180deg, var(--bg) 0%, #e8eef7 100%);
  padding: 2rem 0 2.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  position: relative;
}
.site-footer::before {
  content: "";
  display: block;
  height: 4px;
  width: 100%;
  background-image:
    linear-gradient(
      to right,
      var(--purple) 0%, var(--purple) 25%,
      var(--olive)  25%, var(--olive)  50%,
      var(--blue)   50%, var(--blue)   75%,
      var(--green)  75%, var(--green)  100%
    );
  margin: -2rem 0 2rem;
}
.site-footer p { margin: 0.2em 0; }
.site-footer em { color: var(--navy-light); }

/* ========== Utility ========== */
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.muted { color: var(--text-muted); }
.tbd { background: #fff8d6; padding: 0 0.25em; border-radius: 2px; font-style: italic; }
