/* ==========================================================================
   TEMA "GLASS" — BLOG (listado blog.html y artículos de /blog)
   Se carga DESPUÉS de styles/glass.css, que aporta colores, tipografía,
   fondo, cabecera, botón, pie y aviso de cookies.
   Aquí solo va lo propio del blog. No cambia HTML, textos ni JavaScript.
   ========================================================================== */

:root {
    --light-color: rgba(255, 255, 255, .5);
    --dark-color: transparent;
}

/* style.css coloca el selector de idioma en posición absoluta (es para otro
   formulario) y en el blog se montaba encima del menú */
.main-nav .language-switcher {
    position: static;
}

/* El botón del menú móvil no se veía en el blog: las barras medían 0 px */
.menu-toggle {
    width: 30px;
    padding: 0;
}

.menu-toggle .bar {
    display: block;
    width: 100%;
    height: 2px;
    transition: transform .3s ease-in-out, opacity .3s ease-in-out;
}

.main-header.mobile-open .menu-toggle .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.main-header.mobile-open .menu-toggle .bar:nth-child(2) {
    opacity: 0;
}

.main-header.mobile-open .menu-toggle .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* --- PIE: los enlaces legales traen color blanco en línea --- */
.main-footer {
    margin-top: 3rem;
}

.main-footer a[style] {
    color: var(--g-ink-2) !important;
}

/* ==========================================================================
   LISTADO
   ========================================================================== */
.blog-hero {
    background: none;
    padding: 3.25rem 0 .5rem;
}

.blog-hero .section-title {
    font-size: clamp(2.6rem, 6vw, 4.2rem);
    margin-bottom: .6rem;
}

.blog-hero .section-subtitle {
    margin: 0 auto;
}

.grid {
    /* min(…, 100%): en pantallas de 320 px la columna no puede medir 300 px */
    grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
    gap: 20px;
    margin-top: 2rem;
}

.card {
    background: var(--glass-fill);
    border: 1px solid var(--glass-edge);
    background-clip: padding-box;
    border-radius: var(--r-card);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    box-shadow: var(--glass-shadow);
    transition: transform .4s var(--ease), box-shadow .4s var(--ease), background-color .4s var(--ease);
}

.card:hover {
    transform: translateY(-4px);
    background: var(--glass-fill-strong);
    box-shadow: var(--glass-shadow-lift);
}

.card .thumb {
    height: 210px;
    margin: 8px 8px 0;
    border-radius: var(--r-inset);
    overflow: hidden;
    background: rgba(15, 23, 42, .08);
}

.card img {
    display: block;
    transition: transform .6s var(--ease);
}

.card:hover img {
    transform: scale(1.04);
}

.card .content {
    padding: 1.15rem 1.5rem 1.5rem;
    gap: .45rem;
    flex: 1;
    text-align: left;
}

.badge {
    align-self: flex-start;
    font-size: .74rem;
    font-weight: 500;
    letter-spacing: .01em;
    color: var(--g-blue);
    background: rgba(0, 113, 227, .1);
    border: 1px solid rgba(0, 113, 227, .2);
    padding: 3px 11px;
}

.card h3 {
    margin: .3rem 0 0;
    font-size: 1.2rem;
    font-weight: 500;
    letter-spacing: -.012em;
    line-height: 1.25;
    color: var(--g-ink);
}

.meta {
    margin: 0;
    font-size: .84rem;
    color: var(--g-ink-3);
}

.card .content > p:not(.meta) {
    margin: .15rem 0 0;
    font-size: .94rem;
    line-height: 1.55;
    color: var(--g-ink-2);
}

/* Botón secundario: azul tintado, empujado al pie de la tarjeta */
.card .cta-button {
    margin-top: auto;
    padding: 9px 18px;
    font-size: .9rem;
    color: var(--g-blue);
    background: rgba(0, 113, 227, .1);
    box-shadow: none;
    transform: none;
}

.card .content > p:not(.meta) + .cta-button {
    margin-top: auto;
}

.card .content {
    row-gap: .45rem;
}

.card .cta-button:hover {
    color: #fff;
    background: var(--g-blue);
    box-shadow: 0 10px 24px -10px rgba(0, 113, 227, .7);
    transform: none;
}

/* El primer artículo va destacado a todo el ancho */
@media (min-width: 900px) {
    .card:first-child {
        grid-column: 1 / -1;
        flex-direction: row;
        align-items: stretch;
    }

    .card:first-child .thumb {
        flex: 0 0 52%;
        height: auto;
        min-height: 360px;
        margin: 8px 0 8px 8px;
    }

    .card:first-child .content {
        justify-content: center;
        padding: 2.5rem 3rem;
        gap: .7rem;
    }

    .card:first-child h3 {
        font-size: clamp(1.7rem, 2.6vw, 2.3rem);
        font-weight: 600;
        letter-spacing: -.028em;
        line-height: 1.1;
    }

    .card:first-child .content > p:not(.meta) {
        font-size: 1.08rem;
        line-height: 1.6;
    }

    .card:first-child .cta-button {
        margin-top: .9rem;
        padding: 13px 26px;
        font-size: 1rem;
        color: #fff;
        background: var(--g-blue);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, .38), 0 10px 26px -10px rgba(0, 113, 227, .75);
    }

    .card:first-child .cta-button:hover {
        background: var(--g-blue-hover);
    }
}

/* ==========================================================================
   PREGUNTAS FRECUENTES (faqs.html)
   ========================================================================== */
.faq-hero {
    background: none;
    padding: 3.25rem 0 .5rem;
}

.faq-hero .section-title {
    font-size: clamp(2.1rem, 5vw, 3.4rem);
    margin-bottom: .6rem;
}

.faq-hero .section-subtitle {
    margin: 0 auto;
}

