/* CookCalculator — Shared Stylesheet
   Referenced from all pages via <link rel="stylesheet" href="/style.css">
   Page-specific overrides stay in a small inline <style> block per page.
   Last updated: 2026-04-17
*/

/* ── CSS Variables ── */
:root {
  --bg: #FFFBF5;
  --card: #FFFFFF;
  --accent: #AC5316;
  --accent-hover: #8B4212;
  --accent-light: #FFF3EB;
  --text: #2D2A26;
  --text-light: #6B6560;
  --border: #E8E2DA;
  --tag-bg: #FFF3EB;
  --tag-text: #9E3A0E;
  --green: #1A7A43;
  --green-bg: #EAFAF0;
  --blue: #1D4FBF;
  --blue-bg: #EFF6FF;
  --purple: #8B5CF6;
  --purple-bg: #F3F0FF;
  --color-scheme: light;
}

/* ── Dark mode ── */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1C1916;
    --card: #252220;
    --text: #EDE7DE;
    --text-light: #9E9690;
    --border: #3A3632;
    --tag-bg: #3A2318;
    --tag-text: #D4845A;
    --accent-light: #2E1A0E;
    --green-bg: #0E2018;
    --blue-bg: #0E1830;
    --purple-bg: #1A1030;
  }
}

/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; }

/* ── AdSense CLS guard ──────────────────────────────────────────────────────
   .ad-slot  — outer wrapper that always holds space, even when the ins inside
               is hidden by a CMP with display:none !important.
   ins.adsbygoogle — secondary guard for pages without a wrapper.
─────────────────────────────────────────────────────────────────────────── */
.ad-slot { display: block; min-height: 90px; width: 100%; overflow: hidden; }
.ad-slot-leaderboard { min-height: 90px; max-width: 728px; margin: 0 auto; }
.ad-slot-rectangle   { min-height: 250px; max-width: 336px; }
ins.adsbygoogle { display: block; min-height: 90px; }

/* ── Focus outlines (keyboard nav) ── */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── Nav ── */
nav { background: var(--card); border-bottom: 1px solid var(--border); padding: 0 24px; position: sticky; top: 0; z-index: 100; }
.nav-inner { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { font-size: 22px; font-weight: 700; color: var(--accent); text-decoration: none; letter-spacing: -0.5px; }
.logo span { color: var(--text); }
.nav-links { display: flex; gap: 24px; }
.nav-links a { text-decoration: none; color: var(--text-light); font-size: 14px; font-weight: 500; transition: color .2s; }
.nav-links a:hover, .nav-links a.active { color: var(--accent); }
.lang-switch { text-decoration: none; font-size: 13px; font-weight: 600; color: var(--text-light); background: var(--bg); border: 1.5px solid #ddd; padding: 4px 10px; border-radius: 6px; transition: all .2s; }
.lang-switch:hover { color: var(--accent); border-color: var(--accent); }

/* ── Section header ── */
.section-header { max-width: 1100px; margin: 0 auto; padding: 20px 24px 16px; }
.section-header h2 { font-size: 22px; font-weight: 700; }
.section-header p { font-size: 14px; color: var(--text-light); }

/* ── Page hero / breadcrumb ── */
.page-hero { padding: 40px 24px 32px; max-width: 700px; margin: 0 auto; }
.page-hero .breadcrumb { font-size: 13px; color: var(--text-light); margin-bottom: 12px; }
.page-hero .breadcrumb a { color: var(--accent); text-decoration: none; }
.page-hero .breadcrumb a:hover { text-decoration: underline; }
.page-hero h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 8px; }
.page-hero p { font-size: 16px; color: var(--text-light); }

/* ── Filter bar ── */
.filter-bar { display: flex; flex-wrap: wrap; gap: .45rem; }
.filter-btn { border: 1.5px solid var(--border); background: var(--card); color: var(--text-light); font-size: .8rem; font-weight: 600; padding: .38rem .9rem; border-radius: 20px; cursor: pointer; transition: all .15s; white-space: nowrap; line-height: 1; font-family: inherit; }
.filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.filter-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── Tool cards (base) ── */
.tool-card { background: var(--card); border: 1px solid var(--border); text-decoration: none; color: inherit; transition: all .2s; position: relative; }
.tool-card:hover { border-color: var(--accent); box-shadow: 0 3px 14px rgba(172,83,22,.1); transform: translateY(-1px); }
.tc-icon { font-size: 20px; flex-shrink: 0; line-height: 1; margin-top: 1px; }
.tc-body { flex: 1; min-width: 0; }
.tool-card h3 { font-size: 13.5px; font-weight: 700; line-height: 1.3; margin-bottom: 2px; color: var(--text); }
.tool-card p { font-size: 12px; color: var(--text-light); line-height: 1.4; margin: 0; }
.tc-badge { position: absolute; top: 8px; right: 8px; font-size: 9.5px; font-weight: 700; padding: 2px 6px; border-radius: 10px; letter-spacing: .2px; white-space: nowrap; }
.badge-hot { background: var(--tag-bg); color: var(--tag-text); }
.badge-new { background: var(--green-bg); color: var(--green); }
.badge-trend { background: var(--blue-bg); color: var(--blue); }
/* Legacy tool-tag classes (used on individual tool pages) */
.tool-tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 20px; margin-top: 6px; }
.tag-popular { background: var(--tag-bg); color: var(--tag-text); }
.tag-new { background: var(--green-bg); color: var(--green); }
.tag-trending { background: var(--blue-bg); color: var(--blue); }

