/* Shared visual treatment for the deck, its index and account pages. */
:root {
  --paper:#f5f4ed;
  --surface:#fffef8;
  --ink:#242823;
  --rule:#c9cbc0;
  --section-ink:#e98a4e;
  --section-wash:color-mix(in srgb,var(--section-ink) 12%,var(--surface));
  --action-cut:polygon(0 0,100% 0,100% calc(100% - 8px),calc(100% - 8px) 100%,0 100%);
  --panel-edge:linear-gradient(112deg,var(--section-ink) 0 42px,var(--ink) 42px 100%);
  --corner-cut:clamp(17px,2.1vw,30px);
}
.top-inner {border-bottom:2px solid var(--ink)}
.theater::before {
  content:"";position:absolute;inset:3% 0 0;pointer-events:none;
  background:color-mix(in srgb,var(--section-ink) 15%,var(--paper));
  clip-path:polygon(0 53%,100% 14%,100% 91%,0 100%);
}
.card,.card[data-slot="0"] {
  border-radius:0;box-shadow:none;
  clip-path:polygon(0 0,calc(100% - var(--corner-cut)) 0,100% var(--corner-cut),100% 100%,0 100%);
}
.card::before {
  content:"";position:absolute;right:0;top:0;width:var(--corner-cut);height:var(--corner-cut);
  z-index:2;pointer-events:none;
  background:linear-gradient(45deg,color-mix(in srgb,var(--section-ink) 64%,var(--surface)) 49%,var(--ink) 50%,transparent 53%);
}
.card .copy {position:relative;background:var(--surface)}
.copy::before {
  content:"";position:absolute;left:0;right:0;bottom:calc(100% - 1px);height:clamp(10px,2.3vh,20px);
  background:var(--surface);clip-path:polygon(0 100%,100% 0,100% 100%);pointer-events:none;
}
.copy h2,.div-head h2,.section-name {
  font-family:var(--sans);font-weight:700;letter-spacing:-.055em;line-height:1.04;
}
.copy h2 {font-size:clamp(24px,min(3vw,4.2vh),39px)}
.div-head h2 {font-size:clamp(30px,min(4.4vw,6.6vh),58px)}
.ingredient-heading {display:flex;align-items:center;gap:2px}
.ingredient-heading h2 {min-width:0;margin:0}
.ingredient-info-button {
  flex:0 0 44px;height:44px;display:grid;place-items:center;
  border:0;padding:0;background:transparent;color:var(--ink);
}
.ingredient-info-button span {
  display:grid;place-items:center;width:20px;height:20px;border:1.5px solid currentColor;
  border-radius:50%;font:700 15px/1 Georgia,serif;
}
.ingredient-info-button:hover span,.ingredient-info-button:focus-visible span {background:var(--ink);color:var(--surface)}
#ingredient-note {margin:12px 0 0;font:1rem/1.55 var(--sans)}
#ingredient-guide {font-size:.875rem;text-underline-offset:3px}
#ingredient-guide:not([hidden]) {display:inline-flex;align-items:center;gap:.3em;min-height:44px;margin-top:8px}
.section-name {font-size:clamp(22px,2.8vw,40px)}
.dot,.picker-option i {transform:skewX(-11deg);border-radius:1px}
.pair {font-weight:600}
.folio,.position {font-family:ui-monospace,monospace}
/* Primary actions share one cut and an inset ring that survives clipping. */
.account-trigger,.recipes-btn,.div-choices button.browse-dishes {
  clip-path:var(--action-cut);border:0;border-radius:0;padding-inline:16px 21px;
  background:var(--ink);color:var(--surface);
}
.account-trigger:hover,.recipes-btn:hover,.div-choices button.browse-dishes:hover {background:#40483e}
.account-trigger:focus-visible,.recipes-btn:focus-visible,.div-choices button.browse-dishes:focus-visible {
  outline:2px solid white;outline-offset:-4px;
}
.div-choices button {border-radius:2px}
.div-choices i,#hits i {transform:skewX(-11deg);border-radius:1px}
.ingredient-chip {background:linear-gradient(171deg,transparent 24%,var(--chip-color) 24.2%)}
/* Search, letters and lists use the same ink rules and section color. */
.search-field,#picker-search,#account-email {border-radius:2px}
.search-field:focus-within,#picker-search:focus-visible,#account-email:focus-visible {
  outline:2px solid var(--ink);outline-offset:1px;border-color:var(--surface);
}
.search-field input:focus-visible {outline:none}
.search-field kbd,.index-fan {border-radius:1px}
.transport .arrow,.close,#hit-pages button,.picker-more {border-radius:2px}
.index-fan .fan-leaf.selected::before {
  clip-path:var(--action-cut);border-radius:0;box-shadow:inset 0 -4px var(--ingredient);
  font:700 1rem/1 var(--sans);
}
#results,dialog,.alphabet-sheet,#credit-popover,.account-return section {
  border-radius:2px;border:1px solid var(--rule);border-top:0;
  background:var(--panel-edge) top left / 100% 4px no-repeat,var(--surface);
  box-shadow:0 12px 32px #252a201a;
}
#results {padding-top:8px}
#hits button {border-radius:0}
#hits button:hover,#hits button[aria-selected=true],.picker-option:hover,.picker-more:hover {
  background:var(--section-wash);
}
#hits button[aria-selected=true] {box-shadow:inset 2px 0 var(--ink)}
.hitinfo b,#recipe-links b {font:700 1.05rem/1.25 var(--sans);letter-spacing:-.025em}
#hit-range,#index-count {font-family:ui-monospace,monospace;font-variant-numeric:tabular-nums}
.alphabet-sheet .letters {gap:3px}
.alphabet-sheet .letters button {border-radius:1px;font:600 1.2rem/1 var(--sans)}
.alphabet-sheet .letters button.active {clip-path:var(--action-cut)}
.alphabet-sheet .letters button.active:focus-visible {outline-color:white;outline-offset:-4px}
.alphabet-sheet .letters button:hover:not(:disabled):not(.active) {background:var(--section-wash)}
.dialog-head,.alphabet-sheet-head {gap:12px}
.close {flex:none;width:38px;height:38px}
dialog h2,.alphabet-sheet-head h2,.account-return h1 {
  font:700 clamp(1.65rem,3.8vw,2.25rem)/1.07 var(--sans);letter-spacing:-.05em;overflow-wrap:anywhere;
}
.small-title,#dish-sources h3 {font-weight:700;letter-spacing:.025em}
#recipe-note {font-size:1rem}
#recipe-links a {padding-inline:6px}
#recipe-links a:hover,#recipe-links a:focus-visible {background:var(--section-wash)}
#recipe-links a:focus-visible {outline-offset:-2px}
#source-links a,#original,.account-privacy {font-size:.875rem}
#account-status:not(:empty) {padding:10px 12px;border-left:3px solid var(--ink);background:var(--section-wash)}
.account-return {overflow:auto}
.account-return section {width:min(100%,27rem);padding:clamp(22px,5vw,36px)}
.account-return h1 {margin:0 0 12px}
.account-return p {color:var(--muted);font-size:1rem}
@media(min-width:831px) {
  .catalog {border-right:1px solid var(--rule)}
  .spread {margin-left:clamp(12px,2vw,32px)}
}
@media(max-width:600px) {
  .account-trigger {padding-inline:12px 16px}
  .section-name {font-size:clamp(22px,6.5vw,29px)}
  .copy h2 {font-size:clamp(23px,min(7.5vw,4.6vh),33px)}
  .div-head h2 {font-size:clamp(32px,9vw,45px)}
  .theater::before {inset:0;clip-path:polygon(0 22%,100% 4%,100% 83%,0 98%)}
}
@media(orientation:landscape) and (max-height:510px) {
  .copy::before {inset:0 calc(100% - 1px) 0 auto;width:10px;height:auto;clip-path:polygon(100% 0,100% 100%,0 100%)}
  .copy h2 {font-size:20px}
  .section-name,.div-head h2 {font-size:24px}
}

