/*
Theme Name: RecipePanel Mobile
Theme URI: https://recipepanel.com
Description: Mobile layer for Recipe Panel — sticky header, hamburger nav drawer, chip filters, home/category/article layouts and a sticky ad bar. Child theme of recipepanel-theme, implementing the "RecipePanel Mobile v2" Claude Design prototype.
Author: Recipe Panel
Template: recipepanel-theme
Version: 1.0.0
Text Domain: recipepanel-mobile
*/

/*
Design tokens (do not rename without updating every reference below):
  ink       #191817   headings, primary text, active borders
  body      #3a3735   body copy
  muted     #6e6963   secondary meta text
  border    #e6e2dc   hairlines
  surface   #ffffff   page background
  surface-2 #faf8f5   footer / subtle panels
  surface-3 #f1eee9   hover fills, thumbnail placeholder stripe A
  gold      #b8811f   links / tagline
  gold-2    #d99a2b   accents, step-number badges, hover borders
  category  #c2452d   eyebrow / category label
Breakpoint: 900px is the mobile/desktop switch (matches isMobile = innerWidth < 900 in the source design).
*/

:root {
  --rp-ink: #191817;
  --rp-body: #3a3735;
  --rp-muted: #6e6963;
  --rp-border: #e6e2dc;
  --rp-surface: #ffffff;
  --rp-surface-2: #faf8f5;
  --rp-surface-3: #f1eee9;
  --rp-gold: #b8811f;
  --rp-gold-2: #d99a2b;
  --rp-category: #c2452d;
  --rp-font-display: "Playfair Display", Georgia, serif;
  --rp-font-body: "Karla", "Helvetica Neue", Arial, sans-serif;
  --rp-font-script: "Caveat", cursive;
  --rp-header-h: 64px;
}

.rp-root { min-height: 100vh; display: flex; flex-direction: column; background: var(--rp-surface); }
.rp-root, .rp-root * { box-sizing: border-box; }
.rp-root img, .rp-root svg { max-width: 100%; height: auto; }
.rp-root a { color: var(--rp-ink); text-decoration: none; }
.rp-root a:hover { color: var(--rp-gold); }
.rp-root button { font-family: var(--rp-font-body); }
.rp-root :focus-visible { outline: 0; box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--rp-ink); }

@keyframes rp-slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes rp-fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes rp-riseIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Header ---------- */
.rp-header { position: sticky; top: 0; z-index: 300; background: var(--rp-surface); border-bottom: 2px solid var(--rp-ink); }
.rp-header-inner { max-width: 1180px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 16px; min-height: var(--rp-header-h); }
.rp-logo { display: flex; align-items: center; gap: 10px; min-height: 48px; flex: 0 0 auto; }
.rp-logo-mark { width: 38px; height: 38px; flex: 0 0 38px; aspect-ratio: 1/1; background: var(--rp-ink); color: #fff; display: grid; place-items: center; font-family: var(--rp-font-display); font-size: 23px; line-height: 1; }
.rp-logo-text { display: flex; flex-direction: column; line-height: 1; }
.rp-logo-word { font-family: var(--rp-font-display); font-size: 25px; font-weight: 500; letter-spacing: -0.01em; color: var(--rp-ink); white-space: nowrap; }
.rp-logo-tag { font-family: var(--rp-font-script); font-size: 16px; font-weight: 500; color: var(--rp-gold); margin-top: 2px; white-space: nowrap; }
.rp-header-spacer { flex: 1 1 auto; }

.rp-nav-desktop { display: none; align-items: center; gap: 4px; flex-wrap: nowrap; }
.rp-nav-desktop a { padding: 12px; font-family: var(--rp-font-body); font-size: 16.5px; font-weight: 600; color: var(--rp-ink); white-space: nowrap; min-height: 48px; display: flex; align-items: center; border-bottom: 3px solid transparent; }
.rp-nav-desktop a:hover { border-bottom-color: var(--rp-gold-2); color: var(--rp-ink); }

.rp-menu-btn { min-width: 96px; height: 48px; flex: 0 0 auto; border: 2px solid var(--rp-ink); background: var(--rp-surface); border-radius: 6px; display: flex; align-items: center; justify-content: center; gap: 9px; padding: 0 14px; cursor: pointer; }
.rp-menu-btn:active { background: var(--rp-surface-3); }
.rp-menu-btn-bars { display: flex; flex-direction: column; gap: 4px; }
.rp-menu-btn-bars span { display: block; width: 22px; height: 2.5px; background: var(--rp-ink); }
.rp-menu-btn-label { font-size: 14px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--rp-ink); }

