/*
Theme Name: Quinne & Co Press
Theme URI: https://quinneandcopress.com
Author: Quinne & Co Press
Author URI: https://quinneandcopress.com
Description: Warm, kid-friendly woodland theme for the Quinne & Co Press author website (Murphy and the Magic Wild). A faithful WordPress port of the hand-built site — every page is editable in the dashboard, with Books and Events managed as their own items and brand colors adjustable in the Customizer.
Version: 2.0.0
Requires at least: 6.1
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: quinne-and-co
*/

/* ============================================================
   QUINNE & CO PRESS — styles
   Theme: warm, kid-friendly woodland (forest greens, sunshine
   amber, cream paper). Headings use "Baloo 2", body "Nunito".
   ============================================================ */

:root {
  --forest: #2d6a4f;
  --forest-dark: #1b4332;
  --leaf: #74c69d;
  --leaf-light: #d8f3dc;
  --cream: #fff8ec;
  --paper: #ffffff;
  --sun: #ffb703;
  --sun-dark: #f4a259;
  --berry: #e76f51;
  --sky: #8ecae6;
  --bark: #6b4f3a;
  --ink: #2f3e34;
  --ink-soft: #5c6f63;
  --radius: 18px;
  --shadow: 0 6px 24px rgba(45, 106, 79, 0.12);
  --shadow-lift: 0 14px 34px rgba(45, 106, 79, 0.18);
  --font-display: "Baloo 2", "Comic Sans MS", cursive;
  --font-body: "Nunito", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--cream);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--forest-dark);
  line-height: 1.15;
  margin: 0 0 0.4em;
}

h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.3rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; }

a { color: var(--forest); }

img { max-width: 100%; display: block; }

.container {
  width: min(1100px, 92%);
  margin: 0 auto;
}

section { padding: 56px 0; }

/* anchored sections (e.g. visits.html#school-programs) clear the sticky header */
section[id] { scroll-margin-top: 84px; }

.section-intro {
  max-width: 640px;
  margin: 0 auto 36px;
  text-align: center;
}

.section-intro p { color: var(--ink-soft); }

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 600;
  text-decoration: none;
  padding: 12px 26px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover { transform: translateY(-2px) scale(1.02); box-shadow: var(--shadow); }

.btn-primary { background: var(--sun); color: var(--forest-dark); }
.btn-secondary { background: var(--paper); color: var(--forest); border: 3px solid var(--forest); }
.btn-amazon { background: var(--sun); color: var(--forest-dark); font-size: 0.95rem; padding: 10px 20px; }
.btn-kindle { background: var(--paper); color: var(--forest-dark); border: 2px solid var(--sky); font-size: 0.95rem; padding: 10px 20px; }
.btn-signed { background: var(--leaf-light); color: var(--forest-dark); border: 2px solid var(--leaf); font-size: 0.95rem; padding: 10px 20px; }

.shopify-slot { width: 100%; }

/* ---------- header / nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  box-shadow: 0 2px 14px rgba(45, 106, 79, 0.1);
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-mark {
  width: 44px;
  height: 44px;
  flex: none;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.05; }

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--forest-dark);
}

.brand-tag {
  font-size: 0.72rem;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 999px;
  transition: background 0.15s ease;
}

.nav-links a:hover { background: var(--leaf-light); }
.nav-links a.active { background: var(--forest); color: #fff; }

/* dropdown submenu (Author Visits) */
.nav-links .has-dropdown { position: relative; }

.nav-links .has-dropdown > a::after { content: " ▾"; font-size: 0.75em; }

.nav-links .dropdown {
  list-style: none;
  margin: 0;
  padding: 8px;
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--paper);
  border-radius: 14px;
  box-shadow: var(--shadow);
  min-width: 215px;
  z-index: 60;
}

.nav-links .has-dropdown:hover .dropdown,
.nav-links .has-dropdown:focus-within .dropdown { display: block; }

.nav-links .dropdown a {
  display: block;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 0.95rem;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.7rem;
  color: var(--forest-dark);
  cursor: pointer;
  padding: 8px 12px;
  min-width: 44px;
  min-height: 44px;
}

