/**
 * Eternal Roam — sitewide print stylesheet.
 *
 * Loaded with media="print" on every public page (config/enqueue.php, global
 * assets block). The goal is a readable single-column "field guide": editorial
 * text, key facts, visit guidance, context labels, and source notes survive;
 * navigation, controls, maps, galleries, and full-bleed imagery do not.
 *
 * The My Journey print ledger (#er-journey-print, styled in
 * assets/css/pages/my-journey.css) owns its own print layout; every broad
 * rule here excludes that subtree so the ledger's design is untouched.
 */

/* ====================================================================
   1. Page setup
   ==================================================================== */

@page {
    margin: 14mm 15mm;
}

html,
body {
    width: auto !important;
    background: #fff !important;
}

/* ====================================================================
   2. Chrome and controls never print
   ==================================================================== */

.site-header,
.site-footer,
.back-to-top,
.construction-banner,
.er-section-nav,
.journey-guest-toast,
.er-photo-lightbox,
.er-photo-lightbox-trigger,
.saint-detailed-plan-modal,
button,
input,
select,
textarea,
form,
.er-btn,
.add-to-journey,
.er-home-actions,
.skip-link {
    display: none !important;
}

/* Interactive map shells: embedded OSM iframes, Leaflet panes, and their
   zoom/attribution controls. Address rails and coordinates remain printable
   through the page-type rules below. */
iframe,
.leaflet-container,
.er-place-v1__map-frame,
.er-place-v1__map-actions,
.chv1-map,
.chv1-mapbtn,
.chv1-plate-map {
    display: none !important;
}

/* ====================================================================
   3. Ink reset
   Backgrounds off, text to ink, so ivory bands and dark editorial
   sections do not print as ink fields or vanish as white-on-white.
   :where() keeps specificity at zero; the !important still beats screen
   styles, while the #er-journey-print ledger subtree keeps its palette.
   ==================================================================== */

