/**
 * Bakery theme — cozy cartoon bakery chrome for Sourdough and Bread.
 * Presentation only: does not change calculator math or ad slot IDs.
 * Load after Tailwind + page-local styles so these rules win on shared chrome.
 */

:root {
  /* Domain materials */
  --flour: #fffbf5;
  --butter: #fff0e0;
  --crust: #c45c26;
  --crust-deep: #9a3f12;
  --crust-soft: #ffe4cc;
  --jam: #db2777;
  --pistachio: #2f9e6a;
  --pistachio-deep: #247a52;
  --oven-brick: #7a3410;
  --dough: #f5d9c4;
  --counter: #fff6eb;
  --ink: #3d2a1f;
  --ink-muted: #6b5e55;
  --outline-soft: #e8c9b0;
  --yeast-focus: #4f46e5;
  --surface-card: #ffffff;

  --radius-card: 1.25rem;
  --radius-pill: 9999px;
  --dough-press-depth: 4px;
  --font-display: "Fredoka", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, sans-serif;
  --font-label: "Nunito", system-ui, sans-serif;
}

/* Base canvas */
body.bg-flour-white,
body.bakery-theme {
  background-color: var(--flour) !important;
  color: var(--ink);
  font-family: var(--font-body);
}

.font-display,
h1, h2,
#header-brand-title,
.header-brand-title {
  font-family: var(--font-display);
}

.font-label,
.hearth-nav-link,
.hearth-stat-label,
.guided-stepper-mobile-label {
  font-family: var(--font-label);
}

/* ----- Dough-press controls (signature) ----- */
.dough-press,
.hearth-cta,
button.hearth-cta,
a.hearth-cta {
  position: relative;
  border: 2px solid transparent;
  border-radius: var(--radius-pill);
  background-color: var(--pistachio) !important;
  color: #ffffff !important;
  font-weight: 700;
  box-shadow: 0 var(--dough-press-depth) 0 var(--pistachio-deep);
  transform: translateY(0);
  transition: transform 0.15s ease-out, box-shadow 0.15s ease-out, background-color 0.15s ease-out;
  cursor: pointer;
}

.dough-press:hover,
.hearth-cta:hover,
button.hearth-cta:hover,
a.hearth-cta:hover {
  background-color: #34b078 !important;
}

.dough-press:active,
.hearth-cta:active,
button.hearth-cta:active,
a.hearth-cta:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--pistachio-deep);
}

.dough-press-secondary {
  background-color: var(--surface-card) !important;
  color: var(--crust-deep) !important;
  border: 2px solid var(--outline-soft) !important;
  box-shadow: 0 var(--dough-press-depth) 0 var(--dough);
  border-radius: var(--radius-pill);
  font-weight: 700;
  transition: transform 0.15s ease-out, box-shadow 0.15s ease-out;
  cursor: pointer;
}

.dough-press-secondary:hover {
  border-color: var(--crust) !important;
}

.dough-press-secondary:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--dough);
}

.dough-press-primary {
  background-color: var(--crust) !important;
  color: #ffffff !important;
  border: 2px solid transparent;
  border-radius: var(--radius-pill);
  font-weight: 700;
  box-shadow: 0 var(--dough-press-depth) 0 var(--crust-deep);
  transition: transform 0.15s ease-out, box-shadow 0.15s ease-out;
  cursor: pointer;
}

.dough-press-primary:hover {
  background-color: #d46a30 !important;
}

.dough-press-primary:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--crust-deep);
}

/* ----- Cards / panels ----- */
.hearth-panel,
.bakery-card {
  background: var(--surface-card);
  border: 2px solid var(--outline-soft);
  border-radius: var(--radius-card);
  box-shadow: 0 3px 0 var(--dough);
}

.hearth-panel-muted,
.bakery-card-muted {
  background: var(--butter);
  border: 2px solid var(--outline-soft);
  border-radius: var(--radius-card);
}

.hearth-fine-tune {
  background: #f3e8dc;
  border: 2px solid var(--outline-soft);
  border-radius: var(--radius-card);
  box-shadow: inset 0 1px 2px rgba(61, 42, 31, 0.06);
}

.hearth-stat {
  background: var(--butter);
  border-radius: 1rem;
  border: 1px solid var(--outline-soft);
}

.hearth-stat-value {
  color: var(--crust-deep);
  font-family: ui-monospace, monospace;
}

.hearth-label {
  color: var(--ink-muted);
}

