@import url('https://fonts.googleapis.com/css2?family=Oooh+Baby&family=Poppins:wght@400;600;700&display=swap');

/* Variables de color */
:root {
    --primary: #26cd00;
    --primary-light: #6cff3a;
    --primary-dark: #1e9e00;
    --primary-ink: #116a00;
    --gray: #f5f5f5;
    --dark: #333;
}

/* Utilidad: único h1 real de la página, visible para lectores de pantalla */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* Foco de teclado visible en todo el sitio */
:focus-visible {
    outline: 3px solid var(--primary-light);
    outline-offset: 2px;
}

/* Reset y tipografía */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background-color: #032500;
    /* Color de respaldo si la imagen no carga */
    padding-top: 70px;
    /* Espacio para el header fijo */

    /* Propiedades comunes del fondo, se aplica a todas las páginas */
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

/* Fondo específico para la página de inicio */
.home-page {
    background-image: var(--bg-image-url);
}

/* Fondo específico para las páginas internas */
.internal-page {
    background-image: var(--bg-image-url);
}

.container {
    width: 90%;
    max-width: 1400px;
    margin: 0 auto;
}

/* Newsletter */
.newsletter {
    background-color: rgba(0, 0, 0, 0.45);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    padding: 50px 0;
    text-align: center;
}

.newsletter h2 {
    margin-bottom: 20px;
    color: var(--primary-light);
}

.newsletter > .container > p,
.newsletter .form-intro {
    color: #dfe7dc;
}

.newsletter .form-message.success,
.newsletter .thank-you-message {
    color: var(--primary-light);
}

.newsletter .form-message.error {
    color: #ffb4a2;
}

.trabajemos-form-grid .form-field {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.trabajemos-form-grid label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #eaf5e6;
    margin-bottom: 4px;
}

.trabajemos-form-grid label .optional {
    font-weight: 400;
    opacity: 0.75;
}

/* Rótulo de publicidad separado del contenido editorial */
.ad-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.65);
    margin: 18px 0 6px;
}

.trabajemos-form {
    max-width: 720px;
}

.trabajemos-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
}

.trabajemos-form-grid input {
    width: 100%;
}

.trabajemos-form-grid textarea {
    width: 100%;
    min-height: 132px;
    resize: vertical;
}

.trabajemos-form-grid .form-field--full {
    grid-column: 1 / -1;
}

@media (max-width: 640px) {
    .trabajemos-form-grid {
        grid-template-columns: 1fr;
    }
}

form {
    display: flex;
    flex-direction: column;
    max-width: 500px;
    margin: 0 auto;
    gap: 15px;
}

form input {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

form textarea {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    resize: vertical;
}

form button {
    background-color: var(--primary);
    color: var(--dark);
    border: none;
    padding: 12px;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
}

form button:hover {
    background-color: var(--primary-dark);
}

#formMessage,
#login-message,
.form-message {
    margin-top: 15px;
    font-weight: 600;
    min-height: 1.5em;
    /* Evita saltos de layout */
}

#formMessage.success,
#login-message.success,
.form-message.success {
    color: var(--primary-dark);
}

.thank-you-message {
    font-size: 1.5rem;
    min-height: 0;
}

.thank-you-message p {
    font-size: inherit;
}

#formMessage.error,
#login-message.error,
.form-message.error {
    color: #ff6b6b;
    /* Rojo para errores */
}

/* Footer */
footer {
    background-color: var(--dark);
    color: white;
    text-align: center;
    padding: 12px 0;
}

.site-footer-inner {
    padding: 6px 0;
}

.site-footer-brand {
    font-family: 'Oooh Baby', cursive;
    font-size: 1.45rem;
    margin-bottom: 4px;
    color: #ffffff;
}

.site-footer-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px 22px;
    margin-bottom: 6px;
}

.site-footer-nav a {
    color: #dfe7dc;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.site-footer-nav a:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

.site-footer-copyright {
    color: #dfe7dc;
    font-size: 0.78rem;
}

.site-footer-copyright a {
    color: var(--primary-light);
    font-weight: 700;
    text-decoration: none;
}

.site-footer-copyright a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
}

/* Galería mejorada */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

.gallery-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.gallery-item:hover {
    transform: translateY(-5px);
}

.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

.gallery-item h3 {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(38, 205, 0, 0.8);
    color: white;
    padding: 15px;
    margin: 0;
    text-align: center;
    font-size: 1.2rem;
}

/* Sección de Servicios */
.services {
    background-color: #f9f9f9;
    padding: 60px 0;
}

