/* Layout and components. Colors and fonts come from theme.css. Phone first. */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.55;
}

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

a {
  color: var(--brand);
}

h1,
h2,
h3 {
  font-family: var(--font-heading);
  color: var(--brand);
  line-height: 1.2;
  margin: 0 0 0.5em;
}

h1 {
  font-size: clamp(1.9rem, 6vw, 2.8rem);
}

h2 {
  font-size: clamp(1.4rem, 4.5vw, 1.9rem);
}

h3 {
  font-size: 1.15rem;
}

p {
  margin: 0 0 1em;
}

.wrap {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 16px;
}

.narrow {
  max-width: 720px;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.9rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: -999px;
}

.skip-link:focus {
  left: 16px;
  top: 8px;
  z-index: 10;
  background: var(--bg);
  padding: 8px 12px;
}

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

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
}

.site-header .logo {
  font-size: 1.7rem;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 600;
}

.site-nav a {
  text-decoration: none;
}

.site-nav a[aria-current="page"]:not(.button) {
  text-decoration: underline;
  text-underline-offset: 4px;
}

@media (max-width: 480px) {
  .site-header .logo {
    font-size: 1.35rem;
  }

  .site-nav {
    gap: 10px;
    font-size: 0.95rem;
  }

  .site-nav .nav-extra {
    display: none;
  }

  .site-nav .button {
    min-height: 36px;
    padding: 4px 12px;
  }
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 22px;
  border: 2px solid var(--brand);
  border-radius: 999px;
  background: var(--brand);
  color: var(--on-brand);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
}

.button.secondary {
  background: var(--bg);
  color: var(--brand);
}

.button.secondary:hover {
  background: var(--accent-soft);
}

.button.small {
  min-height: 38px;
  padding: 6px 14px;
  font-size: 0.95rem;
}

.button[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.site-nav .button {
  min-height: 40px;
  padding: 6px 16px;
}

/* Main and sections */
main {
  display: block;
}

.section {
  padding: 40px 0;
}

.section.alt {
  background: var(--surface);
}

.page-title {
  padding: 32px 0 8px;
}

/* Footer */
.site-footer {
  margin-top: 40px;
  padding: 32px 0 40px;
  background: var(--accent-soft);
  font-size: 0.95rem;
}

.site-footer .wrap {
  display: grid;
  gap: 12px;
}

.site-footer .logo {
  font-size: 1.5rem;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

/* Notices */
.notice {
  padding: 14px 16px;
  border-radius: var(--radius-small);
  background: var(--accent-soft);
  border: 1px solid var(--border);
}

.notice.warning {
  background: var(--warning-soft);
}

.notice.error {
  background: var(--danger-soft);
  border-color: var(--danger);
  color: var(--danger);
}

.notice.success {
  background: var(--success-soft);
  border-color: var(--success);
}

.center {
  text-align: center;
}

/* Home: hero */
.hero {
  padding: 40px 0;
}

/* Phone: photo above the card. Wider screens: card left, photo right. */
.hero-grid {
  display: grid;
  gap: 20px;
}

.hero-photo {
  position: relative;
  margin: 0;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  background: var(--accent-soft);
  box-shadow: var(--shadow);
}

/* Slides are stacked. The new one (.is-shown) fades in on top of the old one (.is-prev). */
.hero-photo img {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.2s ease;
}

.hero-photo:not(.rotating) img:first-child,
.hero-photo img.is-prev {
  opacity: 1;
  z-index: 1;
}

.hero-photo img.is-shown {
  opacity: 1;
  z-index: 2;
}

@media (prefers-reduced-motion: reduce) {
  .hero-photo img {
    transition: none;
  }
}

@media (min-width: 760px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 400px);
    align-items: center;
    gap: 32px;
  }

  .hero-photo {
    order: 2;
    aspect-ratio: 4 / 5;
  }
}

.hero-card {
  max-width: 560px;
  padding: 28px 24px;
  border-radius: var(--radius);
  background: var(--bg);
  box-shadow: var(--shadow);
}

.hero-card h1 {
  margin-bottom: 0.4em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin: 1.2em 0 0;
}

[data-closed-banner] {
  margin-top: 24px;
}

/* Home: how it works */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  counter-reset: step;
}

.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 32px 1fr;
  column-gap: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.steps li > * {
  grid-column: 2;
}

.steps li::before {
  content: counter(step);
  grid-column: 1;
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--on-brand);
  font-weight: 700;
}

.steps h3 {
  margin: 4px 0 4px;
}

.steps p {
  margin: 0;
}

/* Flavor grid */
.flavor-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

@media (min-width: 640px) {
  .flavor-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
}

.flavor-card {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg);
  box-shadow: var(--shadow);
}

.flavor-photo img,
.photo-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

/* "Order now" sticker over the photo's bottom-right corner. Links to a blank order. */
.flavor-media {
  position: relative;
}

.order-sticker {
  position: absolute;
  z-index: 2;
  right: 6px;
  bottom: 6px;
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  background: url("/img/order-sticker.svg") center / contain no-repeat;
  color: var(--brand);
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: 0.04em;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  transform: rotate(-12deg);
  transition: transform 0.15s ease;
}

.order-sticker:hover {
  transform: rotate(-4deg) scale(1.08);
}

