/* ==========================================================================
   Feather & Shell Press — stylesheet
   Tokens are declared once in :root and reused throughout. Update the
   palette or type scale there rather than hunting for individual values.
   ========================================================================== */

/* ==========================================================================
   Fonts — self-hosted (Playfair Display + DM Sans, matching the PDF brief)
   ========================================================================== */
@font-face {
  font-family: "Playfair Display";
  src: url("../fonts/playfair-display-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Playfair Display";
  src: url("../fonts/playfair-display-latin-500-normal.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Playfair Display";
  src: url("../fonts/playfair-display-latin-600-normal.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Playfair Display";
  src: url("../fonts/playfair-display-latin-700-normal.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Playfair Display";
  src: url("../fonts/playfair-display-latin-900-normal.woff2") format("woff2");
  font-weight: 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Playfair Display";
  src: url("../fonts/playfair-display-latin-400-italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Playfair Display";
  src: url("../fonts/playfair-display-latin-500-italic.woff2") format("woff2");
  font-weight: 500; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Playfair Display";
  src: url("../fonts/playfair-display-latin-600-italic.woff2") format("woff2");
  font-weight: 600; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url("../fonts/dm-sans-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url("../fonts/dm-sans-latin-500-normal.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url("../fonts/dm-sans-latin-700-normal.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url("../fonts/dm-sans-latin-400-italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}

:root {
  /* --- Colour --- */
  --paper:        #F5EFE0; /* base page background, warm eggshell */
  --paper-alt:     #EFE8D6; /* secondary section background */
  --paper-deep:    #E7DCC8; /* tertiary section background */
  --card:          #FFFDF8; /* card / surface background */
  --ink:           #3B2A20; /* primary text, deep umber */
  --ink-soft:      #6B5B48; /* secondary text */
  --moss:          #6B7A5E; /* lily-pad green, links & accents */
  --moss-dark:     #4F5C45; /* hover state for moss */
  --moss-pale:     #CBD3BC; /* sage card background, Kind Words section */
  --star:          #93805C; /* muted gold star rating */
  --berry:         #A13D2C; /* brick red, primary call-to-action */
  --berry-dark:    #832F21;
  --gold:          #C9A227; /* feather gold, hairlines & small accents */
  --line:          #DCD0B4; /* hairline rule colour */

  /* --- Type --- */
  --font-display: "Playfair Display", Georgia, serif;
  --font-body:    "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* --- Type scale ---
     All sizes are rem so they scale with the reader's browser font-size
     preference. 1rem = the user's base (16px by default).
     --text-body is the single value to change to resize all prose. */
  --text-xs:    0.8rem;    /* uppercase labels, footer, meta */
  --text-sm:    0.9rem;    /* secondary/caption text */
  --text-body:  1.0625rem; /* all prose — 17px at default settings */
  --text-lg:    1.15rem;   /* brand name, contact links */
  --text-xl:    1.3rem;    /* italic subtitles, star row */
  --text-h3:    1.2rem;    /* card headings */
  --text-h3-lg: 1.7rem;    /* book title */
  --text-h2:    clamp(1.7rem, 3.2vw, 2.3rem);  /* section headings */
  --text-h1:    clamp(2.3rem, 6vw, 3.6rem);    /* hero heading */

  /* --- Layout --- */
  --wrap: 1120px;
  --radius: 6px;
}

/* --- Reset --- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 100%; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overflow-x: hidden; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  /* Long words/URLs wrap instead of forcing their container wider */
  overflow-wrap: break-word;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--berry); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--berry-dark); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--ink); color: var(--paper); padding: 12px 18px;
  border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 3px solid var(--berry);
  outline-offset: 3px;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Type scale --- */
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; color: var(--ink); line-height: 1.15; margin: 0 0 0.5em; }

.section-title { font-size: var(--text-h2); }
.section-title--center { text-align: center; max-width: 34ch; margin-left: auto; margin-right: auto; }
.section-subtitle {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: var(--text-xl);
  color: var(--moss-dark);
  text-align: center;
  margin: 0 0 1.6em;
}

.lede {
  max-width: 62ch;
  margin: 0 auto 2.6rem;
  text-align: center;
  color: var(--ink-soft);
  font-size: var(--text-body);
}
.hand-note {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: var(--text-body);
  color: var(--ink);
  margin: 0 0 0.8em;
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: var(--text-sm);
  letter-spacing: 0.02em;
  padding: 0.9em 1.9em;
  border-radius: 999px;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--berry); color: var(--paper); }
.btn-primary:hover { background: var(--berry-dark); color: var(--paper); }
.btn-secondary { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn-secondary:hover { background: var(--ink); color: var(--paper); }

/* ==========================================================================
   Header / nav
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(245, 239, 224, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 14px; padding-bottom: 14px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark { flex-shrink: 0; }
.brand-name {
  font-family: var(--font-display); font-weight: 600; font-size: var(--text-lg);
  letter-spacing: 0.01em;
}

.site-nav { display: flex; gap: 28px; }
.site-nav a {
  color: var(--ink); text-decoration: none; font-weight: 500; font-size: var(--text-sm);
  padding-bottom: 3px; border-bottom: 2px solid transparent;
}
.site-nav a:hover { border-bottom-color: var(--gold); }

.nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 42px; height: 42px; background: transparent; border: 1px solid var(--line);
  border-radius: var(--radius); cursor: pointer;
}
.nav-toggle-bar { width: 20px; height: 2px; background: var(--ink); margin: 0 auto; }

@media (max-width: 800px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    flex-direction: column; gap: 0;
    max-height: 0; overflow: hidden; transition: max-height 0.25s ease;
  }
  .site-nav.is-open { max-height: 320px; }
  .site-nav a { padding: 14px 24px; border-bottom: 1px solid var(--line); }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  padding: 96px 0 120px;
  text-align: center;
  overflow: hidden;
}
.hero-inner { position: relative; z-index: 1; max-width: 780px; }
.hero-title {
  font-size: var(--text-h1);
  margin-bottom: 0.3em;
}
.hero-copy { max-width: 62ch; margin: 0 auto 1.1em; color: var(--ink-soft); font-size: var(--text-body); }
.hero .btn { margin-top: 1.4rem; }

/* torn-paper style fold at the base of the hero, a nod to the brand's
   hand-crafted, storybook-page feel */
.hero-fold {
  position: absolute; left: 0; right: 0; bottom: -1px; height: 46px;
  background: var(--paper-alt);
  clip-path: polygon(
    0% 100%, 0% 40%, 4% 55%, 8% 35%, 12% 58%, 16% 38%, 20% 60%, 24% 40%,
    28% 55%, 32% 35%, 36% 58%, 40% 38%, 44% 60%, 48% 40%, 52% 55%, 56% 35%,
    60% 58%, 64% 38%, 68% 60%, 72% 40%, 76% 55%, 80% 35%, 84% 58%, 88% 38%,
    92% 60%, 96% 40%, 100% 55%, 100% 100%
  );
}

/* ==========================================================================
   Story behind
   ========================================================================== */
.story { background: var(--paper-alt); padding: 88px 0; }
.story-inner {
  display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 56px; align-items: start;
}
.story-photo img {
  border-radius: var(--radius);
  box-shadow: 0 18px 34px -18px rgba(59, 42, 32, 0.35);
}
.story-copy p { margin: 0 0 1em; font-size: var(--text-body); }
.signoff { font-style: italic; color: var(--ink-soft); }

@media (max-width: 760px) {
  .story-inner { grid-template-columns: 1fr; }
  .story-photo { max-width: 260px; }
}

/* ==========================================================================
   Our books
   ========================================================================== */
.books { padding: 96px 0; }

.book-loading { text-align: center; color: var(--ink-soft); font-style: italic; }

.book-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas:
    "image   content"
    "available content"
    "actions actions";
  gap: 48px;
  align-items: start;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 44px;
  margin: 0 auto 40px;
}
.book-card:last-child { margin-bottom: 0; }
.book-card img { border-radius: var(--radius); }

.book-image { grid-area: image; min-width: 0; }
.book-available { grid-area: available; margin-top: 1.6em; min-width: 0; }

.book-content { grid-area: content; min-width: 0; }
.book-card h3 { font-size: var(--text-h3-lg); margin-bottom: 0.5em; }
.book-card p.book-description { color: var(--ink-soft); margin-bottom: 1.3em; font-size: var(--text-body); }

.book-meta { margin: 0 0 1.1em; }
.book-meta-label {
  font-weight: 700; font-size: var(--text-xs); text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--moss-dark); display: block; margin-bottom: 0.5em;
}
.book-meta ul { list-style: none; margin: 0 0 1.6em; padding: 0; }
.book-meta li {
  position: relative; padding-left: 26px; margin-bottom: 0.45em; color: var(--ink);
  font-size: var(--text-body);
}
.book-meta li::before {
  content: ""; position: absolute; left: 0; top: 0.28em; width: 15px; height: 15px;
  background-color: var(--moss);
  -webkit-mask: url("../images/icon-feather.svg") center / contain no-repeat;
  mask: url("../images/icon-feather.svg") center / contain no-repeat;
}

.book-actions {
  grid-area: actions;
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: nowrap;
  margin-top: 8px;
}
.book-actions .btn { flex: 0 1 auto; text-align: center; padding-left: 1.1em; padding-right: 1.1em; white-space: nowrap; }

@media (max-width: 760px) {
  .book-card {
    grid-template-columns: 1fr;
    grid-template-areas:
      "image"
      "content"
      "available"
      "actions";
    padding: 28px;
    gap: 24px;
  }
  .book-available { margin-top: 0; }
}

@media (max-width: 380px) {
  .book-actions { gap: 8px; }
  .book-actions .btn { font-size: var(--text-xs); padding-left: 0.8em; padding-right: 0.8em; }
}

/* ==========================================================================
   What we offer
   ========================================================================== */
.offer { background: var(--paper-alt); padding: 96px 0; }
.offer-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; margin-top: 3rem;
}
.offer-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden;
  min-width: 0;
}
/* Offer photos are cropped to a consistent 4:3 landscape box, taken from
   the centre of the image. Supply artwork already cropped to 4:3 (e.g.
   1200x900) to control exactly what is shown. */
