/* =========================================================
   Love2Feed Recipe Test CSS (Phase 1)
   - Used ONLY by /testweb/recipe-test.html
   - Does NOT touch production /styles.css
   - Includes minimal styling for production header markup
========================================================= */

:root{
  --bg: #0f1115;
  --card: #151a22;
  --card2: #10141b;
  --text: #e9eef6;
  --muted: #a8b3c7;
  --line: rgba(255,255,255,.10);
  --accent: #4da3ff;
  --accent2: #67e8f9;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --radius: 18px;
}

*{ box-sizing: border-box; }
html,body{ height:100%; }

body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background:
    radial-gradient(1000px 800px at 10% -10%, rgba(77,163,255,.15), transparent 60%),
    radial-gradient(900px 700px at 90% 0%, rgba(103,232,249,.10), transparent 55%),
    var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a{ color: inherit; text-decoration: none; }
a:hover{ color: var(--accent2); }

.sr-only{
  position:absolute;
  width:1px;height:1px;
  padding:0;margin:-1px;
  overflow:hidden;clip:rect(0,0,0,0);
  white-space:nowrap;border:0;
}

/* =========================================================
   PRODUCTION HEADER MARKUP SUPPORT (without /styles.css)
   Matches the header structure copied from web/index.html
========================================================= */

.top{
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(15,17,21,.70);
  border-bottom: 1px solid var(--line);
}

.container{
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.top-inner{
  padding: 14px 0;
}

.top-row{
  display:grid;
  grid-template-columns: 1fr auto 1fr;
  align-items:center;
}

.brand{
  grid-column:2;
  justify-self:center;
}

.site-logo{
  height: 34px;
  width: auto;
  display:block;
}

.search-wrapper{
  flex: 1;
  min-width: 0;
}

.searchbox{
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  padding: 6px;
}

/* Suggestions dropdown container used by your header markup */
.suggestions-panel{
  margin-top: 8px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(15,17,21,.92);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* If suggestions are rendered as buttons/links */
.suggestions-panel .suggestion-item,
.suggestions-panel button,
.suggestions-panel a{
  width: 100%;
  display:block;
  text-align:left;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.suggestions-panel .suggestion-item:hover,
.suggestions-panel button:hover,
.suggestions-panel a:hover{
  background: rgba(255,255,255,.05);
}

/* Stats + active filters placeholders */
.subrow{ margin-top: 10px; }
.stats{ color: var(--muted); font-size: 13px; }
.active-filters{ margin-top: 10px; }

/* =========================================================
   MAIN LAYOUT
========================================================= */

.shell{
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.recipe{
  padding-bottom: 12px;
}

/* Breadcrumbs */
.crumbs{
  margin: 18px 0 10px;
  font-size: 13px;
  color: var(--muted);
}
.crumbs .sep{ margin: 0 8px; opacity:.6; }

/* Recipe card */
.recipe-card{
  background: linear-gradient(180deg, rgba(255,255,255,.04), transparent 30%), var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

/* =========================================================
   HERO
========================================================= */

.recipe-hero{
  display:grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 18px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.hero-text{ padding: 8px 6px; }

.recipe-title{
  margin: 0 0 10px;
  font-size: clamp(26px, 3vw, 40px);
  letter-spacing: -0.3px;
}

.meta-row{
  display:flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
}

.rating{
  display:flex;
  align-items:center;
  gap: 10px;
  color: var(--muted);
}
.stars{ letter-spacing: 2px; color: #ffd166; }
.rating-value{ color: var(--text); font-weight: 700; }
.rating-count{ color: var(--muted); }

.facts{
  display:flex;
  flex-wrap:wrap;
  gap: 8px;
}

.pill{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.03);
  color: var(--muted);
  font-size: 13px;
}

.recipe-desc{
  margin: 10px 0 12px;
  color: var(--text);
  opacity: .95;
  max-width: 62ch;
}

.jump-links{
  display:flex;
  flex-wrap:wrap;
  gap: 10px;
  margin: 8px 0 10px;
}
.jump-links a{
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.03);
  color: var(--muted);
  font-size: 13px;
}
.jump-links a:hover{
  color: var(--text);
  border-color: rgba(77,163,255,.35);
}

.share-row{
  display:flex;
  align-items:center;
  gap: 10px;
  margin-top: 10px;
}

.share-status{
  color: var(--muted);
  font-size: 13px;
  min-height: 18px;
}

.recipe-social-actions{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin: 14px 0 12px;
}

.recipe-social-chip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:10px 12px;
  border-radius:999px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.03);
  color: var(--muted);
  cursor:pointer;
  font-size:13px;
  transition: border-color .18s ease, background .18s ease, color .18s ease, transform .06s ease;
}

.recipe-social-chip:hover{
  border-color: rgba(77,163,255,.35);
  color: var(--text);
}

.recipe-social-chip:active{
  transform: translateY(1px);
}

.recipe-social-chip.is-active{
  border-color: rgba(77,163,255,.55);
  background: rgba(77,163,255,.12);
  color: var(--text);
}

.recipe-social-chip__icon{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:18px;
  min-width:18px;
  line-height:1;
}

.recipe-social-chip__label{
  white-space:nowrap;
}

.recipe-social-chip__count{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:24px;
  padding:2px 8px;
  border-radius:999px;
  background: rgba(255,255,255,.06);
  color: var(--text);
  font-weight:600;
}

.recipe-action-toast{
  position:fixed;
  left:50%;
  bottom:24px;
  transform:translateX(-50%) translateY(12px);
  background:#111827;
  color:#fff;
  border-radius:999px;
  padding:12px 18px;
  font-size:14px;
  font-weight:500;
  box-shadow:0 12px 30px rgba(0,0,0,.35);
  opacity:0;
  pointer-events:none;
  transition:opacity .25s ease, transform .25s ease;
  z-index:9999;
}

.recipe-action-toast.is-visible{
  opacity:1;
  transform:translateX(-50%) translateY(0);
}

/* Hero media */
.hero-media{
  margin: 0;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--card2);
  align-self: start;
}
.hero-media img{
  width: 100%;
  height: auto;
  display:block;
}

/* Buttons */
.btn{
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(77,163,255,.35);
  background: rgba(77,163,255,.18);
  color: var(--text);
  cursor: pointer;
}
.btn:hover{ border-color: rgba(103,232,249,.40); }

.btn-ghost{
  background: rgba(255,255,255,.03);
  border-color: var(--line);
  color: var(--muted);
}
.btn-ghost:hover{
  color: var(--text);
  border-color: rgba(77,163,255,.35);
}

/* =========================================================
   BODY GRID
========================================================= */

.grid{
  display:grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  padding: 16px 18px 18px;
}

.toc{ position: relative; }

.toc-box{
  position: sticky;
  top: 88px;
  display:flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.03);
}

.toc-title{
  font-weight: 750;
  letter-spacing: .2px;
  margin-bottom: 2px;
}

.toc-box a{
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 12px;
}
.toc-box a:hover{
  background: rgba(255,255,255,.04);
  color: var(--text);
}

/* Ad placeholder */
.ad-slot{
  margin-top: 14px;
  padding: 14px;
  border-radius: 16px;
  border: 1px dashed rgba(255,255,255,.18);
  background: rgba(255,255,255,.02);
}
.ad-label{
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
  letter-spacing: .3px;
}
.ad-box{
  height: 240px;
  display:grid;
  place-items:center;
  color: rgba(255,255,255,.35);
  background: rgba(255,255,255,.02);
  border-radius: 12px;
}

/* Content blocks */
.content{ min-width: 0; }

.block{
  padding: 14px 14px 10px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.02);
  margin-bottom: 14px;
}