body :where(*:not(#er-journey-print):not(#er-journey-print *)) {
    background: transparent !important;
    color: #1a1a1a !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

body :where(a:not(#er-journey-print a)) {
    text-decoration: underline;
}

/* ====================================================================
   4. Typography — restrained, legible, no viewport-scaled display sizes
   ==================================================================== */

body {
    font-size: 11pt;
    line-height: 1.45;
}

/* Body copy is px-sized per component on screen; normalize it for paper so
   every page type prints at the same restrained text scale. */
main :where(p, li, dd, dt, td, th, blockquote) {
    font-size: 10.5pt !important;
    line-height: 1.4 !important;
}

main :where(p) {
    margin-top: 0 !important;
    margin-bottom: 6pt !important;
}

main :where(h1, h2, h3, h4) {
    margin-top: 10pt !important;
    margin-bottom: 6pt !important;
}

main :where(ul, ol) {
    margin-top: 0 !important;
    margin-bottom: 6pt !important;
}

main :where(blockquote) {
    margin: 6pt 0 !important;
    padding: 4pt 0 4pt 10pt !important;
}

.er-shero,
.er-shero__meta {
    padding-top: 6pt !important;
    padding-bottom: 6pt !important;
    gap: 8pt !important;
}

h1,
.er-shero__name,
.er-place-v1__title,
.chv1-title,
.chv1-headline {
    font-size: 22pt !important;
    line-height: 1.15 !important;
}

h2,
.er-saint-v1__headline,
.er-saint-v1__closing-title {
    font-size: 15pt !important;
    line-height: 1.2 !important;
}

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

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

p, li, blockquote {
    orphans: 3;
    widows: 3;
}

/* Viewport-height heroes must not reserve screen-sized space on paper. */
:where([class*="hero"], [class*="__hero"], .er-shero, .er-hero-a) {
    min-height: 0 !important;
    height: auto !important;
}

/* Screen-scale minimum heights reserve empty paper; drop them everywhere
   outside the My Journey ledger. */
body :where(*:not(#er-journey-print):not(#er-journey-print *)) {
    min-height: 0 !important;
}

/* ====================================================================
   5. Media policy
   Real photography and portraits are screen furniture here; the printed
   page is a text-first field guide. Constrain anything that remains.
   ==================================================================== */

img {
    max-width: 100% !important;
    height: auto !important;
    max-height: 3.2in;
    object-fit: contain;
}

svg {
    max-width: 100% !important;
}

/* Decorative and full-bleed media: hero figures, portrait plates,
   galleries, chapter-image beats, lightbox triggers, card thumbnails. */
.er-shero__right,
.er-saint-v1__media-section,
.er-saint-v1__place-img,
.er-relation img,
.er-sacred-gallery,
.er-place-v1__hero-figure,
.er-place-v1__chapter-beat,
.er-place-v1__figure-portrait,
.er-place-v1__body-media-caption,
.er-place-v1__saint-portrait,
.er-place-v1__image-credits,
.chv1-hero-bg,
.chv1-chapter-beat,
.chv1-interlude,
.chv1-station-figure,
.chv1-linkrow-figure,
.chv1-saint-portrait,
.chv1-credits {
    display: none !important;
}

/* Long raw photo-credit lines should not dominate printed pages. */
:where([class*="credit"], [class*="attribution"]) {
    display: none !important;
}

/* ====================================================================
   6. Disclosure content prints; controls do not
   assets/js/core/print.js opens every <details> before printing and
   restores its state afterwards, so nothing editorial hides in a
   collapsed section. The toggle affordances themselves are suppressed.
   ==================================================================== */

details > summary {
    list-style: none;
}

details > summary::-webkit-details-marker {
    display: none;
}

.er-saint-v1__sources-toggle,
.chv1-saints-more-toggle,
.chv1-saints-more {
    display: none !important;
}

/* Official and source links keep their destination on paper. */
.er-saint-v1__source a[href^="http"]::after,
.er-place-v1__sources-link[href^="http"]::after,
.er-place-v1__official-link[href^="http"]::after,
.chv1-findit-official a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 8pt;
    color: #555 !important;
    word-break: break-all;
}

/* ====================================================================
   7. Layout — readable single column, calm page breaks
   ==================================================================== */

/* Content containers use the full printable width; screen max-widths and
   gutter padding just cost pages here. */
main :where(.er-saint-v1__container, .er-place-v1__container, .chv1-wrap, .container) {
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Atlas / Sacred Geography modules print as compact reference lists. */
.era-module {
    padding: 6pt 8pt !important;
    margin: 0 0 6pt !important;
}

.er-saint-v1__story-grid,
.er-saint-v1__visit-grid,
.er-saint-v1__feast-grid,
.er-place-v1__opening-flow,
.er-place-v1__current-grid,
.er-place-v1__sacred-grid,
.er-place-v1__sources-grid,
.er-place-v1__nearby-geo-grid,
.er-place-v1__dnm-grid,
.er-place-v1__visit-grid,
.chv1-two-col,
.chv1-jz-grid,
.chv1-htr-grid,
.chv1-fine-grid,
.chv1-colophon-grid,
.chv1-sig-grid {
    display: block !important;
}

/* Card-scale containers shed their screen padding and internal gaps so a
   printed card is a bordered note, not a padded plate. */
main :where([class*="card"], [class*="__relic"], [class*="-panel"]),
main :where([class*="card"], [class*="__relic"], [class*="-panel"]) :where(div[class*="body"]) {
    padding: 6pt 8pt !important;
    gap: 4pt !important;
    display: block !important;
    height: auto !important;
}

/* Keep small row-scale units intact across page breaks; taller cards are
   left free to flow, which avoids half-empty pages. */
.er-saint-v1__timeline-divider,
.er-place-v1__catalogue-card,
.er-place-v1__keyfacts-row,
.er-place-v1__nearby-geo-card,
.chv1-reg-row,
.chv1-factrow {
    break-inside: avoid;
    page-break-inside: avoid;
}

/* Sections separate with space, not screen-scale padded bands. */
:where(.er-saint-v1__section, .er-place-v1__section, .chv1-mvt, .er-rd-section, .erl-sec, .city-v1-section) {
    padding-top: 8pt !important;
    padding-bottom: 8pt !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Section headers carry screen-scale margins between eyebrow, headline, and
   rule; tighten them so a heading is a line, not a band. */
main :where(.er-saint-v1__section-head, .er-place-v1__section-head, .chv1-mvt-head, .er-rd-sechead, .erl-sechead) {
    margin-top: 0 !important;
    margin-bottom: 8pt !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* ====================================================================
   8. Context and source language stays on paper
   The er-confidence primitive (Documented / Traditional / Local tradition /
   Careful context), the place-v1 context chips, the church register chips,
   and the relic-page basis pills are how Eternal Roam speaks about sensitive
   claims. On paper the graded bars have no ink, so the worded label carries
   the meaning alone; the label, detail line, and source note all print.
   ==================================================================== */

.er-confidence__bars {
    display: none !important;
}

.er-confidence {
    margin: 4pt 0 !important;
    padding: 0 !important;
}

.er-confidence__eyebrow {
    font-size: 7.5pt !important;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.er-confidence__label {
    font-weight: 700;
    font-size: 9pt !important;
}

.er-confidence__detail,
.er-confidence__source {
    font-size: 9pt !important;
    margin: 1pt 0 0 !important;
}

.er-place-v1__ctx-chip,
.rd-pill {
    border: 1px solid #999 !important;
    padding: 1pt 5pt !important;
}

/* ====================================================================
   9. Page-type notes
   ==================================================================== */

/* Saint pages (saint-v1 / saint-v2): the Atlas Connections and Sacred
   Geography interaction chips are screen affordances; the prose and the
   relationship cards' text still print. */
.er-atlas-legend,
[data-er-section-nav] {
    display: none !important;
}

/* Saint hero: keep the text column full width once the portrait is gone. */
.er-shero__grid {
    display: block !important;
}

/* Saint place and relic cards stack full-width and shed screen padding, so
   "Where to Go" reads as a compact gazetteer instead of one card per page. */
.er-saint-v1__places,
.er-saint-v1__relics {
    display: block !important;
}

.er-saint-v1__place-card,
.er-saint-v1__relic {
    padding: 8pt 10pt !important;
    margin: 0 0 8pt !important;
}

.er-saint-v1__place-card-foot,
.er-saint-v1__place-card-link {
    display: none !important;
}

.er-saint-v1__relic-pilgrim {
    padding: 6pt 8pt !important;
    margin-top: 6pt !important;
}

.er-saint-v1__timeline-row,
.er-saint-v1__timeline-divider {
    padding-top: 4pt !important;
    padding-bottom: 4pt !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Relationship cards (Kindred witnesses, city-hub saints): the portrait
   plate reserves a 4:5 image area on screen; on paper the text carries it,
   and the multi-column card grid keeps its print density. */
.er-relation__plate,
.er-relation__arrow {
    display: none !important;
}

.er-relation__item {
    padding: 4pt 6pt !important;
    break-inside: avoid;
    page-break-inside: avoid;
}

/* Atlas Connections is the interactive relationship browser: it re-lists
   the same places, relics, and legacy entries that already print in the
   Where to Go and Tomb & Relics sections, as graph navigation. On paper it
   is a duplicate, so it stays on screen. The quieter Sacred Geography prose
   section (non-atlas saints) still prints. */
.er-atlas-v1,
.era-spinewrap,
.era-spine {
    display: none !important;
}

/* Relic and route detail (er-rd- / rd- prefixes): hero media is hidden,
   the practical modules keep their compact card form. The relic hero panel
   layers pills and captions absolutely over its photo plate; once the plate
   is gone those layers must flow statically or they overlap the title. */
.er-rd-media,
.er-rd-hero-lightbox,
.er-rd-v1 .rd-img,
.er-rd-v1 .floatlab {
    display: none !important;
}

.er-rd-v1 .rd-detail-hero {
    display: block !important;
}

.er-rd-v1 .rd-detail-hero * {
    position: static !important;
}

.er-rd-v1 .rd-keyfacts {
    max-width: 100% !important;
    width: auto !important;
}

.er-rd-v1 .rd-keyfacts * {
    white-space: normal !important;
}

.er-rd-v1 .rd-savenote,
.er-rd-v1 .rd-detail-hero .acts {
    display: none !important;
}

.rd-gnode {
    break-inside: avoid;
    page-break-inside: avoid;
}

/* Index and hub pages print as quiet directories: text rows, no plates. */
.erl-example-item img,
.city-v1-section img,
.destination-category-hero-background,
.destination-category-hero-image,
.destination-category-image-credit {
    display: none !important;
}

/* Grid gaps tighten to print scale wherever a grid survives. */
main :where([class*="grid"], [class*="-list"], [class*="__list"]) {
    gap: 6pt !important;
}

/* Homepage prints as a short prospectus: copy without the visual plates. */
.er-homepage-rebuild img,
.er-home-saint-finder__portrait,
.er-home-clare__visual {
    display: none !important;
}

/* Church hybrid (chv1) reference blocks: visit plans, the sacred register,
   schedule, and saint plates print as compact rows. */
.chv1-plan,
.chv1-reg-row,
.chv1-saint-plate,
.chv1-htr-item,
.chv1-schedule-row,
.chv1-station {
    padding: 4pt 6pt !important;
    margin: 0 0 4pt !important;
}

/* City hub cards read as directory rows. */
.city-v1-essential-grid > *,
.city-v1-relics-grid > * {
    padding: 4pt 6pt !important;
}
