/*
Theme Name: Cosy Cocoon
Theme URI: https://thecosycocoon.co.uk
Description: A calm, fast block theme for The Cosy Cocoon — baby massage and gentle parent-and-baby classes in Medway. Child of Twenty Twenty-Five.
Author: Graham Hoffman
Version: 1.8.2
Requires at least: 6.7
Tested up to: 7.0
Requires PHP: 8.0
Template: twentytwentyfive
Text Domain: cosycocoon
*/

/* Design tokens live in theme.json. Only genuine exceptions belong here. */

/* Fraunces carries a soft/wonk personality — nudge headings warmer. */
h1, h2, h3, .cc-display {
  font-variation-settings: "SOFT" 30, "WONK" 1;
  letter-spacing: -0.015em;
}

/* Cocoon curve: the soft arch motif used on hero and feature imagery. */
.cc-arch img {
  border-radius: 50vw 50vw 1.5rem 1.5rem;
}

/* Hero portrait crop. The source photography is landscape, so we crop to a
   tall frame and bias the focal point right, where the parent and baby sit. */
/* figure.x img beats core's .wp-block-image img on specificity, which would
   otherwise tie and win on source order. */
figure.cc-hero-img img {
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 50% center;
  width: 100%;
  height: auto;
}
@media (max-width: 781px) {
  figure.cc-hero-img img { aspect-ratio: 3 / 2; object-position: 60% center; }
}

/* Cards lift very gently on hover — calm, not bouncy. */
.cc-card {
  transition: transform .35s ease, box-shadow .35s ease;
}
.cc-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px -24px rgba(47, 59, 34, .42);
}

/* Details/accordion — remove the default marker, add our own. */
.cc-accordion summary { list-style: none; cursor: pointer; }
.cc-accordion summary::-webkit-details-marker { display: none; }
.cc-accordion summary::after {
  content: "+";
  float: right;
  font-family: var(--wp--preset--font-family--body);
  transition: transform .25s ease;
}
.cc-accordion[open] summary::after { content: "–"; }

/* Eyebrow label above section headings. */
.cc-eyebrow {
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: .78rem;
  font-weight: 700;
}

