/* The Saucy Librarian — "Sunset Strip Diner" */

@font-face {
  font-family: "Jost";
  src: url("../fonts/Jost-Variable.b6f232250aa2.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Yellowtail";
  src: url("../fonts/Yellowtail.7210d48b2b78.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --cream: #F5EFE1;
  --card: #FBF7EE;
  --espresso: #3B2A22;
  --shadow: #2a1f19;
  --cherry: #C8342B;
  --cherry-dark: #A62821;
  --turquoise: #2E8B94;
  --turquoise-dark: #236C73;
  --butter: #F3C348;
  --muted: #6E5A4E;
  --line: #D9CDB6;
  --radius: 14px;
  --sans: "Jost", "Futura", "Avenir Next", "Century Gothic", system-ui, sans-serif;
  --script: "Yellowtail", "Brush Script MT", cursive;
}

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

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

body {
  margin: 0;
  background: var(--cream);
  color: var(--espresso);
  font: 400 1.0625rem/1.6 var(--sans);
  overflow-wrap: break-word;  /* long words and links wrap instead of running off a phone screen */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

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

a { color: var(--turquoise-dark); text-underline-offset: 3px; }
a:hover { color: var(--cherry); }

h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; font-weight: 600; letter-spacing: .01em; overflow-wrap: anywhere; }
h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }

.script { font-family: var(--script); font-weight: 400; color: var(--cherry); letter-spacing: 0; }
h1.script, h2.script { font-size: clamp(2.2rem, 5vw, 3.2rem); line-height: 1.1; }

.eyebrow {
  font-size: .8rem; font-weight: 600; letter-spacing: .28em; text-transform: uppercase;
  color: var(--turquoise-dark);
}

.muted { color: var(--muted); }
.small { font-size: .9rem; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding-inline: 20px; }
main { flex: 1; padding-block: 28px 56px; }

/* ---- Header ---------------------------------------------------------- */

.site-header { background: var(--cherry); color: var(--cream); border-bottom: 4px solid var(--espresso); }
.site-header .wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding-block: 10px; }

.brand { display: flex; align-items: center; gap: 10px; color: var(--cream); text-decoration: none; }
.brand img { width: 38px; height: 42px; }
.brand-name { display: flex; flex-direction: column; line-height: 1; }
.brand-name .the { font-size: .6rem; letter-spacing: .3em; font-weight: 600; color: var(--butter); }
.brand-name .saucy { font-family: var(--script); font-size: 1.7rem; color: var(--butter); margin: -2px 0 -4px; }
.brand-name .lib { font-weight: 700; letter-spacing: .12em; font-size: .85rem; }
.brand:hover { color: var(--cream); }

.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-left: auto; }
.nav a, .nav button.linklike {
  color: var(--cream); text-decoration: none; font-weight: 500; font-size: .95rem;
  letter-spacing: .06em; text-transform: uppercase; padding: 6px 10px; border-radius: 999px;
}
.nav a:hover, .nav button.linklike:hover { background: rgba(0, 0, 0, .18); color: #fff; }
.nav a.cta { background: var(--butter); color: var(--espresso); font-weight: 600; }
.nav a.cta:hover { background: #ffd66a; color: var(--espresso); }
.nav form { display: inline; margin: 0; }

.nav-toggle { display: none; }

@media (max-width: 760px) {
  .nav-toggle {
    display: inline-flex; align-items: center; gap: 4px; margin-left: auto; min-height: 40px; background: none;
    border: 2px solid var(--cream); color: var(--cream); border-radius: 10px; padding: 4px 12px; font: 600 .9rem var(--sans);
    letter-spacing: .1em; text-transform: uppercase; cursor: pointer;
  }
  .nav { display: none; width: 100%; flex-direction: column; align-items: stretch; margin: 0; padding-bottom: 6px; }
  .nav.open { display: flex; }
  .nav a, .nav button.linklike { text-align: left; width: 100%; }
}

/* ---- Buttons & forms -------------------------------------------------- */

.btn, button.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 .95rem var(--sans); letter-spacing: .08em; text-transform: uppercase;
  padding: 10px 18px; border-radius: 999px; border: 3px solid var(--espresso);
  background: var(--cherry); color: var(--cream); text-decoration: none; cursor: pointer;
  box-shadow: 3px 3px 0 var(--espresso); transition: transform .08s, box-shadow .08s;
}
.btn:hover { background: var(--cherry-dark); color: var(--cream); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--espresso); }
.btn.secondary { background: var(--turquoise-dark); }
.btn.secondary:hover { background: #1B5358; }
.btn.plain { background: var(--card); color: var(--espresso); }
.btn.plain:hover { background: var(--butter); }
.btn.small { padding: 6px 12px; font-size: .8rem; box-shadow: 2px 2px 0 var(--espresso); border-width: 2px; }
.btn.danger { background: var(--espresso); }

button.linklike {
  background: none; border: 0; padding: 0; font: inherit; color: var(--turquoise-dark);
  text-decoration: underline; cursor: pointer;
}

.form-card { max-width: 720px; }
.field { margin-bottom: 18px; }
.field label, .field .label { display: block; font-weight: 600; margin-bottom: 4px; }
.field .help { font-size: .9rem; color: var(--muted); margin-top: 4px; }
.field .errorlist, .errorlist { color: var(--cherry); font-weight: 500; margin: 4px 0 0; padding: 0; list-style: none; }
.field.checkbox label { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.field.checkbox input { margin: 0; } /* line up with the labels above */

input[type=text], input[type=email], input[type=password], input[type=number], input[type=search],
input[type=tel], input[type=url], select, textarea {
  width: 100%; font: inherit; color: var(--espresso); background: #fffdf7;
  border: 2px solid var(--espresso); border-radius: 10px; padding: 9px 12px;
}
textarea { resize: vertical; }
select { min-height: calc(1.6em + 22px); padding-left: 8px; } /* same height and text start as the text boxes (browsers pad selects inside; Chrome ignores their line-height) */
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 3px solid var(--espresso); outline-offset: 2px;
}
.site-header :focus-visible { outline-color: var(--cream); }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 50; padding: 8px 16px; border-radius: 999px;
  background: var(--espresso); color: var(--cream); font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 12px; outline-color: var(--butter); }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--cherry); }