/* ---------- Mobile drawer ---------- */
.rp-nav-overlay { position: fixed; inset: 0; z-index: 400; background: rgba(25, 24, 23, 0.55); animation: rp-fadeIn 0.18s ease both; display: none; }
.rp-nav-overlay.is-open { display: block; }
.rp-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 500; width: min(340px, 88vw); background: var(--rp-surface); box-shadow: 0 14px 40px rgba(25, 24, 23, 0.13); animation: rp-slideIn 0.22s cubic-bezier(0.22, 1, 0.36, 1) both; display: none; flex-direction: column; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.rp-drawer.is-open { display: flex; }
.rp-drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 12px 14px 20px; border-bottom: 2px solid var(--rp-ink); }
.rp-drawer-eyebrow { font-family: var(--rp-font-body); font-size: 12px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--rp-body); }
.rp-drawer-close { min-width: 88px; height: 48px; border: 2px solid var(--rp-ink); background: var(--rp-surface); border-radius: 6px; cursor: pointer; font-size: 14px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--rp-ink); }
.rp-drawer-close:hover { background: var(--rp-surface-3); }
.rp-drawer-nav { display: flex; flex-direction: column; padding: 6px 10px 20px; }
.rp-drawer-nav a { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; padding: 14px 12px; border-bottom: 1px solid var(--rp-border); font-size: 19px; font-weight: 600; color: var(--rp-ink); }
.rp-drawer-nav a:hover { background: #faf8f5; color: var(--rp-gold); }
.rp-drawer-nav .rp-count { font-size: 15px; font-weight: 500; color: var(--rp-muted); }
.rp-drawer-foot { margin-top: auto; padding: 18px 20px 26px; border-top: 1px solid var(--rp-border); }
.rp-drawer-search { display: flex; align-items: center; justify-content: center; min-height: 54px; background: var(--rp-ink); color: #fff; font-size: 17px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; border-radius: 6px; }
.rp-drawer-search:hover { background: var(--rp-body); color: #fff; }

@media (min-width: 900px) {
  .rp-nav-desktop { display: flex; }
  .rp-menu-btn, .rp-nav-overlay, .rp-drawer { display: none !important; }
}

/* ---------- Main / breadcrumb ---------- */
.rp-main { flex: 1 1 auto; width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px 64px; }
.rp-crumbs { display: flex; align-items: center; gap: 10px; font-size: 16px; color: var(--rp-body); margin-bottom: 14px; flex-wrap: wrap; }
.rp-crumbs a { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; color: var(--rp-ink); }

/* ---------- Home hero ---------- */
.rp-hero { padding: 32px 0 28px; border-bottom: 1px solid var(--rp-border); }
.rp-hero-eyebrow { margin: 0 0 12px; font-size: 12px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--rp-category); }
.rp-hero h1 { margin: 0 0 16px; font-family: var(--rp-font-display); font-weight: 400; font-size: clamp(36px, 9vw, 62px); line-height: 1.12; letter-spacing: -0.01em; color: var(--rp-ink); text-wrap: pretty; }
.rp-hero p { margin: 0; font-size: 19px; line-height: 1.65; color: var(--rp-body); max-width: 44ch; text-wrap: pretty; }

/* ---------- Chip scroller ---------- */
.rp-chips { display: flex; gap: 10px; overflow-x: auto; margin: 0 -20px; padding: 22px 20px 24px; scrollbar-width: none; }
.rp-chips::-webkit-scrollbar { display: none; }
.rp-chip { flex: 0 0 auto; min-height: 48px; display: flex; align-items: center; padding: 10px 20px; border-radius: 999px; border: 2px solid var(--rp-ink); background: var(--rp-surface); font-size: 16.5px; font-weight: 600; color: var(--rp-ink); white-space: nowrap; }
.rp-chip:hover { background: var(--rp-ink); color: #fff; }

/* ---------- Section heading ---------- */
.rp-section-h2 { margin: 0 0 18px; padding-bottom: 10px; border-bottom: 2px solid var(--rp-ink); font-family: var(--rp-font-body); font-size: 13px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--rp-ink); }

/* ---------- Grid (home) ---------- */
.rp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 28px 24px; }
.rp-card { position: relative; z-index: 1; display: flex; flex-direction: column; color: inherit; animation: rp-riseIn 0.28s ease both; }
.rp-card:hover { color: inherit; }
.rp-card-thumb { position: relative; aspect-ratio: 4/3; width: 100%; overflow: hidden; background: repeating-linear-gradient(135deg, var(--rp-surface-3) 0 10px, var(--rp-border) 10px 20px); display: block; }
.rp-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rp-card-body { padding: 14px 0 0; display: flex; flex-direction: column; gap: 8px; }
.rp-eyebrow-cat { font-size: 12px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--rp-category); }
.rp-card-title { margin: 0; font-family: var(--rp-font-display); font-weight: 500; font-size: 25px; line-height: 1.22; letter-spacing: -0.01em; color: var(--rp-ink); text-wrap: pretty; }
.rp-card-meta { font-size: 16px; color: var(--rp-body); }