/* Sticky mobile call-to-action bar. */
@media (max-width: 781px) {
  .cc-sticky-cta {
    position: fixed; inset: auto 0 0 0; z-index: 99;
    box-shadow: 0 -6px 24px -12px rgba(47,59,34,.45);
  }
  body { padding-bottom: 4.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .cc-card, .cc-accordion summary::after { transition: none; }
}

/* Session rhythm list: the ordered run of a class, numbered in sage. */
ol.cc-rhythm {
  list-style: none;
  counter-reset: cc-step;
  padding-left: 0;
  margin: 0;
}
ol.cc-rhythm li {
  counter-increment: cc-step;
  position: relative;
  padding: .55rem 0 .55rem 3.25rem;
  border-bottom: 1px solid var(--wp--preset--color--base-sand);
}
ol.cc-rhythm li:last-child { border-bottom: 0; }
ol.cc-rhythm li::before {
  content: counter(cc-step);
  position: absolute;
  left: 0;
  top: .55rem;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 50%;
  background: var(--wp--preset--color--primary);
  color: #fff;
  font-family: var(--wp--preset--font-family--body);
  font-weight: 700;
  font-size: .92rem;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* The logo is a circular mark; keep it tidy in the header. */
.wp-block-site-logo img { border-radius: 50%; }
@media (max-width: 781px) {
  .wp-block-site-logo img { max-width: 68px; }
}

/* ---------------------------------------------------------------
   FluentBooking: repaint the booking widget in the brand palette.
   The plugin exposes its own custom properties, so we only need to
   redefine those rather than fight its stylesheet selector by selector.
   --------------------------------------------------------------- */
.fcal_cal_wrap.fcal-light-mode {
  --fcal_primary_color: #4F7A38;
  --fcal_dark: #2F3B22;
  --fcal_gray: #5C6B4A;
  --fcal_body_bg: #FBF9F0;
  --fcal_cal_bg: #FFFFFF;
  --fcal_slot_border: #E2DAC6;
  --fcal_thBG: #F1EBDA;
  --fcal_enable_day_bg: #E3EDD8;
  --fcal_date_disabled_color: #A9A392;
  --fcal_date_radius: 8px;
  --fcal_avatar_radius: 50%;
  --fcal_input_bg: #FFFFFF;
}

/* Match the site's typography inside the widget. */
.fcal_cal_wrap {
  font-family: var(--wp--preset--font-family--body);
  border-radius: 1.25rem;
  overflow: hidden;
  border: 1px solid var(--wp--preset--color--base-sand);
  box-shadow: var(--wp--preset--shadow--soft);
}
.fcal_cal_wrap h1, .fcal_cal_wrap h2,
.fcal_cal_wrap h3, .fcal_cal_wrap .fcal_event_title {
  font-family: var(--wp--preset--font-family--heading);
  font-weight: 500;
}

/* Buttons inside the widget pick up the site's pill shape. */
.fcal_cal_wrap button,
.fcal_cal_wrap .fcal_btn,
.fcal_cal_wrap .el-button {
  border-radius: 999px;
}

/* The embed sits on cream, so let the card itself carry the white. */
.cc-booking-embed { max-width: 100%; }

/* Everyone booking is in the UK and the calendar runs on Europe/London, so the
   timezone picker is noise that invites people to change something they should
   not. Hidden rather than removed: the plugin still needs the value internally. */
.fcal_timezone_select { display: none !important; }
/* ...and the timezone line in the event summary, for the same reason. */
.fcal_slot_info .slot_timezone { display: none !important; }

/* Blog grid: cards in a row should match height regardless of title length. */
.wp-block-post-template.is-layout-grid > li { display: flex; }
.wp-block-post-template.is-layout-grid > li > .wp-block-group {
  width: 100%;
  display: flex;
  flex-direction: column;
}

/* Post body: a comfortable reading measure and a little more air. */
.single .wp-block-post-content p,
.single .wp-block-post-content ul,
.single .wp-block-post-content ol { line-height: 1.75; }
.single .wp-block-post-content h2 { margin-top: 2.4em; }
.single .wp-block-post-content h3 { margin-top: 1.8em; }

/* Course dates as a list (cosy_block_dates shortcode, cosycocoon-blocks mu-plugin) */
.cosy-block-dates__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}
.cosy-block-dates__item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 1rem 1.5rem;
  padding: 1rem 1.25rem;
  background: #fff;
  border: 1px solid var(--wp--preset--color--base-sand, #F1EBDA);
  border-radius: 1rem;
}
.cosy-block-dates__when strong { display: block; font-size: 1.1rem; }
.cosy-block-dates__when span { display: block; color: var(--wp--preset--color--primary, #4F7A38); font-weight: 600; font-size: 0.95rem; }
.cosy-block-dates__when small,
.cosy-block-dates__price small,
.cosy-block-dates__action small { display: block; color: var(--wp--preset--color--contrast-soft, #5C6B4A); font-size: 0.85rem; }
.cosy-block-dates__price { text-align: right; }
.cosy-block-dates__price s { display: block; opacity: 0.6; font-size: 0.9rem; }
.cosy-block-dates__price strong { font-size: 1.25rem; }
.cosy-block-dates__action { text-align: center; }
.cosy-block-dates__action .wp-element-button { margin-top: 0.35rem; white-space: nowrap; cursor: pointer; }
.cosy-block-dates__sessions {
  margin: 0.5rem 0 0;
  padding-left: 1.4em;
  columns: 2 14rem;
  column-gap: 1.5rem;
  color: var(--wp--preset--color--contrast-soft, #5C6B4A);
  font-size: 0.95rem;
}
.cosy-block-dates__sessions li { break-inside: avoid; margin: 0.1rem 0; }
.cosy-block-dates__item.is-full { opacity: 0.6; }
.cosy-block-dates__full { font-weight: 600; }
@media (max-width: 640px) {
  .cosy-block-dates__item { grid-template-columns: 1fr auto; }
  .cosy-block-dates__action { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; text-align: left; }
}

/* ---------------------------------------------------------------
   Book page: a card per class time, with its booking widget folded
   away until Book is pressed ([cosy_book], cosycocoon-blocks mu-plugin).
   --------------------------------------------------------------- */
.cosy-book {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  /* "dense" lets the second card sit beside the first even though the first
     card's drawer comes between them in the markup. */
  grid-auto-flow: row dense;
  gap: 1.25rem;
}
@media (min-width: 720px) {
  .cosy-book { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.cosy-card {
  display: flex;
  flex-direction: column;
  background: var(--wp--preset--color--white);
  border: 1px solid var(--wp--preset--color--base-sand);
  border-radius: 1.25rem;
  padding: 1.5rem 1.5rem 1.35rem;
  box-shadow: var(--wp--preset--shadow--soft);
  transition: border-color .25s ease, box-shadow .25s ease;
}
.cosy-card.is-chosen {
  border-color: var(--wp--preset--color--primary);
  box-shadow: 0 0 0 3px var(--wp--preset--color--primary-soft), var(--wp--preset--shadow--soft);
}
.cosy-card > * { margin: 0; }
.cosy-card__eyebrow {
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .74rem;
  font-weight: 700;
  color: var(--wp--preset--color--primary);
}
.cosy-card__time {
  margin-top: .45rem;
  font-size: var(--wp--preset--font-size--x-large);
  line-height: 1.1;
}
.cosy-card__who { margin-top: .4rem; font-weight: 600; }
.cosy-card__dates {
  list-style: none;
  padding: 0;
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}
.cosy-card__dates li {
  background: var(--wp--preset--color--primary-soft);
  border-radius: 999px;
  padding: .2rem .7rem;
  font-size: .85rem;
  font-weight: 600;
}
.cosy-card__venue {
  margin-top: 1rem;
  padding-left: 1.35rem;
  font-size: .95rem;
  color: var(--wp--preset--color--contrast-soft);
  background: no-repeat 0 .2em / .95rem url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235C6B4A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21s-7-6.2-7-11.5a7 7 0 0 1 14 0C19 14.8 12 21 12 21z'/%3E%3Ccircle cx='12' cy='9.5' r='2.5'/%3E%3C/svg%3E");
}
.cosy-card__foot {
  margin-top: auto;
  padding-top: 1.25rem;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: .15rem 1rem;
}
.cosy-card__foot > * { margin: 0; }
.cosy-card__price {
  grid-column: 1;
  font-family: var(--wp--preset--font-family--heading);
  font-size: 1.6rem;
  line-height: 1.2;
}
.cosy-card__price s { font-size: 1rem; opacity: .55; }
.cosy-card__price small {
  display: inline-block;
  vertical-align: middle;
  margin-left: .2rem;
  padding: .1rem .55rem;
  border-radius: 999px;
  background: var(--wp--preset--color--sage-soft);
  color: var(--wp--preset--color--sage);
  font-family: var(--wp--preset--font-family--body);
  font-size: .75rem;
  font-weight: 700;
}
.cosy-card__places { grid-column: 1; font-size: .9rem; color: var(--wp--preset--color--contrast-soft); }
.cosy-card__places.is-low { color: var(--wp--preset--color--sage); font-weight: 700; }
.cosy-card__book, .cosy-card__full { grid-column: 2; grid-row: 1 / span 2; white-space: nowrap; cursor: pointer; }
.cosy-card__full { font-weight: 600; font-size: .9rem; white-space: normal; text-align: right; }
.cosy-card.is-full .cosy-card__time, .cosy-card.is-full .cosy-card__price { opacity: .55; }
/* On a narrow card (phones) the button goes full width under the price. */
.cosy-card { container-type: inline-size; }
@container (max-width: 400px) {
  .cosy-card__foot { grid-template-columns: 1fr; }
  .cosy-card__book, .cosy-card__full { grid-column: 1; grid-row: auto; width: 100%; margin-top: .85rem; text-align: center; }
}
.cosy-book__empty { color: var(--wp--preset--color--contrast-soft); }

/* Folded away, the widget keeps its full width (it sizes its layout from its
   width when it loads), so it is moved out of the grid rather than hidden. */
.cosy-drawer { grid-column: 1 / -1; position: relative; }
.cosy-drawer:not(.is-open) {
  position: absolute;
  inset: 0 0 auto 0;
  height: 0;
  overflow: hidden;
  visibility: hidden;
}
.cosy-drawer.is-open { animation: cosy-drawer-in .35s ease; }
@keyframes cosy-drawer-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.cosy-drawer__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: .25rem 0 .75rem;
}
.cosy-drawer__title { margin: 0; font-weight: 700; }
.cosy-drawer__close {
  flex: none;
  padding: .35rem .95rem;
  border: 1px solid var(--wp--preset--color--base-sand);
  border-radius: 999px;
  background: var(--wp--preset--color--white);
  color: var(--wp--preset--color--contrast);
  font: inherit;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
}
.cosy-drawer__close::after { content: " \00D7"; }
.cosy-drawer__close:hover { border-color: var(--wp--preset--color--primary); }
/* The card above already says who and what, so the widget can skip it. */
.cosy-drawer .fcal_author,
.cosy-drawer .fcal_slot_description { display: none; }

/* Christmas: what the session includes, Jess's own list. */
ul.cc-festive-list {
  list-style: none;
  padding: 0;
  margin: 0;
  columns: 2 18rem;
  column-gap: 2.5rem;
}
ul.cc-festive-list li {
  break-inside: avoid;
  padding: .55rem 0 .55rem 2.1rem;
  position: relative;
  line-height: 1.5;
}
ul.cc-festive-list li span[aria-hidden] { position: absolute; left: 0; top: .5rem; font-size: 1.2rem; }

@media (prefers-reduced-motion: reduce) {
  .cosy-card, .cosy-drawer.is-open { transition: none; animation: none; }
}