.block-head{
  display:flex;
  align-items:flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.block h2{
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.2px;
}

.block-sub{
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.block-actions{ display:flex; gap: 8px; }

/* Ingredients + steps */
.ingredients{
  margin: 0;
  padding-left: 18px;
  color: rgba(233,238,246,.96);
}
.ingredients li{ margin: 8px 0; }

.steps{
  margin: 0;
  padding-left: 20px;
}
.steps li{
  margin: 10px 0 12px;
  padding: 10px 10px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.02);
}

/* Nutrition */
.nutrition{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.nutri-row{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.02);
  color: var(--muted);
}
.nutri-row strong{ color: var(--text); }

/* Tips */
.bullets{
  margin: 0;
  padding-left: 18px;
  color: rgba(233,238,246,.96);
}
.bullets li{ margin: 8px 0; }

/* Related */
.related-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.related-card{
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.02);
  overflow: hidden;
}

.related-card:hover{
  border-color: rgba(77,163,255,.35);
}

.related-thumb{
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  min-width: 56px;
  min-height: 56px;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: #233b53;
}

.related-thumb img{
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.related-meta{
  min-width: 0;
  flex: 1 1 auto;
}

.related-title{
  font-weight: 750;
  margin: 0 0 2px;
  line-height: 1.3;
}

.related-sub{
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
}

/* Footer (test page) */
.site-footer{
  margin-top: 18px;
  border-top: 1px solid var(--line);
  background: rgba(0,0,0,.18);
}
.footer-inner{
  display:flex;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 0;
  color: var(--muted);
}
.foot-brand{
  font-weight: 800;
  color: var(--text);
}
.foot-links{
  display:flex;
  gap: 12px;
}
.foot-links a{ color: var(--muted); }
.foot-links a:hover{ color: var(--text); }

/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 980px){
  .recipe-hero{ grid-template-columns: 1fr; }
  .grid{ grid-template-columns: 1fr; }
  .toc-box{ position: relative; top: 0; }
  .related-grid{ grid-template-columns: 1fr; }
  .nutrition{ grid-template-columns: 1fr; }

  .top-row{ flex-direction: column; align-items: stretch; }
  .brand{ justify-content: center; }
  .search-wrapper{ width: 100%; }
    .recipe-social-actions{ gap:8px; }
  .recipe-social-chip{ width:100%; justify-content:space-between; }
}
/* ===== Header search polish (test page only) ===== */
.search-wrapper{
  flex: 1;
  max-width: 520px;          /* stops it looking huge next to logo */
  min-width: 260px;
  position: relative;
}

