/* ==========================================================================
   Anastasiia's Bakery — shared stylesheet
   1. Design tokens
   2. Reset & base
   3. Typography
   4. Layout helpers
   5. Buttons
   6. Header & navigation
   7. Footer
   8. Floating chat button
   9. Hero banner
   10. Welcome (two-column)
   11. Image cards
   12. Our Work / Instagram feed
   13. Menu page
   14. Coming soon hero
   15. Contact page
   16. Responsive
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */

:root {
  /* Palette */
  --bg-pink: #f7ebed;
  --accent-mauve: #d3b3b8;
  --accent-rose: #e8cfd3;
  --accent-deep: #998184;
  --text-dark: #2b2b2b;
  --white: #ffffff;
  --footer-dark: #2b2626;

  /* Type stacks */
  --font-heading: "Didot", "Playfair Display", serif;
  --font-body: "Avenir", "Nunito Sans", sans-serif;

  /* Rhythm */
  --content-max: 1200px;
  --panel-inset: 40px;
  --section-gap: 80px;
  --header-height: 112px;

  /* Effects */
  --shadow-soft: 0 6px 20px rgba(43, 38, 38, 0.12);
  --transition: 0.25s ease;
}

/* --------------------------------------------------------------------------
   2. Reset & base
   -------------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--white);
  color: var(--text-dark);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

:focus-visible {
  outline: 2px solid var(--accent-deep);
  outline-offset: 3px;
}

/* Visible only to screen readers. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   3. Typography
   -------------------------------------------------------------------------- */

h1,
h2,
h3,
h4 {
  margin: 0 0 0.6em;
  font-family: var(--font-heading);
  font-weight: 400;
  line-height: 1.2;
  color: var(--text-dark);
}

h1 {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  letter-spacing: 0.08em;
}

h2 {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  letter-spacing: 0.08em;
}

h3 {
  font-size: clamp(1.25rem, 2.2vw, 1.5rem);
  letter-spacing: 0.06em;
}

h4 {
  font-size: 1.125rem;
  letter-spacing: 0.05em;
}

p {
  margin: 0 0 1.25em;
}

p:last-child {
  margin-bottom: 0;
}

/* Underlined heading treatment, applied per page spec. */
.is-underlined {
  text-decoration: underline;
  text-underline-offset: 6px;
  text-decoration-thickness: 1px;
}

/* Serif body copy, for pages that call for it. */
.text-serif {
  font-family: var(--font-heading);
  font-weight: 400;
}

.text-center {
  text-align: center;
}

.eyebrow {
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-deep);
}

/* --------------------------------------------------------------------------
   4. Layout helpers
   -------------------------------------------------------------------------- */

.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.page__main {
  flex: 1 0 auto;
  padding-bottom: var(--section-gap);
}

/* The single source of vertical rhythm between sections, on every page.
   Sections must not carry their own top/bottom margins or the gaps drift.
   .section-stack applies the same rhythm to sections nested inside a panel. */
.page__main > * + *,
.section-stack > * + * {
  margin-top: var(--section-gap);
}

/* Centred content column. */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: 24px;
}

/* Soft-pink panel, inset horizontally only — vertical space between sections
   comes from --section-gap so the rhythm stays uniform. */
.panel {
  background-color: var(--bg-pink);
  margin-inline: var(--panel-inset);
  padding: clamp(40px, 6vw, 88px) 0;
}

.panel--flush {
  margin-inline: 0;
}

/* Centred body column for the interior pages. */
.prose {
  max-width: 760px;
  margin-inline: auto;
  text-align: center;
}

/* Narrower measure, for prose sitting in one half of a .split. */
.prose--narrow {
  max-width: 560px;
}

/* The global reset strips link styling so nav items and cards stay clean, but
   a link inside body copy still has to look clickable. */
.prose a {
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--transition);
}

.prose a:hover,
.prose a:focus-visible {
  color: var(--accent-deep);
}

/* Two equal columns that stack on mobile. */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
}

.split__media img {
  width: 100%;
  height: auto;
}

/* Three-quarter width image, still centred in its column. */
.split__media--narrow img {
  width: 75%;
  margin-inline: auto;
}

/* Portrait frame, centred in its column. The ratio matches the 2:3 source so
   nothing is cropped today; object-fit keeps the frame stable if the photo is
   ever swapped for one shot at a different ratio. */
.split__media--portrait img {
  max-width: 500px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  margin-inline: auto;
}

/* Same rhythm as --section-gap, for a block nested inside a section. */
.section-gap-top {
  margin-top: var(--section-gap);
}