/* ── Calc / form styles ── */
.calc-wrap { max-width: 600px; margin: 0 auto 40px; padding: 0 24px; }
.calc-box { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 32px; }
.calc-box h2 { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.calc-box .subtitle { font-size: 14px; color: var(--text-light); margin-bottom: 24px; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.5px; }
.form-row { display: flex; gap: 10px; }
.form-row > * { flex: 1; }
input[type="number"], input[type="text"], select, textarea { width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; font-size: 16px; background: var(--bg); color: var(--text); outline: none; transition: border .2s; font-family: inherit; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
.result-box { background: var(--accent-light); border-radius: 12px; padding: 20px; text-align: center; margin-top: 20px; }
.result-box .value { font-size: 32px; font-weight: 800; color: var(--accent); }
.result-box .label { font-size: 13px; color: var(--text-light); margin-top: 4px; }
.result-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-top: 20px; }
.btn { display: inline-block; background: var(--accent); color: #fff; border: none; padding: 12px 28px; border-radius: 10px; font-size: 15px; font-weight: 600; cursor: pointer; transition: background .2s; width: 100%; margin-top: 4px; }
.btn:hover { background: var(--accent-hover); }

/* ── Info / blog sections ── */
.info-section { max-width: 860px; margin: 0 auto 60px; padding: 0 24px; }
.info-section h2 { font-size: 20px; font-weight: 700; margin: 32px 0 8px; }
.info-section h3 { font-size: 16px; font-weight: 600; margin: 20px 0 4px; }
.info-section p { font-size: 15px; color: var(--text-light); margin-bottom: 12px; }
.info-table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 12px 0 20px; }
.info-table th { text-align: left; padding: 8px 12px; background: var(--accent-light); font-weight: 600; border-bottom: 2px solid var(--border); }
.info-table td { padding: 8px 12px; border-bottom: 1px solid var(--border); }
.info-table tr:hover { background: #FFFAF5; }
.callout { background: var(--accent-light); border-left: 4px solid var(--accent); border-radius: 0 10px 10px 0; padding: 16px 20px; margin: 24px 0; }
.callout p { margin: 0; font-size: 15px; }
.callout-blue { background: var(--blue-bg); border-left-color: var(--blue); }
.callout-green { background: var(--green-bg); border-left-color: var(--green); }

/* ── FAQ ── */
.faq-section { max-width: 860px; margin: 0 auto 60px; padding: 0 24px; }
.faq-section h2 { font-size: 20px; font-weight: 700; margin-bottom: 16px; }
.faq-item { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 18px 20px; margin-bottom: 10px; }
.faq-item summary { cursor: pointer; font-size: 15px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; font-size: 20px; font-weight: 300; color: var(--accent); flex-shrink: 0; margin-left: 12px; }
.faq-item[open] summary::after { content: '\2212'; }
.faq-item[open] summary { margin-bottom: 8px; }
.faq-item p { font-size: 14px; color: var(--text-light); }

/* ── Related tools ── */
.related { max-width: 860px; margin: 0 auto 60px; padding: 0 24px; }
.related h2 { font-size: 18px; font-weight: 700; margin-bottom: 16px; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.related-card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 16px; text-decoration: none; color: inherit; transition: all .2s; }
.related-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.related-card h3 { font-size: 14px; font-weight: 600; }
.related-card p { font-size: 12px; color: var(--text-light); margin-top: 2px; }

/* ── Tool CTA callout ── */
.tool-cta { background: var(--accent-light); border: 2px solid var(--accent); border-radius: 14px; padding: 20px 24px; margin: 32px 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.tool-cta p { margin: 0; font-size: 15px; font-weight: 600; }
.tool-cta a { background: var(--accent); color: #fff; padding: 10px 20px; border-radius: 8px; text-decoration: none; font-weight: 700; font-size: 14px; white-space: nowrap; }
.tool-cta a:hover { background: var(--accent-hover); }

/* ── Footer ── */
footer { text-align: center; padding: 40px 24px; border-top: 1px solid var(--border); color: var(--text-light); font-size: 13px; }
footer a { color: var(--accent); text-decoration: none; }
.footer-links { display: flex; justify-content: center; gap: 20px; margin-bottom: 12px; flex-wrap: wrap; }
.footer-links a { font-size: 13px; color: var(--text-light); text-decoration: none; }
.footer-links a:hover { color: var(--accent); }
.footer-tagline { margin-top: 8px; font-size: 12px; color: #6E6E6E; }
.footer-legal { display: flex; justify-content: center; gap: 16px; margin-top: 12px; font-size: 12px; }
.footer-legal a { color: var(--text-light); text-decoration: none; }
.footer-legal a:hover { color: var(--accent); }
.footer-copy { margin-top: 10px; font-size: 12px; color: #6E6E6E; }

/* ── Blog ── */
.blog-grid { max-width: 1100px; margin: 0 auto 60px; padding: 0 24px; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px,1fr)); gap: 24px; }
.blog-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 24px; text-decoration: none; color: inherit; transition: all .2s; display: flex; flex-direction: column; }
.blog-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.07); }
.blog-card .blog-tag { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--accent); margin-bottom: 10px; }
.blog-card h2 { font-size: 18px; font-weight: 700; line-height: 1.35; margin-bottom: 10px; }
.blog-card p { font-size: 14px; color: var(--text-light); line-height: 1.6; flex: 1; }
.blog-card .read-more { margin-top: 16px; font-size: 13px; font-weight: 600; color: var(--accent); }
.blog-post { max-width: 760px; margin: 0 auto; padding: 0 24px 60px; }
.blog-post h1 { font-size: 32px; font-weight: 800; line-height: 1.25; letter-spacing: -.5px; margin-bottom: 12px; }
.blog-post .post-meta { font-size: 13px; color: var(--text-light); margin-bottom: 32px; }
.blog-post h2 { font-size: 22px; font-weight: 700; margin: 36px 0 12px; }
.blog-post h3 { font-size: 18px; font-weight: 700; margin: 24px 0 8px; }
.blog-post p { font-size: 16px; line-height: 1.75; color: var(--text); margin-bottom: 16px; }
.blog-post ul, .blog-post ol { padding-left: 24px; margin-bottom: 16px; }
.blog-post li { font-size: 16px; line-height: 1.75; margin-bottom: 6px; }
.blog-post a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* ── Copy button ── */
.copy-btn { display: inline-block; margin-top: 12px; padding: 8px 18px; font-size: 13px; font-weight: 600; color: var(--accent); background: var(--accent-light); border: 1.5px solid var(--accent); border-radius: 8px; cursor: pointer; transition: all .2s; }
.copy-btn:hover { background: var(--accent); color: #fff; }

/* ── Accessibility ── */
.skip-nav { position: absolute; left: -999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.skip-nav:focus { position: fixed; top: 12px; left: 12px; width: auto; height: auto; padding: 8px 16px; background: var(--accent); color: #fff; font-weight: 700; font-size: 14px; border-radius: 8px; z-index: 9999; text-decoration: none; }

/* ── Back to top ── */
.back-to-top { position: fixed; bottom: 24px; right: 24px; width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: #fff; border: none; cursor: pointer; font-size: 20px; display: none; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(0,0,0,.2); transition: background .2s; z-index: 99; }
.back-to-top:hover { background: var(--accent-hover); }
.back-to-top.show { display: flex; }

/* ── Disclaimer ── */
.disclaimer-wrap { max-width: 860px; margin: 0 auto; padding: 0 24px 4px; }
.disclaimer-box { background: #FFF8E7; border: 1.5px solid #E8B800; border-radius: 10px; padding: 12px 16px; display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: #5C4A00; line-height: 1.5; margin-bottom: 8px; }
.disclaimer-box strong { color: #4A3900; }

/* ── Responsive — 3 breakpoints: 768px, 600px, 400px ── */
@media (max-width: 768px) {
  .page-hero h1 { font-size: 26px; }
  .result-grid { grid-template-columns: 1fr 1fr; }
  .related-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .page-hero h1 { font-size: 22px; }
  .form-row { flex-direction: column; }
  .result-grid { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr; }
  .nav-links { gap: 14px; }
  .nav-links a { font-size: 13px; }
}
@media (max-width: 400px) {
  .nav-links { display: none; }
}

/* ── Print ── */
@media print {
  nav, footer, .copy-btn, .related, .faq-section, .search-box, .lang-switch, .back-to-top, .disclaimer-wrap { display: none !important; }
  body { background: #fff; }
  .page-hero { padding-top: 0; }
  a { color: inherit; text-decoration: none; }
}
