/*
Theme Name: Girona Gallery
Theme URI: https://espaibarrivell.com
Author: Espai Barri Vell
Description: A minimal, elegant block theme for contemporary art galleries.
Version: 2.0
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: gironagallery
Tags: full-site-editing, block-patterns, custom-colors, custom-logo
*/

/* ===========================================
   CSS CUSTOM PROPERTIES
=========================================== */
:root {
    --gallery-black: #000;
    --gallery-dark: #1a1a1a;
    --gallery-text: #333;
    --gallery-gray: #666;
    --gallery-light-gray: #999;
    --gallery-border: #e0e0e0;
    --gallery-light: #f5f5f5;
    --gallery-white: #fff;
    
    --gallery-transition: 0.3s ease;
    --gallery-transition-slow: 0.6s cubic-bezier(0.45, 0, 0.27, 1);
    
    --gallery-header-height: 60px;
    --gallery-spacing: clamp(20px, 5vw, 80px);
}

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

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    overflow-x: hidden;
}

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

a {
    transition: color var(--gallery-transition), opacity var(--gallery-transition);
}

/* ===========================================
   HEADER - AWL STYLE
=========================================== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: var(--gallery-white);
    height: var(--gallery-header-height);
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--gallery-border);
}

.site-header .wp-block-group {
    width: 100%;
    max-width: none !important;
    padding: 0 var(--gallery-spacing) !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

/* Logo - small, understated */
.site-header .wp-block-site-title {
    margin: 0;
    font-size: 13px !important;
    font-weight: 400 !important;
    letter-spacing: 0.02em;
}

.site-header .wp-block-site-title a {
    color: var(--gallery-text);
}

.site-header .custom-logo {
    max-height: 24px !important;
    width: auto !important;
}

/* Navigation - right aligned, minimal */
.site-header .wp-block-navigation {
    gap: 0;
}

.site-header .wp-block-navigation a {
    font-size: 13px !important;
    font-weight: 400;
    color: var(--gallery-text);
    padding: 8px 16px;
    position: relative;
}

.site-header .wp-block-navigation a:hover {
    color: var(--gallery-gray);
}

/* Body offset for fixed header */
body {
    padding-top: var(--gallery-header-height);
}

/* Mobile menu */
.wp-block-navigation__responsive-container.is-menu-open {
    background: var(--gallery-white);
    padding: 80px var(--gallery-spacing);
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item a {
    font-size: 28px;
    padding: 12px 0;
}

/* ===========================================
   HERO SLIDER - AWL STYLE
=========================================== */
.hero-slider {
    position: relative;
    width: 100%;
    height: calc(100vh - var(--gallery-header-height) - 120px);
    min-height: 400px;
    max-height: 800px;
    background: var(--gallery-white);
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.hero-slide.active {
    opacity: 1;
    visibility: visible;
}

.hero-slide-image {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.hero-slide-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform var(--gallery-transition-slow);
}

.hero-slide.active .hero-slide-image img {
    transform: scale(1);
}

/* Slide caption - below image */
.hero-slide-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    transform: translateY(100%);
    padding: 28px var(--gallery-spacing) 32px;
    background: var(--gallery-white);
}

.hero-slide-title {
    font-size: clamp(20px, 2.5vw, 28px);
    font-weight: 400;
    margin: 0 0 6px 0;
    line-height: 1.25;
    color: var(--gallery-text);
}

.hero-slide-title a {
    color: inherit;
    text-decoration: none;
}

.hero-slide-title a:hover {
    color: var(--gallery-gray);
}

.hero-slide-date {
    font-size: 13px;
    color: var(--gallery-gray);
    margin: 0;
}

/* Slider dots - AWL right-aligned */
.slider-dots {
    position: absolute;
    bottom: -80px;
    right: var(--gallery-spacing);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.slider-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--gallery-light-gray);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background var(--gallery-transition);
}

.slider-dot:hover {
    background: var(--gallery-gray);
}

.slider-dot.active {
    background: var(--gallery-text);
}

/* Slider container with caption space */
.hero-slider-wrapper {
    margin-bottom: 120px;
}

/* ===========================================
   NEWS SECTION - AWL STYLE
=========================================== */
.news-section {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 60px;
    padding: 80px var(--gallery-spacing);
    max-width: 1400px;
    margin: 0 auto;
}

.news-section-label {
    font-size: 13px;
    font-weight: 400;
    color: var(--gallery-text);
    margin: 0;
    padding-top: 4px;
}

