/* ============================================================
   Kadwood Atelier — shared template stylesheet
   Used by every page in /templates/. Edit brand tokens here.
   ============================================================ */

/* ---------- Fonts (converted to .woff2 in /fonts) ---------- */

/* Brand display.
   LIGATURE WARNING: the overlapping "OO" in the KADWOOD wordmark is a real
   `liga` ligature baked into both weights (O+O -> one glyph, ~370/1000em
   narrower than two O's). Browsers switch ligatures OFF whenever
   letter-spacing is non-zero, so ANY rule that tracks out the wordmark
   silently breaks the logo. Keep letter-spacing: 0 on .wordmark. */
/* THE WORDMARK UTILITY.
   Put .no-track on any element whose text is literally the word KADWOOD,
   in any face, anywhere on the site. It was only ever written compounded
   (.np__masthead.no-track, .intro__mark.no-track), so on its own it did
   nothing — and .cover-title h1 at 0.06em and .masthead .name at 0.04em
   were both quietly setting the logo with two separate O's.

   !important is deliberate and is the point of the rule: every base rule
   that sets display tracking is at least as specific as this one, and the
   ligature is not a style preference the cascade gets to win. */
.no-track {
    letter-spacing: 0 !important;
    text-indent: 0;
    font-variant-ligatures: common-ligatures;
    font-feature-settings: "liga" 1;
}

