/* AI Literacy Lab — resources hub extras
   Only new classes needed for resources.html, videos.html, events.html,
   lives.html, catalogue.html, newsletter.html. Everything else lives in
   styles.css. */

.share {
  display: grid;
  gap: 56px;
}

.tile-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.tile-grid > * { min-width: 0; }

.tile {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  color: var(--ink);
  text-decoration: none;
  min-height: 180px;
}

.tile:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.tile-eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 10px;
}

.tile-title {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1.2rem;
  line-height: 1.3;
  margin: 0 0 8px;
  color: var(--ink);
}

.tile-body {
  color: var(--ink-2);
  margin: 0 0 16px;
  font-size: 0.98rem;
  flex: 1;
}

.tile-cta {
  font-weight: 600;
  color: var(--accent);
  font-size: 0.95rem;
}

.tile--external .tile-cta::after {
  content: " ↗";
  font-weight: 400;
}

/* The element carries both classes and .subhead is declared later with a
   margin shorthand, so it won that cascade and the divider sat flush
   against the cards above. Qualify it so the separation actually applies. */
.subhead.tile-divider {
  margin: 56px 0 18px;
  padding: 32px 0 0;
  border-top: 1px solid var(--border);
}

.tile-grid--secondary {
  grid-template-columns: repeat(3, 1fr);
  margin-top: 0;
}

.subhead {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1.05rem;
  margin: 0 0 18px;
  color: var(--ink);
}

/* Videos page */
.video-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.video-grid > * { min-width: 0; }

.video-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  color: var(--ink);
  text-decoration: none;
}

.video-card:hover { border-color: var(--accent); text-decoration: none; }

.video-thumb {
  position: relative;
  aspect-ratio: 9 / 16;      /* these are vertical shorts */
  background: var(--tint);
  overflow: hidden;
}

.video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.video-body {
  padding: 18px 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.video-title {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.35;
  margin: 0;
  color: var(--ink);
}

.video-meta {
  color: var(--ink-2);
  font-size: 0.88rem;
  margin: 0;
}

/* Events page */
.event-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 18px;
}

.event-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 26px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 160px 1fr auto;
  gap: 24px;
  align-items: center;
}

.event-card > * { min-width: 0; }

.event-date {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  line-height: 1.2;
  color: var(--accent);
  margin: 0;
}

.event-date time {
  display: block;
  font-weight: 400;
}

.event-date span {
  display: block;
  font-size: 0.85rem;
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-top: 6px;
}

.event-title {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1.1rem;
  line-height: 1.3;
  margin: 0 0 6px;
  color: var(--ink);
}

.event-desc {
  color: var(--ink-2);
  margin: 0;
  font-size: 0.98rem;
}

.event-cta {
  align-self: center;
  white-space: nowrap;
}

@media (max-width: 860px) {
  .event-card {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .event-cta { align-self: flex-start; }
}

/* Lives page */
.live-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--deep);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 0 0 32px;
  box-shadow: var(--shadow);
}

.live-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.live-title {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1.05rem;
  margin: 0 0 16px;
  color: var(--ink);
}

/* Catalogue page */
.cat-controls {
  display: grid;
  gap: 16px;
  margin: 0 0 28px;
  padding: 20px 22px;
  background: var(--paper-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.cat-search {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.cat-search label {
  flex: 1 1 220px;
  min-width: 0;
}

.cat-search input {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 16px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  min-height: 48px;
}

.cat-search input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-color: var(--accent);
}

.cat-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cat-filter {
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  min-height: 40px;
}

.cat-filter:hover { border-color: var(--accent); }

.cat-filter[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

.cat-count {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.95rem;
}

.cat-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.cat-grid > * { min-width: 0; }

.cat-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cat-card h3 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.3;
  margin: 0;
  color: var(--ink);
}

.cat-provider {
  font-size: 0.85rem;
  color: var(--ink-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  margin: 0;
}

.cat-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cat-meta li {
  font-size: 0.85rem;
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--ink-2);
  background: var(--paper-alt);
}

.cat-desc {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.95rem;
}

.cat-more {
  margin-top: 28px;
  text-align: center;
}

/* Newsletter page */
.news-form {
  display: grid;
  gap: 16px;
  max-width: 520px;
  margin: 0 0 28px;
  padding: 28px;
  background: var(--paper-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.news-field {
  display: grid;
  gap: 6px;
}

.news-field label {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
}

.news-field input {
  font-family: var(--font-sans);
  font-size: 16px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  min-height: 48px;
}

.news-field input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-color: var(--accent);
}

.news-submit { width: auto; justify-self: start; }

.news-status {
  margin: 0;
  padding: 14px 18px;
  border-radius: 8px;
  font-size: 0.98rem;
  display: none;
}

.news-status[data-state="ok"] {
  display: block;
  background: var(--tint);
  color: var(--accent);
  border: 1px solid var(--accent);
}

.news-status[data-state="err"] {
  display: block;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid #b94a4a;
}

.news-status a { color: var(--accent); }

.news-perks {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.news-perks li {
  padding-left: 24px;
  position: relative;
  color: var(--ink-2);
}

.news-perks li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--accent);
}

/* Empty + error state */
.empty-state {
  margin: 0;
  padding: 28px;
  background: var(--paper-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--ink-2);
  text-align: center;
}

.empty-state a { color: var(--accent); font-weight: 600; }

/* Loading pulse */
.loading {
  margin: 0;
  padding: 28px;
  background: var(--paper-alt);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--ink-2);
  text-align: center;
}

/* Page intro */
.page-intro {
  margin: 0 0 40px;
  max-width: 60ch;
  color: var(--ink-2);
  font-size: 1.05rem;
}

.page-intro h1 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 1.1;
  margin: 0 0 16px;
  color: var(--ink);
}

.page-intro .kicker {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

/* Responsive */
@media (max-width: 860px) {
  .tile-grid,
  .tile-grid--secondary,
  .cat-grid {
    grid-template-columns: 1fr;
  }
  .video-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .live-frame { margin: 0 0 24px; }
}

@media (max-width: 480px) {
  .news-form { padding: 22px; }
  .news-submit { width: 100%; }
  .cat-controls { padding: 16px; }
}

@media (max-width: 400px) {
  .wrap { padding: 0 18px; }
}

.news-sub { color: var(--ink-2); margin: -6px 0 14px; }
.news-byline { color: var(--ink-2); font-size: 0.95rem; margin-top: 22px; max-width: 62ch; }
.news-perks strong { color: var(--ink); }

.videos-more { margin-top: 36px; text-align: center; }

.lives-cta {
  margin-top: 34px; padding-top: 28px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.lives-cta p { margin: 0; color: var(--ink-2); }

.chip, .tile-eyebrow + .chip, .cat-chip, .cat-tag { background: var(--paper-alt); color: var(--ink); }

/* ─── Equal-height tiles (29 Jul 2026) ────────────────────────────────
   Two separate reasons a box came out short. The tile is a flex column
   inside its <li>, and the <li> stretched to the row while the tile kept
   its content height ("Reports" sat 26px shorter than its neighbours), so
   the tile now fills the cell. And rows sized independently, so a short
   final row ("GitHub") sat above the row before it: grid-auto-rows equalises
   them. Multi-column only, since in the single-column stack below 861px
   equal heights would just pad dead space under every short tile. */
.tile-grid > li { display: flex; }
.tile-grid .tile { flex: 1; }
@media (min-width: 861px) {
  .tile-grid,
  .tile-grid--secondary { grid-auto-rows: 1fr; }
}
