:root {
    --blog-ink: #102f31;
    --blog-muted: #52696a;
    --blog-teal: #246c6c;
    --blog-teal-strong: #15585b;
    --blog-cyan: #41f2f2;
    --blog-mint: #8afff4;
    --blog-dark: #063c40;
    --blog-soft: #eff8f7;
    --blog-line: rgba(36, 108, 108, 0.18);
}

html { scroll-behavior: smooth; }

.blog-page.blog-modern,
.article-page.article-modern {
    margin: 0;
    overflow-x: hidden;
    background: #f7fbfa;
    color: var(--blog-ink);
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.blog-page.blog-modern *,
.blog-page.blog-modern *::before,
.blog-page.blog-modern *::after,
.article-page.article-modern *,
.article-page.article-modern *::before,
.article-page.article-modern *::after { box-sizing: border-box; }

.blog-page.blog-modern .top-nav,
.article-page.article-modern .top-nav {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 78px;
    padding: 12px clamp(24px, 5vw, 76px);
    background: rgba(25, 88, 91, 0.94);
    box-shadow: 0 12px 32px rgba(7, 52, 54, 0.18);
    backdrop-filter: blur(14px);
}

.blog-page.blog-modern .nav-left,
.article-page.article-modern .nav-left {
    position: absolute;
    top: 50%;
    left: clamp(22px, 4vw, 60px);
    transform: translateY(-50%);
}

.blog-page.blog-modern .nav-logo,
.blog-page.blog-modern .nav-logo img,
.article-page.article-modern .nav-logo,
.article-page.article-modern .nav-logo img { display: block; }

.blog-page.blog-modern .nav-logo img,
.article-page.article-modern .nav-logo img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.blog-page.blog-modern .top-nav ul,
.article-page.article-modern .top-nav ul {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(34px, 6vw, 86px);
    margin: 0;
    padding: 0;
    list-style: none;
}

.blog-page.blog-modern .top-nav a,
.article-page.article-modern .top-nav a {
    position: relative;
    color: #fff;
    font-size: 0.98rem;
    font-weight: 700;
    text-decoration: none;
}

.blog-page.blog-modern .top-nav li > a::after,
.article-page.article-modern .top-nav li > a::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -8px;
    left: 0;
    height: 2px;
    background: var(--blog-cyan);
    transform: scaleX(0);
    transition: transform 0.2s ease;
}

.blog-page.blog-modern .top-nav li > a:hover::after,
.blog-page.blog-modern .top-nav li > a[aria-current="page"]::after,
.article-page.article-modern .top-nav li > a:hover::after,
.article-page.article-modern .top-nav li > a[aria-current="page"]::after { transform: scaleX(1); }

.blog-page.blog-modern .menu-toggle,
.article-page.article-modern .menu-toggle {
    display: none;
    padding: 9px 12px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font: inherit;
    font-weight: 700;
}

.blog-hero,
.article-page.article-modern .hero-section {
    position: relative;
    display: grid;
    min-height: 600px;
    place-items: center;
    padding: 145px 24px 72px;
    color: #fff;
    background-image:
        linear-gradient(105deg, rgba(5, 48, 52, 0.91) 0%, rgba(19, 76, 79, 0.7) 50%, rgba(8, 55, 59, 0.34) 100%),
        url('/images/civilmath_canva_hero_4_hq.png');
    background-position: center;
    background-size: cover;
    text-align: center;
}

.blog-hero::after,
.article-page.article-modern .hero-section::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 130px;
    background: linear-gradient(to top, rgba(4, 50, 53, 0.42), transparent);
    pointer-events: none;
}

.blog-hero-content,
.article-page.article-modern .hero-content {
    position: relative;
    z-index: 1;
    width: min(930px, 100%);
    margin: 0 auto;
}