input[type=file] { font: inherit; }

.row { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }

/* ---- Panels, cards ---------------------------------------------------- */

.panel {
  background: var(--card); border: 3px solid var(--espresso); border-radius: var(--radius);
  box-shadow: 6px 6px 0 var(--shadow); padding: 24px;
}
.panel + .panel { margin-top: 28px; }
/* The box's padding is the space: no extra margin on its first and last things (forms start with a hidden csrf input) */
.panel > :first-child, .panel > input[type=hidden]:first-child + * { margin-top: 0; }
.panel > :last-child { margin-bottom: 0; }

.messages { list-style: none; padding: 0; margin: 0 0 20px; }
.messages li {
  background: var(--butter); border: 2px solid var(--espresso); border-radius: 10px;
  padding: 10px 14px; font-weight: 500; margin-bottom: 8px;
}
.messages li.error { background: var(--cherry); color: var(--cream); }

.grid { display: grid; gap: 26px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

.card {
  background: var(--card); border: 3px solid var(--espresso); border-radius: var(--radius);
  box-shadow: 5px 5px 0 var(--shadow); overflow: hidden; display: flex; flex-direction: column;
  transition: transform .12s, box-shadow .12s;
}
.card:hover { transform: translate(-2px, -2px) rotate(-.4deg); box-shadow: 8px 8px 0 var(--shadow); }
.card a.cover { display: block; aspect-ratio: 4 / 3; background: var(--butter); border-bottom: 3px solid var(--espresso); }
.card a.cover img { display: block; width: 100%; height: 100%; object-fit: cover; } /* block, or the line gap makes photo cards taller */
.card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card h3 { margin: 0; }
.card h3 a { color: var(--espresso); text-decoration: none; }
.card h3 a:hover { color: var(--cherry); }
.card .meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .9rem; color: var(--muted); margin-top: auto; }

