/*
Theme Name: Les Halles Gourmandes
Description: Thème sur mesure pour le food court de La Pallice, La Rochelle.
Version: 1.4.25
Requires at least: 6.4
Requires PHP: 7.4
Text Domain: les-halles-gourmandes
*/
body.admin-bar > header { top: var(--wp-admin--admin-bar--height, 32px); }
body.halles-menu-open { overflow: hidden; }
#mobile-menu.is-open { visibility: visible; opacity: 1; transform: none; overflow-y: auto; }
html { scroll-padding-top: 6rem; }
.reveal { opacity: 1; transform: none; }
.halles-js .reveal:not(.is-visible) { opacity: 0; transform: translateY(40px); }
@media (prefers-reduced-motion: reduce) {
  .halles-js .reveal:not(.is-visible) { opacity: 1; transform: none; }
}

/* Cuisine cards keep the Lovable mosaic with a shorter feature tile. */
section:has(a[href$="#viandes"]) {
  padding-block: clamp(3.5rem, 7vw, 7rem);
}
a.photo-zoom[href$="#viandes"] {
  aspect-ratio: 16 / 10;
}
@media (min-width: 768px) {
  .grid:has(> a[href$="#viandes"]) {
    grid-template-rows: minmax(0, 1.2fr) minmax(0, 1fr);
    height: clamp(19rem, 38vw, 34rem);
  }

  .grid:has(> a[href$="#viandes"]) > a {
    aspect-ratio: auto;
    min-height: 0;
  }
}

.halles-brand-logo {
  width: auto;
  height: 3.5rem;
  object-fit: contain;
  border-radius: 50%;
}
@media (max-width: 1023px) {
  .halles-brand-logo { height: 2.7rem; }
}

body > header.halles-header-solid {
  background-color: var(--night, #122e50);
}

.halles-cuisine-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
}
.halles-cuisine-tile { aspect-ratio: 4 / 3; }
.halles-cuisine-cta { grid-column: 1 / -1; min-height: 8rem; }
@media (min-width: 768px) {
  .halles-cuisine-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .halles-cuisine-cta { grid-column: auto; }
}

/* Keep the skip link available to keyboard users only when focused. */
body > a[href="#halles-content"]:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
body > a[href="#halles-content"]:focus {
  position: fixed;
  top: var(--wp-admin--admin-bar--height, 0);
  left: .75rem;
  z-index: 100000;
  padding: .6rem 1rem;
  color: var(--night);
  background: var(--sun);
}

#bar { background-color: #fff; }
.halles-tintin-photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.halles-tintin-photos figure { align-self: start; }
@media (min-width: 768px) {
  #viandes .mt-10.grid > div { grid-column: 1 / -1; }
  .halles-viandes-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 1.75rem;
  }
}


/* Cuisine navigation and card rhythm. */
nav[aria-label="Catégories"] {
  position: sticky;
  top: var(--halles-menu-bottom, calc(4.7rem + var(--wp-admin--admin-bar--height, 0px)));
  padding-block: 0;
}
nav[aria-label="Catégories"] > div {
  align-items: center;
  min-height: 2.4rem;
}
nav[aria-label="Catégories"] a {
  display: inline-flex;
  align-items: center;
  min-height: 2.4rem;
}
@media (min-width: 1024px) {
  .halles-cuisine-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .halles-cuisine-cta > span { font-size: clamp(2.2rem, 4vw, 3.75rem); }
}

main > section:first-child > div > div > div > figure { max-width: 21rem; }
@media (min-width: 768px) {
  main > section:first-child > div > div:has(> div > figure),
  main > section:first-child > div > div:has(+ div > div > figure) {
    grid-column: span 6 / span 6;
  }
  #viandes > div,
  #a-partager > div,
  #pokes > div,
  #sushis-tartares > div,
  #bar > div,
  #chez-quentin > div { column-gap: clamp(2.75rem, 5vw, 5rem); }
  #chez-quentin > div > .halles-tintin-photos,
  #chez-quentin > div > div:last-child { grid-column: span 6 / span 6; }
}

/* Keep interior hero titles below the homepage display scale. */
body:not(.home) main > section:first-child h1:is(.display-xl, .display-xxl) {
  font-size: clamp(2.75rem, 7vw, 6.5rem);
}
@media (min-width: 768px) {
  #entrees-desserts > div { column-gap: clamp(2.75rem, 5vw, 5rem); }
}

.home main :is(h1, h2).display-xxl {
  font-size: clamp(3.75rem, 14vw, 14rem);
}

#viandes, #pokes, #entrees-desserts, #chez-quentin {
  background-color: #fff;
  color: var(--night);
  border-color: var(--ink);
}
#a-partager, #sushis-tartares, #bar {
  background-color: var(--night);
  color: var(--night-foreground);
  border-color: color-mix(in oklab, var(--sun) 50%, transparent);
}
#bar h3, #bar .text-muted-foreground { color: var(--sun); }
#bar .outline-text { -webkit-text-stroke-color: var(--sun); }
#chez-quentin .text-sun { color: var(--night); }
#chez-quentin .outline-sun { -webkit-text-stroke-color: var(--night); }