.blog-eyebrow,
.blog-kicker,
.article-page.article-modern .hero-tagline {
    display: inline-flex;
    color: var(--blog-teal);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.blog-eyebrow,
.article-page.article-modern .hero-tagline { color: var(--blog-mint); }

.blog-hero h1,
.article-page.article-modern .hero-title {
    max-width: 900px;
    margin: 18px auto;
    color: #fff;
    font-size: clamp(2.8rem, 6vw, 5.2rem);
    line-height: 0.99;
    letter-spacing: -0.055em;
    text-wrap: balance;
}

.blog-hero h1 span,
.article-page.article-modern .hero-title .highlight { color: var(--blog-cyan); }

.blog-hero-content > p,
.article-page.article-modern .hero-subtitle {
    max-width: 780px;
    margin: 0 auto;
    color: rgba(255, 255, 255, 0.86);
    font-size: clamp(1rem, 1.7vw, 1.2rem);
    line-height: 1.65;
    text-wrap: balance;
}

.article-page.article-modern .release-pill { display: none; }

.blog-hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 29px;
}

.blog-btn-primary,
.blog-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 22px;
    border: 1px solid transparent;
    border-radius: 9px;
    font-weight: 800;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.blog-btn-primary {
    background: var(--blog-cyan);
    color: #063e41;
    box-shadow: 0 14px 34px rgba(16, 222, 219, 0.22);
}

.blog-btn-secondary {
    border-color: rgba(255, 255, 255, 0.45);
    background: rgba(6, 48, 51, 0.34);
    color: #fff;
}

.blog-btn-primary:hover,
.blog-btn-secondary:hover { transform: translateY(-2px); }

.posts-section {
    padding: 92px max(24px, calc((100vw - 1220px) / 2));
    background:
        linear-gradient(rgba(36, 108, 108, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(36, 108, 108, 0.035) 1px, transparent 1px),
        #f8fbfb;
    background-size: 34px 34px;
}

.blog-section-heading {
    max-width: 760px;
    margin: 0 auto 44px;
    text-align: center;
}

.blog-section-heading h2,
.blog-cta h2 {
    margin: 10px 0 13px;
    color: var(--blog-ink);
    font-size: clamp(2rem, 4.2vw, 3.25rem);
    line-height: 1.08;
    letter-spacing: -0.04em;
    text-wrap: balance;
}

.blog-section-heading p,
.blog-cta p {
    margin: 0;
    color: var(--blog-muted);
    font-size: 1.04rem;
    line-height: 1.6;
}

.featured-article {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.75fr);
    max-width: 1220px;
    margin: 0 auto 22px;
    overflow: hidden;
    border: 1px solid rgba(36, 108, 108, 0.25);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 22px 58px rgba(19, 75, 77, 0.11);
}

.featured-image {
    display: block;
    min-height: 460px;
    overflow: hidden;
    background: #1d1d1d;
}

.featured-image img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 460px;
    object-fit: cover;
    object-position: center;
}

.featured-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    color: var(--blog-teal);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.featured-copy h3,
.post-card h3 {
    color: var(--blog-ink);
    line-height: 1.16;
    letter-spacing: -0.025em;
}

.featured-copy h3 {
    margin: 15px 0 14px;
    font-size: clamp(1.75rem, 3vw, 2.55rem);
}

.featured-copy > p,
.post-card p {
    color: var(--blog-muted);
    line-height: 1.6;
}

.featured-copy > p { margin: 0 0 17px; }

.featured-copy ul {
    margin: 0 0 22px;
    padding: 0;
    list-style: none;
}

.featured-copy li {
    position: relative;
    margin-top: 8px;
    padding-left: 18px;
    color: #36595a;
    font-size: 0.91rem;
}

.featured-copy li::before {
    content: "";
    position: absolute;
    top: 0.54em;
    left: 0;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--blog-teal);
}

.post-link {
    align-self: flex-start;
    color: var(--blog-teal-strong);
    font-weight: 850;
    text-decoration: none;
}