/* --------------------------------------------------------------------------
   5. Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-block;
  padding: 14px 34px;
  background-color: var(--accent-mauve);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
  border-radius: 2px;
  transition: background-color var(--transition), color var(--transition);
}

.btn:hover,
.btn:focus-visible {
  background-color: var(--accent-deep);
  color: var(--white);
}

.btn--outline {
  background-color: transparent;
  color: var(--text-dark);
  border: 1px solid var(--accent-mauve);
}

.btn--outline:hover,
.btn--outline:focus-visible {
  background-color: var(--accent-rose);
  color: var(--text-dark);
}

/* White serif label plate, used for the home cards and the Instagram CTA. */
.label-button {
  display: inline-block;
  padding: 12px 40px;
  background-color: var(--white);
  color: var(--text-dark);
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  line-height: 1.4;
  text-align: center;
  border: 1px solid rgba(43, 43, 43, 0.25);
  transition: background-color var(--transition);
}

.label-button:hover,
.label-button:focus-visible {
  background-color: var(--accent-rose);
}

/* 1.5x the base plate, for a standalone call to action. Eases down on narrow
   phones, where the full size would be wider than the screen. */
.label-button--lg {
  padding: 18px clamp(24px, 7vw, 60px);
  font-size: clamp(1.125rem, 5.5vw, 1.5rem);
}

/* --------------------------------------------------------------------------
   6. Header & navigation
   -------------------------------------------------------------------------- */

.site-header {
  position: relative;
  z-index: 20;
  background-color: var(--white);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding: 16px 24px;
}

/* Brand ------------------------------------------------------------------ */

.brand {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand__mark {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 80px;
  height: 80px;
  background-color: var(--accent-mauve);
  color: var(--white);
  font-family: var(--font-heading);
  font-size: 1.75rem;
  letter-spacing: 0.08em;
}

.brand__name {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 300;
  letter-spacing: 0.06em;
  color: var(--text-dark);
}

/* Nav -------------------------------------------------------------------- */

.primary-nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.primary-nav__list {
  display: flex;
  align-items: center;
  gap: 32px;
}

.primary-nav__link {
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-dark);
  transition: color var(--transition);
}

.primary-nav__link:hover,
.primary-nav__link:focus-visible {
  color: var(--accent-mauve);
}

.primary-nav__link[aria-current="page"] {
  color: var(--accent-mauve);
}

/* Social icons ----------------------------------------------------------- */

.social-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.social-links__link {
  display: flex;
  color: var(--text-dark);
  transition: color var(--transition);
}

.social-links__link:hover,
.social-links__link:focus-visible {
  color: var(--accent-mauve);
}

.social-links__link svg {
  width: 18px;
  height: 18px;
}

/* Hamburger -------------------------------------------------------------- */

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
}

