/* Guides ("Patarimai"): the home row, the /patarimai/ list and the articles.
   Plain, unlayered CSS like the other home rows, so it wins over Tailwind's
   preflight without !important.

   One idea carries the look: every guide has a technical line drawing (edge
   cross-sections, a charge band) in one green ink on a pale glass-green plate.
   Everything around it stays quiet — white surfaces, slate text, emerald as
   the only accent, no shadows or gradients. */

.guides-strip,
.guides-index,
.guide,
.guide-related {
    --g-ink: #0f172a;
    --g-text: #334155;
    --g-muted: #64748b;
    --g-line: #e2e8f0;
    --g-accent: #047857;
    --g-accent-strong: #065f46;
    --g-plate: #eef4f1;
    --g-plate-line: #d6e4dd;
    color: var(--g-ink);
}

/* ---------------------------------------------------------------- card */

.guide-card {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--g-line);
    border-radius: 16px;
    background: #fff;
    transition: border-color .15s ease;
}

.guide-card:hover {
    border-color: #a7cbbb;
}

.guide-card__cover {
    aspect-ratio: 16 / 10;
    background: var(--g-plate);
    border-bottom: 1px solid var(--g-plate-line);
}

.guide-card__cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.guide-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 8px;
    padding: 16px 18px 18px;
}

.guide-card__title {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -.01em;
}

.guide-card__link {
    color: inherit;
    text-decoration: none;
}

/* The title link covers the whole card. */
.guide-card__link::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
}

.guide-card:hover .guide-card__link {
    color: var(--g-accent-strong);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.guide-card__link:focus-visible {
    outline: none;
}

.guide-card__link:focus-visible::after {
    outline: 3px solid var(--g-accent);
    outline-offset: -3px;
}

.guide-card__excerpt {
    display: -webkit-box;
    overflow: hidden;
    margin: 0;
    color: #475569;
    font-size: 14px;
    line-height: 1.5;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.guide-card__meta {
    margin: auto 0 0;
    padding-top: 4px;
    color: var(--g-muted);
    font-size: 13px;
}

/* ----------------------------------------------------------- home row */

.guides-strip {
    padding: 24px 0 24px 20px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    background: #fff;
}

.guides-strip__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-right: 20px;
}

.guides-strip__title {
    margin: 0;
    font-size: 28px;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -.025em;
}

.guides-strip__controls {
    display: none;
    align-items: center;
    gap: 8px;
}

.guides-strip__all {
    color: var(--g-accent-strong);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
}

.guides-strip__all:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.guides-strip__controls .guides-strip__all {
    margin-right: 8px;
    padding: 8px 4px;
}

.guides-strip__nav {
    display: none;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #fff;
    color: var(--g-ink);
    cursor: pointer;
    transition: border-color .15s ease, color .15s ease;
}

.guides-strip.is-scrollable .guides-strip__nav {
    display: grid;
}

.guides-strip__nav:not(:disabled):hover {
    border-color: var(--g-accent-strong);
    color: var(--g-accent-strong);
}

.guides-strip__nav:disabled {
    cursor: default;
    opacity: .35;
}

.guides-strip a:focus-visible,
.guides-strip__nav:focus-visible {
    outline: 3px solid var(--g-accent);
    outline-offset: 2px;
}

.guides-strip__track {
    display: grid;
    grid-auto-columns: min(78%, 280px);
    grid-auto-flow: column;
    gap: 16px;
    margin: 20px 0 0;
    padding: 0 0 4px;
    list-style: none;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.guides-strip__track::-webkit-scrollbar {
    display: none;
}

/* Room after the last card, so it can scroll fully clear of the panel edge. */
.guides-strip__track::after {
    content: '';
    width: 4px;
}

.guides-strip__item {
    display: flex;
    scroll-snap-align: start;
}

.guides-strip__all--below {
    display: inline-block;
    margin-top: 16px;
    padding: 6px 0;
}

@media (min-width: 640px) {
    .guides-strip {
        padding: 32px 0 32px 32px;
    }

    .guides-strip__head {
        padding-right: 32px;
    }

    .guides-strip__controls {
        display: flex;
    }

    .guides-strip__all--below {
        display: none;
    }

    .guides-strip__track {
        grid-auto-columns: calc((100% - 32px) / 2.35);
        margin-top: 24px;
    }

    .guides-strip__track::after {
        width: 16px;
    }
}

/* Cards stay about 260 px wide on every desktop size; the fraction leaves
   part of the next card in view, which is what tells people the row scrolls. */
@media (min-width: 1024px) {
    .guides-strip__track {
        grid-auto-columns: calc((100% - 48px) / 3.3);
    }
}

@media (min-width: 1280px) {
    .guides-strip__track {
        grid-auto-columns: calc((100% - 64px) / 4.3);
    }
}

/* -------------------------------------------------------- /patarimai/ */

.guides-index {
    max-width: 1120px;
    margin: 0 auto;
    padding: 24px 16px 56px;
}

.guides-index__header h1 {
    margin: 0;
    font-size: clamp(30px, 4vw, 42px);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -.02em;
}

.guides-index__header p {
    max-width: 60ch;
    margin: 12px 0 0;
    color: #475569;
    font-size: 18px;
    line-height: 1.55;
}

.guides-index__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    margin: 32px 0 0;
    padding: 0;
    list-style: none;
}

.guides-index__item {
    display: flex;
}

@media (min-width: 640px) {
    .guides-index__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .guides-index__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .guides-index__item--wide {
        grid-column: span 2;
    }

    .guide-card--wide {
        display: grid;
        grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    }

    .guide-card--wide .guide-card__cover {
        aspect-ratio: auto;
        min-height: 100%;
        border-right: 1px solid var(--g-plate-line);
        border-bottom: 0;
    }

    .guide-card--wide .guide-card__body {
        justify-content: center;
        gap: 12px;
        padding: 28px 30px;
    }

    .guide-card--wide .guide-card__title {
        font-size: 24px;
        line-height: 1.25;
    }

    .guide-card--wide .guide-card__excerpt {
        font-size: 16px;
        -webkit-line-clamp: 4;
    }

    .guide-card--wide .guide-card__meta {
        margin-top: 0;
    }
}

/* ------------------------------------------------------------ crumbs */

.guide-crumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 20px;
    color: var(--g-muted);
    font-size: 14px;
}