.services h2 {
    text-align: center;
    margin-bottom: 40px;
    color: var(--primary-dark);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.service-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.service-card:hover {
    transform: translateY(-5px);
}

.service-card h3 {
    color: var(--primary);
    margin-bottom: 15px;
}

.service-card p {
    color: #555;
}

/* Estilos del Carrusel (movidos desde index.html) */
.carousel-wrap {
    position: relative;
}

.main-carousel {
    height: auto;
}

.carousel-cell {
    width: 100%;
    height: 500px;
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
}

.carousel-cell-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Botón pausa/reanudar del carrusel automático */
.carousel-pause {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 5;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background-color: rgba(0, 0, 0, 0.55);
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.carousel-pause:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.carousel-pause svg {
    width: 18px;
    height: 18px;
}

.carousel-pause .icon-play {
    display: none;
}

.carousel-pause.paused .icon-pause {
    display: none;
}

.carousel-pause.paused .icon-play {
    display: block;
}

@media (max-width: 640px) {
    .carousel-cell {
        height: 380px;
    }

    .slider-caption {
        width: 88%;
        max-width: 88%;
        padding: 22px 20px;
    }

    .slider-caption.left,
    .slider-caption.right,
    .slider-caption.center {
        left: 50%;
        right: auto;
        text-align: left;
        transform: translate(-50%, -50%);
    }

    .slider-caption h1,
    .slider-caption h2 {
        font-size: 27px;
        font-weight: 700;
        letter-spacing: 0.02em;
    }

    .slider-caption p {
        font-size: 16px;
        line-height: 1.6;
        letter-spacing: 0.03em;
        margin: 0;
    }

    .slider-caption .slider-cta {
        margin-top: 14px;
        padding: 9px 18px;
        font-size: 0.9rem;
    }
}

.slider-caption {
    position: absolute;
    top: 50%;
    z-index: 1;
    background: rgba(0, 0, 0, 0.45);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    padding: 36px 46px;
    border-radius: 16px;
    width: min(56vw, 980px);
}

.slider-caption.center {
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.slider-caption.left {
    left: 10%;
    transform: translateY(-50%);
    text-align: left;
}

.slider-caption.right {
    right: 10%;
    transform: translateY(-50%);
    text-align: right;
}

.slider-caption h1 {
    margin: 0 0 12px;
    font-size: clamp(34px, 3vw, 48px);
    line-height: 1.15;
    letter-spacing: 0.02em;
}

.slider-caption h2 {
    margin: 0 0 12px;
    font-size: clamp(34px, 3vw, 48px);
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.slider-caption p {
    margin: 0;
    font-size: clamp(19px, 1.5vw, 23px);
    line-height: 1.65;
    letter-spacing: 0.03em;
}

.slider-caption .slider-cta {
    margin-top: 18px;
    display: inline-block;
    background-color: var(--primary);
    color: #032500;
    font-weight: 600;
    text-decoration: none;
    padding: 10px 22px;
    border-radius: 6px;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.slider-caption .slider-cta:hover {
    background-color: var(--primary-light);
    transform: translateY(-2px);
}

/* --- HEADER PRINCIPAL (FIJO Y TRANSPARENTE) --- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 10px 0;
    transition: background-color 0.3s ease;

    /* Efecto esmerilado con tinte verde oscuro */
    background-color: rgba(5, 100, 0, 0.2);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    /* Para Safari */
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.admin-panel-return {
    padding-top: 16px;
}

.admin-panel-return__button {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 8px 14px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 9px;
    background: rgba(4, 28, 8, 0.78);
    color: var(--primary-light);
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.16);
}

.admin-panel-return__button:hover,
.admin-panel-return__button:focus-visible {
    border-color: var(--primary-light);
    background: var(--primary-dark);
    color: #ffffff;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.site-isologo {
    display: grid;
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    place-items: center;
    overflow: hidden;
    border-radius: 8px;
    background: transparent;
    text-decoration: none;
}

.site-isologo img {
    display: block;
    width: 52px;
    height: 52px;
    object-fit: contain;
}

.site-isologo:hover img {
    transform: scale(1.06);
}

.site-isologo img {
    transition: transform 0.2s ease;
}

.nav-right-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.site-logo {
    font-family: 'Oooh Baby', cursive;
    font-weight: 700;
    /* Forzado por el navegador si no existe bold */
    font-size: 3.5rem;
    color: #ffffff;
    text-decoration: none;
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.8), 0px 0px 10px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
    padding: 0;
    line-height: 0.8;
    -webkit-text-stroke: 0.5px white;
    /* Engrosa ligeramente los trazos */
}

.site-logo:hover {
    transform: scale(1.05);
    color: var(--primary-light);
}

.main-nav {
    display: flex;
    /* Visible en desktop */
}

.main-nav a {
    color: #ffffff;
    text-decoration: none;
    margin-left: 25px;
    font-weight: 600;
    transition: color 0.3s;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.main-nav a:hover {
    color: var(--primary-light);
}

.main-nav a.active {
    color: var(--primary-light);
}

@media (max-width: 768px) {
    body {
        padding-top: 84px;
    }

    .site-logo {
        font-size: 2.75rem;
    }

    .brand-lockup {
        gap: 7px;
    }

}

/* --- ESTILOS PARA MENÚ MÓVIL (HAMBURGUESA) --- */
.nav-toggle {
    display: none;
    /* Oculto en desktop */
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1100;
}

.hamburger {
    display: block;
    position: relative;
    width: 25px;
    height: 3px;
    background: white;
    border-radius: 3px;
    transition: all 0.3s ease-in-out;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 25px;
    height: 3px;
    background: white;
    border-radius: 3px;
    transition: all 0.3s ease-in-out;
}

.hamburger::before {
    transform: translateY(-8px);
}

.hamburger::after {
    transform: translateY(8px);
}

/* Animación de la hamburguesa a "X" */
.nav-open .hamburger {
    background: transparent;
    /* La barra del medio desaparece */
}

.nav-open .hamburger::before {
    transform: rotate(45deg);
}

.nav-open .hamburger::after {
    transform: rotate(-45deg);
}


/* --- ESTILOS RESPONSIVE PARA EL HEADER --- */
@media (max-width: 768px) {
    .nav-right-content {
        /* Por defecto, el menú está oculto */
        display: none;
    }

    /* CORRECCIÓN: Se eliminó una regla duplicada y confusa. 
       Esta es la única regla necesaria para mostrar el menú cuando tiene la clase .nav-open. */
    .nav-right-content.nav-open {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        right: 0;
        width: 70%;
        max-width: 300px;
        height: 100vh;
        background-color: rgba(10, 50, 0, 0.9);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        padding-top: 100px;
        align-items: center;
        gap: 0;
        /* Reseteamos el gap para controlar el margen en los enlaces */
    }

    .main-nav {
        /* En móvil, los enlaces se apilan verticalmente */
        flex-direction: column;
        align-items: center;
    }

    .main-nav a {
        margin: 15px 0;
        font-size: 1.2rem;
    }

    .nav-toggle {
        display: block;
        /* Mostrar el botón de hamburguesa en móvil */
    }
}

.nav-separator {
    color: rgba(255, 255, 255, 0.6);
    font-weight: 100;
}

/* --- ESTILOS PARA MENÚ DE USUARIO LOGUEADO --- */
.user-menu {
    position: relative;
}

.user-menu-trigger {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 5px;
    border-radius: 25px;
    transition: background-color 0.3s;
}

.user-menu-trigger:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: var(--primary);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    font-size: 1.1rem;
    text-shadow: none;
    border: 2px solid rgba(255, 255, 255, 0.5);
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.user-name {
    color: #ffffff;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 220px;
    background-color: rgba(15, 45, 10, 0.8);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    display: none;
    /* Oculto por defecto */
    z-index: 1100;
}

.user-dropdown.active {
    display: block;
}

.user-dropdown .logout-button {
    width: 100%;
    background-color: #c0392b;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
    text-align: center;
}

.user-dropdown .logout-button:hover {
    background-color: #e74c3c;
}

/* --- ESTILOS PARA PÁGINAS INTERNAS --- */

/* Contenido de la página interna */
.page-content {
    padding: 40px 0;
    max-width: 1600px;
    /* Ancho de lectura cómodo */
    margin: 0 auto;
}

.page-content h1 {
    font-size: 2.8rem;
    color: #ffffff;
    margin-bottom: 15px;
    line-height: 1.2;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.page-content h2 {
    font-size: 2rem;
    color: #ffffff;
    margin-top: 40px;
    margin-bottom: 15px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.page-content p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 20px;
    color: #f0f0f0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}

.page-content .page-intro {
    font-size: 1.2rem;
    color: #e0e0e0;
    font-style: italic;
    margin-bottom: 30px;
    padding: 15px 20px;
    background-color: rgba(0, 0, 0, 0.25);
    border-radius: 8px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Estilos para imágenes dentro del contenido */
.page-content figure {
    margin: 30px 0;
    clear: both;
    /* Asegura que el flujo se limpie después de elementos flotantes */
}

.page-content figcaption {
    text-align: center;
    font-size: 0.9rem;
    color: #d0d0d0;
    margin-top: 10px;
    font-style: italic;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}

/* Imagen a ancho completo, ideal para separar secciones de texto. */
.page-content .content-image-full {
    width: 100%;
    margin: 40px 0;
    /* Más margen vertical para crear un impacto visual */
}

.page-content .content-image-full img,
.page-content .content-image-left img,
.page-content .content-image-right img {
    width: 100%;
    height: auto;
    border-radius: 10px;
}

/* Imágenes flotantes para que el texto las rodee. */
.page-content .content-image-left {
    float: left;
    width: 35%;
    /* Tamaño ajustado para un mejor balance con el texto */
    max-width: 400px;
    /* Límite para que no sea excesivamente grande */
    margin-right: 30px;
    margin-bottom: 15px;
}

.page-content .content-image-right {
    float: right;
    width: 35%;
    max-width: 400px;
    margin-left: 30px;
    margin-bottom: 15px;
}

/* Limpiar flotantes */
.page-content p:last-of-type::after {
    content: "";
    display: table;
    clear: both;
}

/* --- ESTILOS ADICIONALES PARA NUEVOS LAYOUTS --- */

/* Layout 2: Dos Columnas */
.two-column-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
}

@media (min-width: 992px) {
    .two-column-layout {
        grid-template-columns: 2fr 1fr;
    }
}

.sidebar {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 25px;
    border-radius: 10px;
}

.sidebar h3 {
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    border-bottom: 2px solid var(--primary-light);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.sidebar ul {
    list-style: none;
    padding: 0;
}

.sidebar ul li a {
    color: #f0f0f0;
    text-decoration: none;
    display: block;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    transition: color 0.3s;
}

.sidebar ul li a:hover {
    color: var(--primary-light);
}

/* Layout 3: Galería Destacada */
.gallery-page-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.gallery-page-grid img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.gallery-page-grid img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3);
}

/* Layout 4: FAQ (Preguntas Frecuentes) */
.faq-container details {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.faq-container summary {
    padding: 20px;
    font-weight: 600;
    cursor: pointer;
    color: #ffffff;
    list-style: none;
    /* Oculta el marcador por defecto */
    position: relative;
    padding-right: 40px;
}

.faq-container summary::-webkit-details-marker {
    display: none;
}

/* Para Chrome/Safari */
.faq-container summary::after {
    content: '+';
    position: absolute;
    right: 20px;
    font-size: 1.5rem;
    color: var(--primary-light);
    transition: transform 0.3s;
}

.faq-container details[open] summary::after {
    transform: rotate(45deg);
}

.faq-container .faq-answer {
    padding: 0 20px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

/* Layout 5: Equipo */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.team-card {
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    text-align: center;
    padding: 30px 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.team-card img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-light);
    margin-bottom: 20px;
}

.team-card h3 {
    color: #ffffff;
    margin-bottom: 5px;
}

.team-card .title {
    color: var(--primary-light);
    font-weight: 600;
    margin-bottom: 15px;
}

.team-card p {
    font-size: 0.95rem;
    color: #e0e0e0;
}

/* Layout 6: Contacto Avanzado */
.contact-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    align-items: flex-start;
}

@media (min-width: 992px) {
    .contact-layout {
        grid-template-columns: 1fr 1fr;
    }
}

.contact-map iframe {
    width: 100%;
    height: 450px;
    border: 0;
    border-radius: 10px;
}

.contact-form form {
    margin: 20px 0;
    max-width: none;
    /* Anula el max-width del selector 'form' genérico */
    margin-left: 0;
    margin-right: 0;
}

.contact-form .form-message {
    text-align: left;
    color: #f0f0f0;
    /* Color de texto base para páginas internas */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}

/* --- ESTILOS ESPECÍFICOS PARA LA PÁGINA DE INICIO (INDEX) --- */

.home-main-section {
    padding: 60px 0;
}

.home-layout-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
}

@media (min-width: 992px) {
    .home-layout-grid {
        grid-template-columns: 2.5fr 1fr;
        align-items: stretch;
    }
}

.home-cards-column,
.home-articles-column {
    height: 100%;
}

.home-articles-column {
    display: flex;
}

/* Galería de tarjetas (izquierda) */
.home-cards-column .gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin: 0;
}

@media (max-width: 768px) {
    .home-cards-column .gallery {
        grid-template-columns: 1fr;
    }
}

.home-cards-column .gallery-item img {
    height: 300px;
}

/* Columna de Artículos (derecha) */
.home-articles-column .sidebar-articles {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 25px;
    height: 100%;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.home-articles-column h3 {
    color: #ffffff;
    font-size: 1.5rem;
    margin-bottom: 25px;
    border-bottom: 2px solid var(--primary-light);
    padding-bottom: 10px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.home-article-preview {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease;
    display: flex;
    gap: 15px;
}

.home-article-preview:hover {
    transform: translateX(5px);
}

.article-thumb {
    width: 80px;
    height: 80px;
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.article-info {
    flex-grow: 1;
}

.home-article-preview h4 {
    color: var(--primary-light);
    font-size: 1.1rem;
    margin-bottom: 8px;
    line-height: 1.3;
}

.article-excerpt {
    color: #e0e0e0;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.article-date {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-read-more {
    color: var(--primary-light);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    transition: all 0.3s;
}

.btn-read-more:hover {
    text-decoration: underline;
    letter-spacing: 0.5px;
}

.no-articles {
    color: #ccc;
    font-style: italic;
    text-align: center;
    padding: 20px 0;
}

/* --- ESTILOS PARA PÁGINAS DE PROVEEDORES --- */

.provider-search-bar {
    margin: 30px 0;
}

.provider-search-bar input {
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background-color: rgba(0, 0, 0, 0.2);
    color: #ffffff;
}

.provider-search-bar input::placeholder {
    color: #cccccc;
}

/* Layout 1: Grid View */
.provider-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.provider-card {
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s, box-shadow 0.3s;
}

.provider-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.provider-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.provider-card-content {
    padding: 20px;
}

.provider-card-content h3 {
    color: #ffffff;
    margin-bottom: 5px;
}

.provider-card-content .specialty {
    color: var(--primary-light);
    font-weight: 600;
    margin-bottom: 15px;
    display: block;
}

.provider-card-content p {
    font-size: 0.95rem;
    color: #e0e0e0;
    margin-bottom: 5px;
}

/* Layout 2: List View */
.provider-list .provider-list-item {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.provider-list-item-info h3 {
    color: #ffffff;
    margin: 0;
}

.provider-list-item-info .specialty {
    color: var(--primary-light);
    font-size: 1rem;
}

.provider-list-item-contact p {
    margin: 0;
    font-size: 1rem;
    color: #e0e0e0;
}

.provider-list-item-info .provider-address {
    font-size: 0.9rem;
    color: #d0d0d0;
    margin-top: 5px;
    text-shadow: none;
}

/* Layout 3: Map View */
.provider-map-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
}

@media (min-width: 1024px) {
    .provider-map-layout {
        grid-template-columns: 1fr 1.5fr;
    }

    .list-container {
        order: 1;
    }

    .map-container {
        order: 2;
    }
}

.map-container iframe {
    width: 100%;
    height: 600px;
    border: 0;
    border-radius: 10px;
}

.provider-list-map .provider-list-item {
    padding: 15px;
    margin-bottom: 10px;
}

.provider-list-map .provider-list-item-info h3 {
    font-size: 1.2rem;
}

/* --- ESTILOS PARA ÁREA PRIVADA Y LOGIN --- */

.login-container {
    max-width: 500px;
    margin: 60px auto;
    padding: 40px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-container h1 {
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
    margin-bottom: 20px;
}

.login-container p {
    color: #e0e0e0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
    margin-bottom: 30px;
}

.login-container form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.login-container .form-group {
    text-align: left;
}

.login-container .form-group label {
    display: block;
    margin-bottom: 8px;
    color: #ffffff;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Override generic input styles for login */
.login-container input[type="text"],
.login-container input[type="password"],
.login-container input[type="email"] {
    background-color: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    width: 100%;
    padding: 12px;
    border-radius: 5px;
    font-size: 1rem;
}

.login-container input::placeholder {
    color: #a0a0a0;
}

#login-message {
    margin-top: 20px;
}

.login-container .register-link {
    margin-top: 25px;
    font-size: 0.95rem;
}

.login-container .register-link p {
    margin-bottom: 0;
}

/* --- NUEVO: Estilos para el enlace de registro --- */
.login-container .register-link a,
.login-container .register-link a:visited {
    color: var(--primary-light);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s;
}

.login-container .register-link a:hover {
    color: #ffffff;
    text-decoration: underline;
}

/* --- NUEVO: Corrección para fondo blanco en autocompletar del navegador --- */
.login-container input:-webkit-autofill,
.login-container input:-webkit-autofill:hover,
.login-container input:-webkit-autofill:focus,
.login-container input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 40px rgba(0, 0, 0, 0.25) inset !important;
    /* Simula el fondo oscuro */
    -webkit-text-fill-color: #ffffff !important;
    /* Cambia el color del texto a blanco */
    caret-color: #ffffff;
    /* Asegura que el cursor de texto sea visible */
    transition: background-color 5000s ease-in-out 0s;
    /* Evita que el navegador cambie el color */
}


.private-area-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 20px;
}

#logout-button {
    background-color: #c0392b;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
}

#logout-button:hover {
    background-color: #e74c3c;
}

.private-links {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
    margin-top: 40px;
}

@media (min-width: 768px) {
    .private-links {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

/* Estilo unificado de Cristal Esmerilado (Glassmorphism) para tarjetas admin */
.private-link-card,
.admin-card {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 20px 25px;
    /* Reducido para menor altura */
    border-radius: 12px;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    height: auto;
    /* Permite que se ajuste al contenido */
    min-height: 100px;
    /* Altura mínima controlada */
    justify-content: center;
}

.private-link-card::before,
.admin-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.1),
            transparent);
    transition: 0.5s;
}

.private-link-card:hover::before,
.admin-card:hover::before {
    left: 100%;
}

.private-link-card:hover,
.admin-card:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-4px);
    /* Menos desplazamiento */
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 30px 0 rgba(0, 0, 0, 0.5);
}

