@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;500;700&family=Source+Serif+4:opsz,wght@8..60,400;8..60,600;8..60,700&family=Lato:wght@400;700;900&display=swap');

/* Variables Base Institucional */
:root {
    --bg-institucional: #f3efe6;
    --bg-sidebar: #DFDACB;
    --border-gold-strong: #876B3A;
    --border-gold-light: #d4cba1;
    --blue-active: #2C4A6E;
    --text-dark: #111;
    --text-gray: #888;
}

body.theme-institucional {
    background-color: var(--bg-institucional);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

body.theme-institucional .navbar-custom {
    margin-bottom: 0 !important;
}

.inst-layout {
    display: flex;
    width: 100%;
    max-width: 100%;
    margin: 0;
    min-height: 80vh;
    background-color: transparent;
}

/* SIDEBAR */
.inst-sidebar {
    width: 10% !important;
    min-width: 300px; 
    padding-left: 40px; 
    padding-right: 30px;
    padding-top: 50px;
    flex-shrink: 0;
    background-color: var(--bg-sidebar);
    border-right: 2px solid var(--border-gold-strong);
    display: flex;
    flex-direction: column;
}

.inst-sidebar-header {
    padding: 0 0 20px 0;
}

.inst-sidebar-subtitle {
    margin: 0 0 12px;
    font-family: "IBM Plex Mono", "Courier New", monospace;
    font-size: .66rem;
    letter-spacing: .26em;
    text-transform: uppercase;
    color: #7C817D;
}

.inst-sidebar-title {
    font-family: 'Oswald', system-ui, sans-serif;
    font-size: 2rem; 
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: -0.5px;
}

.inst-sidebar-title::after {
    content: "";
    display: block;
    width: 40px;
    height: 3px;
    background-color: var(--text-dark);
    margin-top: 15px;
    margin-bottom: 15px;
}

.inst-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    flex-grow: 1;
}

.inst-menu li {
    margin: 0;
    padding: 0;
}

.inst-menu a {
    display: flex;
    align-items: center;
    padding: 12px 0;
    text-decoration: none;
    color: #555;
    font-family: 'Oswald', system-ui, sans-serif;
    font-weight: 500;
    font-size: 1rem; 
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s;
    border-left: 5px solid transparent; 
    padding-left: 10px;
    margin-left: -15px; 
}

.inst-menu a:hover {
    background-color: rgba(255,255,255,0.3);
    color: var(--text-dark);
}

/* === ESTADO ACTIVO === */
.inst-menu a.active {
    background-color: #E2DFD3; 
    color: var(--text-dark);
    border-left-color: var(--blue-active); 
    font-weight: 700;
}

.inst-menu a.active .inst-menu-num {
    color: var(--blue-active);
}

.inst-menu-num {
    font-family: 'Lato', sans-serif;
    font-size: 0.75rem;
    color: var(--text-gray);
    margin-right: 15px;
    font-weight: 700;
    transition: color 0.2s;
}

.inst-sidebar-footer {
    margin: 20px 0 0 0;
    padding-top: 20px;
    border-top: 1px solid var(--border-gold-strong); 
    font-family: "IBM Plex Mono", "Courier New", monospace;
    font-size: .64rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: #7C817D;
    line-height: 1.7;
}

/* ÁREA PRINCIPAL */
.inst-main {
    flex-grow: 1;
    width: 75%;
    background-color: var(--bg-institucional);
    padding-left: 50px;
    padding-right: 5%; 
    padding-top: 50px;
    padding-bottom: 80px;
}

