/* Layout shared by the 30 blog posts (body.tb-blog-post, set in static_base.html.twig).
 *
 * The posts keep their own markup: header div, `.card`, `.alert`, accordion. This sheet restyles
 * that markup. Every selector starts with `body.tb-blog-post` because each post loads static.css
 * and landing.css AFTER this file, and Bootstrap utilities (`mt-5`, `py-5`, `mb-5`) are !important. */

/* ---------------------------------------------------------------- page frame */

/* landing.css puts `overflow-x: hidden` on html AND body. With both, body becomes a scroll
   container and `position: sticky` (the TOC) stops sticking. `clip` cuts the same overflow
   without creating one. */
html:has(body.tb-blog-post),
body.tb-blog-post {
    overflow-x: clip;
}

body.tb-blog-post .static-content {
    margin-top: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 4rem !important;
}

body.tb-blog-post .static-card {
    display: grid;
    grid-template-columns: minmax(0, 720px);
    justify-content: center;
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
    color: var(--tb-text);
}

/* Every block sits in the reading column; the header and the TOC say otherwise below. */
body.tb-blog-post .static-card > * {
    grid-column: -2;
    min-width: 0;
}

/* ---------------------------------------------------------------- header */

/* Full-bleed tint: the box-shadow paints the band to both edges and clip-path keeps it from
   bleeding up or down. `overflow-x: hidden` on html/body (landing.css) stops the sideways scroll. */
body.tb-blog-post .static-card > .text-center:first-child {
    grid-column: 1 / -1;
    text-align: left !important;
    background: var(--tb-tint);
    box-shadow: 0 0 0 100vmax var(--tb-tint);
    clip-path: inset(0 -100vmax);
    padding: 7.5rem 0 3.25rem;
    margin-bottom: 3.5rem !important;
}

body.tb-blog-post .static-card h1 {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -0.03em;
    max-width: 22ch;
    margin-bottom: 1.75rem !important;
}

/* The "13 de octubre, 2026 · 6 min de lectura" line each post writes after the author. */
body.tb-blog-post .static-card > .text-center:first-child > p.lead {
    font-size: 0.875rem;
    margin: 0.75rem 0 0 !important;
}

body.tb-blog-post .static-card > .text-center:first-child .alert {
    max-width: 720px;
    margin-top: 1.5rem;
    background: #fff;
    border: 1px solid var(--tb-line);
}

body.tb-blog-post .static-card > .text-center:first-child picture img {
    display: block;
}

/* ---------------------------------------------------------------- author */

body.tb-blog-post .post-author {
    display: grid;
    grid-template-columns: 46px auto;
    justify-content: start;
    column-gap: 0.875rem;
    align-items: center;
    text-align: left !important;
    margin-bottom: 0 !important;
}

body.tb-blog-post .post-author__avatar {
    display: flex !important;
    grid-row: 1 / 3;
    width: 46px;
    height: 46px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--tb-violet);
    color: #fff;
    font-weight: 700;
    font-size: 0.9375rem;
}

/* `p.` in front: the reading-text rule below (`.static-card p`) would win otherwise. */
body.tb-blog-post .post-author p.post-author__name {
    margin: 0 !important;
    font-size: 1rem;
    color: var(--tb-ink);
    line-height: 1.35;
}

body.tb-blog-post .post-author p.post-author__role {
    margin: 0 !important;
    font-size: 0.875rem;
    line-height: 1.35;
}

