/* ============================================================
   CBM Institucional — Cuerpo de Bomberos Municipales
   Tema del sitio público con identidad institucional CBM
   ============================================================ */

:root {
    --lh-blue:      #8B1515;
    --lh-green:     #1fa36a;
    --lh-red:       #DC2626;
    --lh-yellow:    #F8E128;
    --lh-ink:       #1F2937;
    --lh-navy:      #1A1E23;
    --lh-soft-blue: #FDF5F5;
    --lh-soft-gold: #FFF9DC;
    --lh-white:     #FFFFFF;
    --lh-muted:     #6B7280;
    --lh-border:    rgba(139,21,21,0.14);
    --lh-shadow:    0 24px 60px rgba(26,30,35,0.12);
    --lh-radius-xl: 32px;
    --lh-radius-lg: 24px;
    --lh-radius-md: 18px;
    --bs-primary:       #8B1515;
    --bs-primary-rgb:   139, 21, 21;
}

html { scroll-behavior: smooth; }

body.public-site {
    margin: 0;
    font-family: "Nunito", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    color: var(--lh-ink);
    background: #f8f9fa;
}

body.public-site h1,
body.public-site h2,
body.public-site h3,
body.public-site h4,
body.public-site h5,
body.public-site h6 {
    font-family: "Nunito", "Segoe UI", sans-serif;
    color: var(--lh-navy);
    font-weight: 700;
}

img { max-width: 100%; display: block; }

/* ── Navbar — oscuro institucional ───────────────────── */
body.public-site .site-header,
body.public-site .navbar {
    background: var(--lh-navy) !important;
    border-bottom: 2px solid rgba(139,21,21,0.45);
}

body.public-site .navbar-brand {
    color: #ffffff !important;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.01em;
}

body.public-site .nav-link {
    color: rgba(255,255,255,0.85) !important;
    font-weight: 600;
    padding: 0.55rem 0.85rem !important;
    border-radius: 6px;
    transition: all 0.15s ease;
}

body.public-site .nav-link:hover,
body.public-site .nav-link.active {
    color: #ffffff !important;
    background: rgba(255,255,255,0.10);
}

body.public-site .navbar-toggler {
    border-color: rgba(255,255,255,0.35);
}

body.public-site .navbar-toggler-icon {
    filter: invert(1) brightness(1.8);
}

.dropdown-menu {
    border: 1px solid var(--lh-border);
    border-radius: var(--lh-radius-md);
    box-shadow: var(--lh-shadow);
    padding: 0.4rem 0;
    min-width: 200px;
}

.dropdown-item {
    font-weight: 600;
    color: var(--lh-ink);
    padding: 0.55rem 1rem;
    font-size: 0.92rem;
    border-radius: 6px;
    margin: 0 0.25rem;
}

.dropdown-item:hover, .dropdown-item:focus {
    background: var(--lh-soft-blue);
    color: var(--lh-navy);
}

/* ── Botones ─────────────────────────────────────────── */
.btn { border-radius: 30px; font-weight: 700; }

.btn-primary {
    background-color: var(--lh-blue);
    border-color: var(--lh-blue);
}

.btn-primary:hover, .btn-primary:focus {
    background-color: #6d1010;
    border-color: #6d1010;
}

.btn-outline-primary {
    color: var(--lh-blue);
    border-color: rgba(139,21,21,0.4);
}

.btn-outline-primary:hover, .btn-outline-primary:focus {
    background-color: var(--lh-blue);
    border-color: var(--lh-blue);
    color: #ffffff;
}

/* ── Controles de formulario ─────────────────────────── */
.form-control, .form-control:focus {
    border-radius: 18px;
    border-color: rgba(139,21,21,0.12);
    box-shadow: none;
}

.form-control:focus { border-color: var(--lh-navy); }

/* ── Hero CBM — tarjeta con degradado rojo ───────────── */
.cbm-hero-wrapper {
    padding: 2.5rem 1.5rem 1.5rem;
    background: #f8f9fa;
}