.halles-brunch-hero + #carte,
#brunch-des-halles + section {
  background-color: #fff;
  color: var(--night);
}
.halles-brunch-hero + #carte .bg-night { background-color: #fff; }
.halles-brunch-hero + #carte .bg-night-foreground\/20 { background-color: color-mix(in oklab, var(--night) 18%, transparent); }
.halles-brunch-hero + #carte .text-sun { color: var(--night); }
.halles-brunch-hero + #carte + section {
  background-color: var(--night);
  color: var(--night-foreground);
}
#brunch-des-halles + section + section {
  background-color: var(--night);
  color: var(--night-foreground);
  border-color: var(--sun);
}
#brunch-des-halles + section + section :is(h2, .text-muted-foreground) { color: var(--night-foreground); }
#brunch-des-halles + section + section .btn-night { background-color: var(--sun); color: var(--night); }

#a-partager > div > div:has(> figure),
.halles-tintin-photos {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: .875rem;
}
#a-partager figure,
.halles-tintin-photos figure {
  margin: 0;
}
#a-partager figure + figure,
.halles-tintin-photos figure + figure {
  margin-top: clamp(.8rem, 2.8vw, 2.5rem);
  transform: rotate(2deg);
}
#a-partager figure:first-child,
.halles-tintin-photos figure:first-child { transform: rotate(-2deg); }
#a-partager .mt-10.grid { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 768px) {
  #a-partager > div > div { grid-column: span 6 / span 6; }
}


.halles-brunch-hero figure { min-width: 0; }
.halles-brunch-hero figure:first-child { transform: rotate(-2deg); }
.halles-brunch-hero figure + figure {
  transform: rotate(2.5deg);
  margin: clamp(.55rem, 2vw, 1.5rem) 0 0 .875rem;
}
.halles-brunch-courses {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
}
.halles-brunch-courses > li {
  padding: clamp(1.1rem, 2.5vw, 1.65rem);
  border-top: 2px solid var(--sun);
  background-color: color-mix(in oklab, var(--night) 85%, var(--cream));
}
.halles-brunch-courses > li > p:first-child {
  margin-bottom: .6rem;
  color: var(--sun);
  font: 400 1.6rem/1.1 Anton, Impact, sans-serif;
  text-transform: uppercase;
}
@media (min-width: 768px) {
  .halles-brunch-courses { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.home main h2.display-xxl:not(:has(> .outline-text)) {
  font-size: clamp(2.75rem, 8.3vw, 7.75rem);
}

.home section:has(a.btn-night[href*="/brunch-la-rochelle"]) h2.display-xxl {
  font-size: clamp(2.75rem, 8.3vw, 7.75rem);
  line-height: .96;
}
.home section:has(a.btn-night[href*="/brunch-la-rochelle"]) h2.display-xxl > br { display: none; }
.home section:has(a.btn-night[href*="/brunch-la-rochelle"]) h2.display-xxl > .outline-text {
  display: block;
  margin-top: .08em;
  font-size: inherit;
  line-height: inherit;
}

body > footer > div > div.mt-16 { margin-top: 0; }

.halles-local-links {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.75rem;
  max-width: 1500px;
  margin: 1.5rem auto 0;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
  font-size: .9rem;
}

.halles-agenda-row {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  align-items: center;
  gap: .75rem 1.25rem;
  padding: 1rem .5rem;
  border-bottom: 2px solid var(--night);
}
.halles-agenda-row:hover { background: var(--night); color: var(--cream); }
.halles-agenda-row > :last-child { grid-column: 2; }
.halles-agenda-thumb { width: 100%; aspect-ratio: 4 / 5; object-fit: contain; }
.halles-agenda-poster { width: 100%; height: clamp(13rem, 25vw, 22rem); object-fit: contain; background: var(--night); }
.halles-event-poster { width: 100%; max-height: 42rem; object-fit: contain; }
@media (min-width: 768px) {
  .halles-agenda-row { grid-template-columns: 5rem minmax(0, 1.4fr) minmax(0, 1fr); }
  .halles-agenda-row > :last-child { grid-column: auto; }
}

.halles-bar-note {
  grid-column: 1 / -1;
  padding-top: .9rem;
  border-top: 1px solid color-mix(in oklab, var(--cream) 35%, transparent);
}
@media (min-width: 768px) {
  #pokes .mt-10.grid { grid-template-columns: minmax(0, 1fr); }
  #pokes .mt-10.grid ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: clamp(1.5rem, 3vw, 3rem);
  }
}


@media (max-width: 767px) {
  main section > div:has(> .halles-cuisine-row) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
  }

  main section > div:has(> .halles-cuisine-row) > :is(.halles-cuisine-row, .grid-cols-2) {
    display: contents;
  }

  main section > div:has(> .halles-cuisine-row) > .reveal {
    grid-column: 1 / -1;
    margin-bottom: 2.75rem;
  }

  main section > div:has(> .halles-cuisine-row) > :is(.halles-cuisine-row, .grid-cols-2) > a.photo-zoom:not([href$="#viandes"]) {
    aspect-ratio: 1;
    min-width: 0;
  }

  main .grid-cols-6:has(img[src*="/accueil-19.webp"]) > .col-span-3 {
    aspect-ratio: 1;
    min-width: 0;
  }
}

