@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,500;0,600;1,500&family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --paper: #EDE6D6;
  --card: #F7F2E5;
  --ink: #24261F;
  --ink-soft: #5B5A4E;
  --pine: #1F3B34;
  --pine-light: #2F5850;
  --gold: #B98426;
  --gold-soft: #E6D3AC;
  --line: #CFC5A8;
  --danger: #A8542E;
  --live-bg: #F5DFC6;
  --live-text: #A8461B;
  --inperson-bg: #D7E3E8;
  --inperson-text: #35607A;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'IBM Plex Sans', sans-serif;
  line-height: 1.5;
}

.serif { font-family: 'Lora', serif; }
.mono { font-family: 'IBM Plex Mono', monospace; }

a { color: inherit; }

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 20;
}
.site-header__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo__mark { flex-shrink: 0; }
.logo__word { font-size: 1.25rem; color: var(--pine); }
.main-nav { display: flex; gap: 24px; align-items: center; }
.main-nav a {
  text-decoration: none;
  font-size: 0.95rem;
  color: var(--ink);
  border-bottom: 2px solid transparent;
  padding-bottom: 2px;
}
.main-nav a.active, .main-nav a:hover { border-bottom-color: var(--gold); }

/* ---------- "More" dropdown (desktop) ---------- */
.nav-more { position: relative; }
.nav-more__toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  cursor: pointer;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}
.nav-more__toggle:hover, .nav-more__toggle.active { border-bottom-color: var(--gold); }
.nav-more__menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 6px 0;
  min-width: 170px;
  box-shadow: 0 6px 16px rgba(36,38,31,0.12);
  z-index: 30;
}
.nav-more.open .nav-more__menu { display: flex; flex-direction: column; }
.nav-more__menu a {
  padding: 9px 16px;
  text-decoration: none;
  color: var(--ink);
  font-size: 0.9rem;
  border-bottom: none !important;
}
.nav-more__menu a:hover { background: var(--paper); }
.nav-more__menu a.active { color: var(--pine); font-weight: 600; }

/* ---------- Mobile hamburger + panel ---------- */
.nav-hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--pine);
  cursor: pointer;
  padding: 4px;
}
.main-nav--mobile {
  display: none;
  flex-direction: column;
  padding: 8px 20px 16px;
  border-top: 1px solid var(--line);
}
.main-nav--mobile.open { display: flex; }
.main-nav--mobile a {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
  font-size: 0.98rem;
}
.main-nav--mobile a:last-child { border-bottom: none; }
.main-nav--mobile a.active { color: var(--pine); font-weight: 600; }

@media (max-width: 780px) {
  .main-nav--desktop { display: none; }
  .nav-hamburger { display: inline-flex; }
}

/* ---------- Hero ---------- */
.hero { max-width: 1100px; margin: 0 auto; padding: 48px 20px 32px; }
.hero__eyebrow { font-size: 0.75rem; color: var(--ink-soft); margin-bottom: 12px; }
.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  color: var(--pine);
  line-height: 1.2;
  max-width: 20ch;
  margin: 0 0 12px;
}
.hero p { color: var(--ink-soft); max-width: 60ch; margin: 0 0 24px; font-size: 1.02rem; }

.search-box { position: relative; max-width: 560px; }
.search-box input {
  width: 100%;
  padding: 13px 16px 13px 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--card);
  font-size: 0.95rem;
  color: var(--ink);
  font-family: inherit;
}
.search-box svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); }

/* ---------- Section headings ---------- */
.section { max-width: 1100px; margin: 0 auto; padding: 8px 20px 56px; }
.section__head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 18px; flex-wrap: wrap; gap: 8px;
}
.section__head h2 { font-size: 1.4rem; color: var(--pine); margin: 0; }
.section__head a { font-size: 0.9rem; color: var(--pine); text-decoration: none; border-bottom: 1px solid var(--gold); }