.private-link-card h3,
.admin-card h3 {
    color: var(--primary-light);
    margin-bottom: 5px;
    /* Menos espacio interior */
    font-size: 1.25rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.private-link-card p,
.admin-card p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    line-height: 1.4;
    margin: 0;
}

/* --- ESTILOS PARA PÁGINAS DE AUTENTICACIÓN (LOGIN/REGISTRO) --- */

/*
  Para usar estos estilos en una página de login/registro, agrega la clase 'auth-body'
  a la etiqueta <body> de esa página HTML. Esto centrará el contenido.
  Ejemplo: <body class="auth-body internal-page">
*/
.auth-body {
    font-family: 'Poppins', sans-serif;
    background-color: #f4f4f4;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    color: #333;
    /* Resetea el padding-top para que el contenido se centre correctamente en la página */
    padding-top: 0;
}

/* Contenedor principal para formularios de autenticación */
.auth-container {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.auth-container h2 {
    margin-bottom: 20px;
    color: #333;
    /* Resetea estilos de la plantilla principal */
    text-shadow: none;
}

/* Grupo de formulario, específico para .auth-container para evitar conflictos */
.auth-container .form-group {
    margin-bottom: 15px;
    text-align: left;
}

.auth-container .form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    /* Resetea estilos de la plantilla principal */
    color: #333;
    text-shadow: none;
}

.auth-container .form-group input[type="text"],
.auth-container .form-group input[type="password"],
.auth-container .form-group input[type="email"] {
    width: 100%;
    /* Usar 100% y box-sizing es más robusto */
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 1rem;
    /* Resetea estilos de la plantilla principal */
    background-color: #fff;
    color: #333;
}

/* Anula el estilo de autocompletar oscuro del login principal */
.auth-container input:-webkit-autofill,
.auth-container input:-webkit-autofill:hover,
.auth-container input:-webkit-autofill:focus,
.auth-container input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 40px #fff inset !important;
    -webkit-text-fill-color: #333 !important;
    caret-color: #333;
}

