/*
Theme Name: Savory
Theme URI: https://recipeleaf.net/savory
Author: Savory Themes
Author URI: https://recipeleaf.net
Description: A fast, accessible, SEO-first WordPress theme built for cooking and recipe blogs. Modern hand-drawn "sketchbook" design with Recipe schema (JSON-LD), Open Graph & Twitter cards, breadcrumbs, and optimized Core Web Vitals.
Version: 1.1.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: savory
Tags: blog, food, recipes, seo, accessibility-ready, custom-menu, featured-images, translation-ready, block-styles
*/

/* =========================================================
   Design tokens — sketchbook / hand-drawn modern
   ========================================================= */
:root {
  --sv-font-body: "Nunito", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --sv-font-head: "Nunito", ui-sans-serif, system-ui, sans-serif;
  --sv-font-hand: "Caveat", "Segoe Print", "Bradley Hand", cursive;

  --sv-ink: #221f1a;          /* dark ink for text + sketch lines */
  --sv-ink-soft: #6a6157;     /* muted ink */
  --sv-paper: #fffdf6;        /* warm paper */
  --sv-panel: #fbf3e4;        /* soft panel fill */
  --sv-accent: #2fa360;       /* leaf green (RecipeLeaf) */
  --sv-accent-ink: #1e7a44;   /* darker green */
  --sv-berry: #e4572e;        /* warm secondary accent */
  --sv-border: var(--sv-ink);

  /* Hand-drawn wobbly radii */
  --sv-wobble: 14px 22px 16px 24px / 22px 16px 24px 14px;
  --sv-wobble-lg: 255px 18px 225px 20px / 20px 225px 18px 255px;

  --sv-shadow: 5px 5px 0 var(--sv-ink);
  --sv-shadow-sm: 3px 3px 0 var(--sv-ink);
  --sv-shadow-accent: 5px 5px 0 var(--sv-accent);

  --sv-maxw: 1180px;
  --sv-contentw: 720px;

  /* Wavy hand-drawn underline (green) */
  --sv-squiggle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='10' viewBox='0 0 120 10'%3E%3Cpath d='M0 6 Q 15 1 30 6 T 60 6 T 90 6 T 120 6' fill='none' stroke='%232fa360' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* =========================================================
   Reset & base
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sv-font-body);
  font-size: 1.075rem;
  line-height: 1.72;
  color: var(--sv-ink);
  background-color: var(--sv-paper);
  /* subtle dotted-notebook texture */
  background-image: radial-gradient(rgba(34, 31, 26, 0.07) 1.1px, transparent 1.2px);
  background-size: 24px 24px;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--sv-accent-ink); text-decoration: none; }
a:hover, a:focus { color: var(--sv-berry); }

h1, h2, h3, h4, h5, h6 { font-family: var(--sv-font-head); line-height: 1.15; font-weight: 800; letter-spacing: -0.01em; color: var(--sv-ink); }
h1 { font-size: clamp(2.1rem, 4.5vw, 3.1rem); font-weight: 900; }
h2 { font-size: clamp(1.55rem, 3vw, 2.1rem); }
h3 { font-size: 1.25rem; }
:focus-visible { outline: 3px dashed var(--sv-accent); outline-offset: 3px; }

