/* =============================================================
   Secret Monster Productions — Print / Save-as-PDF Stylesheet
   File: public/styles/print.css
   Linked via <link media="print"> in app/layout.tsx
   Target: project detail pages (/projects/[slug])
   ============================================================= */

/* ── Page setup ─────────────────────────────────────────────── */
@page {
  size: A4;          /* Chrome honours this; Letter fallback: both fit at 12mm margin */
  margin: 12mm;
}

@media print {

  /* Force colours — prevents Chrome from stripping backgrounds */
  *,
  *::before,
  *::after {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* ── Base reset ──────────────────────────────────────────── */
  html,
  body {
    background: #ffffff !important;
    color: #1c1917 !important;   /* stone-950 — matches site body */
    font-size: 10.5pt;
    line-height: 1.55;
  }

  /* Kill all animations / transitions */
  * {
    animation: none !important;
    transition: none !important;
  }

  /* ── Hide non-content chrome ─────────────────────────────── */
  /* nav, grain overlay, scroll widgets etc. use print:hidden in JSX.
     Belt-and-suspenders rules below catch anything missed. */
  header,
  video,
  iframe {
    display: none !important;
  }

  /* Fixed/sticky overlays (grain, scroll indicators, etc.) */
  [style*="position: fixed"],
  [style*="position:fixed"] {
    display: none !important;
  }

  /* ── Hero image section ──────────────────────────────────── */
  #print-hero {
    position: relative !important;
    height: 195px !important;     /* ~52mm — prominent but leaves room for copy */
    overflow: hidden !important;
    page-break-after: avoid !important;
    break-after: avoid !important;
    margin-bottom: 0 !important;
  }

  /* The full-bleed img */
  #print-hero > img:first-child {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
  }

  /* Dark overlay — keep for legibility of title text */
  #print-hero > div:first-of-type {
    position: absolute !important;
    inset: 0 !important;
    background: rgba(0,0,0,0.30) !important;
  }

  /* Bottom gradient on hero */
  #print-hero > div:nth-of-type(2) {
    display: none !important;
  }

  /* Title block */
  #print-hero-title {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    padding: 0 8mm 6mm !important;
    z-index: 10 !important;
  }

  #print-hero-title h1 {
    font-size: 28pt !important;
    line-height: 1 !important;
    color: #ffffff !important;
    text-shadow: 0 2px 12px rgba(0,0,0,0.7) !important;
    margin: 0 !important;
  }

  #print-hero-title .print-genre {
    font-size: 7pt !important;
    letter-spacing: 0.28em !important;
    text-transform: uppercase !important;
    color: rgba(255,255,255,0.65) !important;
    margin-bottom: 4pt !important;
  }

  #print-hero-title .print-tone {
    margin-top: 4pt !important;
    font-size: 7.5pt !important;
    font-family: monospace !important;
    font-weight: 700 !important;
    color: rgba(180,60,50,0.95) !important;
    letter-spacing: 0.12em !important;
  }

  /* ── Stats bar ───────────────────────────────────────────── */
  #print-stats {
    overflow: visible !important;
    border-bottom: 0.75pt solid #d6d3d1 !important;
    margin-bottom: 0 !important;
  }

  #print-stats > div {
    flex-wrap: wrap !important;
    min-width: 0 !important;
    padding: 3mm 0 !important;
    gap: 0 !important;
  }

  /* Individual stat cells */
  #print-stats .stat-cell {
    padding: 0 5mm 0 0 !important;
  }

  #print-stats .stat-label {
    font-size: 6.5pt !important;
    letter-spacing: 0.28em !important;
    text-transform: uppercase !important;
    color: rgba(108,20,30,0.85) !important;
    font-weight: 700 !important;
  }

  #print-stats .stat-value {
    font-size: 8.5pt !important;
    font-family: monospace !important;
    color: #1c1917 !important;
  }

  /* ── Content area — reflow to single column ──────────────── */
  #print-content {
    padding: 0 !important;
    max-width: 100% !important;
  }

  #print-grid {
    display: block !important;   /* override the lg:grid-cols-[1fr_360px] */
  }

  /* ── Left column ─────────────────────────────────────────── */
  #print-main {
    width: 100% !important;
  }

  /* Logline */
  #print-main .print-logline {
    margin: 5mm 0 !important;
    padding-left: 4mm !important;
    border-left: 2pt solid #a8a29e !important;
  }

  #print-main .print-logline p {
    font-size: 11pt !important;
    color: #44403c !important;   /* stone-700 */
    line-height: 1.5 !important;
  }

  /* Section headings (Synopsis, Why We Love, etc.) */
  .print-section-heading {
    font-size: 6.5pt !important;
    letter-spacing: 0.28em !important;
    text-transform: uppercase !important;
    color: rgba(108,20,30,0.85) !important;
    font-weight: 700 !important;
    margin-bottom: 3mm !important;
    page-break-after: avoid !important;
    break-after: avoid !important;
  }

  .print-section {
    margin-bottom: 5mm !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .print-section p {
    font-size: 9pt !important;
    color: #57534e !important;   /* stone-600 */
    line-height: 1.55 !important;
    margin-bottom: 2mm !important;
    orphans: 3;
    widows: 3;
  }

  /* ── Right sidebar ───────────────────────────────────────── */
  #print-sidebar {
    position: static !important;
    width: 100% !important;
    margin-top: 5mm !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 5mm !important;
  }

  #print-sidebar > div {
    border: 0.75pt solid #d6d3d1 !important;
    padding: 4mm !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  /* "Get in Touch" button — hide in print */
  #print-sidebar a[href*="contact"] {
    display: none !important;
  }

  /* Comp title text */
  #print-sidebar .comp-title {
    font-size: 8.5pt !important;
    font-weight: 700 !important;
    color: rgba(108,20,30,0.90) !important;
  }

  #print-sidebar .comp-studio {
    font-size: 7pt !important;
    font-weight: 700 !important;
    color: rgba(108,20,30,0.75) !important;
  }

  #print-sidebar .comp-gross {
    font-size: 7.5pt !important;
    font-family: monospace !important;
    font-weight: 700 !important;
    color: rgba(108,20,30,0.90) !important;
  }

  /* ── Links ───────────────────────────────────────────────── */
  a,
  a:visited {
    color: inherit !important;
    text-decoration: none !important;
  }

  /* ── Prevent orphaned headings / broken sections ─────────── */
  h1, h2, h3, h4 {
    page-break-after: avoid !important;
    break-after: avoid !important;
  }

  img {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

} /* end @media print */
