/* ============================================================================
   STYLES.CSS — all visual styling for the whole site lives in this one file.
   It's organized top-to-bottom in roughly the order things appear on the page:
   colours -> base/reset -> nav -> homepage hero -> sub-page header -> buttons
   -> sections -> content/timeline -> cards -> profile/table -> events
   -> contact -> footer -> scroll animation.
   Search for the "==== SOME NAME ====" banners below to jump to a section.
   ============================================================================ */

/* ---------- COLOUR PALETTE ---------- */
/* These are CSS "variables" (custom properties). Defining a colour once here
   and reusing it everywhere (e.g. var(--brass)) means you can re-theme the
   whole site by changing a value in just this one place. */
:root{
  --ink:#1B2130;        /* main dark text colour / dark backgrounds (footer, buttons) */
  --ink-soft:#333A4A;   /* slightly lighter body text colour */
  --parchment:#F7F3EA;  /* main page background colour (cream/off-white) */
  --parchment-dim:#EFE9DA; /* slightly darker cream, used for subtle backgrounds */
  --brass:#9C7A3C;      /* accent gold/brass colour — links, highlights, icons */
  --brass-light:#C9A968;/* lighter brass, used for footer link hover */
  --stone:#6B675C;      /* muted grey-brown for secondary/quiet text */
  --line:#DDD5C3;       /* soft border colour used throughout (cards, dividers) */
  --max-w:1100px;       /* the maximum width the page content will stretch to */
}

/* ---------- GLOBAL RESET / BASE SETTINGS ---------- */
*{ box-sizing:border-box; } /* makes width/height calculations include padding+border, avoiding layout surprises */
html{ scroll-behavior:smooth; } /* smooth-scrolls to anchor links instead of jumping instantly */

/* Respect users who have "reduce motion" turned on in their OS accessibility settings:
   turn off smooth scrolling and shrink all animations/transitions to near-zero. */
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior:auto; }
  *{ animation-duration:0.01ms !important; transition-duration:0.01ms !important; }
}

body{
  margin:0;                       /* remove the browser's default page margin */
  background:var(--parchment);    /* cream page background */
  color:var(--ink);               /* default text colour */
  font-family:'Inter', sans-serif;/* default English font */
  line-height:1.6;                /* comfortable spacing between lines of text */
}
/* When the page is switched to Chinese (html.lang-zh), swap the whole page's
   body font to the Chinese sans-serif font instead of Inter. */
html.lang-zh body{ font-family:'Noto Sans TC', sans-serif; }

/* Headings use the elegant serif font, in English */
h1,h2,h3{ font-family:'Cormorant Garamond', serif; font-weight:600; margin:0; color:var(--ink); }
/* ...and the Chinese serif font when the page is in Chinese */
html.lang-zh h1, html.lang-zh h2, html.lang-zh h3{ font-family:'Noto Serif TC', serif; }

/* ---------- THE BILINGUAL LANGUAGE SWITCH — THE MOST IMPORTANT RULE IN THIS FILE ---------- */
/* Every bit of text on the site is written twice in the HTML:
     <span class="en">English text</span><span class="zh">中文文字</span>
   These two rules simply hide whichever language is NOT selected:
     - If <html> has class="lang-en", every ".zh" span is hidden (display:none).
     - If <html> has class="lang-zh", every ".en" span is hidden instead.
   script.js is what actually adds/removes "lang-en"/"lang-zh" on <html>. */
html.lang-en .zh{ display:none; }
html.lang-zh .en{ display:none; }

a{ color:inherit; } /* links use the surrounding text colour by default, instead of the browser's default blue */

/* ---------- LAYOUT WRAPPER ---------- */
/* ".wrap" is used inside almost every section to center content and keep it
   from stretching edge-to-edge on wide screens, with side padding on mobile. */
.wrap{ max-width:var(--max-w); margin:0 auto; padding:0 28px; }

/* Small uppercase gold "eyebrow" label used above headings, e.g. "OUR STORY" */
.eyebrow{
  font-size:12px; letter-spacing:0.16em; text-transform:uppercase;
  color:var(--brass); font-weight:600;
}

/* ============================================================================
   NAV — the sticky header bar at the top of every page
   ============================================================================ */