.offer-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.offer-card h3 { font-size: var(--text-h3); margin: 1.2em 1.3em 0.4em; }
.offer-card p { margin: 0 1.3em 1.4em; color: var(--ink-soft); font-size: var(--text-body); }

@media (max-width: 860px) {
  .offer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
  .offer-grid { grid-template-columns: 1fr; }
}

/* Landscape phones/tablets: keep 3 across regardless of width, as per the brief's photo layout */
@media (orientation: landscape) and (max-height: 540px) {
  .offer-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
}

/* Standalone pages (Our Books, individual book) sit below a sticky
   header, so they need a little less top padding than the home page. */
.books--page { padding-top: 56px; }

.breadcrumb {
  font-size: var(--text-sm);
  color: var(--ink-soft);
  margin-bottom: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.breadcrumb a { color: var(--ink-soft); }
.breadcrumb a:hover { color: var(--berry); }
.breadcrumb span[aria-current] { color: var(--ink); font-weight: 500; }

/* Book titles link through to their own page */
.book-title-link { color: inherit; text-decoration: none; }
.book-title-link:hover { color: var(--berry); text-decoration: underline; }

.books-more { text-align: center; margin-top: 2.6rem; }

.book-more-books { margin-top: 4rem; }
.book-links {
  list-style: none; padding: 0;
  margin: 0 auto; max-width: 480px;
  display: flex; flex-direction: column; gap: 12px;
}
.book-links li { text-align: center; }
.book-links a {
  display: block;
  padding: 14px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: var(--font-display);
  font-size: var(--text-h3);
  text-decoration: none;
  color: var(--ink);
}
.book-links a:hover { border-color: var(--gold); color: var(--berry); }

/* 404 page */
.notfound-mark { margin: 0 auto 1.4rem; opacity: 0.85; }

/* ==========================================================================
   Where to find us (events)
   ========================================================================== */
.events { padding: 96px 0; }

.event-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 2.4rem;
}

