/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: Arial, sans-serif; }
a { text-decoration: none; color: inherit; }

/* ══════════════════════════════════════════════════════════════
   Public site (body.site). Palette sampled from designs/home-page.png:
   page pink #da469c, plum frames/tabs #a73f7b, active tab #e890c3 / #333,
   logo blue #4d6488. Admin styles further down are untouched.
   ══════════════════════════════════════════════════════════════ */
@font-face {
  font-family: 'Open Sans';
  src: url('/fonts/open-sans-latin-var.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

.site {
  --pink: #da469c;
  --plum: #a73f7b;
  --plum-dark: #8a3264;
  --tab-active: #e890c3;
  --ink: #333;
  --muted: #5f5a5d;
  --blush: #fdf0f7;
  --blush-line: #f3c6de;
  --card: 190px;
  --gap: 8px;
  --tab-gap: 5px;
  --frame: 5px;
  font-family: 'Open Sans', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  background: var(--pink);
  color: #fff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.4;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}
.site img { max-width: 100%; }
.site [hidden] { display: none !important; }

.site a:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.site .panel a:focus-visible { outline-color: #2f3f5c; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip-link {
  position: absolute; left: 10px; top: -60px; z-index: 10;
  background: #fff; color: var(--ink); padding: 8px 12px; font-weight: 700;
}
.skip-link:focus { top: 10px; }

/* ── Header: round logo + wordmark ── */
.site-header { padding: 10px 10px 6px; }
.site-logo { display: inline-flex; align-items: center; gap: 12px; color: #fff; }
.logo-mark { width: 70px; height: 70px; display: block; }
.logo-text { font-size: 40px; font-weight: 700; letter-spacing: -0.2px; line-height: 1; }

/* ── Layout: content on the left, nav tabs on the right ── */
.page-layout {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, calc(5 * var(--card) + 4 * var(--gap))) max-content;
  grid-template-areas: "main nav";
  column-gap: 15px;
  justify-content: start;
  align-content: start;
  align-items: start;
  padding: 0 15px 20px;
}
.page-layout--fit { grid-template-columns: minmax(0, max-content) max-content; }
.page-main { grid-area: main; min-width: 0; }

.site-nav { grid-area: nav; }
.site-nav ul { list-style: none; display: flex; flex-direction: column; align-items: flex-start; gap: var(--tab-gap); }
.site-nav a {
  display: block;
  background: var(--plum);
  color: #fff;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
  padding: 1px 6px 3px;
}
.site-nav a:hover { background: var(--plum-dark); }
.site-nav a.active { background: var(--tab-active); color: var(--ink); font-size: 28px; }

/* ── Photo cards (recipes, cuisines) ── */
.card-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, var(--card));
  gap: var(--gap);
}
.card a {
  display: flex;
  flex-direction: column;
  background: var(--plum);
  padding: var(--frame) var(--frame) 0;
  color: #fff;
  height: 100%;
  transition: background-color .15s;
}
.card a:hover { background: var(--plum-dark); }
.card img, .card-noimg {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  object-fit: cover;
  background: var(--plum-dark);
}
.card-noimg { display: flex; align-items: center; justify-content: center; font-size: 13px; text-align: center; padding: 8px; }
.card-caption {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  min-height: 2.6em;
  box-sizing: content-box;
  padding: 4px 0 5px;
}

/* Home: search, Top 10 strip */
.search { margin-bottom: 14px; max-width: calc(3 * var(--card) + 2 * var(--gap)); }
.search input {
  width: 100%; height: 48px; padding: 0 14px;
  font: inherit; font-size: 16px; color: var(--ink); background: #fff;
  border: 3px solid var(--plum); border-radius: 0;
}
.search input::placeholder { color: #6f6a6d; }
.search input:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.search-empty { margin-bottom: 14px; }
.home-section { margin-bottom: 18px; }
.section-title { font-size: 24px; font-weight: 700; line-height: 1.2; margin-bottom: 8px; }
.section-title a { color: #fff; }
.section-title a:hover { text-decoration: underline; }
.card-strip {
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: var(--card);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  padding-bottom: 6px;
}
.card-strip .card { scroll-snap-align: start; }
.card-count { font-weight: 400; }

/* ── Page headings on pink ── */
.page-title { font-size: 28px; font-weight: 700; line-height: 1.2; margin: 0 0 10px; }
.page-title .count {
  display: inline-block; vertical-align: middle; margin-left: 6px;
  background: var(--plum); color: #fff; font-size: 15px; font-weight: 600; padding: 1px 8px;
}
.page-intro { font-size: 1.2rem; font-weight: 700; margin: -4px 0 12px; }
.crumbs { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.crumbs a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
/* Small text never sits directly on page pink: breadcrumb on pink gets a plum chip */
.crumbs--chip { display: inline-block; background: var(--plum); padding: 2px 10px; margin-bottom: 8px; }
.crumbs--chip a { text-decoration: none; }
.crumbs--chip a:hover { text-decoration: underline; }

.tag-top {
  display: inline-block; background: var(--tab-active); color: var(--ink);
  font-size: 12px; font-weight: 700; padding: 0 6px; text-transform: uppercase; letter-spacing: .04em;
}

/* ── White content panels (recipe, contact, A–Z) ── */
.panel {
  background: #fff;
  color: var(--ink);
  border: var(--frame) solid var(--plum);
  padding: 20px 24px;
}
.prose { max-width: 640px; }
.prose h1 { font-size: 26px; margin-bottom: 10px; }
.prose p { font-size: 17px; line-height: 1.6; margin-bottom: 10px; }
.panel a { color: var(--plum); text-decoration: underline; text-underline-offset: 2px; }
.panel .crumbs { color: var(--plum); }

/* ── A–Z recipe index ── */
.az { display: flex; flex-wrap: wrap; gap: var(--gap); margin-bottom: 10px; }
.az a { background: var(--plum); color: #fff; font-weight: 700; min-width: 32px; text-align: center; padding: 3px 6px; }
.az a:hover { background: var(--plum-dark); }
.az-list { columns: 2 280px; column-gap: 32px; max-width: 900px; }
.az-list section { break-inside: avoid; margin-bottom: 14px; }
.az-list h2 { font-size: 20px; color: var(--plum); border-bottom: 2px solid var(--blush-line); margin-bottom: 4px; scroll-margin-top: 10px; }
.az-list ul { list-style: none; }
.az-list li { padding: 3px 0; font-size: 16px; }
.az-list li a { color: var(--ink); text-decoration: none; font-weight: 600; }
.az-list li a:hover { color: var(--plum); text-decoration: underline; }
.az-type { color: var(--muted); font-size: 13px; }

/* ── Recipe page ── */
.recipe {
  display: grid;
  grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
  grid-template-areas: "head head" "photo ing" "method method";
  gap: 18px 28px;
}
.recipe-head { grid-area: head; }
.recipe h1 { font-size: 32px; font-weight: 700; line-height: 1.15; color: var(--ink); margin: 2px 0 6px; }
.recipe-photo { grid-area: photo; margin: 0; aspect-ratio: 1 / 1; background: var(--blush); overflow: hidden; position: relative; }
.recipe-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.recipe-photo-fallback { display: none; }
.recipe-photo--missing { display: flex; align-items: center; justify-content: center; border: 2px dashed var(--blush-line); }
.recipe-photo--missing img { display: none; }
.recipe-photo--missing .recipe-photo-fallback { display: block; color: var(--plum); font-weight: 600; }

.recipe h2 {
  font-size: 15px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--plum); border-bottom: 2px solid var(--blush-line); padding-bottom: 4px; margin-bottom: 10px;
}
.ingredients { grid-area: ing; }
.ingredients ul { list-style: none; }
.ingredients li { position: relative; padding: 5px 0 5px 20px; font-size: 16.5px; line-height: 1.45; border-bottom: 1px dotted #eed3e2; }
.ingredients li.ing-item::before {
  content: ""; position: absolute; left: 4px; top: 13px; width: 7px; height: 7px; border-radius: 50%; background: var(--pink);
}
.ingredients li.ing-heading { padding-left: 0; padding-top: 12px; font-weight: 700; color: var(--plum); border-bottom: none; }
.ingredients li.ing-note { font-style: italic; color: var(--muted); font-size: 15px; }
.ing-extra { color: var(--muted); }

.method { grid-area: method; counter-reset: none; }
.method h3 { font-size: 17px; font-weight: 700; color: var(--ink); margin: 16px 0 6px; }
.method ol.steps { list-style: none; counter-reset: step; }
.method ol.steps > li {
  counter-increment: step; position: relative; padding: 0 0 12px 42px; font-size: 17px; line-height: 1.6;
}
.method ol.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 1px;
  width: 28px; height: 28px; border-radius: 50%; background: var(--plum); color: #fff;
  font-size: 14px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.method ol.steps > li.plain { counter-increment: none; padding-bottom: 4px; }
.method ol.steps > li.plain::before { content: none; }
.method ul.sub { list-style: disc; padding: 4px 0 0 20px; }
.method ul.notes {
  list-style: none; background: var(--blush); border-left: 4px solid var(--pink); padding: 10px 14px;
}
.method ul.notes li { font-size: 16px; line-height: 1.55; padding: 3px 0; }
.share { margin-top: 18px; }
.panel a.btn-share {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px;
  background: var(--plum); color: #fff; font-weight: 700; font-size: 16px; text-decoration: none;
}
.panel a.btn-share:hover { background: var(--plum-dark); }

/* ── Footer ── */
.site-footer { background: var(--plum); color: #fff; font-size: 12px; padding: 8px 15px; }
.site-footer a { color: #fff; text-decoration: underline; }

/* ── Tablet: nav moves above the content ── */
@media (max-width: 760px) {
  .page-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "nav" "main"; row-gap: 12px; padding: 0 12px 16px; }
  .site-nav ul { flex-direction: row; flex-wrap: wrap; align-items: stretch; }
  .site-nav li { flex: 1 1 auto; }
  .site-nav a, .site-nav a.active { font-size: 19px; padding: 4px 10px 6px; text-align: center; }
  .card-grid:not(.card-strip) { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .recipe { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "photo" "ing" "method"; padding: 16px; }
  .recipe-photo { aspect-ratio: 16 / 10; max-height: 220px; }
  .card-strip { grid-auto-columns: minmax(150px, 42%); }
}

/* ── Phones ── */
@media (max-width: 480px) {
  .site-header { padding: 10px 12px 8px; }
  .logo-mark { width: 48px; height: 48px; }
  .logo-text { font-size: 26px; }
  /* The logo links home, so phones drop the "home" tab and keep 4 tabs on one row */
  .site-nav ul { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
  .site-nav li:first-child { display: none; }
  .site-nav a, .site-nav a.active {
    font-size: 16px; min-height: 44px; padding: 0 2px;
    display: flex; align-items: center; justify-content: center; text-align: center;
  }
  .card-grid:not(.card-strip) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-caption { font-size: 14px; }
  .page-title { font-size: 24px; }
  .recipe h1 { font-size: 26px; }
  .panel { padding: 16px; border-width: 4px; }
  .method ol.steps > li { font-size: 16.5px; padding-left: 38px; }
  .az-list li { padding: 8px 0; }
}

/* ── Admin ── */
.admin-body { background: #f5f5f5; color: #333; }

.admin-header {
  padding: 4px 10px 0;
  background: #fff;
  border-bottom: 1px solid #ddd;
}

.admin-header-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.admin-logo {
  font-size: 2.1rem;
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: normal;
  color: #111;
}

.admin-label {
  font-size: 0.78rem;
  color: #999;
  margin-left: auto;
}

/* Admin nav: horizontal pill tabs touching the bottom border */
.admin-nav {
  display: flex;
  gap: 2px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.admin-nav a {
  padding: 4px 14px;
  background: #fff;
  border: 1px solid #bbb;
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  font-size: 0.95rem;
  color: #333;
  display: inline-block;
}

.admin-nav a:hover { background: #fde8f0; }
.admin-nav a.active { background: #fde8f0; font-weight: bold; }

.admin-main { padding: 18px 14px; max-width: 900px; }

.admin-main h1 {
  font-size: 1.15rem;
  margin-bottom: 10px;
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: normal;
  color: #333;
}

/* Admin table */
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.admin-table th {
  text-align: left;
  padding: 5px 10px;
  background: #f9dde8;
  border-bottom: 1px solid #ddd;
  border-top: 1px solid #ddd;
}
.admin-table td {
  padding: 4px 10px;
  border-bottom: 1px solid #f0e0e8;
}
.admin-table tr:nth-child(odd) td { background: #fef0f5; }
.admin-table tr:nth-child(even) td { background: #fff; }
.admin-table tr:hover td { background: #fde8f0; }

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 1px 2px;
  line-height: 1;
}
.btn-icon:hover { opacity: 0.7; }

.btn-primary {
  background: #f9dde8;
  color: #333;
  border: 1px solid #bbb;
  padding: 4px 14px;
  cursor: pointer;
  font-size: 0.85rem;
  display: inline-block;
  margin-bottom: 10px;
}
.btn-primary:hover { background: #fde8f0; }

/* Admin form */
.admin-form { background: #fff; padding: 16px; max-width: 600px; border: 1px solid #e0d0d8; }
.admin-form label { display: block; font-size: 0.85rem; margin-bottom: 3px; margin-top: 10px; }
.admin-form input[type="text"],
.admin-form select,
.admin-form textarea {
  width: 100%;
  padding: 4px 7px;
  border: 1px solid #ccc;
  font-size: 0.88rem;
}
.admin-form textarea { min-height: 90px; resize: vertical; }
.admin-form .form-actions { margin-top: 12px; }

/* Login */
.login-box {
  max-width: 460px;
  background: #fef0f5;
  border: 1px solid #e0c0cc;
  padding: 14px 18px 18px;
  color: #333;
}
.login-box h1 {
  color: #c0392b;
  margin-bottom: 10px;
  font-size: 1.15rem;
  font-family: Georgia, serif;
  font-weight: normal;
}
.login-box label { display: block; margin-bottom: 3px; font-size: 0.88rem; margin-top: 8px; }
.login-box input {
  width: 175px;
  padding: 3px 6px;
  border: 1px solid #bbb;
}
.login-box button {
  margin-top: 10px;
  background: #fde8f0;
  border: 1px solid #bbb;
  padding: 4px 16px;
  cursor: pointer;
  font-size: 0.88rem;
}
.login-box button:hover { background: #ffd0e0; }

.admin-footer { padding: 8px 14px; font-size: 0.72rem; color: #999; border-top: 1px solid #eee; }
