/* Accords — /accords/ (search + filters + illustrated cards) and the dish
   pages /accords/<plat>/. Loaded only there (templates/e/_accords.j2).
   The bottle is the real cutout laid on the dish-only illustration, with the
   geometry of sync_journal.with_bottle: centre x 80 %, base 93 %, height 68 %. */

.acc-page { max-width: 1240px; margin: 0 auto; padding: 3rem 1.4rem 4.5rem; }
.acc-head { text-align: center; max-width: 46rem; margin: 0 auto 2.2rem; }
.acc-head h1 { font-size: clamp(2.1rem, 5vw, 3.5rem); }
.acc-head .lede { margin-top: .9rem; }
/* under the banner the title is on the photo: the lede opens the page */
.acc-page-hero { padding-top: 2.4rem; }
.acc-page-hero .acc-head .lede { margin-top: 0; }
/* the banner is two photos side by side: on a narrow screen the crop
   would land on the seam, so keep the left one (the Plantier) */
@media (max-width: 760px) { .acc-hero img { object-position: 24% 50%; } }

/* ── filter bar ───────────────────────────────────────────────────────── */
/* not sticky: with seven wines the bar is ~300 px tall. A filter chosen
   further down scrolls back to the results instead (accords.js toTop). */
.acc-bar { display: grid; gap: .75rem; padding: 1rem 0 .8rem; margin-bottom: 2.2rem;
  border-bottom: 1px solid #e3d5bd; }
.acc-search { display: flex; align-items: center; gap: .65rem; width: 100%; max-width: 32rem;
  margin: 0 auto .3rem; border-bottom: 1px solid var(--ink); }
.acc-search svg { width: 1.15rem; height: 1.15rem; flex: none; fill: none; stroke: currentColor;
  stroke-width: 1.6; opacity: .7; }
.acc-search input { flex: 1; min-width: 0; border: 0; background: none; color: inherit;
  font-family: var(--serif); font-size: 1.3rem; padding: .35rem 0; outline: none; }
.acc-search input::placeholder { color: inherit; opacity: .45; font-style: italic; }
.acc-search:focus-within { border-bottom-color: var(--wine); }
.acc-facet { display: flex; align-items: center; gap: .9rem; min-width: 0; }
.acc-flabel { flex: none; width: 6.5rem; font-size: .66rem; letter-spacing: .2em;
  text-transform: uppercase; opacity: .65; }
.acc-chips { display: flex; flex-wrap: wrap; gap: .4rem; min-width: 0; }
.acc-chip { display: inline-flex; align-items: center; gap: .45em; font: inherit; font-size: .8rem;
  line-height: 1.2; color: var(--ink); background: transparent; border: 1px solid #d9c7a8;
  border-radius: 2em; padding: .38em .95em; cursor: pointer; white-space: nowrap;
  transition: background .3s, color .3s, border-color .3s; }
.acc-chip:hover { border-color: var(--ink); }
.acc-chip:focus-visible { outline: 2px solid var(--wine); outline-offset: 2px; }
.acc-chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.acc-chip-wine { padding: .2em .95em .2em .45em; }
.acc-chip-wine img { height: 1.95rem; width: auto; transition: transform .45s cubic-bezier(.2, .8, .2, 1); }
.acc-chip-wine:hover img, .acc-chip-wine[aria-pressed="true"] img { transform: translateY(-2px) rotate(-5deg); }
.acc-chip small { opacity: .6; font-size: .9em; }
.acc-status { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  min-height: 1.7rem; }
.acc-count { font-family: var(--serif); font-style: italic; font-size: 1.05rem; }
.acc-clear { border: 0; background: none; color: var(--wine); font: inherit; font-size: .78rem;
  letter-spacing: .14em; text-transform: uppercase; cursor: pointer; text-decoration: underline;
  text-underline-offset: .25em; }

/* ── cards ────────────────────────────────────────────────────────────── */
.acc-grid { list-style: none; position: relative; display: grid; gap: 2.6rem 1.8rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.acc-grid-3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.acc-link { display: block; text-decoration: none; color: inherit; }
.acc-ill { position: relative; display: block; aspect-ratio: 3 / 2; overflow: hidden;
  border-radius: 3px; background: var(--paper); }
.acc-ill picture { display: block; width: 100%; height: 100%; }
.acc-ill picture img { width: 100%; height: 100%; object-fit: cover;
  transition: transform 1.1s cubic-bezier(.2, .7, .2, 1); }
.acc-link:hover .acc-ill picture img, .acc-link:focus-visible .acc-ill picture img { transform: scale(1.035); }
.acc-btl { position: absolute; left: 80%; bottom: 7%; height: 68%; aspect-ratio: 221 / 900;
  transform: translateX(-50%); pointer-events: none; }
.acc-btl::before { content: ""; position: absolute; left: -35%; right: -35%; bottom: -5%; height: 9%;
  background: radial-gradient(closest-side, rgba(60, 30, 20, .3), rgba(60, 30, 20, 0));
  transition: opacity .5s; }
.acc-b { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
  opacity: 0; transform: translateY(-7%);
  transition: opacity .55s ease, transform .75s cubic-bezier(.2, .8, .2, 1); }
.acc-b.is-on { opacity: 1; transform: none; }
.acc-link:hover .acc-b.is-on { transform: translateY(-3%); }
.acc-meta { display: block; margin-top: 1rem; font-size: .66rem; letter-spacing: .18em;
  text-transform: uppercase; opacity: .62; }
.acc-name { font-family: var(--serif); text-transform: none; letter-spacing: normal;
  font-size: 1.4rem; line-height: 1.2; margin: .3rem 0 .25rem; transition: color .3s; }
.acc-link:hover .acc-name { color: var(--wine); }
.acc-wine { font-family: var(--serif); font-style: italic; color: var(--wine); }
.acc-link:focus-visible { outline: 2px solid var(--wine); outline-offset: 6px; }

/* entrance: the card rises, then its bottle is set down on the table.
   `acc-js` is set in <head>, so nothing flashes; the fail-safe animation shows
   the cards anyway if accords.js never runs. */
.acc-js .acc-card { opacity: 0; transform: translateY(18px);
  animation: acc-failsafe .01s 3.5s forwards; }
.acc-js .acc-card.is-in { opacity: 1; transform: none; animation: none;
  transition: opacity .8s ease var(--d, 0ms), transform 1s cubic-bezier(.2, .7, .2, 1) var(--d, 0ms); }
.acc-js .acc-card:not(.is-in) .acc-b.is-on { opacity: 0; transform: translateY(-14%); }
.acc-js .acc-card:not(.is-in) .acc-btl::before { opacity: 0; }
.acc-js .acc-card.is-in .acc-b.is-on { transition-delay: calc(var(--d, 0ms) + 350ms); }
@keyframes acc-failsafe { to { opacity: 1; transform: none; } }

.accords-note { margin-top: 3.5rem; text-align: center; font-size: .82rem; opacity: .75; }

/* ── dish page ────────────────────────────────────────────────────────── */
.acd { max-width: 1080px; margin: 0 auto; padding: 2rem 1.4rem 4.5rem; }
.acd-crumb a { font-size: .74rem; letter-spacing: .16em; text-transform: uppercase;
  text-decoration: none; opacity: .7; }
.acd-crumb a:hover { opacity: 1; color: var(--wine); }
.acd-head { text-align: center; margin: 1.6rem auto 2rem; max-width: 46rem; }
.acd-eyebrow { font-size: .7rem; letter-spacing: .24em; text-transform: uppercase; opacity: .7; }
.acd-head h1 { font-size: clamp(2rem, 5vw, 3.4rem); margin: .5rem 0 .4rem; }
.acd-sub { font-family: var(--serif); font-style: italic; font-size: 1.15rem; opacity: .85; }
/* the answer to the page's question, first thing under the dish name */
.acd-answer { font-family: var(--serif); font-size: 1.22rem; line-height: 1.55;
  margin: 1.1rem auto 0; max-width: 40rem; }
.acd-ill { border-radius: 4px; }
/* the illustration is washed in from the left, then the bottle is set down */
.acd-ill picture { -webkit-mask-image: linear-gradient(90deg, #000 40%, transparent 60%);
  mask-image: linear-gradient(90deg, #000 40%, transparent 60%);
  -webkit-mask-size: 250% 100%; mask-size: 250% 100%;
  -webkit-mask-position: 0 0; mask-position: 0 0;
  animation: acd-wash 1.6s cubic-bezier(.3, .6, .2, 1) both; }
@keyframes acd-wash {
  from { -webkit-mask-position: 100% 0; mask-position: 100% 0; }
  to { -webkit-mask-position: 0 0; mask-position: 0 0; } }
.acd-ill .acc-b { animation: acd-set .9s cubic-bezier(.2, .8, .2, 1) 1.15s both; }
.acd-ill .acc-btl::before { animation: acd-shadow .9s ease 1.25s both; }
@keyframes acd-set { from { opacity: 0; transform: translateY(-16%); } to { opacity: 1; transform: none; } }
@keyframes acd-shadow { from { opacity: 0; } to { opacity: 1; } }

.acd-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 3.2rem;
  margin-top: 2.8rem; align-items: start; }
.acd-text p { font-family: var(--serif); font-size: 1.15rem; line-height: 1.75; margin-bottom: 1.1em; }
.acd-text p:first-child::first-letter { font-size: 3.2em; line-height: .8; float: left;
  margin: .08em .1em 0 0; color: var(--wine); }
.acd-wine { position: sticky; top: calc(var(--hd-h) + 1.5rem); display: grid;
  grid-template-columns: 58px 1fr; gap: 1.1rem; align-items: center; padding: 1.4rem 1.3rem;
  border: 1px solid #e3d5bd; border-radius: 4px; background: #fbf5ec; }
.acd-wine-b .acc-b, .acd-also .acc-b { position: static; opacity: 1; transform: none;
  width: auto; transition: transform .45s cubic-bezier(.2, .8, .2, 1); }
.acd-wine-b .acc-b { height: 236px; }
.acd-wine-b:hover .acc-b, .acd-also a:hover .acc-b { transform: translateY(-4px) rotate(-3deg); }
.acd-wine-h { font-size: .66rem; letter-spacing: .2em; text-transform: uppercase; opacity: .65; }
.acd-wine h2 { font-family: var(--serif); text-transform: none; letter-spacing: normal;
  font-size: 1.5rem; line-height: 1.15; margin: .25rem 0 .5rem; }
.acd-wine h2 a { text-decoration: none; }
.acd-wine h2 a:hover { color: var(--wine); }
.acd-wine p { font-size: .86rem; }
.acd-wine-cp { opacity: .75; }
.acd-wine-sv { margin: .6rem 0 1rem; }
.acd-wine-sv span { font-size: .66rem; letter-spacing: .18em; text-transform: uppercase; opacity: .65;
  margin-right: .4em; }
.acd-wine .bt { padding: .7em 1.4em; font-size: .7rem; }

.acd-also, .acd-rel { margin-top: 4rem; }
.acd-also h2, .acd-rel h2 { text-align: center; font-size: clamp(1.5rem, 3vw, 2.1rem); margin-bottom: 1.6rem; }
.acd-also ul { list-style: none; display: grid; gap: 0 2rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.acd-also a { display: grid; grid-template-columns: 34px 1fr; gap: 1rem; align-items: center;
  padding: 1rem 0; border-top: 1px solid #e3d5bd; text-decoration: none; }
.acd-also .acc-b { height: 138px; }
.acd-also b { display: block; font-family: var(--serif); font-size: 1.2rem; font-weight: 600; }
.acd-also a:hover b { color: var(--wine); }
.acd-also em { display: block; font-size: .88rem; line-height: 1.5; opacity: .85; margin-top: .2rem; }

@media (max-width: 860px) {
  .acd-body { grid-template-columns: 1fr; gap: 2rem; }
  .acd-wine { position: static; }
}
@media (max-width: 700px) {
  .acc-page { padding-top: 2rem; }
  /* each row of chips scrolls sideways instead of wrapping */
  .acc-facet { flex-direction: column; align-items: stretch; gap: .35rem; }
  .acc-flabel { width: auto; }
  .acc-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px;
    margin-right: -1.4rem; padding-right: 1.4rem; }
  .acc-chips::-webkit-scrollbar { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .acc-js .acc-card, .acc-js .acc-card.is-in { opacity: 1; transform: none; transition: none; animation: none; }
  .acc-js .acc-card:not(.is-in) .acc-b.is-on, .acc-js .acc-card:not(.is-in) .acc-btl::before { opacity: 1; transform: none; }
  .acc-b, .acc-ill picture img, .acc-chip-wine img { transition: none; }
  .acd-ill picture, .acd-ill .acc-b, .acd-ill .acc-btl::before { animation: none; }
  .acd-ill picture { -webkit-mask-image: none; mask-image: none; }
}