body.tb-blog-post .post-author p.post-author__dates {
    grid-column: 1 / -1;
    margin-top: 1rem !important;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* ---------------------------------------------------------------- reading text */

body.tb-blog-post .static-card p,
body.tb-blog-post .static-card li {
    font-size: 1.125rem;
    line-height: 1.75;
}

body.tb-blog-post .static-card p.lead {
    font-size: 1.3125rem;
    line-height: 1.6;
    color: var(--tb-ink);
}

body.tb-blog-post .static-card h2 {
    font-size: 1.875rem;
    line-height: 1.2;
    margin: 0.5rem 0 1.125rem;
    scroll-margin-top: 100px;
}

body.tb-blog-post .static-card h3 {
    line-height: 1.3;
}

body.tb-blog-post .static-card hr.my-5 {
    border: 0;
    border-top: 1px solid var(--tb-line);
    opacity: 1;
    margin: 3rem 0 !important;
}

/* Four older posts open with text + a stat box side by side (col-md-8 / col-md-4). In a 720 px
   column the text ends up 480 px wide, so the box goes under the text instead. */
body.tb-blog-post .static-card > .row > .col-md-8,
body.tb-blog-post .static-card > .row > .col-md-8 + .col-md-4 {
    flex: 0 0 100%;
    max-width: 100%;
}

/* "1. ¿Porcentaje o monto fijo?" → the number in a box (blog-post.js). */
.blog-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    margin-right: 0.75rem;
    vertical-align: 0.2em;
    border-radius: 10px 10px 10px 3px;
    background: var(--tb-violet-soft);
    color: var(--tb-violet-deep);
    font-size: 1rem;
}

/* ---------------------------------------------------------------- boxes inside the text */

body.tb-blog-post .static-card .card {
    border-radius: 22px 22px 22px 6px;
    border-color: var(--tb-line);
}

body.tb-blog-post .static-card .card:hover {
    transform: none;
    box-shadow: none;
}

/* Softer versions of Bootstrap's green, red and yellow borders, used only by the pros/cons cards. */
body.tb-blog-post {
    --blog-border-good: #9FD9B4;
    --blog-border-bad: #F1B3B3;
    --blog-border-warn: #F1D29A;
}

body.tb-blog-post .static-card .card.border-success { border-color: var(--blog-border-good) !important; }
body.tb-blog-post .static-card .card.border-danger { border-color: var(--blog-border-bad) !important; }
body.tb-blog-post .static-card .card.border-warning { border-color: var(--blog-border-warn) !important; }

body.tb-blog-post .static-card .card-body {
    padding: 1.5rem;
}

body.tb-blog-post .static-card .card p,
body.tb-blog-post .static-card .card li {
    font-size: 1rem;
    line-height: 1.65;
}

/* "Cómo se resuelve en TurnoBoost" and the other grey boxes. */
body.tb-blog-post .static-card .card.bg-light,
body.tb-blog-post .static-card .bg-light {
    background: var(--tb-tint) !important;
    border: 1px solid var(--tb-line) !important;
    border-radius: 22px 22px 22px 6px !important;
}

body.tb-blog-post .static-card .alert-info {
    background: var(--tb-violet-soft);
    color: var(--tb-ink);
    border-radius: 18px 18px 18px 5px;
    padding: 1.125rem 1.375rem;
}

body.tb-blog-post .static-card .table {
    font-size: 1rem;
}

/* ---------------------------------------------------------------- FAQ accordion */

body.tb-blog-post .static-card .accordion-item {
    border: 0;
    border-bottom: 1px solid var(--tb-line);
    border-radius: 0;
    background: transparent;
}

body.tb-blog-post .static-card .accordion-button,
body.tb-blog-post .static-card .accordion-button:not(.collapsed) {
    font-family: var(--tb-font-display);
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--tb-ink);
    background: transparent;
    box-shadow: none;
    padding: 1.125rem 0;
}

body.tb-blog-post .static-card .accordion-button:focus-visible {
    outline: 3px solid var(--tb-violet-dim);
}

body.tb-blog-post .static-card .accordion-body {
    padding: 0 0 1.25rem;
    font-size: 1rem;
    line-height: 1.7;
}

/* ---------------------------------------------------------------- closing CTA (_blog_post_cta) */

body.tb-blog-post .static-content > section.mt-5 {
    max-width: 1040px;
    margin: 3rem auto 0 !important;
    background: var(--tb-tint);
    border-radius: var(--tb-radius-card);
    padding: 3rem 1.5rem;
}

body.tb-blog-post .static-content > section.mt-5 > hr {
    display: none;
}