.placeholder {
  width: 100%; height: 100%; display: grid; place-items: center;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,.25) 0 18%, transparent 19%),
    var(--ph, var(--butter));
}
.placeholder img { width: 34%; max-width: 110px; }
.ph-breakfast { --ph: var(--butter); }
.ph-lunch { --ph: var(--turquoise); }
.ph-dinner { --ph: var(--cherry); }
.ph-dessert { --ph: #E9A6A0; }
.ph-snack { --ph: #9CCBCF; }
.ph-anytime { --ph: #EAD9B6; }

.chip {
  display: inline-block; font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  padding: 3px 10px; border-radius: 999px; border: 2px solid var(--espresso); background: var(--cream);
  color: var(--espresso); text-decoration: none; white-space: nowrap;
}
a.chip:hover { background: var(--butter); color: var(--espresso); }
.chip.course { background: var(--turquoise-dark); color: var(--cream); }
.chip.on { background: var(--cherry); color: var(--cream); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.avatar {
  width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2px solid var(--espresso);
  background: var(--butter); display: inline-grid; place-items: center; font-weight: 700; flex-shrink: 0;
}
.avatar.lg { width: 120px; height: 120px; font-size: 2.6rem; border-width: 3px; }
.byline { display: flex; align-items: center; gap: 10px; }

/* ---- Stars ------------------------------------------------------------ */

.stars { color: var(--butter); -webkit-text-stroke: 1px var(--espresso); letter-spacing: 1px; white-space: nowrap; }
.stars .off { color: transparent; }

.rate { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.rate .label { font-weight: 600; }
.rate-form { display: inline-flex; gap: 2px; }
.rate-form button {
  background: none; border: 0; padding: 0; min-width: 36px; min-height: 36px; font-size: 1.9rem; line-height: 1;
  cursor: pointer; color: transparent; -webkit-text-stroke: 1.5px var(--espresso);
}
.rate-form button.on { color: var(--butter); }
.rate-form:hover button, .rate-form:has(button:focus-visible) button { color: transparent; }  /* preview instead */
.rate-form button:hover, .rate-form button:has(~ button:hover),
.rate-form button:focus-visible, .rate-form button:has(~ button:focus-visible) { color: var(--butter); }

/* ---- Home ------------------------------------------------------------- */

.hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 36px; align-items: center; margin-bottom: 44px; }
.hero .sign { width: 100%; max-width: 620px; filter: drop-shadow(0 10px 18px rgba(59, 42, 34, .18)); }
.hero .pitch p { font-size: 1.15rem; }
.search-bar { display: flex; gap: 10px; margin: 18px 0 10px; }
.search-bar input { flex: 1; }
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; text-align: center; }
  .hero .sign { margin: 0 auto; }
  .hero .chips { justify-content: center; }
}

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 40px 0 18px; }
.section-head h2 { margin: 0; }

.menu-board {
  background: var(--espresso); color: var(--cream); border-radius: var(--radius); padding: 22px 24px;
  box-shadow: 6px 6px 0 var(--cherry); display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}
.menu-board a {
  color: var(--cream); text-decoration: none; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  border: 2px dashed rgba(245, 239, 225, .35); border-radius: 10px; padding: 12px; text-align: center;
}
.menu-board a:hover { border-color: var(--butter); color: var(--butter); }

/* ---- Browse ----------------------------------------------------------- */

.browse { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 32px; align-items: start; }
.filters { position: sticky; top: 16px; }
.filters h3 { margin-top: 18px; font-size: .85rem; letter-spacing: .2em; text-transform: uppercase; color: var(--turquoise-dark); }
.filters > h3:first-child { margin-top: 0; }
.filters h3 + input, .filters h3 + select, .filters h3 + .tag-picker { margin-top: 0; }
.filters label.opt { display: flex; align-items: center; gap: 8px; margin: 0; cursor: pointer; }
.filters label.opt + label.opt { margin-top: 4px; }
.filters label.opt input { margin: 0; }
.filters .tag-picker .help { margin-top: 6px; }
.filters .actions { margin: 18px 0 0; }
@media (max-width: 860px) {
  .browse { grid-template-columns: 1fr; }
  .filters { position: static; }
}

.pager { display: flex; gap: 10px; justify-content: center; align-items: center; margin-top: 32px; }

/* ---- Recipe page ------------------------------------------------------ */

.recipe-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; margin-bottom: 28px; }
.recipe-photo { border: 3px solid var(--espresso); border-radius: var(--radius); overflow: hidden; box-shadow: 6px 6px 0 var(--shadow); aspect-ratio: 4 / 3; }
.recipe-photo img { width: 100%; height: 100%; object-fit: cover; }
.recipe-head .description { font-size: 1.15rem; }
.facts { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 16px 0; padding: 12px 0; border-block: 2px dashed var(--line); }
.facts div { display: flex; flex-direction: column; }
.facts dt { font-size: .75rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--turquoise-dark); }
.facts dd { margin: 0; font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 14px 0; }
@media (max-width: 860px) { .recipe-head { grid-template-columns: 1fr; } }

.recipe-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 28px; align-items: start; }
@media (max-width: 860px) { .recipe-body { grid-template-columns: 1fr; } }
.recipe-body > .panel { margin-top: 0; }  /* the grid gap spaces them */
.recipe-body .notes { grid-column: 1 / -1; }  /* full width, under whichever column is longer */

.ingredients ul { list-style: none; padding: 0; margin: 0; }
.ingredients li { padding: 7px 0 7px 26px; border-bottom: 1px dashed var(--line); position: relative; }
.ingredients li::before { content: ""; position: absolute; left: 4px; top: 15px; width: 10px; height: 10px; border-radius: 50%; background: var(--cherry); }
.ingredients li.ing-heading { padding: 16px 0 4px; font-weight: 700; font-size: .85rem; letter-spacing: .15em; text-transform: uppercase; color: var(--turquoise-dark); }
.ingredients li.ing-heading::before { content: none; }
.ingredients li.ing-heading:first-child { padding-top: 4px; }

