/* ======================================================================
   WILLIAM MORRIS TILE — kelmscott_transitional.css

   PURPOSE: Transitional stylesheet for pages being converted to the
   Kelmscott design system. Same class names and structure as kelmscott.css,
   but uses white backgrounds and Georgia fallback fonts so a converted page
   does not look jarring next to un-converted pages on the live site.

   TO UPGRADE A PAGE TO FULL KELMSCOTT:
   Change one line in the <head>:
       kelmscott_transitional.css  ->  kelmscott.css
   That's it. Everything else stays the same.

   HOW IT DIFFERS FROM kelmscott.css:
   - No Adobe Fonts (P22 Morris Golden, Troy, Ornaments do not load)
   - Headings fall back to Georgia — no visual shock for existing visitors
   - Backgrounds are white/light grey, not cream parchment
   - Fleuron separators render as plain hairlines (no ornament glyph)
   - Drop caps are suppressed
   - Self-hosted TeX Gyre fonts (Pagella body, Schola nav) still load
   - All layout classes are identical to kelmscott.css
   ====================================================================== */


/* ======================================================================
   SECTION 1: DESIGN TOKENS

   Everything visual on the site traces back to these variables.
   Change a color here and it changes everywhere it is used.
   The font stacks define fallback order if a font does not load.
   --measure controls the maximum width of body text paragraphs.
   ====================================================================== */

:root {

    /* Color palette, drawn from the tiles themselves */
    --cream:          #FBFBEF;   /* WMT signature cream — held for full Kelmscott */
    --parchment:      #FFFFFF;   /* transitional: white, matches existing site */
    --parchment-deep: #F5F5F3;   /* transitional: light grey for panels and blocks */
    --rose:           #B17483;   /* footer hairlines */
    --ink:            #2A2118;   /* letterpress brown-black for body text */
    --indigo:         #1F3A5C;   /* Morris indigo — headings and links */
    --lustre:         #7E2A1A;   /* De Morgan red lustre — accents, focus rings */
    --turquoise:      #2E7F7A;   /* De Morgan turquoise — tile hover only, use sparingly */
    --rule:           #B8A88F;   /* hairline rules and dotted leaders */

    /* Font stacks
       Adobe Fonts (P22 Morris Golden etc.) are NOT loaded in transitional mode.
       Headings fall back to Goudy Bookletter 1911 or Georgia.
       Body and nav use self-hosted TeX Gyre fonts (loaded in Section 13). */
    --display:   'Goudy Bookletter 1911', Georgia, serif;
    --troy:      Georgia, serif;
    --body:      'TeX Gyre Pagella', 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
    --ornaments: Georgia, serif;
    --nav:       'TeX Gyre Schola', 'Century Schoolbook', 'New Century Schoolbook', Georgia, serif;

    /* Maximum comfortable line length for body text */
    --measure: 65ch;
}


/* ======================================================================
   SECTION 2: RESET AND BASE

   Box-sizing, page background, body defaults, and the outer .page
   wrapper that centers and constrains all content to 72rem wide.
   .prose caps paragraph line length at --measure for readability.
   ====================================================================== */

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    background: var(--parchment);
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    font-family: var(--body);
    font-size: 1.125rem;
    line-height: 1.65;
}

.page {
    max-width: 72rem;
    margin: 0 auto;
    padding: 0 1.25rem;
}

.prose {
    max-width: var(--measure);
}

img {
    max-width: 100%;
    height: auto;
}


/* ======================================================================
   SECTION 3: TYPOGRAPHY AND LINKS

   All headings use the display font at 400 weight (not bold).
   h3 uses ink color to distinguish it from h1/h2 which use indigo.
   Links never change color on :visited — consistent indigo throughout.
   Bold weight on :hover is a classic typographic shift; no color change.
   ====================================================================== */

h1, h2, h3 {
    font-family: var(--display);
    font-weight: 400;
    color: var(--indigo);
    line-height: 1.2;
}

h1 { font-size: 2.4rem; margin: .4em 0 .2em; }
h2 { font-size: 1.7rem; margin: 1.6em 0 .5em; }
h3 { font-size: 1.25rem; margin: 1.2em 0 .4em; color: var(--ink); }

a               { color: var(--indigo); text-decoration: none; }
a:visited       { color: var(--indigo); font-weight: inherit; }
a:hover         { font-weight: 700; color: var(--indigo); }
a:focus-visible { outline: 2px solid var(--lustre); outline-offset: 2px; }


