/* ===================================================================
   Escuela Taoísta Hung Lin — hoja de estilos institucional
   Paleta: rojo institucional + blanco, acento dorado tenue
   Tipografía: Inter (alojada localmente en /vendor/fonts)
   =================================================================== */
/* ---- Tipografía local (offline / sin dependencias externas) ---- */
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../vendor/fonts/inter/inter-latin-400-normal.woff2") format("woff2");
}

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("../vendor/fonts/inter/inter-latin-500-normal.woff2") format("woff2");
}

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("../vendor/fonts/inter/inter-latin-600-normal.woff2") format("woff2");
}

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("../vendor/fonts/inter/inter-latin-700-normal.woff2") format("woff2");
}

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: url("../vendor/fonts/inter/inter-latin-800-normal.woff2") format("woff2");
}

/* ---- Tokens de diseño ---- */
:root {
    /* Color institucional */
    --tao-red: #aa0000;
    --tao-red-dark: #6e0000;
    --tao-red-darker: #4a0000;
    --tao-white: #ffffff;
    --tao-paper: #fbf6f1;
    --tao-ink: #241b18;
    --tao-ink-soft: #52403b;
    --tao-line: #e7d9d0;
    --tao-gold: #b5741a;
    --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    --radius: 6px;
    --shadow-card: 0 1px 2px rgba(36, 27, 24, 0.06), 0 6px 20px rgba(36, 27, 24, 0.06);
    --container-max: 1180px;
}

/* ---- Base ---- */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
}

body {
    font-family: var(--font-body);
    color: var(--tao-ink);
    background: var(--tao-paper);
    line-height: 1.6;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    * {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

a {
    color: var(--tao-red);
    text-decoration: none;
}

a:hover,
a:focus-visible {
    color: var(--tao-red-dark);
    text-decoration: underline;
}

:focus-visible {
    outline: 3px solid var(--tao-gold);
    outline-offset: 2px;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 2000;
    background: var(--tao-white);
    color: var(--tao-red);
    padding: 0.75rem 1.25rem;
    border-radius: 0 0 var(--radius) 0;
    font-weight: 600;
}

.skip-link:focus {
    left: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-body);
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--tao-ink);
}

.eyebrow {
    color: var(--tao-red);
    font-weight: 600;
    font-size: 0.8rem;
    margin-bottom: 0.35rem;
}

/* ---- Navbar ---- */
.site-navbar {
    background: var(--tao-white);
    border-bottom: 1px solid var(--tao-line);
}

.site-navbar .navbar-brand {
    font-weight: 800;
    color: var(--tao-red);
    font-size: 1.05rem;
    line-height: 1.15;
}

.site-navbar .navbar-brand small {
    display: block;
    font-weight: 500;
    font-size: 0.68rem;
    color: var(--tao-ink-soft);
    letter-spacing: 0.02em;
}

.site-navbar .nav-link {
    color: var(--tao-ink);
    font-weight: 500;
    padding: 0.6rem 0.85rem;
    border-bottom: 2px solid transparent;
}

.site-navbar .nav-link:hover,
.site-navbar .nav-link:focus-visible,
.site-navbar .nav-link.active {
    color: var(--tao-red);
    border-bottom-color: var(--tao-red);
}

/* ---- Hero ---- */
.hero {
    position: relative;
    background: radial-gradient(120% 160% at 15% 0%, var(--tao-red-dark) 0%, var(--tao-red) 45%, var(--tao-red-darker) 100%);
    color: var(--tao-white);
    overflow: hidden;
    background-image: url('../images/redforest2026-3.png');
    background-color: #b40707;
    background-size: cover;
    background-position: center center;
}

.hero-taiji {
    position: absolute;
    right: -60px;
    bottom: -80px;
    width: 320px;
    height: 320px;
    opacity: 0.14;
    pointer-events: none;
}

.hero-inner {
    position: relative;
    z-index: 1;
    padding: 4.25rem 0 3.5rem;
}

