/* ==========================================================================
   Product page (pages/product_page.php).

   Depends on:
     - the --pub-* tokens in wpl-public-theme.css (light/dark)
     - the shared primitives in wpl-landing.css (.pub-shell, .pub-card,
       .pub-chip, .pub-btn, .pub-eyebrow, and the .pub-rail carousel, which
       this page reuses verbatim for its two related-books rails)
     - two classes from wpl-week-listing.css that this page borrows rather
       than restates: .wk-card-variant (the badge on the cover) and .wk-note
       (the incentive-variant callout). Neither sheet is loaded here, so both
       are defined at the bottom of this file.

   Namespacing: --pd-* / .pd-* is this page. See the note at the top of
   wpl-public-theme.css for how --pub-*, --wpl-*, --wk-* and --sp-* divide up.
   ========================================================================== */

.pd-page {
    padding-bottom: 3rem;
}

/* --------------------------------------------------------------------------
   Breadcrumb + masthead
   -------------------------------------------------------------------------- */

.pd-crumbs {
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--pub-border-soft);
    font-size: 0.82rem;
    color: var(--pub-muted);
}

.pd-crumbs .pub-shell {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
}

.pd-crumbs a {
    color: var(--pub-ink-2);
    text-decoration: none;
    transition: color 0.2s ease;
}

.pd-crumbs a:hover { color: var(--pub-accent-2); }

.pd-crumbs i {
    font-size: 0.58rem;
    opacity: 0.5;
}

/* The masthead is the one full-width band. Title and identifying facts sit
   above both columns so they read first at every width — putting them beside
   the cover would drop them below it on a phone. */
.pd-head {
    padding: 1.8rem 0 1.6rem;
    border-bottom: 1px solid var(--pub-border);
    background:
        radial-gradient(900px 300px at 15% -30%, var(--pub-accent-soft), transparent 70%),
        var(--pub-page-2);
}

/* .pub-eyebrow is an inline-flex label; as a link it also needs to shrink-wrap
   so the underline-on-hover does not run the width of the page. */
.pd-series {
    width: -moz-fit-content;
    width: fit-content;
    text-decoration: none;
    transition: color 0.2s ease;
}

.pd-series:hover { color: var(--pub-ink); }

.pd-title {
    margin: 0;
    max-width: 30ch;
    font-family: 'Playfair Display', Lora, Georgia, serif;
    font-size: clamp(1.6rem, 3.6vw, 2.5rem);
    font-weight: 700;
    line-height: 1.12;
    color: var(--pub-ink);
    /* Feed titles are long, unspaced and shouty
       ("...GATEFOLD TRIPTYCH CARD STOCK VAR"). */
    overflow-wrap: anywhere;
}

.pd-subtitle {
    margin: 0.5rem 0 0;
    font-size: 1rem;
    color: var(--pub-ink-2);
}

.pd-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.5rem;
    margin: 1.1rem 0 0;
    padding: 0;
    list-style: none;
}

.pd-facts li {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.7rem;
    border: 1px solid var(--pub-border);
    border-radius: 999px;
    background: var(--pub-surface);
    color: var(--pub-ink-2);
    font-size: 0.8rem;
    font-weight: 600;
}

.pd-facts li i {
    font-size: 0.72rem;
    color: var(--pub-muted);
}

.pd-facts a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: inherit;
    text-decoration: none;
}

.pd-facts li:has(a):hover {
    border-color: var(--pub-accent-2);
    color: var(--pub-ink);
}

/* The cover variant is what distinguishes this row from the eleven others
   sharing its title, so it is the one fact that gets colour. */
.pd-fact-variant {
    border-color: transparent !important;
    background: var(--pub-accent-soft) !important;
    color: var(--pub-accent-2) !important;
}

.pd-fact-variant i { color: inherit !important; }

/* --------------------------------------------------------------------------
   Two-column body
   -------------------------------------------------------------------------- */

/* Three areas rather than two columns, so the order can change with the width.
   Wide: cover top-left, other covers beneath it, details filling the right.
   Narrow: cover, then details — the price and the "add to pull list" button —
   and only then the strip of other covers. */
.pd-grid {
    display: grid;
    grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
    grid-template-areas:
        "art  info"
        "alts info";
    align-content: start;
    gap: 1.6rem 2.5rem;
    padding-top: 2.2rem;
}

.pd-art-col  { grid-area: art; }
.pd-alts     { grid-area: alts; }
.pd-info-col { grid-area: info; }

@media (max-width: 991.98px) {
    .pd-grid {
        grid-template-columns: 1fr;
        grid-template-areas: "art" "info" "alts";
        gap: 1.8rem;
    }
}

/* --------------------------------------------------------------------------
   Cover
   -------------------------------------------------------------------------- */

.pd-cover {
    position: relative;
    margin: 0;
    border: 1px solid var(--pub-border);
    border-radius: 16px;
    background: var(--pub-surface-2);
    overflow: hidden;
    box-shadow: var(--pub-shadow-lift);
}

