/* ============================================================================
   Nusrat Jahan Mahi — Portfolio · Print styles  →  clean, paginated A4 PDF
   Continuous per-year flow fills pages; a running medium name sits in the top
   margin of every page (set via string-set, rendered by Paged.js in build_pdf).
============================================================================ */
@page{
  size:A4; margin:17mm 14mm 15mm;
  @top-left{ content:string(medhead); font-family:'Inter',sans-serif; font-size:7pt;
    letter-spacing:.22em; text-transform:uppercase; color:#b1532f; }
  @top-right{ content:string(yearhead); font-family:'Cormorant Garamond',serif;
    font-size:10pt; font-style:italic; color:#8a8175; }
  @bottom-left{ content:"Nusrat Jahan Mahi"; font-family:'Inter',sans-serif;
    font-size:6.5pt; letter-spacing:.16em; text-transform:uppercase; color:#a59c8d; }
  @bottom-right{ content:counter(page); font-family:'Inter',sans-serif;
    font-size:8.5pt; color:#8a8175; }
}
@page :first{ margin:0;
  @top-left{content:none} @top-right{content:none}
  @bottom-left{content:none} @bottom-right{content:none} }

@media print{
  :root{ --paper:#ffffff; }
  html,body{ background:#fff !important; }
  body{ font-size:10.5pt; }
  body::before{ display:none; }
  *{ -webkit-print-color-adjust:exact !important; print-color-adjust:exact !important; }

  .nav,.lb,.cover .scroll{ display:none !important; }
  .reveal{ opacity:1 !important; transform:none !important; }
  .wrap{ max-width:none; padding:0; margin:0; }

  /* ---- cover: own clean page, no running head ------------------------- */
  .cover{ min-height:auto; height:296mm; padding:0 14mm; }
  .cover h1{ font-size:58pt; }
  .cover .rule{ background:var(--clay); }
  .cover .portrait-ring{ width:52mm; height:52mm; margin:10mm auto 7mm;
    border-radius:50%; overflow:hidden; padding:0; background:none; box-shadow:none; }
  .cover .portrait{ width:100%; height:100%; object-fit:cover; border-radius:50%; border:0; }
  .cover .kicker{ margin-bottom:4mm; }

  /* ---- year section: starts a fresh page; sets the running heads ------ */
  .section{ break-before:page; page-break-before:always; padding:0; }
  .section-head{ margin:0 0 7mm; padding-top:1mm; }
  .section-head h2{ font-size:24pt; string-set:yearhead content(text); }
  .section-head .num{ font-size:15pt; }
  .section-head .meta{ font-size:7.5pt; }

  /* ---- per-medium galleries flow & fill; labels carry running head ---- */
  .yeargallery{ display:block; }
  .yeargallery .group-label{ display:block; width:100%; box-sizing:border-box; text-align:left;
    font-family:'Inter',sans-serif; font-size:8pt; font-weight:600; letter-spacing:.2em;
    text-transform:uppercase; color:var(--clay); margin:3mm 0 3.5mm;
    padding-bottom:1.5mm; border-bottom:.4pt solid #e4dccb;
    break-after:avoid; page-break-after:avoid; string-set:medhead content(text); }
  .section-head{ break-after:avoid; page-break-after:avoid; }

  .gallery{ columns:2; column-gap:7mm; }            /* masonry fills pages, content-safe */
  .gallery.dense{ columns:3; column-gap:6mm; }      /* poster / colour theory denser */
  .gallery figure.work{ display:block; width:auto; margin:0 0 5mm;
    break-inside:avoid; page-break-inside:avoid; -webkit-column-break-inside:avoid; }
  .gallery figure.work .mat{ display:block; background:#fff; border:1px solid #e4dccb;
    padding:2mm; box-shadow:none; }
  .gallery.dense figure.work .mat{ padding:1.4mm; }
  .gallery figure.work .mat img{ width:100%; height:auto; }

  .keep{ break-inside:avoid; page-break-inside:avoid; }   /* e.g. woodcut together */

  /* ---- closing page, no running head ---------------------------------- */
  .foot{ page:blank; break-before:page; page-break-before:always; margin-top:0;
    border:0; padding-top:70mm; }
  .foot .name{ font-size:22pt; }
}
