/* ============================================================
   Maisto indeksai — landing pages (/indeksai + /indeksai/{slug}).
   Mobile-first; the store matrix becomes a table ≥900px. Accent tokens
   (--accent*, --hero-*) are set inline per index on .ix; the neutral palette
   below keeps text at WCAG 2.1 AA contrast (the design's faint #9A9CA3 fails
   AA for text, so text grays are darkened while borders keep the light tone).
   ============================================================ */

.ix {
    --font-num: ui-monospace, "SF Mono", "Segoe UI Mono", "Roboto Mono", Menlo, Consolas, monospace;
    --ink: #16181D;
    --ink-2: #55585F;   /* secondary text  ~7:1 on white */
    --ink-3: #6B7280;   /* muted text      ~4.9:1 on white */
    --line: #EBEBEF;
    --line-2: #F1F1F4;
    --surface: #FFFFFF;
    --surface-2: #FBFBFC;
    --dark: #16181D;
    --dark-2: #1F222B;
    --ok: #2FA36B;
    --bad: #E5484D;
    --pigiausia: #23A55A;
    --promo: #B4690E;   /* akcijos (flash) label, AA on white */

    max-width: 1180px;
    margin: 0 auto;
    padding: 8px 16px 40px;
    color: var(--ink);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.5;
}

.ix .num {
    font-family: var(--font-num);
    font-variant-numeric: tabular-nums;
    letter-spacing: -.01em;
}

/* ── Breadcrumb ── */
.ix-breadcrumb { padding: 8px 2px 0; font-size: 13px; }
.ix-breadcrumb ol {
    list-style: none; display: flex; flex-wrap: wrap; gap: 7px;
    margin: 0; padding: 0; color: var(--ink-3);
}
.ix-breadcrumb li { display: flex; gap: 7px; align-items: center; }
.ix-breadcrumb li + li::before { content: "›"; color: var(--ink-3); }
.ix-breadcrumb a { color: var(--ink-3); text-decoration: none; }
.ix-breadcrumb a:hover { color: var(--ink); text-decoration: underline; }
.ix-breadcrumb [aria-current="page"] { color: var(--ink); font-weight: 600; }

