/* Recipes — tabs, cards and the recipe dialog.

   The palette is the logo's own, sampled out of kidzy-logo-color.webp rather
   than guessed: amber #FEAB02, green #65AB2E, teal #01999E, red #F72929.
   Each meal takes one of them, so a card is identifiable before its title is
   read, and the colour follows the recipe into the dialog. */

/* Defaults first, category colours after: both are one class deep, so
   whichever is declared last wins. Stated the other way round, the dialog
   kept falling back to lagoon however it was labelled. */
.rc-section, .rc-modal {
  --rc: var(--lagoon);
  --rc-ink: var(--lagoon-ink);
  --rc-wash: var(--lagoon-wash);
}

/* There is no hero above it any more, so the section keeps the headroom that
   clears the floating header. */

.rc-breakfast { --rc: #FEAB02; --rc-ink: #8A5A00; --rc-wash: #FFF4DF; }
.rc-lunch     { --rc: #65AB2E; --rc-ink: #41701B; --rc-wash: #EFF7E5; }
.rc-dinner    { --rc: #01999E; --rc-ink: #046F73; --rc-wash: #E0F5F6; }
.rc-snacks    { --rc: #F5821F; --rc-ink: #A85009; --rc-wash: #FEF0E3; }
/* Purple rather than the logo's red: red on a food card reads as a warning or
   a sale sticker, which is the wrong note for a treat. */
.rc-treats    { --rc: #8B5CD6; --rc-ink: #5B3495; --rc-wash: #F1EAFB; }

/* "All" and the workouts both sit on the house lagoon. */
.rc-all        { --rc: var(--lagoon); --rc-ink: var(--lagoon-ink); --rc-wash: var(--lagoon-wash); }
.rc-work       { --rc: #01999E; --rc-ink: #046F73; --rc-wash: #E0F5F6; }

/* --- Category tabs ------------------------------------------------------ */

/* One line, always. On a phone the row becomes a swipeable rail rather than
   wrapping onto a second and third line. */
.rc-tabs {
  display: flex; flex-wrap: nowrap; justify-content: center; gap: 10px;
  margin-bottom: 42px;
}
.rc-tab { flex: none; white-space: nowrap; }

.rc-tab {
  display: inline-flex; align-items: center; gap: .55em;
  font-family: var(--font-body); font-weight: 600; font-size: .96rem;
  padding: .7em 1.35em;
  border: 0; border-radius: 999px; cursor: pointer;
  background: var(--surface); color: var(--ink);
  box-shadow: 0 1px 0 rgba(255,255,255,.9) inset, 0 0 0 1px rgba(16,50,61,.06), var(--sh-1);
  transition: transform .2s cubic-bezier(.22,.7,.3,1), box-shadow .2s ease,
              background-color .2s ease, color .2s ease;
}

/* The dot carries the category colour even when the tab is not selected, so
   all five stay distinguishable at a glance. */
.rc-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--rc);
  transition: background-color .2s ease, transform .2s ease;
}

/* The coloured glow keeps its strength; only how far it spreads is halved, so
   the light stays as warm without washing across the page. */
.rc-tab:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(16,50,61,.10), 0 8px 16px -7px var(--rc);
}

.rc-tab.is-active {
  color: #fff;
  background-color: var(--rc);
  background-image: linear-gradient(135deg,
    color-mix(in srgb, var(--rc) 82%, #fff) 0%,
    var(--rc) 55%,
    color-mix(in srgb, var(--rc) 78%, #000) 100%);
  box-shadow: 0 1px 2px rgba(16,50,61,.14), 0 7px 15px -6px var(--rc);
}
.rc-tab.is-active .rc-dot { background: rgba(255,255,255,.9); transform: scale(1.1); }

/* --- Cards -------------------------------------------------------------- */

.rc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.rc-grid[hidden] { display: none; }

.rc-card { display: flex; }

.rc-open {
  flex: 1;
  display: flex; flex-direction: column; align-items: stretch;
  width: 100%; padding: 0;
  text-align: left; cursor: pointer;
  border: 0; border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--sh-1);
  font-family: var(--font-body);
  transition: transform .3s cubic-bezier(.22,.7,.3,1), box-shadow .3s ease;
}
.rc-open:hover {
  transform: translateY(-5px);
  box-shadow: 0 2px 6px rgba(16,50,61,.08), 0 13px 23px -10px var(--rc);
}

.rc-thumb {
  position: relative; display: block;
  aspect-ratio: 16 / 10; overflow: hidden;
  background: var(--rc-wash);
}
.rc-thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .5s cubic-bezier(.22,.7,.3,1);
}
.rc-open:hover .rc-thumb img { transform: scale(1.05); }

/* A wash of the category colour over the photo ties the two together. */
.rc-thumb::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, transparent 45%,
    color-mix(in srgb, var(--rc) 55%, transparent) 100%);
}

.rc-badge {
  position: absolute; left: 14px; top: 14px; z-index: 1;
  padding: .36em .85em;
  border-radius: 999px;
  background: rgba(255,255,255,.92);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  color: var(--rc-ink);
  font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}

.rc-body { display: flex; flex-direction: column; gap: 9px; padding: 22px 24px 24px; flex: 1; }

.rc-name {
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.12rem; line-height: 1.28; letter-spacing: -.02em;
  color: var(--ink);
}

.rc-time {
  display: inline-flex; align-items: center; gap: .45em;
  color: var(--rc-ink); font-size: .86rem; font-weight: 500;
}
.rc-clock { width: 15px; height: 15px; flex: none; }

.rc-cue {
  margin-top: auto; padding-top: 12px;
  color: var(--rc-ink); font-weight: 600; font-size: .9rem;
  display: inline-flex; align-items: center; gap: .4em;
}
.rc-cue::after {
  content: ""; width: 15px; height: 15px;
  background: currentColor;
  -webkit-mask: var(--arrow) center / contain no-repeat;
          mask: var(--arrow) center / contain no-repeat;
  transition: transform .2s ease;
}
.rc-open:hover .rc-cue::after { transform: translateX(4px); }

/* --- The dialog --------------------------------------------------------- */

.rc-modal {
  width: min(620px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0; border: 0; overflow: hidden;
  border-radius: var(--r-lg);
  background: var(--surface); color: var(--ink);
  box-shadow: var(--sh-3);
}
.rc-modal::backdrop {
  background: rgba(16,50,61,.55);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}

.rc-modal-inner { max-height: calc(100vh - 48px); overflow-y: auto; }

/* Picture space at the top of the dialog. The photo is a stand-in until each
   recipe has one of its own. */
.rc-hero-img { position: relative; aspect-ratio: 16 / 7; background: var(--rc-wash); }
.rc-hero-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rc-hero-img::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 40%,
    color-mix(in srgb, var(--rc) 60%, transparent) 100%);
}

.rc-modal-text { padding: clamp(24px, 3.5vw, 36px); }

.rc-close {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  width: 40px; height: 40px; display: grid; place-items: center;
  border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(255,255,255,.92);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  color: var(--ink); font-size: 1.5rem; line-height: 1;
  box-shadow: var(--sh-1);
  transition: transform .2s ease, background-color .2s ease;
}
.rc-close:hover { transform: scale(1.06); background: #fff; }

#rc-modal-cat { display: inline-flex; align-items: center; gap: .5em; color: var(--rc-ink); }
#rc-modal-cat::before { content: ""; width: 26px; height: 2px; border-radius: 2px; background: var(--rc); }

.rc-modal h3 {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.4rem, 3vw, 1.9rem); line-height: 1.2; letter-spacing: -.02em;
  margin: 10px 0 16px;
}
.rc-modal h4 {
  font-family: var(--font-display); font-size: .78rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: var(--rc-ink);
  margin: 26px 0 10px;
}

.rc-meta {
  display: inline-flex; align-items: center; gap: .5em;
  margin: 0; padding: .55em 1em;
  border-radius: 999px;
  background: var(--rc-wash); color: var(--rc-ink);
  font-size: .92rem;
}
.rc-meta strong { color: var(--rc-ink); }
.rc-meta .rc-clock { width: 16px; height: 16px; }

.rc-modal ul, .rc-modal ol { margin: 0; padding-left: 1.3em; color: var(--ink-2); line-height: 1.7; }
.rc-modal li { margin-bottom: .5em; }
.rc-modal li::marker { color: var(--rc); font-weight: 700; }
.rc-modal li strong { color: var(--ink); }

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

/* --- Search and filters -------------------------------------------------- */

.rc-controls {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  margin-bottom: 28px;
}

.rc-search {
  position: relative;
  display: flex; align-items: center;
  width: min(520px, 100%);
}
.rc-search-icon {
  position: absolute; left: 20px;
  width: 19px; height: 19px;
  color: var(--lagoon-ink); pointer-events: none;
}
.rc-search input {
  width: 100%;
  font-family: var(--font-body); font-size: 1rem; color: var(--ink);
  padding: 1.05em 3em 1.05em 3.35em;
  border: 0; border-radius: 999px;

  /* A tint of the lagoon rather than plain white: on the pale ground - and
     especially on a phone - a white field on a near-white page reads as
     nothing at all. */
  background: var(--lagoon-wash);
  box-shadow: 0 0 0 1px rgba(15,175,192,.30), var(--sh-1);
  transition: box-shadow .2s ease, background-color .2s ease;
}
.rc-search input::placeholder { color: #4E7A82; }
.rc-search input:focus {
  outline: none;
  background: var(--surface);
  box-shadow: 0 0 0 2px var(--lagoon), 0 0 0 5px rgba(15,175,192,.18), var(--sh-2);
}
.rc-search input::-webkit-search-cancel-button { display: none; }

.rc-clear {
  position: absolute; right: 12px;
  width: 32px; height: 32px; display: grid; place-items: center;
  border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(255,255,255,.85); color: var(--ink-2);
  font-size: 1.25rem; line-height: 1;
}
.rc-clear:hover { background: var(--lagoon-wash); color: var(--ink); }
.rc-clear[hidden] { display: none; }


.rc-count {
  margin: 0 0 22px; text-align: center;
  color: var(--ink-3); font-size: .88rem;
}

.rc-empty {
  margin: 8px 0 0; text-align: center;
  color: var(--ink-2); font-size: 1rem;
}

.rc-card[hidden] { display: none; }

/* --- Phone --------------------------------------------------------------- */

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

@media (max-width: 680px) {
  .rc-grid { grid-template-columns: 1fr; gap: 20px; }

  .rc-controls { gap: 14px; margin-bottom: 22px; }
  .rc-search input { padding: 1em 3em 1em 3.2em; font-size: 16px; }

  /* A proper rail rather than a cramped row: full-size chips, a real swipe,
     and a fade at the right edge so it is obvious there is more to reach.
     It breaks out of the page gutter so a scrolled chip sits flush to the
     screen edge instead of looking clipped. */
  .rc-tabs {
    gap: 10px;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--gut);
    scrollbar-width: none;
    margin-inline: calc(var(--gut) * -1);
    padding: 6px var(--gut) 14px;
    margin-bottom: 26px;
    -webkit-mask-image: linear-gradient(90deg, #000 0, #000 88%, transparent 100%);
            mask-image: linear-gradient(90deg, #000 0, #000 88%, transparent 100%);
  }
  .rc-tabs::-webkit-scrollbar { display: none; }

  .rc-tab {
    scroll-snap-align: start;
    font-size: 1rem;
    padding: .85em 1.4em;
  }
  .rc-dot { width: 10px; height: 10px; }

}

/* Copy the recipe's own address, for sharing it directly. */
.rc-copy {
  display: inline-flex; align-items: center; gap: .5em;
  margin-top: 28px;
  font-family: var(--font-body); font-weight: 600; font-size: .9rem;
  padding: .7em 1.3em;
  border: 0; border-radius: 999px; cursor: pointer;
  background: var(--rc-wash); color: var(--rc-ink);
  transition: transform .2s ease, background-color .2s ease;
}
.rc-copy:hover { transform: translateY(-1px); background: color-mix(in srgb, var(--rc) 18%, #fff); }
.rc-copy.is-done { background: var(--rc); color: #fff; }

/* Every recipe ends on the same offer: this is a taste, the programme is the
   thing being sold. Tinted with the recipe's own colour so it reads as part of
   the card rather than an advert dropped in at the end. */
.rc-more {
  margin-top: 30px;
  padding: 22px 24px;
  border-radius: var(--r);
  background: var(--rc-wash);
}
.rc-more p {
  margin: 0 0 14px;
  color: var(--ink); font-size: .98rem; line-height: 1.5;
}

.rc-more-btn {
  display: inline-flex; align-items: center; gap: .5em;
  font-family: var(--font-body); font-weight: 600; font-size: .95rem;
  padding: .82em 1.5em;
  border-radius: 999px; text-decoration: none;
  background-color: var(--rc);
  background-image: linear-gradient(135deg,
    color-mix(in srgb, var(--rc) 84%, #fff) 0%,
    var(--rc) 55%,
    color-mix(in srgb, var(--rc) 80%, #000) 100%);
  color: #fff;
  box-shadow: 0 1px 2px rgba(16,50,61,.14), 0 7px 15px -6px var(--rc);
  transition: transform .2s cubic-bezier(.22,.7,.3,1), box-shadow .2s ease;
}
.rc-more-btn:hover,
.rc-more-btn:focus,
.rc-more-btn:active { color: #fff; }
.rc-more-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(16,50,61,.14), 0 11px 22px -8px var(--rc);
}
.rc-more-btn::after {
  content: ""; width: 15px; height: 15px;
  background: currentColor;
  -webkit-mask: var(--arrow) center / contain no-repeat;
          mask: var(--arrow) center / contain no-repeat;
  transition: transform .2s ease;
}
.rc-more-btn:hover::after { transform: translateX(3px); }

.rc-copy { margin-top: 18px; }

/* A library card shows its group on the photo; workout numbers are short so
   they read better with a little more room. */
.rc-work .rc-badge { letter-spacing: .04em; }

/* The dialog holds long prose for workouts rather than lists. */
.rc-modal p { margin: 0 0 14px; color: var(--ink-2); line-height: 1.7; }
.rc-modal h2 {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.4rem, 3vw, 1.9rem); line-height: 1.2; letter-spacing: -.02em;
  margin: 10px 0 16px;
}

/* --- Two fixes the static page never needed ------------------------------ */

/* 1. Hello Elementor's reset paints every button pink on hover and focus:
      `button:focus, button:hover { background: #CC3366 }`. That is one element
      plus one pseudo-class, which outranks a single class, so every card and
      every tab turned pink the moment the pointer touched it. Each control
      states its own background through all three states. */
.rc-open,
.rc-open:hover,
.rc-open:focus,
.rc-open:active { background: var(--surface); }

.rc-tab,
.rc-tab:hover,
.rc-tab:focus,
.rc-tab:active { background-color: var(--surface); }

.rc-tab.is-active,
.rc-tab.is-active:hover,
.rc-tab.is-active:focus { background-color: var(--rc); }

.rc-close,
.rc-close:focus { background: rgba(255,255,255,.92); }
.rc-close:hover { background: #fff; }

.rc-copy,
.rc-copy:hover,
.rc-copy:focus { background: var(--rc-wash); }
.rc-copy.is-done,
.rc-copy.is-done:hover { background: var(--rc); }

/* 2. `repeat(3, 1fr)` is really `minmax(auto, 1fr)`, so a long equipment line
      or a long title could push its column wider than its neighbours. That is
      what made the cards uneven, the photos different heights, and the whole
      grid wider than the page - which is why it sat off to the right.
      minmax(0, …) lets a column be narrower than its content and wrap. */
.rc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

@media (max-width: 1000px) { .rc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px)  { .rc-grid { grid-template-columns: minmax(0, 1fr); } }

/* Long words in a card should break rather than widen it. */
.rc-name, .rc-time, .rc-badge { overflow-wrap: anywhere; }

/* The same reset also paints button text: `button { color: #CC3366 }` and
   `button:focus, button:hover { color: #fff }`. A dialog focuses its close
   button the moment it opens, so the cross was white on white. Colour is
   pinned through every state, exactly as the background is. */
.rc-close,
.rc-close:hover,
.rc-close:focus,
.rc-close:active { color: var(--ink); }

.rc-open,
.rc-open:hover,
.rc-open:focus,
.rc-open:active { color: var(--ink); }

.rc-tab,
.rc-tab:hover,
.rc-tab:focus,
.rc-tab:active { color: var(--ink); }

.rc-tab.is-active,
.rc-tab.is-active:hover,
.rc-tab.is-active:focus { color: #fff; }

.rc-copy,
.rc-copy:hover,
.rc-copy:focus { color: var(--rc-ink); }
.rc-copy.is-done,
.rc-copy.is-done:hover { color: #fff; }

/* The card keeps its own colours whatever state the button is in. */
.rc-open:hover .rc-name,
.rc-open:focus .rc-name { color: var(--ink); }
.rc-open:hover .rc-time,
.rc-open:focus .rc-time,
.rc-open:hover .rc-cue,
.rc-open:focus .rc-cue { color: var(--rc-ink); }

/* A long equipment list should wrap inside the card rather than run off it. */
.rc-time { align-items: flex-start; }
.rc-time span { overflow-wrap: anywhere; }
.rc-clock { margin-top: .18em; }

/* Who wrote it: quiet on the card, a proper byline in the dialog. */
.rc-author { color: var(--ink-3); font-size: .84rem; }

.rc-byline {
  margin: 0 0 16px;
  color: var(--ink-3); font-size: .9rem;
}
.rc-byline strong { color: var(--rc-ink); }
