/* ============================================================
   YACL — Site-specific styles (Bootstrap 5 base)
   Yale blue #00356b · Accent #286dc0
   ============================================================ */

/* 1. Bootstrap overrides & fonts
   ============================================================ */
:root {
  --yacl-navy: #00356b;
  --yacl-navy-rgb: 0, 53, 107;
  --yacl-link: #286dc0;
  --yacl-link-hover: #1a5096;
  --yacl-ink: #3f4b57;
  --yacl-ink-muted: #667788;
  --yacl-ink-soft: #6a7682;
  --yacl-slate: #334155;
  --yacl-border: #e2e8f0;
  --yacl-border-soft: #e8edf2;
  --yacl-surface-alt: #f6f4f1;
  --yacl-surface-subtle: #fbfaf8;
  --yacl-footer: #0d2240;
  --bs-primary: #00356b;
  --bs-primary-rgb: 0, 53, 107;
  --bs-link-color: #286dc0;
  --bs-link-hover-color: #1a5096;
  --bs-link-color-rgb: 40, 109, 192;
}

body { font-family: 'Roboto', system-ui, sans-serif; }
h1, h2, h3, h4, h5, h6 { font-family: 'Space Grotesk', system-ui, sans-serif; color: var(--yacl-navy); }
h2:not(:first-child), h3:not(:first-child), h4:not(:first-child), h5:not(:first-child), h6:not(:first-child) { margin-top: 1.5rem; }
a { color: var(--bs-link-color); }
a:hover { color: var(--bs-link-hover-color); }

/* 2. Navbar
   ============================================================ */