.cbm-hero {
    background: linear-gradient(180deg, #0d0101 0%, #5a0c0c 45%, #8B1515 100%);
    border-radius: 1.75rem;
    padding: 4.5rem 2rem;
    text-align: center;
    color: #fff;
    max-width: 1080px;
    margin: 0 auto;
    box-shadow: 0 24px 72px rgba(26,5,5,0.34);
}

.cbm-hero h1,
.cbm-hero h2 {
    color: #fff !important;
    font-size: clamp(1.5rem, 3.5vw, 2.6rem);
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.2;
    text-shadow: 0 2px 14px rgba(0,0,0,0.35);
}

.cbm-hero p {
    color: rgba(255,255,255,0.90);
    font-size: 1.1rem;
    margin-bottom: 2.25rem;
}

.cbm-emergency-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--lh-red);
    color: #fff;
    border: none;
    padding: 0.9rem 2.75rem;
    border-radius: 50px;
    font-weight: 800;
    font-size: 1.08rem;
    text-decoration: none;
    letter-spacing: 0.03em;
    box-shadow: 0 10px 30px rgba(220,38,38,0.44);
    transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.cbm-emergency-btn:hover {
    background: #b91c1c;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 14px 40px rgba(220,38,38,0.54);
    text-decoration: none;
}

/* ── Hero genérico de página ─────────────────────────── */
.hero-section, .page-hero {
    position: relative;
    padding: 4.5rem 0 3rem;
    background: linear-gradient(180deg, var(--lh-navy), rgba(139,21,21,0.82));
    color: #fff;
}

.page-hero--centered {
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* ── Utilidades de sección ───────────────────────────── */
.section-space { padding: 5.5rem 0; }
.bg-soft-blue  { background: var(--lh-soft-blue); }
.bg-soft-gold  { background: var(--lh-soft-gold); }

.section-heading {
    font-size: clamp(2rem, 2.5vw, 2.8rem);
    font-weight: 800;
    color: var(--lh-navy);
    line-height: 1.15;
}

.section-lead {
    color: var(--lh-muted);
    font-size: 1.05rem;
    line-height: 1.9;
}

/* ── Tarjetas / paneles ──────────────────────────────── */
.content-card, .info-panel, .value-card {
    border-radius: var(--lh-radius-xl);
    overflow: hidden;
    box-shadow: var(--lh-shadow);
}

.content-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--lh-white);
    border: 1px solid var(--lh-border);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.content-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 28px 64px rgba(139,21,21,0.16);
}

/* ── Sección CTA ─────────────────────────────────────── */
.cta-section {
    background: linear-gradient(135deg, var(--lh-navy), #3a0808 60%, #8B1515);
}

/* ── Pie de página ───────────────────────────────────── */
body.public-site footer {
    background: var(--lh-navy) !important;
    color: rgba(255,255,255,0.75);
    border-top-color: rgba(139,21,21,0.3) !important;
}

body.public-site footer a {
    color: rgba(255,255,255,0.70);
    text-decoration: none;
}

body.public-site footer a:hover { color: #ffffff; }

.site-footer { background: var(--lh-navy); }
.footer-title  { font-size: 1.05rem; margin-bottom: 1rem; color: var(--lh-white); }
.footer-muted, .footer-links a, .footer-contact a, .footer-bottom {
    color: rgba(255,255,255,0.85);
}

/* ── Galería ─────────────────────────────────────────── */
.gallery-tile {
    border-radius: var(--lh-radius-lg);
    overflow: hidden;
    box-shadow: var(--lh-shadow);
}

/* ── Volver arriba ───────────────────────────────────── */
.back-to-top {
    position: fixed;
    display: none;
    right: 30px;
    bottom: 30px;
    z-index: 1100;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    background: var(--lh-navy);
    color: #fff;
    box-shadow: 0 8px 20px rgba(26,30,35,0.20);
}

/* ── Responsivo ──────────────────────────────────────── */
@media (max-width: 767.98px) {
    .section-space { padding: 4.25rem 0; }
    .cbm-hero { padding: 3rem 1.25rem; }
    .cbm-hero-wrapper { padding: 1.25rem 0.75rem 0.75rem; }
}

/* ============================================================
   Blog Compartido — hero parallax, tarjetas, sidebar
   ============================================================ */

.blog-hero-parallax,
.article-hero-parallax {
    position: relative;
    min-height: 400px;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.blog-hero-bg-parallax,
.article-hero-bg-parallax {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    transform: scale(1.04);
    transition: transform 0.4s ease;
}

.blog-hero-overlay,
.article-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
        rgba(26,30,35,0.72) 0%,
        rgba(139,21,21,0.80) 100%);
}

.blog-hero-content,
.article-hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
    padding: 4rem 1rem;
    color: #fff;
}

.blog-hero-title,
.article-hero-title {
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    font-weight: 700;
    color: var(--lh-white);
    margin-bottom: 0.75rem;
    text-shadow: 0 2px 16px rgba(0,0,0,0.3);
}

