/* C for Calories website. Nutrition-label look on an enamel plate, matching the app. */
@font-face { font-family: "Archivo Expanded"; src: url("/assets/fonts/archivo_expanded_extrabold.ttf") format("truetype"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Archivo Figure"; src: url("/assets/fonts/archivo_extracondensed_black.ttf") format("truetype"); font-weight: 900; font-display: swap; }

:root {
  color-scheme: light dark;
  --bg: #f4f6f3;
  --panel: #ffffff;
  --soft: #e9ece7;
  --text: #121513;
  --muted: #5b625d;
  --line: #d9ddd7;
  --rule: #121513;
  --accent: #cc3b22;
  --accent-strong: #a92e19;
  --on-accent: #ffffff;
  --protein: #2f4fb3;
  --carbs: #d99a1e;
  --fat: #6d7d2b;
  --max: 1120px;
  --radius: 22px;
  --display: "Archivo Expanded", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --figure: "Archivo Figure", "Archivo Expanded", ui-sans-serif, system-ui, sans-serif;
  --body: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111312;
    --panel: #1a1d1b;
    --soft: #222624;
    --text: #eef1ed;
    --muted: #a5ada7;
    --line: #2f3431;
    --rule: #eef1ed;
    --accent: #ea5538;
    --accent-strong: #ff7a5f;
    --protein: #7f9cff;
    --carbs: #f0b545;
    --fat: #a9bb5b;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.6 var(--body); text-rendering: optimizeLegibility; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-strong); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1.08; letter-spacing: -0.02em; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 5.4vw, 3.9rem); }
h2 { font-size: clamp(1.55rem, 3.4vw, 2.35rem); }
h3 { font-size: 1.15rem; letter-spacing: -0.01em; line-height: 1.2; }
p { margin: 0 0 1em; }
ul, ol { padding-inline-start: 1.3em; }
li { margin: .35em 0; }
.shell { width: min(calc(100% - 32px), var(--max)); margin-inline: auto; }
.narrow { width: min(calc(100% - 32px), 780px); margin-inline: auto; }
.skip-link { position: absolute; inset-inline-start: -999px; top: 8px; background: var(--panel); padding: 8px 14px; border-radius: 10px; z-index: 10; }
.skip-link:focus { inset-inline-start: 8px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.site-header nav { display: flex; align-items: center; gap: 18px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-family: var(--display); font-weight: 800; font-size: 1.05rem; letter-spacing: -0.01em; white-space: nowrap; }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.nav-links { display: flex; gap: 4px; margin-inline-start: auto; overflow-x: auto; scrollbar-width: none; }
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a { color: var(--text); text-decoration: none; font-size: .93rem; font-weight: 600; padding: 8px 11px; border-radius: 999px; white-space: nowrap; }
.nav-links a:hover { background: var(--soft); color: var(--text); }
.nav-cta { background: var(--accent) !important; color: var(--on-accent) !important; display: inline-flex; align-items: center; gap: 8px; }
.nav-cta-icons { display: inline-flex; align-items: center; gap: 5px; }
.nav-symbol { width: 15px; height: 15px; flex: none; fill: currentColor; }
@media (max-width: 760px) { .nav-links a:not(.nav-cta):not(.keep) { display: none; } }

/* Eyebrows and label rules */
.eyebrow { font-family: var(--display); font-weight: 800; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-strong); margin: 0 0 14px; }
.rule-thick { height: 10px; background: var(--rule); border: 0; margin: 0; }
.rule-thin { height: 2px; background: var(--rule); border: 0; margin: 0; }

/* Hero */
.hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 48px; align-items: center; padding: 64px 0 56px; }
.hero h1 { margin-bottom: 20px; }
.hero h1 em { font-style: normal; color: var(--accent); }
.lede { font-size: 1.2rem; color: var(--muted); max-width: 40em; }
.lede strong { color: var(--text); }
.hero-points { list-style: none; padding: 0; margin: 22px 0 0; display: flex; flex-wrap: wrap; gap: 8px 18px; font-weight: 600; font-size: .96rem; }
.hero-points li { margin: 0; display: inline-flex; align-items: center; gap: 7px; }
.hero-points li::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.phone { justify-self: center; width: min(100%, 340px); border-radius: 44px; padding: 10px; background: var(--rule); box-shadow: 0 30px 60px -28px rgba(0,0,0,.45); }
.phone img { border-radius: 35px; width: 100%; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; padding-top: 40px; gap: 36px; } .phone { width: min(78%, 320px); } }

/* Store buttons */
.store-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.store-link { display: inline-flex; align-items: center; gap: 12px; transition: transform .15s; min-height: 58px; padding: 9px 22px 9px 18px; border-radius: 16px; background: var(--rule); color: var(--bg); text-decoration: none; line-height: 1.15; font-size: .78rem; }
.store-link strong { font-size: 1.18rem; font-family: var(--display); letter-spacing: -0.01em; }
.store-link:hover { color: var(--bg); transform: translateY(-1px); }
.store-link[data-preferred="true"], .store-link[data-preferred="true"]:hover { background: var(--accent); color: var(--on-accent); }
/* Inline SVG filled with currentColor, so the mark always matches the button text in every theme and variant. */
.store-symbol { width: 28px; height: 28px; flex: none; fill: currentColor; }
.store-note { margin-top: 12px; font-size: .9rem; color: var(--muted); }

/* Free strip */
.free-strip { background: var(--rule); color: var(--bg); }
.free-strip .shell { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; padding: 18px 0; font-family: var(--display); font-weight: 800; font-size: .95rem; letter-spacing: .02em; }
.free-strip span::before { content: "✓ "; color: var(--accent); }

/* Sections */
.section { padding: 76px 0; }
.section-tight { padding: 48px 0; }
.section-heading { max-width: 760px; margin-bottom: 36px; }
.section-heading p { color: var(--muted); font-size: 1.1rem; }
.alt { background: var(--panel); border-block: 1px solid var(--line); }

/* Cards */
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grid-2 { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.alt .card { background: var(--bg); }
.card p:last-child { margin-bottom: 0; }
.card .num { font-family: var(--figure); font-size: 2.4rem; line-height: 1; color: var(--accent); display: block; margin-bottom: 12px; }
a.card { color: var(--text); text-decoration: none; display: flex; flex-direction: column; transition: border-color .15s, transform .15s; }
a.card:hover { border-color: var(--accent); transform: translateY(-2px); }
a.card .more { margin-top: auto; padding-top: 10px; color: var(--accent-strong); font-weight: 700; font-size: .95rem; }
a.card p { color: var(--muted); }

/* Nutrition label panel (signature element) */
.label { background: var(--panel); border: 3px solid var(--rule); border-radius: 18px; padding: 18px 22px 20px; max-width: 460px; }
.label-title { font-family: var(--display); font-weight: 800; font-size: 1.9rem; letter-spacing: -0.02em; margin: 0 0 4px; line-height: 1.05; }
.label-sub { font-size: .92rem; color: var(--muted); margin: 0 0 10px; }
.label-cal { display: flex; justify-content: space-between; align-items: flex-end; padding: 8px 0 6px; }
.label-cal span { font-family: var(--display); font-weight: 800; font-size: 1.25rem; }
.label-cal strong { font-family: var(--figure); font-size: 3.6rem; line-height: .9; }
.label-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 1rem; }
.label-row:last-child { border-bottom: 0; }
.label-row b { font-weight: 700; }
.label-row .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-inline-end: 8px; }
.dot.p { background: var(--protein); } .dot.c { background: var(--carbs); } .dot.f { background: var(--fat); }
.label-foot { font-size: .8rem; color: var(--muted); margin: 10px 0 0; }