@media (max-width: 840px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--paper);
    padding: 10px 16px 18px;
    box-shadow: 0 12px 20px rgba(45, 106, 79, 0.15);
  }
  .nav-links.open { display: flex; }
  .nav-links a { display: block; text-align: center; padding: 12px; }
  /* on mobile the submenu shows inline under its parent */
  .nav-links .dropdown {
    display: block;
    position: static;
    box-shadow: none;
    background: transparent;
    padding: 0 0 6px;
    min-width: 0;
  }
  .nav-links .dropdown a { font-size: 0.9rem; padding: 9px; opacity: 0.85; }
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  background: linear-gradient(180deg, #bfe5d2 0%, var(--leaf-light) 60%, var(--cream) 100%);
  padding: 70px 0 0;
  overflow: hidden;
  text-align: center;
}

.hero .container { position: relative; z-index: 2; max-width: 760px; }

.hero h1 { color: var(--forest-dark); }

.hero .hero-sub {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 560px;
  margin: 0 auto 28px;
}

.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 30px; }

.hero-art { display: block; width: 100%; margin-top: -20px; }

.hero-trio {
  display: block;
  width: min(400px, 68vw);
  margin: 6px auto -42px;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 10px 18px rgba(27, 67, 50, 0.3));
}

.hero-badge {
  display: inline-block;
  background: var(--paper);
  color: var(--berry);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 18px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}

/* small page-top hero used on inner pages */
.page-hero {
  background: linear-gradient(180deg, #bfe5d2 0%, var(--cream) 100%);
  text-align: center;
  padding: 48px 0 34px;
}

/* first section after a page hero sits closer to the intro */
.page-hero + section { padding-top: 34px; }

.page-hero p { color: var(--ink-soft); max-width: 620px; margin: 0 auto; }

/* ---------- book cards ---------- */

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 28px;
}

.book-card {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease;
}

.book-card:hover { transform: translateY(-5px); }

.cover {
  position: relative;
  aspect-ratio: 1 / 1;
  background: linear-gradient(170deg, var(--leaf-light) 0%, #fffdf6 100%);
}

.cover img { width: 100%; height: 100%; object-fit: contain; }

.cover .cover-placeholder { display: none; }

.cover.cover-fallback .cover-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 100%;
  padding: 20px;
  text-align: center;
  background:
    radial-gradient(circle at 20% 25%, rgba(255, 183, 3, 0.35) 0 60px, transparent 61px),
    radial-gradient(circle at 85% 75%, rgba(116, 198, 157, 0.5) 0 80px, transparent 81px),
    linear-gradient(160deg, var(--leaf) 0%, var(--forest) 100%);
}

.cover-paw { font-size: 2.2rem; }

.cover-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: #fff;
  text-shadow: 0 2px 6px rgba(27, 67, 50, 0.45);
}

.book-info { padding: 20px 22px 24px; display: flex; flex-direction: column; flex: 1; }

.book-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }

.tag {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 4px 12px;
  border-radius: 999px;
}

.tag-age { background: var(--sun); color: var(--forest-dark); }
.tag-format { background: var(--leaf-light); color: var(--forest-dark); }

.book-subtitle { color: var(--berry); font-weight: 700; font-size: 0.92rem; margin-bottom: 8px; }

.book-desc { color: var(--ink-soft); font-size: 0.95rem; flex: 1; }

.buy-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

/* ---------- events ---------- */

.event-list { display: flex; flex-direction: column; gap: 20px; max-width: 760px; margin: 0 auto; }

.event-card {
  display: flex;
  gap: 20px;
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  align-items: flex-start;
}

.event-date {
  flex: none;
  width: 86px;
  background: var(--forest);
  color: #fff;
  border-radius: 14px;
  text-align: center;
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.event-month {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.85rem;
  color: var(--sun);
}

.event-day { font-family: var(--font-display); font-weight: 700; font-size: 2rem; }

.event-weekday { font-size: 0.78rem; opacity: 0.85; }

.event-body h3 { margin-bottom: 4px; }

.event-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--ink-soft);
  font-size: 0.93rem;
  margin-bottom: 6px;
}

.event-details { font-size: 0.95rem; color: var(--ink-soft); margin-bottom: 4px; }

.event-map { font-weight: 700; font-size: 0.92rem; }

