/**
 * PC Galleries child theme — print stylesheet.
 *
 * Enqueued with media="print" via wp_enqueue_style — no @media wrapper needed.
 * Loads after the parent theme's own print stylesheet (rebrand-styles-print.css)
 * and after the child's screen styles, so rules here win the cascade.
 */
/* Always Hidden in Print */
dialog.sitewide-search,
.pcg-hero-reveal,
.topbar,
.menu-container,
/* Icons plus the separator dots they carry via .pcg-footer-social-list li:before.
   The parent sheet hides .social-icons / [class*="fa-"]; this list is neither. */
.pcg-footer-social-list,
/* Buttons print as outlined boxes with no href — dead ends on paper. */
.pcg-button
{
    display: none !important;
}

/* Reclaim the space the hero reveal was holding open.
   Hiding .pcg-hero-reveal removes the panel, but its height is reserved by a
   separate margin on the content wrapper (core/assets/css/pcg-hero-reveal.css).
   --pcg-reveal-h is min(1000px, 75svh), and svh resolves against the page box
   in print — roughly 768px, which is why page 1 came out empty.
   !important: the source selector is (1,2,1). */
body.has-hero-reveal #pcg-site-body-wrapper {
    margin-top: 0 !important;
}

/* Sticky-footer wrapper reserves a full viewport height, i.e. a full sheet. */
.pcg-site-body-wrapper {
    min-height: 0 !important;
}

/* Card grids. The parent sheet flattens .is-layout-flex to display:block, which
   re-exposes the <li> markers these grids never render on screen — the stray
   bullets beside the collection and news card titles. */
ul.wp-block-post-template,
.pcg-archive-feed,
.pcg-grid
{
    list-style: none !important;
    padding-left: 0 !important;
}

/* Keep the small grid cards and the footer's contact details off page
   boundaries. Deliberately NOT .wp-block-post: the homepage feature items are
   tall enough that refusing to split them strands the section heading alone on
   the previous sheet and leaves most of it blank. Let tall items flow. */
.pcg-archive-item,
.pcg-footer
{
    break-inside: avoid;
}
h1, h2, h3, h4 {
    break-after: avoid;
}

/* Homepage <section> rhythm. --xlg-gap is 6rem, tuned for scrolling; on paper
   that reads as a dead band between sections. Source: style.css 09k. */
main.pcg-home > section + section {
    margin-top: var(--md-gap) !important;
}

/* Media & Text, the homepage feature blocks ("Current Exhibits", "Direct from
   the Source"). Three things conspire to reserve empty height on paper:
     - pcgAspectRatio locks the media column to a fixed box
       (plugins/pcgalleries-custom-blocks/assets/media-text-extensions/css/aspect-ratio.css),
     - is-image-fill-element moves the real <img> out of flow and paints the
       photo as a background instead, so the figure has no intrinsic height,
     - the block carries an INLINE grid-template-columns:60% auto !important.
   Inline !important can't be outweighed by a stylesheet, so the grid is escaped
   by changing display instead — then the two columns stack at full width. */
.wp-block-media-text {
    display: block !important;
}
.wp-block-media-text__media {
    aspect-ratio: auto !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    background-image: none !important; /* the fill-element background */
}
/* Put the photo back in the flow so it prints as an image and gives the figure
   its height. display: !important is required — the parent sheet hides every
   img[alt=""] as decorative, and these carry an empty alt. */
.wp-block-media-text__media img {
    display: block !important;
    position: static !important;
    width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    clip: auto !important;
    clip-path: none !important;
    object-fit: contain !important;
}

/* ---------------------------------------------------------------------------
   TYPE SCALE
   The theme sizes type with rem+vw clamps tuned for screens, so body copy lands
   at 21.6px (16.2pt) on paper and the vw term resolves against the page box,
   making the clamps unpredictable. The parent sheet already aims for 12pt, but
   the child's clamps outrank it, so restate a flat pt scale here.
   pt, not rem: these are physical sizes and should not follow the root.
   ------------------------------------------------------------------------ */
body,
p, li, dd, dt, address,
td, th, figcaption, blockquote
{
    font-size: 11pt !important;
    line-height: 1.4 !important;
}

/* Presets first — .has-pcg-*-font-size can sit on any heading level, and the
   theme applies them at (1,1,1) under #primary, so they'd otherwise outweigh a
   bare tag selector. */
.has-pcg-huge-font-size  { font-size: 18pt !important; }
.has-pcg-large-font-size { font-size: 14pt !important; }
.has-pcg-small-font-size { font-size: 11.5pt !important; }