/* ---------- Cards (homepage highlights) ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.entry-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 16px;
  display: flex;
  flex-direction: column;
}
.entry-card h3 { font-size: 1.02rem; color: var(--pine); margin: 0 0 6px; line-height: 1.3; }
.entry-card__meta { font-size: 0.78rem; color: var(--ink-soft); margin-bottom: 10px; }

.access-line {
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin-bottom: 10px;
}
.access-line--flag {
  display: inline-block;
  color: var(--pine);
  background: var(--gold-soft);
  border: 1px solid var(--gold);
  border-radius: 4px;
  padding: 3px 9px;
  font-weight: 600;
}
.entry-card__desc { font-size: 0.88rem; color: var(--ink); margin-bottom: 14px; flex: 1; }
.entry-card__facts { display: flex; flex-wrap: wrap; gap: 10px; font-size: 0.75rem; color: var(--ink-soft); margin-bottom: 12px; }
.entry-card__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.tag { font-size: 0.7rem; padding: 2px 9px; border-radius: 20px; }
.tag--species { background: var(--pine); color: var(--paper); }
.tag--topic { border: 1px solid var(--gold); color: var(--gold); }
.entry-card__cta {
  text-align: center; text-decoration: none; font-size: 0.88rem; font-weight: 500;
  border: 1px solid var(--pine); color: var(--pine); padding: 8px; border-radius: 4px;
}
.entry-card__cta:hover { background: var(--pine); color: var(--paper); }

.report-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.72rem;
  color: var(--ink-soft);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-align: center;
}
.entry-table .report-link {
  font-size: 0.7rem;
  margin-top: 2px;
}

/* ---------- Browse layout ---------- */
.browse-layout { display: flex; gap: 32px; align-items: flex-start; }
.filters { width: 240px; flex-shrink: 0; position: sticky; top: 90px; }
.filters__section { padding: 14px 0; border-bottom: 1px solid var(--line); }
.filters__section h4 { font-size: 0.85rem; color: var(--pine); margin: 0 0 8px; font-weight: 600; }
.filters__toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  margin-bottom: 8px;
}
.filters__toggle h4 { margin: 0; }
.filters__chevron { color: var(--ink-soft); transition: transform 0.15s ease; flex-shrink: 0; }
.filters__chevron.open { transform: rotate(180deg); }
.filters__count {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--paper);
  background: var(--gold);
  border-radius: 20px;
  padding: 1px 7px;
}
.filters__content.collapsed { display: none; }

.filters-toggle-all {
  display: none;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--pine);
  cursor: pointer;
  margin-bottom: 14px;
}
.filters-toggle-all span { display: flex; align-items: center; gap: 8px; }