/* Botones, específicos para .auth-container */
.auth-container .btn {
    display: inline-block;
    width: 100%;
    /* Hacer que el botón ocupe todo el ancho */
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

.auth-container .btn-primary {
    background-color: var(--primary-dark);
    color: #fff;
}

.auth-container .btn-primary:hover {
    background-color: var(--primary-ink);
}

/* Alertas, específicas para .auth-container */
.auth-container .alert {
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 4px;
    text-align: left;
    min-height: 0;
    /* Resetea el min-height del .form-message general */
    margin-top: 0;
}

.auth-container .alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.auth-container .alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Enlaces dentro del contenedor de autenticación */
.auth-container p {
    margin-top: 20px;
    font-size: 0.9rem;
    /* Resetea estilos de la plantilla principal */
    color: #555;
    text-shadow: none;
}

.auth-container p a {
    color: var(--primary-ink);
    text-decoration: none;
    font-weight: normal;
    text-shadow: none;
}

.auth-container p a:hover {
    text-decoration: underline;
    color: var(--primary-dark);
}

/* --- ESTILOS PARA EL CAMPO DE CONTRASEÑA CON ICONO (DENTRO DE .auth-container) --- */
.auth-container .password-field {
    position: relative;
}

.auth-container .password-field input[type="password"],
.auth-container .password-field input[type="text"] {
    padding-right: 40px;
}

.auth-container .toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #aaa;
    font-size: 1.2rem;
    user-select: none;
}

.auth-container .toggle-password:hover {
    color: #666;
}

.password-wrapper {
    position: relative;
    width: 100%;
}

.password-visibility-field {
    position: relative;
    width: 100%;
}

.password-visibility-field input[type="password"],
.password-visibility-field input[type="text"] {
    padding-right: 46px !important;
}

.password-visibility-toggle {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    background: transparent;
    color: #fff;
    cursor: pointer;
    opacity: 0.82;
}

.password-visibility-toggle:hover {
    opacity: 1;
}

.password-visibility-toggle svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
}

/* --- ESTILOS PARA PÁGINA DE REGISTRO --- */
.register-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    align-items: stretch;
    /* Cambiado para que las columnas tengan la misma altura */
    padding: 40px 0;
}

@media (min-width: 992px) {
    .register-layout {
        grid-template-columns: 1fr 1fr;
        /* Dos columnas iguales */
    }
}

.register-info {
    display: flex;
    flex-direction: column;
}

.register-image-container {
    flex-grow: 1;
    /* Ocupa el espacio restante */
    margin-top: 30px;
    border-radius: 10px;
    overflow: hidden;
}

.register-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    margin: 0 auto;
}

.register-info h1 {
    font-size: 2.5rem;
    color: #ffffff;
    margin-bottom: 20px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.register-info p {
    font-size: 1.2rem;
    line-height: 1.7;
    color: #e0e0e0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}

.register-form {
    padding: 40px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.register-form.register-form-success {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.register-form h2 {
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
    margin-bottom: 10px;
    text-align: center;
    font-size: 1.8rem;
}

.register-form>p {
    color: #e0e0e0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
    margin-bottom: 30px;
    text-align: center;
}

.register-form .form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

@media (min-width: 768px) {
    .register-form .form-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.register-form .form-group {
    margin-bottom: 15px;
}

.register-form input[type="text"],
.register-form input[type="email"],
.register-form input[type="password"],
.register-form textarea {
    background-color: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    width: 100%;
    padding: 12px;
    border-radius: 5px;
    font-size: 1rem;
}

.register-form input::placeholder,
.register-form textarea::placeholder {
    color: #a0a0a0;
}

.register-form textarea {
    font-family: 'Poppins', sans-serif;
    resize: vertical;
}

.register-form .password-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.register-form .password-wrapper {
    position: relative;
    flex-grow: 1;
}

.register-form .password-wrapper input {
    padding-right: 45px;
}

.register-form .toggle-password-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    width: 24px;
    height: 24px;
    color: #fff;
}

.register-form .toggle-password-icon svg {
    stroke-width: 1.5;
}

.register-form .generate-password-btn {
    background-color: transparent;
    color: var(--primary-light);
    border: 1px solid var(--primary-light);
    padding: 10px 0;
    width: 90px;
    border-radius: 5px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    flex-shrink: 0;
    text-align: center;
}

.register-form .generate-password-btn:hover {
    background-color: var(--primary-light);
    color: var(--dark);
}

.register-form button[type="submit"] {
    width: 100%;
    margin-top: 10px;
}

.register-form .register-link {
    margin-top: 25px;
    font-size: 0.95rem;
    text-align: center;
}

.register-form .register-link p {
    margin-bottom: 0;
    color: #e0e0e0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}

.register-form .register-link a {
    color: var(--primary-light);
    font-weight: 600;
    text-decoration: none;
}

.register-form .register-link a:hover {
    text-decoration: underline;
}

.register-form .register-success-state {
    padding: 28px 24px;
    margin-top: -36px;
    text-align: center;
    border-radius: 10px;
    background: rgba(46, 204, 113, 0.12);
    border: 1px solid rgba(46, 204, 113, 0.4);
}

.register-form .register-success-state h3 {
    margin-bottom: 12px;
    color: #ffffff;
}

.register-form .register-success-state p {
    color: #e0e0e0;
    margin-bottom: 12px;
}

.register-form .register-success-state p:last-child {
    margin-bottom: 0;
}

.register-form .register-success-state a {
    color: var(--primary-light);
    font-weight: 600;
    text-decoration: none;
}

.register-form .register-success-state a:hover {
    text-decoration: underline;
}

@media (max-width: 767px) {
    .register-form .password-group {
        flex-direction: column;
        align-items: stretch;
    }

    .register-form .generate-password-btn {
        width: 100%;
    }
}

/* --- ESTILOS PARA FORMULARIO DE AMIGOS.PHP --- */
.amigos-page .sidebar {
    padding: 40px;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    color: #e0e0e0;
}

.amigos-page .sidebar h3 {
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
    margin-bottom: 25px;
    text-align: center;
    font-size: 1.8rem;
    border-bottom: none;
    padding-bottom: 0;
}

.amigos-page .sidebar .form-group label {
    display: block;
    margin-bottom: 8px;
    color: #ffffff;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.amigos-page .sidebar input[type="text"],
.amigos-page .sidebar input[type="tel"],
.amigos-page .sidebar textarea {
    background-color: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    width: 100%;
    padding: 14px;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.amigos-page .sidebar input[type="text"]:focus,
.amigos-page .sidebar input[type="tel"]:focus,
.amigos-page .sidebar textarea:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(108, 255, 58, 0.25);
}

.amigos-page .sidebar input::placeholder,
.amigos-page .sidebar textarea::placeholder {
    color: #a0a0a0;
}

.amigos-page .sidebar input[type="file"] {
    color: #e0e0e0;
    font-size: 0.9rem;
    margin-top: 5px;
    width: 100%;
}

.amigos-page .sidebar input[type="file"]::file-selector-button {
    background-color: var(--dark);
    color: var(--primary-light);
    border: 1px solid var(--primary-light);
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    margin-right: 10px;
}

.amigos-page .sidebar input[type="file"]::file-selector-button:hover {
    background-color: var(--primary-light);
    color: var(--dark);
}

.amigos-page .sidebar button[type="submit"] {
    width: 100%;
    margin-top: 10px;
}

.amigos-page .sidebar small {
    display: block;
    text-align: center;
    margin-top: 15px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

@media (max-width: 480px) {
    .amigos-page .sidebar {
        padding: 25px 16px;
    }
}

/* --- ESTILOS PARA MODAL DE AVISOS --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0s 0.3s;
}

.modal-overlay.visible {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s;
}

.modal-content {
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 30px 40px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 700px;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.3s;
}

.modal-overlay.visible .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2rem;
    color: #fff;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.modal-body {
    margin-top: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-body .modal-image {
    float: left;
    width: 150px;
    height: auto;
    border-radius: 8px;
    margin-right: 20px;
    margin-bottom: 10px;
}

.modal-body::after {
    content: "";
    display: table;
    clear: both;
}

/* --- ESTILOS PARA LAYOUT DE ÁREA PRIVADA --- */
.two-column-layout-private {
    display: grid;
    grid-template-columns: 1fr;
    /* Default para móvil */
    gap: 40px;
    margin-top: 40px;
}

@media (min-width: 992px) {
    .two-column-layout-private {
        grid-template-columns: 1fr 1fr;
        /* Dos columnas iguales en escritorio */
        align-items: start;
        /* Alinea los elementos al inicio de la celda del grid */
    }
}

/* Asegura que las tarjetas de la columna izquierda se apilen verticalmente */
.two-column-layout-private .left-column .private-links {
    grid-template-columns: 1fr;
    margin-top: 0;
    /* El contenedor padre ya tiene margen */
}

.two-column-layout-private .right-column .admin-links {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* --- ESTILOS PARA CHATBOT --- */
#chatbot-fab {
    position: fixed;
    bottom: 20px;
    right: 40px;
    width: 60px;
    height: 60px;
    background-color: var(--primary);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    z-index: 999;
    transition: transform 0.2s ease, opacity 0.3s;
}

#chatbot-fab.hidden {
    transform: scale(0);
    opacity: 0;
}

#chatbot-fab .chatbot-fab-image {
    display: block;
    width: 54px;
    height: 54px;
    object-fit: contain;
}

.bpa-chatbot-window {
    position: fixed;
    bottom: 90px;
    right: 40px;
    width: 370px;
    max-width: calc(100vw - 40px);
    height: 60vh;
    max-height: 550px;
    background-color: #ffffff;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s ease;
}

.bpa-chatbot-window.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.bpa-chat-header {
    background-color: var(--primary-dark);
    color: white;
    padding: 15px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
}

.bpa-chat-title {
    display: inline-flex;
    align-items: center;
    gap: 9px;
}

.bpa-chat-title img {
    display: block;
    width: 28px;
    height: 32px;
    object-fit: contain;
}

.bpa-chat-title__name {
    font-size: 1.35rem;
    line-height: 1;
}

.bpa-chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

.bpa-chat-body {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: #f4f7f9;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bpa-chat-message {
    border-radius: 18px;
    max-width: 85%;
    word-wrap: break-word;
    display: flex;
    flex-direction: column;
}

.bpa-chat-message .message-content {
    padding: 10px 15px;
    line-height: 1.5;
}

.bpa-chat-message .message-time {
    font-size: 0.7rem;
    color: #888;
    padding: 0 15px 6px;
    text-align: right;
    margin-top: -5px;
}

.bpa-user-message .message-time {
    color: rgba(255, 255, 255, 0.75);
}

.bpa-chat-message ul {
    padding-left: 20px;
    margin-top: 5px;
}

.bpa-chat-message a {
    color: var(--primary-dark);
    font-weight: 600;
}

.bpa-bot-message {
    background-color: #e9e9eb;
    color: #333;
    align-self: flex-start;
    border-bottom-left-radius: 5px;
}

.bpa-user-message {
    background-color: var(--primary);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 5px;
}

.bpa-chat-footer {
    position: relative;
    /* Para posicionar el botón de envío */
    padding: 10px;
    border-top: 1px solid #e0e0e0;
    background-color: #ffffff;
}

.bpa-chat-input {
    width: 100%;
    box-sizing: border-box;
    /* Asegura que el padding se incluya en el ancho total */
    border: 1px solid #ccc;
    border-radius: 20px;
    padding: 10px 50px 10px 15px;
    /* Aumenta el padding derecho para el botón */
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    resize: none;
    max-height: 100px;
    overflow-y: auto;
}

.bpa-chat-send {
    position: absolute;
    right: 18px;
    bottom: 18px;
    background-color: var(--primary);
    color: #032500;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: background-color 0.2s;
}

.bpa-chat-send:hover {
    background-color: var(--primary-dark);
}

.bpa-typing-indicator {
    display: flex;
    align-items: center;
    padding: 10px 0;
}

.bpa-typing-indicator span {
    height: 8px;
    width: 8px;
    margin: 0 2px;
    background-color: #9e9e9e;
    border-radius: 50%;
    display: inline-block;
    animation: bpa-blink 1.4s infinite both;
}

.bpa-typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.bpa-typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes bpa-blink {
    0% {
        opacity: 0.2;
    }

    20% {
        opacity: 1;
    }

    100% {
        opacity: 0.2;
    }
}


.two-column-layout-private .right-column .admin-links h2 {
    margin-top: 0;
    /* Resetea el margen para el nuevo título */
    margin-bottom: 0;
    font-size: 1.5rem;
}

.two-column-layout-private .right-column .admin-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.two-column-layout-private .right-column .area-image-container img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    object-fit: cover;
}

@media (max-width: 768px) {
    .two-column-layout-private .right-column .admin-cards-grid {
        grid-template-columns: 1fr;
        /* En pantallas pequeñas, apilar las tarjetas */
    }
}

/* ============================
   Animaciones & cursor de tipeo
   ============================ */

/* Aparición deslizándose + fade */
@keyframes chat-slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes chat-slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Cursor parpadeante */
@keyframes chat-blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* Animación por tipo de mensaje (se activa al insertar el nodo) */
.bpa-chat-message.bpa-bot-message {
    animation: chat-slideInLeft 0.4s ease-out both;
}

.bpa-chat-message.bpa-user-message {
    animation: chat-slideInRight 0.4s ease-out both;
}

/* Pequeña optimización de rendimiento */
.bpa-chat-message {
    will-change: transform, opacity;
}

/* Banners Publicitarios Home */
.home-ad-banner {
    width: 100%;
    margin-bottom: 20px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.home-ad-banner:hover {
    transform: scale(1.01);
}

.home-ad-banner img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.home-ad-banner.top-banner {
    margin-top: 10px;
    margin-bottom: 30px;
}

.home-ad-banner.bottom-banner {
    margin-top: 30px;
}

.home-ad-banner.inline-banner {
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Cursor de tipeo: se muestra mientras el bot está escribiendo */
.bpa-chat-message.bpa-bot-message.bpa-bot-typing .message-content::after {
    content: '▋';
    /* Puedes usar '|' si prefieres */
    display: inline-block;
    margin-left: 4px;
    vertical-align: baseline;
    font-weight: 600;
    color: #999;
    /* Un color gris para el cursor */
    animation: chat-blink 1s steps(1, end) infinite;
    will-change: opacity;
}

/* Accesibilidad: respeta preferencias del usuario */
@media (prefers-reduced-motion: reduce) {

    .bpa-chat-message.bpa-bot-message,
    .bpa-chat-message.bpa-user-message {
        animation: none !important;
    }

    .bpa-chat-message.bpa-bot-message.bpa-bot-typing .message-content::after {
        animation: none !important;
    }
}

/* --- ESTILOS PARA FORMULARIO ADMIN CHATBOT --- */

#chatbot-admin-form-ux.register-form {
    padding: 40px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 40px;
}

#chatbot-admin-form-ux .admin-form {
    width: 90%;
    max-width: none;
    margin: 0 auto;
}

#chatbot-admin-form-ux .form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px 20px;
    margin-bottom: 15px;
}

#chatbot-admin-form-ux .form-group label {
    display: block;
    margin-bottom: 8px;
    color: #ffffff;
    font-weight: 600;
}

#chatbot-admin-form-ux input[type="text"],
#chatbot-admin-form-ux select,
#chatbot-admin-form-ux textarea {
    background-color: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    width: 100%;
    padding: 12px;
    border-radius: 5px;
    font-size: 1rem;
}

#chatbot-admin-form-ux select option {
    background-color: #333;
}