/* Screens row */
.screens { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.screens figure { margin: 0; }
.screens img { border-radius: 26px; border: 1px solid var(--line); box-shadow: 0 18px 40px -26px rgba(0,0,0,.4); }
.screens figcaption { margin-top: 12px; font-weight: 600; text-align: center; }
@media (max-width: 760px) { .screens { grid-template-columns: repeat(3, 70%); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; } .screens figure { scroll-snap-align: center; } }

/* Split feature */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.split.reverse > :first-child { order: 2; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } .split.reverse > :first-child { order: 0; } }
.checks { list-style: none; padding: 0; }
.checks li { padding-inline-start: 30px; position: relative; margin: 10px 0; }
.checks li::before { content: "✓"; position: absolute; inset-inline-start: 0; top: 0; font-weight: 900; color: var(--accent); }

/* Steps */
.steps { counter-reset: step; display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.steps .card { position: relative; }
.steps .card::before { counter-increment: step; content: counter(step, decimal-leading-zero); font-family: var(--figure); font-size: 2.6rem; line-height: 1; color: var(--accent); display: block; margin-bottom: 14px; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); margin: 1.2em 0 1.6em; }
table { border-collapse: collapse; width: 100%; font-size: .96rem; }
th, td { text-align: start; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font-family: var(--display); font-weight: 800; font-size: .82rem; letter-spacing: .06em; text-transform: uppercase; background: var(--soft); }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.yes { color: var(--fat); font-weight: 700; } .no { color: var(--accent-strong); font-weight: 700; }

/* FAQ */
details { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 0 22px; margin: 10px 0; }
summary { cursor: pointer; font-weight: 700; padding: 18px 0; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-family: var(--display); font-size: 1.3rem; line-height: 1; color: var(--accent); }
details[open] summary::after { content: "–"; }
details > :not(summary) { margin-top: 0; }
details p:last-child { padding-bottom: 18px; margin-bottom: 0; }

