/*
Theme Name: Olaetxea
Theme URI: https://olaetxea.com
Author: Juan Carlos Olaetxea
Description: Tema moderno para el portfolio del pintor Juan Carlos Olaetxea
Version: 1.0
License: GNU General Public License v2 or later
Text Domain: olaetxea
*/

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    width: 100%;
}

:root {
    --color-bg: #fafaf8;
    --color-white: #ffffff;
    --color-text: #2c2c2c;
    --color-text-light: #6b6b6b;
    --color-accent: #8b7355;
    --color-accent-dark: #6d5a43;
    --color-border: #e8e4df;
    --color-dark: #1a1a1a;
    --font-heading: 'Playfair Display', Georgia, serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --max-width: 1200px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--color-text);
    background-color: var(--color-bg);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--color-accent-dark);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 400;
    line-height: 1.2;
    color: var(--color-text);
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: 1.25rem; }

/* ============================================
   HEADER & NAVIGATION
   ============================================ */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(250, 250, 248, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border);
    transition: all var(--transition);
}

.site-header.scrolled {
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
}

.site-logo {
    display: flex;
    align-items: center;
}

.site-logo-img {
    height: 28px;
    width: auto;
    transition: all var(--transition);
}

.site-logo-img:hover {
    opacity: 0.8;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 2.5rem;
}

.main-nav a {
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-light);
    position: relative;
    padding: 0.5rem 0;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--color-accent);
    transition: width var(--transition);
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--color-text);
}

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

/* Mobile menu toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-text);
    margin: 5px 0;
    transition: all var(--transition);
}

/* ============================================
   HERO SECTION (HOME)
   ============================================ */
.hero {
    position: relative;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--color-dark);
}

.hero-image {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.6;
    transition: opacity 1s ease;
}

.hero-content {
    position: relative;
    text-align: center;
    color: var(--color-white);
    z-index: 2;
    padding: 2rem;
}

.hero-content h1 {
    color: var(--color-white);
    font-size: clamp(3rem, 7vw, 5.5rem);
    margin-bottom: 1rem;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 1s ease forwards 0.3s;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.3rem);
    font-weight: 300;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 1s ease forwards 0.6s;
}

.hero-cta {
    margin-top: 2.5rem;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 1s ease forwards 0.9s;
}

.hero-cta a {
    display: inline-block;
    padding: 1rem 2.5rem;
    border: 1px solid rgba(255, 255, 255, 0.6);
    color: var(--color-white);
    font-size: 0.85rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    transition: all var(--transition);
}

.hero-cta a:hover {
    background: var(--color-white);
    color: var(--color-dark);
}

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hero header transparent */
.home .site-header:not(.scrolled) {
    background: transparent !important;
    border-bottom-color: transparent !important;
    box-shadow: none !important;
}

.home .site-header:not(.scrolled) .site-logo-img {
    filter: brightness(0) invert(1) !important;
}

.home .site-header:not(.scrolled) .main-nav a {
    color: var(--color-white) !important;
}

.home .site-header:not(.scrolled) .menu-toggle span {
    background: var(--color-white) !important;
}

.home .site-header:not(.scrolled) .menu-toggle {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 6px;
    padding: 0.7rem;
}

.home .site-header:not(.scrolled) .menu-toggle span {
    width: 26px;
    height: 3px;
}

.home .site-header.scrolled {
    background: rgba(250, 250, 248, 0.95);
    border-bottom-color: var(--color-border);
}

.home .site-header.scrolled .site-logo-img {
    filter: none;
}

.home .site-header.scrolled .main-nav a {
    color: var(--color-text-light);
}

.home .site-header.scrolled .menu-toggle span {
    background: var(--color-text);
}

/* ============================================
   FEATURED GALLERY (HOME)
   ============================================ */
.section {
    padding: 6rem 0;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    margin-bottom: 1rem;
}

.section-header p {
    color: var(--color-text-light);
    max-width: 600px;
    margin: 0 auto;
    font-size: 1.05rem;
}

.section-divider {
    width: 50px;
    height: 1px;
    background: var(--color-accent);
    margin: 1.5rem auto 0;
}

/* ============================================
   GALLERY GRID
   ============================================ */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 4/3;
    background: var(--color-border);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-item-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 50%);
    opacity: 0;
    transition: opacity var(--transition);
    display: flex;
    align-items: flex-end;
    padding: 1.5rem;
}

.gallery-item:hover .gallery-item-overlay {
    opacity: 1;
}

.gallery-item-overlay h4 {
    color: var(--color-white);
    font-family: var(--font-heading);
    font-size: 1.1rem;
}

/* ============================================
   LIGHTBOX
   ============================================ */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.95);
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity var(--transition);
}

.lightbox-close:hover {
    opacity: 0.7;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: white;
    font-size: 2.5rem;
    cursor: pointer;
    padding: 1rem;
    transition: opacity var(--transition);
}

.lightbox-nav:hover {
    opacity: 0.7;
}

.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }

/* ============================================
   ABOUT / SOBRE MI
   ============================================ */
.about-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-image {
    aspect-ratio: 3/4;
    overflow: hidden;
}

.about-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.about-text h2 {
    margin-bottom: 1.5rem;
}

.about-text p {
    color: var(--color-text-light);
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
}

/* ============================================
   EXPOSICIONES / TIMELINE
   ============================================ */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--color-border);
}

.timeline-item {
    padding-left: 2.5rem;
    padding-bottom: 2.5rem;
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -4px;
    top: 0.5rem;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--color-accent);
}

.timeline-year {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    color: var(--color-accent);
    margin-bottom: 0.75rem;
}