.pd-cover img {
    display: block;
    width: 100%;
    height: auto;
}

/* .pub-card-pub anchors to a .pub-card-art; here it anchors to the figure. */
.pd-cover .pub-card-pub {
    top: 0.75rem;
    left: 0.75rem;
    font-size: 0.7rem;
}

.pd-cover .wk-card-variant {
    left: 0.75rem;
    bottom: 0.75rem;
    font-size: 0.68rem;
}

/* --------------------------------------------------------------------------
   Alternate covers
   -------------------------------------------------------------------------- */

.pd-alts-lead {
    margin: 0 0 0.9rem;
    font-size: 0.84rem;
    line-height: 1.5;
    color: var(--pub-ink-2);
}

.pd-alt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: 0.7rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pd-alt {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.pd-alt-art {
    position: relative;
    display: block;
    aspect-ratio: 2 / 3;
    border: 1px solid var(--pub-border);
    border-radius: 10px;
    background: var(--pub-surface-2);
    overflow: hidden;
    transition: border-color 0.2s ease, transform 0.15s ease;
}

a.pd-alt-art:hover {
    border-color: var(--pub-accent-2);
    transform: translateY(-2px);
}

@media (prefers-reduced-motion: reduce) {
    a.pd-alt-art:hover { transform: none; }
}

.pd-alt-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* The cover being viewed stays in the strip so the set is complete, but it is
   not a link and it says so. */
.pd-alt.is-current .pd-alt-art {
    border-color: var(--pub-accent-2);
    box-shadow: 0 0 0 2px var(--pub-accent-soft);
}

.pd-alt-here,
.pd-alt-tag {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0.16rem 0.35rem;
    background: rgba(8, 17, 28, 0.86);
    color: #fff;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pd-alt-tag { color: #ffd9a8; }

.pd-alt-name {
    font-size: 0.7rem;
    line-height: 1.25;
    color: var(--pub-ink-2);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.pd-alt-price {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--pub-muted);
}

/* --------------------------------------------------------------------------
   Panels
   -------------------------------------------------------------------------- */

.pd-panel,
.pd-action {
    padding: 1.3rem 1.4rem;
    border: 1px solid var(--pub-border);
    border-radius: 16px;
    background: var(--pub-surface);
    box-shadow: var(--pub-shadow);
}

.pd-info-col > * + * { margin-top: 1.1rem; }

.pd-panel-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.9rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: var(--pub-muted);
}

.pd-panel-head i { color: var(--pub-accent-2); }

.pd-count {
    margin-left: auto;
    letter-spacing: 0.04em;
    text-transform: none;
    font-weight: 600;
    color: var(--pub-muted);
}

/* --------------------------------------------------------------------------
   Action panel — price, dates, and the two things a visitor can do
   -------------------------------------------------------------------------- */

.pd-action-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    padding-bottom: 1.1rem;
    border-bottom: 1px solid var(--pub-border-soft);
}

.pd-price-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--pub-muted);
}

.pd-price {
    display: block;
    margin-top: 0.1rem;
    font-family: 'Playfair Display', Lora, Georgia, serif;
    font-size: 1.85rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--pub-ink);
}

.pd-status {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

/* The two dates are the whole reason this page exists, so they get a row of
   their own rather than a line in the spec table. */
.pd-dates {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 0.75rem;
    margin: 1.1rem 0 0;
}

.pd-dates > div {
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--pub-border);
    border-radius: 12px;
    background: var(--pub-surface-2);
}

.pd-dates dt {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--pub-muted);
}

.pd-dates dt i { color: var(--pub-accent-2); }

.pd-dates dd {
    margin: 0.35rem 0 0;
    font-size: 0.94rem;
    font-weight: 700;
    color: var(--pub-ink);
}

.pd-dates dd small {
    display: block;
    margin-top: 0.1rem;
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--pub-muted);
}

.pd-ratio { margin: 1.1rem 0 0; }

.pd-pull { margin-top: 1.2rem; }

.pd-pull-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--pub-ink-2);
}

.pd-pull-label span {
    font-weight: 500;
    color: var(--pub-muted);
}

.pd-pull-input {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--pub-border);
    border-radius: 10px;
    background: var(--pub-page);
    color: var(--pub-ink);
    font-size: 0.88rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.pd-pull-input::placeholder { color: var(--pub-muted); }

.pd-pull-input:focus {
    outline: none;
    border-color: var(--pub-accent-2);
    box-shadow: 0 0 0 3px var(--pub-accent-soft);
}

.pd-pull-btn,
.pd-fav {
    width: 100%;
    margin-top: 0.7rem;
}

.pd-fav.is-on {
    border-color: var(--pub-hot);
    color: var(--pub-hot);
}