body.tb-blog-post .static-content > section.mt-5 h3 {
    font-size: 1.75rem;
}

body.tb-blog-post .static-content > section.mt-5 .btn {
    border-radius: var(--tb-radius-btn);
    font-weight: 600;
    padding: 0.75rem 1.5rem;
}

body.tb-blog-post .static-content > section.mt-5 .btn-success {
    background: var(--tb-violet);
    border: 0;
}

body.tb-blog-post .static-content > section.mt-5 .btn-outline-primary,
body.tb-blog-post .static-content > section.mt-5 .btn-outline-secondary {
    background: #fff;
    border: 1px solid var(--tb-line);
    color: var(--tb-ink);
}

/* ---------------------------------------------------------------- table of contents (blog-post.js) */

.blog-toc details {
    border: 1px solid var(--tb-line);
    border-radius: 16px 16px 16px 5px;
    padding: 0 1rem;
    margin-bottom: 2.5rem;
}

.blog-toc summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
    cursor: pointer;
    list-style: none;
    font-weight: 600;
    color: var(--tb-ink);
}

.blog-toc summary::-webkit-details-marker {
    display: none;
}

.blog-toc summary::after {
    content: '';
    width: 9px;
    height: 9px;
    margin-right: 4px;
    border-right: 2px solid var(--tb-violet);
    border-bottom: 2px solid var(--tb-violet);
    transform: rotate(45deg) translateY(-3px);
    transition: transform 0.15s ease;
}

.blog-toc details[open] summary::after {
    transform: rotate(-135deg) translateY(-3px);
}

.blog-toc ol {
    list-style: none;
    margin: 0;
    padding: 0 0 0.875rem;
}

body.tb-blog-post .blog-toc li {
    font-size: 0.9375rem;
    line-height: 1.4;
}

body.tb-blog-post .blog-toc a {
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: 10px;
    color: var(--tb-text);
}

body.tb-blog-post .blog-toc a:hover {
    color: var(--tb-ink);
    background: var(--tb-tint);
    text-decoration: none;
}

body.tb-blog-post .blog-toc a.is-active {
    background: var(--tb-violet-soft);
    color: var(--tb-violet-deep);
    font-weight: 600;
}

/* Wide screens: the TOC becomes a sticky column to the left of the text. It spans every row
   of the grid so the text is laid out as if it were not there. */
@media (min-width: 1200px) {
    body.tb-blog-post.has-toc .static-card {
        grid-template-columns: 230px minmax(0, 720px);
        column-gap: 4rem;
    }

    body.tb-blog-post .static-card > .blog-toc {
        grid-column: 1;
        grid-row: 2 / span 400;
        align-self: start;
        position: sticky;
        top: 96px;
    }

    .blog-toc details {
        border: 0;
        padding: 0;
    }

    .blog-toc summary {
        min-height: 0;
        padding: 0 0.75rem 0.625rem;
        font-size: 0.75rem;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: var(--tb-gray);
        cursor: default;
        pointer-events: none;
    }

    .blog-toc summary::after {
        display: none;
    }
}

/* ---------------------------------------------------------------- phone */

@media (max-width: 767.98px) {
    body.tb-blog-post .static-card > .text-center:first-child {
        padding: 6rem 0 2.25rem;
        margin-bottom: 2rem !important;
    }

    body.tb-blog-post .static-card h1 {
        font-size: 2rem;
    }

    body.tb-blog-post .static-card p,
    body.tb-blog-post .static-card li {
        font-size: 1.0625rem;
    }

    body.tb-blog-post .static-card p.lead {
        font-size: 1.1875rem;
    }

    body.tb-blog-post .static-card h2 {
        font-size: 1.5rem;
    }

    body.tb-blog-post .static-card hr.my-5 {
        margin: 2.25rem 0 !important;
    }

    body.tb-blog-post .static-content > section.mt-5 {
        padding: 2.25rem 1.25rem;
    }

    body.tb-blog-post .static-content > section.mt-5 .btn {
        width: 100%;
    }
}