.nav-toggle__bar {
  display: block;
  width: 24px;
  height: 1px;
  margin-inline: auto;
  background-color: var(--text-dark);
  transition: transform var(--transition), opacity var(--transition);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* --------------------------------------------------------------------------
   7. Footer
   -------------------------------------------------------------------------- */

.site-footer {
  padding: 26px 24px;
  background-color: var(--footer-dark);
  color: var(--white);
  text-align: center;
}

.site-footer__text {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 300;
  letter-spacing: 0.06em;
}

/* --------------------------------------------------------------------------
   8. Floating chat button
   -------------------------------------------------------------------------- */

.chat-button {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 50;
  padding: 14px 26px;
  background-color: var(--accent-mauve);
  color: var(--white);
  font-family: var(--font-heading);
  font-size: 1rem;
  letter-spacing: 0.04em;
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  transition: background-color var(--transition), transform var(--transition);
}

.chat-button:hover,
.chat-button:focus-visible {
  background-color: var(--accent-deep);
  transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   9. Hero banner
   -------------------------------------------------------------------------- */

.hero {
  background-color: var(--bg-pink);
}

.hero__image {
  width: 100%;
  height: 52vh;
  min-height: 320px;
  object-fit: cover;
}

/* --------------------------------------------------------------------------
   10. Welcome (two-column)
   -------------------------------------------------------------------------- */

.welcome {
  display: grid;
  grid-template-columns: 3fr 2fr;
  margin-inline: var(--panel-inset);
  background-color: var(--bg-pink);
}

.welcome__text {
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(40px, 5vw, 80px) clamp(24px, 4vw, 56px);
  text-align: center;
}

/* Sized against the column, not the viewport, so the explicit line break in
   the markup stays two lines instead of spilling onto a third. */
.welcome__title {
  margin-bottom: 1.1em;
  font-size: clamp(1.75rem, 2.6vw, 2.25rem);
  font-size: min(2.5rem, 7cqw);
}

.welcome__body {
  max-width: 520px;
}

/* The photo fills its column, cropping to the panel height set by the text
   column rather than shrinking to fit. */
.welcome__media {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
}

.welcome__media img {
  width: 100%;
  height: 100%;
  min-height: 360px;
  object-fit: cover;
}

/* --------------------------------------------------------------------------
   11. Image cards
   -------------------------------------------------------------------------- */

.cards__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(20px, 3vw, 36px);
}

.card {
  position: relative;
  display: block;
}

/* Fixed ratio keeps the three cards level despite differing source sizes. */
.card__image {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.card__label {
  position: absolute;
  bottom: clamp(18px, 3vw, 32px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
}

/* The whole card is the link, so hovering anywhere lights up the label. */
.card:hover .card__label,
.card:focus-visible .card__label {
  background-color: var(--accent-rose);
}

/* --------------------------------------------------------------------------
   12. Our Work / Instagram feed
   -------------------------------------------------------------------------- */

.our-work__title {
  margin-bottom: 0;
  text-align: center;
}

/* Wrapper only — the widget styles its own internals. */
.our-work__feed {
  max-width: var(--content-max);
  margin-inline: auto;
  padding: clamp(32px, 4vw, 56px) 24px;
}

.our-work__cta {
  text-align: center;
}

/* --------------------------------------------------------------------------
   13. Menu page
   -------------------------------------------------------------------------- */

/* Orders / price cards ---------------------------------------------------- */

/* White band between the two pink panels, so the bordered cards read as
   floating on white. Vertical breathing room comes from --section-gap. */
.orders {
  background-color: var(--white);
}

.order-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(24px, 3vw, 40px);
}

.order-card {
  min-height: 320px;
  padding: clamp(32px, 4vw, 56px) clamp(24px, 3vw, 40px);
  background-color: var(--bg-pink);
  border: 5px solid var(--accent-mauve);
  text-align: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.order-card:hover,
.order-card:focus-within {
  transform: scale(1.03);
  box-shadow: 0 16px 36px rgba(43, 38, 38, 0.2);
}

.price-list {
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: 1.125rem;
  line-height: 2.1;
  letter-spacing: 0.03em;
}

/* Three across at every width down to the 768px phone breakpoint, where it
   drops straight to a single column. There is no two-column tablet step. */
.flavors {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(24px, 3vw, 40px);
}

.flavor {
  text-align: center;
}

/* Fixed square frame so source photos of any size render uniformly.
   overflow: hidden clips the per-image zoom below.
   The tint shows while the photo loads, so an empty cell never looks broken. */
.flavor__media {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background-color: var(--accent-rose);
}

/* The source photos are shot at different distances, so each <img> carries an
   inline --zoom to bring every macaron to the same on-screen size, plus
   --nudge-x / --nudge-y to re-centre it afterwards. Defaults leave the photo
   untouched. Percentages resolve against the tile, and scale runs first.
   object-position is no help here: source and tile are both square, so cover
   crops nothing and there is nothing for it to reposition. Keep each nudge
   within (zoom - 1) / 2 or the opposite edge pulls away from the frame. */
.flavor__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: translate(var(--nudge-x, 0), var(--nudge-y, 0)) scale(var(--zoom, 1));
}

.flavor__name {
  margin: 18px 0 4px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.flavor__label {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 300;
  letter-spacing: 0.06em;
  color: var(--accent-deep);
}

/* --------------------------------------------------------------------------
   14. Coming soon hero
   -------------------------------------------------------------------------- */

/* cta-hero background: uncomment background-image and point it at the photo.
   Paths are relative to this stylesheet, so they start with ../images/. */
.cta-hero {
  position: relative;
  /* background-image: url("../images/menu/coming-soon.jpg"); */
  background-color: var(--accent-rose);
  background-size: cover;
  background-position: center;
  padding-block: clamp(56px, 8vw, 112px);
  color: var(--white);
  text-align: center;
}

.cta-hero__overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.25);
}

/* Lifts the content above the overlay. */
.cta-hero__inner {
  position: relative;
}

.cta-hero h2 {
  color: inherit;
}

/* Subscribe form ---------------------------------------------------------- */

.subscribe {
  max-width: 520px;
  margin: clamp(24px, 3vw, 36px) auto 0;
}

.subscribe__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.subscribe__input {
  flex: 1 1 240px;
  min-width: 0;
  padding: 14px 18px;
  background-color: var(--white);
  color: var(--text-dark);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 300;
  border: 1px solid var(--accent-mauve);
  border-radius: 2px;
}

.subscribe__input::placeholder {
  color: var(--accent-deep);
}

/* A solid chip so the message stays legible over any background photo. */
.subscribe__error {
  display: inline-block;
  margin: 14px 0 0;
  padding: 6px 14px;
  background-color: var(--white);
  color: #a3261e;
  font-size: 0.8125rem;
  border-radius: 2px;
}

.subscribe__error[hidden] {
  display: none;
}

/* min-height reserves the widget's space so the layout holds steady while the
   placeholder site key is in place. */
.subscribe__recaptcha {
  display: flex;
  justify-content: center;
  min-height: 78px;
  margin-top: 18px;
}

/* --------------------------------------------------------------------------
   15. Contact page
   -------------------------------------------------------------------------- */

.form-card {
  max-width: 860px;
  margin-inline: auto;
  padding: clamp(28px, 5vw, 50px);
  background-color: var(--white);
}

/* Revealed by js/main.js after Formspree redirects back with ?sent=1. */
.form-note {
  margin: 0 0 clamp(24px, 4vw, 36px);
  text-align: center;
  font-size: 0.9375rem;
  color: var(--accent-deep);
}

.form-note[hidden] {
  display: none;
}

/* One gap value drives the spacing between every row and field. */
.form-fields {
  display: grid;
  gap: clamp(26px, 4vw, 38px);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(24px, 3vw, 40px);
}

.field__label {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
}

/* Underline only — no box, no fill. */
.field__input {
  display: block;
  width: 100%;
  padding: 8px 0;
  background-color: transparent;
  border: 0;
  border-bottom: 1px solid var(--text-dark);
  border-radius: 0;
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-dark);
}