#header-search{
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color: var(--text);
  outline: none;
}

#header-search::placeholder{
  color: rgba(233,238,246,.55);
}

#header-search:focus{
  border-color: rgba(77,163,255,.55);
  box-shadow: 0 0 0 4px rgba(77,163,255,.14);
}

/* Suggestions dropdown that header-search.js uses */
#header-suggestions{
  position: absolute;
  left: 0;
  right: 0;
  top: calc(42px + 10px);
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(15,17,21,.96);
  box-shadow: var(--shadow);
  overflow: hidden;
  z-index: 80;
}

/* Make any suggestion rows look consistent regardless of element type */
#header-suggestions a,
#header-suggestions button,
#header-suggestions .suggestion-item{
  display: block;
  width: 100%;
  padding: 12px 14px;
  text-align: left;
  background: transparent;
  border: 0;
  color: var(--text);
  cursor: pointer;
}

#header-suggestions a:hover,
#header-suggestions button:hover,
#header-suggestions .suggestion-item:hover{
  background: rgba(255,255,255,.06);
}

/* Mobile: full width, stacked nicely */
@media (max-width: 980px){
  .search-wrapper{
    max-width: none;
    width: 100%;
    min-width: 0;
  }
}
/* ===== Ad placeholders (test only) ===== */
.ad-placeholder{
  border-radius: 16px;
  border: 1px dashed rgba(255,255,255,.18);
  background: rgba(255,255,255,.02);
  overflow: hidden;
}

.ad-placeholder .ad-label{
  font-size: 12px;
  letter-spacing: .3px;
  color: var(--muted);
  padding: 10px 12px;
  border-bottom: 1px dashed rgba(255,255,255,.12);
}

.ad-placeholder .ad-box{
  display: grid;
  place-items: center;
  color: rgba(255,255,255,.35);
  padding: 14px;
}

.ad-300x600 .ad-box{ height: 600px; }
.ad-in-article .ad-box{ height: 250px; }
.ad-multiplex .ad-box{ height: 280px; }

/* Mobile: reduce tall sidebar ad */
@media (max-width: 980px){
  .ad-300x600 .ad-box{ height: 250px; }
}
@media (max-width: 980px){
  .toc{ display:none; }
}
/* ===== TEST ADS (placeholders) ===== */
.ad-placeholder{
  display: block !important;
  margin: 14px 0;
  border-radius: 16px;
  border: 1px dashed rgba(255,255,255,.18);
  background: rgba(255,255,255,.02);
  overflow: hidden;
}

.ad-placeholder .ad-label{
  font-size: 12px;
  letter-spacing: .3px;
  color: var(--muted);
  padding: 10px 12px;
  border-bottom: 1px dashed rgba(255,255,255,.12);
}

.ad-placeholder .ad-box{
  display: grid;
  place-items: center;
  color: rgba(255,255,255,.45);
  padding: 16px;
  text-align: center;
  line-height: 1.25;
  min-height: 120px;
}

/* sizes */
.ad-300x600 .ad-box{ height: 600px; }
.ad-in-article .ad-box{ height: 250px; }
.ad-multiplex .ad-box{ height: 280px; }

/* mobile: prevent huge sidebar ad */
@media (max-width: 980px){
  .ad-300x600 .ad-box{ height: 250px; }
}
/* ===== Recipe details (SQL-only) ===== */
.details{
  display: grid;
  gap: 10px;
}

.detail-row{
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  border-radius: 14px;
}

.detail-row span{
  color: var(--muted);
  font-size: 14px;
}

.detail-row strong{
  color: var(--text);
  font-weight: 650;
}
.ad-slot{
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  border-radius: 14px;
  padding: 10px;
  overflow: hidden;
}

.ad-slot--sidebar{
  /* makes 300–336px units look natural on desktop */
  max-width: 336px;
  margin-top: 14px;
}

.ad-slot--inarticle,
.ad-slot--native{
  margin: 18px 0;
}

@media (max-width: 980px){
  /* sidebar collapses into content flow on mobile */
  .ad-slot--sidebar{
    max-width: 100%;
  }
}
