/* Poetry By Heart: Poetry & resources page blocks
   Load after pbh.css (tokens, buttons, header, menu, footer, chat, breadcrumb and page title).
   Sections are headed "BLOCK: <name>", matching the BLOCK markers in the HTML.
   Breakpoints as pbh.css: tablet ≤1099px (designed at 810), mobile ≤699px (designed at 390). */

body.page-resources { background: #fff; }

/* ==== BLOCK: feature-carousel ==== */
.fc { position: relative; padding: 24px; background: #fff; }
.fc-view { max-width: 1352px; margin-inline: auto; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.fc-view::-webkit-scrollbar { display: none; }
.fc-view:focus { outline: none; }
.fc-track { list-style: none; margin: 0; padding: 0; display: flex; }
.fc-slide { flex: 0 0 100%; min-width: 0; scroll-snap-align: start; scroll-snap-stop: always; display: grid; grid-template-columns: minmax(460px, 580fr) 710fr; align-items: center; column-gap: 14px; padding: 24px; background: var(--lilac-500); }
/* CMS surface colour tokens (PBH Surface Colour) → .fc-slide--{token} */
.fc-slide--lilac { background: var(--lilac-500); }
.fc-slide--yellow { background: var(--yellow-500); }
.fc-slide--green { background: var(--green-300); }
.fc-slide--coffee { background: var(--coffee-200); }
.fc-slide--orange { background: var(--orange-400); }
.fc-slide--white { background: #fff; }
.fc-text { display: flex; flex-direction: column; align-items: flex-start; gap: 24px; padding: 24px; min-width: 0; }
.fc-label { font-weight: 800; font-size: 30px; line-height: 38px; letter-spacing: -0.02em; color: #fff; }
.fc-title { display: flex; flex-direction: column; gap: 12px; }
.fc-title h2 { font-weight: 700; font-size: 46px; line-height: 53px; letter-spacing: -0.02em; text-transform: uppercase; text-wrap: balance; }
.fc-poet { font-weight: 800; font-size: 22px; line-height: 29px; letter-spacing: -0.02em; }
.fc-quote { font-size: 18px; line-height: 27px; color: #000; }
.fc-img { width: 100%; height: 485px; object-fit: cover; border-radius: 20px; }
/* arrows sit on the left and right edges of the slides */
.fc-arrow { position: absolute; top: 50%; z-index: 2; width: 36px; height: 36px; margin-top: -18px; display: grid; place-items: center; padding: 0; border-radius: 50%; border: 1.5px solid #fff; background: var(--ink); color: #fff; cursor: pointer; transition: background-color .15s, opacity .15s; }
.fc-arrow svg { width: 24px; height: 24px; fill: currentColor; }
.fc-arrow:hover { background: var(--lilac-900); }
.fc-arrow[aria-disabled="true"] { visibility: hidden; } /* no arrow at either end */
.fc-prev { left: max(1px, calc(50% - 699px)); }
.fc-next { right: max(12px, calc(50% - 688px)); }
.fc-dots { position: absolute; left: 50%; bottom: 42px; transform: translateX(-50%); display: flex; gap: 6px; z-index: 2; }
.fc-dots button { width: 24px; height: 24px; padding: 6px; border: 0; background: none; cursor: pointer; }
.fc-dots button::before { content: ""; display: block; width: 12px; height: 12px; box-sizing: border-box; border-radius: 50%; background: #fff; border: 2px solid #fff; }
.fc-dots button[aria-current="true"]::before { background: var(--ink); }
.fc[data-count="1"] .fc-arrow, .fc[data-count="1"] .fc-dots, .fc:not([data-count]) .fc-dots { display: none; }

/* ==== BLOCK: card-section ==== (the pale yellow panel holds every card section on the page; its frame is white whatever the page background) */
.cs-panel { border: 24px solid #fff; border-top: 0; padding: 60px 112px; background: var(--yellow-50); background-clip: padding-box; display: flex; flex-direction: column; gap: 64px; }
.cs { width: 100%; max-width: 1128px; margin-inline: auto; display: flex; flex-direction: column; gap: 48px; }
.cs-band { padding: 16px 12px; background: var(--yellow-500); text-align: center; font-weight: 800; font-size: 22px; line-height: 29px; letter-spacing: -0.02em; }
/* CMS surface colour tokens → .cs-band--{token} */
.cs-band--lilac { background: var(--lilac-500); }
.cs-band--yellow { background: var(--yellow-500); }
.cs-band--green { background: var(--green-300); }
.cs-band--coffee { background: var(--coffee-200); }
.cs-band--orange { background: var(--orange-400); }
.cs-band--white { background: #fff; }
.cs-intro { max-width: 738px; font-size: 16px; line-height: 24px; }
.cs-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 64px 40px; }
.cs-card { position: relative; display: flex; flex-direction: column; min-width: 0; }
.cs-img { aspect-ratio: 1; max-width: 100%; overflow: hidden; border-radius: 20px; }
.cs-img > img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s cubic-bezier(.2,.7,.2,1); }
.cs-card h3 { margin: 16px 0 0; font-weight: 800; font-size: 22px; line-height: 29px; letter-spacing: -0.02em; }
.cs-card h3 a { text-decoration: none; }
.cs-card h3 a::after { content: ""; position: absolute; inset: 0; z-index: 1; } /* whole card is the link */
.cs-card p { margin-top: 4px; font-size: 16px; line-height: 24px; }
.cs-card:hover .cs-img > img { transform: scale(1.07); }
.cs-card:hover h3 { color: var(--orange-700); }
.cs-card:has(a:focus-visible) { outline: 3px solid var(--focus); outline-offset: 4px; border-radius: 20px; }
.cs-card a:focus-visible { outline: none; }
[data-input="pointer"] .cs-card:has(a:focus-visible) { outline: none; }

/* Lucky dip (from the Figma prototype): on hover the button grows and the arrow turns 150°; pressing darkens it */
.cs-card--lucky .cs-img { display: grid; place-items: center; background: rgba(14, 5, 66, .05); }
.lucky { width: 97%; display: block; }
.lucky svg { display: block; width: 100%; height: auto; overflow: visible; }
.ld-all, .ld-arrow { transform-box: fill-box; transform-origin: center; transition: transform .4s cubic-bezier(.65,0,.35,1); }
.cs-card--lucky:hover .ld-all { transform: scale(1.134); }
.cs-card--lucky:hover .ld-arrow { transform: rotate(360deg); transition-duration: .1s, .8s; } /* one full turn; leaving the card turns it back */
.cs-card--lucky:active .ld-all { transform: scale(.96); transition-duration: .1s; }
/* pressed: the button darkens (not the glow or the lettering), as the Figma pressed state's 30% black overlay */
.ld-all > g > * { transition: filter .1s, transform .4s cubic-bezier(.65,0,.35,1); }
.cs-card--lucky:active .ld-all > g > :not(:first-child):not(:nth-child(9)) { filter: brightness(.7); }
@media (prefers-reduced-motion: reduce) { .cs-img > img, .ld-all, .ld-arrow { transition: none; } .cs-card:hover .cs-img > img { transform: none; } }

/* ================= Tablet (810 design) ================= */
@media (max-width: 1099px) {
  .fc { padding: 16px; }
  .fc-slide { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: stretch; padding: 16px; }
  .fc-text { justify-content: center; }
  .fc-label { font-size: 26px; line-height: 33px; }
  .fc-title h2 { font-size: 36px; line-height: 45px; }
  .fc-poet { font-size: 20px; line-height: 26px; }
  .fc-quote { font-size: 16px; line-height: 24px; }
  .fc-img { height: 100%; min-height: 327px; border-radius: 18px; }
  .fc-prev { left: 7px; }
  .fc-next { right: 7px; }
  .fc-dots { bottom: 28px; }

  .cs-panel { border-width: 0 16px 16px; padding: 32px; }
  .cs { max-width: 800px; }
  .cs-band { padding: 17px 12px; font-size: 20px; line-height: 26px; }
  .cs-intro { font-size: 14px; line-height: 21px; }
  .cs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px 32px; }
  .cs-img, .cs-card:has(a:focus-visible) { border-radius: 18px; }
  .cs-card h3 { font-size: 20px; line-height: 26px; }
  .cs-card p { font-size: 14px; line-height: 21px; }
}

/* ================= Mobile (390 design) ================= */
@media (max-width: 699px) {
  .fc-slide { grid-template-columns: minmax(0, 1fr); align-items: start; align-content: start; /* spare height (slides match the tallest) goes below the text, not between picture and text */ row-gap: 14px; padding: 16px; }
  .fc-img { order: -1; height: auto; min-height: 0; aspect-ratio: 326 / 248; border-radius: 16px; }
  .fc-label { font-size: 22px; line-height: 28px; }
  .fc-title h2 { font-size: 30px; line-height: 38px; }
  .fc-poet { font-size: 18px; line-height: 26px; }
  .fc-arrow { display: none; }  /* swipe on phones */
  .fc-dots { bottom: 30px; }

  .cs-panel { padding: 24px 16px; }
  .cs-grid { gap: 32px 16px; }
  .cs-img, .cs-card:has(a:focus-visible) { border-radius: 16px; }
  .cs-card h3 { overflow-wrap: anywhere; }
}
