/* Print styles — loaded via <link media="print">, not in @layer cascade */
/* Strategy: aggressive reset, then build back only what print needs */


/* ============================================
   1. GLOBAL RESET
   ============================================ */

*,
*::before,
*::after {
  background: transparent !important;
  color: #000 !important;
  box-shadow: none !important;
  text-shadow: none !important;
}

/* Meter/progress — hidden, replaced by JS-injected text for print */
meter, progress {
  display: none !important;
}

@page {
  margin: 0.75in 1in;
}

body {
  display: block !important;
  font-size: 11pt;
  line-height: 1.5;
}


/* ============================================
   2. AGGRESSIVE SPACING + FONT RESET
   Strip all component-level spacing and sizing
   so new components start from zero.
   ============================================ */

main *,
.site-header *,
.site-footer * {
  margin: 0 !important;
  padding: 0 !important;
  min-height: 0 !important;
  min-block-size: 0 !important;
  height: auto !important;
  font-size: inherit !important;
  max-inline-size: none !important;
}

/* Flatten the content grid so sections are plain blocks within the @page
   margins (the grid's gutter columns would otherwise inset content further). */
main {
  display: block !important;
}

section,
.site-header,
.site-footer {
  display: block !important;
  text-align: left !important;
}


/* ============================================
   3. HIDE NON-PRINTABLE ELEMENTS
   ============================================ */

.skip-link,
.site-nav-toggle,
site-nav,
.cta,
form,
button,
.hero-bg,
.embed-section,
[style*="aspect-ratio"] {
  display: none !important;
}

/* Hide CTA button wrapper (contents already hidden) */
.cta-block > div > :last-child {
  display: none !important;
}

/* Hide footer nav (redundant in print) */
.site-footer site-nav {
  display: none !important;
}


/* ============================================
   4. HEADER + FOOTER
   ============================================ */

.site-header {
  padding: 0.5rem 0 0 !important;
}

.site-logo {
  font-size: 14pt !important;
}

.site-header::after {
  content: "" !important;
  display: block !important;
  border-bottom: 1px solid #ccc !important;
  margin-block-start: 0.5rem !important;
}

.site-header[data-sticky] {
  position: static !important;
  border: none !important;
}

.site-footer {
  padding: 1rem 0 !important;
}


/* ============================================
   5. SECTION SPACING
   Uniform padding for all sections, then
   overrides for specific section types.
   ============================================ */

main > section {
  padding: 1rem 0 !important;
  border-block-end: 1px solid #ccc !important;
}

/* Remove border on last section (footer has its own separator) */
main > section:last-child {
  border-block-end: none !important;
}

/* Home hero — more breathing room, centered */
.hero {
  display: block !important;
  text-align: center !important;
  padding: 2rem 0 1.5rem !important;
}

.hero p {
  max-inline-size: 40ch !important;
  margin-inline: auto !important;
}

/* Sub-page header */
.page-header {
  padding: 1.25rem 0 !important;
}


/* ============================================
   6. TYPOGRAPHY
   Build back font sizes and spacing from the
   12pt body baseline.
   ============================================ */

h1 {
  font-size: 22pt !important;
}

h2 {
  font-size: 16pt !important;
}

h3 {
  font-size: 13pt !important;
}

h4 {
  font-size: 12pt !important;
}

/* Heading spacing */
h1, h2, h3, h4 {
  margin-block-end: 0.25rem !important;
  text-wrap: balance !important;
}

/* Space above headings when they follow other content */
* + h2 {
  margin-block-start: 1.25rem !important;
}

* + h3 {
  margin-block-start: 1.15rem !important;
}

* + h4 {
  margin-block-start: 0.75rem !important;
}

/* Collapse gap between consecutive headings */
h1 + h2, h1 + h3, h2 + h3, h2 + h4, h3 + h4 {
  margin-block-start: 0.15rem !important;
}

/* Paragraphs */
p {
  margin-block: 0.25rem !important;
  text-wrap: pretty !important;
}

