/* ===== VARIABLES ===== */
:root {
    --bg-body: #f7f3ee;
    --bg-card: #ffffff;
    --text-color: #2c2c2c;
    --text-muted: #5a5a5a;
    --border-color: #dcd7d0;
    --bg-input: #ffffff;
    --shadow: 0 4px 20px rgba(0,0,0,0.08);
    --primary: #8b3a3a;
    --primary-dark: #5f2626;
    --accent: #b78a5f;
    --font-serif: 'Playfair Display', serif;
    --font-sans: 'Inter', sans-serif;
    --transition: 0.3s ease;
}

[data-theme="dark"] {
    --bg-body: #1e1e1e;
    --bg-card: #2a2a2a;
    --text-color: #e8e0d8;
    --text-muted: #b0a8a0;
    --border-color: #3d3d3d;
    --bg-input: #3a3a3a;
    --shadow: 0 4px 20px rgba(0,0,0,0.4);
    --primary: #b57a7a;
    --primary-dark: #8f5a5a;
    --accent: #c9a87c;
}

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: var(--font-sans);
    background-color: var(--bg-body);
    color: var(--text-color);
    line-height: 1.6;
    transition: background var(--transition), color var(--transition);
}
a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover {
    color: var(--primary-dark);
}
img {
    max-width: 100%;
    display: block;
}
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ===== TIPOGRAFÍA ===== */
h1, h2, h3, h4 {
    font-family: var(--font-serif);
    font-weight: 700;
    line-height: 1.2;
}
h1 { font-size: 2.8rem; }
h2 { font-size: 2.2rem; margin-bottom: 1.5rem; }
h3 { font-size: 1.5rem; margin-bottom: 0.8rem; }
.section-title {
    text-align: center;
    margin-bottom: 2.5rem;
    font-style: italic;
    color: var(--primary);
}

/* ===== HEADER ===== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--bg-card);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    z-index: 1000;
    padding: 0.8rem 0;
    transition: background var(--transition);
}
.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.logo img {
    height: 50px;
    width: auto;
}
.main-nav ul {
    display: flex;
    gap: 1.8rem;
    list-style: none;
}
.main-nav a {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-color);
    padding-bottom: 4px;
    border-bottom: 2px solid transparent;
    transition: border var(--transition);
}
.main-nav a.active,
.main-nav a:hover {
    border-bottom-color: var(--primary);
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.btn-donar {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 0.5rem 1.2rem;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background var(--transition);
}
.btn-donar:hover {
    background: var(--primary-dark);
}
.theme-toggle, .menu-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
}
.menu-toggle {
    display: none;
    font-size: 1.8rem;
}

/* ===== HERO ===== */
.hero {
    position: relative;
    min-height: 80vh;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    margin-top: 70px;
}
.hero-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.35);
}
.hero-content {
    position: relative;
    z-index: 2;
    color: #fff;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    padding: 3rem 0;
}
.hero-content h1 {
    font-size: 3.2rem;
    font-weight: 400;
    font-style: italic;
    margin-bottom: 1rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
.hero-sub {
    font-size: 1.2rem;
    font-weight: 300;
    margin-bottom: 2rem;
}
.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}
.btn-primary, .btn-secondary {
    padding: 0.8rem 2rem;
    border-radius: 40px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    font-size: 1rem;
}
.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}
.btn-secondary {
    background: transparent;
    color: #fff;
    border: 2px solid #fff;
}
.btn-secondary:hover {
    background: rgba(255,255,255,0.15);
    transform: translateY(-2px);
}

/* ===== COUNTER ===== */
.counter-section {
    padding: 4rem 0;
    background: var(--bg-card);
    transition: background var(--transition);
}
.counter-grid {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 2rem;
}
.counter-item {
    text-align: center;
}
.counter-number {
    font-family: var(--font-serif);
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--primary);
    display: block;
}
.counter-label {
    font-size: 1.1rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ===== TIMELINE ===== */
.timeline-section {
    padding: 4rem 0;
}
.timeline {
    display: flex;
    justify-content: center;
    gap: 4rem;
    flex-wrap: wrap;
}
.timeline-item {
    text-align: center;
    position: relative;
}
.timeline-item::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -2rem;
    width: 2rem;
    height: 2px;
    background: var(--border-color);
}
.timeline-item:last-child::after {
    display: none;
}
.timeline-year {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    display: block;
}
.timeline-text {
    font-size: 1rem;
    color: var(--text-muted);
}