/* ---------- Row list (category archive) ---------- */
.rp-cat-head { padding: 28px 0 24px; border-bottom: 2px solid var(--rp-ink); }
.rp-cat-head h1 { margin: 0 0 12px; font-family: var(--rp-font-display); font-weight: 400; font-size: clamp(32px, 8vw, 50px); line-height: 1.14; letter-spacing: -0.01em; color: var(--rp-ink); }
.rp-cat-head p { margin: 0; font-size: 18.5px; line-height: 1.65; color: var(--rp-body); max-width: 50ch; text-wrap: pretty; }

.rp-rowlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 0 28px; padding-top: 8px; }
.rp-row { position: relative; z-index: 1; display: flex; gap: 16px; align-items: center; padding: 18px 0; border-bottom: 1px solid var(--rp-border); color: inherit; animation: rp-riseIn 0.28s ease both; }
.rp-row:hover { color: inherit; }
.rp-row-thumb { flex: 0 0 104px; width: 104px; aspect-ratio: 1/1; overflow: hidden; background: repeating-linear-gradient(135deg, var(--rp-surface-3) 0 10px, var(--rp-border) 10px 20px); }
.rp-row-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rp-row-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rp-row-title { margin: 0; font-family: var(--rp-font-display); font-weight: 500; font-size: 22px; line-height: 1.24; color: var(--rp-ink); text-wrap: pretty; }

/* ---------- Load more ---------- */
.rp-loadmore-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 40px 0 0; }
.rp-loadmore-btn { width: 100%; max-width: 420px; min-height: 56px; padding: 14px 28px; border-radius: 6px; border: 2px solid var(--rp-ink); background: var(--rp-ink); color: #fff; font-size: 17px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; cursor: pointer; }
.rp-loadmore-btn:hover { background: var(--rp-body); border-color: var(--rp-body); }
.rp-loadmore-btn[disabled] { opacity: 0.55; cursor: default; }
.rp-count-label { font-size: 15.5px; color: var(--rp-body); }

/* ---------- Article ---------- */
.rp-article { max-width: 700px; margin: 0 auto; padding: 26px 0 0; }
.rp-article h1 { margin: 0 0 16px; font-family: var(--rp-font-display); font-weight: 400; font-size: clamp(34px, 8.5vw, 54px); line-height: 1.12; letter-spacing: -0.01em; color: var(--rp-ink); text-wrap: pretty; }
.rp-article-meta { display: flex; flex-wrap: wrap; gap: 10px 22px; padding-bottom: 22px; border-bottom: 1px solid var(--rp-border); font-size: 16.5px; color: var(--rp-body); }
.rp-article-hero { aspect-ratio: 3/2; width: 100%; margin: 24px 0 28px; overflow: hidden; background: repeating-linear-gradient(135deg, var(--rp-surface-3) 0 11px, var(--rp-border) 11px 22px); }
.rp-article-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rp-article-intro { margin: 0 0 30px; font-size: 20px; line-height: 1.68; color: var(--rp-ink); text-wrap: pretty; }
.rp-article-content { font-size: 18.5px; line-height: 1.65; color: var(--rp-ink); }
.rp-article-content h2 { margin: 34px 0 20px; padding-bottom: 10px; border-bottom: 2px solid var(--rp-ink); font-family: var(--rp-font-display); font-weight: 500; font-size: 30px; letter-spacing: -0.01em; color: var(--rp-ink); }
.rp-back-wrap { display: flex; justify-content: center; padding: 38px 0 8px; }
.rp-back-btn { width: 100%; max-width: 420px; min-height: 56px; padding: 14px 26px; border-radius: 6px; border: 2px solid var(--rp-ink); background: var(--rp-surface); font-size: 17px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--rp-ink); cursor: pointer; }
.rp-back-btn:hover { background: var(--rp-ink); color: #fff; }

/* Best-effort re-skin of WP Recipe Maker's default markup to match the design's
   ingredient/step list (right-aligned quantity, numbered gold-circle steps).
   Verify these selectors against the live recipe card — WPRM class names vary
   slightly by template/version. */
.rp-article-content .wprm-recipe-container { margin: 0 0 34px; }
.rp-article-content .wprm-recipe-ingredients-container h3,
.rp-article-content .wprm-recipe-instructions-container h3 { display: none; }
.rp-article-content .wprm-recipe-ingredients { list-style: none; margin: 0; padding: 0; }
.rp-article-content .wprm-recipe-ingredient { display: flex; justify-content: space-between; align-items: baseline; gap: 18px; padding: 15px 2px; border-bottom: 1px solid var(--rp-border); font-size: 18.5px; line-height: 1.5; color: var(--rp-ink); }
.rp-article-content .wprm-recipe-ingredient-name { flex: 1 1 auto; }
.rp-article-content .wprm-recipe-ingredient-amount,
.rp-article-content .wprm-recipe-ingredient-unit { font-weight: 700; color: var(--rp-body); white-space: nowrap; }
.rp-article-content .wprm-recipe-instructions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 24px; }
.rp-article-content .wprm-recipe-instruction { display: flex; gap: 16px; }
.rp-article-content .wprm-recipe-instruction-text { margin: 0; padding-top: 3px; font-size: 19px; line-height: 1.68; color: var(--rp-ink); }
.rp-article-content .wprm-recipe-instruction::before {
  content: counter(rp-step); counter-increment: rp-step;
  flex: 0 0 38px; width: 38px; height: 38px; background: var(--rp-gold-2); color: var(--rp-ink);
  display: grid; place-items: center; font-size: 18px; font-weight: 700; border-radius: 999px;
}
.rp-article-content .wprm-recipe-instructions { counter-reset: rp-step; }