.order-sticker:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
  border-radius: 50%;
}

@media (min-width: 640px) {
  .order-sticker {
    right: 10px;
    bottom: 10px;
    width: 78px;
    height: 78px;
    font-size: 0.78rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .order-sticker {
    transition: none;
  }
}

/* An invisible button covering the whole card opens the details dialog. */
.card-open {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: none;
  cursor: pointer;
}

.card-open:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: -3px;
}

.dialog-close:focus-visible,
.dialog-thumb:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}

/* Flavor details dialog */
.flavor-dialog {
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: 0;
  overflow-y: auto;
  border: 0;
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  box-shadow: var(--shadow);
}

.flavor-dialog::backdrop {
  background: rgb(29 47 94 / 0.6);
}

.dialog-photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.dialog-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.9);
  color: var(--brand);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}

.dialog-thumbs {
  display: flex;
  gap: 8px;
  padding: 8px 16px 0;
}

.dialog-thumb {
  width: 64px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--radius-small);
  background: none;
  overflow: hidden;
  cursor: pointer;
}

.dialog-thumb[aria-pressed="true"] {
  border-color: var(--brand);
}

.dialog-thumb img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.dialog-body {
  padding: 16px 18px 20px;
}

.dialog-body h2 {
  margin: 0 0 8px;
}

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

.flavor-body {
  padding: 12px 14px 14px;
}

.flavor-body h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.flavor-body p {
  margin: 0 0 6px;
  font-size: 0.95rem;
}

/* Cards show the first two lines of the description; the details dialog shows all of it. */
.flavor-body .flavor-desc {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}

.allergens {
  color: var(--muted);
}

.badge {
  display: inline-block;
  margin-bottom: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--brand);
  font-size: 0.8rem;
  font-weight: 700;
}

.badge.holiday {
  background: var(--warning-soft);
}

/* Home: seasonal callout */
.callout {
  padding: 24px;
  border-radius: var(--radius);
}

.callout-grid {
  display: grid;
  gap: 18px;
}

.seasonal-photo {
  max-width: 420px;
  aspect-ratio: 1 / 1;
}

@media (min-width: 760px) {
  .callout-grid {
    grid-template-columns: minmax(0, 520px) minmax(0, 360px);
    align-items: center;
    gap: 28px;
  }

  .seasonal-photo {
    order: 0;
    aspect-ratio: 1 / 1;
  }
}

.callout-card {
  max-width: 520px;
  padding: 22px;
  border-radius: var(--radius);
  background: var(--bg);
}

.seasonal-list {
  margin: 0 0 1em;
  padding-left: 1.2em;
  font-weight: 600;
}

/* FAQ */
.faq details {
  border-bottom: 1px solid var(--border);
}

.faq summary {
  padding: 16px 0;
  font-weight: 700;
  color: var(--brand);
  cursor: pointer;
}

.faq details p {
  margin: 0 0 16px;
}

.faq-cta {
  margin-top: 28px;
}

/* About */
.story {
  font-size: 1.1rem;
}

.signature {
  font-size: 2rem;
}

/* Long text pages */
.prose h2 {
  margin-top: 1.4em;
  font-size: 1.3rem;
}

/* Order form */
.order-form fieldset {
  margin: 0 0 24px;
  padding: 18px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.order-form legend {
  padding: 0 6px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--brand);
}

.field {
  margin: 0 0 14px;
}

.field label,
.group-field label {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
}

input:not([type="radio"], [type="checkbox"]),
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #9fb3c8;
  border-radius: var(--radius-small);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 1rem; /* 16px keeps iPhone Safari from zooming in on focus */
}

textarea {
  resize: vertical;
}

.choice {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 10px;
  align-items: start;
  margin: 0 0 14px;
}

.choice input {
  width: 22px;
  height: 22px;
  margin: 2px 0 0;
  accent-color: var(--brand);
}

.gift-choice {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.packs {
  display: grid;
  gap: 14px;
}

.pack-card {
  padding: 14px;
  border-radius: var(--radius-small);
  background: var(--accent-soft);
}

.pack-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.pack-head h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
}

.group-field {
  margin-top: 10px;
}

.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.mode-button {
  min-height: 46px;
  padding: 8px 10px;
  border: 1px solid #9fb3c8;
  border-radius: var(--radius-small);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.mode-button.active {
  border-color: var(--brand);
  background: var(--brand);
  color: var(--bg);
}

.pack-card > .link-button {
  display: block;
  margin-top: 10px;
}

.link-button {
  border: 0;
  padding: 4px 0;
  background: none;
  color: var(--brand);
  font: inherit;
  font-size: 0.95rem;
  text-decoration: underline;
  cursor: pointer;
}

.add-pack {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.order-summary {
  margin: 0 0 16px;
}

.total-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 0 0 4px;
  font-size: 1.25rem;
}

.turnstile {
  min-height: 70px;
  margin: 0 0 12px;
}

#form-error {
  margin-bottom: 12px;
}

.button.submit {
  width: 100%;
  margin-bottom: 12px;
  font-size: 1.1rem;
}

/* Thanks page */
.receipt-card {
  margin: 0 0 24px;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--accent-soft);
}

.receipt-number {
  margin-bottom: 8px;
}

.receipt-packs {
  margin: 0 0 12px;
  padding-left: 1.2em;
}