.post-link:hover { text-decoration: underline; }

.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    max-width: 1220px;
    margin: 0 auto;
}

.post-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--blog-line);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 16px 42px rgba(19, 75, 77, 0.075);
}

.post-image {
    display: block;
    height: 210px;
    overflow: hidden;
    background: #173f42;
}

.post-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.post-card:hover .post-image img { transform: scale(1.025); }

.post-card-content {
    display: flex;
    min-height: 260px;
    flex-direction: column;
    align-items: flex-start;
    padding: 24px;
}

.post-card h3 {
    margin: 13px 0 10px;
    font-size: 1.27rem;
}

.post-card p {
    margin: 0 0 20px;
    font-size: 0.94rem;
}

.post-card .post-link { margin-top: auto; }

.blog-cta {
    padding: 82px 24px;
    background:
        radial-gradient(circle at 50% 0, rgba(65, 242, 242, 0.13), transparent 42%),
        var(--blog-dark);
    color: #fff;
    text-align: center;
}

.blog-cta .blog-kicker { color: var(--blog-mint); }
.blog-cta h2 { color: #fff; }
.blog-cta p { color: rgba(255, 255, 255, 0.72); }

.blog-footer,
.article-page.article-modern .social-media-section {
    margin: 0;
    padding: 38px 24px 84px;
    background: var(--blog-teal-strong);
    color: #fff;
    text-align: center;
}

.blog-footer h3,
.article-page.article-modern .social-media-section h3 {
    margin: 0 0 16px;
    color: #fff;
    font-size: 1rem;
}

.blog-footer .social-icons,
.article-page.article-modern .social-icons {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin: 0;
}

.blog-footer .social-icons img,
.article-page.article-modern .social-icons img {
    display: block;
    width: 34px;
    height: 34px;
}

.blog-footer > p,
.article-page.article-modern .copyright-section p {
    margin: 18px 0 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.78rem;
}

.blog-page.blog-modern .whatsapp-button,
.article-page.article-modern .whatsapp-button {
    position: fixed;
    right: 24px;
    bottom: 62px;
    z-index: 1001;
    display: block;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    box-shadow: 0 9px 24px rgba(0, 0, 0, 0.22);
}

.blog-page.blog-modern .whatsapp-button img,
.article-page.article-modern .whatsapp-button img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.blog-page.blog-modern .bottom-bar,
.article-page.article-modern .bottom-bar {
    position: fixed;
    inset: auto 0 0;
    z-index: 1000;
    min-height: 42px;
    padding: 8px 24px;
    background: rgba(21, 88, 91, 0.97);
    box-shadow: 0 -4px 16px rgba(6, 53, 55, 0.14);
}

.blog-page.blog-modern .contact-info,
.article-page.article-modern .contact-info {
    display: flex;
    justify-content: center;
    gap: 28px;
}

.blog-page.blog-modern .contact-info a,
.article-page.article-modern .contact-info a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    color: #fff;
    font-size: 0.78rem;
    text-decoration: none;
}

.blog-page.blog-modern .contact-info img,
.article-page.article-modern .contact-info img {
    width: 14px;
    height: 14px;
    object-fit: contain;
}

/* Article page */
.article-page.article-modern .main-container {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}

.article-page.article-modern .hero-section { height: auto; }

.article-page.article-modern .hero-text {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.article-page.article-modern .hero-tagline { margin: 0; }
.article-page.article-modern .hero-title { font-weight: 800; }
.article-page.article-modern .hero-subtitle { font-size: 1.1rem; }

.article-page.article-modern .blog-post-content {
    width: min(980px, calc(100% - 40px));
    max-width: 980px;
    margin: 72px auto 88px;
    padding: 0;
    background: transparent;
    box-shadow: none;
    text-align: left;
}

.article-back {
    display: inline-flex;
    margin-bottom: 28px;
    color: var(--blog-teal-strong);
    font-weight: 800;
    text-decoration: none;
}

.article-page.article-modern #noticia-titulo {
    max-width: 880px;
    margin: 0;
    color: var(--blog-ink);
    font-size: clamp(2.25rem, 5vw, 4.25rem);
    line-height: 1.02;
    letter-spacing: -0.05em;
    text-align: left;
    text-wrap: balance;
}

