/*
 * Public homepage (templates/index.html) and its order dialog (templates/includes/order_dialog.html).
 * Fonts, colours, the espresso header, glass buttons and the footer come from site.css (load it first).
 * The one bold element is the hero "cup": the logo's cup seen from above, drawn in CSS around a photo.
 * The editor's colours arrive as --home-bg, --home-section-bg, --home-text and --home-size
 * (templates/includes/homepage_theme.html).
 */
body.home { background: var(--home-bg, #fff); color: var(--home-text, var(--color-text)); }

body.home .pub-main--full { max-width: none; padding: 0; }
body.home .pub-main--full > .mb-3 { max-width: 74rem; margin: 6rem auto var(--space-4); padding-inline: var(--space-4); }
body.home [id] { scroll-margin-top: 6rem; }
/* The glass bar floats over the hero photo */
body.home .pub-header { position: fixed; inset: 0 0 auto; }

/* A draft being previewed says so */
.home-preview {
  position: fixed; left: 50%; bottom: max(1rem, env(safe-area-inset-bottom)); z-index: 1025; transform: translateX(-50%);
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); width: max-content; max-width: calc(100% - 2rem);
  padding: var(--space-2) var(--space-4); border-radius: var(--radius-lg); background: var(--mc-navy-700); color: #fff; box-shadow: var(--shadow-md);
}
.home-preview a { color: #fff; font-weight: 600; }

.home-wrap { width: 100%; max-width: 74rem; margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2rem); }
.home-script { margin: 0 0 var(--space-3); font-family: var(--font-script); font-weight: 400; line-height: 1.1; letter-spacing: 0; }
h2.home-script { font-size: clamp(2.4rem, 5vw, 3.4rem); color: inherit; }
.home-link { color: var(--site-orange-ink); font-weight: 600; text-underline-offset: 0.2em; }

/* The floating order button: warm glass, shown once the hero is out of view (static/js/pages/home.js) */
.btn.glass-fab {
  position: fixed; right: clamp(1rem, 3vw, 2rem); bottom: max(1rem, env(safe-area-inset-bottom)); z-index: 1020;
  min-height: 3.25rem; padding-inline: 1.5rem; font-size: 1rem;
  opacity: 0; visibility: hidden; transform: translateY(0.75rem);
  transition: opacity var(--motion-base) var(--ease-out), transform var(--motion-base) var(--ease-out), visibility 0s linear var(--motion-base), filter var(--motion-base);
}
.btn.glass-fab.is-visible { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.modal-open .btn.glass-fab { visibility: hidden; opacity: 0; }
body.home .site-footer { padding-bottom: 5.5rem; }  /* room for the floating button over the last line */
.btn.glass-fab:focus-visible { outline-color: var(--color-focus); }

/* ===== Hero: a photo of the café behind, the cup in front ===== */
.home-hero {
  position: relative; isolation: isolate; overflow: hidden; color: var(--site-cream); background: var(--site-espresso);
  min-height: min(100svh, 58rem); display: grid; align-items: center;
  padding-block: clamp(6.5rem, 12vw, 8rem) clamp(3rem, 7vw, 5rem);
}
.home-hero__bg { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.home-hero::after {  /* espresso over the photo: dense behind the words, lighter behind the cup */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, rgb(33 25 20 / 0.92) 0%, rgb(33 25 20 / 0.78) 42%, rgb(33 25 20 / 0.5) 100%),
    linear-gradient(0deg, rgb(33 25 20 / 0.55), transparent 35%);
}
@media (max-width: 767.98px) { .home-hero::after { background: linear-gradient(180deg, rgb(33 25 20 / 0.72), rgb(33 25 20 / 0.86)); } }
.home-hero__grid { display: grid; gap: clamp(2rem, 5vw, 3rem); align-items: center; }
@media (min-width: 768px) { .home-hero__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.home-hero__title { margin: 0; font-family: var(--font-script); font-weight: 400; font-size: clamp(3.5rem, 10vw, 7rem); line-height: 1; color: #fff; }
.home-hero__lead { margin: var(--space-4) 0 0; max-width: 26ch; font-weight: 300; font-size: clamp(1.15rem, 2.2vw, 1.5rem); line-height: 1.45; color: var(--site-cream-soft); }
.home-hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-6); }
.home-hero__table { display: inline-flex; align-items: center; gap: var(--space-2); margin: var(--space-4) 0 0; color: var(--site-cream-soft); }
.home-hero__table .bi { color: var(--site-orange); }

.cup { position: relative; width: min(100%, 30rem); aspect-ratio: 1; margin-inline: auto; filter: drop-shadow(0 30px 60px rgb(0 0 0 / 0.35)); }
.cup > span, .cup__photo { position: absolute; border-radius: 50%; }
.cup__saucer {  /* open on the right where the handle sits, like the logo */
  inset: 0; border: 3px solid var(--site-ring);
  -webkit-mask: conic-gradient(#000 0 74deg, transparent 74deg 106deg, #000 106deg); mask: conic-gradient(#000 0 74deg, transparent 74deg 106deg, #000 106deg);
}
.cup__handle { top: 45.5%; right: 0.5%; width: 17%; height: 9%; border-radius: var(--radius-pill) !important; border: 5px solid var(--site-handle); border-left: 0; border-top-left-radius: 0 !important; border-bottom-left-radius: 0 !important; }
.cup__arc { border-style: solid; border-color: transparent; }
.cup__arc--orange {  /* the cup wall: an orange ring with a gap, as in the logo */
  inset: 11%; border-width: 6px; border-color: var(--site-orange);
  -webkit-mask: conic-gradient(#000 0 300deg, transparent 300deg 330deg, #000 330deg); mask: conic-gradient(#000 0 300deg, transparent 300deg 330deg, #000 330deg);
}
.cup__arc--coral {
  inset: 5%; border-width: 4px; border-color: var(--site-coral);
  -webkit-mask: conic-gradient(transparent 0 200deg, #000 200deg 262deg, transparent 262deg); mask: conic-gradient(transparent 0 200deg, #000 200deg 262deg, transparent 262deg);
}
.cup__photo { inset: 17%; width: 66%; height: 66%; object-fit: cover; box-shadow: 0 0 0 6px var(--site-cream), 0 24px 48px rgb(0 0 0 / 0.45); background: var(--site-espresso-2); }

/* The one load moment: the cup's rings turn into place */
@media (prefers-reduced-motion: no-preference) {
  .cup__arc--orange { animation: cup-turn 1.4s var(--ease-out) both; }
  .cup__arc--coral { animation: cup-turn-back 1.6s var(--ease-out) 0.15s both; }
  .cup__saucer, .cup__handle { animation: cup-fade 0.9s ease-out 0.3s both; }
}
@keyframes cup-turn { from { transform: rotate(-120deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes cup-turn-back { from { transform: rotate(90deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes cup-fade { from { opacity: 0; } to { opacity: 1; } }

/* ===== Sections ===== */
.home-section { padding-block: clamp(3.5rem, 8vw, 6rem); font-size: var(--home-size, 1.0625rem); overflow-x: clip; }
.home-section--paper { background: var(--home-bg, #fff); color: var(--home-text, var(--color-text)); }
.home-section--cream { background: var(--home-section-bg, var(--site-cream)); color: var(--home-text, var(--color-text)); }
.home-section--espresso { background: var(--site-espresso); color: var(--site-cream); }
.home-heading { max-width: 40rem; margin-bottom: clamp(2rem, 4vw, 3rem); }
.home-heading p { margin: 0; color: var(--color-text-muted); }
.home-section--espresso .home-heading p { color: var(--site-cream-soft); }
.home-section--espresso h2.home-script { color: #fff; }
.home-cta { margin: clamp(2rem, 4vw, 3rem) 0 0; text-align: center; }

/* About */
.home-story { display: grid; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
@media (min-width: 768px) { .home-story { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); } }
.home-story__text p { max-width: 62ch; line-height: 1.7; }
.home-story__media { position: relative; width: min(100%, 24rem); justify-self: center; }
.home-story__media img { display: block; width: 100%; aspect-ratio: 5 / 6; object-fit: cover; border-radius: 12rem 12rem var(--radius-lg) var(--radius-lg); }
.home-story__media::before {  /* a saucer line behind the arched photo */
  content: ""; position: absolute; inset: -1rem -1rem auto auto; width: 7rem; aspect-ratio: 1; border-radius: 50%;
  border: 3px solid var(--site-orange); border-left-color: transparent; border-bottom-color: transparent; transform: rotate(-10deg);
}

/* Why us: three reasons, each marked with a piece of the logo's rings */
.reasons { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(1.75rem, 4vw, 2.5rem); }
@media (min-width: 768px) { .reasons { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.reason h3 { margin: var(--space-3) 0 var(--space-2); font-family: var(--font-body); font-weight: 600; font-size: 1.15rem; }
.reason p { margin: 0; color: var(--color-text-muted); line-height: 1.65; }
.reason__mark { display: block; width: 2.75rem; height: 2.75rem; border-radius: 50%; border: 4px solid var(--site-orange-ink); border-top-color: transparent; transform: rotate(35deg); }
.reason:nth-child(3n+2) .reason__mark { border-color: var(--mc-crimson-600); border-right-color: transparent; }
.reason:nth-child(3n) .reason__mark { border-color: var(--mc-navy-700); border-bottom-color: transparent; }

/* Menu: a printed menu sheet with dotted leaders; ordering happens in the dialog */
.menu-jump { display: flex; gap: var(--space-2); overflow-x: auto; padding-bottom: var(--space-2); margin-bottom: var(--space-5); scrollbar-width: thin; }
@media (min-width: 768px) { .menu-jump { flex-wrap: wrap; overflow: visible; } }
.menu-jump a { flex: none; display: inline-flex; align-items: center; min-height: var(--touch-target); padding: 0 1rem; border: 1px solid var(--site-line); border-radius: var(--radius-pill); color: inherit; text-decoration: none; background: var(--site-paper); font-size: 0.95rem; }
.menu-jump a:hover { border-color: var(--site-orange-ink); color: var(--site-orange-ink); }
.menu-board {
  background: var(--site-paper); color: var(--color-text); border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 4vw, 3rem); box-shadow: 0 0 0 1px var(--site-line), inset 0 0 0 8px var(--site-paper), inset 0 0 0 9px var(--site-line);
}
@media (min-width: 992px) { .menu-board { columns: 2; column-gap: 4rem; } }
.menu-board__group { break-inside: avoid; padding-bottom: var(--space-5); }
.menu-board__title { font-size: 2.1rem; color: var(--site-orange-ink); margin-bottom: var(--space-2); }
.menu-board__list { list-style: none; margin: 0; padding: 0; }
.menu-line { padding: var(--space-2) 0; }
.menu-line__head { display: flex; align-items: baseline; gap: var(--space-2); margin: 0; font-size: 1rem; }
.menu-line__name { font-weight: 600; }
.menu-line__dots { flex: 1 1 auto; min-width: 1.5rem; border-bottom: 2px dotted var(--mc-ink-300); transform: translateY(-0.3em); }
.menu-line__price { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.menu-line__desc { margin: 0.15rem 0 0; max-width: 46ch; font-size: 0.9rem; color: var(--color-text-muted); line-height: 1.5; }

/* Specials: plates seen from above, like the cup */
.plates { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(2rem, 4vw, 2.5rem) var(--space-5); grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr)); text-align: center; }
.plate__photo { display: block; width: min(100%, 11rem); aspect-ratio: 1; margin: 0 auto var(--space-4); border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 5px var(--site-cream), 0 0 0 12px var(--site-espresso), 0 0 0 14px var(--site-ring); }
.plate:nth-child(odd) .plate__photo { box-shadow: 0 0 0 5px var(--site-cream), 0 0 0 12px var(--site-espresso), 0 0 0 14px var(--site-orange); }
.plate__photo--empty { display: grid; place-items: center; background: var(--site-espresso-2); color: var(--site-orange); font-size: 3rem; }
.plate__name { font-size: 1.9rem; color: #fff; margin-bottom: var(--space-1); }
.plate p { margin: 0 auto; max-width: 24ch; color: var(--site-cream-soft); font-size: 0.95rem; line-height: 1.55; }

/* Gallery */
.photo-wall { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 9.5rem; }
@media (min-width: 768px) { .photo-wall { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 12rem; } }
.photo-wall li:first-child { grid-column: span 2; grid-row: span 2; }
/* The first photo takes four cells; widen the last one so the wall ends without a hole */
.photo-wall li:last-child:nth-child(even):not(:first-child) { grid-column: span 2; }
@media (min-width: 768px) {
  .photo-wall li:last-child:nth-child(even):not(:first-child) { grid-column: auto; }
  .photo-wall li:last-child:nth-child(4n):not(:first-child) { grid-column: span 2; }
  .photo-wall li:last-child:nth-child(4n+2):not(:first-child) { grid-column: span 4; }
  .photo-wall li:last-child:nth-child(4n+3) { grid-column: span 3; }
}
.photo-wall__item { display: block; width: 100%; height: 100%; padding: 0; border: 0; border-radius: var(--radius-lg); overflow: hidden; background: var(--color-surface-muted); cursor: zoom-in; }
.photo-wall__item img { width: 100%; height: 100%; object-fit: cover; transition: transform 400ms var(--ease-out); }
.photo-wall__item:hover img { transform: scale(1.04); }
.photo-wall__item:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 3px; }

/* ===== Order dialog ===== */
.order-dialog .modal-content { border: 0; border-radius: var(--radius-lg); overflow: hidden; background: var(--color-surface); }
.order-dialog .modal-header { align-items: flex-start; background: var(--site-espresso); color: var(--site-cream); border-bottom: 0; padding: var(--space-4) var(--space-5); }
.order-dialog .modal-header .btn-close { filter: invert(1) grayscale(1) brightness(2); margin-top: 0; }
.order-dialog .modal-header .btn-close:focus-visible { outline: 3px solid var(--color-focus-on-dark); box-shadow: none; }
.order-dialog__title { margin: 0; font-family: var(--font-script); font-weight: 400; font-size: 2.2rem; line-height: 1.1; color: inherit; }
.order-dialog__where { margin: var(--space-1) 0 0; font-size: var(--text-sm); color: var(--site-cream-soft); }
.order-dialog__where .bi { color: var(--site-orange); }
.order-dialog__body { padding: 0; }
@media (min-width: 992px) { .order-dialog__body { display: grid; grid-template-columns: minmax(0, 1fr) 21rem; align-items: start; } }

/* Take away or dine in, and the table for dine in */
.order-where { grid-column: 1 / -1; padding: var(--space-4) var(--space-5); background: var(--site-paper); border-bottom: 1px solid var(--color-border); }
.order-mode { border: 0; padding: 0; margin: 0 0 var(--space-3); min-width: 0; }
.order-mode legend { float: none; width: auto; padding: 0; }
.order-table { max-width: 40rem; }
.order-table__current { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin: 0; font-size: 1.05rem; }
.order-table__current .bi { color: var(--site-orange-ink); }
.order-table__help { margin: 0 0 var(--space-3); color: var(--color-text-muted); }
.order-table__type { margin-top: var(--space-4); }
.order-table__row { display: flex; gap: var(--space-2); }
.order-table__row .form-select { min-height: var(--touch-target); min-width: 0; flex: 1 1 auto; }
.order-table__row .btn { white-space: nowrap; flex: none; }
.order-table__error { margin: var(--space-3) 0 0; padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); background: var(--color-danger-tint); color: var(--color-danger-ink); font-weight: 600; }
.order-table__error[hidden] { display: none; }
.order-scan { margin: var(--space-3) 0 0; }
.order-scan[hidden] { display: none; }
.order-scan__frame { position: relative; width: min(100%, 22rem); aspect-ratio: 1; border-radius: var(--radius-lg); overflow: hidden; background: var(--site-espresso); box-shadow: 0 0 0 1px var(--site-line); }
.order-scan__frame video { width: 100%; height: 100%; object-fit: cover; display: block; }
.order-scan__frame::after { content: ""; position: absolute; inset: 14%; border: 3px solid rgb(255 255 255 / 0.85); border-radius: var(--radius-lg); box-shadow: 0 0 0 999px rgb(0 0 0 / 0.35); pointer-events: none; }
.order-scan__hint { margin: var(--space-2) 0; color: var(--color-text-muted); font-size: var(--text-sm); }
.order-summary__hint { margin: var(--space-2) 0 0; text-align: center; font-size: var(--text-sm); color: var(--color-text-muted); }
.order-summary__hint[hidden] { display: none; }

.order-pick { padding: 0 var(--space-5) var(--space-5); min-width: 0; }
.order-pick__tools { position: sticky; top: 0; z-index: 2; margin: 0 calc(var(--space-5) * -1); padding: var(--space-4) var(--space-5) var(--space-2); background: var(--color-surface); border-bottom: 1px solid var(--color-border); }
.order-pick__tools .form-control { border-radius: var(--radius-pill); padding-inline: 1.1rem; min-height: var(--touch-target); }
.order-pick__cats { display: flex; gap: var(--space-2); overflow-x: auto; padding: var(--space-3) 0 var(--space-2); scrollbar-width: thin; }
.order-pick__cats a { flex: none; display: inline-flex; align-items: center; min-height: 2.25rem; padding: 0 0.9rem; border-radius: var(--radius-pill); background: var(--color-surface-muted); color: var(--color-text); text-decoration: none; font-size: var(--text-sm); }
.order-pick__cats a:hover { background: var(--color-primary-tint); color: var(--color-primary-ink); }
.order-pick__none { margin: var(--space-5) 0; color: var(--color-text-muted); }
.order-cat { padding-top: var(--space-5); scroll-margin-top: 7.5rem; }
.order-cat__title { margin: 0 0 var(--space-2); font-family: var(--font-script); font-weight: 400; font-size: 1.9rem; color: var(--site-orange-ink); }
.order-items { list-style: none; margin: 0; padding: 0; }
.order-item { border-bottom: 1px dashed var(--site-line); }
.order-item__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-2) var(--space-3); align-items: center; padding: var(--space-3) 0; }
.order-item__info { grid-column: 1 / -1; }  /* phone: name on top, then price and buttons on one line */
@media (min-width: 576px) { .order-item__row { grid-template-columns: minmax(0, 1fr) auto auto; } .order-item__info { grid-column: auto; } }
.order-item__name { margin: 0; font-weight: 600; }
.order-item__desc { margin: 0.1rem 0 0; font-size: var(--text-sm); color: var(--color-text-muted); }
.order-item__price { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.order-item__actions { display: flex; gap: var(--space-2); justify-content: flex-end; }
.order-item__actions .btn { min-height: 2.5rem; display: inline-flex; align-items: center; gap: var(--space-1); }
.order-item__options { margin: 0 0 var(--space-3); padding: var(--space-4); border-radius: var(--radius-lg); background: var(--site-paper); box-shadow: inset 0 0 0 1px var(--site-line); }
.order-item__options fieldset { border: 0; padding: 0; min-width: 0; }
.order-item__options legend { float: none; width: auto; padding: 0; }
.order-item__opts-row { display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: flex-end; }
.order-item__note { flex: 1 1 14rem; }

.order-summary { padding: var(--space-5); background: var(--site-paper); border-top: 1px solid var(--color-border); }
@media (min-width: 992px) { .order-summary { min-height: 100%; border-top: 0; border-left: 1px solid var(--color-border); } .order-summary__inner { position: sticky; top: var(--space-4); } }
.order-summary__title { margin: 0 0 var(--space-3); font-family: var(--font-script); font-weight: 400; font-size: 1.9rem; }
.order-summary__empty { margin: 0 0 var(--space-3); color: var(--color-text-muted); }
.order-summary__lines { list-style: none; margin: 0; padding: 0; }
.order-line { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: var(--space-2); align-items: start; padding: var(--space-2) 0; border-bottom: 1px dashed var(--site-line); }
.order-line__name { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.order-line__controls { margin-top: var(--space-2); min-height: 2.25rem; display: flex; align-items: center; gap: var(--space-2); }
.line-stepper { display: inline-flex; align-items: center; border: 1px solid var(--color-border-strong); border-radius: var(--radius-pill); overflow: hidden; background: var(--color-surface); }
.line-stepper__btn.btn { width: 2.25rem; min-width: 2.25rem; height: 2.25rem; padding: 0; border: 0; border-radius: 0; display: inline-grid; place-items: center; background: transparent; }
.line-stepper__btn.btn:hover:not(:disabled) { background: var(--color-primary-tint); color: var(--color-primary-ink); }
.line-stepper__qty { min-width: 2rem; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.order-line.is-removing .order-line__name, .order-line.is-removing .order-line__price { text-decoration: line-through; opacity: 0.6; }
.order-line__removing { color: var(--color-danger-ink); font-weight: 600; font-size: var(--text-sm); }
.order-line__more { margin: 0; font-size: var(--text-sm); color: var(--color-text-muted); }
.order-line__price { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.order-line__remove { min-width: 2.25rem; min-height: 2.25rem; padding: 0; margin-top: -0.35rem; }
.order-summary__total { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); margin: var(--space-4) 0; font-size: 1.05rem; }
.order-summary__total strong { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.order-summary__more { margin: var(--space-3) 0 0; text-align: center; font-size: var(--text-sm); }
.order-summary__more a { color: var(--site-orange-ink); }

.order-dialog__done { padding: clamp(2.5rem, 8vw, 4rem) var(--space-5); text-align: center; }
.order-dialog__done-icon { font-size: 3.25rem; color: var(--color-success); }
.order-dialog__done .order-dialog__title { color: var(--color-text); margin: var(--space-3) 0 var(--space-2); }
.order-dialog__done h3:focus { outline: none; }
.order-dialog__bar { justify-content: space-between; background: var(--color-surface); box-shadow: 0 -6px 16px rgb(43 33 27 / 0.08); }
.order-dialog__bar p { line-height: 1.3; font-size: var(--text-sm); }
.order-dialog__bar strong { font-size: 1.1rem; font-variant-numeric: tabular-nums; }
@media (min-width: 992px) { .order-dialog__bar { display: none; } }

@media (prefers-reduced-motion: reduce) {
  .glass-fab, .photo-wall__item img, .btn.glass-btn { transition: none; }
  .photo-wall__item:hover img { transform: none; }
}