.directions ol { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.directions li { counter-increment: step; position: relative; padding: 4px 0 14px 50px; }
.directions li::before {
  content: counter(step); position: absolute; left: 0; top: 0; width: 34px; height: 34px; border-radius: 50%;
  background: var(--turquoise); color: var(--cream); font-weight: 700; display: grid; place-items: center;
  border: 2px solid var(--espresso);
}

.story { background: var(--butter); position: relative; }
.story::before { content: "“"; font-family: var(--script); font-size: 5rem; line-height: 1; position: absolute; top: -4px; left: 14px; color: var(--cherry); }
.story .text { padding-left: 40px; white-space: pre-line; }
.prose { white-space: pre-line; }

.fav-btn.on { background: var(--cherry); color: var(--cream); }

details.add-to-list { position: relative; }
details.add-to-list summary { list-style: none; }
details.add-to-list summary::-webkit-details-marker { display: none; }
details.add-to-list .dropdown {
  position: absolute; z-index: 5; top: calc(100% + 8px); left: 0; width: min(300px, 80vw);
  background: var(--card); border: 3px solid var(--espresso); border-radius: 12px; padding: 12px;
  box-shadow: 5px 5px 0 var(--shadow);
}
.dropdown form { margin: 0 0 6px; }
.dropdown .list-opt { width: 100%; text-align: left; background: none; border: 0; padding: 6px 4px; font: inherit; cursor: pointer; border-radius: 6px; }
.dropdown .list-opt:hover { background: var(--butter); }
.dropdown .new-list { display: flex; gap: 6px; margin-top: 8px; }

.comment { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px dashed var(--line); }
.comment:last-child { border-bottom: 0; }
.comment .who { font-weight: 600; }
.comment .body { white-space: pre-line; }
.comment .grow { flex: 1; min-width: 0; }
.comment .stars { font-size: .9rem; margin-left: 4px; }

/* ---- Members & pets --------------------------------------------------- */

.member-card { display: flex; gap: 14px; align-items: center; text-align: center; }
:root[data-view="list"] .grid.cards.members .member-card { flex-direction: row; text-align: left; }
.member-card .name { font-weight: 600; }
.profile-head { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.tagline { font-style: italic; color: var(--muted); }
.pet-card img, .pet-card .placeholder { aspect-ratio: 1; object-fit: cover; width: 100%; }
.pet-card .cover { aspect-ratio: 1; }
.pet-card[data-pet-card] { cursor: zoom-in; }

/* Full-screen pet view (built by site.js from the card) */
.pet-viewer { width: min(94vw, 1100px); max-height: 92vh; padding: 0; overflow: auto; border: 3px solid var(--espresso);
  border-radius: var(--radius); background: var(--card); color: var(--espresso); box-shadow: 8px 8px 0 var(--shadow); }
.pet-viewer::backdrop { background: rgba(59, 42, 34, .78); }
.pet-viewer-close { position: absolute; top: 10px; right: 10px; z-index: 2; width: 40px; height: 40px; border-radius: 50%;
  border: 2px solid var(--espresso); background: var(--cream); color: var(--espresso); font: 700 1.5rem/1 var(--sans); cursor: pointer; }
.pet-viewer-close:hover { background: var(--butter); }
.pet-viewer-card { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: stretch; }
.pet-viewer-card .cover { aspect-ratio: auto; background: var(--espresso); display: flex; align-items: center; justify-content: center; }
.pet-viewer-card .cover > img { width: 100%; height: 100%; max-height: 88vh; aspect-ratio: auto; object-fit: contain; }
.pet-viewer-card .cover .placeholder { width: 100%; aspect-ratio: 1; }
.pet-viewer-card .body { padding: 32px 28px; display: flex; flex-direction: column; gap: 12px; justify-content: center; }
.pet-viewer-card h3 { margin: 0; font-size: 2.2rem; }
.pet-viewer-card .small { font-size: 1.05rem; }
@media (max-width: 700px) {
  .pet-viewer-card { grid-template-columns: 1fr; }
  .pet-viewer-card .cover > img { max-height: 65vh; }
  .pet-viewer-card .body { padding: 20px; }
}
.formset-row { border: 0; border-top: 2px dashed var(--line); padding: 16px 0 0; margin: 16px 0 0; min-width: 0; }
.formset-row legend { padding: 0 8px 0 0; font-weight: 600; }
.photo-row { display: flex; gap: 14px; align-items: flex-start; }
.photo-preview.small-preview { width: 96px; flex-shrink: 0; aspect-ratio: 1; margin: 0; display: grid; place-items: center; }
.photo-preview.small-preview .placeholder { width: 100%; height: 100%; }
.photo-preview.small-preview .avatar { width: 64px; height: 64px; font-size: 1.6rem; }
.photo-controls { flex: 1; min-width: 0; }
[data-add-pet] { margin-top: 14px; }

/* ---- Footer ----------------------------------------------------------- */

.site-footer { background: var(--espresso); color: var(--cream); padding: 26px 0 30px; font-size: .9rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; align-items: center; }
.site-footer a { color: var(--butter); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 4px 16px; } /* the links carry 6px padding, so wrapped lines need little gap */

.empty { text-align: center; padding: 40px 20px; }
.empty img { width: 80px; margin: 0 auto 12px; }

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

@media (prefers-reduced-motion: reduce) {
  .card, .btn { transition: none; }
  .card:hover { transform: none; }
}

/* ---- Print: just the recipe ------------------------------------------- */

@media print {
  body { background: #fff; font-size: 11pt; }
  .site-header, .site-footer, .no-print, .actions, .share, #comments, .messages { display: none !important; }
  main { padding: 0; }
  .panel, .recipe-photo { box-shadow: none; border-width: 1px; }
  .recipe-photo { max-height: 3in; aspect-ratio: auto; }
  .recipe-head, .recipe-body { grid-template-columns: 1fr 1fr; gap: 18px; }
  .story { background: #fff; }
  a { color: inherit; text-decoration: none; }
}

/* Keep the placeholder cake small inside photo frames. */
.card a.cover .placeholder img,
.recipe-photo .placeholder img,
.pet-card .cover .placeholder img { width: 34%; max-width: 110px; height: auto; object-fit: contain; }

/* ---- Icon buttons ------------------------------------------------------ */

.icon { width: 20px; height: 20px; display: block; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0; flex-shrink: 0;
  border-radius: 50%; border: 2px solid var(--espresso); background: var(--card); color: var(--espresso);
  cursor: pointer; text-decoration: none; box-shadow: 2px 2px 0 var(--espresso);
  transition: transform .08s, box-shadow .08s, background .1s;
}
.icon-btn:hover { background: var(--butter); color: var(--espresso); }
.icon-btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--espresso); }

.fav-form { margin: 0; display: inline-flex; }
.fav-btn { color: var(--cherry); }
.fav-btn.on { --heart-fill: var(--cherry); }
.fav-btn:hover { background: #fde3e0; color: var(--cherry); }
.fav-btn.on .icon { animation: heart-pop .25s ease-out; }
@keyframes heart-pop { 50% { transform: scale(1.3); } }

/* ---- Recipe cards: favorite + rating ------------------------------------ */

.card { position: relative; }
.card-fav { position: absolute; top: 10px; right: 10px; z-index: 2; }
.card-link::after { content: ""; position: absolute; inset: 0; z-index: 1; }  /* the whole card is the link */
.card-action { position: relative; z-index: 2; }

/* ---- Grid / list toggle ------------------------------------------------- */

.results-head, .head-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
/* Flex keeps the h1's margin from merging with the next margin, so the row carries it instead (half the script h1 size, like h1's .5em) */
.head-actions:has(> h1) { margin-bottom: clamp(1.1rem, 2.5vw, 1.6rem); }
.head-actions h1 { margin-bottom: 0; }
.results-head { margin-bottom: 14px; }
.view-toggle { display: inline-flex; gap: 6px; }
.view-toggle .icon-btn { width: 40px; height: 40px; box-shadow: none; }
.view-toggle .icon-btn .icon { width: 17px; height: 17px; }
.view-toggle [data-view-set="grid"],
:root[data-view="list"] .view-toggle [data-view-set="list"] { background: var(--espresso); color: var(--cream); }
:root[data-view="list"] .view-toggle [data-view-set="grid"] { background: var(--card); color: var(--espresso); }

:root[data-view="list"] .grid.cards { grid-template-columns: 1fr; gap: 16px; }
:root[data-view="list"] .grid.cards .recipe-card { flex-direction: row; align-items: stretch; }
:root[data-view="list"] .grid.cards .recipe-card a.cover {
  flex: 0 0 150px; aspect-ratio: auto; min-height: 120px; border-bottom: 0; border-right: 3px solid var(--espresso);
}
:root[data-view="list"] .grid.cards .recipe-card .body {
  flex-direction: row; flex-wrap: wrap; align-items: center; column-gap: 14px; padding-right: 64px;
}
:root[data-view="list"] .grid.cards .recipe-card h3 { flex: 1 1 220px; order: -1; }
:root[data-view="list"] .grid.cards .recipe-card .desc { flex-basis: 100%; }
:root[data-view="list"] .grid.cards .recipe-card .meta { flex-basis: 100%; margin-top: 0; }
:root[data-view="list"] .grid.cards .card-fav { top: 50%; transform: translateY(-50%); }
:root[data-view="list"] .grid.cards.members .card .body { padding-block: 10px; }
@media (max-width: 560px) {
  :root[data-view="list"] .grid.cards .recipe-card a.cover { flex-basis: 96px; }
  :root[data-view="list"] .grid.cards .recipe-card .desc { display: none; }
}

/* ---- Tag type-ahead ----------------------------------------------------- */

.tag-picker .chosen { margin-bottom: 8px; }
.tag-picker .chosen:not(:has(.chip)) { display: none; } /* the template leaves whitespace, so :empty never matched */
.tag-picker .chip { display: inline-flex; align-items: center; gap: 4px; }
.chip-x { background: none; border: 0; color: inherit; font: 700 1rem/1 var(--sans); padding: 0; min-width: 24px; min-height: 24px; cursor: pointer; }
.tag-input-wrap { position: relative; }
.suggestions {
  position: absolute; z-index: 10; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px;
  list-style: none; background: var(--card); border: 2px solid var(--espresso); border-radius: 10px;
  box-shadow: 4px 4px 0 var(--shadow); max-height: 240px; overflow: auto;
}
.suggestions li { padding: 6px 10px; border-radius: 6px; cursor: pointer; }
.suggestions li[aria-selected="true"], .suggestions li:hover { background: var(--butter); }
.suggestions li mark { background: none; color: var(--cherry); font-weight: 700; }

/* ---- Recipe form with photo sidebar -------------------------------------- */

.recipe-form { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.recipe-form .form-main { grid-column: 1; grid-row: 1; }
.recipe-form .form-side { grid-column: 2; grid-row: 1 / span 2; }
.recipe-form .form-actions { grid-column: 1; grid-row: 2; margin: -8px 0 0; }
.recipe-form .panel + .panel { margin-top: 0; }
.recipe-form .field { margin-bottom: 22px; }
.recipe-form .field label { margin-bottom: 6px; }
.recipe-form .field .help { margin-top: 6px; }
.form-side { position: sticky; top: 16px; }
.form-side .field:last-child { margin-bottom: 0; }
.photo-preview {
  aspect-ratio: 4 / 3; border: 2px solid var(--espresso); border-radius: 10px; overflow: hidden; margin-bottom: 12px;
}
.photo-preview > img { width: 100%; height: 100%; object-fit: cover; }
.photo-preview .placeholder img { width: 34%; max-width: 110px; }
/* Photo pickers: the file input itself is hidden; its label is the button, and the chosen file's
   name sits beside it, trimmed with "…" so long phone file names can't spill out. */
.file-pick { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; margin-bottom: 8px; }
.file-pick input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.file-pick-btn { flex-shrink: 0; cursor: pointer; }
.file-pick:has(input:focus-visible) .file-pick-btn { outline: 3px solid var(--espresso); outline-offset: 2px; }
.file-name { flex: 1 1 100%; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; color: var(--muted); }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 20px; }
.form-actions { margin-bottom: 0; }
@media (max-width: 860px) {
  .recipe-form { grid-template-columns: 1fr; }
  .recipe-form .form-main, .recipe-form .form-side, .recipe-form .form-actions { grid-column: 1; grid-row: auto; }
  .form-side { position: static; }
}
@media (max-width: 480px) { .field-grid { grid-template-columns: 1fr; } }

/* ---- My lists, with the pinup librarian ------------------------------- */

.lists-layout, .pinup-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 360px); gap: 36px; align-items: start; }
.pinup { margin: 0; position: sticky; top: 16px; text-align: center; }
.pinup img { width: 100%; height: auto; }
.pinup figcaption { font-size: 1.9rem; line-height: 1.1; margin-top: -6px; transform: rotate(-3deg); }
.pinup-layout { align-items: center; }
.pinup-layout .pinup { position: static; }
.not-found .panel { align-self: center; }
@media (max-width: 860px) {
  .lists-layout, .pinup-layout { grid-template-columns: 1fr; }
  .pinup { position: static; max-width: 320px; margin: 0 auto; }
}

.action-divider { width: 2px; align-self: stretch; margin: 4px 4px; background: var(--line); border-radius: 2px; }
.actions .share { display: inline-flex; flex-wrap: wrap; gap: 8px; }
.actions .icon-btn { width: 36px; height: 36px; }
.actions .icon-btn .icon { width: 17px; height: 17px; }
.actions { gap: 8px; }
.actions .btn + a:not(.btn), .actions .btn + span { margin-left: 6px; } /* text beside a button clears its shadow */

/* ---- Invites & simple row lists ------------------------------------------ */

.invite-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 28px; align-items: start; }
.invite-layout .panel + .panel { margin-top: 0; }
@media (max-width: 860px) { .invite-layout { grid-template-columns: 1fr; } }
.invite-note { margin: 0 0 18px; padding: 10px 16px; background: var(--butter); border: 2px solid var(--espresso); border-radius: 10px; font-style: italic; }