.events-empty, .next-event-empty {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 34px;
  text-align: center;
  color: var(--ink-soft);
}

@media (max-width: 540px) {
  .event-card { flex-direction: column; }
  .event-date { flex-direction: row; gap: 8px; width: auto; align-items: baseline; padding: 8px 14px; }
  .event-day { font-size: 1.4rem; }
}

/* ---------- feature bands & cards ---------- */

.band-green { background: var(--leaf-light); }
.band-paper { background: var(--paper); }

.next-event-band .event-card { max-width: 760px; margin: 0 auto; }

.center { text-align: center; }

.mt-24 { margin-top: 24px; }

.character-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 24px;
}

.character-card {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 24px;
  text-align: center;
}

.character-emoji { font-size: 3rem; line-height: 1; display: block; margin-bottom: 12px; }

.character-art {
  height: 180px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  margin: 0 auto 14px;
}

.badge-art {
  width: 110px;
  margin: 0 auto 12px;
}

.character-card h3 { margin-bottom: 6px; }

.character-card p { color: var(--ink-soft); font-size: 0.95rem; margin: 0; }

/* about teaser split */

.split {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 40px;
  align-items: center;
}

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

.portrait-frame {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
}

.portrait-frame .portrait {
  border-radius: 12px;
  aspect-ratio: 4 / 5;
  background:
    radial-gradient(circle at 75% 20%, rgba(255, 183, 3, 0.4) 0 70px, transparent 71px),
    linear-gradient(170deg, var(--sky) 0%, var(--leaf) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  color: var(--forest-dark);
  font-family: var(--font-display);
  font-weight: 700;
  text-align: center;
  padding: 16px;
}

.portrait span:first-child { font-size: 3.4rem; }

.portrait-photo {
  width: 100%;
  border-radius: 12px;
}

/* ---------- visit program cards ---------- */

.program-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
}

.program-card {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 24px;
  border-top: 6px solid var(--sun);
}

.program-card:nth-child(2n) { border-top-color: var(--leaf); }
.program-card:nth-child(3n) { border-top-color: var(--sky); }

.program-card .program-emoji { font-size: 2.2rem; display: block; margin-bottom: 10px; }

.program-card p { color: var(--ink-soft); font-size: 0.95rem; margin: 0; }

/* ---------- forms ---------- */

.form-card {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 34px;
  max-width: 680px;
  margin: 0 auto;
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

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

.form-field { display: flex; flex-direction: column; gap: 6px; }

.form-field.full { grid-column: 1 / -1; }

.form-field label { font-weight: 700; font-size: 0.92rem; color: var(--forest-dark); }

.form-field input,
.form-field select,
.form-field textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 11px 14px;
  border: 2px solid var(--leaf-light);
  border-radius: 12px;
  background: var(--cream);
  color: var(--ink);
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--leaf);
}

.form-card .btn { margin-top: 20px; }

/* ---------- contact info ---------- */

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin-bottom: 44px;
}

.contact-card {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
  text-align: center;
}

.contact-card .contact-emoji { font-size: 2rem; display: block; margin-bottom: 8px; }

.contact-card a { font-weight: 700; word-break: break-word; }

/* ---------- newsletter ---------- */

.newsletter {
  background: var(--forest);
  color: #fff;
  text-align: center;
}

.newsletter h2 { color: #fff; }

.newsletter p { color: var(--leaf-light); max-width: 520px; margin: 0 auto 22px; }

.newsletter-form {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.newsletter-form input {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 12px 18px;
  border-radius: 999px;
  border: none;
  width: min(340px, 80vw);
}

/* ---------- "What's New" cards ---------- */

.whats-new { padding: 40px 0; }

.whats-new-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.new-card {
  background: var(--paper);
  border-left: 6px solid var(--sun);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 18px 22px;
}

.new-card:nth-child(2n) { border-left-color: var(--leaf); }
.new-card:nth-child(3n) { border-left-color: var(--sky); }

.new-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--berry);
  margin-bottom: 6px;
}

.new-card h3 { font-size: 1.1rem; margin-bottom: 4px; }

.new-card p { color: var(--ink-soft); font-size: 0.92rem; margin-bottom: 8px; }