.hero h1 {
    color: var(--tao-white);
    font-weight: 800;
    font-size: clamp(2rem, 4.4vw, 3.1rem);
    max-width: 16ch;
}

.hero .lead {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.05rem;
    max-width: 52ch;
}

.hero .btn-cta {
    background: var(--tao-white);
    color: var(--tao-red);
    font-weight: 600;
    border-radius: var(--radius);
    padding: 0.6rem 1.3rem;
    border: 2px solid var(--tao-white);
}

.hero .btn-cta:hover {
    background: transparent;
    color: var(--tao-white);
}

.hero .btn-outline-cta {
    color: var(--tao-white);
    font-weight: 600;
    border-radius: var(--radius);
    padding: 0.6rem 1.3rem;
    border: 2px solid rgba(255, 255, 255, 0.7);
}

.hero .btn-outline-cta:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--tao-white);
}

/* ---- Accesos rápidos (nav de íconos) ---- */
.quick-links {
    background: var(--tao-white);
    border-bottom: 1px solid var(--tao-line);
}

.quick-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.6rem;
    padding: 1.1rem 0.5rem;
    border-radius: var(--radius);
    color: var(--tao-ink);
    height: 100%;
}

.quick-link:hover,
.quick-link:focus-visible {
    background: var(--tao-paper);
    color: var(--tao-red);
    text-decoration: none;
}

.quick-link img {
    width: 56px;
    height: 56px;
    object-fit: contain;
}

.quick-link span {
    font-weight: 600;
    font-size: 0.88rem;
    line-height: 1.25;
}

/* ---- Secciones generales ---- */
.section-title {
    font-size: 1.4rem;
    font-weight: 700;
    border-bottom: 3px solid var(--tao-red);
    padding-bottom: 0.5rem;
    margin-bottom: 1.25rem;
    display: inline-block;
}

/* ---- Tarjetas de novedades ---- */
.news-card {
    background: var(--tao-white);
    border: 1px solid var(--tao-line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: 1.25rem 1.35rem;
    margin-bottom: 1.25rem;
}

.news-card h3 {
    font-size: 1.05rem;
    color: var(--tao-red);
    margin-bottom: 0.35rem;
}

.news-card .news-date {
    font-size: 0.78rem;
    color: var(--tao-ink-soft);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.5rem;
}

.news-card p:last-child {
    margin-bottom: 0;
}

.news-card img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    margin: 0.5rem 0;
    border: 1px solid var(--tao-line);
}

.poem-block {
    border-left: 3px solid var(--tao-red);
    padding: 0.25rem 0 0.25rem 1.1rem;
    font-style: italic;
    color: var(--tao-ink-soft);
    margin: 0.75rem 0;
}

.poem-author {
    font-style: normal;
    font-weight: 600;
    color: var(--tao-ink);
}

/* ---- Barra lateral (sedes / contacto) ---- */
.aside-card {
    background: var(--tao-white);
    border: 1px solid var(--tao-line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.sede-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sede-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--tao-red);
    color: var(--tao-white);
    border-radius: var(--radius);
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.6rem;
}

.sede-item img {
    width: 56px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.sede-item a {
    color: var(--tao-white);
    font-weight: 700;
}

.sede-item a:hover {
    color: #ffe9e0;
}

.sede-item .sede-schedule {
    display: block;
    font-weight: 400;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.85);
}