.pd-fav.is-on:hover {
    border-color: var(--pub-hot);
    color: var(--pub-hot);
    background: var(--pub-hot-soft);
}

.pd-already {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin: 1.2rem 0 0;
    padding: 0.8rem 0.95rem;
    border: 1px solid var(--pub-good);
    border-radius: 12px;
    background: var(--pub-good-soft);
    font-size: 0.88rem;
    color: var(--pub-ink);
}

.pd-already i { color: var(--pub-good); }

.pd-already a {
    margin-left: auto;
    color: var(--pub-accent-2);
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.pd-already a:hover { text-decoration: underline; }

.pd-fineprint {
    margin: 0.85rem 0 0;
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--pub-muted);
}

.pd-guest {
    margin-top: 1.2rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--pub-border-soft);
}

.pd-guest p {
    margin: 0 0 0.9rem;
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--pub-ink-2);
}

.pd-guest-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

/* --------------------------------------------------------------------------
   Credits, description, specs
   -------------------------------------------------------------------------- */

.pd-credits {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 0.75rem 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pd-credit-role {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--pub-muted);
}

.pd-credit-name {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--pub-ink);
    text-decoration: none;
    transition: color 0.2s ease;
}

.pd-credit-name:hover {
    color: var(--pub-accent-2);
    text-decoration: underline;
}

.pd-desc {
    margin: 0;
    max-width: 68ch;
    font-size: 0.96rem;
    line-height: 1.65;
    color: var(--pub-ink-2);
}

.pd-specs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 0.75rem 1.25rem;
    margin: 0;
}

.pd-specs dt {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--pub-muted);
}

.pd-specs dd {
    margin: 0.15rem 0 0;
    font-size: 0.9rem;
    color: var(--pub-ink);
    /* UPCs and product codes are long unbroken digit runs. */
    overflow-wrap: anywhere;
}

/* --------------------------------------------------------------------------
   Rails
   -------------------------------------------------------------------------- */

/* The landing page separates its rails with a lot of air because they are the
   whole page; here they are a footnote to the book above them. */
.pd-page .pub-rail { padding: 2.4rem 0 0; }

.pd-page .pub-rail + .pub-rail { padding-top: 2rem; }

/* --------------------------------------------------------------------------
   Bootstrap modals, repainted in the page palette
   -------------------------------------------------------------------------- */

.modal-content {
    border: 1px solid var(--pub-border);
    border-radius: 16px;
    background: var(--pub-surface);
    color: var(--pub-ink);
}

.modal-header,
.modal-footer { border-color: var(--pub-border-soft); }

.modal-footer { gap: 0.5rem; }

/* Bootstrap's own spacing assumes .btn children, which these are not. */
.modal-footer > .pub-btn { margin: 0; }

.pd-modal-tick {
    font-size: 3rem;
    color: var(--pub-good);
}

/* --------------------------------------------------------------------------
   Product not found
   -------------------------------------------------------------------------- */

.pd-missing {
    max-width: 640px;
    margin: 3rem auto;
}

.pd-missing-search {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
    margin: 1.5rem 0 0;
}

.pd-missing-input {
    flex: 1 1 240px;
    max-width: 380px;
    padding: 0.72rem 1rem;
    border: 1px solid var(--pub-border);
    border-radius: 999px;
    background: var(--pub-surface-2);
    color: var(--pub-ink);
    font-size: 0.92rem;
}

.pd-missing-input:focus {
    outline: none;
    border-color: var(--pub-accent-2);
    box-shadow: 0 0 0 3px var(--pub-accent-soft);
}

.pd-missing-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
    margin-top: 1rem;
}

/* --------------------------------------------------------------------------
   Borrowed from wpl-week-listing.css, which this page does not load.
   Keep the two definitions in step.
   -------------------------------------------------------------------------- */

.wk-card-variant {
    position: absolute;
    left: 0.55rem;
    bottom: 0.55rem;
    max-width: calc(100% - 1.1rem);
    padding: 0.18rem 0.5rem;
    border-radius: 999px;
    background: rgba(8, 17, 28, 0.82);
    color: #ffd9a8;
    font-size: 0.63rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    backdrop-filter: blur(3px);
}

.wk-note {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    margin: 0;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--pub-border);
    border-left: 3px solid var(--pub-hot);
    border-radius: 10px;
    background: var(--pub-page);
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--pub-ink-2);
}

.wk-note i {
    margin-top: 0.18rem;
    color: var(--pub-hot);
    flex-shrink: 0;
}

.wk-empty {
    padding: 3.5rem 1.5rem;
    border: 1px dashed var(--pub-border);
    border-radius: 18px;
    background: var(--pub-surface);
    text-align: center;
}

.wk-empty i {
    font-size: 1.8rem;
    color: var(--pub-muted);
}

.wk-empty h3 {
    margin: 0.9rem 0 0.35rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--pub-ink);
}

.wk-empty p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--pub-ink-2);
}