/* ======================================================================
   SECTION 4: PAGE HEADER AND NAVIGATION

   header.site wraps the entire top of the page.
   #header holds the logo and h1.main.

   h1.main is INTENTIONALLY plain body text. It carries keyword phrases
   for search engines but is invisible to casual visitors. Never enlarge
   or decorate it. (Standing rule, est. 1998.)

   .pagetitle is the human-facing display headline visitors actually read.

   nav.rows renders two centered rows of links. Put section links (Morris,
   De Morgan, etc.) in the first <ul> and utility links (Catalog, Search,
   Contact) in the second <ul>.

   details.contents is the mobile nav, hidden on desktop.
   ====================================================================== */

header.site {
    border-bottom: 3px double var(--rule);
    padding: .2rem 0 .5rem;
    text-align: center;
}

#header {
    position: relative;
    text-align: left;
    border-bottom: 1px solid #DDDDDD;
    padding: .5rem 0 .5rem;
}

#header img {
    width: 280px;
    max-width: 80%;
    height: auto;
    display: inline-block;
}

/* SEO workhorse H1 — plain body text, never decorated */
h1.main {
    font-family: var(--body);
    font-size: 1em;
    font-weight: 400;
    color: var(--ink);
    margin: .45em 0 0;
    line-height: 1.4;
}

/* Human-facing display headline */
.pagetitle {
    font-family: var(--display);
    font-size: 2rem;
    color: var(--indigo);
    text-align: center;
    margin: .4em 0 .2em;
    line-height: 1.2;
}

.wordmark   { font-family: var(--display); font-size: 2rem; color: var(--ink); }
.wordmark a { color: inherit; }

/* Navigation — two centered rows */
nav.rows {
    font-size: .85rem;
    font-family: var(--nav);
    text-transform: uppercase;
    letter-spacing: .04em;
    width: 100%;
}

nav.rows ul {
    list-style: none;
    margin: .15rem 0;
    padding: 0;
    text-align: center;
    width: 100%;
}

nav.rows li           { display: inline; }
nav.rows li + li::before { content: " \2022  "; color: var(--rule); }

/* Mobile nav — hidden on desktop, shown on phones */
details.contents {
    display: none;
    text-align: left;
    border: 1px solid var(--rule);
    padding: .5rem .8rem;
    margin: .6rem 0;
    font-size: .9rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    font-family: var(--nav);
}

details.contents summary    { font-family: var(--nav); cursor: pointer; color: var(--indigo); }
details.contents li         { display: block; padding: .15rem 0; }
details.contents li + li::before { content: none; }


/* ======================================================================
   SECTION 5: EPIGRAPHS AND PULL QUOTES

   .epigraph — centered italic quote. Use for page-opening Morris quotes
   when no image is competing for space beside it.

   .epigraph-left — same styling but left-aligned. Use when a float image
   is present beside the quote; otherwise .epigraph tries to center itself
   in the non-floated area and looks wrong.
   ====================================================================== */

.epigraph {
    font-style: italic;
    text-align: center;
    max-width: 46ch;
    margin: 1rem auto 0;
}

.epigraph .attr {
    font-style: normal;
    font-size: .9rem;
    display: block;
    margin-top: .2rem;
}

/* Left-aligned: use when a float image is present beside the quote */
.epigraph-left {
    font-style: italic;
    max-width: var(--measure);
    margin: .5rem 0 1rem;
    text-align: left;
}

.epigraph-left .attr {
    font-style: normal;
    font-size: .9rem;
    display: block;
    margin-top: .2rem;
}


/* ======================================================================
   SECTION 6: BOOK DEVICES

   Decorative elements from book typography:

   .toc — table of contents with dot leaders (the dots connecting title
   to page number in a printed book). Used on section overview pages.

   .dropcap — large illuminated first letter. SUPPRESSED here because
   P22 Morris Troy is not loaded in transitional mode.

   .fleuron — ornamental section separator. Full Kelmscott uses Morris's
   comma-cross ornament; transitional renders it as a plain hairline.

   .featured — a single prominent image, centered, for hero tile images.
   ====================================================================== */

/* Table of contents with dot leaders */
.toc {
    border: 1px solid var(--rule);
    background: var(--parchment-deep);
    padding: 1rem 1.4rem;
    margin: 1.6rem auto;
    max-width: 34rem;
}