.guide-crumbs a {
    color: inherit;
    text-decoration: none;
}

.guide-crumbs a:hover {
    color: var(--g-accent-strong);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ----------------------------------------------------------- article */

.guide {
    max-width: 1040px;
    margin: 0 auto;
    padding: 24px 16px 8px;
}

.guide__header {
    display: grid;
    align-items: center;
    gap: 24px;
}

.guide__title {
    margin: 0;
    font-size: clamp(30px, 4.2vw, 44px);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -.022em;
}

.guide__lead {
    max-width: 60ch;
    margin: 16px 0 0;
    color: var(--g-text);
    font-size: 19px;
    line-height: 1.55;
}

.guide__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
    margin: 16px 0 0;
    color: var(--g-muted);
    font-size: 14px;
}

.guide__plate {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border: 1px solid var(--g-plate-line);
    border-radius: 20px;
    background: var(--g-plate);
}

.guide__plate img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

@media (min-width: 900px) {
    .guide__header {
        grid-template-columns: minmax(0, 1fr) 340px;
        gap: 40px;
    }
}

/* Body text. Bodies are plain HTML written per language; these rules and
   the components below are the whole vocabulary an author needs. */
.guide-prose {
    max-width: 720px;
    margin-top: 40px;
    color: var(--g-text);
    font-size: 17px;
    line-height: 1.7;
}

.guide-prose > * + * {
    margin-top: 1em;
}

.guide-prose h2 {
    margin-top: 2.2em;
    color: var(--g-ink);
    font-size: 26px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -.012em;
}

.guide-prose h3 {
    margin-top: 1.6em;
    color: var(--g-ink);
    font-size: 19px;
    font-weight: 600;
    line-height: 1.35;
}