/* ===== FOOTER ===== */
.site-footer {
    background: var(--bg-card);
    padding: 3rem 0 1.5rem;
    border-top: 1px solid var(--border-color);
    transition: background var(--transition);
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}
.footer-col h4 {
    font-family: var(--font-serif);
    margin-bottom: 1rem;
}
.footer-col p, .footer-col a {
    color: var(--text-muted);
    font-size: 0.95rem;
}
.social-icons a {
    display: inline-block;
    margin-right: 0.8rem;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-color);
    transition: color var(--transition);
}
.social-icons a:hover {
    color: var(--primary);
}
#newsletter-form {
    display: flex;
    gap: 0.5rem;
}
#newsletter-form input {
    flex: 1;
    padding: 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-input);
    color: var(--text-color);
}
#newsletter-form button {
    padding: 0.6rem 1.2rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
.footer-bottom {
    text-align: center;
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ===== PÁGINAS INTERNAS ===== */
.page-header {
    padding: 8rem 0 3rem;
    background: var(--bg-card);
    text-align: center;
}
.page-header h1 {
    font-size: 3rem;
    font-weight: 400;
}
.page-header p {
    font-size: 1.2rem;
    color: var(--text-muted);
}

/* ===== GALERÍA ===== */
.gallery-section {
    padding: 3rem 0 5rem;
}
.filters-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
    margin-bottom: 2.5rem;
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
}
.filter-group {
    display: flex;
    flex-direction: column;
    flex: 1 0 140px;
}
.filter-group label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
}
.filter-select {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-input);
    color: var(--text-color);
    font-family: var(--font-sans);
}
.btn-filter-clear {
    padding: 0.5rem 1.2rem;
    background: var(--border-color);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-color);
    font-weight: 500;
    align-self: flex-end;
}
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 2rem;
}
.obra-card {
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform var(--transition), box-shadow var(--transition);
    cursor: pointer;
}
.obra-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}
.obra-card img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.obra-card:hover img {
    transform: scale(1.02);
}
.obra-card .info {
    padding: 1.2rem 1.2rem 1.5rem;
}
.obra-card .info h3 {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    margin-bottom: 0.3rem;
}
.obra-card .info .artista {
    color: var(--text-muted);
    font-size: 0.95rem;
}
.obra-card .info .detalles {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.obra-card .info .detalles span {
    background: var(--bg-body);
    padding: 0.15rem 0.6rem;
    border-radius: 20px;
}

/* ===== OBRA DETALLE ===== */
.obra-detalle {
    padding: 4rem 0;
}
.obra-principal {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}
.obra-imagen img {
    width: 100%;
    border-radius: 8px;
    box-shadow: var(--shadow);
    cursor: zoom-in;
}
.obra-info h2 {
    font-size: 2.4rem;
    margin-bottom: 1rem;
}
.obra-info p {
    margin-bottom: 0.5rem;
}
.obra-ensayo {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}
.obra-video {
    margin-top: 1.5rem;
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
}
.obra-video iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
}
.obra-relacionadas {
    margin-top: 4rem;
}
.relacionadas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1.5rem;
}
.relacionada-card img {
    border-radius: 6px;
    height: 160px;
    object-fit: cover;
    width: 100%;
}
.relacionada-card p {
    margin-top: 0.4rem;
    font-weight: 500;
    text-align: center;
}

/* ===== ARTISTAS ===== */
.artistas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 2.5rem;
    padding: 2rem 0 4rem;
}
.artista-card {
    text-align: center;
    background: var(--bg-card);
    padding: 1.5rem 1rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    transition: transform var(--transition);
}
.artista-card:hover {
    transform: translateY(-4px);
}
.artista-card img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 1rem;
}
.artista-card h3 {
    font-size: 1.2rem;
}
.artista-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ===== ARTISTA DETALLE ===== */
.artista-perfil {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2.5rem;
    padding: 2rem 0;
}
.artista-foto img {
    border-radius: 8px;
    box-shadow: var(--shadow);
}
.artista-info h2 {
    font-size: 2.4rem;
}
.artista-biografia {
    margin-top: 1.5rem;
}
.artista-obras {
    margin-top: 3rem;
}
.obras-mini-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1.5rem;
}
.obra-mini img {
    border-radius: 6px;
    height: 150px;
    object-fit: cover;
    width: 100%;
}
.obra-mini p {
    margin-top: 0.3rem;
    text-align: center;
    font-weight: 500;
}

