/* =====================================================================
   flourishklink.com: the one stylesheet for the whole site
   =====================================================================

   Every page (the home page and each homily/essay page) loads this file.
   It is organized top to bottom as:

     1. Fonts            (where the font files are, and ligature settings)
     2. Colours          (change the whole colour scheme in one place)
     3. Page basics      (text size, links, headings)
     4. Top bar          (the sticky header with the site name and links)
     5. Opening section  (“Hi, I’m Father Flourish.” and the arched photo)
     6. Content sections (About, A little more about me, Education)
     7. Homily & essay cards on the home page (the expanding boxes)
     8. Get in touch, and the footer
     9. Individual homily & essay pages (/posts/…/)
    10. Phones and narrow windows

   A few CSS notes, if it has been a while:
     - A line like  .edu b { … }  means “bold text inside anything with
       class="edu"”. The class names match the ones in the HTML files.
     - “px” is pixels. clamp(A, B, C) means “B, but never smaller than A
       or bigger than C”; it lets sizes grow and shrink with the window.
     - var(--green) means “use the colour called --green from section 2”.
     - Anything between slash-star and star-slash is a comment and is
       ignored by browsers.
   ===================================================================== */


/* ---------------------------------------------------------------------
   1. FONTS
   ---------------------------------------------------------------------
   Body text: Junicode 2 by Peter S. Baker (free, SIL Open Font License;
   the licence is in assets/fonts/OFL.txt). The four files below live in
   assets/fonts/ and were trimmed to Western European letters and common
   punctuation so they load quickly.

   Headings: Quintessential, loaded from Google Fonts by the <link> tag
   in includes/head.php.

   Each @font-face rule tells the browser “when I ask for Junicode in this
   weight and style, use this file”. 400 = regular, 700 = bold.
   --------------------------------------------------------------------- */
@font-face{font-family:Junicode;src:url("fonts/junicode-regular.woff") format("woff");font-weight:400;font-style:normal;font-display:swap}
@font-face{font-family:Junicode;src:url("fonts/junicode-italic.woff") format("woff");font-weight:400;font-style:italic;font-display:swap}
@font-face{font-family:Junicode;src:url("fonts/junicode-bold.woff") format("woff");font-weight:700;font-style:normal;font-display:swap}
@font-face{font-family:Junicode;src:url("fonts/junicode-bolditalic.woff") format("woff");font-weight:700;font-style:italic;font-display:swap}

/* Ligatures. Browsers show only the basic ligatures (fi, ff, ffl…) unless
   told otherwise. This switches on Junicode’s decorative ones too: ct, st,
   ft, tt, fr, fy, tr, ty, and in italics also Qu, as, is, us.
   - To turn the decorative ones OFF, delete “discretionary-ligatures”.
   - The antique historic set (ch, ck, gg, ll) was left OUT of the trimmed
     font files, so adding “historical-ligatures” here would do nothing.
     Getting it would mean re-trimming the fonts from the full Junicode
     download with that set kept in. */
body,h1,h2,h3,summary,.ht{
  font-variant-ligatures:common-ligatures discretionary-ligatures contextual;
  font-kerning:normal;               /* use the font’s own letter spacing pairs */
  text-rendering:optimizeLegibility;
}


/* ---------------------------------------------------------------------
   2. COLOURS
   ---------------------------------------------------------------------
   Change a colour here and it changes everywhere it is used.
   Colours are written as hex codes (#rrggbb); any online “colour picker”
   will give you one.
   --------------------------------------------------------------------- */
:root{
  color-scheme:light;
  --bg:#f1f4ee;      /* pale sage: the main page background */
  --panel:#fbfcf9;   /* near-white: alternate section bands and the cards */
  --ink:#1e2a23;     /* very dark green: main text */
  --soft:#4c5a51;    /* grey-green: secondary text (dates, captions, notes) */
  --green:#2f5a44;   /* evergreen: links and section headings */
  --claret:#8a2c3b;  /* claret: hover colour, focus outlines, the ✠ bullets */
  --rule:#d3dcd0;    /* light grey-green: thin dividing lines and borders */
}


