/* DPP Gothic Press 3.8.3 - foundations: one paper stock, one framed sheet, navigation, targets. Loaded last. */

/* For the two sheets that load after this one (front page, American edition):
   - The London stock is defined ONCE, in section 2. Read it as var(--paper), var(--paper-inset), var(--ink), var(--rule).
     It is never given to the American edition: .dpp-edition-american (on a sheet or round it), .dpp-room-pulp,
     .dpp-archive-american, .dpp-pulp-paper, .pulp-campaign and the American story plates keep their own stock.
   - The FRAME is shared by both editions (section 3): every sheet stands in one column, width var(--sheet-column) =
     the page less var(--sheet-gutter) each side, never wider than var(--sheet-max). The masthead takes the same column
     and is not framed. A sheet's edge, var(--sheet-edge), is drawn from that sheet's own --paper and --rule, so an
     American sheet is edged in its own colours; the soft shadow is var(--sheet-shadow).
   - Engravings on the London front page take ONE filter (section 5). A plate scanned from browned stock raises
     --engraving-lift on its figure; nothing else should set a filter on a plate. */

/* ---------------------------------------------------------------------------------------------------------
   1. The dark rain surround (moved here from dpp-r19-slate.css, which is retired in 3.8.3)
   --------------------------------------------------------------------------------------------------------- */
