/* Print layout for marketing case study pages (body.case-study-page) */

@media print {
  @page {
    margin: 1.4cm 1.6cm;
    size: A4;
  }

  html {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body.case-study-page {
    background: #fff !important;
    color: #1c1917 !important;
    font-size: 11pt;
    line-height: 1.45;
  }

  body.case-study-page .dark,
  body.case-study-page.dark {
    color-scheme: light;
  }

  /* Site chrome */
  body.case-study-page > a[href="#main-content"],
  body.case-study-page > header,
  body.case-study-page > footer,
  body.case-study-page .document-print-actions,
  body.case-study-page .navbar-actions,
  body.case-study-page .theme-toggle {
    display: none !important;
  }

  body.case-study-page #main-content {
    max-width: none;
    padding: 0 !important;
  }

  body.case-study-page #main-content > div {
    max-width: none;
    padding: 0 !important;
  }

  /* Typography */
  body.case-study-page h1 {
    font-size: 20pt;
    color: #1c1917 !important;
  }

  body.case-study-page h2,
  body.case-study-page h3 {
    color: #1c1917 !important;
    break-after: avoid;
  }

  body.case-study-page p {
    color: #292524 !important;
  }

  /* Override dark mode — paper is always light */
  html.dark body.case-study-page .bg-white,
  html.dark body.case-study-page .bg-white\/85,
  html.dark body.case-study-page .bg-white\/80 {
    background-color: #fff !important;
  }

  html.dark body.case-study-page .bg-stone-50,
  html.dark body.case-study-page .bg-stone-50\/90,
  html.dark body.case-study-page .bg-stone-100 {
    background-color: #f5f5f4 !important;
  }

  html.dark body.case-study-page .bg-accent-50,
  html.dark body.case-study-page .bg-accent-50\/35 {
    background-color: #fff7ed !important;
  }

  html.dark body.case-study-page .text-stone-900 {
    color: #1c1917 !important;
  }

  html.dark body.case-study-page .text-stone-800,
  html.dark body.case-study-page .text-stone-700 {
    color: #292524 !important;
  }

  html.dark body.case-study-page .text-stone-600,
  html.dark body.case-study-page .text-stone-500 {
    color: #57534e !important;
  }

  html.dark body.case-study-page .text-brand-700 {
    color: #1d4ed8 !important;
  }

  html.dark body.case-study-page .text-accent-700,
  html.dark body.case-study-page .text-accent-900 {
    color: #c2410c !important;
  }

  html.dark body.case-study-page .border-stone-200,
  html.dark body.case-study-page .border-stone-200\/80,
  html.dark body.case-study-page .border-stone-100,
  html.dark body.case-study-page .border-accent-100 {
    border-color: #d6d3d1 !important;
  }

  html.dark body.case-study-page .ring-stone-100,
  html.dark body.case-study-page .ring-stone-900\/5,
  html.dark body.case-study-page .ring-accent-200\/80 {
    --tw-ring-color: #d6d3d1 !important;
  }

  /* Feature cards (e.g. Why teams adopt ALDAS) */
  body.case-study-page article ul.space-y-3 > li {
    background: #fafaf9 !important;
    border: 1px solid #d6d3d1 !important;
    box-shadow: none !important;
    --tw-ring-width: 0 !important;
    color: #292524 !important;
    break-inside: avoid;
  }

  body.case-study-page article ul.space-y-3 > li > span:last-child {
    color: #292524 !important;
  }

  body.case-study-page article ul.space-y-3 > li > span[aria-hidden="true"] {
    color: #1d4ed8 !important;
  }

  /* Org / tag pills */
  body.case-study-page article .rounded-full.bg-accent-50 {
    background: #fff7ed !important;
    color: #9a3412 !important;
    border: 1px solid #fed7aa !important;
    --tw-ring-color: #fdba74 !important;
  }

  body.case-study-page nav[aria-label="Breadcrumb"] {
    margin-bottom: 0.75rem;
    font-size: 9pt;
    color: #57534e !important;
  }

  body.case-study-page nav[aria-label="Breadcrumb"] a {
    color: #1d4ed8 !important;
    text-decoration: none;
  }

  body.case-study-page article > header {
    border-bottom-color: #d6d3d1 !important;
    padding-bottom: 0.75rem;
    break-after: avoid;
  }

  /* Layout: single column */
  body.case-study-page article .grid {
    display: block !important;
  }

  body.case-study-page article .grid > * {
    margin-bottom: 1rem;
  }

  body.case-study-page article .lg\:grid-cols-2 > * + * {
    margin-top: 1rem;
  }

  /* Figures and placeholders */
  body.case-study-page figure {
    break-inside: avoid;
    margin: 1rem 0;
    border-color: #d6d3d1 !important;
    box-shadow: none !important;
    background: #fff !important;
  }

  body.case-study-page figure img {
    max-width: 100% !important;
    height: auto !important;
  }

  body.case-study-page figure .aspect-\[4\/3\],
  body.case-study-page figure .aspect-\[16\/10\],
  body.case-study-page figure [class*="aspect-"] {
    aspect-ratio: auto !important;
    min-height: 0 !important;
  }

  body.case-study-page figure .bg-gradient-to-br,
  body.case-study-page figure .border-dashed {
    border-style: solid !important;
    border-color: #d6d3d1 !important;
    background: #fafaf9 !important;
    padding: 0.5rem 0 !important;
  }

  body.case-study-page figcaption {
    background: #f5f5f4 !important;
    color: #57534e !important;
    border-top-color: #e7e5e4 !important;
  }

  /* Expand “What we'd explore first” for paper */
  body.case-study-page .case-study-explore {
    break-inside: avoid;
    margin-top: 1.25rem;
  }

  body.case-study-page .case-study-explore__details {
    border: 1px solid #d6d3d1 !important;
    background: #fff !important;
    box-shadow: none !important;
  }

  body.case-study-page .case-study-explore__summary {
    padding: 0.65rem 0.85rem;
    pointer-events: none;
  }

  body.case-study-page .case-study-explore__chevron {
    display: none !important;
  }

  body.case-study-page .case-study-explore__panel {
    display: block !important;
    border-top-color: #e7e5e4 !important;
  }

  body.case-study-page .case-study-explore__phases {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 0.65rem !important;
  }

  body.case-study-page .case-study-explore__phase {
    border-color: #e7e5e4 !important;
    background: #fafaf9 !important;
    padding: 0.55rem 0.65rem;
  }

  /* Article footer CTA — contact only */
  body.case-study-page article > footer {
    break-inside: avoid;
    margin-top: 1.25rem;
    padding: 0.75rem 0.85rem !important;
    border: 1px solid #d6d3d1 !important;
    background: #fafaf9 !important;
    border-radius: 0.35rem;
  }

  body.case-study-page article > footer .flex.flex-col,
  body.case-study-page article > footer .sm\:flex-row {
    display: none !important;
  }

  body.case-study-page article > footer::after {
    display: block;
    margin-top: 0.5rem;
    font-size: 9pt;
    color: #57534e;
    content: "Contact: enquire@terrabase.co.uk · 020 7666 3368 · terrabase.co.uk";
  }

  /* Links */
  body.case-study-page a {
    color: #1d4ed8 !important;
    text-decoration: underline;
  }

  body.case-study-page a[href^="mailto:"]::after,
  body.case-study-page a[href^="tel:"]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    font-weight: normal;
    color: #57534e;
  }

  body.case-study-page a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 8.5pt;
    font-weight: normal;
    color: #78716c;
    word-break: break-all;
  }

  body.case-study-page a[href^="#"]::after,
  body.case-study-page a[href^="/"]::after {
    content: none;
  }
}