.timeline-entries {
    list-style: none;
}

.timeline-entries li {
    padding: 0.4rem 0;
    color: var(--color-text-light);
    font-size: 0.95rem;
    border-bottom: 1px solid var(--color-border);
}

.timeline-entries li:last-child {
    border-bottom: none;
}

/* ============================================
   PAGE HERO (INTERNAL PAGES)
   ============================================ */
.page-hero {
    padding-top: 140px;
    padding-bottom: 60px;
    text-align: center;
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
}

.page-hero h1 {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    margin-bottom: 0.5rem;
}

.page-hero p {
    color: var(--color-text-light);
    font-size: 1.1rem;
}

/* ============================================
   CONTACT
   ============================================ */
.contact-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.contact-info h3 {
    margin-bottom: 1.5rem;
}

.contact-detail {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.contact-detail-icon {
    width: 20px;
    flex-shrink: 0;
    color: var(--color-accent);
    margin-top: 0.2rem;
}

.contact-detail p {
    color: var(--color-text-light);
    font-size: 0.95rem;
    line-height: 1.6;
}

.contact-detail a {
    color: var(--color-accent);
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--color-border);
    border-radius: 50%;
    color: var(--color-text-light);
    transition: all var(--transition);
}

.social-links a:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

/* Contact form */
.contact-form .form-group {
    margin-bottom: 1.5rem;
}

.contact-form label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    color: var(--color-text);
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 1px solid var(--color-border);
    background: var(--color-white);
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--color-text);
    transition: border-color var(--transition);
    outline: none;
}

.contact-form input:focus,
.contact-form textarea:focus {
    border-color: var(--color-accent);
}

.contact-form textarea {
    min-height: 150px;
    resize: vertical;
}

.contact-form button {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: var(--color-accent);
    color: var(--color-white);
    border: none;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background var(--transition);
}

.contact-form button:hover {
    background: var(--color-accent-dark);
}

/* Contact Form 7 styles */
.contact-form-wrap .wpcf7 label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 0.3rem;
    color: var(--color-text);
}

.contact-form-wrap .wpcf7 p {
    margin-bottom: 1.5rem;
}

.contact-form-wrap .wpcf7 input[type="text"],
.contact-form-wrap .wpcf7 input[type="email"],
.contact-form-wrap .wpcf7 textarea {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 1px solid var(--color-border);
    background: var(--color-white);
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--color-text);
    transition: border-color var(--transition);
    outline: none;
    border-radius: 0;
    -webkit-appearance: none;
}

.contact-form-wrap .wpcf7 input[type="text"]:focus,
.contact-form-wrap .wpcf7 input[type="email"]:focus,
.contact-form-wrap .wpcf7 textarea:focus {
    border-color: var(--color-accent);
}

.contact-form-wrap .wpcf7 textarea {
    min-height: 180px;
    resize: vertical;
}

.contact-form-wrap .wpcf7 input[type="submit"] {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: var(--color-accent);
    color: var(--color-white);
    border: none;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background var(--transition);
    width: auto;
    border-radius: 0;
    -webkit-appearance: none;
}

.contact-form-wrap .wpcf7 input[type="submit"]:hover {
    background: var(--color-accent-dark);
}

.contact-form-wrap .wpcf7-response-output {
    border: none !important;
    padding: 1rem !important;
    margin: 1.5rem 0 0 !important;
    font-size: 0.9rem;
}

.contact-form-wrap .wpcf7-mail-sent-ok {
    background: #e8f5e9;
    color: #2e7d32;
}

.contact-form-wrap .wpcf7-not-valid-tip {
    color: #c62828;
    font-size: 0.8rem;
    margin-top: 0.3rem;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
    background: var(--color-dark);
    color: rgba(255, 255, 255, 0.5);
    padding: 3rem 0;
    text-align: center;
    font-size: 0.85rem;
}

.site-footer a {
    color: rgba(255, 255, 255, 0.7);
}

.site-footer a:hover {
    color: var(--color-white);
}

.footer-nav {
    display: flex;
    justify-content: center;
    gap: 2rem;
    list-style: none;
    margin-bottom: 1.5rem;
}

.footer-nav a {
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    /* BURGER: siempre visible en movil */
    .menu-toggle {
        display: block !important;
        z-index: 1001;
        position: relative;
        background: rgba(0, 0, 0, 0.4);
        border-radius: 6px;
        padding: 0.7rem;
    }

    .menu-toggle span {
        background: #ffffff !important;
        width: 26px;
        height: 3px;
    }

    /* X cuando esta abierto */
    .menu-toggle.active span {
        background: #2c2c2c !important;
    }
    .menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    .menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }
    .menu-toggle.active {
        background: transparent;
    }

    /* NAV: oculto por defecto, panel lateral */
    .main-nav {
        display: none !important;
        position: fixed;
        top: 0;
        right: 0;
        width: 280px;
        height: 100vh;
        background: #ffffff;
        padding: 5rem 2rem 2rem;
        box-shadow: -5px 0 30px rgba(0, 0, 0, 0.2);
        z-index: 999;
    }

    .main-nav.open {
        display: block !important;
    }

    .main-nav ul {
        flex-direction: column;
        gap: 1.5rem;
    }

    /* Links SIEMPRE oscuros en el panel movil */
    .main-nav a {
        color: #2c2c2c !important;
        font-size: 1rem;
    }

    /* Overlay de fondo */
    .main-nav.open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.4);
        z-index: -1;
    }

    .about-layout,
    .contact-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .section {
        padding: 4rem 0;
    }

    .header-inner {
        height: 65px;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
}