.new-link { font-weight: 700; font-size: 0.92rem; text-decoration: none; }

/* ---------- brand shelves (home page) ---------- */

.shelf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 28px;
}

.shelf-card {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
}

.shelf-cover {
  aspect-ratio: 5 / 4;
  background: linear-gradient(170deg, var(--leaf-light) 0%, #fffdf6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.shelf-cover img { max-width: 100%; max-height: 100%; object-fit: contain; }

.shelf-info {
  padding: 20px 22px 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.shelf-info h3 { margin-bottom: 6px; }

.shelf-info p { color: var(--ink-soft); font-size: 0.95rem; flex: 1; margin-bottom: 10px; }

.shelf-link {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--forest);
}

.shelf-card:hover .shelf-link { color: var(--forest-dark); text-decoration: underline; }

/* ---------- FAQ ---------- */

.faq-list { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }

.faq-item {
  background: var(--paper);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 4px 22px;
}

.faq-item summary {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.08rem;
  color: var(--forest-dark);
  cursor: pointer;
  padding: 16px 0;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.faq-item summary::-webkit-details-marker { display: none; }

/* custom on-brand chevron, rotates when the item opens */
.faq-item summary::after {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  margin-right: 6px;
  border-right: 3px solid var(--sun-dark);
  border-bottom: 3px solid var(--sun-dark);
  border-radius: 1px;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.faq-item[open] > summary::after { transform: rotate(225deg); }

.faq-item summary:hover { color: var(--forest); }

.faq-item p { color: var(--ink-soft); padding-bottom: 18px; margin: 0; }

/* ---------- Murphy's World ---------- */

.world-art {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.character-portrait {
  width: min(260px, 60vw);
  margin: 0 auto;
  display: block;
  filter: drop-shadow(0 8px 14px rgba(27, 67, 50, 0.25));
}

/* ---------- mini game ---------- */

.game-frame {
  max-width: 860px;
  margin: 0 auto;
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
}

#game-canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  touch-action: none;
  cursor: pointer;
}

.game-controls {
  display: none;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
}

.game-controls-left { display: flex; gap: 10px; }

.game-btn {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--forest-dark);
  background: var(--leaf-light);
  border: 3px solid var(--leaf);
  border-radius: 999px;
  padding: 12px 22px;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.game-btn:active { background: var(--leaf); }

.game-btn-jump { background: var(--sun); border-color: var(--sun-dark); }

/* show touch buttons on touch devices (media query + .show JS backup) */
@media (pointer: coarse) {
  .game-controls { display: flex; }
}

.game-controls.show { display: flex; }

.game-hint { color: var(--ink-soft); margin-top: 16px; font-size: 0.95rem; }

/* ---------- footer ---------- */

.site-footer {
  background: var(--forest-dark);
  color: var(--leaf-light);
  padding: 40px 0 26px;
  font-size: 0.93rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.8fr 0.9fr 1.2fr;
  gap: 30px;
  margin-bottom: 26px;
}

@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }

/* Trail Notes signup in the footer */
.footer-news p { font-size: 0.9rem; margin-bottom: 12px; }

.footer-news input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 11px 16px;
  border-radius: 999px;
  border: none;
  margin-bottom: 10px;
  box-sizing: border-box;
}

.footer-news .btn { font-size: 0.92rem; padding: 10px 22px; }

.site-footer h4 { color: #fff; margin-bottom: 10px; }

.site-footer ul { list-style: none; margin: 0; padding: 0; }

.site-footer li { margin-bottom: 6px; }

.site-footer a { color: var(--leaf-light); text-decoration: none; }

.site-footer a:hover { color: var(--sun); }

.social-row { display: flex; gap: 14px; margin-top: 10px; }

.social-row a { font-size: 1.4rem; }

.footer-bottom {
  border-top: 1px solid rgba(216, 243, 220, 0.25);
  padding-top: 18px;
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.85;
}

/* ============================================================
   PREMIUM POLISH — unified rhythm, cards, and mobile tuning
   (kept last so it wins the cascade at equal specificity)
   ============================================================ */

h1, h2, h3, h4 { letter-spacing: 0.2px; }

h1 { line-height: 1.1; }
h2 { line-height: 1.15; }
h3 { font-size: 1.28rem; }

.section-intro { margin-bottom: 40px; }
.section-intro p { font-size: 1.02rem; }

/* one consistent lift for every card type */
.book-card, .shelf-card, .new-card, .program-card,
.character-card, .contact-card, .event-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.book-card:hover, .shelf-card:hover, .new-card:hover,
.program-card:hover, .character-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
}

.btn { line-height: 1.25; }

/* small screens: tighter, better-balanced spacing */
@media (max-width: 560px) {
  section { padding: 44px 0; }
  .page-hero { padding: 40px 0 28px; }
  .page-hero + section { padding-top: 28px; }
  .section-intro { margin-bottom: 28px; }
  .hero { padding-top: 54px; }
  .hero-trio { width: min(320px, 78vw); }
  .whats-new { padding: 34px 0; }
  .form-card { padding: 26px 20px; }
}

/* ============================================================
   WORDPRESS BRIDGE
   Everything ABOVE this line is the original Quinne & Co design,
   copied unchanged. The rules below map WordPress's block editor
   and menu output onto those same design classes, so pages built
   with blocks look identical to the hand-built site.
   ============================================================ */

/* ---------- page wrapper: kill default block margins so the
   full-width bands stack flush like the original <main> ---------- */
.qc-page-main > * { margin-top: 0; margin-bottom: 0; }

/* section spacing as a class (block "Group" renders a <div>, so the
   original `section { padding }` rule can't reach it) */
.qc-section { padding: 56px 0; }
.page-hero + .qc-section { padding-top: 34px; }
@media (max-width: 560px) {
  .qc-section { padding: 44px 0; }
  .page-hero + .qc-section { padding-top: 28px; }
}

/* Group blocks we tag `.container` behave like the old .container */
.wp-block-group.container { width: min(1100px, 92%); margin-left: auto; margin-right: auto; }

/* our grids are plain CSS grid — drop the block layout's child margins */
.book-grid.wp-block-group > *,
.character-grid.wp-block-group > *,
.program-grid.wp-block-group > *,
.shelf-grid.wp-block-group > *,
.contact-grid.wp-block-group > *,
.whats-new-grid.wp-block-group > * { margin: 0; }

/* images placed via blocks / media library.
   The design's image classes (.character-art etc.) were written for an
   <img>, but the block editor puts them on the wrapping <figure>, so we
   re-target the inner <img> here. */
.wp-block-image { margin: 0; }
.wp-block-image img { display: block; }

.wp-block-image.hero-trio { width: min(400px, 68vw); margin: 6px auto -42px; position: relative; z-index: 2; }
.wp-block-image.hero-trio img { width: 100%; height: auto; filter: drop-shadow(0 10px 18px rgba(27, 67, 50, 0.3)); }

.wp-block-image.character-art { margin: 0 auto 14px; }
.wp-block-image.character-art img { height: 180px; width: auto; max-width: 100%; object-fit: contain; margin: 0 auto; }

.wp-block-image.character-portrait { width: min(260px, 60vw); margin: 0 auto; }
.wp-block-image.character-portrait img { width: 100%; filter: drop-shadow(0 8px 14px rgba(27, 67, 50, 0.25)); }

.wp-block-image.world-art { margin: 0; }
.wp-block-image.world-art img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); }