/* ---------------------------------------------------------------------
   3. PAGE BASICS
   --------------------------------------------------------------------- */

/* Make widths include padding and borders (much easier to reason about),
   and let flexible boxes shrink on small screens. */
*{box-sizing:border-box;min-width:0}

/* Smooth scrolling when a header link jumps to a section. The 72px stops
   the section title from hiding under the sticky top bar. */
html{scroll-behavior:smooth;scroll-padding-top:72px}
/* …but not for visitors who have asked their device for less motion. */
@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto}}

/* Main text: 18px Junicode, 1.6 line spacing. Georgia etc. are backups
   used only if Junicode fails to load.
   Note: the font is set with three separate lines (font-family, font-size,
   line-height) on purpose. The one-line “font:” shorthand would also reset
   the ligature setting from section 1 and switch the decorative ligatures
   off, so don't combine them into “font: …” here or anywhere below. */
body{margin:0;background:var(--bg);color:var(--ink);font-family:Junicode,Georgia,Baskerville,"Times New Roman",serif;font-size:18px;line-height:1.6;overflow-x:clip}

/* Links: green with a thin underline, claret when the mouse is over them. */
a{color:var(--green);text-decoration-thickness:1px;text-underline-offset:3px}
a:hover{color:var(--claret)}

/* Outline shown when someone moves through the page with the Tab key.
   Keep this for keyboard users. */
a:focus-visible,summary:focus-visible{outline:2px solid var(--claret);outline-offset:3px;border-radius:3px}

/* Big headings and the site name use Quintessential. */
h1,h2,.brand{font-family:Quintessential,Georgia,serif;font-weight:400;line-height:1.05;text-wrap:balance}


/* ---------------------------------------------------------------------
   4. TOP BAR (includes/head.php)
   ---------------------------------------------------------------------
   The bar with “The Rev. Flourish Klink” and the section links. It stays
   stuck to the top of the window while scrolling (position:sticky).
   The bar's background is the sage of --bg written out as numbers
   (rgba = red, green, blue, opacity) so it can be slightly see-through.
   It does NOT follow --bg automatically: if you change --bg, change the
   rgba(…) below to match (241,244,238 is #f1f4ee; .92 = 92% opaque).
   --------------------------------------------------------------------- */
header.top{position:sticky;top:0;z-index:5;background:rgba(241,244,238,.92);backdrop-filter:blur(6px);border-bottom:1px solid var(--rule)}
/* The inner row: site name on the left, links on the right; wraps onto
   two lines on narrow screens. max-width keeps it from spreading too wide. */
.top .in{max-width:1080px;margin:0 auto;padding:10px max(5vw,16px);display:flex;flex-wrap:wrap;gap:6px 24px;align-items:center;justify-content:space-between}
.brand{font-size:22px;color:var(--ink);text-decoration:none}
nav ul{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:4px 20px}
nav a{display:inline-block;padding:10px 0;text-decoration:none;color:var(--soft)}
nav a:hover{color:var(--claret)}


/* ---------------------------------------------------------------------
   5. OPENING SECTION (content/about.php, the part with class="hero")
   ---------------------------------------------------------------------
   Two columns: greeting on the left, arched photo on the right.
   On phones they stack (see section 10).
   --------------------------------------------------------------------- */
.hero{max-width:1080px;margin:0 auto;padding:clamp(32px,6vw,80px) max(5vw,16px);display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,.85fr);gap:clamp(28px,5vw,72px);align-items:center}
.hero h1{font-size:clamp(40px,6.5vw,64px);margin:0 0 18px;color:var(--ink)}  /* “Hi, I’m Father Flourish.” */
.lede{font-size:clamp(18px,2vw,21px);color:var(--soft);margin:0 0 22px;max-width:34em}  /* the sentence under it */