/* Prevent superscript/subscript from affecting line-height */
sup, sub {
  line-height: 0 !important;
}

/* h4 — tight bottom margin */
h4 {
  margin-block-end: -0.15rem !important;
}

/* Lists */
li {
  margin-block: 0.15rem !important;
}

ul, ol {
  padding-inline-start: 1.5rem !important;
}

/* Description lists */
dt {
  font-weight: bold !important;
  margin-block-start: 0.5rem !important;
}

dd {
  margin-inline-start: 0 !important;
}


/* ============================================
   7. LINKS — show URLs
   ============================================ */

a[href]::after {
  content: " (" attr(href) ")";
  font-size: 0.85em;
  font-weight: normal;
}

/* Don't show URL for fragment or JS links */
a[href^="#"]::after,
a[href^="javascript:"]::after {
  content: "";
}

/* Don't show URL for nav links or logo — too noisy */
site-nav a::after,
.site-logo::after {
  content: "" !important;
}


/* ============================================
   8. LAYOUT PRIMITIVES
   ============================================ */

/* Flatten grid and switcher to single column */
.l-grid,
.l-switcher {
  display: block !important;
}

/* Preserve sidebar as two-column */
.l-sidebar {
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 1.5rem !important;
}

.l-sidebar > :first-child {
  flex: 0 0 35% !important;
}

.l-sidebar > :last-child {
  flex: 1 !important;
  min-inline-size: 0 !important;
}


/* ============================================
   9. CONTENT ELEMENTS
   ============================================ */

/* Blockquotes — left border + indent (not inside testimonials) */
blockquote {
  border-left: 3px solid #000 !important;
  padding-left: 1rem !important;
  margin-block: 0.5rem !important;
}

/* Details — content shown via JS beforeprint event */
details {
  margin-block: 0.75rem !important;
  page-break-inside: avoid !important;
  break-inside: avoid !important;
}

details > summary {
  margin-block-end: 0.15rem !important;
}

details > p {
  margin-block: 0.25rem !important;
}

/* Horizontal rules */
hr {
  border: none !important;
  border-top: 1px solid #ccc !important;
  margin-block: 1rem !important;
}

/* Figures */
figure {
  margin-block: 0.75rem !important;
}

figure img {
  margin-block-end: 0.35rem !important;
}

figcaption {
  margin-block-start: 0.25rem !important;
}

/* Tables */
table {
  margin-block: 0.5rem !important;
}

th, td {
  padding: 0.35rem 0.5rem !important;
}



/* ============================================
   10. COMPONENTS
   ============================================ */

/* Testimonial cards — strip blockquote print styles */
testimonial-card {
  display: block !important;
  padding: 0.15rem 0 !important;
  border: none !important;
}

testimonial-card blockquote {
  border-left: none !important;
  padding-left: 0 !important;
  margin-block: 0 !important;
}

testimonial-card blockquote p,
testimonial-card cite {
  margin-block: 0 !important;
}

testimonial-card + testimonial-card {
  margin-block-start: 0.5rem !important;
}


/* ============================================
   10. PAGE-BREAK + WIDOW/ORPHAN CONTROL
   ============================================ */

h1, h2, h3, h4 {
  page-break-after: avoid;
  break-after: avoid;
}

p, li, blockquote, figure, pre, table {
  orphans: 3;
  widows: 3;
}

blockquote, figure, pre, table,
testimonial-card, .services .l-grid > * {
  page-break-inside: avoid;
  break-inside: avoid;
}

img {
  max-inline-size: 100% !important;
  page-break-inside: avoid;
  break-inside: avoid;
}

thead {
  display: table-header-group;
}

tr {
  page-break-inside: avoid;
  break-inside: avoid;
}


/* ============================================
   11. CODE BLOCKS
   ============================================ */

pre {
  border: 1px solid #ccc !important;
  padding: 0.5rem !important;
  white-space: pre-wrap !important;
  word-wrap: break-word !important;
}