@media (max-width: 780px) {
  .filters-toggle-all { display: flex; }
  .filters-body.collapsed { display: none; }
}
.filters label { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; padding: 4px 0; cursor: pointer; }
.filters select {
  width: 100%; padding: 7px; border: 1px solid var(--line); border-radius: 4px;
  background: var(--card); font-family: inherit; font-size: 0.85rem;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn {
  font-size: 0.8rem; padding: 5px 12px; border-radius: 20px; border: 1px solid var(--line);
  background: transparent; color: var(--ink); cursor: pointer; font-family: inherit;
}
.chip-btn.active { background: var(--pine); border-color: var(--pine); color: var(--paper); }
.clear-filters {
  width: 100%; margin-top: 12px; padding: 8px; font-size: 0.85rem; border-radius: 4px;
  border: 1px solid var(--gold); color: var(--gold); background: transparent; cursor: pointer; font-family: inherit;
}

.results-count { font-size: 0.88rem; color: var(--ink-soft); margin-bottom: 12px; }

/* The table lives in its own scrolling box (like a frozen header in a
   spreadsheet) rather than relying on the whole page's scroll position.
   This avoids the header needing to guess the site nav's exact height,
   and keeps it correctly pinned even when a row wraps onto several lines. */
.table-wrap {
  overflow: auto;
  max-height: 72vh;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.entry-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; background: var(--card); }
.entry-table th, .entry-table td {
  text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top;
}
.entry-table thead {
  position: sticky;
  top: 0;
  z-index: 5;
}
.entry-table th {
  font-size: 0.75rem; color: var(--ink-soft); font-weight: 600; cursor: pointer; user-select: none;
  background: var(--paper);
  box-shadow: 0 1px 0 var(--line);
}
.entry-table th:hover { color: var(--pine); }
.entry-table tr:hover td { background: rgba(31,59,52,0.04); }
.entry-table td.title-cell { font-family: 'Lora', serif; color: var(--pine); max-width: 260px; }
.title-cell--expandable { cursor: pointer; }
.title-cell--expandable:hover { text-decoration: underline; text-decoration-color: var(--gold); }
.title-cell__chevron {
  display: inline-block;
  font-size: 0.7rem;
  color: var(--gold);
  margin-right: 4px;
  transition: transform 0.15s ease;
}
.title-cell__chevron.open { transform: rotate(90deg); }
.description-row td {
  background: var(--paper);
  font-size: 0.88rem;
  color: var(--ink);
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.description-row strong { color: var(--pine); }
.entry-table .row-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.entry-table .row-tags--stack { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.col-topic { max-width: 150px; }
.col-species { max-width: 130px; }

.badge-sponsored {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--pine);
  background: var(--gold-soft);
  border: 1px solid var(--gold);
  border-radius: 3px;
  padding: 1px 6px;
  margin-left: 6px;
  vertical-align: middle;
  white-space: normal;
}
.entry-table a.view-link { color: var(--pine); border-bottom: 1px solid var(--gold); text-decoration: none; white-space: nowrap; }
.entry-table tr.row--live { background: var(--live-bg); }
.entry-table tr.row--live:hover td { background: rgba(168,70,27,0.08); }
.entry-table tr.row--inperson { background: var(--inperson-bg); }
.entry-table tr.row--inperson:hover td { background: rgba(53,96,122,0.08); }
.badge-live {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--paper);
  background: var(--live-text);
  border-radius: 3px;
  padding: 1px 7px;
  margin-left: 6px;
  vertical-align: middle;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge-inperson {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--paper);
  background: var(--inperson-text);
  border-radius: 3px;
  padding: 1px 7px;
  margin-left: 6px;
  vertical-align: middle;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.empty-state { text-align: center; padding: 60px 20px; background: var(--card); border: 1px solid var(--line); border-radius: 4px; }
.empty-state h3 { color: var(--pine); font-size: 1.1rem; }
.loading-state { text-align: center; padding: 60px 20px; color: var(--ink-soft); }

.site-footer { border-top: 1px solid var(--line); padding: 24px 20px; text-align: center; color: var(--ink-soft); font-size: 0.82rem; }
.site-footer a { color: var(--pine); border-bottom: 1px solid var(--gold); text-decoration: none; }

@media (max-width: 780px) {
  .browse-layout { flex-direction: column; }
  .filters { width: 100%; position: static; }
  .table-wrap { max-height: 60vh; }
  .entry-table thead { position: static; }
}

/* ---------- Wide layout for the browse page ---------- */
.section--wide { max-width: 1600px; }

/* ---------- Mobile-only subtitle shown under the title, replacing hidden columns ---------- */
.title-cell__meta {
  display: none;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.76rem;
  color: var(--ink-soft);
  margin-top: 3px;
}

@media (max-width: 900px) {
  .col-provider, .col-speakers, .col-account { display: none; }
  .title-cell__meta { display: block; }
}

/* ---------- Long-form content pages (About, etc.) ---------- */
.prose { max-width: 68ch; margin: 0 auto; padding: 8px 20px 64px; }
.prose h2 { color: var(--pine); font-size: 1.3rem; margin-top: 36px; }
.prose p { margin-bottom: 16px; }
.prose a { color: var(--pine); border-bottom: 1px solid var(--gold); text-decoration: none; }

.cta-button {
  display: inline-block;
  background: var(--pine);
  color: var(--paper);
  padding: 12px 22px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  margin-top: 8px;
}
.cta-button:hover { background: var(--pine-light); }

/* ---------- Upcoming & Live calendar ---------- */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}
.calendar-daylabel {
  background: var(--paper);
  padding: 8px 6px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-soft);
  text-align: center;
}
.calendar-cell {
  background: var(--card);
  min-height: 90px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.calendar-cell--blank { background: var(--paper); }
.calendar-cell--today { background: var(--gold-soft); }
.calendar-daynum { font-size: 0.75rem; color: var(--ink-soft); font-weight: 600; margin-bottom: 2px; }
.calendar-entry {
  display: block;
  font-size: 0.68rem;
  background: var(--pine);
  color: var(--paper);
  border-radius: 3px;
  padding: 3px 5px;
  text-decoration: none;
  white-space: normal;
  word-break: break-word;
  line-height: 1.25;
}
.calendar-more { font-size: 0.65rem; color: var(--ink-soft); }

.desc-toggle {
  background: none;
  border: none;
  color: var(--pine);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-decoration-color: var(--gold);
}

@media (max-width: 700px) {
  .calendar-cell { min-height: 56px; }
  .calendar-entry { font-size: 0.6rem; }
}