header{
  position:sticky; top:0; z-index:50;         /* sticks to the top of the screen when scrolling; z-index keeps it above other content */
  background:rgba(247,243,234,0.92);          /* semi-transparent cream so page content is faintly visible behind it while scrolling */
  backdrop-filter:blur(6px);                  /* blurs whatever scrolls underneath the header, for a "frosted glass" look */
  border-bottom:1px solid var(--line);        /* thin line separating the header from the page */
}
nav.wrap{ display:flex; align-items:center; justify-content:space-between; height:72px; } /* logo on the left, nav links + toggle on the right */

.brand{ /* the site name/logo text, top-left */
  font-family:'Cormorant Garamond', serif; font-weight:700; font-size:19px;
  letter-spacing:0.01em; text-decoration:none; color:var(--ink); white-space:nowrap; /* nowrap keeps the church name on one line */
}
html.lang-zh .brand{ font-family:'Noto Serif TC', serif; } /* Chinese font for the logo when in Chinese mode */

.nav-links{ display:flex; gap:26px; list-style:none; margin:0; padding:0; font-size:14px; font-weight:500; } /* horizontal row of nav links, no bullet points */
.nav-links a{
  text-decoration:none; color:var(--ink-soft); padding-bottom:4px;
  border-bottom:2px solid transparent; /* invisible underline reserved in advance, so hovering doesn't shift layout */
  transition:border-color .2s ease, color .2s ease; /* smooth colour/underline fade on hover */
}
/* On hover, keyboard focus, OR on the current page (class="active"): darken text and show the brass underline */
.nav-links a:hover, .nav-links a:focus-visible, .nav-links a.active{ color:var(--ink); border-bottom-color:var(--brass); }

.nav-right{ display:flex; align-items:center; gap:18px; } /* holds the language toggle button */

#langToggle{ /* the "中文 / English" button */
  font-family:'Inter', sans-serif; font-size:13px; font-weight:600; letter-spacing:0.04em;
  background:var(--ink); color:var(--parchment); border:none; padding:9px 16px;
  border-radius:2px; cursor:pointer; transition:background .2s ease;
}
#langToggle:hover, #langToggle:focus-visible{ background:var(--brass); } /* turns gold on hover/focus */
#langToggle:focus-visible{ outline:2px solid var(--brass); outline-offset:2px; } /* visible focus ring for keyboard users */

/* On narrow/tablet screens (860px or less), hide the middle nav links to save
   space. NOTE: there is currently no mobile hamburger menu added back in —
   only the logo and language toggle remain visible below this width. */
@media (max-width: 860px){ .nav-links{ display:none; } }

/* ============================================================================
   HOMEPAGE HERO — the big introduction banner (index.html only)
   ============================================================================ */
.hero{ padding:100px 0 90px; position:relative; overflow:hidden; }
/* Decorative background layer behind the hero content: a soft fade plus
   faint vertical ruled lines (like old ledger paper), for texture. */
.hero::before{
  content:""; position:absolute; inset:0;
  background:
    linear-gradient(180deg, transparent 0%, var(--parchment) 100%),
    repeating-linear-gradient(90deg, var(--parchment-dim) 0 1px, transparent 1px 140px);
  opacity:0.6; pointer-events:none; /* pointer-events:none so this decorative layer never blocks clicks */
}
.hero-inner{ position:relative; display:grid; grid-template-columns:1fr auto; gap:48px; align-items:end; } /* 2-column grid: text (flexible) + cornerstone graphic (fixed width) */
.hero h1{ font-size:clamp(38px, 6vw, 68px); line-height:1.05; margin:14px 0 20px; } /* clamp() makes the heading scale smoothly between 38px (small screens) and 68px (large screens) */
.hero p.lede{ max-width:520px; font-size:18px; color:var(--ink-soft); margin:0 0 32px; } /* the intro paragraph under the big heading */
.hero-ctas{ display:flex; gap:14px; flex-wrap:wrap; } /* row of call-to-action buttons, wraps onto a new line if needed */

/* On narrow screens, stack the hero text and cornerstone graphic vertically instead of side-by-side */
@media (max-width: 720px){ .hero-inner{ grid-template-columns:1fr; } }