/* The photo in its church-window arch. The arch shape comes from the
   border-radius line: 50%/34% rounds the top corners into an arch, 6px
   keeps the bottom corners nearly square. aspect-ratio 2/3 = portrait.
   For a plain rectangle instead of an arch, delete the border-radius part
   (everything from “border-radius:” up to and including the next “;”). */
.arch{position:relative;margin:0;justify-self:center;width:min(100%,380px)}
.arch .frame{border-radius:50% 50% 6px 6px / 34% 34% 6px 6px;overflow:hidden;border:6px solid var(--panel);box-shadow:0 0 0 1px var(--rule),0 24px 50px -24px rgba(30,42,35,.45);aspect-ratio:2/3;background:#cfd8cc}
/* The frame is always 2:3. A photo of a different shape is trimmed to fit,
   and object-position decides which part stays in view: 50% = centred
   left-to-right; 20% = near the top (where the face is). A smaller number
   keeps more of the top of the photo, a larger one more of the bottom.
   (The current photo is exactly 2:3, so nothing is trimmed.) */
.arch img{display:block;width:100%;height:100%;object-fit:cover;object-position:50% 20%}
.arch figcaption{font-size:13px;color:var(--soft);text-align:center;margin-top:10px}  /* photo credit */


/* ---------------------------------------------------------------------
   6. CONTENT SECTIONS
   ---------------------------------------------------------------------
   Each section of the home page is a full-width “band”. Bands marked
   class="band alt" get the near-white background, so the page alternates
   sage / white / sage… Swap “band” and “band alt” in the HTML to change
   which sections are white.
   --------------------------------------------------------------------- */
.band{padding:clamp(36px,5vw,72px) max(5vw,16px);border-top:1px solid var(--rule)}
.band.alt{background:var(--panel)}
.wrap{max-width:760px;margin:0 auto}   /* keeps lines of text a comfortable length */
.band h2{font-size:clamp(32px,4.5vw,44px);margin:0 0 22px;color:var(--green)}  /* About, Homilies, … */
.band h3{font-family:Junicode,Georgia,serif;font-size:21px;font-weight:700;margin:32px 0 10px}  /* Education */

/* Bulleted lists with a claret ✠ cross instead of a dot
   (<ul class="facts"> in content/about.php). Change the "✠" to use a
   different symbol. */
ul.facts{margin:0;padding:0;list-style:none}
ul.facts li{position:relative;padding:0 0 14px 28px}
ul.facts li::before{content:"✠";position:absolute;left:0;top:1px;color:var(--claret);font-size:15px}

/* Education cards (<ul class="edu">). They sit side by side and wrap
   onto new rows when there isn’t room; each is at least 200px wide.
   Inside each card, <b> is the degree and <span> the school and year. */
.edu{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:14px;margin:8px 0 0;padding:0;list-style:none}
.edu li{background:var(--bg);border:1px solid var(--rule);border-radius:10px;padding:16px 18px}
.edu b{display:block;font-size:19px}
.edu span{color:var(--soft);font-size:15px}


/* ---------------------------------------------------------------------
   7. HOMILY & ESSAY CARDS ON THE HOME PAGE (includes/post-list.php)
   ---------------------------------------------------------------------
   Each card is a <details> element: the browser itself opens and closes
   it when the title (the <summary>) is clicked; no JavaScript involved.
   Homilies and essays use the same card (class="homily" for both).
   --------------------------------------------------------------------- */
.homily{background:var(--panel);border:1px solid var(--rule);border-radius:12px;margin:0 0 20px;overflow:hidden}

/* The always-visible part: title and date on one row, subtitle and the
   “Read …” prompt below. “list-style:none” and the ::-webkit-details-marker
   line hide the browser’s own little triangle (the second line is needed
   for Safari), since we show our own “Read …” text instead. */
.homily summary{list-style:none;cursor:pointer;padding:20px 22px;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 16px;align-items:baseline}
.homily summary::-webkit-details-marker{display:none}
.homily .ht{font-family:Quintessential,Georgia,serif;font-size:clamp(23px,3vw,28px);line-height:1.15;color:var(--ink)}  /* title */
.homily summary:hover .ht{color:var(--claret)}
.homily time{color:var(--soft);font-size:15px;white-space:nowrap}         /* date */
.homily .place{grid-column:1/-1;color:var(--soft);font-style:italic;font-size:16px}  /* subtitle line */

/* The “Read the homily ↓” / “Read the essay ↓” / “Close ↑” prompt.
   The words are set here, not in the HTML; edit them here. */
.homily .toggle{grid-column:1/-1;font-size:15px;color:var(--green);margin-top:6px}
.homily .toggle::after{content:"Read the homily ↓"}
.homily .toggle.essay::after{content:"Read the essay ↓"}
.homily[open] .toggle::after{content:"Close ↑"}

/* The text that appears when a card is opened (class="hbody"). The same
   class is used on the individual post pages (section 9). */
.hbody{padding:4px 22px 26px;border-top:1px solid var(--rule)}
.hbody p{margin:0 0 1em}
.hbody .intro{color:var(--soft);font-style:italic}       /* italic notes at the top of a post: <p class="intro"> */
.hbody hr{border:0;border-top:1px solid var(--rule);margin:22px auto;width:40%}  /* short centred divider: <hr> */
.amen{font-weight:700}                                     /* <p class="amen"> makes a closing line bold */

/* Footnote numbers (<sup>) and the numbered notes at the end of an essay
   (<ol class="notes">). */
.hbody sup{line-height:0}
.hbody sup a{text-decoration:none;padding:0 2px}
.notes{font-size:15px;color:var(--soft);padding-left:1.4em;margin:0}
.notes li{margin-bottom:.6em}

/* Embedded YouTube video (<div class="video"> around an <iframe>) keeps
   a 16:9 shape at any width. The pill-shaped link under it is class="watch". */
.video{position:relative;aspect-ratio:16/9;margin:8px 0 12px;border-radius:10px;overflow:hidden;background:#1e2a23}
.video iframe{position:absolute;inset:0;width:100%;height:100%;border:0}
.watch{display:inline-flex;align-items:center;gap:8px;padding:10px 16px;border:1px solid var(--green);border-radius:999px;text-decoration:none;margin:4px 0 20px}
.watch:hover{background:var(--green);color:#fff}

/* “Permanent link: …” line at the bottom of each opened card. */
.permalink{margin:22px 0 0;font-size:15px;color:var(--soft)}


/* ---------------------------------------------------------------------
   8. GET IN TOUCH, AND THE FOOTER
   --------------------------------------------------------------------- */
.mail{font-size:clamp(22px,3vw,28px)}   /* the large email address (content/contact.php) */
footer{padding:28px max(5vw,16px);border-top:1px solid var(--rule);color:var(--soft);font-size:14px;text-align:center}  /* includes/footer.php */


/* ---------------------------------------------------------------------
   9. INDIVIDUAL HOMILY & ESSAY PAGES (includes/post.php)
   --------------------------------------------------------------------- */
.post{max-width:760px;margin:0 auto;padding:clamp(32px,6vw,72px) max(5vw,16px)}
.post .kicker{margin:0 0 10px;font-size:15px}        /* “← Homilies” back link */
.post .kicker a{text-decoration:none}
.post h1{font-size:clamp(36px,6vw,54px);margin:0 0 14px;color:var(--ink)}  /* the title */
.post .meta{color:var(--soft);font-style:italic;margin:0 0 28px}          /* date · subtitle */
.post .hbody{padding:0;border:0}                     /* no card padding on a full page */


/* ---------------------------------------------------------------------
   10. PHONES AND NARROW WINDOWS
   ---------------------------------------------------------------------
   Everything inside this block applies only when the window is 720px
   wide or less: the opening section becomes one column, with the photo
   on top and a little smaller.
   --------------------------------------------------------------------- */
@media (max-width:720px){
  .hero{grid-template-columns:minmax(0,1fr)}
  .arch{order:-1;width:min(78%,320px)}
}