@font-face {
    font-family: 'Kadwood';
    src: url('../fonts/Kadwood-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Kadwood';
    src: url('../fonts/Kadwood-Light.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

/* Body / UI — Helvetica Neue family, one family + weights */
@font-face {
    font-family: 'HN';
    src: url('../fonts/HelveticaNeue-Thin.woff2') format('woff2');
    font-weight: 100;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'HN';
    src: url('../fonts/HelveticaNeue-Light.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'HN';
    src: url('../fonts/HelveticaNeue-LightItalic.woff2') format('woff2');
    font-weight: 300;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: 'HN';
    src: url('../fonts/HelveticaNeue-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'HN';
    src: url('../fonts/HelveticaNeue-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* Handwriting accent — pull-quotes, signatures */
@font-face {
    font-family: 'Homemade Apple';
    src: url('../fonts/HomemadeApple-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* Typewriter — Courier Prime, OFL. License: fonts/CourierPrime-OFL.txt.
   Carries the correspondence pages (letter.html) — a 1900s typed letter. */
@font-face {
    font-family: 'Courier Prime';
    src: url('../fonts/CourierPrime-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Courier Prime';
    src: url('../fonts/CourierPrime-Italic.woff2') format('woff2');
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: 'Courier Prime';
    src: url('../fonts/CourierPrime-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Courier Prime';
    src: url('../fonts/CourierPrime-BoldItalic.woff2') format('woff2');
    font-weight: 700;
    font-style: italic;
    font-display: swap;
}

/* Editorial Didone — Playfair Display (variable 400–900), OFL.
   License: fonts/PlayfairDisplay-OFL.txt. Used for magazine-style
   display + serif body across the /templates/*.html editorial pages. */
@font-face {
    font-family: 'Playfair Display';
    src: url('../fonts/PlayfairDisplay-var.woff2') format('woff2');
    font-weight: 400 900;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Playfair Display';
    src: url('../fonts/PlayfairDisplay-Italic-var.woff2') format('woff2');
    font-weight: 400 900;
    font-style: italic;
    font-display: swap;
}

/* ---------- Brand tokens ---------- */
:root {
    --ink:      #0D0D0D;   /* near-black background */
    --burgundy: #42141E;   /* primary brand text/lines */
    --blush:    #E8C7C3;   /* page / panel background */

    --font-display: 'Kadwood', 'HN', Arial, sans-serif;
    --font-body:    'HN', Arial, sans-serif;
    --font-script:  'Homemade Apple', 'Kadwood', cursive;
    --font-type:    'Courier Prime', 'Courier New', Courier, monospace;
    --font-serif:   'Playfair Display', Georgia, 'Times New Roman', serif;  /* editorial Didone */

    --page-pad: clamp(20px, 5vw, 48px);
}

/* ---------- Reset / stage ---------- */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: var(--ink);
    font-family: var(--font-body);
    color: var(--burgundy);
    -webkit-font-smoothing: antialiased;
}

#book {
    position: relative;
    max-width: 100%;
}

/* ---------- Pages ---------- */
.page {
    background-color: var(--blush);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Full-bleed image pages (cover / photo) */
.page.image img,
.page.cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ---------- Scrollable text content ---------- */
.content-container {
    padding: var(--page-pad);
    padding-bottom: 60px;          /* clear the footer */
    height: 100%;
    overflow-y: auto;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
}

.content-container p {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(13px, 1.6vw, 16px);
    line-height: 1.65;
    margin: 0 0 1em;
}

.content-container h1,
.content-container h2,
.content-container h3 {
    font-family: var(--font-display);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    line-height: 1.1;
    margin: 0 0 0.5em;
}
.content-container h1 { font-size: clamp(28px, 5vw, 44px); }
.content-container h2 { font-size: clamp(18px, 2.6vw, 24px); margin-top: 1.2em; }
.content-container h3 { font-size: clamp(15px, 2vw, 18px); font-family: var(--font-body); font-weight: 500; }

.content-container .eyebrow {
    font-family: var(--font-body);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 11px;
    margin: 0 0 1.4em;
    opacity: 0.75;
}

.content-container blockquote,
.pull-quote {
    font-family: var(--font-script);
    font-size: clamp(22px, 4vw, 34px);
    line-height: 1.35;
    color: var(--burgundy);
    margin: 0;
    padding: 0;
    border: none;
}

/* ---------- Links ---------- */
a, a:visited, a:hover, a:active {
    color: var(--burgundy);
    text-decoration: none;
}
.content-container a { text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Footer strip on text pages ---------- */
.footer {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 44px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 var(--page-pad);
    border-top: 1.5px solid var(--burgundy);
    background: var(--blush);
    font-family: var(--font-body);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 10px;
}

/* Caption strip on image pages */
.image-footer {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 8px var(--page-pad);
    background-color: rgba(232, 199, 195, 0.85);
    border-top: 1.5px solid var(--burgundy);
    color: var(--burgundy);
    font-family: var(--font-body);
    font-size: 10px;
    letter-spacing: 0.04em;
}

/* ---------- Button (matches main site) ---------- */
.kadwood-button {
    display: inline-block;
    padding: 12px 22px;
    background-color: transparent;
    color: var(--burgundy);
    font-family: var(--font-display);
    font-size: 15px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: 2px solid var(--burgundy);
    transition: all 0.3s ease;
    cursor: pointer;
}
.kadwood-button:hover {
    background-color: var(--burgundy);
    color: var(--blush);
}

/* ---------- Cover / title overlays ---------- */
.cover-title {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--page-pad);
    color: var(--blush);
}
.cover-title h1 {
    font-family: var(--font-display);
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: clamp(30px, 6vw, 52px);
    margin: 0;
}
.cover-title .script {
    font-family: var(--font-script);
    font-size: clamp(20px, 4vw, 30px);
    margin-top: 0.3em;
}

/* ---------- Split layout (image + text) ---------- */
.split {
    height: 100%;
    display: grid;
    grid-template-rows: 45% 55%;   /* image on top, text below */
}
.split .split-media { overflow: hidden; }
.split .split-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.split .split-body {
    padding: var(--page-pad);
    padding-bottom: 60px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* ---------- Animated turn-page icon (Lottie) ---------- */
.turn-hint {
    position: absolute;
    right: 18px;
    bottom: 22px;
    z-index: 60;
    width: 50px;
    height: 50px;
    cursor: pointer;
}

/* ---------- Navigation hint arrow ---------- */
.nav-hint {
    position: absolute;
    right: 16px;
    bottom: 54px;
    z-index: 50;
    font-family: var(--font-body);
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    opacity: 0.6;
    pointer-events: none;
}