/* Accessibility */
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 1000; background: var(--sv-ink); color: #fff; padding: 12px 18px; border-radius: 0 0 12px 0; font-family: var(--sv-font-head); font-weight: 700; }
.skip-link:focus { left: 0; color: #fff; }
.screen-reader-text { border: 0; clip: rect(1px,1px,1px,1px); clip-path: inset(50%); height: 1px; width: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; }

/* =========================================================
   Layout
   ========================================================= */
.sv-container { max-width: var(--sv-maxw); margin-inline: auto; padding-inline: 1.35rem; }
.sv-site-main { padding-block: 2.75rem; }
.sv-layout { display: grid; grid-template-columns: minmax(0,1fr) 330px; gap: 3.25rem; }
@media (max-width: 900px) { .sv-layout { grid-template-columns: 1fr; } }

/* =========================================================
   Header
   ========================================================= */
.sv-header { border-bottom: 3px solid var(--sv-ink); background: var(--sv-paper); position: relative; }
.sv-header::after { content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 3px; background: var(--sv-accent); opacity: .0; }
.sv-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding-block: 1.15rem; }
.sv-brand { font-family: var(--sv-font-hand); font-weight: 700; font-size: 2.5rem; line-height: 1; text-decoration: none; color: var(--sv-ink); }
.sv-brand span { color: var(--sv-accent); }
.sv-tagline { font-family: var(--sv-font-hand); font-size: 1.15rem; color: var(--sv-ink-soft); margin: 2px 0 0; }
.sv-nav ul { list-style: none; display: flex; gap: 1.5rem; margin: 0; padding: 0; }
.sv-nav a { font-family: var(--sv-font-head); font-weight: 700; font-size: 1rem; text-decoration: none; color: var(--sv-ink); padding-bottom: 3px; background-image: var(--sv-squiggle); background-repeat: no-repeat; background-position: 0 110%; background-size: 0% 8px; transition: background-size .25s ease; }
.sv-nav a:hover, .sv-nav .current-menu-item > a { background-size: 100% 8px; color: var(--sv-ink); }
.sv-nav-toggle { display: none; background: var(--sv-paper); border: 2.5px solid var(--sv-ink); border-radius: var(--sv-wobble); padding: 8px 13px; font-size: 1.05rem; cursor: pointer; box-shadow: var(--sv-shadow-sm); font-family: var(--sv-font-head); font-weight: 800; }
@media (max-width: 820px) {
  .sv-nav-toggle { display: inline-flex; align-items: center; gap: 6px; }
  .sv-nav { position: absolute; inset: auto 1.35rem auto auto; margin-top: 8px; background: var(--sv-paper); border: 2.5px solid var(--sv-ink); box-shadow: var(--sv-shadow); border-radius: var(--sv-wobble); padding: 1rem 1.25rem; display: none; z-index: 50; }
  .sv-nav.is-open { display: block; }
  .sv-nav ul { flex-direction: column; gap: 0.85rem; }
}

/* =========================================================
   Cards / archive grid
   ========================================================= */