.news-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* News item - AWL horizontal card style */
.news-item {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 30px;
    padding: 30px 0;
    border-bottom: 1px solid var(--gallery-border);
    text-decoration: none;
    color: inherit;
}

.news-item:first-child {
    padding-top: 0;
}

.news-item:last-child {
    border-bottom: none;
}

.news-item-image {
    aspect-ratio: 4/3;
    overflow: hidden;
    background: var(--gallery-light);
}

.news-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--gallery-transition-slow), opacity var(--gallery-transition);
}

.news-item:hover .news-item-image img {
    transform: scale(1.03);
    opacity: 0.9;
}

.news-item-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.news-item-category {
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--gallery-gray);
    margin-bottom: 8px;
}

.news-item-title {
    font-size: 18px;
    font-weight: 400;
    line-height: 1.35;
    margin: 0 0 6px 0;
    color: var(--gallery-text);
    transition: color var(--gallery-transition);
}

.news-item:hover .news-item-title {
    color: var(--gallery-gray);
}

.news-item-subtitle {
    font-size: 14px;
    color: var(--gallery-gray);
    margin: 0 0 8px 0;
    line-height: 1.5;
}

.news-item-date {
    font-size: 13px;
    color: var(--gallery-light-gray);
    margin: 0;
}

/* ===========================================
   ARTISTS GRID
=========================================== */
.artists-section {
    padding: 80px var(--gallery-spacing);
    max-width: 1400px;
    margin: 0 auto;
}

.section-label {
    font-size: 13px;
    font-weight: 400;
    color: var(--gallery-text);
    margin: 0 0 50px 0;
}

.artists-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 40px;
}

.artist-card {
    text-align: center;
    text-decoration: none;
    color: inherit;
}

.artist-card-image {
    aspect-ratio: 1;
    overflow: hidden;
    margin-bottom: 16px;
    background: var(--gallery-light);
}

.artist-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--gallery-transition-slow), opacity var(--gallery-transition);
}

.artist-card:hover .artist-card-image img {
    transform: scale(1.03);
    opacity: 0.9;
}

.artist-card-name {
    font-size: 15px;
    font-weight: 400;
    color: var(--gallery-text);
    margin: 0;
    transition: color var(--gallery-transition);
}

.artist-card:hover .artist-card-name {
    color: var(--gallery-gray);
}

/* ===========================================
   EXHIBITIONS GRID
=========================================== */
.exhibitions-section {
    padding: 80px var(--gallery-spacing);
    max-width: 1400px;
    margin: 0 auto;
}

.exhibitions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 50px;
}

.exhibition-card {
    text-decoration: none;
    color: inherit;
}

.exhibition-card-image {
    aspect-ratio: 4/3;
    overflow: hidden;
    margin-bottom: 18px;
    background: var(--gallery-light);
}

.exhibition-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--gallery-transition-slow);
}

.exhibition-card:hover .exhibition-card-image img {
    transform: scale(1.02);
}

.exhibition-card-title {
    font-size: 20px;
    font-weight: 400;
    line-height: 1.3;
    margin: 0 0 6px 0;
    color: var(--gallery-text);
    transition: color var(--gallery-transition);
}

.exhibition-card:hover .exhibition-card-title {
    color: var(--gallery-gray);
}

.exhibition-card-date {
    font-size: 14px;
    color: var(--gallery-gray);
    margin: 0;
}

/* ===========================================
   SINGLE PAGES
=========================================== */
.page-hero {
    width: 100%;
    height: 60vh;
    min-height: 400px;
    overflow: hidden;
}

.page-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.page-content {
    max-width: 720px;
    margin: 0 auto;
    padding: 60px var(--gallery-spacing) 100px;
}

.page-title {
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 400;
    margin: 0 0 16px 0;
    line-height: 1.2;
}

.page-meta {
    font-size: 14px;
    color: var(--gallery-gray);
    margin-bottom: 40px;
}

/* Single artist - sidebar layout */
.single-artist {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 60px;
    padding: 60px var(--gallery-spacing) 100px;
    max-width: 1200px;
    margin: 0 auto;
}

.single-artist-portrait {
    aspect-ratio: 1;
    overflow: hidden;
    position: sticky;
    top: calc(var(--gallery-header-height) + 30px);
    align-self: start;
}

.single-artist-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.single-artist-info h1 {
    font-size: 28px;
    font-weight: 400;
    margin: 0 0 24px 0;
}