.rows { list-style: none; padding: 0; margin: 0; }
.rows li { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.rows li:last-child { border-bottom: 0; }
.rows .grow { flex: 1 1 220px; min-width: 0; overflow-wrap: anywhere; }
.rows form { margin: 0; }

.status {
  display: inline-block; font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  padding: 3px 10px; border-radius: 999px; border: 2px solid var(--espresso); background: var(--cream); white-space: nowrap;
}
.status-waiting, .status-requested, .status-pending { background: var(--butter); }
.status-joined, .status-approved, .status-login { background: var(--turquoise); color: var(--cream); }
.status-not-approved, .status-denied, .status-failed { background: var(--cherry); color: var(--cream); }
.status-cancelled, .status-expired, .status-logout { color: var(--muted); border-color: var(--line); }

/* ---- The Kitchen (staff dashboard) ------------------------------------------ */

.kitchen-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.kitchen-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; }
.kitchen-tabs a {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px;
  border: 2px solid var(--espresso); background: var(--card); color: var(--espresso); text-decoration: none;
  font-weight: 600; font-size: .85rem; letter-spacing: .08em; text-transform: uppercase;
}
.kitchen-tabs a:hover { background: var(--butter); color: var(--espresso); }
.kitchen-tabs a[aria-current="page"] { background: var(--espresso); color: var(--cream); }
.kitchen-tabs .count {
  min-width: 22px; padding: 0 6px; border-radius: 999px; background: var(--cherry); color: var(--cream);
  font-size: .75rem; line-height: 22px; text-align: center; letter-spacing: 0;
}
.kitchen-tabs .count.quiet { background: var(--turquoise); }
.kitchen-panel h2 { font-size: 1.3rem; }
.kitchen-subhead { margin-top: 32px; }
.kitchen-panel .invite-layout .field:last-of-type { margin-bottom: 14px; }
.row-actions { display: flex; gap: 8px; align-items: center; }
.row-note { color: var(--turquoise-dark); font-weight: 500; margin-top: 2px; }
.request-note { margin-top: 6px; padding: 8px 12px; background: var(--cream); border-left: 4px solid var(--butter); border-radius: 4px; }