.article-page.article-modern #noticia-fecha {
    display: inline-flex;
    margin: 20px 0 30px;
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(36, 108, 108, 0.1);
    color: var(--blog-teal-strong);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.article-page.article-modern #noticia-imagen {
    display: block;
    width: 100%;
    max-width: none;
    max-height: 560px;
    margin: 0 0 42px;
    border: 1px solid var(--blog-line);
    border-radius: 16px;
    object-fit: cover;
    box-shadow: 0 20px 50px rgba(17, 69, 71, 0.11);
}

.article-page.article-modern #noticia-contenido {
    color: #29494a;
    font-size: 1.04rem;
    line-height: 1.78;
}

.article-page.article-modern #noticia-contenido > p,
.article-page.article-modern #noticia-contenido > ul,
.article-page.article-modern #noticia-contenido > ol,
.article-page.article-modern #noticia-contenido > h3,
.article-page.article-modern #noticia-contenido > .article-callout,
.article-page.article-modern #noticia-contenido > .article-note,
.article-page.article-modern #noticia-contenido > .article-flow,
.article-page.article-modern #noticia-contenido > .article-feature-grid,
.article-page.article-modern #noticia-contenido > .article-cta { max-width: 800px; margin-right: auto; margin-left: auto; }

.article-page.article-modern #noticia-contenido h3 {
    margin-top: 48px;
    margin-bottom: 14px;
    color: var(--blog-ink);
    font-size: clamp(1.55rem, 3vw, 2.15rem);
    line-height: 1.18;
    letter-spacing: -0.03em;
}

.article-page.article-modern #noticia-contenido li { margin-bottom: 8px; }

.article-page.article-modern .article-lead {
    color: #173f41;
    font-size: 1.2rem;
    line-height: 1.72;
}

.article-page.article-modern .article-callout,
.article-page.article-modern .article-note {
    margin-top: 30px;
    margin-bottom: 30px;
    padding: 24px 26px;
    border: 1px solid var(--blog-line);
    border-left: 5px solid var(--blog-teal);
    border-radius: 12px;
    background: var(--blog-soft);
}

.article-page.article-modern .article-callout > strong,
.article-page.article-modern .article-note > strong {
    display: block;
    margin-bottom: 6px;
    color: var(--blog-ink);
}

.article-page.article-modern .article-callout p,
.article-page.article-modern .article-note p { margin: 0; }

.article-page.article-modern .article-flow {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
    gap: 10px;
    align-items: center;
    margin-top: 34px;
    margin-bottom: 34px;
    padding: 20px;
    border-radius: 13px;
    background: var(--blog-dark);
}

.article-page.article-modern .article-flow span {
    padding: 10px;
    border: 1px solid rgba(138, 255, 244, 0.14);
    border-radius: 8px;
    color: #fff;
    font-size: 0.86rem;
    font-weight: 750;
    text-align: center;
}

.article-page.article-modern .article-flow b { color: var(--blog-mint); }

.article-page.article-modern .article-feature-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
    margin-top: 24px;
    margin-bottom: 28px;
}

.article-page.article-modern .article-feature-grid > div {
    padding: 21px;
    border: 1px solid var(--blog-line);
    border-radius: 11px;
    background: #fff;
}

.article-page.article-modern .article-feature-grid strong { color: var(--blog-teal-strong); }
.article-page.article-modern .article-feature-grid p { margin: 7px 0 0; font-size: 0.94rem; line-height: 1.55; }