/* ---------- Footer ---------- */
.rp-footer { border-top: 2px solid var(--rp-ink); background: var(--rp-surface-2); }
.rp-footer-inner { max-width: 1180px; margin: 0 auto; padding: 34px 20px 112px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 30px; }
.rp-footer-brand { display: flex; flex-direction: column; gap: 10px; }
.rp-footer-brand-name { font-family: var(--rp-font-display); font-size: 24px; font-weight: 500; color: var(--rp-ink); }
.rp-footer-brand-blurb { font-size: 16.5px; line-height: 1.6; color: var(--rp-body); max-width: 30ch; }
.rp-footer-col { display: flex; flex-direction: column; gap: 12px; }
.rp-footer-label { font-size: 12px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--rp-ink); }
.rp-footer-links { display: flex; flex-direction: column; gap: 4px; }
.rp-footer-links a { font-size: 17px; min-height: 44px; display: flex; align-items: center; color: var(--rp-ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.rp-footer-links a:hover { color: var(--rp-gold); }

/* ---------- Sticky ad bar ---------- */
.rp-adbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 200; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); background: var(--rp-surface); border-top: 2px solid var(--rp-ink); display: flex; align-items: center; gap: 14px; animation: rp-riseIn 0.25s ease both; }
.rp-adbar.is-hidden { display: none; }
.rp-adbar-thumb { flex: 0 0 52px; width: 52px; aspect-ratio: 1/1; background: repeating-linear-gradient(135deg, var(--rp-surface-3) 0 8px, var(--rp-border) 8px 16px); }
.rp-adbar-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rp-adbar-sponsored { font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--rp-muted); }
.rp-adbar-title { font-size: 16.5px; font-weight: 600; color: var(--rp-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-adbar-close { min-width: 88px; height: 48px; flex: 0 0 auto; border: 2px solid var(--rp-ink); background: var(--rp-surface); border-radius: 6px; cursor: pointer; font-size: 14px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--rp-ink); }
.rp-adbar-close:hover { background: var(--rp-surface-3); }

body.rp-has-adbar { padding-bottom: 76px; }
@media (min-width: 900px) { body.rp-has-adbar { padding-bottom: 0; } .rp-adbar { max-width: 1180px; margin: 0 auto; left: 0; right: 0; border: 2px solid var(--rp-ink); border-radius: 10px; bottom: 16px; } }