.guide-prose h2 + *,
.guide-prose h3 + * {
    margin-top: .6em;
}

.guide-prose p {
    margin-bottom: 0;
}

.guide-prose ul,
.guide-prose ol {
    padding-left: 1.3em;
}

.guide-prose ul {
    list-style: disc;
}

.guide-prose ol {
    list-style: decimal;
}

.guide-prose li + li {
    margin-top: .45em;
}

.guide-prose li::marker {
    color: var(--g-accent);
}

.guide-prose strong {
    color: var(--g-ink);
    font-weight: 600;
}

.guide-prose a {
    color: var(--g-accent-strong);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.guide-prose a:hover {
    color: #064e3b;
}

.guide-prose a:focus-visible,
.guide-prose summary:focus-visible {
    outline: 3px solid var(--g-accent);
    outline-offset: 2px;
    border-radius: 4px;
}

/* "Trumpai" — the short version at the top of a guide. */
.guide-key {
    padding: 20px 24px;
    border-left: 3px solid var(--g-accent);
    border-radius: 0 16px 16px 0;
    background: #f3f8f6;
}

.guide-prose .guide-key h2 {
    margin-top: 0;
    font-size: 18px;
}

.guide-key ul {
    margin-top: .6em;
}

/* A side note or a warning inside the text. */
.guide-note {
    padding: 16px 20px;
    border: 1px solid var(--g-line);
    border-radius: 14px;
    background: #f8fafc;
    font-size: 16px;
}

.guide-note--warn {
    border-color: #fcd9a0;
    background: #fffaf0;
}

.guide-note > :first-child {
    margin-top: 0;
}

/* Numbered steps: only for real sequences. */
.guide-steps {
    display: grid;
    gap: 12px;
    padding: 0;
    list-style: none;
    counter-reset: guide-step;
}

.guide-prose .guide-steps {
    padding-left: 0;
    list-style: none;
}

.guide-steps > li {
    position: relative;
    padding: 18px 20px 18px 64px;
    border: 1px solid var(--g-line);
    border-radius: 14px;
    background: #fff;
    counter-increment: guide-step;
}

.guide-prose .guide-steps > li + li {
    margin-top: 0;
}

.guide-steps > li::before {
    content: counter(guide-step);
    position: absolute;
    top: 18px;
    left: 18px;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: var(--g-accent-strong);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
}

.guide-prose .guide-steps h3 {
    margin: 2px 0 4px;
    font-size: 18px;
}

.guide-steps p {
    margin: 0;
}

.guide-steps p + p {
    margin-top: .5em;
}

/* Tables scroll sideways on phones instead of squeezing. */
.guide-table {
    overflow-x: auto;
    border: 1px solid var(--g-line);
    border-radius: 14px;
}

.guide-table table {
    width: 100%;
    min-width: 580px;
    border-collapse: collapse;
    font-size: 15px;
    line-height: 1.5;
}

.guide-table th {
    padding: 12px 14px;
    border-bottom: 1px solid var(--g-line);
    background: #f8fafc;
    color: var(--g-ink);
    font-weight: 600;
    text-align: left;
    vertical-align: bottom;
}

.guide-table td {
    padding: 12px 14px;
    border-top: 1px solid #eef2f6;
    vertical-align: top;
}

.guide-table td:first-child {
    color: var(--g-ink);
    font-weight: 600;
}

/* Drawings inside the text. */
.guide-figure {
    margin: 1.8em 0 0;
}

.guide-figure svg {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--g-plate-line);
    border-radius: 16px;
    background: var(--g-plate);
}

.guide-figure figcaption {
    margin-top: 10px;
    color: var(--g-muted);
    font-size: 14px;
    line-height: 1.5;
}

/* Honest pros and cons, side by side from tablet width. */
.guide-proscons {
    display: grid;
    gap: 12px;
}

.guide-proscons > div {
    padding: 16px 20px;
    border: 1px solid var(--g-line);
    border-radius: 14px;
    background: #fff;
}