/* A single event shouldn't look stranded in a wide row, so it is
   centred and given a comfortable reading width instead. */
.event-list--single {
  grid-template-columns: minmax(0, 560px);
  justify-content: center;
}

.event-card {
  display: flex;
  gap: 22px;
  align-items: flex-start;
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 26px;
}

/* Calendar-style date block */
.event-date {
  flex-shrink: 0;
  width: 68px;
  text-align: center;
  background: var(--paper-alt);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 6px;
}
.event-day {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.9rem;
  line-height: 1;
  color: var(--ink);
}
.event-month {
  display: block;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--berry);
  margin-top: 3px;
}

.event-body { min-width: 0; }
.event-card h3 { font-size: var(--text-h3); margin-bottom: 0.35em; }
.event-when   { margin: 0 0 0.2em; font-size: var(--text-body); font-weight: 500; }
.event-time   { color: var(--ink-soft); font-weight: 400; }
.event-time::before { content: " · "; }
.event-where  { margin: 0 0 0.6em; font-size: var(--text-sm); color: var(--ink-soft); }
.event-description { margin: 0 0 0.8em; font-size: var(--text-body); color: var(--ink-soft); }
.event-link { font-size: var(--text-sm); font-weight: 700; }

@media (max-width: 480px) {
  .event-card { padding: 20px; gap: 16px; }
  .event-date { width: 58px; }
  .event-day  { font-size: 1.6rem; }
}

