/* Palette taken from the macaron reference image
   #B5C8AC  pale sage      #8EA186  soft grey-green
   #90A76A  olive          #60774C  mid green
   #3A5231  deep forest                                            */

:root {
  --sage-pale: #b5c8ac;
  --sage-soft: #8ea186;
  --olive: #90a76a;
  --green-mid: #60774c;
  --green-deep: #3a5231;

  --paper: #f6f7f3;
  --card: #ffffff;
  --ink: #222c1d;
  --ink-soft: #55614b;
  --line: rgba(58, 82, 49, 0.14);

  --shadow-sm: 0 1px 2px rgba(34, 44, 29, 0.06), 0 2px 8px rgba(34, 44, 29, 0.05);
  --shadow-md: 0 4px 12px rgba(34, 44, 29, 0.08), 0 12px 32px rgba(34, 44, 29, 0.09);
  --shadow-lg: 0 24px 64px rgba(34, 44, 29, 0.22);

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --sidebar-w: 310px;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
  letter-spacing: -0.01em;
}

a { color: var(--green-mid); }

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input, textarea, select {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--olive);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------------------------------------------------------------- layout */

.layout {
  display: flex;
  min-height: 100vh;
}

/* ---------------------------------------------------------------- sidebar */

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--green-deep);
  color: var(--sage-pale);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar__brand {
  padding: 28px 26px 20px;
  border-bottom: 1px solid rgba(181, 200, 172, 0.16);
}

.sidebar__brand a {
  color: #fff;
  text-decoration: none;
  font-family: var(--serif);
  font-size: 1.4rem;
  display: block;
  line-height: 1.15;
}

.sidebar__brand span {
  display: block;
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--sage-soft);
  margin-top: 8px;
}

.sidebar__search {
  padding: 16px 20px 10px;
}

.sidebar__search input {
  width: 100%;
  padding: 9px 13px;
  border-radius: 9px;
  border: 1px solid rgba(181, 200, 172, 0.24);
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  font-size: 0.88rem;
}

.sidebar__search input::placeholder { color: rgba(181, 200, 172, 0.65); }

.sidebar__label {
  padding: 6px 26px 8px;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sage-soft);
}

/* The scrolling list of recipe titles */
.recipe-list {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 0 12px 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--green-mid) transparent;
}

.recipe-list::-webkit-scrollbar { width: 8px; }
.recipe-list::-webkit-scrollbar-thumb {
  background: var(--green-mid);
  border-radius: 8px;
}

.recipe-list__item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  border-radius: 9px;
  color: var(--sage-pale);
  font-size: 0.93rem;
  transition: background 0.15s ease, color 0.15s ease;
}

.recipe-list__item:hover,
.recipe-list__item:focus-visible {
  background: rgba(144, 167, 106, 0.22);
  color: #fff;
}

.recipe-list__item small {
  display: block;
  font-size: 0.75rem;
  color: var(--sage-soft);
  margin-top: 2px;
}

.recipe-list__empty {
  padding: 14px;
  font-size: 0.86rem;
  color: var(--sage-soft);
}

/* Admin sits at the very bottom of the panel */
.sidebar__foot {
  border-top: 1px solid rgba(181, 200, 172, 0.16);
  padding: 14px 20px 18px;
  display: grid;
  gap: 8px;
}

.sidebar__foot button,
.sidebar__foot a {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 0.87rem;
  color: var(--sage-pale);
  text-decoration: none;
  transition: background 0.15s ease;
}

.sidebar__foot button:hover,
.sidebar__foot a:hover { background: rgba(181, 200, 172, 0.14); }

.sidebar__foot .admin-link {
  border: 1px solid rgba(181, 200, 172, 0.3);
  justify-content: center;
}

/* ------------------------------------------------------------------- main */

.main {
  flex: 1 1 auto;
  min-width: 0;
}

.hero {
  padding: 68px 56px 40px;
  background: linear-gradient(165deg, rgba(181, 200, 172, 0.4), rgba(246, 247, 243, 0) 65%);
  border-bottom: 1px solid var(--line);
}

.hero__eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--green-mid);
  font-weight: 600;
  margin: 0 0 14px;
}

.hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  max-width: 15ch;
}

.hero p {
  max-width: 60ch;
  color: var(--ink-soft);
  margin: 18px 0 0;
  font-size: 1.03rem;
}

.stats {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 32px;
}

.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 24px;
  box-shadow: var(--shadow-sm);
  min-width: 150px;
}

.stat__value {
  font-family: var(--serif);
  font-size: 2.1rem;
  line-height: 1;
  color: var(--green-deep);
}

.stat__label {
  font-size: 0.74rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 7px;
}

.section {
  padding: 44px 56px 72px;
}

.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.section__head h2 { font-size: 1.6rem; }

.section__head p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

/* ------------------------------------------------------------------- grid */

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

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-align: left;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  display: flex;
  flex-direction: column;
}

.card:hover,
.card:focus-visible {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.card__media {
  aspect-ratio: 4 / 3;
  background: var(--sage-pale);
  overflow: hidden;
  position: relative;
}

.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.card:hover .card__media img { transform: scale(1.04); }

.card__count {
  position: absolute;
  right: 10px;
  bottom: 10px;
  background: rgba(34, 44, 29, 0.7);
  color: #fff;
  font-size: 0.72rem;
  padding: 3px 9px;
  border-radius: 20px;
  backdrop-filter: blur(4px);
}

.card__body { padding: 16px 18px 20px; }

.card__body h3 {
  font-size: 1.14rem;
  margin-bottom: 5px;
}

.card__body p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card__date {
  margin-top: 12px;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sage-soft);
}

