/* /css/resources.css — Phase 12 resources page styles.
   Extends css/style.css's design tokens (D-11). Does NOT redefine --theme-bg etc.
   View-type renderers (.view-list, .view-kanban, .view-embed-grid) ship in Plan 12-03 — NOT here.
*/

/* Ensure the full viewport uses the theme dark background, not browser-default white */
html, body { background: var(--theme-bg, #0a0e17); }

/* --- Container ------------------------------------------------------------ */
.resources-container {
  max-width: 32rem;           /* roughly matches main-page button column width */
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
  color: var(--theme-text, #ffffff);
  background: var(--theme-bg, #000000);
  min-height: 100vh;
  font-family: var(--font-body, system-ui, sans-serif);
}

/* --- Hero ----------------------------------------------------------------- */
.resources-hero {
  position: relative;
  margin: 0 -1rem 1.5rem;     /* full-bleed on small screens */
  padding: 2rem 1rem 1.5rem;
  border-radius: 0 0 1rem 1rem;
  background-color: var(--theme-card, rgba(255,255,255,0.04));
  background-size: cover;
  background-position: center;
  min-height: 9rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.25rem;
}
.resources-hero--has-image {
  /* darken cover slightly so white text reads */
  box-shadow: inset 0 0 0 100vmax rgba(0,0,0,0.35);
}
.resources-hero__title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--theme-text, #ffffff);
}
.resources-hero__subtitle {
  margin: 0;
  font-size: 0.95rem;
  opacity: 0.85;
  color: var(--theme-text, #ffffff);
}

/* --- Intro callout -------------------------------------------------------- */
.resources-intro {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.875rem 1rem;
  margin: 0 0 1.5rem;
  border-radius: 0.5rem;
  background: rgba(59, 130, 246, 0.18);    /* Notion-style blue tint; intentionally subtle */
  border: 1px solid rgba(59, 130, 246, 0.32);
}
.resources-intro__icon {
  font-size: 1.25rem;
  flex: 0 0 auto;
  line-height: 1.2;
}
.resources-intro__text {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--theme-text, #ffffff);
}

/* --- Sections wrapper ----------------------------------------------------- */
.resources-sections {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-bottom: 2.5rem;
}
.resources-empty {
  text-align: center;
  opacity: 0.6;
  font-size: 0.9rem;
}

/* --- Support footer ------------------------------------------------------- */
.resources-support {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.875rem;
  margin-top: 2rem;
  padding: 1.5rem 1rem;
  text-align: center;
}
.resources-support__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}
.resources-support__qr {
  width: 9rem;
  height: 9rem;
  object-fit: contain;
  border-radius: 0.5rem;
  background: rgba(255,255,255,0.04);
  padding: 0.5rem;
}

/* --- View renderer headings (shared shape across all 3 view types) -------- */
.view-list__heading {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 600;
  opacity: 0.9;
}

/* --- View: List ----------------------------------------------------------- */
.view-list { /* heading already styled by .view-list__heading above */ }
.view-list__items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}
.view-list__item {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.view-list__item:last-child { border-bottom: 0; }
.resource-icon {
  flex: 0 0 auto;
  font-size: 1.125rem;
  line-height: 1.2;
}
.resource-link {
  color: var(--theme-accent, #6ea8ff);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  flex: 1 1 16rem;
  word-break: break-word;
}
.resource-link:hover,
.resource-link:focus-visible {
  text-decoration-thickness: 2px;
}
.resource-desc {
  flex: 1 1 100%;
  margin-left: 1.75rem;        /* aligns under the link, not under the emoji */
  opacity: 0.7;
  font-size: 0.85rem;
  line-height: 1.4;
}

/* --- View: Kanban --------------------------------------------------------- */
.view-kanban__heading {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 600;
  opacity: 0.9;
}
.kanban-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}
.kanban-card {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  padding: 0.875rem;
  border-radius: 0.5rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}
.kanban-card .resource-icon { font-size: 1.25rem; }
.kanban-card .resource-link { flex: 0 1 auto; }
.kanban-card .resource-desc { margin-left: 0; }

/* --- View: Embed-grid ---------------------------------------------------- */
.view-embed-grid__heading {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 600;
  opacity: 0.9;
}
.embed-grid-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
@media (min-width: 640px) {
  .embed-grid-row {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}
.embed-grid-card { /* inherits .kanban-card */ }
.embed-slot {
  width: 100%;
  min-width: 0;
  min-height: 0;
}

/* --- Plan 12-04: Embed iframe sizing per type --------------------------- */
/* aspect-ratio is also set inline by renderEmbed() for belt-and-braces CLS prevention;
   these rules enforce the visual cap and keep layout consistent across both rendered branches. */
.embed-slot iframe {
  display: block;
  width: 100%;
  margin: 0 auto;
  border: 0;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.04);
}
.embed-slot[data-embed-type="tiktok"] iframe {
  max-width: 325px;
  aspect-ratio: 325 / 580;
}
.embed-slot[data-embed-type="instagram"] iframe {
  max-width: 328px;
  aspect-ratio: 328 / 540;
}

/* --- Plan 12-04: Embed fallback (thumbnail link OR text-only) ---------- */
.embed-fallback-link {
  display: block;
  text-align: center;
  text-decoration: none;
  color: var(--theme-accent, #6ea8ff);
}
.embed-fallback-thumb {
  display: block;
  width: 100%;
  max-width: 328px;
  height: auto;
  margin: 0 auto;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.04);
}
.embed-fallback-link--text-only {
  padding: 1rem;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 0.5rem;
}

/* --- Avatar-bio (profile header) ------------------------------------------ */
/* Loaded async from /config.json after the page renders — slot stays empty on fetch failure */
.resources-avatar-bio {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.25rem 0 0.5rem;
  gap: 0.35rem;
}
.resources-avatar-bio .avatar-link {
  display: inline-block;
  text-decoration: none;
}
/* Scale the avatar-wrap ring down from the main page's 8rem to 5rem.
   isolation: isolate creates a local stacking context so the z-index:-1 ::before ring
   paints within this context (above the page background) rather than behind it. */
.resources-avatar-bio .avatar-wrap {
  width: 5rem;
  height: 5rem;
  margin-bottom: 0.5rem;
  isolation: isolate;
}
.resources-avatar-bio .avatar {
  width: 5rem;
  height: 5rem;
}
.resources-avatar-bio .profile-name {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--theme-text, #fff);
}
.resources-avatar-bio .profile-bio {
  margin: 0.25rem 0 0;
  font-size: 0.88rem;
  color: var(--theme-text-secondary, #dde2ec);
  max-width: 22rem;
}

/* --- "Free Resources" section heading between bio and intro callout ------- */
.resources-page-heading {
  text-align: center;
  margin: 1rem 0 0.75rem;
}