.contact-icons {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.contact-icons img {
    width: 44px;
    height: 44px;
    object-fit: contain;
}

.notice-gold {
    background: #fff6e6;
    border: 1px solid #f1d9a8;
    color: #6b4a10;
    border-radius: var(--radius);
    padding: 0.85rem 1rem;
    font-size: 0.86rem;
}

.notice-block h4 {
    color: var(--tao-gold);
    font-size: 1rem;
    margin-bottom: 0.35rem;
}

.notice-block p {
    font-size: 0.88rem;
    color: var(--tao-ink-soft);
}

/* ---- Acordeón de enlaces secundarios ---- */
.accordion .accordion-button {
    font-weight: 600;
    color: var(--tao-red);
    background: var(--tao-white);
}

.accordion .accordion-button:not(.collapsed) {
    color: var(--tao-red-dark);
    background: var(--tao-paper);
    box-shadow: inset 0 -1px 0 var(--tao-line);
}

.accordion .accordion-button:focus {
    box-shadow: none;
}

.link-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.link-list li {
    border-bottom: 1px solid var(--tao-line);
}

.link-list li:last-child {
    border-bottom: none;
}

.link-list a {
    display: block;
    padding: 0.55rem 0.1rem;
    color: var(--tao-ink);
    font-size: 0.92rem;
}

.link-list a:hover {
    color: var(--tao-red);
    text-decoration: none;
    padding-left: 0.35rem;
    transition: padding-left 0.15s ease;
}

/* ---- Facebook embed ---- */
.fb-wrap {
    max-width: 100%;
    overflow-x: auto;
}

/* ---- Buscar / denominaciones ---- */
.search-strip {
    background: var(--tao-white);
    border-top: 1px solid var(--tao-line);
    border-bottom: 1px solid var(--tao-line);
}

.search-strip h2 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--tao-ink-soft);
}

.search-form input[type="text"] {
    border: 1px solid var(--tao-line);
    border-radius: var(--radius);
    padding: 0.4rem 0.6rem;
}

.search-form .btn-search {
    background: var(--tao-red);
    color: var(--tao-white);
    border: none;
    border-radius: var(--radius);
    padding: 0.4rem 1rem;
    font-weight: 600;
}

.search-form .btn-search:hover {
    background: var(--tao-red-dark);
}

.search-form .credit {
    font-size: 0.72rem;
    color: #9a9a9a;
}

/* ---- Footer ---- */
.site-footer {
    background: var(--tao-red);
    color: var(--tao-white);
}

.site-footer .footer-title {
    font-weight: 700;
    font-size: 1.05rem;
}

.site-footer a {
    color: var(--tao-white);
    text-decoration: underline;
}

.site-footer a:hover {
    color: #ffe9e0;
}

.site-footer .footer-fine {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.85);
}

/* ---- Botón volver arriba ---- */
.back-to-top {
    position: fixed;
    right: 1.1rem;
    bottom: 1.1rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--tao-red);
    color: var(--tao-white);
    border: none;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-card);
    z-index: 1030;
}

.back-to-top.show {
    display: flex;
}

.back-to-top:hover {
    background: var(--tao-red-dark);
}

/* ---- Responsivo ---- */
@media (max-width: 767.98px) {
    .hero-inner {
        padding: 2.75rem 0 2.25rem;
        text-align: center;
    }

    .hero .lead {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-taiji {
        width: 220px;
        height: 220px;
        right: -50px;
        bottom: -60px;
    }

    .quick-link img {
        width: 48px;
        height: 48px;
    }
}

/* ===================================================================
   Componentes compartidos por las páginas internas (plantillas)
   =================================================================== */
/* ---- Banner de página interna (versión compacta del hero) ---- */
.page-banner {
    position: relative;
    background: radial-gradient(120% 200% at 10% 0%, var(--tao-red-dark) 0%, var(--tao-red) 55%, var(--tao-red-darker) 100%);
    color: var(--tao-white);
    overflow: hidden;
    padding: 2.5rem 0 2.75rem;
    background-image: url('../images/redforest2026-3.png');
    background-position: center center;
    background-size: cover;
}

.page-banner .hero-taiji {
    width: 200px;
    height: 200px;
    right: -50px;
    bottom: -70px;
    opacity: 0.14;
}

.page-banner h1 {
    color: var(--tao-white);
    font-weight: 800;
    font-size: clamp(1.6rem, 3.4vw, 2.3rem);
    margin-bottom: 0.4rem;
}

.page-banner .lead {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    max-width: 60ch;
    margin-bottom: 0;
}

.page-banner .breadcrumb {
    --bs-breadcrumb-divider-color: rgba(255,255,255,0.6);
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
}

.page-banner .breadcrumb a {
    color: rgba(255,255,255,0.85);
}

.page-banner .breadcrumb a:hover {
    color: var(--tao-white);
}

.page-banner .breadcrumb-item.active {
    color: rgba(255,255,255,0.75);
}

/* ---- Marco de imagen editable ----
   Envolvé cualquier <img> con esta clase: el marco fija el tamaño y
   la proporción, y la imagen se ajusta sola para llenarlo sin
   deformarse (se recorta el sobrante, igual que en Instagram).
   Para ver la foto completa en vez de recortarla, cambiá
   "object-fit: cover" por "object-fit: contain" más abajo. */
.img-frame {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--tao-paper);
    border: 1px solid var(--tao-line);
}