h1 { font-size: 20pt !important; }
h2 { font-size: 16pt !important; }
h3 { font-size: 13pt !important; }
h4, h5, h6 { font-size: 11.5pt !important; }

/* Supporting text: dates, meta rows, credits. */
.pcg-archives--details,
.pcg-collection-tags,
.wp-block-post-date,
small
{
    font-size: 9pt !important;
}

/* ---------------------------------------------------------------------------
   FEATURED CONTENT — ROWS  (.collaborations-query-block, legacy class; /learn/)
   Source: plugins/pcgalleries-custom-blocks/assets/featured-content-rows/css/style.css

   That block is a hard `width: 1600px`. The printable measure is ~6.5in, so
   everything past it was simply cut off at the page edge. Worse, the block is
   its own query container (`container: featured-rows / inline-size`), so the
   1600px also kept its own `@container (width < 1300px)` rule — the one that
   stacks the columns and cancels the offsets — from ever firing on paper.
   Releasing the width fixes the clipping AND lets that rule do its job.
   ------------------------------------------------------------------------ */
.collaborations-query-block.wp-block-query {
    width: 100% !important;
    max-width: 100% !important;
}
.collaborations-query-block.wp-block-query .collaborations-query-block-item {
    display: block !important;
}
.collaborations-query-block.wp-block-query .collaborations-query-block-item > * {
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}
/* The alternating indent is translateX(-20%/+20%), not a margin — which is why
   resetting margins alone left it in place. */
.collaborations-query-block.wp-block-query .collaborations-query-block-caption,
.collaborations-query-block.wp-block-query li:nth-child(even) .collaborations-query-block-caption
{
    transform: none !important;
    background-color: transparent !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}
/* Half the measure, matching the block's own 50/50 intent at desktop widths.
   Unstacked these ran the full 6.5in and cost roughly a page per entry. */
.collaborations-query-block.wp-block-query .wp-block-post-featured-image {
    max-width: 100% !important;
}
.collaborations-query-block.wp-block-query .wp-block-post-featured-image img {
    width: 100% !important;
    height: auto !important;
}

/* Decorative arc frames on cards. Extends the parent's
   [class*="-arch-border-overlay"] rules, which only cover image, cover and
   media-text blocks. Harmless no-op if these cards are built another way. */
[class*="-arch-border-overlay"]::before,
[class*="-arch-border-overlay"]::after,
[class*="-arch-border-overlay"] > *::before
{
    display: none !important;
}

/* ---------------------------------------------------------------------------
   COLUMNS — stack at full width
   The parent sheet deliberately holds multi-column blocks at two 50% columns on
   paper (rebrand-styles-print.css:460), and does it with !important at (0,5,0).
   Rather than out-specify that, take the container out of flex: the 50% `flex`
   shorthand and any inline flex-basis both go inert on non-flex children, and
   block-level children fill the measure on their own.

   This is core Columns only. The footer's two-up contact layout is
   .pcg-footer.pcg-grid (layers/pcg-footer.php), so it keeps its side-by-side
   arrangement.
   ------------------------------------------------------------------------ */
.wp-block-columns {
    display: block !important;
}
.wp-block-column {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
}
/* `gap` stops applying once the container is block, so restore the separation
   between what are now stacked blocks. */
.wp-block-columns > .wp-block-column + .wp-block-column {
    margin-top: var(--md-gap, 2rem) !important;
}

/* ---------------------------------------------------------------------------
   PCG WORDMARK — top right of the first page
   The parent prints the PC College logo as a block-level main::before
   (rebrand-styles-print.css, section 9), which is what puts it top left. It also
   hides the entire site header — `header` sits in the display:none list at
   rebrand-styles-print.css:258 — which is why the galleries wordmark has never
   printed.

   display:none on an ancestor can't be undone from a descendant, so the header
   is brought back and each level then hides its own siblings, revealing just the
   chain down to .pcg-wordmark (header.php).

   Absolute, so it lands on page one opposite the logo without pushing the
   document down. It is anchored to .pcg-site-body-wrapper, which already becomes
   a containing block on the homepage via pcg-hero-reveal.css; positioning it
   here as well keeps placement identical on every template.
   ------------------------------------------------------------------------ */
.pcg-site-body-wrapper {
    position: relative !important;
}
header.primary {
    display: block !important;
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    left: auto !important;
    width: auto !important;
    max-width: 45% !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
    border: 0 !important;
}
header.primary > *:not(.inner),
header.primary .inner > *:not(.pcg-logos-wrapper),
header.primary .pcg-logos-wrapper > *:not(.pcg-wordmark)
{
    display: none !important;
}
header.primary .inner,
header.primary .pcg-logos-wrapper,
header.primary .pcg-wordmark
{
    display: block !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}