.cornerstone{ width:150px; height:150px; flex-shrink:0; position:relative; } /* the decorative "1897" square graphic */
.cornerstone svg{ width:100%; height:100%; }
.cornerstone-year{ font-family:'Cormorant Garamond', serif; font-weight:700; }
html.lang-zh .cornerstone-year{ font-family:'Noto Serif TC', serif; }
@media (max-width: 720px){ .cornerstone{ width:110px; height:110px; } } /* shrink the graphic slightly on small screens */

/* ============================================================================
   PAGE HEADER BANNER — the smaller title banner used on every sub-page
   (About Us, Events, Cell Groups, Contact, etc — everything except the homepage)
   ============================================================================ */
.page-hero{ padding:64px 0 48px; border-bottom:1px solid var(--line); }
.breadcrumb{ font-size:13px; color:var(--stone); margin-bottom:14px; } /* the small "Home / About Us / ..." trail */
.breadcrumb a{ color:var(--brass); text-decoration:none; }
.breadcrumb a:hover{ text-decoration:underline; }
.page-hero h1{ font-size:clamp(32px,5vw,52px); margin-top:6px; }
.page-hero p.lede{ max-width:620px; font-size:16px; color:var(--ink-soft); margin-top:14px; }

/* "← Back to About Us" style links used at the bottom of sub-sub-pages */
.back-link{
  display:inline-flex; align-items:center; gap:6px; font-size:14px;
  color:var(--brass); text-decoration:none; margin-bottom:20px;
}
.back-link:hover{ text-decoration:underline; }

/* ============================================================================
   BUTTONS
   ============================================================================ */
.btn{
  display:inline-block; padding:13px 24px; font-size:14px; font-weight:600;
  letter-spacing:0.02em; text-decoration:none; border-radius:2px;
  transition:transform .15s ease, background .2s ease, color .2s ease;
}
.btn-primary{ background:var(--ink); color:var(--parchment); } /* solid dark button, e.g. "Learn Our Story" */
.btn-primary:hover{ background:var(--brass); }
.btn-secondary{ background:transparent; color:var(--ink); border:1px solid var(--ink); } /* outline button, e.g. "Visit Us", "Get Directions" */
.btn-secondary:hover{ border-color:var(--brass); color:var(--brass); }
.btn:focus-visible{ outline:2px solid var(--brass); outline-offset:2px; } /* keyboard focus ring for accessibility */

/* ============================================================================
   SECTION SHELL — the generic spacing/border wrapper used by every <section>
   ============================================================================ */
section{ padding:80px 0; border-top:1px solid var(--line); } /* default: adds vertical spacing + a thin top divider line */
section.no-border{ border-top:none; } /* used when a section sits directly under a hero/banner, so we don't get a double line */
.section-head{ margin-bottom:40px; max-width:640px; } /* the "eyebrow + h2" heading block used above card grids */
.section-head h2{ font-size:clamp(28px,4vw,40px); margin-top:8px; }
.section-head p{ color:var(--stone); margin-top:14px; font-size:16px; }

/* Generic body paragraph styling used inside long-form text blocks (About Us history, Statement of Faith, etc) */
.content-block p{ color:var(--ink-soft); margin:0 0 18px; max-width:740px; font-size:16px; } /* max-width keeps lines of text from getting too wide to read comfortably */
.content-block h3{ font-size:22px; margin:32px 0 14px; }

