/* =========================================================
   Variables de tema (claro / oscuro)
   El modo se controla con el atributo data-bs-theme en <html>,
   que además activa el dark mode nativo de Bootstrap 5.3.
   ========================================================= */
:root {
    --bordo: #8A1538;
    --bordo-dark: #6a102b;
    --bordo-light: #a32247;
    --bordo-glow: rgba(138, 21, 56, 0.25);

    --bg: #f6f7fb;
    --surface: #ffffff;
    --surface-alt: #eef0f5;
    --text-strong: #15171c;
    --border-soft: #e7e9f0;

    --shadow-sm: 0 2px 10px rgba(20, 20, 30, 0.06);
    --shadow-md: 0 14px 34px rgba(20, 20, 30, 0.09);
    --shadow-lg: 0 24px 60px rgba(20, 20, 30, 0.14);

    /* Alias retrocompatibles */
    --light-gray: var(--bg);
    --medium-gray: var(--surface-alt);
    --dark-text: var(--text-strong);
}

[data-bs-theme="dark"] {
    --bordo: #d24a71;
    --bordo-dark: #a32247;
    --bordo-light: #e06a8e;
    --bordo-glow: rgba(210, 74, 113, 0.35);

    --bg: #0e1016;
    --surface: #171922;
    --surface-alt: #1f222d;
    --text-strong: #eef0f5;
    --border-soft: #2a2e3a;

    --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.45);
    --shadow-md: 0 14px 34px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.6);
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--bordo-light) transparent;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-strong);
    background-color: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color .35s ease, color .35s ease;
    animation: pageFadeIn .5s ease both;
}

@keyframes pageFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

main {
    flex: 1;
}

h1, h2, h3, h4, h5, h6 {
    letter-spacing: -0.02em;
}

/* Colores personalizados Bootstrap */
.bg-bordo {
    background-color: var(--bordo) !important;
}

.text-bordo {
    color: var(--bordo) !important;
}

.border-bordo {
    border-color: var(--bordo) !important;
}

.btn-bordo {
    background-color: var(--bordo);
    color: white;
    border: none;
    transition: all 0.25s ease;
    box-shadow: 0 4px 14px var(--bordo-glow);
}

.btn-bordo:hover {
    background-color: var(--bordo-dark);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 10px 24px var(--bordo-glow);
}

.btn-bordo:active {
    transform: translateY(0);
}

.hover-bordo:hover {
    color: var(--bordo) !important;
}

.hover-white:hover {
    color: white !important;
}

/* =========================================================
   Theme toggle (switch sol / luna)
   ========================================================= */
.theme-toggle-btn {
    --size: 38px;
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: rotate(15deg);
}

.theme-toggle-btn i {
    font-size: 1rem;
    transition: transform 0.4s ease;
}

.theme-toggle-btn.admin-variant {
    border-color: var(--border-soft);
    background: var(--surface-alt);
    color: var(--text-strong);
}

.theme-toggle-btn.admin-variant:hover {
    background: var(--bordo);
    color: #fff;
    border-color: var(--bordo);
}

/* =========================================================
   Navbar
   ========================================================= */
.navbar {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.navbar.bg-bordo {
    box-shadow: 0 6px 24px rgba(138, 21, 56, 0.25);
}

.navbar-brand {
    font-size: 1.5rem;
    letter-spacing: -0.5px;
    transition: transform 0.25s ease;
}

.navbar-brand:hover {
    transform: translateY(-1px);
}

.nav-link {
    font-weight: 500;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    background-color: white;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after, .nav-link.active::after {
    width: 100%;
}

/* =========================================================
   Hero / encabezados
   ========================================================= */
.hero-section {
    position: relative;
    background: url('../escuela.jpg') center/cover no-repeat;
    height: 60vh;
    min-height: 400px;
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(138, 21, 56, 0.82), rgba(10, 6, 10, 0.78));
}

.hero-section::before,
.hero-section::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    z-index: 1;
    pointer-events: none;
}