.hearth-link {
  color: var(--crust);
}

.hearth-link:hover {
  color: var(--crust-deep);
}

/* ----- Header / nav ----- */
.hearth-header,
header.bg-flour-white {
  background: var(--flour) !important;
  border-bottom: 2px solid var(--dough) !important;
}

.hearth-nav-link {
  color: var(--ink-muted);
  font-family: var(--font-label);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding-bottom: 0.25rem;
  border-bottom: 3px solid transparent;
  transition: color 0.2s, border-color 0.2s;
  background: transparent;
  cursor: pointer;
}

.hearth-nav-link:hover {
  color: var(--crust);
}

.hearth-nav-link.active {
  color: var(--crust-deep);
  font-weight: 800;
  border-bottom-color: var(--crust);
}

.header-icon-btn {
  border-radius: var(--radius-pill) !important;
  border-color: var(--outline-soft) !important;
  background: var(--surface-card);
  box-shadow: 0 2px 0 var(--dough);
  transition: transform 0.15s ease-out, box-shadow 0.15s ease-out;
}

.header-icon-btn:active {
  transform: translateY(2px);
  box-shadow: 0 0 0 var(--dough);
}

#header-brand-title,
.header-brand-title {
  color: var(--crust-deep) !important;
  letter-spacing: -0.02em;
}

/* ----- Selectable cards & pills ----- */
.btn-select {
  transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s, transform 0.15s;
  border-width: 2px;
  border-color: transparent;
  border-radius: var(--radius-card);
  box-shadow: 0 3px 0 transparent;
}

.btn-select:hover:not(.active) {
  border-color: var(--outline-soft);
  box-shadow: 0 3px 0 var(--dough);
}

.btn-select.active {
  background-color: var(--crust-soft) !important;
  border-color: var(--crust) !important;
  color: var(--crust-deep);
  box-shadow: 0 3px 0 #e8b896;
}

.btn-select:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--yeast-focus);
}

.btn-select.active .style-check {
  color: var(--crust);
}

.btn-pill {
  transition: background-color 0.2s, border-color 0.2s, box-shadow 0.15s, transform 0.15s;
  border-radius: var(--radius-pill);
}

.btn-pill.active {
  background-color: var(--crust-soft) !important;
  color: var(--crust-deep) !important;
  font-weight: 800;
  border: 2px solid var(--outline-soft) !important;
  box-shadow: 0 2px 0 var(--dough);
}

.btn-pill:not(.active) {
  color: #6b7280;
  border: 2px solid #e5e7eb;
  background: var(--surface-card);
}

.btn-pill:active {
  transform: translateY(2px);
  box-shadow: 0 0 0 transparent;
}

.btn-pill:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--yeast-focus);
}

/* ----- Guided stepper ----- */
.guided-stepper-dot {
  border: 2px solid transparent;
  box-shadow: 0 2px 0 transparent;
}

.guided-stepper-dot.done {
  background-color: var(--pistachio) !important;
  color: white;
  box-shadow: 0 2px 0 var(--pistachio-deep);
}

.guided-stepper-dot.current {
  background-color: var(--crust) !important;
  color: white;
  box-shadow: 0 3px 0 var(--crust-deep);
}

.guided-stepper-dot.upcoming {
  background-color: var(--dough) !important;
  color: var(--ink-muted);
}

.guided-stepper-line {
  background-color: var(--outline-soft) !important;
  height: 3px !important;
  border-radius: 9999px;
}

.guided-stepper-line.done {
  background-color: var(--pistachio) !important;
}

.guided-stepper-progress-track {
  background: var(--outline-soft) !important;
  height: 6px !important;
}

.guided-stepper-progress-fill {
  background: var(--crust) !important;
}

.nav-tab.active {
  background-color: rgba(196, 92, 38, 0.12);
  color: var(--crust-deep);
  font-weight: 700;
}

.mobile-tab.active {
  background-color: var(--crust) !important;
  color: #ffffff;
  border-radius: 1rem;
  box-shadow: 0 3px 0 var(--crust-deep);
}

.pro-sidebar {
  background: var(--butter) !important;
  border-color: var(--outline-soft) !important;
  border-radius: var(--radius-card);
}

.style-thumb {
  border-radius: 1rem !important;
  background: var(--butter) !important;
  border: 2px solid var(--outline-soft);
}

