/*
 * Blog listing styles.
 *
 * Hand-written and linked directly from the blog views, following the same
 * convention as promotion.css — it is not part of the app.scss / Laravel Mix
 * build, so editing it needs no compile step.
 *
 * Visual model: the old blog.ev-renting.com listing — full-bleed hero built from
 * the newest article, a horizontal category filter, and a two-column grid of tall
 * image cards with a bottom gradient.
 */

:root {
    --blog-dark: #2e333d;
    --blog-green: #67bdb9;
    --blog-ink: #363636;
    --blog-muted: #757763;
    --blog-line: #e8e6df;
    --blog-max: 1344px;
    --blog-shadow: 0 8px 16px -2px rgba(9, 10, 12, .1), 0 0 0 1px rgba(9, 10, 12, .02);

    /* Brand CTA gradient, lifted from the promo page's "Enviar solicitud" button
       (.button.is-warning-gradient / .v5-cta) so the blog matches the rest of the site. */
    --blog-oker: #ffc376;
    --blog-pink: #fa7c91;
    --blog-cta: linear-gradient(137deg, #ffc376 32%, #fa7c91 100%);
    --blog-cta-shadow: 0 12px 28px rgba(250, 124, 145, .28);
    --blog-cta-shadow-hover: 0 16px 36px rgba(250, 124, 145, .42);
}

/* ---------------------------------------------------------------- hero ---- */

.blog-hero {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: 580px;
    margin-bottom: 0;
    overflow: hidden;
    background-color: var(--blog-dark);
}

.blog-hero__img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
}

/* Was baked into the hero's background-image; now its own layer over the img. */
.blog-hero__scrim {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(rgba(0, 0, 0, .2), rgba(0, 0, 0, .7));
}

/* Soft vignette so the type always has something to sit on, whatever the photo. */
.blog-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(120% 80% at 20% 100%, rgba(0, 0, 0, .55) 0%, rgba(0, 0, 0, 0) 60%);
}

.blog-hero__container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: var(--blog-max);
    margin: 0 auto;
    padding: 60px 20px 56px;
}

.blog-hero__label {
    position: relative;
    display: inline-block;
    margin-bottom: 72px;
    padding-bottom: 12px;
    color: #fff;
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -.5px;
    line-height: 1.1;
}

/* Gold rule under the label, tying the hero to the filter chips. */
.blog-hero__label::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 46px;
    height: 3px;
    border-radius: 2px;
    background: var(--blog-cta);
}

.blog-hero__title {
    max-width: 20ch;
    margin: 0 0 18px;
    font-size: 52px;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1.12;
    color: #fff;
    text-shadow: 0 2px 24px rgba(0, 0, 0, .35);
}

.blog-hero__title a {
    color: inherit;
    line-height: inherit;
    transition: color .25s;
}

.blog-hero__title a:hover {
    color: var(--blog-oker);
}

.blog-hero__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    color: rgba(255, 255, 255, .88);
    font-size: 15px;
    font-weight: 600;
}

.blog-hero__author {
    color: #fff;
    font-weight: 700;
}

.blog-hero__dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .5);
}

/* Pages 2+ and empty categories have no featured image: compact, centred band. */
.blog-hero--no-image {
    min-height: 320px;
    align-items: center;
    text-align: center;
    background: linear-gradient(135deg, #2e333d 0%, #1f232b 100%);
}

.blog-hero--no-image::after {
    display: none;
}

.blog-hero--no-image .blog-hero__container {
    padding: 48px 20px;
}

.blog-hero--no-image .blog-hero__label {
    margin-bottom: 22px;
}

.blog-hero--no-image .blog-hero__label::after {
    left: 50%;
    transform: translateX(-50%);
}

.blog-hero--no-image .blog-hero__title {
    max-width: none;
    margin-bottom: 0;
}

.blog-hero--no-image .blog-tags-wrapper,
.blog-hero--no-image .blog-hero__meta {
    justify-content: center;
}

/* Tag pill, used in the hero and on the cards. */
.blog-tags-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.blog-tag-pill {
    display: inline-block;
    padding: 6px 13px;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 999px;
    background: rgba(255, 255, 255, .14);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .3px;
    text-decoration: none;
    transition: background .3s, border-color .3s;
}

a.blog-tag-pill:hover {
    border-color: transparent;
    background: var(--blog-cta);
    color: var(--blog-ink);
}

/* ------------------------------------------------------ category filter ---- */

/*
 * Filter chips, styled in the same language as the promo page: frosted glass,
 * an amber glow that drifts out on hover, a lift, and a shimmer sweep across
 * the label. The active chip is filled with the promo gold.
 *
 * Label and count sit in their own z-index:1 wrappers so the blurred glow
 * pseudo-elements can live behind them inside the clipped pill.
 */
.blog-tags-filter {
    position: relative;
    max-width: var(--blog-max);
    margin: 0 auto 10px;
    /* Generous gap under the hero so the filter reads as its own band rather
       than as part of the banner. */
    padding: 44px 20px 22px;
}

.blog-tags-filter__container {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    padding: 4px 2px 8px;
}

.blog-tags-filter__container::-webkit-scrollbar {
    display: none;
}

.blog-tag-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    padding: .72rem 1.15rem;
    border: 1px solid var(--blog-line);
    border-radius: 100px;
    background: #fff;
    color: var(--blog-ink);
    font-size: 15px;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 2px 8px -4px rgba(9, 10, 12, .12);
    /* Same transition contract as the promo CTA. */
    transition: transform .2s, box-shadow .2s, border-color .2s, background .2s, color .2s;
}