/* Article */
.article { padding: 44px 0 72px; }
.breadcrumbs { font-size: .9rem; color: var(--muted); margin-bottom: 22px; display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumbs a { color: var(--muted); }
.article h1 { font-size: clamp(2rem, 4.6vw, 3.2rem); }
.article h2 { font-size: clamp(1.45rem, 3vw, 1.9rem); margin-top: 1.8em; }
.article h3 { margin-top: 1.5em; }
.article .lede { margin-bottom: 1.4em; }
.meta { font-size: .9rem; color: var(--muted); margin-bottom: 26px; }
.callout { background: var(--panel); border: 1px solid var(--line); border-inline-start: 6px solid var(--accent); border-radius: 14px; padding: 18px 20px; margin: 1.6em 0; }
.callout p:last-child { margin-bottom: 0; }
.cta-box { background: var(--rule); color: var(--bg); border-radius: var(--radius); padding: 30px; margin: 2.4em 0; }
.cta-box h2, .cta-box h3 { color: var(--bg); margin-top: 0; }
.cta-box p { color: color-mix(in srgb, var(--bg) 80%, transparent); }
.cta-box .store-link { background: var(--bg); color: var(--rule); }
.cta-box .store-link:hover { color: var(--rule); }
.cta-box .store-link[data-preferred="true"], .cta-box .store-link[data-preferred="true"]:hover { background: var(--accent); color: var(--on-accent); }
.toc { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px 22px; margin: 0 0 2em; font-size: .95rem; }
.toc strong { display: block; margin-bottom: 4px; }
.toc ol { margin: 0; }
.related { margin-top: 3em; }
.sources { font-size: .9rem; color: var(--muted); }

/* Calculators */
.calc { background: var(--panel); border: 3px solid var(--rule); border-radius: var(--radius); padding: 24px; margin: 1.4em 0 2em; }
.calc form { display: grid; gap: 14px 16px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); align-items: end; }
.calc label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: .92rem; }
.calc input, .calc select { font: inherit; font-weight: 500; padding: 11px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--text); width: 100%; min-height: 46px; }
.calc .full { grid-column: 1 / -1; }
/* Drop Safari's native select chrome so selects match the text inputs. */
.calc select { -webkit-appearance: none; appearance: none; cursor: pointer; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; line-height: 1.3; padding-inline-end: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%235b625d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-size: 16px 16px; background-position: right 14px center; }
[dir="rtl"] .calc select { background-position: left 14px center; }
@media (prefers-color-scheme: dark) { .calc select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23a5ada7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E"); } }
.seg { display: inline-flex; background: var(--soft); border-radius: 999px; padding: 4px; gap: 4px; }
.seg button { font: inherit; font-weight: 700; font-size: .9rem; border: 0; border-radius: 999px; padding: 8px 16px; background: transparent; color: var(--text); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--panel); box-shadow: 0 1px 3px rgba(0,0,0,.18); }
.btn { font: inherit; font-weight: 800; font-family: var(--display); border: 0; border-radius: 14px; padding: 13px 22px; background: var(--accent); color: var(--on-accent); cursor: pointer; min-height: 48px; }
.btn:hover { background: var(--accent-strong); }
.calc-result { margin-top: 22px; }
.calc-result[hidden] { display: none; }
.result-figure { font-family: var(--figure); font-size: clamp(3rem, 9vw, 4.6rem); line-height: .95; }
.result-figure small { font-family: var(--display); font-size: 1.05rem; color: var(--muted); margin-inline-start: 6px; }
.result-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-top: 16px; }
.result-grid div { background: var(--bg); border-radius: 14px; padding: 14px; }
.result-grid strong { display: block; font-family: var(--figure); font-size: 2rem; line-height: 1; }
.result-grid span { font-size: .88rem; color: var(--muted); }
.imperial-only[hidden], .metric-only[hidden] { display: none; }

/* Food index */
.food-index { columns: 3 220px; column-gap: 28px; }
.food-index h3 { break-after: avoid; margin-top: 1.2em; }
.food-index ul { list-style: none; padding: 0; margin: 0 0 1em; break-inside: avoid-column; }
.food-index li { margin: 4px 0; }
.food-index a { color: var(--text); text-decoration: none; display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-bottom: 1px dotted var(--line); }
.food-index a span { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.food-index a:hover { color: var(--accent-strong); }
.food-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 460px); gap: 40px; align-items: start; }
@media (max-width: 860px) { .food-hero { grid-template-columns: 1fr; } }
.macro-bar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; margin: 10px 0 6px; background: var(--soft); }
.macro-bar span { display: block; height: 100%; }
.macro-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .9rem; color: var(--muted); }

/* Language list */
.lang-list { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; }
.lang-list a { display: inline-block; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--text); font-size: .92rem; background: var(--panel); }
.lang-list a:hover { border-color: var(--accent); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 48px 0 40px; font-size: .93rem; background: var(--panel); }
.footer-grid { display: grid; gap: 28px; grid-template-columns: 1.4fr repeat(4, 1fr); }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-grid h2 { font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; margin: 0 0 12px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin: 7px 0; }
.footer-grid a { color: var(--text); text-decoration: none; }
.footer-grid a:hover { color: var(--accent-strong); text-decoration: underline; }
.footer-brand p { color: var(--muted); max-width: 30em; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); }
.footer-bottom a { color: var(--muted); }

/* Legal */
.legal h2 { margin-top: 2em; font-size: 1.5rem; }
.legal h3 { margin-top: 1.4em; }
.legal section { scroll-margin-top: 80px; }

[dir="rtl"] .hero-points li::before, [dir="rtl"] .checks li::before { inset-inline-start: 0; }