/* Three stacked words, flush right against the logo opposite. The screen rule
   centres them with `margin: 0 auto` and `text-align: center`. */
.pcg-wordmark a.logo-link {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    margin: 0 0 0 auto !important;
    padding: 0 !important;
    text-align: right !important;
    text-decoration: none !important;
    color: #000 !important;
}
/* The parent's blanket `body *` reset puts 12pt on every element, the spans
   included, so the size is restated at higher specificity than (0,1,1).
   Weight only needs setting on the anchor — the spans inherit it, and no parent
   print rule touches font-weight. The screen value is 300. */
.pcg-wordmark a.logo-link,
.pcg-wordmark a.logo-link span
{
    font-size: 17pt !important;
    line-height: 1.15 !important;
    font-weight: 500 !important;
}

/* ---------------------------------------------------------------------------
   ARCHIVE CARD GRIDS — two up
   The grid is auto-fill with a 370px floor (style.css:1855, 1863). The printable
   measure is ~6.5in / 624px, so two columns never fit (2 x 370 + gap = 804px)
   and every card runs the full width with the rest of the row empty — worst on
   the collection's ?view=all listing.

   Column count is pinned instead, and `display` is asserted rather than assumed:
   .pcg-grid gets its grid from the parent theme, and the parent print sheet
   flattens layout classes it recognises.
   ------------------------------------------------------------------------ */
.pcg-archive-feed.pcg-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: var(--md-gap, 2rem) !important;
}

/* Reception info: the purple left/top rules and rounded corner are a screen
   treatment (style.css:1479). `border: 0` covers both edges. */
.pcg-reception-info {
    border: 0 !important;
    border-radius: 0 !important;
}

/* ---------------------------------------------------------------------------
   GALLERY FRAGMENTATION
   The parent gives `figure:has(img)` break-inside: avoid
   (rebrand-styles-print.css, section 4). A core gallery is a <figure> that
   contains <figure>s, so the rule lands on the whole gallery — nine images and
   five sheets tall on a collection item. An avoid that cannot be satisfied makes
   Chrome abandon the current page and start the block on a fresh one, leaving
   the page it gave up on nearly empty; the parent documents this same failure
   for nested columns at its line 187.

   Individual image figures keep the protection. Only the wrapper is released.
   ------------------------------------------------------------------------ */
figure:has(figure),
.wp-block-gallery
{
    break-inside: auto !important;
}

/* The post header's stacked-layout rules live in a (max-width: 1099px) query
   (style.css:1459), which the ~6.5in printable measure satisfies — so what reads
   as a mobile-only block is active on paper. Drop the spacing it adds above the
   media column, and the matching top margin on the content column. */
.pcg-post-header.wp-block-media-text.is-stacked-on-mobile > .wp-block-media-text__media,
.pcg-post-header > .wp-block-media-text__media
{
    padding: 0 !important;
}
.pcg-post-header.wp-block-media-text.is-stacked-on-mobile > .wp-block-media-text__content,
.pcg-post-header > .wp-block-media-text__content
{
    margin-top: 0 !important;
}

/* ---------------------------------------------------------------------------
   GALLERIES — three up
   Galleries print one image per line because the parent flattens the flex
   layout and then caps every image at half the measure, flush left
   (rebrand-styles-print.css:343). Nine artwork images become five sheets.

   SPECIFICITY NOTE: :not() takes the weight of its heaviest argument, and that
   list contains `section#home_page_stories .story_text > .story-arrow` — (1,2,1).
   With the `img` type selector the whole rule is (1,2,2), ID-level, so no stack
   of classes alone can beat it. Both <figure> tags are named below to clear it
   on element count: #primary(1,0,0) + figure(0,0,1) + .wp-block-gallery(0,1,0)
   + figure(0,0,1) + .wp-block-image(0,1,0) + img(0,0,1) = (1,2,3).
   ------------------------------------------------------------------------ */
#primary .wp-block-gallery {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: var(--sm-gap, 1rem) !important;
}
#primary .wp-block-gallery > .wp-block-image {
    width: auto !important;
    max-width: 100% !important;
    margin: 0 !important;
    break-inside: avoid;
}
/* Fill the cell: overrides max-width 50% and the flush-left margin. */
#primary figure.wp-block-gallery figure.wp-block-image img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    object-fit: contain !important;
}
/* Lightbox affordance — an interactive control with nothing to do on paper. */
#primary .wp-block-gallery .lightbox-trigger {
    display: none !important;
}