.yacl-navbar { background-color: var(--yacl-navy); box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.yacl-navbar .navbar-brand { font-size: .95rem; }
.yacl-navbar .navbar-brand img { width: 32px; height: 32px; object-fit: contain; flex-shrink: 0; }
.yacl-navbar .nav-link { color: rgba(255,255,255,.85) !important; border-radius: 4px; }
.yacl-navbar .nav-link:hover,
.yacl-navbar .nav-link.active { background: rgba(255,255,255,.18); color: #fff !important; }


/* 3. Hero sections
   ============================================================ */
.page-hero,
.home-hero {
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  color: #fff;
}

.page-hero {
  background-image:
    linear-gradient(rgba(0,53,107,.72), rgba(0,53,107,.72)),
    url('/assets/images/yale-cs-building-enhanced-hq.webp');
  padding: 2.5rem 0;
}

.home-hero {
  background-image:
    linear-gradient(135deg, rgba(0,53,107,.62) 0%, rgba(0,53,107,.34) 40%, rgba(0,53,107,.12) 100%),
    url('/assets/images/yale-cs-building-enhanced-hq.webp');
  padding: 4rem 0 3rem;
  text-align: center;
}

.home-hero h1,
.page-hero h1 { color: #fff; }

.hero-logo {
  width: clamp(150px, 28vw, 240px);
  height: clamp(150px, 28vw, 240px);
  object-fit: contain;
  border-radius: 16px;
  margin-bottom: 1rem;
}

.home-hero .tagline { font-size: 1.15rem; color: rgba(255,255,255,.9); }
.page-hero h1 { margin-bottom: 0; }
.page-subtitle { color: rgba(255,255,255,.82); font-size: 1.1rem; margin-top: .35rem; margin-bottom: 0; }

/* 4. Page content layout
   ============================================================ */
.page-body > h2,
.page-section h2 { border-bottom: 2px solid var(--yacl-border); padding-bottom: .5rem; margin-bottom: 1.25rem; }

/* 5. Home page sections
   ============================================================ */
.home-hero .container,
.home-section .container {
  max-width: 960px;
}

.home-section { padding: 3.5rem 0; }
.home-section + .home-section { border-top: 1px solid var(--yacl-border-soft); }
.home-section.alt-bg { background: var(--yacl-surface-alt); }

.section-header { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; }
.section-header h2 { margin: 0; }
.section-header a { font-size: .9rem; font-weight: 500; }


/* 6. Update list
   ============================================================ */
.updates-list { display: flex; flex-direction: column; }

.update-date,
.update-tag {
  display: inline-flex;
  align-items: center;
  font-family: ui-monospace, 'Courier New', monospace;
  font-size: .72rem;
  font-weight: 600;
  padding: .1rem .4rem;
  border-radius: 5px;
  white-space: nowrap;
}

.update-item {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .7rem 0;
  border-bottom: 1px solid var(--yacl-border);
}
.update-item:last-child { border-bottom: none; }

.update-date {
  justify-content: center;
  flex: 0 0 7.5rem;
  background: rgba(31,41,55,.08);
  color: var(--yacl-slate);
}

.update-body { display: block; flex: 1 1 auto; min-width: 0; }

.update-tag {
  text-transform: uppercase;
  letter-spacing: .05em;
  vertical-align: baseline;
  margin-right: .25rem;
}

.update-tag--paper { background: #dbeafe; color: #1e40af; }
.update-tag--award { background: #fef9c3; color: #92400e; }
.update-tag--talk  { background: #dcfce7; color: #166534; }
.update-tag--news  { background: #f3e8ff; color: #6b21a8; }

.updates-collapsed,
.seminar-list,
.seminar-full-list { display: flex; flex-direction: column; }

.updates-collapsed[hidden] { display: none; }

.updates-toggle {
  margin-top: .5rem;
  background: none;
  border: none;
  color: #286dc0;
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
}
.updates-toggle:hover { text-decoration: underline; }


/* 7. Seminar cards & accordion
   ============================================================ */
.seminar-list,
.seminar-full-list { gap: 1rem; }

.seminar-date {
  text-align: center;
  background: var(--yacl-navy);
  color: #fff;
  border-radius: 6px;
  padding: .35rem .4rem;
  line-height: 1.1;
  width: 68px;
  align-self: flex-start;
}

.seminar-entry-past .seminar-date { background: #6b7280; }
.seminar-date .month,
.seminar-date .day,
.seminar-date .year { display: block; }

.seminar-date .month { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; opacity: .85; }
.seminar-date .day { font-size: 1.6rem; font-weight: 700; }
.seminar-date .year { font-size: .7rem; opacity: .75; }

.seminar-heading { font-size: 1rem; color: var(--yacl-navy); margin: 0 0 .2rem; }
.seminar-speaker { font-weight: 700; }
.seminar-speaker-line { margin: 0; font-weight: 400; }
.seminar-time { color: #777; margin-bottom: 0; }

.seminar-entry { --bs-card-border-color: var(--yacl-border); overflow: hidden; }
.seminar-entry[open] { --bs-card-border-color: #d8dde6; box-shadow: 0 8px 24px rgba(15,23,42,.08); }
.seminar-entry-past[open] { --bs-card-border-color: #d6dbe3; box-shadow: 0 8px 20px rgba(71,85,105,.12); }

.seminar-entry-summary { list-style: none; cursor: pointer; }
.seminar-entry-summary::-webkit-details-marker { display: none; }

.seminar-entry-body { background: var(--yacl-surface-subtle); }
.seminar-detail { color: var(--yacl-ink); line-height: 1.65; }

.seminar-btn {
  border: none;
  border-radius: 999px;
  color: #fff;
  font-weight: 600;
  letter-spacing: .01em;
  padding: .42rem .8rem;
  box-shadow: 0 8px 18px rgba(15,23,42,.12);
}

.seminar-btn:hover,
.seminar-btn:focus-visible {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(15,23,42,.18);
}

.seminar-btn-livestream {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.seminar-btn-video {
  background: linear-gradient(135deg, #f97360, #dc2626);
}

.seminar-btn-details {
  background: linear-gradient(135deg, #51a9ff, #2f6fed);
}

.seminar-toggle { white-space: nowrap; }
.seminar-toggle-label-close { display: none; }
.seminar-entry[open] .seminar-toggle,
.seminar-entry-past[open] .seminar-toggle { filter: saturate(1.05) brightness(.96); }
.seminar-entry[open] .seminar-toggle-label-open { display: none; }
.seminar-entry[open] .seminar-toggle-label-close { display: inline; }

.seminar-action-row { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: .5rem; }

.seminar-resources {
  background: #f0f5fb;
  border: 1px solid #d7e4f2;
  border-left: 4px solid #286dc0;
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
}
.seminar-resources h2 { font-size: 1.1rem; margin-bottom: .75rem; }
.seminar-resources ul { list-style: none; padding: 0; margin: 0; }
.seminar-resources li { padding: .3rem 0; font-size: .9rem; }
.seminar-resources li::before { content: "→ "; color: #286dc0; font-weight: 700; }
.seminar-links ul { margin-top: .5rem; }

/* 8. People page
   ============================================================ */
.page-section { margin-bottom: 2.5rem; }

.people-list { display: flex; flex-direction: column; gap: 1.5rem; }

.person-row { display: grid; grid-template-columns: clamp(120px, 18vw, 200px) minmax(0,1fr); gap: 1.25rem; align-items: start; }

.person-photo { width: 100%; aspect-ratio: 1/1; object-fit: cover; background: #e2e8f0; }

.person-copy h3 { font-size: 1.25rem; margin-bottom: .25rem; }
.person-role { font-size: .82rem; color: var(--yacl-link); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; margin-bottom: .6rem; }
.person-links { font-size: .88rem; color: var(--yacl-ink-muted); margin-bottom: .65rem; }
.person-links a { color: var(--yacl-link); }
.person-links-sep { color: #98a5b3; margin: 0 .35rem; }
.person-research { font-size: .95rem; color: var(--yacl-ink); margin: 0; line-height: 1.7; }
.member-role { font-size: .9rem; color: var(--yacl-ink-soft); margin: .25rem 0 0; }


/* 9. Teaching page
   ============================================================ */
.course-table td:first-child { font-weight: 600; color: var(--yacl-navy); white-space: nowrap; }


/* 10. Funding page
   ============================================================ */
.funding-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 1.25rem; margin-bottom: 2rem; }
.funding-card { background: #fff; border: 1px solid #e4ebf2; border-radius: 12px; padding: 1.5rem 1.25rem; min-height: 200px; display: flex; flex-direction: column; justify-content: space-between; align-items: center; text-align: center; box-shadow: 0 4px 16px rgba(13,34,64,.06); }
.funding-card h2 { font-size: 1rem; margin: 0; }
.funding-logo { width: 100%; max-width: 200px; height: 100px; object-fit: contain; }
.funding-logo--nsf { height: 130px; max-width: 130px; }


/* 11. Calendar
   ============================================================ */
.calendar-embed { width: 100%; height: 600px; border: 1px solid var(--yacl-border); border-radius: 8px; }


/* 12. Footer
   ============================================================ */
.site-footer { background: var(--yacl-footer); }
.footer-heading { color: #fff; font-family: 'Roboto', sans-serif; font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; margin-bottom: .65rem; }
.footer-link { color: rgba(255,255,255,.6); font-size: .875rem; text-decoration: none; display: block; margin-bottom: .35rem; }
.footer-link:hover { color: #fff; }


/* 13. Responsive tweaks (Bootstrap handles the rest)
   ============================================================ */
@media (max-width: 991px) {
  .yacl-navbar .nav-link { padding: .6rem .75rem; }
}

@media (max-width: 768px) {
  .update-item { flex-direction: column; gap: .5rem; }
  .update-date {
    flex: 0 0 auto;
    align-self: stretch;
    justify-content: center;
  }
  .person-row { grid-template-columns: clamp(120px, 32vw, 160px) minmax(0,1fr); }
}