.wp-block-image.badge-art { width: 110px; margin: 0 auto 12px; }
.wp-block-image.badge-art img { width: 100%; }

.wp-block-image.portrait-photo img { width: 100%; border-radius: 12px; }

/* images inside the shelf "cover" frames */
.shelf-cover .wp-block-image { height: 100%; display: flex; align-items: center; justify-content: center; }
.shelf-cover .wp-block-image img { max-width: 100%; max-height: 100%; width: auto; object-fit: contain; }

/* ---------- buttons: make core Button blocks look like .btn ----------
   A custom CSS class on a Button block lands on the .wp-block-button
   wrapper, so we target the inner link from there. */
.wp-block-button__link {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  padding: 12px 26px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.wp-block-button__link:hover { transform: translateY(-2px) scale(1.02); box-shadow: var(--shadow); }
/* default + explicit primary = amber; secondary = outlined */
.wp-block-button .wp-block-button__link,
.wp-block-button.btn-primary .wp-block-button__link { background: var(--sun); color: var(--forest-dark); }
.wp-block-button.btn-secondary .wp-block-button__link {
  background: var(--paper); color: var(--forest); border: 3px solid var(--forest);
}
.wp-block-buttons.hero-cta { justify-content: center; margin-bottom: 30px; gap: 14px; }
.wp-block-buttons { gap: 12px; }

/* ---------- navigation: map wp_nav_menu output onto the old nav ---------- */
.nav-links li { margin: 0; }
.nav-links .menu-item-has-children { position: relative; }
.nav-links .menu-item-has-children > a::after { content: " \25BE"; font-size: 0.75em; }
.nav-links .sub-menu {
  list-style: none; margin: 0; padding: 8px; display: none;
  position: absolute; top: 100%; left: 0;
  background: var(--paper); border-radius: 14px; box-shadow: var(--shadow);
  min-width: 215px; z-index: 60;
}
.nav-links .menu-item-has-children:hover .sub-menu,
.nav-links .menu-item-has-children:focus-within .sub-menu { display: block; }
.nav-links .sub-menu a { display: block; border-radius: 10px; padding: 9px 12px; font-size: 0.95rem; }
.nav-links .current-menu-item > a,
.nav-links .current_page_item > a,
.nav-links .current-menu-ancestor > a { background: var(--forest); color: #fff; }

@media (max-width: 840px) {
  .nav-links .sub-menu {
    display: block; position: static; box-shadow: none;
    background: transparent; padding: 0 0 6px; min-width: 0;
  }
  .nav-links .sub-menu a { font-size: 0.9rem; padding: 9px; opacity: 0.85; }
}

/* ---------- admin bar offset for the sticky header ---------- */
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }

/* ---------- editor niceties: constrain the editing canvas a touch ---------- */
.editor-styles-wrapper { background: var(--cream); }

/* ============================================================
   WordPress visual-editor enhancements (v2.0)
   ============================================================ */

/* Make core block spacing work consistently on the front end. */
.entry-content > * + *,
.qc-page-main > .wp-block-group > * + * { margin-block-start: var(--wp--style--block-gap, 1.5rem); }
.wp-block-group { box-sizing: border-box; }

/* User-selectable block styles, available from the block Styles panel. */
.wp-block-group.is-style-qcp-card {
  background: var(--paper);
  border: 1px solid rgba(45, 106, 79, 0.10);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.wp-block-group.is-style-qcp-soft-section {
  background: color-mix(in srgb, var(--leaf-light) 42%, var(--cream));
  border-radius: var(--radius);
}
.wp-block-image.is-style-qcp-rounded img { border-radius: var(--radius); box-shadow: var(--shadow); }
.wp-block-button.is-style-qcp-outline .wp-block-button__link {
  background: transparent;
  color: var(--forest);
  border: 3px solid var(--forest);
}

/* WordPress-created submenu markup. Keep only the top-level current page green.
   Anchor links within the same page no longer all appear selected. */
.nav-links > .current-menu-item > a,
.nav-links > .current_page_item > a,
.nav-links > .current-menu-ancestor > a,
.nav-links > .current_page_ancestor > a {
  background: var(--nav-active-bg, var(--forest));
  color: var(--nav-active-text, #fff);
}
.nav-links .sub-menu .current-menu-item > a,
.nav-links .sub-menu .current_page_item > a,
.nav-links .sub-menu .current-menu-ancestor > a {
  background: transparent;
  color: var(--nav-dropdown-text, var(--ink));
}
.nav-links .sub-menu {
  background: var(--nav-dropdown-bg, var(--paper));
  border-radius: var(--nav-dropdown-radius, 14px);
}
.nav-links .sub-menu a { color: var(--nav-dropdown-text, var(--ink)); }
.nav-links .sub-menu a:hover,
.nav-links .sub-menu a:focus {
  background: var(--nav-dropdown-hover-bg, var(--leaf-light));
  color: var(--nav-dropdown-hover-text, var(--forest-dark));
}

.footer-widget-area { margin-top: 32px; }
.footer-widget-area .wp-block-group { max-width: none; }