#chatbot-admin-form-ux textarea {
    resize: vertical;
    min-height: 120px;
    font-family: 'Poppins', sans-serif;
}

@media (min-width: 768px) {
    #chatbot-admin-form-ux .form-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 767px) {
    #chatbot-admin-form-ux .admin-form {
        width: 100%;
    }
}

/* ==== Parche menú móvil BPA ==== */
@media (max-width: 768px) {

    /* Asegura que el panel se vea cuando tiene nav-open */
    .nav-right-content.nav-open {
        display: flex;
    }

    /* Navegación en columna dentro del panel */
    .nav-right-content.nav-open .main-nav {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    .nav-right-content.nav-open .main-nav a {
        margin: 12px 0;
    }
}


/* ==== Articulos Destacados (Homepage) ==== */
.featured-articles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.featured-article {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
    padding: 0;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}

.featured-article:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.featured-img {
    width: 100%;
    height: 180px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.featured-body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.featured-category {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary-light);
    margin-bottom: 8px;
}

.featured-body h3 {
    margin: 0 0 10px 0;
    font-size: 1.15rem;
    color: #fff;
    line-height: 1.3;
}

.featured-excerpt {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0 0 15px 0;
    flex: 1;
}

.featured-placeholder {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.9rem;
    font-style: italic;
    margin: 10px 0 15px 0;
    flex: 1;
}

.featured-read-more {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: opacity 0.3s;
    margin-top: auto;
}

.featured-read-more:hover {
    opacity: 0.8;
    text-decoration: underline;
}

@media (max-width: 768px) {
    .featured-articles {
        grid-template-columns: 1fr;
    }
}

/* === Centro de vida barrial Amancay === */
.community-shell {
    padding: 42px 0 72px;
}

.eyebrow,
.section-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-light);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.eyebrow::before,
.section-kicker::before {
    content: '';
    width: 24px;
    height: 2px;
    background: currentColor;
}

.community-heading {
    max-width: 760px;
    margin-bottom: 26px;
}

.community-heading h1,
.community-heading h2 {
    margin: 8px 0 10px;
    color: #fff;
    font-size: clamp(2rem, 4vw, 3.5rem);
    letter-spacing: -0.035em;
    line-height: 1.1;
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45);
}

.community-heading p {
    margin: 0;
    color: #dbe8d8;
    font-size: 1.05rem;
}

