/* ==========================================================================
   Daniel Ferraz Ramos — Design System & CSS Architecture
   Theme: Minimalist Light / Pure White Gallery Aesthetic
   ========================================================================== */

:root {
    --bg-primary: #ffffff;
    --bg-surface: #f9f9fb;
    --bg-subtle: #f1f1f5;
    --text-primary: #111113;
    --text-secondary: #52525b;
    --text-muted: #8e8e93;
    --accent: #18181b;
    --border-color: #e4e4e7;
    --border-hover: #a1a1aa;
    
    --font-heading: 'Playfair Display', Georgia, serif;
    --font-artistic: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    
    --max-width: 1360px;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    --shadow-soft: 0 10px 30px -10px rgba(0, 0, 0, 0.06);
    --shadow-modal: 0 25px 50px -12px rgba(0, 0, 0, 0.18);
}

/* Reset & Base Setup */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.6;
    overflow-x: hidden;
}

/* View Transitions API Native Enhancements */
::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 0.3s;
    animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Utility Layout Containers */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
}

@media (max-width: 768px) {
    .container {
        padding: 0 1.25rem;
    }
}

/* Header & Navigation Bar */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(228, 228, 231, 0.6);
    padding: 1.25rem 0;
    transition: var(--transition-fast);
}

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

.brand-logo {
    font-family: var(--font-artistic);
    font-size: 1.65rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: 0.01em;
    line-height: 1.1;
    display: flex;
    flex-direction: column;
}

.brand-subtitle {
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    margin-top: -2px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
    list-style: none;
}

.nav-link {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-fast);
    position: relative;
    padding: 0.25rem 0;
}

.nav-link:hover, .nav-link.active {
    color: var(--text-primary);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--text-primary);
    border-radius: 2px;
}

/* Language Switcher Pills */
.lang-switcher {
    display: inline-flex;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 3px;
}

.lang-btn {
    border: none;
    background: none;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 16px;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition-fast);
}

.lang-btn.active {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

/* Hero & Category Filter Section */
.hero-section {
    padding: 1.75rem 0 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.hero-content {
    max-width: var(--max-width);
}

/* Category Filter Tabs */
.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 0;
}

.tab-btn {
    border: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    color: var(--text-secondary);
    padding: 0.5rem 1.25rem;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.tab-btn:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.tab-btn.active {
    background-color: var(--text-primary);
    color: var(--bg-primary);
    border-color: var(--text-primary);
}

a.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    text-decoration: none;
}

.tab-btn.ver-site-btn {
    border-color: rgba(0, 0, 0, 0.18);
    background-color: var(--bg-surface);
    color: var(--text-primary);
    font-weight: 500;
}

.tab-btn.ver-site-btn:hover {
    background-color: var(--text-primary);
    color: var(--bg-primary);
    border-color: var(--text-primary);
}

/* Artwork Masonry / Grid */
.artwork-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2.5rem;
    padding: 3rem 0;
}

.artwork-card {
    background-color: var(--bg-primary);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
}

.artwork-card:hover {
    transform: translateY(-6px);
}

.card-image-wrap {
    position: relative;
    width: 100%;
    padding-top: 125%; /* 4:5 aspect ratio */
    background-color: var(--bg-surface);
    overflow: hidden;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.card-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.artwork-card:hover .card-image {
    transform: scale(1.04);
}

.card-meta {
    padding: 1rem 0.25rem;
}

.card-category {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.card-technique {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Artwork Lightbox / Detail Modal */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-smooth);
}

.modal-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-container {
    background-color: var(--bg-primary);
    width: 100%;
    max-width: 1280px;
    max-height: 92vh;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-modal);
    display: grid;
    grid-template-columns: 1fr 340px;
    overflow: hidden;
    position: relative;
}

@media (max-width: 768px) {
    .modal-container {
        grid-template-columns: 1fr;
        max-height: 95vh;
        overflow-y: auto;
    }
}

.modal-close-btn {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 10;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.modal-close-btn:hover {
    background-color: var(--text-primary);
    color: var(--bg-primary);
}

.modal-image-area {
    background-color: #f7f7f9;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.75rem;
    overflow: hidden;
}

.modal-image {
    max-width: 100%;
    max-height: 82vh;
    object-fit: contain;
    border-radius: var(--radius-sm);
    box-shadow: 0 15px 35px -10px rgba(0, 0, 0, 0.08);
}

@media (max-width: 768px) {
    .modal-image {
        max-height: 60vh;
    }
}

.modal-info-area {
    padding: 3rem 2.25rem 2.25rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.modal-title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 500;
    line-height: 1.25;
    margin-bottom: 0.75rem;
}

.modal-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.65;
    margin: 0.5rem 0 1.5rem;
}

.modal-info-area .inquire-btn {
    margin-top: auto;
}

.inquire-btn {
    display: inline-block;
    width: 100%;
    padding: 0.8rem 1.5rem;
    text-align: center;
    background-color: var(--text-primary);
    color: var(--bg-primary);
    border: none;
    border-radius: 30px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition-fast);
}

.inquire-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Contact Section & Form */
.contact-section {
    padding: 5rem 0;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-surface);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

@media (max-width: 768px) {
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.form-input, .form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.95rem;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.form-input:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--text-primary);
}

/* Footer */
.site-footer {
    padding: 2.5rem 0;
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    justify-content: center;
    text-align: center;
    align-items: center;
}

/* Backoffice / Admin Specific Styles */
.admin-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 2rem;
    max-width: 440px;
    margin: 4rem auto;
    box-shadow: var(--shadow-soft);
}

.admin-title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.totp-qr-wrap {
    text-align: center;
    margin: 1.5rem 0;
}

.totp-qr-image {
    width: 180px;
    height: 180px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.admin-table th, .admin-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.88rem;
}

.admin-table th {
    font-weight: 600;
    background-color: var(--bg-surface);
}

/* Spinner Loader */
.initial-loader {
    height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 2px solid var(--border-color);
    border-top-color: var(--text-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 860px) {
    .smtp-grid-container {
        grid-template-columns: 1fr !important;
    }
}

/* Accessibility — Screen-reader only (visually hidden H1 for SEO) */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Card link wrapper — makes artwork cards proper links for crawlers */
.card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}



/* Footer enhancement */
.site-footer p {
    margin: 0;
}