.paint-chip {display:inline-block;width:40px;height:20px;object-fit:contain;flex:none}
.paint-chip.glazed {position:relative;isolation:isolate}
.glazed::before,.glazed::after,.glazed .paint-grain {
  content:"";position:absolute;inset:0;pointer-events:none;
  -webkit-mask:var(--mask) center / contain no-repeat;
  mask:var(--mask) center / contain no-repeat;
}
.glazed::before {--mask:url("paint/first.png");background:var(--first)}
.glazed::after {--mask:url("paint/second.png");background:var(--second);mix-blend-mode:multiply}
.glazed .paint-grain {--mask:url("paint/pigment.png");background:#675342;z-index:1;mix-blend-mode:multiply}

.search-wrap {display:flex;align-items:center;gap:10px;width:clamp(300px,38vw,470px)}
.search-field {flex:1;min-width:0}
.edition-switch {display:inline-flex;flex:none;border:1px solid var(--rule);border-radius:3px;padding:2px;gap:2px}
.edition-switch a {display:grid;place-items:center;min-height:32px;padding:0 10px;font:600 13px/1 var(--sans);text-decoration:none;border-radius:1px}
.edition-switch a[aria-current] {background:var(--ink);color:var(--surface)}
@media(max-width:600px) {.search-wrap {width:100%;gap:7px}.edition-switch a {min-height:30px;padding:0 9px}}
.picture.aura-picture {position:relative;overflow:hidden;isolation:isolate;pointer-events:auto;background:radial-gradient(ellipse at 50% 56%,var(--lit),var(--shade) 90%)}
.aura-picture canvas {position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
.aura-picture img {position:absolute;left:8%;top:20%;width:84%;height:68%;object-fit:contain;filter:drop-shadow(0 8px 7px #180f162d);pointer-events:none}
.aura-picture button {position:absolute;z-index:1;top:3%;background:transparent;border:0;color:#fff4db;text-shadow:0 1px 5px #23151f}
.aura-picture .aura-play {right:5%;width:40px;height:40px;display:grid;place-items:center}
.aura-play::before {content:"";width:6px;height:9px;border-inline:2px solid currentColor;box-sizing:content-box}
.aura-play.paused::before {width:0;height:0;border:5px solid transparent;border-left:8px solid currentColor;border-right:0}
#aura-brief {line-height:1.55}
#aura-inks {display:flex;gap:2px;margin:15px 0 2px}
#aura-inks i {width:42px;height:8px}
.aura-picture img.original-art {mask-image:radial-gradient(ellipse closest-side,#000 76%,transparent)}
#aura-details {margin-top:1rem}
#aura-details summary {cursor:pointer}

/* Keep title glyphs (especially g, p, q and y) clear of the clipping edge.
   Let the illustration yield space to the complete title on portrait cards. */
.copy h2 {
  line-height:1.16;
  flex-shrink:0;
  display:block;
  overflow:visible;
  -webkit-line-clamp:unset;
}
@media(orientation:landscape) and (max-height:510px) {
  .copy h2 {
    display:-webkit-box;
    -webkit-line-clamp:3;
    overflow:hidden;
    padding-bottom:.12em;
  }
}
#opening{position:absolute;inset:0;text-align:center}
#opening img{height:70%;max-width:100%;object-fit:contain}
#contents{line-height:1.55}
#contents h1,#opening h2{font:normal 2rem/1.08 var(--serif);margin:1rem 0}
#contents article{display:flow-root;border-top:1px solid var(--rule);margin:1.4rem 0;padding-top:1rem}
#contents article img{float:left;width:26%;aspect-ratio:1;object-fit:cover;margin:0 1rem .6rem 0}
#contents article h2{font-size:1.5rem;margin:0}
#contents article p{margin:.6rem 0}
#contents .reference{display:block;clear:both;font-size:.85rem;padding:.2rem 0}
#contents nav a{display:inline-block;padding:.2rem 0}

.cardfoot:has(.dish-page) {display:flex;align-items:center;gap:clamp(8px,3vw,18px)}
.cardfoot .dish-page {display:inline-flex;align-items:center;min-height:40px;white-space:nowrap;font-size:.875rem;color:inherit;text-underline-offset:3px}
#contents .dish-page {font-weight:600}
@media(max-width:390px){
  .cardfoot:has(.dish-page) .recipes-btn {padding-inline:10px}
}

.expand-dish {
  position:absolute;top:3%;left:3%;width:44px;height:44px;
  display:grid;place-items:center;color:#fff4db;z-index:1;
}
.expand-dish::before {
  content:"";width:17px;height:17px;border:2px solid;
  clip-path:polygon(0 0,36% 0,36% 36%,64% 36%,64% 0,100% 0,100% 36%,64% 36%,64% 64%,100% 64%,100% 100%,64% 100%,64% 64%,36% 64%,36% 100%,0 100%,0 64%,36% 64%,36% 36%,0 36%);
}
.expand-dish:hover,.expand-dish:focus-visible {background:#ffffff1a;border-radius:50%;outline-color:#fff4db}
.card > .expand-dish {
  top:6px;left:6px;color:var(--ink);border-radius:50%;
  background:radial-gradient(circle,var(--surface) 0 52%,transparent 55%);
}
.card > .expand-dish:hover,.card > .expand-dish:focus-visible {
  color:var(--surface);outline-color:var(--ink);
  background:radial-gradient(circle,var(--ink) 0 55%,transparent 58%);
}
.card.side .expand-dish {display:none}
@view-transition {navigation:auto}
@media(prefers-reduced-motion:no-preference) {
  .card[data-slot="0"] > img.picture,
  .card[data-slot="0"] .aura-picture:has(.expand-dish) img {view-transition-name:dish-art}
  ::view-transition-group(root),::view-transition-group(dish-art) {animation-duration:.6s;animation-timing-function:ease-in-out}
}
@media(prefers-reduced-motion:reduce) {
  ::view-transition-group(*) {animation-duration:0s}
}

.recipe-credit {margin:.35rem 0 .45rem;border-left:2px solid currentColor;padding-left:.7rem;font:14px/1.35 var(--sans);overflow-wrap:anywhere}
.recipe-credit > * {display:block}
.recipe-credit a {color:inherit;text-decoration:underline;text-underline-offset:2px}
.recipe-credit > span {font-size:.94em;margin-top:2px}
.card.side .recipe-credit {visibility:hidden}
.copy:has(.recipe-credit) .card-note {display:none}
.copy:has(.recipe-credit) {overflow-y:auto}
@media(max-height:740px){.copy .recipe-credit{font-size:13px;margin-block:2px}.copy:has(.recipe-credit) h2{font-size:22px}}