.blog-tag-link:hover,
.blog-tag-link:focus-visible {
    transform: translateY(-2px);
    border-color: rgba(250, 124, 145, .45);
    background: #fff;
    color: var(--blog-ink);
    box-shadow: var(--blog-cta-shadow);
}

/* Active chip is the promo "Enviar solicitud" button, verbatim. */
.blog-tag-link--active {
    border-color: transparent;
    background: var(--blog-cta);
    color: var(--blog-ink);
    box-shadow: var(--blog-cta-shadow);
}

.blog-tag-link--active:hover,
.blog-tag-link--active:focus-visible {
    transform: translateY(-2px);
    border-color: transparent;
    background: var(--blog-cta);
    color: var(--blog-ink);
    box-shadow: var(--blog-cta-shadow-hover);
}

.blog-tag-link--active @media (prefers-reduced-motion: reduce) {
    .blog-tag-link,
    .blog-tag-link::before,
    .blog-tag-link::after {
        transition: none;
    }

    .blog-tag-link:hover {
        transform: none;
    }
}

/* ---------------------------------------------------------------- grid ---- */

.blog-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 26px;
    max-width: var(--blog-max);
    margin: 0 auto;
    padding: 8px 20px 20px;
}

.blog-grid__item--wide {
    grid-column: 1 / -1;
}

/*
 * Cards are sized by aspect-ratio, not a fixed height. Every hero image in the
 * corpus is 16:9, so a portrait card would crop away half the photograph — 3:2
 * keeps 84% of the frame, and the full-width card goes cinematic at 21:9.
 */
.post-card {
    position: relative;
    display: block;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    border-radius: 18px;
    background-color: #1a1a1a;
    box-shadow: 0 6px 20px -10px rgba(9, 10, 12, .35);
    text-decoration: none;
    transition: transform .2s, box-shadow .2s;
}

.post-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--blog-cta-shadow-hover);
}

.blog-grid__item--wide .post-card {
    aspect-ratio: 21 / 9;
}

.post-card__img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% center;
    transition: transform .6s cubic-bezier(.22, .61, .36, 1);
}

.post-card:hover .post-card__img {
    transform: scale(1.04);
}

/* Scrim only where the type sits, so the photograph stays vivid. */
.post-card__overlay {
    position: absolute;
    inset: auto 0 0 0;
    z-index: 1;
    height: 62%;
    background: linear-gradient(0deg, rgba(12, 13, 15, .88) 0%, rgba(12, 13, 15, .55) 42%, transparent 100%);
}

/* Hairline ring keeps the card defined against the light page background. */
.post-card::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 3;
    border-radius: inherit;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1);
    pointer-events: none;
}

.post-card__content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: 100%;
    padding: 28px;
}

/* Category sits in the top-left corner, out of the way of the headline. */
.post-card__meta {
    position: absolute;
    top: 20px;
    left: 20px;
    margin: 0;
}

.post-card__title {
    margin: 0 0 14px;
    max-width: 24ch;
    color: #fff;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -.4px;
    line-height: 1.2;
    text-shadow: 0 1px 12px rgba(0, 0, 0, .3);
    /* Keep every card's headline to three lines so the grid stays even. */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color .2s;
}

.blog-grid__item--wide .post-card__title {
    max-width: 30ch;
    font-size: 32px;
}

.post-card:hover .post-card__title {
    color: var(--blog-oker);
}

.post-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.post-card__byline {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
    color: rgba(255, 255, 255, .72);
    font-size: 13.5px;
    font-weight: 500;
}

.post-card__author {
    color: #fff;
    font-weight: 700;
}

.post-card__author::after {
    content: "·";
    margin-left: 8px;
    color: rgba(255, 255, 255, .45);
}

.post-card__date {
    color: rgba(255, 255, 255, .72);
}

.post-card__arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .16);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: transform .2s, background .2s;
}

.post-card:hover .post-card__arrow {
    transform: translateX(3px);
    background: var(--blog-cta);
}

.post-card:hover .post-card__arrow svg path {
    stroke: var(--blog-ink);
}

.post-card__footer svg {
    display: block;
    width: 20px;
    height: 20px;
}