.flour-hint-zone {
  background: var(--butter) !important;
  border-color: var(--outline-soft) !important;
  border-radius: 1rem !important;
}

/* One connected disclosure: summary + panel share a single rounded shell.
   Do not !important a full radius on summary — that leaves a disconnected
   panel under a pill when [open]. */
details.guided-mobile-accordion,
details.guided-faq-mobile-shell {
  border: 1px solid var(--outline-soft);
  border-radius: 1rem;
  overflow: hidden;
  background: var(--surface-card);
}

.guided-mobile-accordion > summary,
#guided-faq-outer > summary {
  background: var(--butter) !important;
  border: none !important;
  border-radius: 0 !important;
  margin: 0 !important;
  list-style: none;
  cursor: pointer;
}

.guided-mobile-accordion > summary::-webkit-details-marker,
#guided-faq-outer > summary::-webkit-details-marker,
.sponsor-tools-compact > details > summary::-webkit-details-marker {
  display: none;
}

.guided-mobile-accordion > summary::marker,
#guided-faq-outer > summary::marker,
.sponsor-tools-compact > details > summary::marker {
  content: none;
  display: none;
}

.guided-mobile-accordion[open] > summary,
#guided-faq-outer[open] > summary {
  border-bottom: 1px solid var(--outline-soft) !important;
}

.guided-mobile-accordion > summary > *,
#guided-faq-outer > summary > * {
  pointer-events: none;
}

.guided-mobile-accordion .guided-accordion-body,
#guided-faq-outer .guided-faq-inner {
  border: none !important;
  border-radius: 0 !important;
}

.guided-mobile-accordion > summary i,
#guided-faq-outer > summary i {
  transition: transform 0.2s ease-out;
}

.guided-mobile-accordion[open] > summary i,
#guided-faq-outer[open] > summary i {
  transform: rotate(180deg);
}

@media (min-width: 768px) {
  details.guided-mobile-accordion,
  details.guided-faq-mobile-shell {
    border: none;
    overflow: visible;
    background: transparent;
    border-radius: 0;
  }
}

.hearth-optional-badge {
  background: var(--butter);
  border-color: var(--outline-soft);
  color: var(--ink-muted);
}

.hearth-toggle-track {
  background: var(--dough);
}

.hearth-toggle-track.active {
  background: var(--crust-soft);
}

/* Schedule nodes keep semantic ingredient hues; soft bakery rail */
.schedule-node {
  border-left-color: var(--outline-soft);
}

.bake-mode-header {
  background: var(--crust) !important;
}

.bake-stage-active {
  border-color: var(--crust) !important;
  box-shadow: 0 4px 16px rgba(196, 92, 38, 0.18);
}

/* ----- Starter-jar bottle mascot ----- */
.bakery-mascot {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  user-select: none;
}

.bakery-mascot-svg {
  width: 4.5rem;
  height: 5.25rem;
  overflow: visible;
}

.bakery-mascot-bubble {
  font-family: var(--font-label);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--crust-deep);
  background: var(--surface-card);
  border: 2px solid var(--outline-soft);
  border-radius: 1rem;
  padding: 0.25rem 0.65rem;
  box-shadow: 0 2px 0 var(--dough);
  max-width: 11rem;
  text-align: center;
  line-height: 1.25;
}

.bakery-mascot .jar-body {
  fill: #f8fbff;
  stroke: var(--ink);
  stroke-width: 2.5;
}

.bakery-mascot .jar-lid {
  fill: var(--crust);
  stroke: var(--crust-deep);
  stroke-width: 2;
}

.bakery-mascot .jar-band {
  fill: var(--crust-soft);
  stroke: var(--outline-soft);
  stroke-width: 1.5;
}

.bakery-mascot .starter-fill {
  fill: #f9a8d4;
  transition: fill 0.3s ease, transform 0.3s ease;
  transform-origin: center bottom;
}

.bakery-mascot[data-mood="sourdough"] .starter-fill {
  fill: #f472b6;
}

.bakery-mascot[data-mood="yeast"] .starter-fill {
  fill: #93c5fd;
}

.bakery-mascot[data-mood="overnight"] .starter-fill {
  fill: #a78bfa;
}

.bakery-mascot[data-mood="happy"] .starter-fill {
  fill: #86efac;
}

.bakery-mascot .eye {
  fill: var(--ink);
}

.bakery-mascot .blush {
  fill: #fda4af;
  opacity: 0.85;
}

