﻿/* ============================================================================
   ATMS FICTION - EDITION CHROME (shared)

   The dark "cover" masthead used by the fiction pages (library.aspx,
   story.aspx and anything added later). This file exists because the chrome
   was originally copy-pasted per page, which meant every spacing fix had to be
   made two or three times and the masthead kept ending up jammed against the
   site nav on whichever page had been missed.

   RULE: spacing of the cover and masthead lives HERE. A page may set its own
   background, cover height and type scale, but must not re-declare the
   padding below - override the tokens instead.
   ============================================================================ */

/* ---------------------------------------------------------------------------
   EDGES - one definition for the whole feature.

   Every fiction surface (library, title page, reader, payment sheet) draws its
   borders from these two tokens, so a border is never re-invented per page.
   They derive from whatever the current surface's INK is, so the same rules work
   on the light pages and on all four reading themes with no hard-coded colour:

     --fx-edge       a real, visible edge: inputs, panels, dialogs
     --fx-edge-soft  a structural divider: price lines, section rules

   NOT the same thing as the reader's --rule, which is the PROSE hairline and is
   meant to be nearly invisible. Using --rule on a form field is what made the
   card box impossible to see. --rule between paragraphs; --fx-edge anywhere the
   reader has to aim at something.

   var(--fg, ...) resolves to the reader's live theme ink when present, and falls
   back to the edition ink on the light pages.
   --------------------------------------------------------------------------- */