.halles-mobile-booking {
  position: fixed;
  bottom: max(.75rem, env(safe-area-inset-bottom));
  left: 50%;
  z-index: 40;
  transform: translateX(-50%);
}

.halles-mobile-booking .btn-sun { box-shadow: 0 4px 18px #101c3550; }

@media (max-width: 767px) {
  html, body { overflow-x: clip; }

  main :is(h1, h2, h3, address),
  footer :is(address, a) { overflow-wrap: anywhere; }

  main form :is(label, input, select, textarea) { min-width: 0; }
  main form :is(input, select, textarea) { max-width: 100%; }
}

.flatpickr-day.flatpickr-disabled { text-decoration: line-through; }

.halles-footer-address-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .65rem .9rem;
  margin-top: .875rem;
}
.halles-footer-bottom,
.halles-footer-legal {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .5rem 1rem;
}
.halles-footer-bottom a { color: inherit; font-size: inherit; }
.halles-footer-bottom a:hover { text-decoration: underline; }
.halles-footer-credit { margin-inline-start: auto; }


.halles-legal-content article {
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.halles-legal-content article > :is(h2, h3, p, ul, ol),
.halles-legal-content .halles-cookie-policy > :is(h2, h3, p) {
  max-width: 76ch;
}
.halles-legal-content article > :is(h2, h3) {
  margin: 2rem 0 .5rem;
  font-family: Anton, sans-serif;
  font-size: clamp(1.65rem, 3vw, 2.4rem);
  line-height: 1.2;
}
.halles-legal-content article > :first-child { margin-top: 0; }
.halles-legal-content article > p + p { margin-top: 1rem; }
.halles-legal-content article > p > strong:first-child {
  display: inline-block;
  margin-bottom: .25rem;
}
.halles-legal-content article :is(ul, ol) { padding-left: 1.4em; }
.halles-legal-content article ul { list-style: disc; }
.halles-legal-content article ol { list-style: decimal; }
.halles-legal-content article a { text-decoration: underline; text-underline-offset: .18em; }
.halles-legal-content .halles-cookie-policy { border-top-color: var(--sun); }

.halles-legal-hero { padding-top: calc(clamp(8rem, 13vw, 11rem) + var(--wp-admin--admin-bar--height, 0px)); }

body main:has(.halles-local-step) > section:first-child h1.display-xl {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
}
main:has(.halles-local-step) h2.display-lg { font-size: clamp(1.8rem, 3vw, 2.85rem); }
.halles-local-step-1 { background: var(--cream); color: var(--night); }
.halles-local-step-2 { background: var(--night); color: var(--night-foreground); }
.halles-local-step-2 .tag { color: var(--sun); }
.halles-local-step-2 .outline-text { -webkit-text-stroke-color: var(--sun); }
.halles-local-step-inner { display: grid; gap: 2rem; align-items: center; }
.halles-local-step-text { min-width: 0; }
.halles-local-step-text span[aria-hidden="true"] { font-size: clamp(2.3rem, 4vw, 3.5rem); }
.halles-local-step-photo { width: min(100%, 24rem); margin: auto; padding: .6rem .6rem 1.65rem; }
.halles-local-step-photo img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.halles-local-step-2 .btn-night { background: var(--sun); color: var(--night); }
@media (min-width: 768px) {
  .halles-local-step-inner { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3rem; }
  .halles-local-step-2 .halles-local-step-photo { grid-column: 1; grid-row: 1; }
  .halles-local-step-2 .halles-local-step-text { grid-column: 2; grid-row: 1; }
}


body main > section.halles-local-example h1.display-xl {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
}
main:has(.halles-local-example) h2:is(.display-lg, .display-xl) {
  font-size: clamp(1.8rem, 3vw, 3.2rem);
}
.halles-local-lovable-step .font-display:is(.outline-text, .outline-sun) {
  font-size: clamp(2.6rem, 5vw, 4.25rem);
}
.halles-local-lovable-step .flex.items-end > div { min-width: 0; }
.halles-local-lovable-step li { min-width: 0; }
.halles-local-lovable-step .order-1 { order: 1; }
.halles-local-lovable-step .order-2 { order: 2; }
@media (min-width: 1024px) {
  .halles-local-lovable-step .lg\:order-1 { order: 1; }
  .halles-local-lovable-step .lg\:order-2 { order: 2; }
}