html.dpp-rain-site {
    --dpp-page-surround: #1d1d1d;
    --dpp-rain-field: radial-gradient(ellipse at 18% 48%, #a9b3b42e, transparent 60%),
        radial-gradient(ellipse at 81% 77%, #79868b36, transparent 62%);
    --sheet-max: 1180px;
    --sheet-gutter: clamp(10px, 3vw, 48px);
    --sheet-column: min(100% - 2 * var(--sheet-gutter), var(--sheet-max));
    --sheet-shadow: 0 1px 3px #0008, 0 16px 38px #000b;
    background: var(--dpp-page-surround);
}
.dpp-rain-site body {
    isolation: isolate;
    background-color: var(--dpp-page-surround);
    background-image: var(--dpp-rain-field);
    background-attachment: fixed;
}
.dpp-rain-site .dpp-page-weather {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}
.dpp-rain-site :is(main#site-main, .dpp35-page, .dpp35-common-header, .dpp35-masthead-wrap,
    .dpp35-salon-page, .dpp35-stall-page, .dpp35-lounge-page, .dpp35-salon-masthead,
    .site-header, .site-footer, .site-backdrop) {
    background: transparent;
    filter: none;
}
.dpp-rain-site :is(.dpp35-sm-external-titles, .dpp35-sm-nav, .dpp35-sm-lock,
    .dpp-broadsheet .folio.dpp-rail-folio) {
    background: var(--dpp-rain-field), var(--dpp-page-surround);
}
.dpp-rain-site .dpp35-masthead-wrap { isolation: auto; }
.dpp-rain-site .dpp35-masthead-link { mix-blend-mode: lighten; }
.dpp-rain-site .dpp-global-rain-nav + main#site-main { padding-block-start: 0; margin-block-start: 0; }
.dpp-rain-site main#site-main > :is(.dpp35-common-header, .dpp35-page, .dpp-broadsheet, .dpp-room-paper, .dpp-publication-sheet):first-child {
    margin-block-start: 0;
}
.dpp-rain-site .dpp35-page > .dpp35-common-header { margin-block: 0; }

/* ---------------------------------------------------------------------------------------------------------
   2. The London stock: warm unbleached newsprint, one for Home, Room and Story. Defined once, here.
      (Home was cold slate, the rooms nine creams, the story another.) The American edition keeps its own.
   --------------------------------------------------------------------------------------------------------- */
.dpp-rain-site .dpp-broadsheet:where(:not(.dpp-edition-american, .dpp-edition-american *, .dpp-room-pulp, .dpp-archive-american)),
.dpp-rain-site main > .dpp-publication-sheet:where(:not(.dpp-edition-american, .dpp-edition-american *,
    :has(.dpp-whole-sheet-art:is([src*="/reading-sheets/fantasy"], [src*="/reading-sheets/scifi-"],
        [src*="/reading-sheets/tepid"], [src*="/reading-sheets/salt"], [src*="/reading-sheets/minutes"],
        [src*="/nov10/minutes-"], [src*="/nov10/amazingly-"], [src*="/nov10/gritty-"], [src*="/nov10/counterintuitive-"])))),
.dpp-rain-site main > .dpp-standard-broadsheet:where(:not(.room-moth-paper, :has(.dpp-whole-sheet, .dpp-commonplace-reading-sheet))) {
    --paper: #e6dfd3;
    --paper-inset: #ded6c7;
    --ink: #191614;
    --rule: #3a332c;
    /* what a London story sheet hands to its own box, plate and furniture (section 4). This rule is the one
       place that says which story sheets are London; an American sheet never receives these. */
    --london-story-column: var(--sheet-column);
    --london-story-max: none;
    --london-story-margin: clamp(.3rem, 1vw, .75rem) clamp(1rem, 3vw, 2.5rem);
    --london-story-pad: clamp(.45rem, 1.6vw, 1.25rem);
    --london-story-measure: 36rem; /* the prose inside the publication's page: about 65 characters a line */
    --london-story-paper: var(--paper);
    --london-story-ink: var(--ink);
    --london-story-frame: var(--sheet-edge), var(--sheet-shadow);
    --london-plate-blend: multiply;
    --london-plate-filter: brightness(1.22) contrast(1.08);
    color: var(--ink);
}
/* the slate accent goes with the slate; the front page's second colour is its rule colour */
.dpp-rain-site .home-template .dpp-broadsheet:where(:not(.dpp-edition-american, .dpp-edition-american *)) { --accent: var(--rule); }
/* one stock means one surface: the grain overlays that only the front page carried are switched off */
.dpp-rain-site .dpp-broadsheet:where(:not(.dpp-edition-american, .dpp-edition-american *, .dpp-room-pulp, .dpp-archive-american)) > .paper-stock { display: none; }
.dpp-rain-site .home-template .dpp-broadsheet::after { content: none; }
/* The standard page and story sheet (page.hbs; post.hbs where a piece has no publication of its own) carries no
   plate, so it takes the stock by the tokens alone. Its "Filed under" line was set in a gold meant for the dark
   room (2.7:1 on the old cream): it takes the ink.
   NOT moved to the stock: the sheets that print on a plate with its own cream in the picture - London Review, the
   office letter, the haiku sheets, the Commonplace, Curiosities and Provisional Verse. Lifted and multiplied as the
   story plates are (section 4), the Commonplace engraving washes away; each of those plates needs re-cutting. */
.dpp-rain-site main > .dpp-standard-broadsheet:not(.room-moth-paper):not(:has(.dpp-whole-sheet, .dpp-commonplace-reading-sheet)) {
    background: var(--paper);
    color: var(--ink);
}
.dpp-rain-site main > .dpp-standard-broadsheet:not(.room-moth-paper):not(:has(.dpp-whole-sheet, .dpp-commonplace-reading-sheet)) :is(.post-header, .page-header) {
    border-block-color: var(--rule);
}
.dpp-rain-site main > .dpp-standard-broadsheet:not(.room-moth-paper):not(:has(.dpp-whole-sheet, .dpp-commonplace-reading-sheet)) .post-tags :is(span, a) {
    border-color: color-mix(in srgb, var(--rule) 45%, var(--paper));
    color: var(--ink);
}

/* ---------------------------------------------------------------------------------------------------------
   3. One framed sheet: one column, the rain surround at the sides, an edge and a soft shadow.
   --------------------------------------------------------------------------------------------------------- */
/* the column: masthead and sheets share it (the masthead is not framed) */
.dpp-rain-site .dpp35-page {
    box-sizing: border-box;
    width: var(--sheet-column);
    max-width: none;
    margin-inline: auto;
}
/* the soft shadow falls from the whole column where sheets fill it (so stacked sheets cast none on each other) */
.dpp-rain-site .dpp35-page:has(> .dpp-broadsheet) { box-shadow: var(--sheet-shadow); }
.dpp-rain-site .dpp35-page > .dpp-broadsheet {
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    margin-inline: 0;
}
/* a sheet that stands alone under the navigation (the registers) is its own column */
.dpp-rain-site main > .dpp-broadsheet {
    box-sizing: border-box;
    width: var(--sheet-column);
    max-width: none;
    margin-inline: auto;
}
/* the edge: a 1 px line in the sheet's rule colour and a faint line inside it. It is made of the sheet's own
   --paper and --rule, so each edition is edged in its own stock. (The smoking room keeps its walnut frame.) */
.dpp-rain-site :is(.dpp35-page, main) > .dpp-broadsheet,
.dpp-rain-site main > .dpp-publication-sheet {
    --sheet-edge: inset 0 0 0 3px var(--paper), inset 0 0 0 4px color-mix(in srgb, var(--rule) 30%, var(--paper)), 0 0 0 1px var(--rule);
}
.dpp-rain-site .dpp35-page > .dpp-broadsheet:where(:not(.dpp-room-lounge)) { box-shadow: var(--sheet-edge); }
.dpp-rain-site main > .dpp-broadsheet:where(:not(.dpp-room-lounge)) { box-shadow: var(--sheet-edge), var(--sheet-shadow); }
/* sheets on the front page lie edge to edge, as they did; the last one keeps clear of the foot of the page */
.dpp-rain-site .dpp35-common-header + .dpp-broadsheet { margin-block-start: .25rem; }
.dpp-rain-site .home-template .dpp35-page > .dpp-broadsheet { margin-block-end: 0; }
.dpp-rain-site .home-template .dpp-publication-directory { margin-block-start: 0; }
.dpp-rain-site .home-template .pulp-campaign { width: 100%; margin-block: 0; }
.dpp-rain-site .home-template .dpp35-page { margin-block-end: clamp(1rem, 3vw, 2.5rem); }

/* ---------------------------------------------------------------------------------------------------------
   4. The story sheet: the same frame; inside it the publication's own page keeps a measure of about 65 characters.
      Its plate prints on the London stock: the plate's own cream is lifted to white and multiplied away.
   --------------------------------------------------------------------------------------------------------- */
/* Each value falls back to what the sheet had before, so a sheet that section 2 did not name is left as it was.
   The selectors are kept light (:where) so that the American sheet, which loads later, can always overrule them. */
:where(.dpp-rain-site main) > .dpp-publication-sheet {
    box-sizing: border-box;
    width: var(--london-story-column, calc(100% - 24px));
    max-width: var(--london-story-max, 47rem);
    margin-block: var(--london-story-margin, 1rem 2rem);
    padding: var(--london-story-pad, 0);
    background-color: var(--london-story-paper, transparent);
    box-shadow: var(--london-story-frame, none);
}
:where(.dpp-rain-site main) > .dpp-publication-sheet > .dpp-publication-paper {
    max-width: 47rem;
    margin-inline: auto;
}
/* the measure: headline, deck and prose share one column inside the plate's writable area */
:where(.dpp-rain-site main) > .dpp-publication-sheet > .dpp-publication-paper > .dpp-whole-sheet-copy > :is(h1, .dpp-publication-deck, .dpp-publication-copy) {
    max-width: var(--london-story-measure, none);
    margin-inline: auto;
}
/* the plate: on a story sheet, and in a room's own reader (a London room reads London plates; an American room
   never receives the --london- values, so its plates stay as they were) */
:where(.dpp-rain-site main) > .dpp-publication-sheet > .dpp-publication-paper,
:where(.dpp-rain-site .dpp-room-paper) .dpp-publication-paper {
    isolation: isolate;
    background-color: var(--london-story-paper, var(--dpp-oyster-ivory));
    color: var(--london-story-ink, var(--dpp-paper-ink));
}
:where(.dpp-rain-site main) > .dpp-publication-sheet > .dpp-publication-paper > .dpp-whole-sheet-plate,
:where(.dpp-rain-site .dpp-room-paper) .dpp-publication-paper > .dpp-whole-sheet-plate,
:where(.dpp-rain-site .dpp-room-salon) .dpp-salon-printed-masthead img {
    mix-blend-mode: var(--london-plate-blend, normal);
    filter: var(--london-plate-filter, none);
}
:where(.dpp-rain-site main) > .dpp-publication-sheet > .dpp-pulp-nav a { color: var(--london-story-ink, #f3dfad); }

/* ---------------------------------------------------------------------------------------------------------
   5. Engravings on the London front page: ONE rule. Soot-black line, the plate's whites clipped so that the
      multiply leaves no box on the paper. (The filters were spread over three files and one plate had none.)
   --------------------------------------------------------------------------------------------------------- */
.dpp-rain-site .dpp-broadsheet:where(:not(.dpp-edition-american, .dpp-edition-american *)) [data-broadsheet-front] :is(img, svg.art) {
    filter: grayscale(1) brightness(var(--engraving-lift, 1.07)) contrast(var(--engraving-bite, 1.18));
    mix-blend-mode: multiply;
    opacity: 1;
}
/* plates scanned from browned stock: their paper sits lower, so it is lifted further before it clips */
.dpp-rain-site .dpp-broadsheet [data-broadsheet-front] :is(.advert-opaque-stock, .advert[data-advert="cocoa"], .commonplace-ink) {
    --engraving-lift: 1.42;
    --engraving-bite: 1.22;
}

/* ---------------------------------------------------------------------------------------------------------
   6. Shared furniture: every target at least 44 px, and no arrow or fleuron the faces lack.
   --------------------------------------------------------------------------------------------------------- */
/* the story's way home (partials/dpp-front-page-return.hbs) */
.dpp-rain-site .dpp-broadsheet-return {
    display: flex;
    justify-content: center;
    box-sizing: border-box;
    width: var(--sheet-column);
    margin: 0 auto;
    padding: 0;
}
.dpp-rain-site .dpp-broadsheet-return a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-width: 44px;
    min-height: 44px;
    padding: 0 1.1rem;
    /* a plain dark tab with a hairline, so the link has a ground its contrast can be measured against */
    background-color: var(--dpp-page-surround);
    box-shadow: inset 0 0 0 1px #f3dfad3d;
    color: #f3dfad;
    font: 400 .86rem/1.15 var(--type-nav);
    letter-spacing: .06em;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: .3em;
}
.dpp-rain-site .dpp-broadsheet-return a:hover { color: #fff; }
.dpp-rain-site .dpp-broadsheet-return a:focus-visible { outline: 2px solid #f6e3a6; outline-offset: 2px; }
/* the paid story's own link back to its stall */
.dpp-rain-site .dpp-publication-sheet > .dpp-pulp-nav { margin: 0 0 .25rem; }
.dpp-rain-site .dpp-publication-sheet > .dpp-pulp-nav a {
    display: inline-flex;
    align-items: center;
    min-width: 44px;
    min-height: 44px;
}
/* the reading-size buttons and the skip link of the layouts */
.dpp-rain-site :is(.dpp-reading-size-button, .dpp-reading-size-reset) {
    box-sizing: border-box;
    min-width: 44px;
    min-height: 44px;
}
.dpp-rain-site .skip-link {
    /* a role, taken where the link stands, so that it follows the edition (the layouts mark it on the American room) */
    --type-nav: var(--type-smallcaps);
    font-family: var(--type-nav);
}
.dpp-rain-site .skip-link:is(:focus, :focus-visible) {
    display: inline-flex;
    align-items: center;
    box-sizing: border-box;
    min-width: 44px;
    min-height: 44px;
}

/* ---------------------------------------------------------------------------------------------------------
   7. Kept from dpp-r19-slate.css because readers' fingers depend on it (not a matter of stock):
      the tap layer over the two fiction specimens on the front page.
   --------------------------------------------------------------------------------------------------------- */
.dpp-fiction-touch { display: none; }
@media (max-width: 1180px) and (any-pointer: coarse), (max-width: 768px) {
    .home-template .dpp-fiction-viewport { overflow: hidden; touch-action: pan-y; }
    .home-template .dpp-fiction-touch {
        display: block;
        position: absolute;
        inset: 0;
        z-index: 2;
        touch-action: pan-y;
    }
    .home-template .dpp-fiction-touch:focus-visible { outline: 3px solid #35454e; outline-offset: -3px; }
    .home-template .dpp-fiction-reader-bar > span { display: none; }
}