/* LIGHT surfaces - the white pages, and the reader's sepia/light themes. */
.fx-scope, .fx-read {
    --fx-edge: var(--atms-border-strong, #D3C0D8);
    --fx-edge-soft: var(--atms-border, #E9E1EC);
}

/* DARK/PURPLE surfaces - the cover band and the reader's ink + night themes.
   --atms-purple-divider is the house hairline for exactly this case: a darker
   offset that reads against the purple, instead of a one-off white alpha. */
.fx-scope .fx-cover,
.fx-read,
:root[data-theme="night"] .fx-read {
    --fx-edge: var(--atms-purple-divider, #5C3F73);
    --fx-edge-soft: var(--atms-purple-divider, #5C3F73);
}

/* ...but the reader's two LIGHT themes go back to the light tokens. */
:root[data-theme="sepia"] .fx-read,
:root[data-theme="light"] .fx-read {
    --fx-edge: var(--atms-border-strong, #D3C0D8);
    --fx-edge-soft: var(--atms-border, #E9E1EC);
}

.fx-scope {
    /* Clearance under the site nav. The masthead is the first thing inside the
       dark, directly below the sticky chrome, so it needs real breathing room -
       at 6px (the old value) it reads as if it is riding the nav. */
    --fx-cover-top: 36px;
    --fx-cover-bottom: 60px;
    /* FULL WIDTH (5 Nov 2026), like the rest of the redesign: break out of #fixed-box's
       old 980/1182px column and take the same gutter the hdr-v2 mast and footer use. */
    --fx-g: clamp(16px, 3vw, 72px);
    --fx-cover-x: var(--fx-g);
    margin-inline: calc(50% - 50vw);
    width: 100vw;

    /* the letterhead rule and the gap it holds off the content below it */
    --fx-mast-gap: 14px;
}

/* 100vw includes the scrollbar; clip the sliver rather than scroll sideways */
html:has(.fx-scope) { overflow-x: clip; }

/* The cover: a column, with the masthead pinned at its top. Height is the
   page's business (full screen for the library's front door, content-sized for
   a title page) - padding is not. */
.fx-scope .fx-cover {
    display: flex;
    flex-direction: column;
    padding: var(--fx-cover-top) var(--fx-cover-x) var(--fx-cover-bottom);
    color: #fff;
}

/* The letterhead: what this is on the left, who it's for on the right. Stays a
   ROW on mobile - it is a letterhead, and stacking it makes two unrelated
   labels sitting on top of each other. */
.fx-scope .fx-masthead {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 18px;
    font-family: var(--fx-d);
    text-transform: uppercase;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: .18em;
    color: rgba(255, 255, 255, .72);
    padding-bottom: var(--fx-mast-gap);
    border-bottom: 1px solid var(--fx-edge);
}

.fx-scope .fx-masthead a { color: inherit; text-decoration: none; }
.fx-scope .fx-masthead a:hover { color: #fff; }
.fx-scope .fx-mast-r { white-space: nowrap; color: rgba(255, 255, 255, .5); }

@media (max-width: 620px) {
    .fx-scope { --fx-cover-top: 28px; }
    .fx-scope .fx-masthead { gap: 12px; letter-spacing: .12em; }
}

/* ---------------------------------------------------------------------------
   PAYMENT SHEET - shared by the library, the title page and the reader.
   Tight on purpose: what you are buying, the card, nothing else. No shipping,
   no account step, no upsell.
   Colours resolve from the reader's live theme variables when present and fall
   back to the light storefront values elsewhere, so one definition covers the
   white pages AND all four reading themes.
   --------------------------------------------------------------------------- */
.fx-pay-back { position:fixed; inset:0; z-index:120; background:rgba(8,6,10,.72); display:none; }
.fx-pay-back.on { display:block; }

.fx-pay-box {
    position:fixed; z-index:121; left:50%; top:50%; transform:translate(-50%,-50%);
    /* 440, not 400: Stripe's card element stacks number / MM-YY / CVC onto two rows once
       its container falls under ~340px. At 400px wide, minus the sheet padding and the
       field padding, the element got ~332px and wrapped. This keeps it on one row. */
    width:min(94vw, 440px);
    background:var(--bg, #fff);
    color:var(--fg, var(--atms-ink, #14101a));
    border:1px solid var(--fx-edge, var(--atms-border-strong, #D3C0D8));
    border-radius:var(--atms-radius, 8px);
    padding:22px 20px; font-family:Roboto, Arial, Helvetica, sans-serif; display:none;
}
.fx-pay-box.on { display:block; }

.fx-pay-hd { display:flex; align-items:flex-start; gap:12px; margin-bottom:16px; }
.fx-pay-t {
    font-family:"Barlow Condensed", Roboto, Arial, sans-serif; text-transform:uppercase;
    font-weight:600; font-size:16px; letter-spacing:.04em; line-height:1.2;
}
.fx-pay-sub { font-size:12px; color:var(--fg-mute, var(--atms-text-muted, #7A6F7E)); margin-top:4px; }
.fx-pay-x {
    margin-left:auto; background:none; border:0; font-size:20px; line-height:1; cursor:pointer;
    padding:0 2px; color:var(--fg-mute, var(--atms-text-muted, #7A6F7E));
}

.fx-pay-line {
    display:flex; justify-content:space-between; align-items:baseline; font-size:14px; padding:12px 0;
    border-top:1px solid var(--fx-edge-soft, var(--atms-border, #E9E1EC));
    border-bottom:1px solid var(--fx-edge-soft, var(--atms-border, #E9E1EC));
}
.fx-pay-line b { font-size:16px; }

.fx-pay-el {
    /* No min-height: the card row is ~20px tall, so forcing 52px left a band of dead
       space under it that read as a second line. The field sizes to its contents. */
    margin:14px 0 18px; padding:12px 10px; font-size:13px;
    color:var(--fg-mute, var(--atms-text-muted, #7A6F7E));
    border:1px solid var(--fx-edge, var(--atms-border-strong, #D3C0D8));
    border-radius:var(--atms-radius, 8px); transition:border-color .15s ease;
}
.fx-pay-el:focus-within { border-color:var(--atms-orange, #FA4616); }

.fx-pay-err { font-size:13px; line-height:1.5; color:var(--atms-berry, #C22B3D); margin:0 0 12px; }

.fx-pay-go {
    width:100%; background:var(--atms-orange, #FA4616); color:#fff; border:0;
    border-radius:var(--atms-radius, 8px); padding:14px 20px;
    font-family:Roboto, Arial, Helvetica, sans-serif; font-size:15px; cursor:pointer;
}
.fx-pay-go[disabled] { opacity:.55; cursor:default; }

.fx-pay-note { text-align:center; font-size:11px; color:var(--fg-mute, var(--atms-text-muted, #7A6F7E)); margin-top:12px; }

/* ---- THE RECEIPT ----------------------------------------------------------
   Shown in place of the form once the claim succeeds. Purple tick, not orange:
   orange is the action colour on this site and there is no action left to take
   in the mark itself. The one orange thing here is "Start reading", because
   that IS the next action. */
.fx-pay-ok { text-align:center; padding:6px 0 2px; }
.fx-pay-ok-mark {
    width:52px; height:52px; margin:0 auto 18px; border-radius:50%;
    display:flex; align-items:center; justify-content:center;
    background:var(--atms-lilac-mist, #F3E8F4); color:var(--atms-purple, #6A2C99);
    font-size:26px; line-height:1;
}
.fx-pay-ok-t {
    font-family:var(--fx-d, Roboto), Roboto, Arial, sans-serif;
    font-size:22px; line-height:1.2; margin:0 0 8px;
}
.fx-pay-ok-s { font-size:13px; line-height:1.55; color:var(--fg-mute, var(--atms-text-muted, #7A6F7E)); margin:0 0 18px; }
/* No panel. A light fill inside a sheet that sits on the dark edition chrome put
   near-white text on a near-white box - and the box was never earning anything the
   line above it wasn't. Same muted treatment as .fx-pay-ok-s, so the three lines
   read as one block. */
.fx-pay-ok-mail {
    font-size:13px; line-height:1.55; text-align:center;
    color:var(--fg-mute, var(--atms-text-muted, #7A6F7E));
    margin:0 0 18px;
}
/* the address is the one thing here worth picking out of the sentence */
.fx-pay-ok-mail b { color:var(--fg, inherit); font-weight:600; word-break:break-all; }
.fx-pay-ok-go {
    display:block; width:100%; box-sizing:border-box; text-align:center;
    background:var(--atms-orange, #FA4616); color:#fff; text-decoration:none;
    border-radius:var(--atms-radius, 8px); padding:14px 20px;
    font-family:Roboto, Arial, Helvetica, sans-serif; font-size:15px;
}
.fx-pay-ok-go:hover { color:#fff; text-decoration:none; }
.fx-pay-ok-back {
    display:block; width:100%; margin-top:10px; padding:12px 20px;
    background:transparent; border:1px solid var(--fx-edge, rgba(0,0,0,.14));
    border-radius:var(--atms-radius, 8px);
    font-family:Roboto, Arial, Helvetica, sans-serif; font-size:14px; cursor:pointer;
    color:inherit;
}

/* a centred dialog fights the on-screen keyboard, so it becomes a sheet on phones */
@media (max-width:520px) {
    .fx-pay-box {
        top:auto; bottom:0; transform:translateX(-50%); width:100%;
        border-radius:var(--atms-radius, 8px) var(--atms-radius, 8px) 0 0;
    }
}

/* OUTLINE BUTTONS
   The house outline style is .gen-btn-white-first (mainx.css): white, #444 ink,
   inverting to dark on hover. Every secondary button in this feature wears it, so
   colour and hover are defined ONCE, by the site - not per control. These rules add
   only the hairline and, for the cart button, the square geometry. Nothing here
   sets a colour or a hover; if you find yourself wanting to, fix the shared
   variant instead so the whole site moves together. */
.fx-btn-ghost { border: 1px solid var(--fx-edge, var(--atms-border-strong, #D3C0D8)); }

.fx-cart-sq {
    position: relative;
    box-sizing: border-box;
    flex: 0 0 46px; width: 46px; height: 46px; min-width: 46px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; line-height: 0;
}

/* Colour is set ON the svg (stroke/fill attributes), not here: the shared outline
   variant declares its ink with !important and inheriting through that into an inline
   SVG proved unreliable. CSS only handles the hover inversion. */
.fx-cart-sq:hover .fx-cart-ico path { fill: #fff; stroke: #fff; }

/* Stripe injects a hidden accessibility <input> inside the card container. The
   storefront styles EVERY text input with a 1px #bbb border (mainx.css / mainx-au.css),
   so that hidden input drew a second line inside our field - visible on the library
   page, which loads mainx, but not in the reader, which does not. Neutralise any input
   Stripe puts inside the sheet; the field's only border is .fx-pay-el's. */
/* scoped to the CARD container only - it used to be .fx-pay-box input, which also
   stripped the border and padding off our own email field and left it looking like
   floating plain text. */
.fx-pay-el input {
    border: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    font-size: inherit !important;
}

/* email capture - one field, above the card. It is the receipt and the restore path,
   not an upsell, so it is labelled plainly and never optional. */
.fx-pay-lbl {
    display: block; font-size: 12px; margin: 16px 0 6px;
    color: var(--fg-mute, var(--atms-text-muted, #7A6F7E));
}
.fx-pay-email {
    display: block; width: 100%; box-sizing: border-box;
    padding: 13px 12px; font-size: 15px; font-family: inherit;
    color: var(--fg, var(--atms-ink, #14101a));
    background: transparent;
    border: 1px solid var(--fx-edge, var(--atms-border-strong, #D3C0D8)) !important;
    border-radius: var(--atms-radius, 8px);
}
.fx-pay-email:focus { outline: none; border-color: var(--atms-orange, #FA4616) !important; }

/* The + is OVERLAID, not part of the basket art. Trying to fit both into one viewBox
   either crowded the basket or shrank it - they are two marks, so they are two elements.
   Sits in the top-right quadrant of the 46px square, clear of the basket beneath it. */
.fx-cart-plus {
    position: absolute;
    top: 6px; right: 6px;
    width: 10px; height: 10px;
    pointer-events: none;
}
.fx-cart-sq:hover .fx-cart-plus path { stroke: #fff; }


/* The feature's single toast. Same treatment as the reader's, so buying from the
   library, the title page or mid-chapter all confirm the same way. */
.fx-toast {
    position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 130;
    background: var(--bg, var(--atms-ink, #14101a)); color: var(--fg, #fff);
    border: 1px solid var(--fx-edge, var(--atms-purple-divider, #5C3F73));
    border-radius: var(--atms-radius, 8px);
    padding: 12px 20px; font-family: Roboto, Arial, Helvetica, sans-serif; font-size: 14px;
    display: none;
}
.fx-toast.on { display: block; }