.blog-hero-description,
.article-hero-description {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.88);
    max-width: 640px;
    margin: 0 auto 1.5rem;
}

.article-hero-meta {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.article-hero-meta-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: rgba(255,255,255,0.85);
    font-size: 0.92rem;
}

.blog-article-card {
    border-radius: var(--lh-radius-lg);
    overflow: hidden;
    background: var(--lh-white);
    box-shadow: var(--lh-shadow);
    border: 1px solid var(--lh-border);
    height: 100%;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.blog-article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 32px 72px rgba(139,21,21,0.18);
}

.blog-article-card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.blog-article-card-image {
    flex: 0 0 220px;
    min-height: 220px;
    background-size: cover;
    background-position: center;
    background-color: var(--lh-soft-blue);
}

.blog-article-card-content {
    flex: 1;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.blog-article-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--lh-navy);
    margin: 0;
    line-height: 1.3;
}

.blog-article-description {
    font-size: 0.93rem;
    color: var(--lh-muted);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

.blog-article-meta {
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid var(--lh-border);
}

.blog-article-date {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--lh-muted);
    font-size: 0.85rem;
}

.blog-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-section {
    background: var(--lh-white);
    border: 1px solid var(--lh-border);
    border-radius: var(--lh-radius-lg);
    padding: 1.5rem;
    box-shadow: var(--lh-shadow);
}

.sidebar-section-title {
    font-size: 1.1rem;
    color: var(--lh-navy);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.blog-info-item {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    margin-bottom: 0.85rem;
}

.blog-info-icon  { color: var(--lh-blue); margin-top: 0.15rem; flex-shrink: 0; }
.blog-info-content { flex: 1; }

.blog-info-label {
    font-size: 0.78rem;
    color: var(--lh-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.blog-info-value { font-size: 0.95rem; color: var(--lh-ink); }

.latest-articles-grid { display: flex; flex-direction: column; gap: 1rem; }

.latest-article-item {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s;
}

.latest-article-item:hover { opacity: 0.8; }

.latest-article-thumbnail {
    flex: 0 0 64px;
    height: 64px;
    border-radius: 0.5rem;
    background-size: cover;
    background-position: center;
    background-color: var(--lh-soft-blue);
}

.latest-article-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--lh-navy);
    margin: 0 0 0.25rem;
    line-height: 1.3;
}

.latest-article-date {
    font-size: 0.78rem;
    color: var(--lh-muted);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* ============================================================
   Blog Index
   ============================================================ */

.blog-articles-section {
    background: var(--lh-soft-blue);
    min-height: 40vh;
}

.articles-count { font-size: 0.95rem; }

@media (max-width: 767.98px) {
    .blog-hero-parallax  { min-height: 300px; }
    .blog-hero-bg-parallax { background-attachment: scroll; }
}

/* ============================================================
   Artículo de Blog — tipografía, paywall
   ============================================================ */

.article-content-section { background: var(--lh-white); }

.article-main-content {
    background: var(--lh-white);
    border-radius: var(--lh-radius-xl);
    border: 1px solid var(--lh-border);
    box-shadow: var(--lh-shadow);
    padding: 2.5rem;
}

.article-content {
    font-size: 1.05rem;
    line-height: 1.9;
    color: var(--lh-ink);
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4 {
    color: var(--lh-navy);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.article-content p { margin-bottom: 1.25rem; }

.article-content img {
    border-radius: 0.75rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    margin: 1.5rem auto;
    max-width: 100%;
    display: block;
}

.article-content a { color: var(--lh-blue); text-decoration: underline; }

.article-content blockquote {
    border-left: 4px solid var(--lh-blue);
    margin: 1.5rem 0;
    padding: 0.75rem 1.25rem;
    background: var(--lh-soft-blue);
    border-radius: 0 0.5rem 0.5rem 0;
    color: var(--lh-muted);
    font-style: italic;
}

.article-content pre,
.article-content code {
    background: var(--lh-soft-blue);
    border-radius: 8px;
    font-size: 0.9rem;
}

.article-paywall {
    text-align: center;
    padding: 3rem 1.5rem;
    background: var(--lh-soft-blue);
    border: 1px solid var(--lh-border);
    border-radius: var(--lh-radius-lg);
    margin-top: 1.5rem;
}

@media (max-width: 767.98px) {
    .article-hero-parallax    { min-height: 280px; }
    .article-hero-bg-parallax { background-attachment: scroll; }
    .article-main-content     { padding: 1.5rem; }
}