/* =========================
   0) LOCAL FONTS (Poppins)
   ========================= */
@font-face {
  font-family: "Poppins";
  src: url("assets/fonts/Poppins-Light.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Poppins";
  src: url("assets/fonts/Poppins-LightItalic.woff") format("woff");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Poppins";
  src: url("assets/fonts/Poppins-Regular.woff") format("woff");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Poppins";
  src: url("assets/fonts/Poppins-Medium.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Poppins";
  src: url("assets/fonts/Poppins-SemiBold.woff") format("woff");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

/* =========================================
   1) DESIGN TOKENS — EDIT THESE TO TWEAK
   ========================================= */
:root{
  /* container */
  --maxw: 1000px;
  --page-pad: 24px;

  /* spacing */
  --space-1: 6px;
  --space-2: 12px;
  --space-3: 16px;
  --space-4: 24px;
  --space-6: 32px;
  --space-8: 48px;

  /* color */
  --ink: #111;
  --muted: #555;
  --bg: #fafafa;
  --line: #e6e6e6;
  --accent: #0b5cff; /* optional */

  /* typography scale */
  --fs-title: clamp(1.5rem, 2.5vw, 2.0rem);
  --fs-subtitle: clamp(1rem, 1.6vw, 1.2rem);
  --fs-h1: clamp(1.25rem, 2vw, 1.6rem);
  --fs-h2: clamp(1.05rem, 1.7vw, 1.25rem);
  --fs-h3: clamp(1rem, 1.3vw, 1.05rem);
  --fs-body: 1rem;
  --fs-quote: 1rem;
  --fs-code: 0.95rem;

  /* weights */
  --wt-title: 800;
  --wt-subtitle: 400;
  --wt-h1: 800;
  --wt-h2: 700;
  --wt-h3: 500;
  --wt-body: 400;
  --wt-quote: 400;
  --wt-code: 400;

  /* line-heights */
  --lh-body: 1.65;
  --lh-heading: 1.25;

  /* corners and shadows */
  --radius: 14px;
  --shadow: 0 6px 18px rgba(0,0,0,.06);
}

/* ===================
   2) GLOBAL ELEMENTS
   =================== */
*{ box-sizing:border-box; }
html, body{ margin:0; padding:0; }
body{
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--ink);
  background: var(--bg);
}
.wrapper{
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--page-pad);
}

/* ============================
   3) TYPOGRAPHIC HIERARCHY
   (you can use elements or the
   matching utility classes)
   ============================ */

/* Title (site or page hero) */
.title{
  font-size: var(--fs-title);
  font-weight: var(--wt-title);
  line-height: var(--lh-heading);
  margin: 0 0 var(--space-1);
}
.subtitle{
  font-size: var(--fs-subtitle);
  font-weight: var(--wt-subtitle);
  color: var(--muted);
  margin: 0 0 var(--space-4);
}

/* Headings */
h1, h2, h3{
  line-height: var(--lh-heading);
  margin: var(--space-6) 0 var(--space-2);
}
h1{ font-size: var(--fs-h1); font-weight: var(--wt-h1); }
h2{ font-size: var(--fs-h2); font-weight: var(--wt-h2); }
h3{ font-size: var(--fs-h3); font-weight: var(--wt-h3); }

/* Body text */
p{ margin: var(--space-2) 0; font-weight: var(--wt-body); }

/* Quote */
.quote{
  border-left: 4px solid var(--line);
  padding: var(--space-2) var(--space-4);
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.quote p{ font-size: var(--fs-quote); font-weight: var(--wt-quote); margin: 0; }
.quote cite{ display:block; margin-top: var(--space-1); color: var(--muted); font-style: italic; }

/* Inline code + code blocks */
code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: var(--fs-code);
  background: #f0f2f5;
  padding: 0 .35em;
  border-radius: 6px;
}

pre.code,
pre[class*="language-"] {
  max-width: 680px;        /* adjust width you want */
  margin: 1em auto;        /* centers the whole block */
  padding: var(--space-3); /* or a fixed value like 12px */
  background: #f0f2f5;     /* optional – remove if you already theme via Prism */
  border-radius: var(--radius);
  overflow: auto;          /* safe horizontal scroll if needed */
  text-align: left;        /* code text stays left-aligned */
}

pre.code code{ background: transparent; padding: 0; display: block; }

/* =================
   4) NAV + FOOTER
   ================= */
.site-header{ margin-bottom: var(--space-6); }
.main-nav ul{
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.main-nav a{
  color: var(--ink);
  text-decoration: none;
  opacity: .85;
}
.main-nav a:hover{ opacity: 1; text-decoration: underline; }
.main-nav a[aria-current="page"]{ font-weight: 700; }

.site-footer{
  margin-top: var(--space-8);
  color: var(--muted);
}

/* ==========================
   5) GRID (2–3 columns)
   ========================== */
.grid{ display: grid; gap: var(--space-2); }
.grid.cols-2{ grid-template-columns: 1fr; }
.grid.cols-3{ grid-template-columns: 1fr; }
@media (min-width: 800px){
  .grid.cols-2{ grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid.cols-3{ grid-template-columns: repeat(3, minmax(0,1fr)); }
}

/* Make 3-column grid cards larger */
.grid.cols-3 .card {
  min-width: 0;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  font-size: 1.08rem;
}
.grid.cols-3 img {
  width: 100%;
  height: auto;
  cursor: zoom-in;
  transition: box-shadow 0.2s;
}
.grid.cols-3 img:hover {
  box-shadow: 0 0 0 4px var(--accent);
}

/* Center images and text in 2 and 3 column card layouts */
.grid.cols-2 .card, .grid.cols-3 .card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.grid.cols-2 .card img, .grid.cols-3 .card img {
  margin: 0 auto;
}

/* Cards / media blocks */
.card{
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-2);
  box-shadow: var(--shadow);
  justify-content: center;
  align-items: center;
}
.card.centered{
  max-width: 780px;
  margin: var(--space-4) auto; /* center horizontally with vertical spacing */
}
/* Hide legacy monolithic block (kept for reference) */
.legacy-block{ display:none; }
.card img{ width: 100%; height: auto; border-radius: 10px; display:block; }
.card figcaption{ margin-top: var(--space-2); color: var(--muted); text-align: center; }

/* ==========================
   6) MULTI-COLUMN TEXT
   ========================== */
.text-columns.two{ column-count: 1; column-gap: var(--space-6); }
.text-columns.three{ column-count: 1; column-gap: var(--space-6); }
@media (min-width: 900px){
  .text-columns.two{ column-count: 2; }
  .text-columns.three{ column-count: 3; }
}


/* ==========================
   7) 3×3 nav grid (GIFs with overlay title)
   ========================== */
/* 3×3 nav grid (GIFs with overlay title) */
.grid-nav{
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(1, minmax(0,1fr));
}
@media (min-width: 800px){
  .grid-nav{ grid-template-columns: repeat(3, minmax(0,1fr)); }
}

.tile{
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  display: block; /* make anchor fill */
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  outline: none;
}
.tile img{
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tile video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;   /* keeps aspect ratio and fills tile */
}
.tile .overlay{
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(0,0,0,0);
  opacity: 0;
  transition: opacity .2s ease, background-color .2s ease;
  padding: var(--space-4);
  text-align: center;
}
.tile .overlay .label{
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1.3;
}
.tile:hover .overlay,
.tile:focus-visible .overlay{
  opacity: 1;
  background: rgba(0,0,0,.45);
}
.tile:focus-visible{
  box-shadow: 0 0 0 3px rgba(11,92,255,.6);
}

/* Week 3: media containment */
.card { 
  overflow: hidden;        /* clips media to card’s rounded corners */
}

.card video {
  display: block;
  width: 100%;
  height: auto;            /* keeps aspect ratio */
  max-width: 100%;
  object-fit: contain;     /* ensures whole frame fits inside */
  border-radius: 10px;     /* match your image rounding, adjust if needed */
}

/* Lightbox image: center and shrink so overlay is clickable */
.lightbox img {
  max-width: 80vw;
  max-height: 80vh;
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
  display: block;
  margin: auto;
  pointer-events: auto;
}

/* Lightbox overlay: ensure it covers the entire viewport and is clickable */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: grid;
  place-items: center;
  z-index: 1000;
  pointer-events: auto;
}

/* Ensure the lightbox itself registers clicks */
.lightbox[hidden] {
  display: none;
}
.legacy-block{ display:none; }
/* Hide any old monolithic code block that directly follows the parts list on Week 3 */
#week3 ol + figure.card.centered{ display:none; }