/* ===== FUNDACIÓN ===== */
.fundacion-secciones {
    padding: 3rem 0 5rem;
}
.fundacion-block {
    margin-bottom: 3rem;
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
}
.fundacion-block h2 {
    font-size: 1.8rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

/* ===== LIBRO DIGITAL ===== */
.libro-container {
    padding: 3rem 0 5rem;
}
.flipbook-placeholder {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 4rem 2rem;
    text-align: center;
    box-shadow: var(--shadow);
    border: 2px dashed var(--border-color);
    margin-bottom: 2rem;
}
.placeholder-content h3 {
    font-family: var(--font-serif);
}
.placeholder-code {
    background: var(--bg-body);
    padding: 1rem;
    border-radius: 4px;
    margin-top: 1rem;
    font-size: 0.9rem;
    overflow-x: auto;
}
.libro-descarga {
    text-align: center;
}
.descarga-aviso {
    margin-top: 0.8rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ===== COMUNIDAD / MEMBRESÍAS ===== */
.membresias {
    padding: 2rem 0 4rem;
}
.membresia-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}
.membresia-card {
    background: var(--bg-card);
    padding: 2rem 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform var(--transition);
}
.membresia-card:hover {
    transform: translateY(-4px);
}
.membresia-card.destacada {
    border: 2px solid var(--primary);
    position: relative;
}
.membresia-card.destacada::before {
    content: 'Recomendado';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: #fff;
    padding: 0.2rem 1.2rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}
.membresia-card h3 {
    font-size: 1.8rem;
}
.precio {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary);
    margin: 0.5rem 0 1rem;
}
.membresia-card ul {
    list-style: none;
    text-align: left;
    margin: 1rem 0 1.5rem;
}
.membresia-card ul li {
    padding: 0.3rem 0;
    border-bottom: 1px solid var(--border-color);
}
.membresia-card .btn-primary {
    width: 100%;
}

/* ===== BLOG ===== */
.blog-section {
    padding: 3rem 0 5rem;
}
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}
.blog-card {
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}
.blog-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}
.blog-card h3, .blog-card p {
    padding: 0 1.2rem;
}
.blog-card h3 {
    margin-top: 0.8rem;
    font-size: 1.2rem;
}
.blog-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}
.blog-card a {
    display: block;
    padding: 0.8rem 1.2rem 1.2rem;
    font-weight: 600;
    color: var(--primary);
}

/* ===== CONTACTO ===== */
.contacto-form {
    padding: 3rem 0 5rem;
}
#contact-form {
    max-width: 600px;
    margin: 0 auto;
}
.form-group {
    margin-bottom: 1.2rem;
}
.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.3rem;
}
.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-input);
    color: var(--text-color);
    font-family: var(--font-sans);
    transition: border var(--transition);
}
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}
#contact-status .success {
    color: #2e7d32;
    background: #e8f5e9;
    padding: 0.8rem;
    border-radius: 4px;
    text-align: center;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
    .obra-principal {
        grid-template-columns: 1fr;
    }
    .artista-perfil {
        grid-template-columns: 1fr;
    }
    .hero-content h1 {
        font-size: 2.4rem;
    }
}
@media (max-width: 768px) {
    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--bg-card);
        padding: 1rem 2rem;
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    }
    .main-nav.open {
        display: block;
    }
    .main-nav ul {
        flex-direction: column;
        gap: 0.8rem;
    }
    .menu-toggle {
        display: block;
    }
    .header-container {
        flex-wrap: wrap;
    }
    .timeline-item::after {
        display: none;
    }
    .timeline {
        gap: 2rem;
    }
    .filters-container {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-group {
        flex: 1 1 auto;
    }
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
    .counter-grid {
        flex-direction: column;
        align-items: center;
    }
    .hero-content h1 {
        font-size: 2rem;
    }
}
@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }
    .hero-content h1 {
        font-size: 1.6rem;
    }
    .btn-primary, .btn-secondary {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
}