.img-frame img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.img-frame.img-frame--square {
    aspect-ratio: 1 / 1;
}

/* ---- Prosa (plantilla de texto) ---- */
.prose {
    max-width: 72ch;
}

.prose p {
    margin-bottom: 1.1rem;
}

.prose h2 {
    color: var(--tao-red);
    font-size: 1.3rem;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.figure-ref {
    background: var(--tao-white);
    border: 1px solid var(--tao-line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: 0.75rem;
    margin-bottom: 1.5rem;
}

.figure-ref figcaption {
    font-size: 0.82rem;
    color: var(--tao-ink-soft);
    margin-top: 0.5rem;
    text-align: center;
}

/* ---- Submenús del navbar (generados por js/nav-render.js) ---- */
.site-navbar .dropdown-menu {
    border: 1px solid var(--tao-line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    margin-top: 0.25rem;
    padding: 0.35rem;
}

.site-navbar .dropdown-item {
    font-size: 0.92rem;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
}

.site-navbar .dropdown-item:hover,
.site-navbar .dropdown-item:focus-visible,
.site-navbar .dropdown-item.active {
    background: var(--tao-paper);
    color: var(--tao-red);
}

.site-navbar .nav-link.dropdown-toggle.active {
    color: var(--tao-red);
}

.site-navbar .dropdown-toggle::after {
    vertical-align: 0.15em;
}

/* En pantallas grandes con mouse, el submenú también se abre al pasar el cursor
   (la clase "hover-open" la agrega y saca js/nav-render.js, con una
   pequeña demora, para tolerar el hueco al pasar al submenú del costado) */
@media (hover: hover) and (pointer: fine) and (min-width: 992px) {
    .site-navbar .dropdown-menu.hover-open {
        display: block;
    }

    .site-navbar .dropdown > .dropdown-menu.hover-open {
        margin-top: 0;
    }
}

/* ---- Sub-submenús (un submenú dentro de otro submenú) ---- */
.site-navbar .dropdown-item.dropdown-toggle.active {
    color: var(--tao-red);
    background: var(--tao-paper);
}

/* Escritorio: el sub-submenú se abre hacia el costado, no debajo */
@media (hover: hover) and (pointer: fine) and (min-width: 992px) {
    .site-navbar .dropdown-submenu {
        position: relative;
    }

    .site-navbar .dropdown-submenu > .dropdown-toggle::after {
        transform: rotate(-90deg);
    }

    .site-navbar .dropdown-submenu > .dropdown-menu {
        top: 0;
        left: 100%;
        margin-top: -0.35rem;
    }

    /* Si no entra a la derecha, js/nav-render.js agrega esta clase */
    .site-navbar .dropdown-submenu > .dropdown-menu.flip-left {
        left: auto;
        right: 100%;
    }
}

/* Celular/tablet: el sub-submenú se apila debajo, con una sangría */
@media (max-width: 991.98px) {
    .site-navbar .dropdown-submenu > .dropdown-toggle {
        font-weight: 600;
    }

    .site-navbar .dropdown-submenu > .dropdown-menu {
        padding-left: 0.75rem;
        border: none;
        box-shadow: none;
        margin-top: 0;
    }
}