.community-panel,
.community-card,
.agenda-card,
.admin-priority-card,
.dashboard-stat {
    border: 1px solid rgba(255, 255, 255, 0.13);
    background: rgba(5, 29, 8, 0.72);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.community-panel--padded {
    padding: 22px;
    border-radius: 14px;
}

.now-strip {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(220px, 0.75fr) minmax(220px, 0.75fr);
    gap: 1px;
    overflow: hidden;
    margin: 28px 0 50px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.14);
}

.now-item {
    min-height: 150px;
    padding: 22px 24px;
    background: rgba(4, 31, 8, 0.86);
}

.now-item--notice {
    background: linear-gradient(135deg, rgba(31, 111, 15, 0.92), rgba(5, 34, 10, 0.92));
}

.now-item h3,
.now-item p {
    margin: 7px 0 0;
    color: #fff;
}

.now-item h3 {
    font-size: 1.08rem;
    line-height: 1.3;
}

.now-item p {
    color: #dbe8d8;
    font-size: 0.91rem;
    line-height: 1.45;
}

.text-link {
    display: inline-block;
    margin-top: 11px;
    color: var(--primary-light);
    font-size: 0.86rem;
    font-weight: 700;
    text-decoration: none;
}

.text-link:hover { text-decoration: underline; }
.agenda-propose-link { margin-top: 0; }

.participation-grid,
.dashboard-grid,
.admin-tools-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.participation-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.participation-grid .community-card {
    min-height: 0;
    padding: 14px 18px;
    flex-direction: row;
    align-items: center;
}

.participation-grid .community-card__icon {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    font-size: 1.1rem;
}