/* box-shadow rather than a thicker border, so focus adds no layout shift. */
.field__input:focus-visible {
  outline: none;
  border-bottom-color: var(--accent-deep);
  box-shadow: 0 1px 0 0 var(--accent-deep);
}

textarea.field__input {
  resize: vertical;
}

.form-actions {
  margin-top: clamp(32px, 5vw, 44px);
  text-align: center;
}

/* Text-only button, for a form that should stay quiet. */
.text-button {
  padding: 0;
  background: none;
  border: 0;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dark);
  cursor: pointer;
  transition: color var(--transition);
}

.text-button:hover,
.text-button:focus-visible {
  color: var(--accent-deep);
}

/* 630x300 embed that keeps its ratio as it narrows. */
.map {
  max-width: 630px;
  margin-inline: auto;
  aspect-ratio: 21 / 10;
}

.map iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* --------------------------------------------------------------------------
   16. Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1024px) {
  :root {
    --panel-inset: 24px;
  }

  .primary-nav,
  .primary-nav__list {
    gap: 22px;
  }

  .cards__grid {
    gap: 18px;
  }

  .card__label {
    padding: 10px 24px;
    font-size: 0.9375rem;
  }
}

@media (max-width: 767px) {
  :root {
    --panel-inset: 0px;
    --section-gap: 48px;
  }

  .site-header__inner {
    flex-wrap: wrap;
    padding: 12px 20px;
  }

  .nav-toggle {
    display: flex;
  }

  /* Nav collapses into a dropdown toggled by main.js. */
  .primary-nav {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    flex-basis: 100%;
    padding: 20px 0 8px;
    border-top: 1px solid var(--bg-pink);
  }

  .primary-nav.is-open {
    display: flex;
  }

  .primary-nav__list {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
  }

  .primary-nav__link {
    font-size: 0.875rem;
  }

  .brand__mark {
    width: 64px;
    height: 64px;
    font-size: 1.5rem;
  }

  .hero__image {
    height: 46vh;
    min-height: 260px;
  }

  /* Text column first, photo beneath it. */
  .welcome {
    grid-template-columns: 1fr;
  }

  /* Stacked: back to natural size and scaled back so the tall photo doesn't
     dominate the layout. */
  .welcome__media {
    padding: 24px;
  }

  .welcome__media img {
    width: auto;
    height: auto;
    min-height: 0;
    max-width: min(100%, 360px);
  }

  .cards__grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .split {
    grid-template-columns: 1fr;
  }

  /* Full width once stacked — 75% of a narrow column is too small. */
  .split__media--narrow img {
    width: 100%;
  }

  .flavors {
    grid-template-columns: 1fr;
  }

  .order-cards {
    grid-template-columns: 1fr;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .order-card {
    min-height: 0;
  }

  /* The widget is a fixed 304px wide, so shrink it to fit small screens. */
  .subscribe__recaptcha {
    transform: scale(0.85);
    transform-origin: center top;
  }

  .card__image {
    aspect-ratio: 4 / 3;
  }

  .card__label {
    padding: 12px 40px;
    font-size: 1rem;
  }

  .chat-button {
    right: 16px;
    bottom: 16px;
    padding: 12px 20px;
    font-size: 0.9375rem;
  }

  /* Keep the copyright clear of the floating chat button. */
  .site-footer {
    padding-bottom: 76px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