/* ==========================================================================
   Kind words
   ========================================================================== */
.words { padding: 96px 0; }
.review-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; margin-top: 2.4rem;
}
.review-card {
  position: relative;
  margin: 0;
  min-width: 0;
  background: var(--moss-pale);
  border: none;
  border-radius: 18px;
  padding: 30px 26px;
  box-shadow: none;
  text-align: center;
  display: flex;
  flex-direction: column;
}
.review-stars {
  display: block;
  text-align: left;
  color: var(--star);
  font-size: var(--text-xl);
  letter-spacing: 0.12em;
  margin-bottom: 0.9em;
}
.review-card blockquote { margin: 0 0 auto; padding-bottom: 1.6em; }
.review-card p { margin: 0; font-size: var(--text-body); }
.review-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 1.4em;
}
.review-card figcaption { display: flex; flex-direction: column; text-align: left; }
.review-name { font-family: var(--font-body); font-weight: 700; font-size: var(--text-body); color: var(--ink); }
.review-source { font-size: var(--text-sm); color: var(--ink-soft); }
.review-watermark {
  width: 84px;
  height: auto;
  flex-shrink: 0;
  opacity: 0.75;
}

@media (max-width: 860px) {
  .review-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
  .review-grid { grid-template-columns: 1fr; }
}

/* Landscape phones/tablets: keep 3 across regardless of width.
   Text is scaled by narrowing the tokens for these cards, so the
   proportions of the scale are preserved rather than re-specified. */
@media (orientation: landscape) and (max-height: 540px) {
  .wrap { padding: 0 6px; }

  .review-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .review-card {
    padding: 16px 12px;
    border-radius: 12px;
    --text-body: 0.82rem;
    --text-sm: 0.76rem;
    --text-xl: 1rem;
  }
  .review-card blockquote { padding-bottom: 0.7em; }
  .review-card p { line-height: 1.4; }
  .review-stars { margin-bottom: 0.5em; }
  .review-footer { margin-top: 0.8em; }
  .review-watermark { width: 56px; }
}

/* ==========================================================================
   Contact
   ========================================================================== */
.contact { background: var(--paper-deep); padding: 96px 0; }
.contact-inner { text-align: center; }
.contact-list {
  list-style: none; margin: 2.4rem auto 0; padding: 0;
  display: grid; grid-template-columns: auto 1fr;
  column-gap: 18px; row-gap: 1.3rem;
  justify-content: center; align-items: center;
  width: fit-content; max-width: 100%;
}
.contact-list li { display: contents; }
.contact-icon { color: var(--gold); flex-shrink: 0; }
.contact-text { display: flex; flex-direction: column; text-align: left; min-width: 0; }
.contact-label {
  font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--gold); font-weight: 700; margin-bottom: 0.3em;
}
.contact-list a { font-size: var(--text-lg); font-weight: 500; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { padding: 40px 0; }
.footer-inner {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  color: var(--ink-soft); font-size: var(--text-sm); text-align: center;
}
