/* =========================================================
   Leticia Di Gregorio — estilos del sitio público
   Los colores y tipografía se inyectan como variables CSS
   desde includes/header.php (tabla settings del panel).
   ========================================================= */

:root {
    --color-primario: #e30613;
    --color-secundario: #1a1a1a;
    --color-texto: #222222;
    --color-menu-fondo: #ffffff;
    --color-menu-texto: #1a1a1a;
    --color-menu-hover: #e30613;
    --color-boton-fondo: #e30613;
    --fuente: 'Poppins', sans-serif;
    --radius: 10px;
}

* { box-sizing: border-box; }

body {
    font-family: var(--fuente);
    color: var(--color-texto);
    background: #f7f7f8;
    margin: 0;
    padding-top: 82px;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

.btn-primario {
    background: var(--color-boton-fondo);
    color: #fff;
    border: none;
    padding: 12px 28px;
    border-radius: var(--radius);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: filter .15s ease, transform .15s ease;
}
.btn-primario:hover { filter: brightness(0.9); transform: translateY(-1px); color: #fff; }

.btn-outline {
    background: transparent;
    color: var(--color-boton-fondo);
    border: 2px solid var(--color-boton-fondo);
    padding: 10px 26px;
    border-radius: var(--radius);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn-outline:hover { background: var(--color-boton-fondo); color: #fff; }

/* ---------- Navbar ---------- */
.navbar-ldg {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    background: var(--color-menu-fondo);
    box-shadow: 0 2px 14px rgba(0,0,0,.08);
    padding: 10px 0;
}
.navbar-ldg .navbar-brand img {
    width: auto;
    max-width: 260px;
    object-fit: contain;
}
.navbar-ldg .logo-text {
    font-weight: 800;
    font-size: 1.35rem;
    color: var(--color-secundario);
    line-height: 1.05;
}
.navbar-ldg .logo-text small {
    display: block;
    font-size: .6rem;
    letter-spacing: 2px;
    font-weight: 600;
    color: var(--color-primario);
}
.navbar-ldg .nav-link {
    font-weight: 600;
    color: var(--color-menu-texto) !important;
    padding: 10px 16px !important;
    border-radius: 6px;
    transition: background .15s ease, color .15s ease;
}
.navbar-ldg .nav-link:hover,
.navbar-ldg .nav-link.active {
    background: var(--color-menu-hover);
    color: #fff !important;
}
.navbar-ldg .social-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--color-secundario);
    color: #fff;
    margin-left: 6px;
    font-size: .9rem;
}
.navbar-ldg .social-icons a:hover { background: var(--color-primario); }

/* ---------- Hero / video ---------- */
.hero-video {
    position: relative;
    background: #000;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 760px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hero-video video {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: contain;
    background: #000;
}
.hero-video-frame {
    position: absolute; inset: 0;
}
.hero-video-frame iframe {
    width: 100%;
    height: 100%;
    border: none;
    pointer-events: none;
}
.hero-video::after {
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,.15) 0%, rgba(0,0,0,.05) 50%, rgba(0,0,0,.45) 100%);
    pointer-events: none;
}
.hero-video .hero-caption {
    position: relative; z-index: 2;
    color: #fff; text-align: center;
    padding: 0 20px;
}
.hero-video .hero-caption h1 {
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 800;
    text-shadow: 0 2px 10px rgba(0,0,0,.4);
}

