/* ============================================================
   CSS EXTRAÍDO DE inicio.php
   Colegio Militar Francisco Bolognesi - CMFB
   ============================================================ */

.modal-popup-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); z-index: 9999; display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: all 0.3s ease; }
        .modal-popup-overlay.show { opacity: 1; visibility: visible; }
        .modal-popup-content { background: transparent; position: relative; max-width: 90%; max-height: 90vh; transform: scale(0.9); transition: all 0.3s ease; }
        .modal-popup-overlay.show .modal-popup-content { transform: scale(1); }
        .modal-popup-close { position: absolute; top: -15px; right: -15px; background: #fff; border: none; border-radius: 50%; width: 35px; height: 35px; font-size: 1.2rem; cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,0.2); z-index: 10; display: flex; align-items: center; justify-content: center; color: #333; }
        .modal-img-web { display: block; max-width: 100%; height: auto; max-height: 85vh; border-radius: 8px; border: 3px solid #d4af37; box-shadow: 0 10px 30px rgba(0,0,0,0.3); }
        .modal-img-mobile { display: none; max-width: 100%; height: auto; max-height: 85vh; border-radius: 8px; border: 3px solid #d4af37; box-shadow: 0 10px 30px rgba(0,0,0,0.3); }
        @media (max-width: 768px) { .modal-img-web { display: none !important; } .modal-img-mobile { display: block !important; } }

        /* ============================================================
           POP-UP TPL4 - REGISTRO VIRTUAL DESDE EL INICIO
           ============================================================ */
        .inicio-tpl4-popup { position:fixed; inset:0; z-index:100000; display:none; align-items:center; justify-content:center; padding:24px; box-sizing:border-box; }
        .inicio-tpl4-popup.is-open { display:flex; }
        .inicio-tpl4-popup-backdrop { position:absolute; inset:0; background:rgba(15,23,42,.72); backdrop-filter:blur(7px); -webkit-backdrop-filter:blur(7px); opacity:0; transition:opacity .25s ease; }
        .inicio-tpl4-popup.is-open .inicio-tpl4-popup-backdrop { opacity:1; }
        .inicio-tpl4-popup-dialog { position:relative; z-index:2; width:min(760px,100%); max-height:min(900px,calc(100vh - 40px)); overflow:auto; background:#fff; border-radius:22px; box-shadow:0 30px 90px rgba(0,0,0,.30); transform:translateY(22px) scale(.97); opacity:0; transition:transform .28s ease,opacity .28s ease; }
        .inicio-tpl4-popup.is-open .inicio-tpl4-popup-dialog { transform:translateY(0) scale(1); opacity:1; }
        .inicio-tpl4-popup-close { position:absolute; top:16px; right:16px; z-index:5; width:42px; height:42px; border:0; border-radius:50%; background:rgba(255,255,255,.16); color:#fff; display:flex; align-items:center; justify-content:center; cursor:pointer; font-size:18px; transition:.2s ease; }
        .inicio-tpl4-popup-close:hover { background:rgba(255,255,255,.28); transform:rotate(4deg) scale(1.05); }
        .inicio-tpl4-popup-head { position:relative; display:flex; align-items:center; gap:18px; padding:30px 72px 26px 28px; color:#fff; background:linear-gradient(135deg,#991b1b 0%,#b91c1c 55%,#7f1d1d 100%); overflow:hidden; }
        .inicio-tpl4-popup-head::after { content:""; position:absolute; width:210px; height:210px; right:-80px; top:-110px; border-radius:50%; background:rgba(255,255,255,.09); }
        .inicio-tpl4-popup-icon { flex:0 0 58px; width:58px; height:58px; border-radius:16px; display:flex; align-items:center; justify-content:center; background:rgba(255,255,255,.14); border:1px solid rgba(255,255,255,.24); font-size:25px; }
        .inicio-tpl4-popup-kicker { display:block; margin-bottom:5px; font-size:11px; font-weight:800; letter-spacing:1.7px; opacity:.84; }
        .inicio-tpl4-popup-head h2 { margin:0; color:#fff; font-size:clamp(20px,3vw,29px); line-height:1.15; }
        .inicio-tpl4-popup-head p { margin:7px 0 0; color:rgba(255,255,255,.84); font-size:13px; line-height:1.5; }
        .inicio-tpl4-popup-body { padding:24px; }
        .inicio-tpl4-popup-info { display:flex; align-items:flex-start; gap:10px; margin-bottom:18px; padding:12px 14px; border-radius:12px; background:#f8fafc; border:1px solid #e5e7eb; color:#475569; font-size:12px; line-height:1.45; }
        .inicio-tpl4-popup-info i { flex:0 0 auto; margin-top:1px; color:#b91c1c; }
        .inicio-tpl4-popup .tpl4-form { margin:0; }
        .inicio-tpl4-popup .tpl4-form-row { display:grid; grid-template-columns:1fr 1fr; gap:15px; margin-bottom:0; }
        .inicio-tpl4-popup .tpl4-input,.inicio-tpl4-popup .tpl4-textarea { box-sizing:border-box; width:100%; padding:15px; border:1px solid #cbd5e1; border-radius:6px; font-family:'Lato','Arial',sans-serif; font-size:.95rem; color:#1e293b; background:#f8fafc; transition:border-color .3s; margin-bottom:15px; }
        .inicio-tpl4-popup .tpl4-input:focus,.inicio-tpl4-popup .tpl4-textarea:focus { border-color:#1a2238; outline:none; background:#fff; }
        .inicio-tpl4-popup .tpl4-textarea { height:120px; resize:vertical; }
        .inicio-tpl4-popup .tpl4-checkbox { display:flex; gap:10px; align-items:flex-start; font-family:'Lato','Arial',sans-serif; font-size:.85rem; color:#4b5563; margin-bottom:10px; cursor:pointer; }
        .inicio-tpl4-popup .tpl4-checkbox input { margin-top:3px; accent-color:#1a2238; }
        .inicio-tpl4-popup .tpl4-submit-btn { background:#1a2238; color:#fff; border:none; width:100%; padding:18px; font-family:'Oswald','Arial Narrow',sans-serif; font-size:1.1rem; text-transform:uppercase; letter-spacing:1px; border-radius:6px; cursor:pointer; transition:background .3s; margin-top:20px; }
        .inicio-tpl4-popup .tpl4-submit-btn:hover { background:#881313; }
        .inicio-tpl4-popup .tpl4-submit-btn:disabled { opacity:.78; cursor:wait; }
        .inicio-tpl4-popup .tpl4-form-message { width:100%; box-sizing:border-box; margin-top:16px; padding:14px 16px; display:flex; align-items:flex-start; gap:12px; border-radius:10px; animation:inicioTpl4MessageIn .28s ease both; }
        .inicio-tpl4-popup .tpl4-form-message[hidden] { display:none; }
        .inicio-tpl4-popup .tpl4-form-message-icon { flex:0 0 32px; width:32px; height:32px; border-radius:50%; display:flex; align-items:center; justify-content:center; }
        .inicio-tpl4-popup .tpl4-form-message-content { display:flex; flex-direction:column; gap:3px; }
        .inicio-tpl4-popup .tpl4-form-message-content strong { font-size:.9rem; }
        .inicio-tpl4-popup .tpl4-form-message-content span { font-size:.8rem; line-height:1.45; }
        .inicio-tpl4-popup .tpl4-form-message--loading { background:#eff6ff; border:1px solid #bfdbfe; border-left:5px solid #2563eb; }
        .inicio-tpl4-popup .tpl4-form-message--loading .tpl4-form-message-icon { background:#2563eb; color:#fff; }
        .inicio-tpl4-popup .tpl4-form-message--loading strong { color:#1e3a8a; }
        .inicio-tpl4-popup .tpl4-form-message--loading span { color:#1d4ed8; }
        .inicio-tpl4-popup .tpl4-form-message--success { background:linear-gradient(135deg,#ecfdf3 0%,#dcfce7 100%); border:1px solid #86efac; border-left:5px solid #22c55e; }
        .inicio-tpl4-popup .tpl4-form-message--success .tpl4-form-message-icon { background:#22c55e; color:#fff; }
        .inicio-tpl4-popup .tpl4-form-message--success strong { color:#166534; }
        .inicio-tpl4-popup .tpl4-form-message--success span { color:#15803d; }
        .inicio-tpl4-popup .tpl4-form-message--error { background:#fff7ed; border:1px solid #fed7aa; border-left:5px solid #f97316; }
        .inicio-tpl4-popup .tpl4-form-message--error .tpl4-form-message-icon { background:#f97316; color:#fff; }
        .inicio-tpl4-popup .tpl4-form-message--error strong { color:#9a3412; }
        .inicio-tpl4-popup .tpl4-form-message--error span { color:#c2410c; }
        @keyframes inicioTpl4MessageIn { from { opacity:0; transform:translateY(4px); } to { opacity:1; transform:none; } }
        body.inicio-tpl4-popup-open { overflow:hidden; }
        @media(max-width:700px) {
            .inicio-tpl4-popup { padding:10px; }
            .inicio-tpl4-popup-dialog { max-height:calc(100vh - 20px); border-radius:17px; }
            .inicio-tpl4-popup-head { padding:24px 58px 22px 20px; gap:13px; }
            .inicio-tpl4-popup-icon { flex-basis:48px; width:48px; height:48px; border-radius:13px; font-size:20px; }
            .inicio-tpl4-popup-body { padding:18px; }
            .inicio-tpl4-popup-close { top:11px; right:11px; width:38px; height:38px; }
            .inicio-tpl4-popup .tpl4-form-row { display:block; }
            .inicio-tpl4-popup .tpl4-form-row > * { width:100%; }
            .inicio-tpl4-popup-head h2 { font-size:20px; }
        }

        /* ============================================================
           BLOQUE INSTITUCIONAL DE INICIO
           Misma identidad del cintillo inferior: borgoña + dorado + verde.
           ============================================================ */
        .cmfb-home-feature-section {
            width: min(1120px, calc(100% - 40px));
            margin: 18px auto 28px;
            padding: 0 0 20px;
            background: transparent;
            border: 0;
            border-top: 4px solid #560910;
            box-shadow: none;
        }

        .cmfb-home-feature-section::before {
            content: "";
            display: block;
            width: 100%;
            height: 2px;
            margin-top: 0;
            background: #a8874a;
        }

        .cmfb-home-feature-cards {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 14px;
            margin: 14px 0 14px;
        }

        .cmfb-home-feature-card {
            min-width: 0;
            position: relative;
            overflow: hidden;
            background: #fff;
            border: 1px solid #d8d0c7;
            border-top: 0;
            border-radius: 0 0 4px 4px;
            box-shadow: 0 5px 14px rgba(0,0,0,.10);
        }

        .cmfb-home-feature-card-link {
            display: block;
            color: inherit;
            text-decoration: none;
        }

        .cmfb-home-feature-card-title {
            margin: 0;
            min-height: 38px;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 7px 12px;
            color: #fff;
            background: #560910;
            border-bottom: 2px solid #a8874a;
            font-family: 'Oswald','Arial Narrow',Arial,sans-serif;
            font-size: 17px;
            font-weight: 800;
            line-height: 1.1;
            text-align: center;
            text-transform: uppercase;
            letter-spacing: .1px;
        }

        .cmfb-home-feature-card-image {
            display: block;
            width: 100%;
            height: 285px;
            object-fit: cover;
            object-position: center;
            background: #e9e9e9;
        }

        .cmfb-home-admission {
            display: grid;
            grid-template-columns: 43% 57%;
            align-items: stretch;
            min-height: 345px;
            background: #e6dddd;
            border: 1px solid #cfc4c0;
            border-radius: 2px;
            overflow: hidden;
            box-shadow: 0 6px 16px rgba(0,0,0,.11);
        }

        .cmfb-home-admission-info {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 30px 34px;
            text-align: center;
            color: #560910;
            border-right: 4px solid #a8874a;
            background: #e6dddd;
        }

        .cmfb-home-admission-info p {
            margin: 5px 0;
            font-size: 13px;
            line-height: 1.45;
        }

        .cmfb-home-admission-info i {
            margin-right: 5px;
        }

        .cmfb-home-admission-info .cmfb-admission-info-title {
            margin-bottom: 7px;
            color: #560910;
            font-weight: 700;
        }

        .cmfb-home-admission-hours {
            margin: 12px 0 !important;
            color: #006b16;
            font-family: 'Oswald','Arial Narrow',Arial,sans-serif;
            font-size: 18px !important;
            font-weight: 800;
            text-transform: uppercase;
        }

        .cmfb-home-admission-address-title {
            margin-top: 9px !important;
            margin-bottom: 1px !important;
        }

        .cmfb-home-admission-actions {
            display: flex;
            align-items: center;
            justify-content: center;
            flex-wrap: wrap;
            gap: 9px;
            margin-top: 14px;
        }

        .cmfb-home-admission-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-height: 38px;
            padding: 9px 18px;
            border: 1px solid #560910;
            border-radius: 2px;
            background: #560910;
            color: #fff !important;
            text-decoration: none !important;
            font-size: 12px;
            font-weight: 800;
            text-transform: uppercase;
            box-shadow: none;
        }

        .cmfb-home-admission-btn.secondary {
            background: transparent;
            border-color: #006b16;
            color: #006b16 !important;
        }

        .cmfb-home-admission-media {
            position: relative;
            min-height: 345px;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            justify-content: flex-end;
            background: #fff;
        }

        .cmfb-home-admission-image {
            position: absolute;
            inset: 0 0 48px 0;
            width: 100%;
            height: calc(100% - 48px);
            object-fit: cover;
            object-position: center;
            display: block;
            filter: none;
        }

        .cmfb-home-admission-image::after {
            content: "";
        }

        .cmfb-home-admission-overlay {
            position: absolute;
            inset: 0 0 48px 0;
            background: transparent;
            pointer-events: none;
        }

        .cmfb-home-admission-title {
            position: relative;
            z-index: 2;
            min-height: 48px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0;
            padding: 5px 12px;
            background: #560910;
            border-top: 2px solid #a8874a;
            color: #fff;
            font-family: 'Oswald','Arial Narrow',Arial,sans-serif;
            font-size: 22px;
            font-weight: 900;
            text-align: center;
            text-transform: uppercase;
        }

        @media (max-width: 700px) {
            .cmfb-home-feature-section {
                width: calc(100% - 20px);
                margin-top: 12px;
                padding-bottom: 14px;
            }

            .cmfb-home-feature-cards,
            .cmfb-home-admission {
                grid-template-columns: 1fr;
            }

            .cmfb-home-feature-card-image {
                height: 230px;
            }

            .cmfb-home-admission-info {
                min-height: 300px;
                border-right: 0;
                border-bottom: 4px solid #a8874a;
                padding: 28px 20px;
            }

            .cmfb-home-admission-media {
                min-height: 300px;
            }
        }

        /* ============================================================
           ACCESOS RÁPIDOS
           Solo da estilo a los elementos administrados desde
           web_config.home_quick_links. No modifica otras secciones.
           ============================================================ */
        .cmfb-quick-links-section {
            width: 100%;
            margin: 0;
            padding: 0 0 18px;
            background: transparent;
        }

        .cmfb-quick-links-container {
            width: min(1200px, calc(100% - 32px));
            margin: 0 auto;
            display: grid;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 12px;
            align-items: stretch;
        }

        .cmfb-quick-link {
            min-height: 62px;
            box-sizing: border-box;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 14px;
            padding: 8px 18px;
            background: #004b0b;
            color: #fff !important;
            text-decoration: none !important;
            border: 0;
            border-radius: 0;
            box-shadow: none;
            transition: background .18s ease, transform .18s ease;
        }

        .cmfb-quick-link:hover {
            background: #063d0b;
            color: #fff !important;
            transform: translateY(-1px);
        }

        .cmfb-quick-link-image {
            width: 46px;
            height: 46px;
            flex: 0 0 46px;
            border-radius: 8px;
            overflow: hidden;
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(255,255,255,.08);
        }

        .cmfb-quick-link-image img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
        }

        .cmfb-quick-link-icon {
            flex: 0 0 36px;
            width: 36px;
            height: 36px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #fff;
            font-size: 25px;
            line-height: 1;
        }

        .cmfb-quick-link-icon i {
            color: inherit;
        }

        .cmfb-quick-link-label {
            flex: 1 1 auto;
            min-width: 0;
            color: #fff;
            font-family: 'Oswald', 'Arial Narrow', Arial, sans-serif;
            font-size: 16px;
            font-weight: 700;
            line-height: 1.15;
            text-transform: uppercase;
            text-align: left;
            overflow-wrap: anywhere;
        }

        @media (max-width: 900px) {
            .cmfb-quick-links-container {
                grid-template-columns: repeat(2, minmax(0, 1fr));
            }
        }

        @media (max-width: 560px) {
            .cmfb-quick-links-section {
                padding-bottom: 12px;
            }

            .cmfb-quick-links-container {
                width: calc(100% - 20px);
                grid-template-columns: 1fr;
                gap: 8px;
            }

            .cmfb-quick-link {
                min-height: 58px;
                padding: 8px 14px;
            }

            .cmfb-quick-link-label {
                font-size: 14px;
            }
        }
    
        /* ============================================================
           MEJORAS LOCALES: NOTICIAS Y EVENTOS
           ============================================================ */
        .cmfb-noticias-heading {
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            gap: 3px;
            min-width: 0;
        }

        .cmfb-noticias-kicker {
            display: inline-flex;
            align-items: center;
            gap: 7px;
            color: #a8874a;
            font-family: 'Lato', Arial, sans-serif;
            font-size: 10px;
            font-weight: 800;
            letter-spacing: 1.4px;
            line-height: 1;
            text-transform: uppercase;
        }

        .cmfb-noticias-heading .section-title-distressed {
            position: relative;
            display: inline-block;
            line-height: .95;
            padding-bottom: 8px;
        }

        .cmfb-noticias-heading .section-title-distressed::after {
            content: "";
            display: block;
            width: 58px;
            height: 3px;
            margin-top: 7px;
            background: #6f0b14;
            border-radius: 2px;
        }

        .cmfb-event-link {
            display: block;
            width: 100%;
            color: inherit;
            text-decoration: none !important;
            cursor: pointer;
        }

        .cmfb-event-link .widget-content-white {
            transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease;
        }

        .cmfb-event-link:hover .widget-content-white {
            transform: translateY(-2px);
            box-shadow: 0 8px 18px rgba(0,0,0,.14);
            background-color: #fff;
        }

        .cmfb-event-more-link {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            margin-top: 8px;
            color: #6f0b14;
            font-family: 'Lato', Arial, sans-serif;
            font-size: 11px;
            font-weight: 800;
            letter-spacing: .35px;
            text-transform: uppercase;
        }

        .cmfb-event-more-link i {
            font-size: 10px;
            transition: transform .18s ease;
        }

        .cmfb-event-link:hover .cmfb-event-more-link i {
            transform: translateX(3px);
        }

        @media (max-width: 700px) {
            .cmfb-noticias-kicker {
                font-size: 9px;
            }

            .cmfb-event-more-link {
                font-size: 10px;
            }
        }

/* ============================================================
   CMFB INICIO - MEJORAS ADICIONALES
   ============================================================ */

html {
    scroll-behavior: smooth;
}

img {
    max-width: 100%;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

/* Evita que el contenido del inicio quede pegado al footer */
.cmfb-home-feature-section,
.cmfb-quick-links-section {
    scroll-margin-top: 90px;
}

/* Las tarjetas administradas desde el panel se sienten como un bloque único */
.cmfb-home-feature-card {
    transition: transform .2s ease, box-shadow .2s ease;
}

.cmfb-home-feature-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(0,0,0,.14);
}

.cmfb-home-feature-card-link:focus-visible,
.cmfb-quick-link:focus-visible,
.btn:focus-visible,
.btn-filter:focus-visible {
    outline: 3px solid #d4af37;
    outline-offset: 3px;
}

/* Accesos rápidos: mejor reparto horizontal */
.cmfb-quick-link {
    position: relative;
    overflow: hidden;
}

.cmfb-quick-link::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: #a8874a;
    transform: scaleY(0);
    transform-origin: center;
    transition: transform .18s ease;
}

.cmfb-quick-link:hover::after {
    transform: scaleY(1);
}

/* Convenios */

/* Noticias: altura uniforme sin tocar la información */
.cards-grid .card-custom {
    min-width: 0;
}

.cards-grid .card-custom img {
    display: block;
    width: 100%;
}

/* Mejor comportamiento del slider en pantallas pequeñas */
.hero-container {
    isolation: isolate;
}

.hero-overlay {
    max-width: min(680px, 88%);
    box-sizing: border-box;
}

@media (max-width: 900px) {
    .hero-container {
        height: 360px;
    }

    .hero-image {
        height: 360px;
    }

    .hero-overlay {
        left: 3%;
        bottom: 6%;
        padding: 18px;
    }

    .hero-overlay h3 {
        font-size: 1.45rem;
    }

    .hero-overlay h4 {
        font-size: 1rem;
    }
}

@media (max-width: 560px) {
    .hero-section {
        padding: 14px 10px 0;
    }

    .hero-container {
        height: 300px;
        border-radius: 8px;
    }

    .hero-image {
        height: 300px;
    }

    .hero-overlay {
        left: 10px;
        right: 10px;
        bottom: 10px;
        max-width: none;
        padding: 13px;
        border-left-width: 3px;
    }

    .hero-overlay h3 {
        font-size: 1.05rem;
        margin-bottom: 4px;
    }

    .hero-overlay h4 {
        font-size: .82rem;
        margin-bottom: 9px;
    }

    .hero-buttons {
        gap: 7px;
    }

    .hero-buttons .btn {
        padding: 8px 11px;
        font-size: .76rem;
    }

    .cmfb-home-feature-card-title {
        font-size: 15px;
    }

    .cmfb-home-admission-title {
        font-size: 18px;
    }

}

/* Respeta usuarios que prefieren menos movimiento */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