.faq-hero ~ .faq-list {
    margin: 2rem auto 0;
    padding: 0 1rem;
}

.faq-hero ~ .faq-list .faq-item {
    padding: 0;
    margin-bottom: .75rem;
}

.faq-hero ~ .faq-list .faq-item > p {
    padding: 0 1.5rem 1.35rem;
    font-size: .98rem;
    line-height: 1.65;
    color: var(--g-ink-2);
}

/* Aquí el signo ya cambia de + a −: no hace falta girarlo */
.faq-hero ~ .faq-list .faq-item[open] summary::after {
    transform: none;
}

/* ==========================================================================
   ARTÍCULO
   ========================================================================== */
main > .content-section > .container {
    max-width: 820px !important;
}

main > .content-section {
    padding-top: 2.5rem;
}

main > .content-section .section-title {
    font-size: clamp(2rem, 4.6vw, 3.2rem);
    line-height: 1.08;
    margin-bottom: 0;
}

.article-meta {
    margin: 1.25rem 0 1.75rem !important;
    padding: 0 !important;
    border-bottom: 0 !important;
}

.article-meta p:first-child {
    color: var(--g-ink) !important;
    font-weight: 500 !important;
    font-size: 1rem !important;
}

.article-meta p + p {
    color: var(--g-ink-3) !important;
    font-size: .88rem !important;
    line-height: 1.5;
}

/* Fotos del artículo */
main .img-container {
    width: 100%;
    height: clamp(220px, 44vw, 420px);
    margin: 0;
    border-radius: var(--r-panel);
    background: rgba(15, 23, 42, .08);
    border: 1px solid var(--glass-edge);
    box-sizing: border-box;
    box-shadow: 0 0 0 .5px rgba(15, 23, 42, .08), 0 30px 60px -30px rgba(15, 23, 42, .4);
}

main .content-section article .img-container {
    height: clamp(180px, 34vw, 300px) !important;
    border-radius: 20px;
    box-shadow: 0 0 0 .5px rgba(15, 23, 42, .08), 0 20px 40px -24px rgba(15, 23, 42, .35);
}

/* El texto va sobre una hoja de cristal */
main .content-section article {
    margin-top: 1.5rem;
    padding: clamp(1.4rem, 4vw, 3rem);
    background: var(--glass-fill-strong);
    border: 1px solid var(--glass-edge);
    background-clip: padding-box;
    border-radius: var(--r-panel);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    box-shadow: var(--glass-shadow);
}

main .content-section article > p {
    margin: 0 0 1.15rem;
    font-size: 1.08rem;
    line-height: 1.72;
    color: var(--g-ink-2);
}

main .content-section article > p:first-child {
    font-size: 1.2rem;
    line-height: 1.6;
    color: var(--g-ink);
}

main .content-section article > p:empty,
main .content-section article > h2:empty,
main .content-section article > h3:empty,
main .content-section article > ul:empty {
    display: none;
}

main .content-section article h2 {
    margin: 2.2rem 0 .8rem;
    font-size: clamp(1.4rem, 2.6vw, 1.75rem);
    font-weight: 600;
    letter-spacing: -.022em;
    line-height: 1.2;
    color: var(--g-ink);
}

main .content-section article h3 {
    margin: 1.8rem 0 .6rem;
    font-size: 1.2rem;
    font-weight: 500;
    letter-spacing: -.01em;
    color: var(--g-ink);
}

main .content-section article > ul,
main .content-section article > ol {
    margin: 0 0 1.3rem;
    padding-left: 1.3rem;
    font-size: 1.04rem;
    line-height: 1.65;
    color: var(--g-ink-2);
}

main .content-section article > ul li,
main .content-section article > ol li {
    margin-bottom: .5rem;
    padding-left: .2rem;
}

main .content-section article > ul li::marker {
    color: var(--g-blue);
}

main .content-section article a:not(.cta-button) {
    color: var(--g-blue) !important;
}

main .content-section article a:not(.cta-button):hover {
    text-decoration: underline !important;
}

/* Autor y relacionados: placas interiores, sin la franja lateral */
.author-box,
.related-box {
    margin: 2.25rem 0 0 !important;
    padding: 1.4rem 1.6rem !important;
    background: rgba(118, 118, 128, .08) !important;
    border: 1px solid rgba(15, 23, 42, .06) !important;
    border-radius: 20px !important;
}

.related-box {
    margin-top: 1rem !important;
}

.author-box > p:first-child,
.related-box > p:first-child {
    font-size: 1.05rem !important;
    font-weight: 500 !important;
    color: var(--g-ink) !important;
}

.author-box > p[data-i18n="authorBio"] {
    color: var(--g-ink-2) !important;
    font-size: .93rem !important;
    line-height: 1.6;
}

.related-box ul {
    font-size: .96rem !important;
    line-height: 1.5;
}

.related-box li {
    margin-bottom: .3rem;
}

.related-box li::marker {
    color: var(--g-blue);
}

/* "Volver al blog": botón secundario */
main .content-section article > .cta-button {
    margin-top: 1.75rem;
    padding: 11px 22px;
    font-size: .95rem;
    color: var(--g-blue);
    background: rgba(0, 113, 227, .1);
    box-shadow: none;
}

main .content-section article > .cta-button:hover {
    color: #fff;
    background: var(--g-blue);
    transform: none;
}

@media (max-width: 768px) {
    .blog-hero {
        padding-top: 2rem;
    }

    .grid {
        gap: 14px;
        margin-top: 1.5rem;
    }

    main > .content-section {
        padding-top: 1.5rem;
    }

    main article > p {
        font-size: 1.02rem;
    }

    main article > p:first-child {
        font-size: 1.1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .card,
    .card:hover,
    .card:hover img {
        transform: none;
    }
}