/* ------------------------------------------------- related ("Sigue leyendo") ---- */

.blog-related {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px 60px;
}

.blog-related__heading {
    margin-bottom: 20px;
    color: var(--blog-ink);
    font-size: 26px;
    font-weight: 700;
}

.blog-related__grid {
    display: grid;
    /* auto-fit rather than a fixed 3 columns: a couple of articles list only two
       related posts, and this lets those two fill the row instead of leaving a hole. */
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.related-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--blog-shadow);
    text-decoration: none;
    transition: transform .2s, box-shadow .2s;
}

.related-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 24px -8px rgba(9, 10, 12, .22);
}

.related-card__figure {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #1a1a1a;
}

.related-card__figure img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .5s;
}

.related-card:hover .related-card__figure img {
    transform: scale(1.05);
}

.related-card__tag {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 9px;
    border-radius: 8px;
    background: rgba(46, 51, 61, .88);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .02em;
}

.related-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 16px 18px 18px;
}

.related-card__title {
    margin: 0 0 10px;
    color: var(--blog-ink);
    font-size: 17px;
    font-weight: 700;
    line-height: 1.32;
}

.related-card:hover .related-card__title {
    color: var(--blog-green);
}

.related-card__meta {
    margin-top: auto;
    color: #8a8a86;
    font-size: 13px;
}

@media (max-width: 900px) {
    .blog-related__grid {
        grid-template-columns: 1fr;
    }

    .related-card {
        flex-direction: row;
    }

    .related-card__figure {
        flex: 0 0 40%;
        aspect-ratio: auto;
    }
}

/* ---------------------------------------------------------- pagination ---- */

.blog-pagination-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
    padding: 40px 20px 110px;
}

.blog-pagination {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, .6);
    border-radius: 999px;
    background: rgba(255, 255, 255, .6);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 10px 28px -14px rgba(9, 10, 12, .3), inset 0 1px 0 rgba(255, 255, 255, .9);
}

.blog-pagination__btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 999px;
    color: var(--blog-ink);
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    transition: background .25s, color .25s;
}

.blog-pagination__btn:hover {
    background: rgba(250, 124, 145, .14);
    color: var(--blog-ink);
}

.blog-pagination__btn.is-disabled {
    color: rgba(57, 58, 49, .3);
    cursor: not-allowed;
    pointer-events: none;
}

.blog-pagination__numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.blog-pagination__number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    border-radius: 50%;
    color: var(--blog-ink);
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    transition: background .25s, color .25s, box-shadow .25s;
}

.blog-pagination__number:hover {
    background: rgba(250, 124, 145, .16);
    color: var(--blog-ink);
}

.blog-pagination__number--active {
    background: var(--blog-cta);
    color: var(--blog-ink);
    box-shadow: var(--blog-cta-shadow);
}

.blog-pagination__gap {
    padding: 0 2px;
    color: rgba(57, 58, 49, .35);
    font-weight: 700;
}

/* --------------------------------------------------------------- empty ---- */

.blog-empty {
    max-width: var(--blog-max);
    margin: 0 auto;
    padding: 60px 20px 120px;
    color: #7a7a7a;
    font-size: 18px;
}

/* ---------------------------------------------------------- responsive ---- */

@media (max-width: 1023px) {
    .blog-hero {
        min-height: 440px;
    }

    .blog-hero__container {
        padding: 40px 20px 36px;
    }

    .blog-hero__label {
        font-size: 26px;
        margin-bottom: 40px;
    }

    .blog-hero__title {
        font-size: 34px;
        max-width: none;
    }

    .blog-tags-filter {
        padding: 32px 20px 18px;
    }

    .blog-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .post-card,
    .blog-grid__item--wide .post-card {
        aspect-ratio: 16 / 10;
    }

    .post-card__content {
        padding: 22px;
    }

    .post-card__title,
    .blog-grid__item--wide .post-card__title {
        font-size: 22px;
        max-width: none;
        -webkit-line-clamp: 2;
    }
}

@media (max-width: 600px) {
    .blog-hero {
        min-height: 380px;
    }

    .blog-hero__title {
        font-size: 27px;
    }

    .blog-hero__label {
        font-size: 22px;
        margin-bottom: 28px;
    }

    .blog-tags-filter {
        padding: 26px 20px 16px;
    }

    .blog-tag-link {
        font-size: 14px;
        padding: .62rem 1rem;
    }

    .post-card,
    .blog-grid__item--wide .post-card {
        aspect-ratio: 4 / 3;
    }

    .post-card__title,
    .blog-grid__item--wide .post-card__title {
        font-size: 19px;
    }

    .post-card__arrow {
        width: 38px;
        height: 38px;
    }

    .blog-pagination {
        gap: 4px;
        padding: 8px 10px;
    }

    .blog-pagination__btn span {
        display: none;
    }

    .blog-pagination__btn {
        padding: 8px 12px;
    }
}