.guide-proscons__label {
    color: var(--g-ink);
    font-size: 15px;
    font-weight: 700;
}

.guide-prose .guide-proscons ul {
    margin-top: .5em;
    padding-left: 0;
    list-style: none;
    font-size: 16px;
}

.guide-proscons li {
    position: relative;
    padding-left: 22px;
}

.guide-proscons li::before {
    position: absolute;
    left: 0;
    font-weight: 700;
}

.guide-pros li::before {
    content: '+';
    color: var(--g-accent);
}

/* Considerations stay quiet: a neutral marker, not a warning colour. */
.guide-cons li::before {
    content: '\2013';
    color: #94a3b8;
}

@media (min-width: 640px) {
    .guide-proscons {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* "Avoid" lists: each line marked with a cross. */
.guide-prose .guide-avoid {
    padding-left: 0;
    list-style: none;
}

.guide-avoid li {
    position: relative;
    padding-left: 26px;
}

.guide-avoid li::before {
    content: '';
    position: absolute;
    top: .55em;
    left: 2px;
    width: 12px;
    height: 12px;
    background:
        linear-gradient(45deg, transparent 43%, #b91c1c 43%, #b91c1c 57%, transparent 57%),
        linear-gradient(-45deg, transparent 43%, #b91c1c 43%, #b91c1c 57%, transparent 57%);
}

/* FAQ, rendered by {% faq %}. */
.guide-faq {
    margin-top: 2.4em;
}

.guide-faq__item {
    border-top: 1px solid var(--g-line);
}

.guide-faq__item:last-child {
    border-bottom: 1px solid var(--g-line);
}

.guide-prose .guide-faq__item {
    margin-top: 0;
}

.guide-faq__item summary {
    position: relative;
    padding: 16px 40px 16px 0;
    color: var(--g-ink);
    font-weight: 600;
    line-height: 1.45;
    list-style: none;
    cursor: pointer;
}

.guide-faq__item summary::-webkit-details-marker {
    display: none;
}

.guide-faq__item summary::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 8px;
    width: 9px;
    height: 9px;
    border-right: 2px solid var(--g-accent-strong);
    border-bottom: 2px solid var(--g-accent-strong);
    transform: translateY(-75%) rotate(45deg);
    transition: transform .15s ease;
}

.guide-faq__item[open] summary::after {
    transform: translateY(-25%) rotate(-135deg);
}

.guide-faq__answer {
    padding: 0 0 18px;
}

.guide-faq__answer > * + * {
    margin-top: .8em;
}

/* The shop link that ends a guide. */
.guide-shop {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px 24px;
    margin-top: 2.4em;
    padding: 22px 24px;
    border: 1px solid var(--g-plate-line);
    border-radius: 18px;
    background: var(--g-plate);
}

.guide-shop__title {
    margin: 0;
    color: var(--g-ink);
    font-size: 19px;
    font-weight: 700;
    line-height: 1.35;
}

.guide-shop__note {
    margin: 4px 0 0;
    font-size: 16px;
}

.guide-prose .guide-shop__button,
.guide-shop__button {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 10px 18px;
    border-radius: 12px;
    background: var(--g-accent-strong);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
}

.guide-prose .guide-shop__button:hover,
.guide-shop__button:hover {
    background: #064e3b;
    color: #fff;
}

/* ------------------------------------------------- more tips (related) */

.guide-related {
    max-width: 1040px;
    margin: 56px auto 0;
    padding: 0 16px 56px;
}

.guide-related__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px 16px;
}

.guide-related__head h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -.01em;
}

.guide-related__head a {
    color: var(--g-accent-strong);
    font-weight: 600;
    text-decoration: none;
}

.guide-related__head a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.guide-related__list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    margin: 20px 0 0;
    padding: 0;
    list-style: none;
}

.guide-related__list > li {
    display: flex;
}

@media (min-width: 640px) {
    .guide-related__list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (prefers-reduced-motion: reduce) {
    .guide-card,
    .guides-strip__nav,
    .guide-faq__item summary::after {
        transition: none;
    }
}