.empty {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 56px 32px;
  text-align: center;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.6);
}

.empty h3 { margin-bottom: 8px; color: var(--green-deep); }

/* ------------------------------------------------------------------ modal */

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  padding: 32px 20px;
  overflow-y: auto;
  background: rgba(34, 44, 29, 0.5);
  backdrop-filter: blur(3px);
}

.modal[open],
.modal.is-open { display: block; }

.modal__panel {
  max-width: 940px;
  margin: 0 auto;
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: rise 0.22s ease;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .modal__panel { animation: none; }
  .card { transition: none; }
  .card__media img { transition: none; }
}

.modal__close {
  position: fixed;
  top: 24px;
  right: 28px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--green-deep);
  font-size: 1.35rem;
  line-height: 1;
  box-shadow: var(--shadow-sm);
  z-index: 2;
}

.modal__gallery {
  display: grid;
  gap: 3px;
  background: var(--sage-pale);
  grid-template-columns: 1fr;
}

.modal__gallery--multi { grid-template-columns: 2fr 1fr; }

.modal__gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  max-height: 420px;
}

.modal__gallery-side {
  display: grid;
  gap: 3px;
  grid-auto-rows: 1fr;
  max-height: 420px;
  overflow: hidden;
}

.modal__body { padding: 34px 40px 44px; }

.modal__body h2 {
  font-size: clamp(1.7rem, 3.4vw, 2.3rem);
}

.modal__subtitle {
  color: var(--ink-soft);
  margin: 8px 0 0;
  font-size: 1rem;
}

.modal__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0 28px;
}

.chip {
  background: rgba(181, 200, 172, 0.35);
  color: var(--green-deep);
  border-radius: 20px;
  padding: 4px 13px;
  font-size: 0.78rem;
  font-weight: 500;
}

.prose h3 {
  font-size: 1.02rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  font-family: var(--sans);
  color: var(--green-mid);
  margin: 30px 0 12px;
}

.prose h3:first-child { margin-top: 0; }

.prose p {
  margin: 0 0 16px;
  font-size: 1.02rem;
  color: #2f3a28;
}

.prose p:last-child { margin-bottom: 0; }

details.recipe-details {
  margin-top: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

details.recipe-details > summary {
  cursor: pointer;
  padding: 15px 20px;
  background: rgba(181, 200, 172, 0.22);
  font-weight: 600;
  color: var(--green-deep);
  list-style: none;
}

details.recipe-details > summary::-webkit-details-marker { display: none; }
details.recipe-details > summary::after { content: " ▾"; color: var(--green-mid); }
details.recipe-details[open] > summary::after { content: " ▴"; }

.recipe-details__inner {
  padding: 22px 24px 26px;
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(220px, 1fr) 2fr;
}

.recipe-details h4 {
  font-family: var(--sans);
  font-size: 0.74rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--green-mid);
  margin-bottom: 10px;
}

.recipe-details ul,
.recipe-details ol {
  margin: 0;
  padding-left: 20px;
  font-size: 0.93rem;
}

.recipe-details li { margin-bottom: 8px; }

/* ------------------------------------------------------------ notify bar */

.notify-bar {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 70;
  max-width: 520px;
  width: calc(100% - 40px);
  background: var(--green-deep);
  color: var(--sage-pale);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-lg);
  display: none;
  gap: 14px;
  align-items: center;
}

.notify-bar.is-open { display: flex; }

/* Keep the bar from covering the last row of dishes */
body.has-notify-bar .section { padding-bottom: 150px; }

.notify-bar p {
  margin: 0;
  font-size: 0.88rem;
  flex: 1 1 auto;
}

.notify-bar strong { color: #fff; display: block; margin-bottom: 2px; }

.btn {
  background: var(--olive);
  color: #1e2a17;
  border-radius: 9px;
  padding: 9px 16px;
  font-weight: 600;
  font-size: 0.87rem;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.btn:hover { background: var(--sage-pale); }

.btn--ghost {
  background: transparent;
  color: var(--sage-soft);
  padding: 9px 10px;
}

.btn--ghost:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }

.sidebar-scrim {
  position: fixed;
  inset: 0;
  z-index: 54;
  background: rgba(34, 44, 29, 0.45);
}

.sidebar-toggle {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 50;
  background: var(--green-deep);
  color: #fff;
  border-radius: 10px;
  padding: 9px 13px;
  box-shadow: var(--shadow-md);
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 55;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: var(--shadow-lg);
  }

  .sidebar.is-open { transform: none; }
  .sidebar-toggle { display: block; }

  .hero { padding: 76px 22px 32px; }
  .section { padding: 32px 22px 64px; }
  .modal { padding: 16px 10px; }
  .modal__body { padding: 24px 22px 32px; }
  .modal__close { top: 26px; right: 20px; }
  .modal__gallery--multi { grid-template-columns: 1fr; }
  .modal__gallery-side { grid-auto-flow: column; max-height: 130px; }
  .recipe-details__inner { grid-template-columns: 1fr; }
}