.inline-form { display: flex; gap: 6px; align-items: center; margin: 0; }
.tag-rows input[type=text] { width: 190px; padding: 5px 10px; }
.tag-rows select { width: 170px; padding: 5px 8px; min-height: calc(1.6em + 14px); } /* as tall as the name box */
.tag-rows .tag-count { flex: 1 1 90px; }
.dup-groups { display: grid; gap: 12px; margin-bottom: 8px; }
.dup-group { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px; border: 2px dashed var(--line); border-radius: 10px; }
.dup-group input[type=text], .merge-ticked input[type=text] { width: 190px; padding: 5px 10px; }
.chip-check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; text-transform: none; letter-spacing: 0; font-size: .9rem; }
.chip-check:has(input:checked) { background: var(--butter); }
.chip-check .count { font-weight: 400; color: var(--muted); }
.merge-ticked { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); flex-wrap: wrap; }

.table-wrap { overflow-x: auto; }
.log-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.log-table th { text-align: left; font-size: .75rem; letter-spacing: .15em; text-transform: uppercase; color: var(--turquoise-dark); padding: 6px 10px; border-bottom: 2px solid var(--espresso); }
.log-table td { padding: 8px 10px; border-bottom: 1px dashed var(--line); white-space: nowrap; }
.log-table tr.failed td { background: #fbe6e3; }
input:disabled { background: var(--cream); color: var(--muted); border-style: dashed; cursor: not-allowed; }

/* ---- Password gate (while the site is private) ------------------------------ */

.gate { display: flex; flex-direction: column; align-items: center; gap: 22px; padding-top: 3vh; }
.gate-sign { width: min(520px, 100%); max-height: 32vh; object-fit: contain; filter: drop-shadow(0 10px 18px rgba(59, 42, 34, .18)); }
.gate-form { width: min(420px, 100%); }
.gate-form h1 { margin-bottom: .2em; }

/* ---- Favorites & lists page --------------------------------------------- */

.list-search { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 18px 0 18px; }
.list-search input { flex: 1 1 220px; width: auto; min-width: 0; }
.list-search select { flex: 0 0 auto; width: auto; }
.list-search .btn { align-self: stretch; }
.card.pinned { background: #fdf3d0; }

/* ---- Message board ------------------------------------------------------ */

.nav-badge { display: inline-block; min-width: 1.5em; margin-left: 3px; padding: 0 6px; border-radius: 999px;
  background: var(--butter); color: var(--espresso); font-size: .75rem; font-weight: 700; line-height: 1.6; text-align: center; }
.new-badge { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--cherry); color: var(--cream);
  font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.topic-list { list-style: none; margin: 20px 0 0; padding: 4px 24px; }
.topic-row { position: relative; display: flex; align-items: center; gap: 10px 14px; padding: 14px 0; border-bottom: 1px dashed var(--line); }
.topic-row:last-child { border-bottom: 0; }
.topic-row .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.topic-row .chip { margin-left: 6px; vertical-align: 2px; }
.topic-title { font-weight: 600; font-size: 1.1rem; color: var(--espresso); text-decoration: none; }
.topic-title::after { content: ""; position: absolute; inset: 0; }  /* the whole row is the link */
.topic-row:hover .topic-title { color: var(--cherry); }
.topic-row.has-new .topic-title { color: var(--cherry); }
.topic-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.topic-head h1 { margin: 0; }
.topic-tools { margin: 0 0 18px; }
.topic-tools summary { list-style: none; display: inline-block; }
.topic-tools summary::-webkit-details-marker { display: none; }
.topic-tools-body { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.topic-tools-body input[type=text] { width: 260px; padding: 5px 10px; }
.posts .post { scroll-margin-top: 90px; }
.posts .post.is-new { background: #fdf3d0; margin: 0 -24px; padding-inline: 24px; }
.posts .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.posts .new-badge { margin-left: 6px; }
.post-tools { display: flex; gap: 10px; align-items: baseline; }
.post-tools a, .post-tools button { font-size: .85rem; }
.narrow-form { max-width: 720px; }
.reactions { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.reactions form { margin: 0; }
.reaction { display: inline-flex; align-items: center; gap: 4px; padding: 1px 9px; min-height: 32px; border: 1.5px solid #8C7A6B;
  border-radius: 999px; background: var(--card); font: inherit; font-size: .95rem; line-height: 1.6; cursor: pointer; }
.reaction .n { font-size: .8rem; font-weight: 600; }
.reaction:hover:not(:disabled) { border-color: var(--espresso); }
.reaction.mine { background: var(--butter); border-color: var(--espresso); }
.reaction:disabled { cursor: default; }
.reaction.add { color: var(--muted); font-weight: 700; }
details.react-picker { position: static; }  /* the picker lines up with the row, not the ＋ */
details.react-picker summary { list-style: none; }
details.react-picker summary::-webkit-details-marker { display: none; }
.react-picker .picker { position: absolute; left: 0; bottom: calc(100% + 6px); z-index: 5; display: grid;  /* left edge of the reactions row */
  grid-template-columns: repeat(6, auto); gap: 2px; padding: 6px; background: var(--card); border: 2px solid var(--espresso);
  border-radius: 14px; box-shadow: 3px 3px 0 var(--shadow); }
.react-picker .picker button { background: none; border: 0; font-size: 1.25rem; line-height: 1; width: 40px; height: 40px; padding: 0; border-radius: 50%; cursor: pointer; }
.react-picker .picker button:hover { background: var(--butter); transform: scale(1.15); }

/* ---- Fixes from the member reviews (2026-09-23) ------------------------ */

.nav a[aria-current="page"] { background: rgba(0, 0, 0, .22); }
.nav-toggle .nav-badge { margin-left: 2px; }
.icon-btn.copied { position: relative; background: var(--butter); }
.icon-btn.copied::after { content: "Copied!"; position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  padding: 2px 8px; border-radius: 6px; background: var(--espresso); color: var(--cream); font: 600 .75rem var(--sans); white-space: nowrap; }
.sort-search { max-width: 760px; flex-wrap: wrap; }
.sort-search input { flex: 1 1 240px; }
.sort-search select { width: auto; flex: 0 0 auto; }

/* Pet cards: the name is a button stretched over the whole card; the owner link sits above it. */
.pet-open { all: unset; cursor: zoom-in; }
.pet-open::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.pet-open:focus-visible { outline: none; }
.pet-card:has(.pet-open:focus-visible) { outline: 3px solid var(--espresso); outline-offset: 3px; }
.pet-card .pet-owner a { position: relative; z-index: 2; }

/* ---- Phones (from the phone review, 2026-09-24) ------------------------ */

button.filters-toggle { display: none; } /* "button." so it beats button.btn */
.comment .when { white-space: nowrap; }
.post-tools a, .post-tools button { display: inline-block; padding: 6px 2px; min-height: 32px; }
.post-tools { gap: 16px; }
.site-footer nav a { display: inline-block; padding: 6px 0; }
a.chip { padding-block: 6px; }

@media (max-width: 860px) {
  button.filters-toggle { display: inline-flex; margin: 10px 0 0; }
  .more-filters:not(.open) { display: none; }
}

@media (max-width: 600px) {
  /* Edit / Delete go under the comment or post, so the words get the full width */
  .comment { flex-wrap: wrap; }
  .comment { gap: 10px; }
  .comment > .avatar { width: 32px; height: 32px; font-size: .95rem; border-width: 2px; }
  .comment .post-tools { flex-basis: 100%; padding-left: 42px; margin-top: -6px; }
  .posts .post.is-new { margin: 0 -16px; padding-inline: 16px; }
  .pet-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .pet-grid .pet-card .body { padding: 10px 12px 12px; }
  .pet-grid .pet-card h3 { font-size: 1.05rem; }
  .profile-head .actions { width: 100%; }
  .logout-form { flex-basis: 100%; margin-top: 6px; }
  .story .text, .story h2 { padding-left: 0 !important; }
  .story { padding-top: 40px; }
  .actions .share { display: contents; }  /* share icons wrap one by one instead of as a block */
  .action-divider { display: none; }
}
@media (max-width: 380px) {
  .react-picker .picker { grid-template-columns: repeat(4, auto); }
}