.inst-breadcrumb {
    font-family: "IBM Plex Mono", "Courier New", monospace;
    font-size: 0.75rem;
    letter-spacing: 2px;
    color: var(--text-gray);
    text-transform: uppercase;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.inst-title {
    font-family: "Oswald", system-ui, sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a1a;
    text-transform: uppercase;
    margin: 0 0 15px 0;
    line-height: 1.1;
    letter-spacing: -0.5px;
}

.inst-intro {
    font-family: "Source Serif 4", Georgia, serif;
    font-size: 1.05rem !important;
    line-height: 1.7 !important;
    color: #2b2b2b;
    max-width: 55%;
    margin-bottom: 30px;
    text-align: justify;
}


/* ========================================================= */
/* CLASES DE LAS PLANTILLAS ANTIGUAS (1, 2, 3, 4)            */
/* ========================================================= */
.inst-stats {
    font-family: 'Lato', sans-serif;
    font-size: 0.65rem;
    letter-spacing: 2px;
    color: var(--text-gray);
    text-transform: uppercase;
    margin-bottom: 35px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    border-bottom: 1px solid var(--border-gold-strong);
    padding-bottom: 15px;
}

.inst-stats span {
    color: #1e293b;
    font-weight: 900;
}

.inst-grid-1 { display: grid; grid-template-columns: 5.8fr 4.2fr; gap: 35px; align-items: start; }
.inst-grid-2 { display: grid; grid-template-columns: 5.5fr 4.5fr; gap: 40px; align-items: start; }

.inst-media-wrapper {
    background: #ffffff; padding: 10px; box-shadow: 0 5px 20px rgba(0,0,0,0.08); border: 1px solid var(--border-gold-light);
}
.inst-media-wrapper img, .inst-media-wrapper video, .inst-media-wrapper iframe { width: 100%; height: auto; display: block; }
.inst-image-caption { background-color: #1a2238; padding: 15px 20px; text-transform: uppercase; box-shadow: 0 10px 30px rgba(0,0,0,0.1); }
.inst-image-caption-name { display: block; margin-bottom: 7px; font-family: "Oswald", system-ui, sans-serif; font-weight: 600; font-size: .92rem; line-height: 1.1; letter-spacing: .01em; text-transform: uppercase; color: #ece7dd; }
.inst-image-caption-rank { display: block; margin-bottom: 4px; font-family: "IBM Plex Mono", "Courier New", monospace; font-size: .6rem; letter-spacing: .08em; text-transform: uppercase; color: #ece7dd99; }
.inst-image-caption-role { display: block; font-family: "IBM Plex Mono", "Courier New", monospace; font-size: .66rem; letter-spacing: .05em; color: #c2a06a; }

.inst-content-box { padding-top: 0; border-left: 2px solid var(--border-gold-strong); padding-left: 25px; margin: 0 0 clamp(26px, 4vw, 38px); max-width: 62ch; font-family: "Source Serif 4", Georgia, serif; font-size: 1.02rem; line-height: 1.7; color: #2a2e2c; text-align: justify; }
.inst-subtitle { margin: 0 0 14px; font-family: "IBM Plex Mono", "Courier New", monospace; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--blue-active); }
.inst-subtitle-top { font-family: 'Lato', sans-serif; font-size: 0.7rem; letter-spacing: 3px; color: var(--text-gray); text-transform: uppercase; margin-bottom: 15px; }
.inst-body { font-family: 'Source Serif 4', Georgia, serif; font-size: 0.95rem; line-height: 1.8; color: #2b2b2b; margin-bottom: 25px; text-align: justify; }
.inst-signature-role { font-family: "IBM Plex Mono", "Courier New", monospace; font-size: 0.75rem; letter-spacing: 3px; color: #A9874E; text-transform: uppercase; margin-bottom: 5px; border-top: 1px solid var(--border-gold-light); padding-top: 20px; display: inline-block; }
.inst-signature-name { font-family: 'Source Serif 4', Georgia, serif; font-size: .95rem; font-weight: 500; color: #15191A; }
.inst-tabs { display: flex; flex-wrap: wrap; gap: 20px; margin-bottom: 40px; border-bottom: 1px solid var(--border-gold-light); padding-bottom: 15px; }
.inst-tabs a { font-family: 'Lato', sans-serif; font-size: 0.7rem; letter-spacing: 2px; color: var(--text-gray); text-transform: uppercase; text-decoration: none; transition: color 0.2s; }
.inst-tabs a:hover { color: var(--text-dark); }
.inst-tabs a.active { color: var(--text-dark); font-weight: 900; }
.contact-layout { display: grid; grid-template-columns: 1fr 1.3fr; gap: 30px; align-items: stretch; margin-top: 20px; }
.contact-card { background: #fff; border-radius: 8px; border: 1px solid #eae5d8; padding: 30px; margin-bottom: 30px; box-shadow: 0 4px 15px rgba(0,0,0,0.03); }
.contact-card-title { font-family: 'Oswald', system-ui, sans-serif; font-size: 1.2rem; font-weight: 700; color: #1a1a1a; margin-bottom: 25px; text-transform: uppercase; letter-spacing: 0.5px; }
.contact-list { list-style: none; padding: 0; margin: 0; }
.contact-list-item { display: flex; gap: 15px; margin-bottom: 25px; align-items: flex-start; }
.contact-list-item:last-child { margin-bottom: 0; }
.contact-list-icon { font-size: 1.2rem; color: #666; margin-top: 2px; min-width: 25px; text-align: center; }
.contact-list-content h5 { margin: 0 0 5px 0; font-family: 'Lato', sans-serif; font-weight: 700; font-size: 0.95rem; color: #1a1a1a; }
.contact-list-content p { margin: 0; font-family: 'Lato', sans-serif; font-size: 0.85rem; color: #555; line-height: 1.5; }
.contact-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 15px; }
.contact-form-control { width: 100%; padding: 12px 15px; border: 1px solid #e5e7eb; border-radius: 6px; font-family: 'Lato', sans-serif; font-size: 0.85rem; background: #fdfdfd; transition: all 0.3s; outline: none; color: #333; }
.contact-form-control:focus { border-color: var(--border-gold-strong); background: #fff; box-shadow: 0 0 0 3px rgba(142, 122, 69, 0.1); }
textarea.contact-form-control { resize: vertical; min-height: 100px; }
.contact-form-check { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; font-family: 'Lato', sans-serif; font-size: 0.75rem; color: #555; }
.contact-form-check input { margin-top: 3px; cursor: pointer; }
.contact-btn { width: 100%; background: #404040; color: #fff; border: none; padding: 15px; border-radius: 6px; font-family: 'Oswald', system-ui, sans-serif; font-size: 1rem; font-weight: 700; text-transform: uppercase; cursor: pointer; transition: background 0.3s; margin-top: 15px; }
.contact-btn:hover { background: #1a1a1a; }
.contact-right-col .contact-card { display: flex; flex-direction: column; height: 100%; padding: 15px; margin-bottom: 0; }
.map-container-tpl3 { width: 100%; flex-grow: 1; min-height: 500px; background: #eee; border-radius: 8px; overflow: hidden; margin-bottom: 20px; border: 1px solid #eae5d8; }
.map-container-tpl3 iframe { width: 100%; height: 100%; border: none; }
.map-address-tpl3 { font-family: 'Lato', sans-serif; font-size: 0.85rem; color: #555; padding: 0 10px 10px 10px; }
.map-address-tpl3 strong { display: block; font-size: 0.95rem; margin-bottom: 5px; color: #1a1a1a; font-weight: 900; }
.hero-tpl4 { position: relative; width: 100%; height: 60vh; overflow: hidden; background: #000; margin-bottom: 50px; }
.hero-tpl4 video, .hero-tpl4 img { width: 100%; height: 100%; object-fit: cover; opacity: 0.85; }
.hero-tpl4-btn { position: absolute; bottom: 40px; left: 5%; background-color: #a71818; color: #fff; padding: 12px 30px; border-radius: 30px; text-decoration: none; font-family: 'Oswald', system-ui, sans-serif; font-size: 1.1rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; display: flex; align-items: center; gap: 12px; border: 2px solid #ea8c8c; box-shadow: 0 4px 15px rgba(0,0,0,0.5); transition: all 0.3s; z-index: 10; }
.hero-tpl4-btn::before { content: ''; display: block; width: 10px; height: 10px; background: #fde047; border-radius: 50%; }
.hero-tpl4-btn:hover { background-color: #881313; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.6); }
.tpl4-media-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-bottom: 60px; max-width: 100%; margin-left: auto; margin-right: auto; }
.tpl4-media-title { font-family: 'Oswald', system-ui, sans-serif; color: #166534; text-align: center; font-size: 1.8rem; margin-bottom: 20px; text-transform: uppercase; }
.tpl4-iframe-container { position: relative; width: 100%; padding-bottom: 56.25%; background: #000; border-radius: 12px; overflow: hidden; box-shadow: 0 8px 25px rgba(0,0,0,0.15); }
.tpl4-iframe-container iframe, .tpl4-iframe-container img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; object-fit: cover; }
.tpl4-faq-wrapper { max-width: 1000px; margin: 0 auto 60px auto; padding: 0 20px; }
.tpl4-faq-header { font-family: 'Oswald', system-ui, sans-serif; color: #166534; font-size: 2rem; margin-bottom: 25px; text-transform: uppercase; }
.tpl4-faq-container { border-top: 2px solid #d4d4d4; }
.tpl4-faq-item { border-bottom: 2px solid #d4d4d4; }
.tpl4-faq-question { width: 100%; text-align: left; padding: 18px 20px; background: #e5e5e5; border: none; font-family: 'Oswald', system-ui, sans-serif; font-size: 1.1rem; font-weight: 700; color: #333; cursor: pointer; display: flex; justify-content: space-between; align-items: center; transition: all 0.3s; }
.tpl4-faq-question:hover { background: #d4d4d4; }
.tpl4-faq-question.active { background: #d4d4d4; color: #166534; }
.tpl4-faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.3s ease-out; background: #fdfcf9; }
.tpl4-faq-answer-inner { padding: 20px; font-family: 'Lato', sans-serif; color: #444; line-height: 1.7; font-size: 0.95rem; }

/* ========================================= */
/* RESPONSIVE (Tablets y Móviles)            */
/* ========================================= */
@media (max-width: 992px) {
    .inst-layout { flex-direction: column; }
    
    .inst-sidebar { 
        width: 100% !important; 
        padding: 40px 20px;
        border-right: none; 
        border-bottom: 2px solid var(--border-gold-strong); 
        align-items: center;
        text-align: center;
    }
    
    .inst-sidebar-header {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
    }
    
    .inst-sidebar-title::after {
        margin-left: auto;
        margin-right: auto;
    }
    
    .inst-menu {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .inst-menu a {
        justify-content: center;
        padding: 15px 0;
        margin-left: 0;
        border-left: none;
        border-bottom: 3px solid transparent;
        width: 100%;
        max-width: 300px;
    }
    
    /* En móvil, la línea azul del menú activo va abajo, no a la izquierda */
    .inst-menu a.active {
        border-left-color: transparent;
        border-bottom-color: var(--blue-active); 
        background-color: #E2DFD3;
    }
    
    .inst-sidebar-footer {
        text-align: center;
        padding: 30px 20px;
        border-top: 1px solid var(--border-gold-strong);
        width: 100%;
        margin-top: 20px;
    }
    
    .inst-main { 
        width: 100%;
        padding: 40px 20px; 
    }
    
    .inst-intro {
        max-width: 100%;
    }
    
    .inst-grid-1, .inst-grid-2 { grid-template-columns: 1fr; gap: 30px; }
    .inst-title { font-size: 2.2rem; }
    .inst-grid-2 { display: flex; flex-direction: column-reverse; }
    .contact-layout { grid-template-columns: 1fr; gap: 0; }
    .contact-form-row { grid-template-columns: 1fr; gap: 15px; }
    .map-container-tpl3 { min-height: 400px; }
    .contact-right-col .contact-card { margin-top: 30px; }
}

@media (max-width: 768px) {
    .hero-tpl4 { height: 40vh; }
    .tpl4-media-grid { grid-template-columns: 1fr; gap: 40px; }
}