.sv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 2rem; }
.sv-card {
  background: var(--sv-paper);
  border: 2.5px solid var(--sv-ink);
  border-radius: var(--sv-wobble);
  overflow: hidden;
  box-shadow: var(--sv-shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease;
}
.sv-card:nth-child(even) { border-radius: 22px 14px 24px 16px / 16px 24px 14px 22px; }
.sv-card:hover { transform: translate(-2px, -3px) rotate(-.5deg); box-shadow: var(--sv-shadow-accent); }

/* Media + title overlay (recipe name shown ON the image) */
.sv-card__media { position: relative; aspect-ratio: 3 / 2; overflow: hidden; background: var(--sv-ink); border-bottom: 2.5px solid var(--sv-ink); }
.sv-card__media > a { display: block; height: 100%; }
.sv-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.sv-card:hover .sv-card__media img { transform: scale(1.05); }
.sv-card__overlay {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 2.4rem 1.15rem 1rem;
  background: linear-gradient(to top, rgba(18,16,13,0.90) 0%, rgba(18,16,13,0.55) 50%, rgba(18,16,13,0) 100%);
  pointer-events: none;
  transition: background .25s ease;
}
.sv-card:hover .sv-card__overlay,
.sv-card:focus-within .sv-card__overlay {
  background: linear-gradient(to top, rgba(18,16,13,0.94) 0%, rgba(18,16,13,0.85) 55%, rgba(18,16,13,0.25) 100%);
}
.sv-card__overlay a { pointer-events: auto; }
.sv-card__cat { font-family: var(--sv-font-hand); font-size: 1.2rem; letter-spacing: 0; text-transform: none; color: #9fe6bd; text-decoration: none; font-weight: 700; text-shadow: 0 1px 4px rgba(0,0,0,0.5); }
.sv-card__title { font-size: 1.28rem; margin: 0.15rem 0 0; line-height: 1.18; }
.sv-card__title a { color: #fff; text-decoration: none; text-shadow: 0 1px 6px rgba(0,0,0,0.55); }
.sv-card__title a:hover { color: #ffe9c7; }

/* Meta + excerpt: hidden by default, revealed on hover/focus (no layout shift) */
.sv-card__reveal {
  max-height: 0; opacity: 0; overflow: hidden;
  transition: max-height .3s ease, opacity .25s ease, margin-top .3s ease;
  margin-top: 0;
}
.sv-card:hover .sv-card__reveal,
.sv-card:focus-within .sv-card__reveal {
  max-height: 12rem; opacity: 1; margin-top: 0.55rem;
}
.sv-card__meta { font-family: var(--sv-font-head); font-size: 0.82rem; font-weight: 700; color: #d9e8dd; display: flex; gap: 1rem; flex-wrap: wrap; text-shadow: 0 1px 4px rgba(0,0,0,0.5); }
.sv-card__excerpt { font-size: 0.95rem; color: #ece6db; margin: 0.4rem 0 0; text-shadow: 0 1px 4px rgba(0,0,0,0.5); }

/* =========================================================
   Featured hero (front page)
   ========================================================= */
.sv-hero > a { display: block; border: 3px solid var(--sv-ink) !important; box-shadow: var(--sv-shadow); border-radius: var(--sv-wobble); overflow: hidden; }
.sv-hero > a img { transition: transform .4s ease; }
.sv-hero > a:hover img { transform: scale(1.04); }

/* =========================================================
   Single post
   ========================================================= */
.sv-article { max-width: var(--sv-contentw); margin-inline: auto; }
.sv-article__header { margin-bottom: 1.5rem; }
.sv-article__title { margin: 0.5rem 0 0.85rem; }
.sv-article__meta { font-family: var(--sv-font-head); font-size: 0.9rem; font-weight: 700; color: var(--sv-ink-soft); display: flex; gap: 1.2rem; flex-wrap: wrap; align-items: center; }
.sv-article__hero { margin: 1.6rem 0; border: 3px solid var(--sv-ink); border-radius: var(--sv-wobble); overflow: hidden; box-shadow: var(--sv-shadow); }
.sv-article__content { font-size: 1.12rem; }
.sv-article__content > * { margin-block: 1.15rem; }
.sv-article__content h2 { margin-top: 2.3rem; display: inline-block; padding-bottom: 6px; background-image: var(--sv-squiggle); background-repeat: no-repeat; background-position: 0 100%; background-size: 100% 9px; }
.sv-article__content h3 { margin-top: 1.6rem; }
.sv-article__content img { border: 2.5px solid var(--sv-ink); border-radius: var(--sv-wobble); }
.sv-article__content a { text-decoration: underline; text-decoration-style: wavy; text-decoration-color: var(--sv-accent); text-underline-offset: 3px; }
.sv-article__content blockquote { border: none; position: relative; margin-inline: 0; padding: 1rem 1.4rem; background: var(--sv-panel); border-left: 4px dashed var(--sv-accent); border-radius: 8px; font-family: var(--sv-font-hand); font-size: 1.4rem; color: var(--sv-ink); }
.sv-article__content ul, .sv-article__content ol { padding-left: 1.3rem; }
.sv-article__content li { margin-bottom: 0.4rem; }

/* Breadcrumbs */
.sv-breadcrumbs { font-family: var(--sv-font-head); font-weight: 700; font-size: 0.85rem; color: var(--sv-ink-soft); margin-bottom: 1.1rem; }
.sv-breadcrumbs a { text-decoration: none; color: var(--sv-ink-soft); }
.sv-breadcrumbs a:hover { color: var(--sv-accent-ink); }
.sv-breadcrumbs [aria-current] { color: var(--sv-ink); }

/* Author bio */
.sv-author-bio { border: 2.5px dashed var(--sv-ink) !important; background: var(--sv-panel) !important; border-radius: var(--sv-wobble) !important; }

/* =========================================================
   Recipe card — the hand-drawn recipe box
   ========================================================= */
.sv-recipe {
  border: 3px solid var(--sv-ink);
  border-radius: var(--sv-wobble-lg);
  background: var(--sv-panel);
  padding: 2rem 2rem 2.25rem;
  margin: 2.75rem 0;
  box-shadow: var(--sv-shadow);
  position: relative;
}
.sv-recipe::before { content: "★"; position: absolute; top: -16px; left: 26px; background: var(--sv-accent); color: #fff; width: 34px; height: 34px; display: grid; place-items: center; border: 2.5px solid var(--sv-ink); border-radius: 50%; font-size: 1rem; }
.sv-recipe__head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; border-bottom: 2.5px dashed var(--sv-ink); padding-bottom: 1rem; margin-bottom: 1.35rem; }
.sv-recipe__label { font-family: var(--sv-font-hand); text-transform: none; letter-spacing: 0; font-size: 1.35rem; color: var(--sv-accent-ink); font-weight: 700; }
.sv-recipe__title { margin: 0.1rem 0 0; font-size: 1.7rem; }
.sv-recipe__stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)); gap: 0.75rem; margin-bottom: 1.6rem; }
.sv-recipe__stat { text-align: center; background: var(--sv-paper); border: 2.5px solid var(--sv-ink); border-radius: 16px 10px 18px 12px / 12px 18px 10px 16px; padding: 0.7rem 0.4rem; }
.sv-recipe__stat b { display: block; font-family: var(--sv-font-head); font-size: 1.15rem; font-weight: 900; }
.sv-recipe__stat span { font-size: 0.72rem; color: var(--sv-ink-soft); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 700; font-family: var(--sv-font-head); }
.sv-recipe h3 { font-family: var(--sv-font-hand); font-size: 1.7rem; font-weight: 700; margin: 1.4rem 0 0.7rem; color: var(--sv-accent-ink); }
.sv-recipe ul, .sv-recipe ol { padding-left: 1.3rem; }
.sv-recipe li { margin-bottom: 0.55rem; }
.sv-recipe ul li::marker { content: "✔ "; color: var(--sv-accent); }
.sv-rating { color: var(--sv-berry); font-size: 1.15rem; letter-spacing: 2px; }

/* =========================================================
   Sidebar
   ========================================================= */
.sv-sidebar .widget { background: var(--sv-paper); border: 2.5px solid var(--sv-ink); border-radius: var(--sv-wobble); padding: 1.35rem 1.5rem; margin-bottom: 1.75rem; box-shadow: var(--sv-shadow-sm); }
.sv-sidebar .widget:nth-child(even) { border-radius: 22px 14px 24px 16px / 16px 24px 14px 22px; }
.sv-sidebar .widget-title { font-family: var(--sv-font-hand); font-weight: 700; font-size: 1.6rem; margin: 0 0 0.85rem; padding-bottom: 4px; color: var(--sv-accent-ink); border: none; display: inline-block; background-image: var(--sv-squiggle); background-repeat: no-repeat; background-position: 0 100%; background-size: 100% 9px; }
.sv-sidebar ul { list-style: none; padding: 0; margin: 0; }
.sv-sidebar li { padding: 0.45rem 0; border-bottom: 1.5px dashed rgba(34,31,26,.25); font-family: var(--sv-font-head); font-weight: 600; font-size: 0.98rem; }
.sv-sidebar li:last-child { border-bottom: none; }
.sv-sidebar a { text-decoration: none; color: var(--sv-ink); }
.sv-sidebar a:hover { color: var(--sv-accent-ink); }

/* Reader Reviews widget */
.sv-reviews { display: grid; gap: 1.1rem; }
.sv-review { display: flex; gap: 0.85rem; margin: 0; padding: 0.95rem 1rem; background: var(--sv-panel); border: 2.5px solid var(--sv-ink); border-radius: 18px 12px 20px 14px / 14px 20px 12px 18px; }
.sv-review__avatar { flex: 0 0 auto; width: 56px; height: 56px; border-radius: 50%; border: 2.5px solid var(--sv-ink); object-fit: cover; background: #fff; }
.sv-review__body { min-width: 0; }
.sv-review__stars { color: var(--sv-berry); font-size: 0.95rem; letter-spacing: 1px; display: block; line-height: 1; }
.sv-review__text { font-family: var(--sv-font-hand); font-size: 1.18rem; line-height: 1.25; color: var(--sv-ink); margin: 0.35rem 0 0.4rem; border: none; padding: 0; }
.sv-review__meta { font-family: var(--sv-font-head); font-size: 0.82rem; color: var(--sv-ink-soft); }
.sv-review__name { font-weight: 800; color: var(--sv-ink); }
.sv-review__on { font-weight: 600; }
.sv-review__recipe { font-weight: 700; color: var(--sv-accent-ink); text-decoration: none; }
.sv-review__recipe:hover { color: var(--sv-berry); text-decoration: underline; text-decoration-style: wavy; }

/* =========================================================
   Pagination
   ========================================================= */
.sv-pagination { margin-top: 2.75rem; display: flex; justify-content: center; }
/* Reset the wrapping <ul> (it also carries the .page-numbers class) */
.sv-pagination ul.page-numbers { list-style: none; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin: 0; padding: 0; border: none; background: none; box-shadow: none; }
.sv-pagination li { margin: 0; padding: 0; border: none; background: none; }
/* Style only the actual buttons (a/span), not the container */
.sv-pagination a.page-numbers,
.sv-pagination span.page-numbers {
  font-family: var(--sv-font-head); font-weight: 800;
  display: inline-flex; min-width: 44px; height: 44px; align-items: center; justify-content: center;
  padding: 0 14px; border: 2.5px solid var(--sv-ink);
  border-radius: 14px 10px 16px 12px / 12px 16px 10px 14px;
  text-decoration: none; color: var(--sv-ink); background: var(--sv-paper);
  box-shadow: var(--sv-shadow-sm); transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.sv-pagination a.page-numbers:hover { transform: translate(-1px,-2px); box-shadow: var(--sv-shadow); background: var(--sv-accent); color: #fff; }
.sv-pagination span.current { background: var(--sv-accent); color: #fff; }
/* The "…" ellipsis is not a button */
.sv-pagination .page-numbers.dots { border: none; box-shadow: none; background: none; min-width: 0; padding: 0 4px; }

/* =========================================================
   Buttons, tags, search
   ========================================================= */
.sv-btn {
  display: inline-block; font-family: var(--sv-font-head); font-weight: 800; font-size: 1rem;
  background: var(--sv-accent); color: #fff; text-decoration: none;
  padding: 0.75rem 1.6rem; border: 2.5px solid var(--sv-ink);
  border-radius: var(--sv-wobble); box-shadow: var(--sv-shadow-sm); cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
.sv-btn:hover { color: #fff; transform: translate(-1px,-2px); box-shadow: var(--sv-shadow); }
.sv-btn:active { transform: translate(2px,2px); box-shadow: 1px 1px 0 var(--sv-ink); }

.sv-tags a { display: inline-block; font-family: var(--sv-font-head); font-weight: 700; font-size: 0.85rem; background: var(--sv-paper); border: 2px solid var(--sv-ink); padding: 4px 14px; border-radius: 999px; text-decoration: none; color: var(--sv-ink-soft); margin: 0 7px 7px 0; }
.sv-tags a:hover { background: var(--sv-accent); border-color: var(--sv-ink); color: #fff; }

.search-field { font-family: var(--sv-font-body); border: 2.5px solid var(--sv-ink) !important; border-radius: var(--sv-wobble) !important; }

/* =========================================================
   Comments
   ========================================================= */
.sv-comments { max-width: var(--sv-contentw); margin: 3rem auto 0; }
.sv-comments .comments-title { font-family: var(--sv-font-hand); font-size: 2rem; color: var(--sv-accent-ink); }
.sv-comments .comment-list { list-style: none; padding: 0; }
.sv-comments .comment-body { border: 2.5px solid var(--sv-ink); border-radius: var(--sv-wobble); padding: 1.1rem 1.3rem; margin-bottom: 1rem; background: var(--sv-paper); }
.sv-comments input[type="text"], .sv-comments input[type="email"], .sv-comments input[type="url"], .sv-comments textarea { border: 2.5px solid var(--sv-ink); border-radius: 12px; padding: .6rem .8rem; font-family: var(--sv-font-body); width: 100%; }

/* =========================================================
   Page header (archives, search)
   ========================================================= */
.page-title { font-family: var(--sv-font-head); }
.page-header .archive-description, .archive-description { color: var(--sv-ink-soft); }
.no-results { border: 2.5px dashed var(--sv-ink); border-radius: var(--sv-wobble); padding: 2rem; background: var(--sv-panel); }

/* =========================================================
   Footer
   ========================================================= */
.sv-footer { background: var(--sv-ink); color: #efe7d8; margin-top: 3.5rem; padding-block: 2.75rem; border-top: 3px solid var(--sv-accent); }
.sv-footer a { color: #fff; text-decoration: underline; text-decoration-style: wavy; text-decoration-color: var(--sv-accent); text-underline-offset: 3px; }
.sv-footer .widget-title { font-family: var(--sv-font-hand); font-weight: 700; font-size: 1.5rem; color: #fff; }
.sv-footer__cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2rem; }
.sv-footer__bottom { border-top: 2px dashed rgba(255,255,255,0.25); margin-top: 2rem; padding-top: 1.35rem; font-size: 0.92rem; color: #cabfa9; text-align: center; font-family: var(--sv-font-head); font-weight: 600; }

/* =========================================================
   WP core alignment helpers
   ========================================================= */
.alignwide { max-width: 1000px; margin-inline: auto; }
.alignfull { max-width: 100%; }
.aligncenter { margin-inline: auto; }
.wp-caption-text, .wp-element-caption { font-family: var(--sv-font-hand); font-size: 1.1rem; color: var(--sv-ink-soft); text-align: center; }