/* ── Hero ── */
.ix-hero {
    position: relative; overflow: hidden;
    margin-top: 14px;
    border-radius: 22px;
    background: var(--accent-grad-mob, var(--accent-grad));
    padding: 24px 22px;
    color: #fff;
}
.ix-hero__meta {
    display: flex; align-items: center; gap: 9px; margin: 0 0 10px;
    font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
    color: var(--hero-dim, #ffffff);
}
.ix-hero__meta time { color: inherit; }
.ix-hero__dot {
    width: 9px; height: 9px; border-radius: 999px; background: #B3FFD1;
    box-shadow: 0 0 0 0 rgba(179,255,209,.7); animation: ix-live 1.8s ease-in-out infinite;
}
.ix-hero__title { margin: 0; font-size: 27px; line-height: 1.08; font-weight: 800; letter-spacing: -.01em; }
.ix-hero__lead { margin: 10px 0 0; font-size: 14.5px; line-height: 1.5; color: var(--hero-text, #fff); max-width: 30em; }
.ix-hero__figures { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; margin-top: 16px; }
.ix-hero__price { font-size: 48px; font-weight: 700; line-height: 1; letter-spacing: -.02em; }
.ix-hero__change { display: flex; flex-direction: column; gap: 5px; padding-bottom: 4px; }
.ix-pill {
    display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
    padding: 6px 12px; border-radius: 999px; background: #fff;
    font-family: var(--font-num); font-size: 13px; font-weight: 800;
}
.ix-pill--down { color: var(--ok); }
.ix-pill--up { color: var(--bad); }
.ix-hero__delta { font-size: 12.5px; font-weight: 600; color: var(--hero-dim, #fff); }
.ix-hero__icon {
    position: absolute; right: -26px; bottom: -30px; width: 150px; height: 150px;
    filter: drop-shadow(0 14px 22px rgba(20,10,20,.35));
    pointer-events: none;
}

/* ── Quick stats ── */
.ix-stats {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 14px;
}
.ix-stat {
    background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 16px; padding: 14px 16px;
}
.ix-stat__label {
    font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3);
}
.ix-stat__value { margin-top: 4px; font-size: 17px; font-weight: 800; color: var(--ink); }
.ix-stat__value--accent { color: var(--accent); }

/* ── Sections ── */
.ix-section { margin-top: 40px; }
.ix-section__title { margin: 0 0 4px; font-size: 22px; font-weight: 800; letter-spacing: -.01em; color: var(--ink); }
.ix-section__sub { margin: 0 0 16px; font-size: 14px; color: var(--ink-3); }

/* ── Chart ── */
.ix-chart {
    background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 18px; padding: 18px 16px 8px;
}
.ix-chart svg { display: block; width: 100%; height: auto; }
.ix-chart__grid line { stroke: #ECECF0; stroke-width: 1; }
.ix-chart__ylab text { fill: var(--ink-3); font-size: 12px; font-family: var(--font-num); }
.ix-chart__area { fill: var(--accent); opacity: .08; }
.ix-chart__line { fill: none; stroke: var(--accent); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.ix-chart__dots circle { fill: var(--accent); }
.ix-chart__last { fill: var(--accent); stroke: #fff; stroke-width: 3; }
.ix-chart__tipbox { fill: var(--dark); }
.ix-chart__tiptext { fill: #fff; font-size: 14px; font-weight: 700; font-family: var(--font-num); }
.ix-chart__xlab text { fill: var(--ink-3); font-size: 12px; }

/* ── Table head + legend ── */
.ix-table-head {
    display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; justify-content: space-between; margin-bottom: 14px;
}
.ix-table-head > div { min-width: 0; }
.ix-legend {
    display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto;
    font-size: 12.5px; font-weight: 700; color: var(--promo); background: #FDF3E1;
    padding: 7px 13px; border-radius: 999px;
}

/* ── Store matrix (desktop only) ── */
.ix-table-desktop { display: none; }
.store-table {
    width: 100%; border-collapse: separate; border-spacing: 0;
    border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
}
.store-table th, .store-table td { border-bottom: 1px solid var(--line-2); vertical-align: top; }
.store-table thead th {
    background: var(--surface-2); border-bottom: 1px solid var(--line);
    padding: 13px 15px; text-align: center; font-size: 15px; font-weight: 800; color: var(--ink);
}
.store-table thead th.store-table__corner {
    text-align: left; font-size: 12px; font-weight: 700; letter-spacing: .06em;
    text-transform: uppercase; color: var(--ink-3);
}
.store-table thead th + th { border-left: 1px solid var(--line); }
.store-table__store-name { display: block; }
.store-table__diff { display: block; margin-top: 3px; font-size: 11.5px; font-weight: 600; color: var(--ink-3); font-family: var(--font-num); }
.ix-badge {
    display: inline-block; margin-top: 3px; font-size: 10.5px; font-weight: 800; letter-spacing: .02em;
    color: #fff; background: var(--pigiausia); padding: 2px 9px; border-radius: 999px; text-transform: uppercase;
}
.store-table__ing { text-align: left; padding: 13px 18px; font-weight: 700; }
.store-table__ing-name { display: block; font-size: 15px; color: var(--ink); }
.store-table__ing-qty { display: block; margin-top: 2px; font-size: 12.5px; font-weight: 500; color: var(--ink-3); }
.store-table__cell { padding: 11px 15px; border-left: 1px solid var(--line-2); }
.store-table td.is-cheapest, .store-table th.is-cheapest { background: var(--accent-col); }
.store-table thead th.is-cheapest { background: #E9F8F0; }
.store-table__prod { display: block; font-size: 12px; line-height: 1.35; color: var(--ink-2); }
.store-table__price { display: block; margin-top: 4px; font-size: 17px; font-weight: 700; color: var(--ink); }
.store-table__unit { display: block; font-size: 11px; color: var(--ink-3); }
.store-table__miss { color: var(--ink-3); }
.ix-flash { color: var(--promo); font-style: normal; }

/* Imputed (incomplete-basket) cells and stores — shown for comparison only,
   never part of the index or the "cheapest basket" headline. */
.store-table__est { color: var(--ink-3); font-weight: 700; font-size: .8em; margin-left: 2px; cursor: help; }
.store-table__diff--est { color: var(--ink-3); font-style: italic; }
.store-table__prod--est { font-style: italic; color: var(--ink-3); }
.store-table td.is-estimate, .store-table th.is-estimate { background: repeating-linear-gradient(-45deg, transparent, transparent 7px, rgba(120,120,120,.05) 7px, rgba(120,120,120,.05) 14px); }
.store-table td.is-estimate .store-table__price { color: var(--ink-2); font-weight: 600; }
.store-table__totals td.is-estimate .store-table__total { color: #C9CCD3; }
.ix-badge--est { background: var(--ink-3); }
.store-table__note {
    margin: 12px 2px 0; font-size: 12px; line-height: 1.5; color: var(--ink-3);
    display: flex; gap: 7px; align-items: baseline;
}
.store-table__note-mark { font-weight: 800; color: var(--ink-2); }
.store-panel__row.is-estimate { opacity: .72; }
.store-panel__row.is-estimate .store-panel__price { font-style: italic; }
.store-table__totals th, .store-table__totals td { background: var(--dark); border-bottom: 0; text-align: center; padding: 15px; }
.store-table__totals th { text-align: left; padding: 15px 18px; color: #fff; font-weight: 800; font-size: 15px; }
.store-table__totals td { border-left: 1px solid #2A2E38; }
.store-table__totals td.is-cheapest { background: #1E5C3C; }
.store-table__total { display: block; font-size: 23px; font-weight: 700; color: #fff; }
.store-table__totals td.is-cheapest .store-table__total { color: #7CF0B1; }
.store-table__per { display: block; margin-top: 1px; font-size: 11.5px; color: #9DA2AD; }
.store-table__totals td.is-cheapest .store-table__per { color: #A9E8C6; }

/* ── Store tabs + panels (mobile) ── */
.store-mobile { margin-top: 4px; }
.store-tabs { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
.store-tab {
    flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
    padding: 8px 13px; border: 0; border-radius: 999px; background: #F1F1F3; color: var(--ink-2);
    font-size: 13px; font-weight: 600; font-family: inherit;
}
.store-tab.is-active { background: var(--dark); color: #fff; }
.store-tab__sum { color: var(--ink-3); font-weight: 700; }
.store-tab.is-active .store-tab__sum { color: #fff; }
.store-tab__sum.is-cheapest { color: var(--ok); }
.store-tab.is-active .store-tab__sum.is-cheapest { color: #7CF0B1; }

.store-panel {
    margin-top: 12px; border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
}
.is-enhanced .store-panel + .store-panel { margin-top: 12px; }
.store-panel__head {
    display: flex; align-items: center; gap: 8px; padding: 12px 16px;
    background: var(--accent-col); border-bottom: 1px solid var(--line);
    font-size: 14px; font-weight: 800; color: var(--ink);
}
.store-panel__row {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 11px 16px; border-bottom: 1px solid var(--line-2);
}
.store-panel__info { min-width: 0; }
.store-panel__ing { display: block; font-size: 13.5px; font-weight: 700; color: var(--ink); }
.store-panel__meta { display: block; margin-top: 1px; font-size: 11.5px; color: var(--ink-3); }
.store-panel__price { flex: 0 0 auto; font-size: 16px; font-weight: 700; color: var(--ink); }
.store-panel__total {
    display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; background: var(--dark); color: #fff;
}
.store-panel__total-fig { text-align: right; }
.store-panel__total-fig .num { font-size: 20px; font-weight: 700; }
.store-panel__total-fig small { display: block; font-size: 10.5px; color: #9DA2AD; }

/* ── Recipe ── */
.ix-recipe { display: grid; gap: 16px; }
.ix-recipe__card { background: var(--accent-light); border-radius: 20px; padding: 22px 22px; }
.ix-recipe__title { margin: 0 0 4px; font-size: 21px; font-weight: 800; color: var(--ink); }
.ix-recipe__meta { margin: 0 0 14px; font-size: 13px; font-weight: 600; color: var(--accent-on-light); }
.ix-recipe__list { list-style: none; margin: 0; padding: 0; }
.ix-recipe__list li {
    display: flex; justify-content: space-between; gap: 12px; padding: 10px 0;
    border-bottom: 1px dashed rgba(0,0,0,.12); font-size: 14.5px;
}
.ix-recipe__list li:last-child { border-bottom: 0; }
.ix-recipe__list li span:first-child { font-weight: 600; color: var(--ink); }
.ix-recipe__list li span:last-child { color: var(--ink-3); }
.ix-recipe__how { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 20px; padding: 22px; }
.ix-recipe__how-title { margin: 0 0 16px; font-size: 17px; font-weight: 800; color: var(--ink); }
.ix-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.ix-step { display: flex; gap: 13px; }
.ix-step__num {
    flex: 0 0 auto; width: 28px; height: 28px; border-radius: 999px; background: var(--accent); color: #fff;
    display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800;
}
.ix-step p { margin: 3px 0 0; font-size: 14.5px; line-height: 1.5; color: #3A3D44; }

/* ── Methodology ── */
.ix-method__grid { display: grid; gap: 12px; }
.ix-method__card { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 18px; padding: 20px; }
.ix-method__ico { font-size: 24px; margin-bottom: 8px; }
.ix-method__card h3 { margin: 0 0 6px; font-size: 16px; font-weight: 800; color: var(--ink); }
.ix-method__card p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink-3); }
.ix-method__ver { margin: 16px 0 0; font-size: 13px; color: var(--ink-3); }
.ix-method__ver strong { color: var(--ink); }
.ix-method__ver a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }

/* ── FAQ ── */
.ix-faq { display: grid; gap: 16px; }
.ix-faq__intro p { margin: 6px 0 0; }
.ix-faq__list { display: flex; flex-direction: column; gap: 10px; }
.ix-faq__item {
    border: 1px solid var(--line-2); border-radius: 15px; padding: 4px 18px; background: var(--surface-2);
}
.ix-faq__item summary {
    display: flex; justify-content: space-between; align-items: center; gap: 12px; cursor: pointer;
    list-style: none; padding: 14px 0; font-size: 15px; font-weight: 700; color: var(--ink);
}
.ix-faq__item summary::-webkit-details-marker { display: none; }
.ix-faq__item summary::after { content: "+"; color: var(--accent); font-weight: 700; font-size: 18px; }
.ix-faq__item[open] summary::after { content: "−"; }
.ix-faq__item p { margin: 0 0 14px; font-size: 14px; line-height: 1.6; color: var(--ink-2); }

/* ── Other indices ── */
.ix-others__grid { display: grid; gap: 12px; }
.ix-other {
    display: flex; align-items: center; gap: 14px; text-decoration: none;
    background: var(--card-bg, var(--surface-2)); border-radius: 18px; padding: 16px 18px;
    transition: transform .12s ease, box-shadow .12s ease;
}
.ix-other:hover { transform: translateY(-1px); box-shadow: 0 12px 26px -16px rgba(20,23,31,.4); }
.ix-other__icon { width: 52px; height: 52px; flex: 0 0 auto; }
.ix-other__body { flex: 1; min-width: 0; }
.ix-other__name { display: block; font-size: 16px; font-weight: 800; color: var(--ink); }
.ix-other__meta { display: block; margin-top: 2px; font-size: 13px; color: var(--card-text, var(--ink-3)); }
.ix-other__arrow { flex: 0 0 auto; font-size: 20px; color: var(--card-text, var(--ink-3)); }

/* ── CTA ── */
.ix-cta {
    margin-top: 40px; background: var(--dark); border-radius: 22px; padding: 26px 22px;
    display: flex; flex-direction: column; gap: 18px;
}
.ix-cta__text h2 { margin: 0 0 6px; font-size: 21px; font-weight: 800; color: #fff; }
.ix-cta__text p { margin: 0; font-size: 14px; color: #9DA2AD; }
.ix-cta__flash { margin: 12px 0 0; font-size: 13.5px; font-weight: 600; padding: 10px 14px; border-radius: 12px; }
.ix-cta__flash--ok { background: rgba(124,240,177,.14); color: #7CF0B1; }
.ix-cta__flash--err { background: rgba(229,72,77,.16); color: #FF9A9D; }
.ix-cta__form { display: flex; flex-direction: column; gap: 9px; }
.ix-cta__input {
    padding: 13px 18px; border-radius: 999px; border: 0; background: #23262F; color: #fff;
    font-size: 14.5px; font-family: inherit;
}
.ix-cta__input::placeholder { color: #7E838E; }
.ix-cta__input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ix-cta__btn {
    padding: 13px 20px; border-radius: 999px; border: 0; cursor: pointer;
    background: var(--accent); color: #fff; font-size: 15px; font-weight: 800; font-family: inherit;
}
.ix-cta__btn:hover { filter: brightness(1.05); }

/* ── Hub ── */
.ix-hub__head { margin-top: 16px; }
.ix-hub__head h1 { margin: 0 0 6px; font-size: 28px; font-weight: 800; letter-spacing: -.01em; }
.ix-hub__head p { margin: 0 0 20px; font-size: 15px; color: var(--ink-3); max-width: 40em; }
.ix-hub__empty { color: var(--ink-3); }

/* Keyboard focus visibility (WCAG) */
.ix a:focus-visible, .store-tab:focus-visible, .ix-faq__item summary:focus-visible, .ix-cta__btn:focus-visible {
    outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px;
}

@keyframes ix-live {
    0%, 100% { box-shadow: 0 0 0 0 rgba(179,255,209,.6); }
    50% { box-shadow: 0 0 0 5px rgba(179,255,209,0); }
}
@media (prefers-reduced-motion: reduce) {
    .ix-hero__dot { animation: none; }
    .ix-other { transition: none; }
}

/* ── Desktop ── */
@media (min-width: 640px) {
    .ix-method__grid { grid-template-columns: repeat(2, 1fr); }
    .ix-others__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
    .ix { padding: 8px 24px 56px; }
    .ix-hero { display: grid; grid-template-columns: 1.4fr 1fr; align-items: center; gap: 28px; padding: 40px 44px; border-radius: 26px; background: var(--accent-grad); }
    .ix-hero__title { font-size: 44px; }
    .ix-hero__lead { font-size: 16px; }
    .ix-hero__price { font-size: 66px; }
    .ix-hero__icon { position: static; width: 220px; height: 220px; justify-self: center; }
    .ix-stats { grid-template-columns: repeat(4, 1fr); gap: 14px; }
    .ix-method__grid { grid-template-columns: repeat(4, 1fr); }
    .ix-table-desktop { display: block; }
    .store-mobile { display: none; }
    .ix-recipe { grid-template-columns: 1fr 1.35fr; }
    .ix-faq { grid-template-columns: 320px 1fr; gap: 30px; }
    .ix-hub__grid { grid-template-columns: repeat(3, 1fr); }
    .ix-section__title { font-size: 26px; }
    .ix-recipe__title { font-size: 24px; }
}

/* ── Dark theme ──────────────────────────────────────────────
   The site stamps data-theme="dark" on <html> (base.html.twig; honours the
   manual toggle + system preference), so key off that, not prefers-color-scheme.
   Accent surfaces arrive inline as light pastels (--accent-light, --accent-col,
   --card-bg) and inline styles can't be overridden as variables, so their
   usages are re-tinted with color-mix instead. */
[data-theme="dark"] .ix {
    --ink: #EBEBEB;
    --ink-2: #B9BBC2;
    --ink-3: #999CA6;
    --line: #3A3A3C;
    --line-2: #333336;
    --surface: #1A1A1A;
    --surface-2: #1E1E1E;
    --promo: #FF9560;
}
[data-theme="dark"] .ix-legend { background: rgba(255, 149, 96, .13); }

/* Chart */
[data-theme="dark"] .ix-chart__grid line { stroke: #34363C; }
[data-theme="dark"] .ix-chart__area { opacity: .16; }
[data-theme="dark"] .ix-chart__last { stroke: var(--surface-2); }
[data-theme="dark"] .ix-chart__tipbox { fill: #0B0D12; }

/* Store matrix: cheapest tint goes translucent green instead of light pastel */
[data-theme="dark"] .store-table td.is-cheapest,
[data-theme="dark"] .store-table th.is-cheapest { background: rgba(35, 165, 90, .09); }
[data-theme="dark"] .store-table thead th.is-cheapest { background: rgba(35, 165, 90, .16); }
[data-theme="dark"] .store-table__totals th,
[data-theme="dark"] .store-table__totals td { background: var(--dark); }
[data-theme="dark"] .store-table__totals td.is-cheapest { background: #1E5C3C; }

/* Mobile store tabs + panels */
[data-theme="dark"] .store-tab { background: #2E3037; }
[data-theme="dark"] .store-tab.is-active { background: var(--dark); }
[data-theme="dark"] .store-tab__sum.is-cheapest { color: #5DD695; }
[data-theme="dark"] .store-panel__head { background: color-mix(in srgb, var(--accent) 16%, var(--surface-2)); }

/* Accent pastel surfaces → accent-tinted dark surfaces */
[data-theme="dark"] .ix-recipe__card { background: color-mix(in srgb, var(--accent) 14%, var(--surface-2)); }
[data-theme="dark"] .ix-recipe__meta { color: color-mix(in srgb, var(--accent) 55%, #fff); }
[data-theme="dark"] .ix-recipe__list li { border-bottom-color: rgba(255, 255, 255, .14); }
[data-theme="dark"] .ix-step p { color: var(--ink-2); }

/* Accent-coloured text lightened to keep contrast on dark surfaces */
[data-theme="dark"] .ix-stat__value--accent,
[data-theme="dark"] .ix-faq__item summary::after { color: color-mix(in srgb, var(--accent) 60%, #fff); }

/* Index cards (hub + "Kiti maisto indeksai"): inline --card-bg is a light pastel */
[data-theme="dark"] .ix-other { background: color-mix(in srgb, var(--card-text, #9A9CA6) 16%, var(--surface-2)); }
[data-theme="dark"] .ix-other__meta,
[data-theme="dark"] .ix-other__arrow { color: color-mix(in srgb, var(--card-text, #9A9CA6) 45%, #fff); }
[data-theme="dark"] .ix-other:hover { box-shadow: 0 12px 26px -16px rgba(0, 0, 0, .8); }

/* CTA block is dark by design; hairline separates it from the dark page bg */
[data-theme="dark"] .ix-cta { box-shadow: 0 0 0 1px rgba(255, 255, 255, .06); }