.hero-section::before {
    width: 320px;
    height: 320px;
    background: rgba(255, 255, 255, 0.12);
    top: -120px;
    right: -60px;
}

.hero-section::after {
    width: 220px;
    height: 220px;
    background: rgba(255, 255, 255, 0.10);
    bottom: -80px;
    left: 8%;
}

.hero-section .position-relative {
    z-index: 2;
}

.hero-section h1,
.hero-section p,
.hero-section .btn {
    animation: heroRise .7s cubic-bezier(.22, 1, .36, 1) both;
}

.hero-section p { animation-delay: .08s; }
.hero-section .btn { animation-delay: .16s; }

@keyframes heroRise {
    from { opacity: 0; transform: translateY(22px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Encabezados tipo "page header" usados en horarios/historia */
header.py-5[style*="gradient"] {
    position: relative;
    overflow: hidden;
}

/* =========================================================
   Cards
   ========================================================= */
.news-card {
    transition: all 0.3s cubic-bezier(.22, 1, .36, 1);
    border: none;
    border-radius: 14px;
    overflow: hidden;
    background: var(--surface);
    height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
}

.news-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg) !important;
}

.news-img-container {
    height: 200px;
    overflow: hidden;
    background-color: var(--surface-alt);
    display: flex;
    align-items: center;
    justify-content: center;
}

.news-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.news-card:hover .news-img {
    transform: scale(1.06);
}

.news-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: var(--bordo);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.card-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-weight: 700;
    line-height: 1.4;
    color: var(--text-strong);
}

.card-text {
    color: var(--bs-secondary-color);
    font-size: 0.95rem;
    flex-grow: 1;
}

.card-footer-custom {
    padding: 1rem 1.25rem;
    background: var(--surface);
    border-top: 1px solid var(--border-soft);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Read More View */
.article-header {
    margin-top: -3rem;
    position: relative;
    z-index: 2;
    background: var(--surface);
    padding: 2.5rem;
    border-radius: 14px;
    box-shadow: var(--shadow-md);
}

.article-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-strong);
    opacity: .9;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Admin Styles */
.form-signin {
    width: 100%;
    max-width: 330px;
    padding: 15px;
    margin: auto;
}

/* Utilities */
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* =========================================================
   Scroll reveal (aparición suave de secciones al hacer scroll)
   ========================================================= */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .7s cubic-bezier(.22, 1, .36, 1), transform .7s cubic-bezier(.22, 1, .36, 1);
}

.reveal.reveal-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Animación de entrada para tarjetas generadas dinámicamente por JS
   (noticias, horarios): no dependen del IntersectionObserver de reveal.js. */
.fade-in-card {
    animation: fadeInCard .5s cubic-bezier(.22, 1, .36, 1) both;
}

@keyframes fadeInCard {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================================
   Horarios
   ========================================================= */
.tecnicatura-card {
    border: 2px solid var(--border-soft);
    border-radius: 14px;
    background: var(--surface);
    color: var(--text-strong);
    transition: all 0.25s ease;
}

.tecnicatura-card:hover {
    border-color: var(--bordo-light);
    transform: translateY(-3px);
    box-shadow: var(--shadow-sm);
}

.tecnicatura-card.active {
    border-color: var(--bordo);
    background-color: var(--bordo-glow);
    color: var(--bordo);
    box-shadow: var(--shadow-md);
}

.horario-doc-card {
    border: none;
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transition: all 0.25s ease;
}

.horario-doc-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.horario-file-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.icon-pdf { background-color: rgba(220, 53, 69, 0.12); color: #dc3545; }
.icon-word { background-color: rgba(13, 110, 253, 0.12); color: #0d6efd; }

/* =========================================================
   Footer
   ========================================================= */
footer.bg-dark {
    background-color: #0b0c10 !important;
}