.toc h2 {
    margin: 0 0 .5rem;
    font-size: 1.15rem;
    text-align: center;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.toc ol { list-style: none; margin: 0; padding: 0; }

.toc li {
    display: flex;
    align-items: baseline;
    gap: .5ch;
    padding: .18rem 0;
}

.toc li::after {
    content: "";
    order: 2;
    flex: 1;
    border-bottom: 1px dotted var(--rule);
    transform: translateY(-4px);
}

.toc a      { order: 1; }
.toc .folio { order: 3; font-variant: small-caps; color: var(--lustre); }

/* Drop cap — suppressed in transitional mode */
.dropcap::first-letter {
    font-size: inherit;
    float: none;
    padding: 0;
    color: inherit;
}

/* Fleuron — plain hairline in transitional (Morris ornament not available) */
.fleuron           { border: 0; border-top: 1px solid var(--rule); margin: 2.2rem 0; }
.fleuron::after    { content: none; }

/* Featured/hero image — single prominent tile image, centered */
.featured          { max-width: 28rem; margin: 1.4rem auto; text-align: center; }
.featured img      { width: 100%; height: auto; display: block; }
.featured figcaption { font-style: italic; font-size: .9rem; margin-top: .4rem; }


/* ======================================================================
   SECTION 7: SEPARATORS AND DIVIDERS

   Three horizontal rules, each for a different context:

   hr.sep    — the ornamental section.png image used throughout the site.
               Write <hr class="sep"> instead of the old img block.

   hr.fleuron — defined above in Book Devices (plain hairline here).

   hr.rose   — the footer hairline in WMT rose color.

   .centered — utility class, text-align:center on any element.
   ====================================================================== */

hr.sep {
    border: 0;
    height: 22px;
    background: url('https://williammorristile.com/images/section.png') center no-repeat;
    margin: 1.5rem 0;
}

hr.rose {
    border: 0;
    border-top: 1px solid var(--rose);
    margin: .4rem 0;
}

.centered { text-align: center; }


/* ======================================================================
   SECTION 8: TILE GRID

   .tiles — the auto-filling grid of clickable tile boxes used on gallery
   and category pages. Each box is a .tile link with a square image
   placeholder (.img) and a label (.name) below it.
   ====================================================================== */

.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
    gap: 1.1rem;
    margin: 1.2rem 0;
}

.tile {
    border: 1px solid var(--rule);
    background: #fff;
    color: var(--ink);
    display: block;
    padding: .55rem;
}

.tile:hover { border-color: var(--turquoise); }

.tile .img {
    aspect-ratio: 1;
    background: var(--parchment-deep);
    border: 1px dashed var(--rule);
    display: grid;
    place-items: center;
    font-size: .8rem;
    color: #7a6c58;
    text-align: center;
    padding: .5rem;
}

.tile .name {
    font-family: var(--display);
    font-size: .98rem;
    display: block;
    margin-top: .5rem;
    text-align: center;
    color: var(--indigo);
}


/* ======================================================================
   SECTION 9: LAYOUT UTILITIES

   Reusable patterns for page composition:

   .img-right / .img-left — float an image beside text. Use .clearfix
   on the parent container to stop the float before the next section.

   .two-col — two equal columns. Collapses to one column on mobile.
   Use for pricing/links, catalog sections, and col-entry grids.

   .tile-entry — horizontal card: image fixed at 200px on the left,
   text flowing on the right. For product listings with longer descriptions.

   .col-entry — vertical card: image centered above text. Use inside
   .two-col on catalog and product pages.

   .heading-img — section image at 80% container width, centered above
   a section heading. Used on the catalog page.
   ====================================================================== */

/* Floating images with text wrap */
.img-right { float: right; margin: 0 0 1.2rem 1.8rem; max-width: 42%; }
.img-left  { float: left;  margin: 0 1.8rem 1.2rem 0; max-width: 42%; }
.img-right img, .img-left img { display: block; width: 100%; height: auto; }

.clearfix::after { content: ''; display: table; clear: both; }

@media (max-width: 640px) {
    .img-right, .img-left { float: none; max-width: 100%; margin: 0 0 1rem; }
}


/* Two equal columns — collapses on phones */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    margin: 2rem 0;
}

@media (max-width: 640px) {
    .two-col { grid-template-columns: 1fr; }
}


/* Horizontal product card: fixed image left, text right */
.tile-entry {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    margin: 2rem 0 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--rule);
}

.tile-entry:last-of-type   { border-bottom: none; padding-bottom: 0; }
.tile-entry .entry-img     { flex: 0 0 200px; }
.tile-entry .entry-img img { width: 100%; height: auto; display: block; }
.tile-entry .entry-img a   { display: block; }
.tile-entry .entry-text    { flex: 1; min-width: 0; }
.tile-entry .entry-text h3 { margin-top: 0; }

@media (max-width: 640px) {
    .tile-entry            { flex-direction: column; gap: 1rem; }
    .tile-entry .entry-img { flex: 0 0 auto; max-width: 280px; }
}


/* Vertical product card: image above text (use inside .two-col) */
.col-entry { margin-bottom: 1.5rem; }

.col-entry img {
    max-width: 280px;
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto .8rem;
}