.article-page.article-modern .article-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 26px;
    margin-top: 46px;
    padding: 27px;
    border-radius: 13px;
    background: var(--blog-dark);
    color: #fff;
}

.article-page.article-modern .article-cta strong { color: #fff; }
.article-page.article-modern .article-cta p { margin: 4px 0 0; color: rgba(255, 255, 255, 0.7); }

.article-page.article-modern .article-cta a {
    flex: 0 0 auto;
    padding: 11px 16px;
    border-radius: 8px;
    background: var(--blog-cyan);
    color: var(--blog-dark);
    font-weight: 850;
    text-decoration: none;
}

.article-page.article-modern .copyright-section { margin: 0; }

@media (max-width: 980px) {
    .featured-article { grid-template-columns: 1fr; }
    .featured-image,
    .featured-image img { min-height: 360px; }
    .posts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 780px) {
    .blog-page.blog-modern .top-nav,
    .article-page.article-modern .top-nav {
        justify-content: flex-end;
        min-height: 66px;
        padding: 9px 18px;
    }

    .blog-page.blog-modern .nav-left,
    .article-page.article-modern .nav-left { left: 16px; }

    .blog-page.blog-modern .nav-logo img,
    .article-page.article-modern .nav-logo img {
        width: 42px;
        height: 42px;
    }

    .blog-page.blog-modern .menu-toggle,
    .article-page.article-modern .menu-toggle { display: inline-flex; }

    .blog-page.blog-modern .top-nav ul,
    .article-page.article-modern .top-nav ul {
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 8px 18px 18px;
        background: rgba(21, 88, 91, 0.98);
    }

    .blog-page.blog-modern .top-nav ul.is-open,
    .article-page.article-modern .top-nav ul.is-open { display: flex; }

    .blog-page.blog-modern .top-nav li > a,
    .article-page.article-modern .top-nav li > a {
        display: block;
        padding: 11px 4px;
    }

    .blog-page.blog-modern .top-nav li > a::after,
    .article-page.article-modern .top-nav li > a::after { display: none; }

    .blog-hero,
    .article-page.article-modern .hero-section {
        min-height: 500px;
        padding: 122px 20px 58px;
        background-position: 58% center;
    }

    .blog-hero h1,
    .article-page.article-modern .hero-title { font-size: clamp(2.5rem, 12vw, 3.7rem); }

    .posts-section { padding-top: 70px; padding-bottom: 72px; }

    .article-page.article-modern .blog-post-content {
        width: min(100% - 32px, 980px);
        margin-top: 52px;
        margin-bottom: 66px;
    }

    .article-page.article-modern .article-flow { grid-template-columns: 1fr; }
    .article-page.article-modern .article-flow b { transform: rotate(90deg); text-align: center; }
}

@media (max-width: 600px) {
    .blog-hero-actions { align-items: stretch; flex-direction: column; }
    .blog-btn-primary,
    .blog-btn-secondary { width: 100%; }
    .featured-copy { padding: 26px; }
    .featured-image,
    .featured-image img { min-height: 250px; }
    .posts-grid { grid-template-columns: 1fr; }
    .post-image { height: 220px; }
    .article-page.article-modern .article-feature-grid { grid-template-columns: 1fr; }
    .article-page.article-modern .article-cta { align-items: stretch; flex-direction: column; }
    .article-page.article-modern .article-cta a { text-align: center; }

    .blog-page.blog-modern .contact-info,
    .article-page.article-modern .contact-info { gap: 12px; }

    .blog-page.blog-modern .contact-info a,
    .article-page.article-modern .contact-info a { font-size: 0.68rem; }

    .blog-page.blog-modern .whatsapp-button,
    .article-page.article-modern .whatsapp-button {
        right: 14px;
        bottom: 55px;
        width: 46px;
        height: 46px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .blog-page.blog-modern *,
    .article-page.article-modern * { transition-duration: 0.01ms !important; }
}