/* ---------- Banner petitorio ---------- */
.banner-petitorio {
    background: var(--color-primario);
    color: #fff;
    padding: 56px 0;
    position: relative;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
.banner-petitorio h2 { font-weight: 800; }
.banner-petitorio p { opacity: .95; max-width: 780px; }
.banner-petitorio .btn-primario { background: #fff; color: var(--color-primario); }
.banner-petitorio .btn-primario:hover { background: #f1f1f1; }

/* ---------- Secciones generales ---------- */
section { padding: 90px 0; }
.section-title {
    font-weight: 800;
    color: var(--color-secundario);
    margin-bottom: 8px;
}
.section-title span { color: var(--color-primario); }
.section-subtitle { color: #666; margin-bottom: 40px; }

/* ---------- Biografía ---------- */
.bio-foto {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,.15);
}
.bio-texto p { margin-bottom: 16px; line-height: 1.75; }

/* ---------- Buscador de novedades ---------- */
.buscador-novedades .input-group-lg > .form-control,
.buscador-novedades .input-group-lg > .input-group-text,
.buscador-novedades .input-group-lg > .btn {
    border-radius: 0;
    border-color: #e2e2e2;
}
.buscador-novedades .input-group-lg > .input-group-text {
    border-radius: var(--radius) 0 0 var(--radius);
}
.buscador-novedades .input-group-lg > *:last-child {
    border-radius: 0 var(--radius) var(--radius) 0;
}
.buscador-novedades .form-control:focus {
    box-shadow: none;
    border-color: var(--color-primario);
}

/* ---------- Tarjetas (novedades / proyectos) ---------- */
.card-item {
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 4px 18px rgba(0,0,0,.07);
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: transform .18s ease, box-shadow .18s ease;
}
.card-item:hover { transform: translateY(-4px); box-shadow: 0 10px 26px rgba(0,0,0,.12); }
.card-item .card-img { aspect-ratio: 4/3; overflow: hidden; }
.card-item .card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-item .card-img.card-img-logo {
    background: #872c32;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 34px;
}
.card-item .card-img.card-img-logo img {
    width: auto;
    height: auto;
    max-width: 65%;
    max-height: 65%;
    object-fit: contain;
}
.card-item .card-body-item { padding: 18px; display: flex; flex-direction: column; flex: 1; }
.card-item .tema-tag {
    display: inline-block;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .5px;
    color: var(--color-primario);
    background: rgba(227,6,19,.08);
    padding: 3px 10px;
    border-radius: 20px;
    margin-bottom: 10px;
    align-self: flex-start;
    text-transform: uppercase;
}
.card-item h3 {
    font-size: 1.02rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--color-secundario);
    margin-bottom: 10px;
}
.card-item .fecha-item { font-size: .78rem; color: #999; margin-bottom: 10px; }
.card-item .descrip-corta { color: #555; font-size: .9rem; flex: 1; }
.card-item .leer-mas { margin-top: 14px; font-weight: 700; color: var(--color-primario); font-size: .88rem; }

/* ---------- Paginación ---------- */
.paginacion { display: flex; justify-content: center; gap: 8px; margin-top: 46px; flex-wrap: wrap; }
.paginacion a, .paginacion span {
    min-width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px;
    background: #fff;
    color: var(--color-secundario);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.paginacion a:hover { background: var(--color-primario); color: #fff; }
.paginacion .activo { background: var(--color-primario); color: #fff; }

/* ---------- Galería ---------- */
.galeria-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.galeria-grid a { border-radius: 8px; overflow: hidden; aspect-ratio: 1; }
.galeria-grid img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s ease; }
.galeria-grid a:hover img { transform: scale(1.08); }

/* ---------- Footer ---------- */
.footer-ldg { background: var(--color-secundario); color: #ddd; padding: 50px 0 20px; margin-top: 40px; }
.footer-ldg a { color: #ddd; }
.footer-ldg .social-icons a {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 50%;
    background: rgba(255,255,255,.1); margin-right: 8px;
}
.footer-ldg .social-icons a:hover { background: var(--color-primario); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 30px; padding-top: 18px; font-size: .85rem; color: #999; text-align: center; }
.footer-bottom a { color: #bbb; font-weight: 600; }

/* ---------- Detalle ---------- */
.detalle-imagen { border-radius: var(--radius); overflow: hidden; margin-bottom: 30px; box-shadow: 0 10px 30px rgba(0,0,0,.12); }
.detalle-imagen.detalle-imagen-logo {
    background: #f4f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 50px;
}
.detalle-imagen.detalle-imagen-logo img {
    width: auto;
    max-width: 320px;
    max-height: 220px;
    object-fit: contain;
}
.detalle-contenido p { line-height: 1.8; margin-bottom: 18px; }
.detalle-meta { color: #888; font-size: .9rem; margin-bottom: 20px; }

@media (max-width: 991px) {
    body { padding-top: 70px; }
    section { padding: 46px 0; }
}

/* ---------- Animaciones al hacer scroll ----------
   La clase .reveal-init la agrega el JS (progresivamente, no bloquea
   nada si JS no llega a cargar). .revealed la agrega el JS cuando el
   elemento entra en pantalla. */
.reveal-init {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity .65s ease, transform .65s ease;
}
.reveal-init.revealed {
    opacity: 1;
    transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
    .reveal-init { opacity: 1; transform: none; transition: none; }
}