.col-entry h3 { font-size: 1.05rem; margin: .4rem 0 .25rem; text-align: center; }
.col-entry p  { font-size: .95rem; margin: .25rem 0; }


/* Section heading image — 80% width, centered above a section */
.heading-img {
    display: block;
    width: 80%;
    max-width: 100%;
    height: auto;
    margin: 0 auto 1rem;
}

.heading-img a { display: block; }


/* ======================================================================
   SECTION 10: BUILD-PHASE TOOLS

   Scaffolding useful while building pages, not intended for permanent use.

   .writes — highlighted block marking prose Christine still needs to
   write. The blue left border makes it impossible to miss on the page.
   Replace these blocks with real prose before launch.

   .merton-date, .merton-links — used only by Merton auto-generated
   listing pages. These can move to a merton-specific stylesheet later.
   ====================================================================== */

/* Placeholder block — remove or replace before launch */
.writes {
    border-left: 4px solid var(--indigo);
    background: var(--parchment-deep);
    padding: .8rem 1.1rem;
    margin: 1.2rem 0;
    max-width: var(--measure);
}

.writes .who {
    font-family: var(--display);
    font-size: .85rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--lustre);
    display: block;
    margin-bottom: .3rem;
}

.writes p       { margin: .3rem 0; font-style: italic; }
.gallery-link   { font-size: 1rem; }

/* Merton listing page elements */
.merton-date  { font-size: .9rem; color: #666; margin: .2rem 0 1.4rem; }
.merton-links { list-style: none; padding: 0; margin: .5rem 0 1rem; }
.merton-links li            { padding: .2rem 0; border-bottom: 1px dotted var(--rule); }
.merton-links li:last-child { border-bottom: none; }


/* ======================================================================
   SECTION 11: FOOTER
   ====================================================================== */

footer.site, #footer {
    clear: both;
    width: 100%;
    border-top: 1px solid var(--rule);
    margin-top: 3rem;
    padding: .6rem 0 2rem;
    font-size: .9rem;
    text-align: left;
}

footer.site p, #footer p { padding: 10px; margin: 0; }


/* ======================================================================
   SECTION 12: RESPONSIVE AND PRINT

   Phones (max 640px): hide desktop nav, show mobile nav, reduce type.
   Tablets (641-1024px): grid and measure handle themselves; add rules
   here if a specific device proves otherwise.
   Reduced motion: respects the OS accessibility setting.
   Print: hide navigation and scaffolding, restore black on white.
   ====================================================================== */

@media (max-width: 640px) {
    nav.rows.desktop { display: none; }
    details.contents { display: block; }
    body { font-size: 1.0625rem; }
    h1   { font-size: 1.9rem; }
}

@media (min-width: 641px) and (max-width: 1024px) {
    /* Add tablet-specific overrides here if needed */
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}

@media print {
    nav.rows, details.contents, .writes { display: none; }
    html { background: #fff; }
    a    { color: var(--ink); }
}


/* ======================================================================
   SECTION 13: FONTS

   Self-hosted fonts only — no Adobe Fonts in transitional mode.

   TeX Gyre Pagella is used for body text (4 weights: regular, italic,
   bold, bold-italic). TeX Gyre Schola is used for navigation.
   Both are served from the /fonts/ folder next to this stylesheet.
   License: GUST Font License (free for web). LICENSE-GUST.txt should
   travel with the font files.
   ====================================================================== */

@font-face {
    font-family: 'TeX Gyre Schola';
    font-style: normal;
    font-weight: 400;
    src: url('fonts/tex-gyre-schola-400.woff2') format('woff2');
    font-display: swap;
}

@font-face {
    font-family: 'TeX Gyre Schola';
    font-style: normal;
    font-weight: 700;
    src: url('fonts/tex-gyre-schola-700.woff2') format('woff2');
    font-display: swap;
}

@font-face {
    font-family: 'TeX Gyre Pagella';
    font-style: normal;
    font-weight: 400;
    src: url('fonts/tex-gyre-pagella-400.woff2') format('woff2');
    font-display: swap;
}

@font-face {
    font-family: 'TeX Gyre Pagella';
    font-style: italic;
    font-weight: 400;
    src: url('fonts/tex-gyre-pagella-400italic.woff2') format('woff2');
    font-display: swap;
}

@font-face {
    font-family: 'TeX Gyre Pagella';
    font-style: normal;
    font-weight: 700;
    src: url('fonts/tex-gyre-pagella-700.woff2') format('woff2');
    font-display: swap;
}

@font-face {
    font-family: 'TeX Gyre Pagella';
    font-style: italic;
    font-weight: 700;
    src: url('fonts/tex-gyre-pagella-700italic.woff2') format('woff2');
    font-display: swap;
}