.participation-grid .community-card__body { margin-left: 14px; }
.participation-grid .community-card__title { margin-bottom: 3px; }
.participation-grid .community-card__text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.community-card {
    display: flex;
    min-height: 186px;
    padding: 22px;
    border-radius: 16px;
    color: #fff;
    text-decoration: none;
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.community-card:hover,
.community-card:focus-visible {
    transform: translateY(-4px);
    border-color: rgba(108, 255, 58, 0.72);
    background: rgba(17, 77, 20, 0.88);
}

.community-card__icon {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    border-radius: 50%;
    background: rgba(108, 255, 58, 0.17);
    color: var(--primary-light);
    font-size: 1.2rem;
    font-weight: 700;
}

.community-card__body { margin-left: 15px; }
.community-card__title { display: block; margin: 0 0 6px; color: #fff; font-size: 1.05rem; font-weight: 700; }
.community-card__text { display: block; color: #dbe8d8; font-size: 0.88rem; line-height: 1.5; }

.content-split {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.9fr);
    gap: 26px;
    margin-top: 48px;
}

.content-split > section { min-width: 0; }

.home-right-col {
    display: flex;
    flex-direction: column;
}

.home-right-col > .community-news,
.home-right-col > #encuesta-activa { flex: 0 0 auto; }

.home-right-col .home-agenda-section {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    margin-top: 34px;
}

.home-right-col .home-agenda-section .home-calendar {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

.home-right-col .home-calendar__grid {
    flex: 1 1 auto;
    align-content: stretch;
}

.section-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.section-header h2 { margin: 5px 0 0; color: #fff; font-size: 1.7rem; }
.section-header .text-link { margin: 0; white-space: nowrap; }

.agenda-list,
.feed-list,
.priority-list { display: grid; gap: 12px; }

.agenda-card {
    display: grid;
    grid-template-columns: 66px 1fr auto;
    gap: 16px;
    align-items: center;
    padding: 15px;
    border-radius: 14px;
}

.agenda-card__date {
    padding: 8px 5px;
    border-radius: 10px;
    background: rgba(108, 255, 58, 0.12);
    color: var(--primary-light);
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-transform: uppercase;
}

.agenda-card__date strong { display: block; color: #fff; font-size: 1.55rem; }
.agenda-card h3 { margin: 0 0 3px; color: #fff; font-size: 1rem; }
.agenda-card p { margin: 0; color: #c8d7c4; font-size: 0.85rem; }

.agenda-card__action,
.button-secondary,
.button-primary {
    display: inline-flex;
    justify-content: center;
    padding: 9px 13px;
    border: 1px solid rgba(108, 255, 58, 0.55);
    border-radius: 8px;
    color: var(--primary-light);
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
}

.button-primary { border-color: var(--primary); background: var(--primary); color: #092400; }
.button-secondary:hover,
.agenda-card__action:hover { background: rgba(108, 255, 58, 0.14); }

.empty-state {
    padding: 26px;
    border: 1px dashed rgba(255, 255, 255, 0.26);
    border-radius: 14px;
    color: #dbe8d8;
    text-align: center;
}

.empty-state p { margin: 0; }

.community-news { display: grid; gap: 13px; }
.community-news .home-article-preview { margin: 0; padding: 15px; border: 0; border-radius: 14px; background: rgba(5, 29, 8, 0.72); }

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

.home-blog-card {
    display: grid;
    grid-template-rows: 1.7fr 1fr;
    min-height: 360px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 16px;
    background: rgba(5, 29, 8, 0.78);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.18);
}

.home-blog-card__image { display: block; min-height: 0; background: rgba(108, 255, 58, 0.1); }
.home-blog-card__image img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.home-blog-card:hover .home-blog-card__image img { transform: scale(1.04); }
.home-blog-card__placeholder { display: grid; width: 100%; height: 100%; place-items: center; color: var(--primary-light); font-size: 0.85rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.home-blog-card__body { display: flex; flex-direction: column; justify-content: flex-start; gap: 8px; padding: 16px; }
.home-blog-card__body h3 { margin: 0; font-size: 1.22rem; line-height: 1.2; }
.home-blog-card__body h3 a { color: #fff; text-decoration: none; }
.home-blog-card__body h3 a:hover { color: var(--primary-light); }
.home-blog-card__subtitle { margin: 0; color: #dbe8d8; font-size: 0.92rem; line-height: 1.45; }
.home-blog-card__author { align-self: flex-end; margin: 0; color: var(--primary-light); font-size: 0.8rem; font-style: italic; }
.home-blog-card__body .text-link { margin-top: auto; font-size: 0.82rem; }
.home-blog-empty { grid-column: 1 / -1; }
.home-blog-card--featured { grid-template-rows: 1.9fr 1fr; min-height: 400px; }
.home-blog-card--featured .home-blog-card__body h3 { font-size: 1.4rem; }
.home-archive-section { margin-top: 32px; }
.home-archived-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
    margin-top: 20px;
}
.home-archived-card {
    display: grid;
    grid-template-columns: 92px 1fr;
    align-items: center;
    gap: 14px;
    min-height: 78px;
    padding: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 13px;
    background: rgba(5, 29, 8, 0.72);
    color: #fff;
    text-decoration: none;
    transition: border-color 0.25s ease, transform 0.25s ease;
}
.home-archived-card:hover { border-color: rgba(108, 255, 58, 0.65); transform: translateY(-2px); }
.home-archived-card__thumb {
    display: block;
    width: 92px;
    height: 66px;
    overflow: hidden;
    border-radius: 9px;
    background: rgba(108, 255, 58, 0.1);
    flex-shrink: 0;
}
.home-archived-card__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.home-archived-card__thumb--placeholder { display: grid; place-items: center; color: var(--primary-light); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.home-archived-card__title { font-size: 0.96rem; line-height: 1.32; font-weight: 600; color: #fff; }
.home-archived-card:hover .home-archived-card__title { color: var(--primary-light); }
.home-agenda-section { margin-top: 34px; }

.news-index { padding: 48px 0 64px; }
.news-index__header { max-width: 760px; margin-bottom: 30px; }
.news-index__header h1 { margin: 6px 0 10px; color: #fff; font-size: clamp(2rem, 4vw, 3.4rem); line-height: 1.05; }
.news-index__header p { margin: 0; color: #dbe8d8; }
.news-index-featured { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr); overflow: hidden; margin-bottom: 28px; border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 20px; background: rgba(5, 29, 8, 0.78); }
.news-index-featured__image { min-height: 330px; background: rgba(108, 255, 58, 0.1); }
.news-index-featured__image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.news-index-featured__body { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: 34px; }
.news-index-featured__body h2 { margin: 9px 0 12px; font-size: clamp(1.5rem, 2.5vw, 2.3rem); line-height: 1.15; }
.news-index-featured__body h2 a { color: #fff; text-decoration: none; }
.news-index-featured__body h2 a:hover { color: var(--primary-light); }
.news-index-featured__body p { margin: 0 0 20px; color: #dbe8d8; }
.news-index-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.news-index-card { overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.13); border-radius: 16px; background: rgba(5, 29, 8, 0.72); }
.news-index-card__image { display: block; height: 190px; background: rgba(108, 255, 58, 0.1); }
.news-index-card__image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.news-index-card__body { padding: 18px; }
.news-index-card__body h2 { margin: 0 0 10px; font-size: 1.15rem; line-height: 1.3; }
.news-index-card__body h2 a { color: #fff; text-decoration: none; }
.news-index-card__body h2 a:hover { color: var(--primary-light); }
.news-index-card__body p { margin: 0 0 14px; color: #dbe8d8; font-size: 0.9rem; line-height: 1.55; }
.news-index-featured__image,
.news-index-card__image,
.home-blog-card__image,
.editorial-detail__image-wrap { position: relative; }

.news-category-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    max-width: calc(100% - 24px);
    padding: 5px 13px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    background: rgba(6, 20, 9, 0.62);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-decoration: none;
}
.editorial-author { margin: -6px 0 16px !important; color: var(--primary-light) !important; font-size: 0.82rem !important; font-style: italic; text-align: right; align-self: stretch; }
.editorial-detail__author { max-width: 480px; }

.editorial-admin { padding-bottom: 58px; }
.editorial-admin__grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr); gap: 28px; margin-top: 30px; }
.editorial-admin__items { display: grid; gap: 12px; }
.editorial-admin__item { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px; border: 1px solid rgba(255, 255, 255, 0.13); border-radius: 14px; background: rgba(5, 29, 8, 0.72); }
.editorial-admin__item h3 { margin: 0 0 5px; color: #fff; font-size: 1rem; }
.editorial-admin__item { position: relative; padding-left: 18px; }
.editorial-admin__item.is-sortable { cursor: grab; }
.editorial-admin__item.is-sortable:active { cursor: grabbing; }
.editorial-admin__item .editorial-admin__drag-handle { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: rgba(255, 255, 255, 0.35); font-size: 1.05rem; line-height: 1; user-select: none; pointer-events: none; }
.editorial-admin__item.is-sortable .editorial-admin__drag-handle { color: var(--primary-light); opacity: 0.7; }
.editorial-admin__item.is-sortable:hover .editorial-admin__drag-handle { opacity: 1; }
.editorial-admin__item.dragging { opacity: 0.35; border-style: dashed; }
.editorial-admin__item.drag-over { border-color: var(--primary-light); box-shadow: inset 0 2px 0 var(--primary-light); }
.editorial-admin__item.drag-over.drag-over-bottom { box-shadow: inset 0 -2px 0 var(--primary-light); }
.editorial-admin__item:not(.is-sortable) .editorial-admin__drag-handle { display: none; }
.editorial-admin__sort-hint { max-width: 560px; margin: -4px 0 16px; color: #a9c7a4; font-size: 0.85rem; line-height: 1.5; }
.editorial-admin__featured-badge { display: inline-block; margin-left: 8px; padding: 3px 9px; border-radius: 20px; background: rgba(108, 255, 58, 0.16); color: var(--primary-light); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; vertical-align: middle; }
.editorial-admin__check small { display: block; flex-basis: 100%; margin: 2px 0 0 24px; color: #a9c7a4; font-size: 0.78rem; }
.editorial-admin__item p { margin: 0; color: #dbe8d8; font-size: 0.82rem; }
.editorial-admin__actions { display: flex; flex-direction: column; align-items: stretch; gap: 6px; min-width: 120px; }
.editorial-admin__actions form { margin: 0; }
.editorial-admin__actions a,
.editorial-admin__actions button { width: 100%; min-height: 26px; padding: 3px 10px; border-radius: 6px; font-size: 0.72rem; justify-content: center; text-align: center; box-sizing: border-box; }
.editorial-admin__delete { width: 100%; min-height: 26px; padding: 3px 10px; border: 1px solid rgba(255, 107, 107, 0.65); border-radius: 6px; background: transparent; color: #ffb2b2; font: inherit; font-size: 0.72rem; font-weight: 700; cursor: pointer; box-sizing: border-box; }
.editorial-admin__form { padding: 24px; border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 16px; background: rgba(5, 29, 8, 0.78); }
.editorial-admin__form h2 { margin: 0 0 18px; color: #fff; }
.editorial-admin__form form { display: grid; gap: 9px; }
.editorial-admin__form label { color: var(--primary-light); font-size: 0.9rem; font-weight: 700; }
.editorial-admin__form input:not([type="checkbox"]), .editorial-admin__form textarea { width: 100%; box-sizing: border-box; padding: 11px; border: 1px solid rgba(255, 255, 255, 0.25); border-radius: 8px; background: rgba(0, 0, 0, 0.25); color: #fff; font: inherit; }
.editorial-admin__form textarea { resize: vertical; }
.editorial-admin__form small { color: #dbe8d8; font-size: 0.78rem; line-height: 1.4; }
.editorial-admin__check { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0; color: #fff !important; cursor: pointer; }
.editorial-admin__form .button-primary { border: 0; cursor: pointer; font: inherit; }
.editorial-admin__preview { width: 150px; border-radius: 10px; }

.editorial-detail { max-width: 940px; margin: 44px auto 64px; padding: 0 5%; }
.editorial-detail__article { overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 20px; background: rgba(5, 29, 8, 0.78); }
.editorial-detail__image { display: block; width: 100%; max-height: 520px; object-fit: cover; }
.editorial-detail__content { padding: clamp(24px, 5vw, 54px); }
.editorial-detail__content > .text-link { margin-bottom: 25px; }
.editorial-detail__content .section-kicker { display: block; margin-bottom: 8px; }
.editorial-detail__content h1 { margin: 0; color: #fff; font-size: clamp(2rem, 5vw, 3.6rem); line-height: 1.08; }
.editorial-detail__subtitle { margin: 16px 0; color: #dbe8d8; font-size: 1.2rem; line-height: 1.55; }
.editorial-detail time { display: block; margin-bottom: 30px; color: var(--primary-light); font-size: 0.9rem; font-weight: 700; }
.editorial-detail__body { color: #f0f5ef; font-size: 1.05rem; line-height: 1.8; }

.participation-footer {
    margin-top: 52px;
    padding: 30px;
    border-radius: 18px;
    background: linear-gradient(110deg, rgba(21, 100, 21, 0.9), rgba(5, 35, 10, 0.9));
    text-align: center;
}

.participation-footer h2 { margin: 7px 0; color: #fff; }
.participation-footer p { margin: 0; color: #e1ecdf; }

.participation-form {
    max-width: 720px;
    margin: 28px auto 0;
}

.participation-form .trabajemos-form {
    margin: 0 auto;
}

.participation-form .form-message {
    text-align: left;
}

.dashboard-hero {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 32px;
}

.dashboard-hero .page-intro { max-width: 720px; margin: 10px 0 0; }
.dashboard-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.dashboard-stat {
    min-height: 118px;
    padding: 18px;
    border-radius: 14px;
}

.dashboard-stat__value { display: block; color: var(--primary-light); font-size: 2.1rem; font-weight: 700; line-height: 1; }
.dashboard-stat__label { display: block; margin-top: 8px; color: #e1ecdf; font-size: 0.88rem; }

.private-service-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 0; }
.dashboard-section { margin-top: 42px; }
.dashboard-section h2 { margin-top: 6px; }

.provider-request {
    margin-top: 34px;
    border-radius: 16px;
    overflow: hidden;
}

.provider-request summary {
    padding: 18px 22px;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}

.provider-request summary::-webkit-details-marker { display: none; }
.provider-request summary::after { content: '+'; float: right; color: var(--primary-light); font-size: 1.35rem; }
.provider-request[open] summary::after { content: '-'; }
.provider-request__body { padding: 4px 22px 24px; }

.admin-dashboard-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.admin-priority-card { padding: 18px; border-radius: 14px; }
.admin-priority-card h3 { margin: 0 0 5px; color: #fff; font-size: 1rem; }
.admin-priority-card p { margin: 0; color: #dbe8d8; font-size: 0.88rem; }
.admin-priority-card .text-link { margin-top: 8px; }
.admin-tools-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.admin-tool-group h3 { margin: 0 0 10px; color: var(--primary-light); font-size: 0.82rem; letter-spacing: 0.08em; text-transform: uppercase; }
.admin-tool-group .private-links { grid-template-columns: 1fr; gap: 10px; margin: 0; }
.admin-tool-group .private-link-card,
.admin-tool-group .admin-card { min-height: 0; padding: 15px 17px; }

@media (max-width: 1050px) {
    .now-strip,
    .content-split { grid-template-columns: 1fr; }
    .participation-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-dashboard-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .home-blog-grid { grid-template-columns: repeat(2, minmax(240px, 1fr)); overflow-x: auto; padding-bottom: 8px; }
    .home-blog-card { min-height: 300px; }
    .home-blog-card--featured { min-height: 340px; }
    .home-archived-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .news-index-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .editorial-admin__grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .community-shell { padding-top: 28px; }
    .participation-grid,
    .dashboard-grid,
    .admin-tools-grid,
    .private-service-grid,
    .admin-dashboard-stats { grid-template-columns: 1fr; }
    .now-strip { margin-bottom: 35px; }
    .agenda-card { grid-template-columns: 54px 1fr; }
    .agenda-card__action { grid-column: 2; justify-self: start; }
    .section-header,
    .dashboard-hero { align-items: flex-start; flex-direction: column; }
    .home-blog-grid { grid-template-columns: repeat(2, minmax(220px, 1fr)); margin-right: -16px; }
    .news-index { padding-top: 32px; }
    .news-index-featured { grid-template-columns: 1fr; }
    .news-index-featured__image { min-height: 230px; }
    .news-index-featured__body { padding: 24px; }
    .news-index-grid { grid-template-columns: 1fr; }
    .editorial-admin__item { align-items: flex-start; flex-direction: column; }
    .editorial-admin__actions { justify-content: flex-start; }
}

/* --- Mobile first: refinamiento transversal de pantallas pequeñas --- */
@media (max-width: 760px) {
    body {
        padding-top: 76px;
        background-attachment: scroll;
    }

    .container {
        width: min(100% - 32px, 1400px);
    }

    .site-header {
        padding: 7px 0;
    }

    .site-isologo,
    .site-isologo img {
        width: 42px;
        height: 42px;
    }

    .site-isologo {
        flex-basis: 42px;
    }

    .site-logo {
        font-size: 2.35rem;
    }

    .nav-container {
        min-height: 48px;
    }

    .nav-toggle {
        display: grid;
        width: 48px;
        height: 48px;
        padding: 0;
        place-items: center;
        border-radius: 12px;
        background: rgba(0, 0, 0, 0.18);
    }

    .nav-right-content.nav-open {
        width: min(88vw, 360px);
        max-width: none;
        height: 100dvh;
        padding: max(88px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
        align-items: stretch;
        overflow-y: auto;
        overscroll-behavior: contain;
        box-shadow: -18px 0 45px rgba(0, 0, 0, 0.35);
    }

    .nav-right-content.nav-open .main-nav {
        align-items: stretch;
        gap: 4px;
    }

    .nav-right-content.nav-open .main-nav a {
        min-height: 48px;
        margin: 0;
        padding: 12px 14px;
        border-radius: 10px;
        font-size: 1rem;
        line-height: 1.45;
    }

    .nav-right-content.nav-open .main-nav a:hover,
    .nav-right-content.nav-open .main-nav a.active {
        background: rgba(255, 255, 255, 0.1);
    }

    .nav-right-content.nav-open .nav-separator {
        display: none;
    }

    .nav-right-content.nav-open .user-name {
        width: 100%;
        margin-top: 16px;
        padding-top: 16px;
        border-top: 1px solid rgba(255, 255, 255, 0.18);
        font-size: 0.9rem;
    }

    .nav-right-content.nav-open .user-menu {
        width: 100%;
    }

    .nav-right-content.nav-open .user-menu-trigger {
        width: 100%;
        min-height: 48px;
        justify-content: flex-end;
    }

    .nav-right-content.nav-open .user-dropdown {
        position: static;
        width: 100%;
        margin-top: 6px;
        padding: 14px;
        background: rgba(0, 0, 0, 0.2);
        box-shadow: none;
    }

    .nav-right-content.nav-open .user-dropdown-menu li a,
    .nav-right-content.nav-open .logout-button {
        min-height: 44px;
        padding: 11px 8px;
    }

    .admin-panel-return {
        padding-top: 10px;
    }

    .admin-panel-return__button {
        width: 100%;
        min-height: 46px;
        justify-content: center;
        text-align: center;
    }

    .page-content,
    .community-shell {
        padding-top: 26px;
        padding-bottom: 42px;
    }

    .page-content h1 {
        font-size: clamp(1.9rem, 9vw, 2.5rem);
        line-height: 1.12;
    }

    .page-content .page-intro,
    .community-heading p {
        font-size: 0.98rem;
    }

    input,
    select,
    textarea {
        font-size: 16px;
    }

    button,
    input[type="submit"],
    input[type="button"] {
        min-height: 44px;
    }

    .trabajemos-form,
    .participation-form,
    form {
        max-width: none;
    }

    .now-strip {
        margin-top: 20px;
        border-radius: 14px;
    }

    .now-item {
        min-height: 0;
        padding: 19px;
    }

    .community-panel--padded,
    .participation-footer,
    .editorial-admin__form {
        padding: 18px;
    }

    .home-blog-grid {
        grid-template-columns: 1fr;
        margin-right: 0;
        overflow: visible;
    }

    .home-archived-grid { grid-template-columns: 1fr; }
    .home-archived-card { grid-template-columns: 84px 1fr; }

    .home-blog-card {
        grid-template-rows: 190px auto;
        min-height: 0;
    }

    .home-blog-card__body {
        min-height: 156px;
    }

    .home-article-preview,
    .agenda-card {
        gap: 14px;
    }

    .dashboard-quick-actions,
    .user-detail-actions,
    .editorial-admin__actions {
        width: 100%;
    }

    .dashboard-quick-actions a,
    .user-detail-actions button,
    .editorial-admin__actions a,
    .editorial-admin__actions button {
        flex: 1 1 100%;
        justify-content: center;
        text-align: center;
    }

    .form-container {
        max-width: 100%;
        padding: 16px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .form-container .admin-table,
    .admin-table {
        min-width: 640px;
    }

    .form-container .admin-table th,
    .form-container .admin-table td {
        white-space: nowrap;
    }

    .modal-content {
        width: calc(100% - 24px);
        max-height: calc(100dvh - 24px);
        padding: 24px 20px;
        overflow-y: auto;
    }

    .modal-body .modal-image {
        float: none;
        width: 100%;
        max-width: 280px;
        margin: 0 auto 16px;
    }

    .site-footer-inner {
        padding: 8px 0;
    }

    .site-footer-nav {
        align-items: stretch;
        flex-direction: column;
        gap: 2px;
    }

    .site-footer-nav a {
        min-height: 44px;
        display: grid;
        place-items: center;
    }
}

@media (max-width: 380px) {
    .container {
        width: min(100% - 24px, 1400px);
    }

    .site-logo {
        font-size: 2.05rem;
    }

    .home-article-preview {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* --- Calendario de actividades en la home --- */
.home-calendar {
    margin-top: 22px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 14px;
    background: rgba(5, 29, 8, 0.72);
    padding: 16px;
}
.home-calendar__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}
.home-calendar__title {
    color: #fff;
    font-size: 1rem;
    text-transform: capitalize;
}
.home-calendar__nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid rgba(108, 255, 58, 0.45);
    border-radius: 8px;
    color: var(--primary-light);
    font-size: 1.15rem;
    line-height: 1;
    text-decoration: none;
    transition: background 0.15s;
}
.home-calendar__nav:hover { background: rgba(108, 255, 58, 0.14); }
.home-calendar__grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: auto;
    grid-auto-rows: 1fr;
    gap: 4px;
    flex: 1 1 auto;
    align-content: stretch;
}
.home-calendar__dow {
    text-align: center;
    color: #a9c7a4;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding-bottom: 4px;
}
.home-calendar__cell {
    min-height: 44px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 2px;
    gap: 3px;
}
.home-calendar__cell.is-empty { background: transparent; }
.home-calendar__cell.is-today {
    outline: 2px solid rgba(108, 255, 58, 0.55);
    outline-offset: -2px;
}
.home-calendar__cell.has-events { cursor: pointer; transition: background 0.15s; }
.home-calendar__cell.has-events:hover { background: rgba(108, 255, 58, 0.12); }
.home-calendar__daynum {
    color: #dbe8d8;
    font-size: 0.82rem;
    font-weight: 600;
}
.home-calendar__cell.is-today .home-calendar__daynum { color: #fff; font-weight: 700; }
.home-calendar__dots {
    display: flex;
    justify-content: center;
    gap: 3px;
    flex-wrap: wrap;
}
.home-calendar__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
    opacity: 0.95;
}
.home-calendar__more {
    color: var(--primary-light);
    font-size: 0.62rem;
    font-weight: 700;
}
.home-calendar__login-hint {
    margin: 12px 0 0;
    color: #a9c7a4;
    font-size: 0.82rem;
    text-align: center;
}
.home-event-modal { max-width: 460px; }
.home-event-modal__item { margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid rgba(255, 255, 255, 0.15); }
.home-event-modal__item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.home-event-modal__item h4 { margin: 0 0 4px; color: var(--primary-light); font-size: 0.95rem; }
.home-event-modal__item p { margin: 2px 0; color: #e6f0e3; font-size: 0.85rem; }
.home-event-modal__detail { color: #cfe0cb !important; line-height: 1.45; }