/* The yellow "Placeholder content" callout boxes seen on several pages */
.placeholder-note{
  background:#FFF7E8; border:1px solid #EFD9A6; color:#8A6D1D; /* soft yellow background + border + brown text, to look like a sticky note / draft warning */
  padding:14px 18px; border-radius:4px; font-size:14px; margin:24px 0; max-width:740px;
}
.placeholder-note strong{ color:#6B540F; } /* slightly darker brown for the bold "Placeholder content:" label */

/* Styled quote blocks, e.g. the Bible verse on the About Us page */
blockquote{
  border-left:3px solid var(--brass); margin:28px 0; padding:4px 0 4px 20px; /* gold vertical line on the left, like a highlighted excerpt */
  font-family:'Cormorant Garamond', serif; font-size:20px; font-style:italic; color:var(--ink-soft); max-width:700px;
}
html.lang-zh blockquote{ font-family:'Noto Serif TC', serif; font-style:normal; } /* Chinese script doesn't have a true italic form, so italics are turned off */
blockquote cite{ display:block; font-family:'Inter', sans-serif; font-style:normal; font-size:13px; color:var(--stone); margin-top:8px; } /* the small reference line, e.g. "1 Corinthians 3:6–7" */
html.lang-zh blockquote cite{ font-family:'Noto Sans TC', sans-serif; }

/* ============================================================================
   CONFESSION LIST — the list of confessional documents on the
   Statement of Faith page (about-faith.html). (No auto-numbering here —
   each belief is just a plain title row; the numbering CSS counter is used
   only inside the expanded panels, for the WCF chapters / Athanasian
   clauses — see ".clause-list" further down.)
   ============================================================================ */
.confession-list{ list-style:none; margin:24px 0 0; padding:0; max-width:740px; }

/* ============================================================================
   CONFESSION ACCORDION — expand/collapse panels under each confession/creed
   on the Statement of Faith page (about-faith.html). Each ".confession-item"
   is one row: a clickable ".confession-toggle" button (the title) plus a
   hidden ".confession-panel" underneath holding the full bilingual text.
   Clicking the button adds/removes the "open" class on the parent
   ".confession-item" (see script.js -> initConfessionAccordion()), and these
   CSS rules handle the actual show/hide animation + the "+" -> "×" rotation.
   ============================================================================ */
.confession-item{ border-top:1px solid var(--line); }
.confession-item:first-child{ border-top:none; }

.confession-toggle{
  width:100%; display:flex; align-items:baseline; gap:16px; padding:16px 0;
  background:none; border:none; margin:0; cursor:pointer; text-align:left; /* strip default <button> styling so it reads like plain text, not a button */
  font-family:'Cormorant Garamond', serif; font-size:17px; color:var(--ink-soft);
}
html.lang-zh .confession-toggle{ font-family:'Noto Serif TC', serif; }
.confession-title{ flex:1 1 auto; } /* takes up the remaining space so the chevron sits flush to the right */
.confession-chevron{                            /* the "+" on the right that rotates into a "×" when expanded */
  flex-shrink:0; width:20px; height:20px; position:relative; color:var(--brass);
}
.confession-chevron::before, .confession-chevron::after{
  content:""; position:absolute; top:50%; left:50%; background:var(--brass);
  transform:translate(-50%,-50%); transition:transform .25s ease;
}
.confession-chevron::before{ width:12px; height:2px; }   /* the horizontal stroke of the "+" */
.confession-chevron::after{ width:2px; height:12px; }    /* the vertical stroke of the "+" — rotates flat to form a "−" when open (together with the horizontal stroke above) */
.confession-item.open .confession-chevron::after{ transform:translate(-50%,-50%) rotate(90deg) scaleY(0); }

.confession-panel{ max-height:0; overflow:hidden; opacity:0; transition:max-height .45s ease, opacity .3s ease; } /* collapsed by default */
.confession-item.open .confession-panel{ max-height:6000px; opacity:1; transition:max-height .6s ease, opacity .4s ease .05s; } /* 6000px is just a generous cap, not the real height — see script.js comment for why */

.confession-panel-inner{ padding:2px 0 28px 0; color:var(--ink-soft); font-size:15px; line-height:1.75; max-width:700px; } /* no left indent now that the title row has no leading number */
.confession-panel-inner p{ margin:0 0 14px; }
.confession-panel-inner p:last-child{ margin-bottom:0; }
.confession-panel-inner .creed-text{ font-family:'Cormorant Garamond', serif; font-style:italic; font-size:16px; } /* the historic creed wording is set in the elegant serif italic, echoing the Bible-verse blockquote style elsewhere on the site */
html.lang-zh .confession-panel-inner .creed-text{ font-family:'Noto Serif TC', serif; font-style:normal; }

/* The 44-clause Athanasian Creed and 33-chapter Westminster table of contents
   are both naturally numbered lists, so they get their own compact two-column
   layout instead of the flowing creed-text paragraph style above. */
.confession-panel-inner .clause-list{ list-style:none; margin:0; padding:0; columns:2; column-gap:32px; font-size:14px; }
.confession-panel-inner .clause-list li{ padding:5px 0; break-inside:avoid; border-bottom:1px dashed var(--line); }
.confession-panel-inner .clause-list li span.num{ color:var(--brass); font-weight:700; font-size:12px; font-family:'Inter', sans-serif; margin-right:6px; }
@media (max-width:640px){ .confession-panel-inner .clause-list{ columns:1; } }

.confession-panel-inner .wcf-note{ font-size:13px; color:var(--stone); margin-top:18px; }
.confession-panel-inner .wcf-link{ display:inline-block; margin-top:10px; font-size:13px; color:var(--brass); font-weight:600; text-decoration:none; }
.confession-panel-inner .wcf-link:hover{ text-decoration:underline; }
.confession-panel-inner .wcf-link + .wcf-link{ margin-left:18px; }

/* ============================================================================
   ABOUT PAGE — TWO-COLUMN GRID & TIMELINE (currently .about-grid is unused
   in the HTML, but kept here in case a two-column About layout is added later)
   ============================================================================ */
.about-grid{ display:grid; grid-template-columns:1.1fr 0.9fr; gap:64px; align-items:start; }

/* The vertical dotted timeline of key church history dates (1897, 1993, 1999, 2018) */
.timeline{ list-style:none; margin:28px 0 0; padding:0; border-left:2px solid var(--line); } /* the vertical line running down the left side */
.timeline li{ position:relative; padding:0 0 26px 26px; } /* space for each entry, indented past the vertical line */
.timeline li::before{ /* the small gold dot marking each date on the line */
  content:""; position:absolute; left:-7px; top:4px; width:12px; height:12px;
  border-radius:50%; background:var(--brass); border:2px solid var(--parchment);
}
.timeline .yr{ font-family:'Cormorant Garamond', serif; font-weight:700; font-size:20px; color:var(--brass); display:block; } /* the big gold year, e.g. "1897" */
html.lang-zh .timeline .yr{ font-family:'Noto Serif TC', serif; }
.timeline .desc{ color:var(--stone); font-size:14px; } /* the description text next to each year */

/* The "This Sunday" info card on the homepage (Sunday Worship time + Address) */
.service-card{ background:#fff; border:1px solid var(--line); border-radius:4px; padding:32px; }
.service-card h3{ font-size:22px; margin-bottom:18px; }
.service-row{ display:flex; justify-content:space-between; gap:16px; padding:14px 0; border-top:1px solid var(--line); font-size:15px; } /* each row: label on the left, value on the right */
.service-row:first-of-type{ border-top:none; } /* no divider line above the very first row */
.service-row .name{ font-weight:500; }
.service-row .time{ color:var(--brass); font-weight:600; white-space:nowrap; text-align:right; }

@media (max-width: 560px){ .about-grid{ grid-template-columns:1fr; } } /* stack to one column on small phones */

/* ============================================================================
   CARD GRIDS — used for the homepage's 4 nav cards, About Us's 3 faith/leadership
   cards, and Cell Groups' 3 group cards
   ============================================================================ */
.cards{ display:grid; grid-template-columns:repeat(4, 1fr); gap:24px; } /* default: 4 equal-width columns */
.cards.cols-3{ grid-template-columns:repeat(3, 1fr); } /* override to 3 columns, e.g. for About Us / Cell Groups */
.cards.cols-2{ grid-template-columns:repeat(2, 1fr); } /* override to 2 columns (available if needed elsewhere) */
.card{
  background:#fff; border:1px solid var(--line); padding:28px 24px; border-radius:4px;
  transition:transform .2s ease, box-shadow .2s ease; /* smooth lift effect on hover */
}
.card.link-card{ text-decoration:none; display:block; color:var(--ink); } /* used when the whole card itself is a clickable <a> link */
.card:hover{ transform:translateY(-3px); box-shadow:0 10px 24px rgba(27,33,48,0.06); } /* lifts the card slightly and adds a soft shadow on hover */
.card .icon{ width:34px; height:34px; margin-bottom:18px; color:var(--brass); } /* the small line-drawing icon at the top of each card */
.card h3{ font-size:20px; margin-bottom:10px; }
.card p{ color:var(--stone); font-size:14px; margin:0; }
.card .arrow{ color:var(--brass); font-size:13px; font-weight:600; margin-top:14px; display:inline-block; } /* the "Read more →" text at the bottom of link cards */

/* Responsive breakpoints: shrink the grid columns as the screen gets narrower */
@media (max-width: 900px){ .cards{ grid-template-columns:repeat(2,1fr); } .cards.cols-3{ grid-template-columns:repeat(2,1fr);} } /* tablets: 2 columns */
@media (max-width: 560px){ .cards, .cards.cols-3, .cards.cols-2{ grid-template-columns:1fr; } } /* phones: 1 column, stacked */

/* ============================================================================
   PERSON PROFILE — used on the "Our Reverend" page
   ============================================================================ */
.profile{ display:grid; grid-template-columns:220px 1fr; gap:44px; align-items:start; } /* fixed-width photo column + flexible text column */
.profile-photo{
  width:220px; height:220px; border-radius:4px; background:var(--parchment-dim);
  border:1px solid var(--line); display:flex; align-items:center; justify-content:center;
  color:var(--stone); font-size:13px; text-align:center; padding:16px; /* currently shows "Photo coming soon" text; replace with a real <img> and this box will size to fit */
}
@media (max-width: 640px){ .profile{ grid-template-columns:1fr; } .profile-photo{ width:160px; height:160px; } } /* stack photo above text, and shrink the photo, on small screens */

/* Parish Council members table */
.council-table{ width:100%; border-collapse:collapse; margin-top:8px; max-width:740px; } /* border-collapse removes double borders between table cells */
.council-table th, .council-table td{ text-align:left; padding:12px 16px; border-bottom:1px solid var(--line); font-size:15px; }
.council-table th{ font-size:12px; text-transform:uppercase; letter-spacing:0.06em; color:var(--brass); font-weight:600; } /* header row: small gold uppercase labels */

/* ============================================================================
   EVENTS LIST — used on the Latest Events page
   ============================================================================ */
.events-list{ list-style:none; margin:0; padding:0; }
.event-row{ display:grid; grid-template-columns:96px 1fr auto; gap:24px; align-items:center; padding:22px 0; border-top:1px solid var(--line); } /* 3 columns: date badge | title+location | time */
.event-row:first-child{ border-top:none; } /* no divider line above the first event */
.event-date{ background:var(--ink); color:var(--parchment); text-align:center; padding:10px 6px; border-radius:3px; font-family:'Cormorant Garamond', serif; } /* the dark square date badge, e.g. "19 / JUL" */
html.lang-zh .event-date{ font-family:'Noto Serif TC', serif; }
.event-date .d{ display:block; font-size:24px; font-weight:700; line-height:1; } /* the big day-of-month number */
.event-date .m{ display:block; font-size:11px; letter-spacing:0.08em; text-transform:uppercase; margin-top:4px; } /* the small month abbreviation below it */
.event-title{ font-weight:600; font-size:16px; }
.event-sub{ color:var(--stone); font-size:14px; margin-top:4px; } /* the location line under the event title */
.event-time{ color:var(--brass); font-weight:600; font-size:14px; white-space:nowrap; }
/* On small screens, drop the "time" column onto its own row under the title, and shrink the date badge column */
@media (max-width:560px){ .event-row{ grid-template-columns:64px 1fr; } .event-time{ grid-column:2; } }

/* Optional 4th row inside an .event-row, used when an event has a poster image
   and/or a link (e.g. to an online photo gallery). "grid-column:1/-1" makes it
   stretch across all 3 columns of the event-row grid instead of squeezing into
   just the last column. Only appears on events where this div is actually added. */
.event-extra{ grid-column:1 / -1; margin-top:14px; display:flex; align-items:center; gap:16px; flex-wrap:wrap; }
.event-poster-thumb{ width:90px; height:auto; border-radius:4px; border:1px solid var(--line); display:block; } /* small clickable poster thumbnail — click opens the full-size image in a new tab */
.event-link{ font-size:13px; color:var(--brass); font-weight:600; text-decoration:none; } /* e.g. "View poster & photos →" */
.event-link:hover{ text-decoration:underline; }

/* ============================================================================
   CONTACT PAGE — details column + embedded map column
   ============================================================================ */
.contact-grid{ display:grid; grid-template-columns:0.9fr 1.1fr; gap:56px; } /* details column slightly narrower than the map column */
.contact-item{ margin-bottom:22px; }
.contact-item .label{ font-size:12px; letter-spacing:0.1em; text-transform:uppercase; color:var(--brass); font-weight:600; margin-bottom:6px; display:block; } /* e.g. "ADDRESS", "PHONE" */
.contact-item .value{ font-size:16px; }
.map-frame{ border:1px solid var(--line); border-radius:4px; overflow:hidden; height:100%; min-height:280px; } /* frames/clips the embedded Google Map with rounded corners */
.map-frame iframe{ width:100%; height:100%; min-height:280px; border:0; display:block; }
@media (max-width:800px){ .contact-grid{ grid-template-columns:1fr; } } /* stack details above the map on narrower screens */

/* ============================================================================
   MAGAZINE FLIPBOOK — the "Thanksgiving Magazine" page-viewer on index.html
   (see the "THANKSGIVING MAGAZINE" section in index.html, and the
   initMagazineFlipbook() function in script.js which drives it)
   ============================================================================ */

/* Row of tab buttons above the flipbook, e.g. "2024–25 Edition" / "2025 Edition" */
.magazine-tabs{ display:flex; gap:10px; margin-bottom:28px; flex-wrap:wrap; }
.magazine-tab{
  font-family:'Inter', sans-serif; font-size:13px; font-weight:600; letter-spacing:0.03em;
  padding:11px 20px; border:1px solid var(--line); background:#fff; color:var(--ink-soft);
  border-radius:2px; cursor:pointer; transition:background .2s ease, color .2s ease, border-color .2s ease;
}
html.lang-zh .magazine-tab{ font-family:'Noto Sans TC', sans-serif; }
.magazine-tab:hover, .magazine-tab:focus-visible{ border-color:var(--brass); color:var(--ink); }
.magazine-tab.active{ background:var(--ink); color:var(--parchment); border-color:var(--ink); } /* the currently-selected year */

/* The dark "reading room" stage that holds the page image + arrow buttons either side.
   Padding/gap use clamp() so the whole thing scales smoothly between phone and
   desktop widths instead of jumping at a fixed breakpoint. */
.flipbook{
  position:relative; display:flex; align-items:center; justify-content:center;
  gap:clamp(6px, 3vw, 22px);
  background:var(--ink); border-radius:6px;
  padding:clamp(18px, 5vw, 40px) clamp(8px, 3vw, 20px);
}
.flipbook:focus-visible{ outline:2px solid var(--brass); outline-offset:4px; } /* keyboard focus ring, since arrow keys navigate pages */

/* The page "card" itself — locked to real A4 proportions (the actual page
   size of the source PDFs) so pages never look stretched or squashed.
   The width formula caps itself against THREE limits at once: 84% of the
   viewport width, a sensible max of 380px on large screens, AND 68% of the
   viewport HEIGHT (converted to an equivalent width) — that last one is
   what keeps the flipbook from overflowing the screen on short/landscape
   phone or tablet views. perspective is what makes the rotateY() flip
   animation below look 3-dimensional rather than a flat squish. */
.flip-page-wrap{
  position:relative;
  width:min(84vw, 380px, calc(68vh * 0.7071));
  aspect-ratio:210 / 297; /* real A4 ratio, matching the source PDF pages */
  perspective:1800px; border-radius:3px; overflow:hidden; background:#fff;
  box-shadow:0 22px 50px rgba(0,0,0,0.4);
}
/* Both the incoming ("back") and current ("front") page images stack exactly
   on top of one another, filling the frame. object-fit:contain (not "cover")
   is deliberate — it guarantees the full page, including edges of text, is
   always visible and never cropped, letterboxing on white if needed. */
.flip-page{
  position:absolute; inset:0; width:100%; height:100%; object-fit:contain; background:#fff;
  display:block; backface-visibility:hidden; -webkit-backface-visibility:hidden;
  opacity:0; transition:opacity .25s ease; /* fades in once the image has actually loaded — see script.js */
}
.flip-page.is-loaded{ opacity:1; }
.flip-page-back{ z-index:1; }  /* sits underneath, already loaded with the destination page */
.flip-page-front{               /* sits on top; this is the one that animates when flipping */
  z-index:2; transform-origin:left center;
}
/* Added by script.js for the duration of a flip — rotates the front page
   like a turning sheet of paper, revealing the "back" image beneath.
   ".flip-anim" carries the transition so it's only present *during* a flip —
   see the JS comments for why that matters (it's the fix for a bug where
   resetting the page afterwards used to visibly animate back into place). */
.flip-page-front.flip-anim{ transition:transform .6s cubic-bezier(.45,.05,.55,.95), opacity .6s ease; }
.flip-page-front.flip-out-next{ transform:rotateY(-120deg); opacity:0; }
.flip-page-front.flip-out-prev{ transform-origin:right center; transform:rotateY(120deg); opacity:0; }

/* Invisible left/right tap zones layered directly over the page image, so on
   touch devices a visitor can simply tap the left/right side of the page
   itself to turn it — the small arrow buttons are a secondary option. */
.flip-tap-zone{
  position:absolute; top:0; bottom:0; width:50%; z-index:3;
  background:transparent; border:0; padding:0; cursor:pointer;
}
.flip-tap-zone.zone-prev{ left:0; }
.flip-tap-zone.zone-next{ right:0; }

/* Round prev/next arrow buttons either side of the page. clamp() keeps them
   usable-sized on phones without them ever crowding out the page itself. */
.flip-arrow{
  flex-shrink:0; width:clamp(30px, 8vw, 44px); height:clamp(30px, 8vw, 44px); border-radius:50%;
  border:1px solid rgba(247,243,234,0.3); background:rgba(247,243,234,0.08);
  color:var(--parchment); font-size:clamp(11px, 3vw, 15px); cursor:pointer;
  transition:background .2s ease, border-color .2s ease;
}
.flip-arrow:hover, .flip-arrow:focus-visible{ background:var(--brass); border-color:var(--brass); }
.flip-arrow:disabled{ opacity:0.35; cursor:default; } /* shown at the first/last page of a magazine */
.flip-arrow:disabled:hover{ background:rgba(247,243,234,0.08); border-color:rgba(247,243,234,0.3); }

/* Row below the flipbook: "Page X of Y" on the left, "Download PDF" link on the right */
.flip-footer{
  display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:10px;
  margin-top:18px; font-size:13px; color:var(--stone);
}
.flip-download{ color:var(--brass); font-weight:600; text-decoration:none; }
.flip-download:hover{ text-decoration:underline; }

/* ============================================================================
   FOOTER
   ============================================================================ */
footer{ background:var(--ink); color:var(--parchment-dim); padding:48px 0 28px; } /* dark footer, contrasting with the cream page background */
.footer-top{ display:flex; justify-content:space-between; flex-wrap:wrap; gap:24px; padding-bottom:28px; border-bottom:1px solid rgba(247,243,234,0.15); } /* logo on the left, links on the right, thin divider below */
footer .brand-line{ font-family:'Cormorant Garamond', serif; font-size:22px; color:#fff; text-decoration:none; }
html.lang-zh footer .brand-line{ font-family:'Noto Serif TC', serif; }
footer .foot-links{ display:flex; gap:22px; list-style:none; padding:0; margin:0; font-size:14px; flex-wrap:wrap; }
footer .foot-links a{ text-decoration:none; color:var(--parchment-dim); }
footer .foot-links a:hover{ color:var(--brass-light); }
.footer-bottom{ padding-top:20px; font-size:13px; color:#8B8E9A; display:flex; justify-content:space-between; flex-wrap:wrap; gap:8px; } /* copyright line + "Est. 1897", side by side */

/* ============================================================================
   SCROLL-REVEAL ANIMATION
   Elements with class="reveal" start hidden/shifted down, then script.js adds
   the "in" class once they scroll into view, which fades/slides them into place.
   ============================================================================ */
.reveal{ opacity:0; transform:translateY(14px); transition:opacity .6s ease, transform .6s ease; } /* starting (hidden) state */
.reveal.in{ opacity:1; transform:translateY(0); } /* final (visible) state, applied by script.js via IntersectionObserver */