.single-artist-bio {
    font-size: 16px;
    line-height: 1.75;
}

/* Single exhibition - sidebar layout */
.single-exhibition {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 60px;
    padding: 60px var(--gallery-spacing) 100px;
    max-width: 1200px;
    margin: 0 auto;
}

.single-exhibition-sidebar {
    position: sticky;
    top: calc(var(--gallery-header-height) + 30px);
    align-self: start;
}

.single-exhibition-sidebar h1 {
    font-size: 24px;
    font-weight: 400;
    margin: 0 0 12px 0;
    line-height: 1.3;
}

.single-exhibition-dates {
    font-size: 14px;
    color: var(--gallery-gray);
    margin-bottom: 30px;
}

.single-exhibition-artists-label {
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--gallery-gray);
    margin-bottom: 10px;
}

.single-exhibition-artists a {
    display: block;
    font-size: 14px;
    color: var(--gallery-text);
    margin-bottom: 6px;
}

.single-exhibition-artists a:hover {
    color: var(--gallery-gray);
}

.single-exhibition-content {
    font-size: 16px;
    line-height: 1.8;
}

.single-exhibition-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 50px;
}

.single-exhibition-gallery img {
    width: 100%;
    cursor: pointer;
    transition: opacity var(--gallery-transition);
}

.single-exhibition-gallery img:hover {
    opacity: 0.9;
}

/* ===========================================
   FOOTER - AWL STYLE
=========================================== */
.site-footer {
    background: var(--gallery-dark);
    color: var(--gallery-white);
    padding: 60px var(--gallery-spacing) 40px;
}

.site-footer .wp-block-group {
    max-width: 1400px;
    margin: 0 auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 2fr;
    gap: 50px;
    margin-bottom: 50px;
}

.footer-heading {
    font-size: 11px !important;
    font-weight: 400 !important;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 20px !important;
}

.site-footer p {
    font-size: 14px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 6px;
}

.site-footer a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color var(--gallery-transition);
}

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

.footer-nav a {
    display: block;
    font-size: 14px;
    margin-bottom: 10px;
}

.footer-social a {
    display: block;
    font-size: 14px;
    margin-bottom: 10px;
}

/* Newsletter form */
.newsletter-form {
    display: flex;
    margin-top: 15px;
}

.newsletter-form input[type="email"] {
    flex: 1;
    padding: 10px 14px;
    font-size: 13px;
    font-family: inherit;
    color: #fff;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-right: none;
    outline: none;
}

.newsletter-form input[type="email"]::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.newsletter-form input[type="email"]:focus {
    border-color: rgba(255, 255, 255, 0.4);
}

.newsletter-form button {
    padding: 10px 18px;
    font-size: 11px;
    font-weight: 400;
    font-family: inherit;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all var(--gallery-transition);
}

.newsletter-form button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Footer bottom */
.footer-bottom {
    padding-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
}

.footer-locations {
    display: flex;
    gap: 20px;
}

/* ===========================================
   ARCHIVE PAGES
=========================================== */
.archive-header {
    padding: 50px var(--gallery-spacing) 30px;
    max-width: 1400px;
    margin: 0 auto;
}

.archive-title {
    font-size: 13px;
    font-weight: 400;
    color: var(--gallery-text);
    margin: 0;
}

/* ===========================================
   UTILITY CLASSES
=========================================== */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ===========================================
   PAGE TRANSITIONS
=========================================== */
.wp-site-blocks > * {
    animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===========================================
   RESPONSIVE
=========================================== */
@media (max-width: 1024px) {
    .news-section {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 40px;
    }
    
    .single-artist,
    .single-exhibition {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .single-artist-portrait,
    .single-exhibition-sidebar {
        position: static;
        max-width: 300px;
    }
}

@media (max-width: 768px) {
    :root {
        --gallery-header-height: 50px;
    }
    
    .hero-slider {
        height: 50vh;
        min-height: 300px;
    }
    
    .hero-slider-wrapper {
        margin-bottom: 100px;
    }
    
    .hero-slide-caption {
        padding: 20px var(--gallery-spacing) 24px;
    }
    
    .slider-dots {
        bottom: -70px;
    }
    
    .news-item {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .news-item-image {
        max-width: 200px;
    }
    
    .exhibitions-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 35px;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 15px;
    }
    
    .footer-locations {
        flex-wrap: wrap;
    }
    
    .page-hero {
        height: 40vh;
    }
}