.bakery-mascot .mouth {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2;
  stroke-linecap: round;
}

.bakery-mascot .bubble-pop {
  animation: bakery-bubble-pop 0.45s ease-out;
}

@keyframes bakery-bubble-pop {
  0% { transform: scale(0.85); opacity: 0; }
  60% { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.bakery-mascot .jar-idle {
  transform-origin: 50% 90%;
  animation: bakery-jar-bob 3.2s ease-in-out infinite;
}

@keyframes bakery-jar-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

/* ----- Journal / Recipes decorative ----- */
.bakery-polaroid {
  background: #fff;
  border: 2px solid var(--outline-soft);
  border-radius: 0.5rem 0.5rem 1rem 1rem;
  padding: 0.65rem 0.65rem 1.25rem;
  box-shadow: 0 4px 0 var(--dough);
}

.bakery-polaroid img {
  display: block;
  width: 100%;
  border-radius: 0.35rem;
  border: 1px solid var(--outline-soft);
}

.bakery-sticker {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-family: var(--font-label);
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  border: 2px solid var(--outline-soft);
  background: var(--crust-soft);
  color: var(--crust-deep);
  box-shadow: 0 2px 0 var(--dough);
}

.bakery-sticker-pistachio {
  background: #d1fae5;
  color: #065f46;
  border-color: #6ee7b7;
  box-shadow: 0 2px 0 #a7f3d0;
}

.bakery-empty {
  text-align: center;
  padding: 2rem 1.25rem;
  background: var(--butter);
  border: 2px dashed var(--outline-soft);
  border-radius: var(--radius-card);
  color: var(--ink-muted);
}

.bakery-empty .bakery-mascot {
  margin: 0 auto 0.75rem;
}

/* Soft decorative wobble for non-data chrome only (not sliders/ads) */
.bakery-wobble-soft {
  border-radius: 1.35rem 1.15rem 1.4rem 1.2rem / 1.2rem 1.4rem 1.15rem 1.35rem;
}

/* ----- Section bands + hill / hill-up / scallop dividers ----- */
/*
 * Hero / intro: divider is LAST child; peaks hang down.
 * Footer: divider is FIRST child with .bakery-divider--up; peaks face up
 * via a dedicated path (never CSS scaleY flip).
 * Wrapper stays transparent; fill lives on .bakery-band__body + the SVG
 * (currentColor / --bakery-fill). A filled wrapper under the SVG paints a
 * rectangle in the troughs.
 */
.bakery-band {
  position: relative;
  background: var(--butter);
}

.bakery-band-flour { background: var(--flour); --bakery-fill: var(--flour); }
.bakery-band-butter { background: var(--butter); --bakery-fill: var(--butter); }
.bakery-band-counter { background: var(--counter); --bakery-fill: var(--counter); }
.bakery-band-dough { background: var(--dough); --bakery-fill: var(--dough); }
.bakery-band-crust-soft { background: var(--crust-soft); --bakery-fill: var(--crust-soft); }

.bakery-band:has(> .bakery-divider) {
  background: transparent !important;
  overflow: visible;
}

.bakery-band:has(> .bakery-divider:not(.bakery-divider--up)) {
  padding-bottom: 0 !important;
  border-bottom-left-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}

.bakery-band:has(> .bakery-divider--up) {
  padding-top: 0 !important;
  border-top-left-radius: 0 !important;
  border-top-right-radius: 0 !important;
}

.bakery-band:has(> .bakery-divider) > .bakery-band__body {
  position: relative;
  z-index: 1;
  background: var(--bakery-fill, var(--butter));
}

.bakery-divider {
  --bakery-crest-x: 70%;
  --bakery-crest-y: 88%;
  position: relative;
  display: block;
  width: 100%;
  height: 4rem;
  margin-top: -1px;
  padding: 0;
  line-height: 0;
  overflow: visible;
  pointer-events: none;
  color: var(--bakery-fill, var(--butter));
  background: transparent;
}

.bakery-divider--up {
  --bakery-crest-y: 12%;
  margin-top: 0;
  margin-bottom: -1px;
}

.bakery-divider--scallop {
  --bakery-crest-x: 70.8%;
  --bakery-crest-y: 82%;
  height: 3.5rem;
}

.bakery-divider > svg:not(.bakery-divider__rider) {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.bakery-divider__rider {
  position: absolute;
  left: var(--bakery-crest-x);
  top: var(--bakery-crest-y);
  width: 3.25rem;
  height: auto;
  transform: translate(-50%, -85%);
  z-index: 2;
  pointer-events: none;
}

.bakery-divider__rider.bakery-mascot {
  display: inline-flex;
  width: auto;
  height: auto;
  transform: translate(-50%, -92%);
}

.bakery-divider__rider.bakery-mascot .bakery-mascot-svg {
  width: 3.25rem;
  height: auto;
}

.bakery-divider__rider.bakery-mascot .bakery-mascot-bubble {
  display: none;
}

.bakery-divider--up .bakery-divider__rider {
  transform: translate(-50%, -100%);
}

@media (min-width: 768px) {
  .bakery-divider {
    height: 4.5rem;
  }

  .bakery-divider__rider {
    width: 3.75rem;
  }

  .bakery-divider__rider.bakery-mascot .bakery-mascot-svg {
    width: 3.75rem;
  }
}

/* ----- Motion ----- */
@keyframes bakery-step-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes bakery-float-soft {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes bakery-sparkle {
  0%, 100% { opacity: 0.35; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.08); }
}

.guided-step.active {
  animation: bakery-step-in 0.38s ease-out;
}

.bakery-float {
  animation: bakery-float-soft 3.6s ease-in-out infinite;
}

.bakery-sparkle {
  display: inline-block;
  animation: bakery-sparkle 2.4s ease-in-out infinite;
  color: var(--crust);
}

.bakery-reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.45s ease-out, transform 0.45s ease-out;
}

.bakery-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.recipe-card.hearth-panel,
a.recipe-card,
.bakery-card-lift {
  transition: transform 0.2s ease-out, box-shadow 0.2s ease-out, border-color 0.2s ease-out;
}

.recipe-card.hearth-panel:hover,
a.recipe-card:hover,
.bakery-card-lift:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 0 var(--dough);
}

.btn-select:hover:not(.active) {
  transform: translateY(-1px);
}

.guided-stepper-dot.current {
  animation: bakery-float-soft 2.8s ease-in-out infinite;
}

/*
 * Article + shared sidebar: leftover row space is split evenly
 * (left | main | middle | rail | right) so the rail sits in the
 * balance between the article and the container edge.
 */
@media (min-width: 1280px) {
  .flex:has(> [data-site-ad-rail]),
  .flex:has(> #ad-rail) {
    justify-content: space-evenly;
    gap: 0;
  }

  .flex:has(> [data-site-ad-rail]) > main,
  .flex:has(> #ad-rail) > main {
    margin-left: 0;
    margin-right: 0;
    flex: 0 1 48rem;
    width: 100%;
  }
}

/* Ad wells stay reserved & calm — do not cartoonize Gourmet AST boxes */
.ad-slot,
.ad-slot-rect,
[id^="ga_"],
[id^="ga_os_"] {
  border-radius: 0.75rem;
}

/* Creatives sit in the middle of the reserved well (smaller units, iframes). */
.ad-slot,
.ad-slot-header,
.ad-slot-rect,
.ad-slot-native,
.ad-slot-outstream,
.ad-slot-rail-unit,
.ad-header-host {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

[id^="ga_"],
[id^="ga_os_"] {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.ad-slot iframe,
[id^="ga_"] iframe,
[id^="ga_os_"] iframe {
  display: block;
  float: none;
  margin-left: auto;
  margin-right: auto;
}

/* ----- Reduced motion ----- */
@media (prefers-reduced-motion: reduce) {
  .bakery-mascot .jar-idle,
  .bakery-mascot .bubble-pop,
  .guided-step.active,
  .bakery-float,
  .bakery-sparkle,
  .guided-stepper-dot.current {
    animation: none !important;
  }

  .bakery-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .dough-press,
  .dough-press-secondary,
  .dough-press-primary,
  .hearth-cta,
  .btn-select,
  .btn-pill,
  .header-icon-btn,
  .recipe-card.hearth-panel,
  a.recipe-card,
  .bakery-card-lift {
    transition: background-color 0.15s, border-color 0.15s, color 0.15s !important;
  }

  .dough-press:active,
  .dough-press-secondary:active,
  .dough-press-primary:active,
  .hearth-cta:active,
  .header-icon-btn:active,
  .btn-pill:active,
  .recipe-card.hearth-panel:hover,
  a.recipe-card:hover,
  .bakery-card-lift:hover,
  .btn-select:hover:not(.active) {
    transform: none;
  }
}
