/* Preview templates: recipe layout (Quick Look panel, ingredient table, numbered Prep/Steps),
   equipment and supplies pages. Builds on styles.css tokens. */

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.preview-bar { background: #FBF3E6; color: #4A3A20; text-align: center; font-size: 14px; font-weight: 600; padding: 8px 16px; }

/* Gray image placeholders */
.ph { background: #D9DCDA; border-radius: 12px; display: flex; align-items: flex-end; justify-content: flex-start; aspect-ratio: 1 / 1; padding: 12px; }
.ph span { font-size: 13px; color: #3A403C; background: rgba(255,255,255,0.85); padding: 4px 8px; border-radius: 6px; }
.ph-hero { flex: 1 1 400px; max-width: 460px; min-width: 0; align-self: center; }
.ph-wide { aspect-ratio: 3 / 1; margin: 40px 0 0; }
.ph-step { max-width: 360px; margin-top: 24px; }
.ph-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 24px; }
.ph-pick { width: 200px; flex: none; align-self: flex-start; }
.ph-thumb { width: 72px; flex: none; padding: 0; }
.ph-thumb span { display: none; }

/* Store buttons with "Coming soon" */
.store-row { display: flex; flex-wrap: wrap; gap: 10px; }
.soon-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.btn-store { min-height: 44px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--border); background: #fff; color: var(--ink); font: 600 15px var(--sans); cursor: not-allowed; }
.btn-store:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.soon { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.shop-box { background: var(--alt); border-radius: 16px; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.shop-box h2 { font-size: 18px; }
.fine { font-size: 13px; color: var(--muted); margin: 8px 0 0; }

/* Quick Look panel (labels in bold caps, like the 4-Hour Chef sidebar) */
.recipe-card-panel { padding-bottom: 72px; }
.panel { border-top: 3px solid var(--ink); padding-top: 24px; }
.panel .label { font-family: var(--sans); font-size: 15px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; margin: 22px 0 4px; }
.panel .label:first-child { margin-top: 0; }
.panel p { margin: 0; font-size: 18px; line-height: 1.55; }
.panel .shorthand { font-size: 17px; }
.equip-list { list-style: none; margin: 8px 0 0; padding: 0; }
.equip-item { border-top: 1px solid var(--line); padding: 14px 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.equip-name { font-size: 17px; font-weight: 600; }

/* Ingredient table: dark header bar, tinted rows separated by white gaps */
.ing-table { width: 100%; border-collapse: separate; border-spacing: 0 6px; margin-top: 16px; font-family: var(--display); }
.ing-table thead th { background: var(--ink); color: #fff; text-align: left; font-size: 22px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.02em; padding: 10px 14px; }
.ing-table thead th:first-child { width: 32%; border-right: 6px solid #fff; }
.ing-table tbody th, .ing-table tbody td { background: #CDE9DF; color: var(--ink); text-align: left; vertical-align: top; font-size: 18px; font-weight: 700; padding: 10px 14px; line-height: 1.3; }
.ing-table tbody th { border-right: 6px solid #fff; }

/* Prep / Steps with large two-digit numerals */
.method-block { margin-top: 48px; }
.method-head { font-family: var(--sans); font-weight: 400; font-size: 34px; text-transform: uppercase; letter-spacing: 0.02em; margin-bottom: 16px; }
.num-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 18px; }
.num-steps li { display: flex; gap: 14px; align-items: baseline; }
.num-steps .num { font-family: var(--sans); font-size: 30px; font-weight: 300; color: var(--accent); line-height: 1; min-width: 40px; }
.num-steps p { margin: 0; font-size: 18px; line-height: 1.6; }
.note, .care { margin-top: 40px; }
.disclaimer { margin-top: 32px; }

/* Equipment page (product-guide style) */
.page-title { font-weight: 800; font-size: clamp(34px, 4.5vw, 48px); line-height: 1.1; letter-spacing: -0.02em; margin: 8px 0 16px; }
.callout { background: var(--alt); border-radius: 12px; padding: 18px 20px; margin: 24px 0; font-size: 16px; line-height: 1.6; }
.toc { display: flex; flex-wrap: wrap; gap: 8px 16px; font-weight: 600; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cat-head { font-size: 28px; margin: 48px 0 8px; padding-bottom: 8px; border-bottom: 3px solid var(--ink); }
.pick { display: flex; flex-wrap: wrap; gap: 24px; padding: 28px 0; border-bottom: 1px solid var(--line); }
.pick-body { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.pick-body h3 { font-size: 24px; }
.pick-body p { margin: 0; font-size: 17px; line-height: 1.6; }
.pick-label { font-size: 13px !important; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.pick-model { color: var(--muted); font-size: 15px !important; }

/* Supplies page */
.supply-list { list-style: none; margin: 0; padding: 0; }
.supply { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 20px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.supply-text { flex: 1 1 260px; min-width: 0; }
.supply-text h3 { font-size: 19px; }
.supply-text p { margin: 4px 0 0; font-size: 16px; color: #3D4A43; }

/* Maintenance page */
.maint { min-height: 100vh; display: flex; align-items: center; justify-content: center; text-align: center; padding: 40px 24px; background: var(--alt); }
.maint-card { max-width: 560px; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.maint h1 { font-weight: 800; font-size: clamp(32px, 5vw, 46px); line-height: 1.1; }

@media (max-width: 600px) {
  .ph-pick { width: 100%; }
  .ing-table thead th { font-size: 17px; }
  .ing-table tbody th, .ing-table tbody td { font-size: 16px; }
}
@media print {
  .preview-bar, .store-row, .shop-box, .ph { display: none !important; }
}

/* Learn index */
.article-list { margin-top: 32px; }
.article-card { display: flex; flex-wrap: wrap; gap: 24px; padding: 28px 0; border-top: 1px solid var(--line); }
.ph-thumb-lg { width: 160px; flex: none; align-self: flex-start; }
.ph-thumb-lg span { display: none; }
.article-card-body { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.article-card-body h2 { font-size: 24px; line-height: 1.25; }
.article-card-body h2 a { color: var(--ink); text-decoration: none; }
.article-card-body h2 a:hover { color: var(--accent); text-decoration: underline; }
.article-card-body p { margin: 0; font-size: 17px; line-height: 1.6; }
.in-recipes { background: var(--tint); border-radius: 10px; padding: 10px 14px; font-size: 16px !important; }

/* Recipe table of contents */
.count { color: var(--muted); font-weight: 600; font-size: 20px; }
.toc-list { list-style: none; margin: 0; padding: 0; }
.toc-item { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.toc-name { font-size: 17px; font-weight: 500; }
.toc-name a { font-weight: 600; }
.toc-meta { display: flex; align-items: center; gap: 10px; }

/* Book page */
.book-hero { display: flex; flex-wrap: wrap; gap: 48px; align-items: flex-start; padding: 48px 0 32px; }
.ph-cover { flex: 0 1 340px; aspect-ratio: 3 / 4; }
.book-info { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.authors { margin: 0; font-size: 18px; font-weight: 600; }
.blurb { margin: 0; font-size: 18px; line-height: 1.65; }
.inside-list { margin: 0; padding-left: 22px; display: grid; gap: 6px; font-size: 17px; }
.edition { border: 1px solid var(--line); border-radius: 16px; padding: 22px; margin-top: 20px; display: flex; flex-direction: column; gap: 12px; }
.edition-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.edition h3 { font-size: 22px; }
.edition-price { font-weight: 700; font-size: 18px; }
.edition p { margin: 0; color: var(--muted); font-size: 16px; }

/* Google AdSense placeholders */
.ad-slot { margin: 40px auto; text-align: center; }
.ad-label { display: block; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.ad-box { border: 2px dashed #B8C0BB; border-radius: 8px; background: #F7F8F7; color: #5A645E; font-size: 14px; display: flex; align-items: center; justify-content: center; }
.ad-in-content .ad-box { min-height: 250px; max-width: 336px; margin: 0 auto; }
.ad-leaderboard .ad-box { min-height: 90px; max-width: 728px; margin: 0 auto; }
@media print { .ad-slot { display: none !important; } }

/* Home: featured recipe in the hero */
.featured { flex: 1 1 420px; min-width: 0; max-width: 520px; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 24px; overflow: hidden; text-decoration: none; color: var(--ink); background: #fff; }
.featured:hover { color: var(--ink); border-color: var(--border); }
.featured:hover .featured-title { text-decoration: underline; }
.featured-img { aspect-ratio: 16 / 9; border-radius: 0; }
.featured-body { padding: 20px 24px 24px; display: flex; flex-direction: column; gap: 10px; }
.featured-label { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.featured-title { font-size: 24px; line-height: 1.25; }
.featured-desc { margin: 0; font-size: 16px; color: var(--muted); line-height: 1.5; }
.featured-cta { font-weight: 700; color: var(--accent); }
.hero:has(.featured) { padding: 40px 0 48px; gap: 40px; }
.main-nav a.btn-primary, .main-nav a.btn-primary:hover { color: #fff; }

/* Fermenting page */
.method-grid { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; }
.method-card { display: flex; flex-direction: column; gap: 8px; }
.method-card h3 { font-size: 18px; line-height: 1.3; }
.method-card p { margin: 0; font-size: 14px; color: var(--muted); }
.ph-method span { display: none; }
.safety { margin-top: 40px; }
.safety-list { margin: 0; padding-left: 22px; display: grid; gap: 12px; font-size: 17px; line-height: 1.55; }
.safety-list .fine { font-size: 13px; }

/* About page */
.person { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; padding: 20px 0; border-bottom: 1px solid var(--line); }
.ph-portrait { width: 140px; flex: none; border-radius: 50%; }
.ph-portrait span { display: none; }
.person > div:not(.ph) { flex: 1 1 260px; min-width: 0; }
.person h3 { font-size: 22px; margin-bottom: 6px; }
.person p { margin: 0; font-size: 17px; line-height: 1.6; color: #3D4A43; }

/* Uploaded images (replace gray placeholders) */
img.img { display: block; width: 100%; height: auto; object-fit: cover; border-radius: 12px; }
img.img-hero { flex: 1 1 400px; max-width: 460px; min-width: 0; aspect-ratio: 1 / 1; border-radius: 24px; }
img.img-pick { width: 200px; flex: none; aspect-ratio: 1 / 1; align-self: flex-start; }
img.img-thumb { width: 72px; flex: none; aspect-ratio: 1 / 1; }
img.img-cover { flex: 0 1 340px; aspect-ratio: 3 / 4; }
img.featured-img { aspect-ratio: 16 / 9; border-radius: 0; }
a.btn-store { display: inline-flex; align-items: center; text-decoration: none; cursor: pointer; }

.btn-instacart { align-self: flex-start; }

/* Substitutions guide */
.sub-search { display: flex; flex-direction: column; gap: 6px; margin: 24px 0 8px; }
.sub-search label { font-weight: 600; }
.sub-search input { height: 50px; border: 1px solid var(--border); border-radius: 10px; padding: 0 14px; font: 16px var(--sans); }
.sub-card { border: 1px solid var(--line); border-radius: 14px; padding: 20px; margin-top: 16px; }
.sub-card[hidden], .sub-section[hidden] { display: none; }
.sub-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.sub-head h3 { font-size: 21px; }
.sub-amt { font-weight: 700; color: var(--accent-dark); }
.sub-label { margin: 10px 0 4px; font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.sub-swaps { margin: 0; padding-left: 22px; display: grid; gap: 6px; font-size: 17px; line-height: 1.5; }
.sub-note { margin: 10px 0 0; font-size: 15px; color: #3D4A43; }
.sub-meta { margin-top: 10px; }

.ph-section { margin: 12px 0 0; aspect-ratio: 3 / 1; }
.sub-intro { font-size: 17px; line-height: 1.6; margin: 14px 0 4px; color: #3D4A43; }
.sub-family { list-style: none; padding-left: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.sub-family li { background: var(--tint); color: var(--accent-dark); font-weight: 600; font-size: 15px; padding: 6px 12px; border-radius: 999px; }

/* Substitutions table */
.sub-page { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.sub-page .lede, .sub-page .callout, .sub-page .sub-search, .sub-page .sub-intro { max-width: 760px; }
.sub-table-wrap { margin-top: 16px; }
.sub-table { width: 100%; border-collapse: collapse; font-size: 16px; line-height: 1.5; }
.sub-table thead th { text-align: left; font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; border-bottom: 2px solid var(--ink); }
.sub-table tbody th, .sub-table tbody td { text-align: left; vertical-align: top; padding: 14px 12px; border-bottom: 1px solid var(--line); }
.sub-table tbody th { font-weight: 700; width: 20%; }
.sub-table td:nth-child(2) { width: 11%; font-weight: 600; color: var(--accent-dark); white-space: nowrap; }
.sub-table td:nth-child(3) { width: 31%; }
.sub-table td:nth-child(4) { color: #3D4A43; }
.sub-table .sub-src { width: 16%; font-size: 14px; }
.sub-table tr[hidden] { display: none; }
.sub-table .sub-swaps { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 16px; }
.sub-table .sub-family { padding-left: 0; }
.sub-table .sub-family li { font-size: 14px; padding: 4px 10px; }
.sub-table .sub-label { display: block; margin: 0 0 6px; }
@media (max-width: 760px) {
  .sub-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .sub-table, .sub-table tbody, .sub-table tr, .sub-table th, .sub-table td { display: block; width: auto !important; }
  .sub-table tbody tr { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
  .sub-table tbody th, .sub-table tbody td { border: 0; padding: 4px 0; white-space: normal !important; }
  .sub-table tbody th { font-size: 19px; }
  .sub-table tbody td::before { content: attr(data-label); display: block; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
  .sub-table tbody td:empty { display: none; }
}
.sub-table .sub-family { display: flex; flex-wrap: wrap; gap: 6px; }
.sub-page .ph-section { aspect-ratio: 5 / 1; }
