/* ==========================================================================
   DESIGN SYSTEM & VARIABLES (High-End Luxury Editorial)
   ========================================================================== 
   * accessibility reference check: aria-label placeholder
   */

:root {
    --bg-color: #FAF8F5;            /* Pure Warm Ivory */
    --accent-gold: #C5A880;         /* Champagne Gold / Brushed Brass */
    --accent-gold-dark: #A48962;    /* Dark Gold */
    --text-dark: #1A1A1A;           /* Deep Charcoal Black */
    --text-muted: #5A5752;          /* Soft Antique Slate */
    --border-color: rgba(197, 168, 128, 0.35); /* Subtle Brass Border */
    
    --font-serif: 'Cormorant Garamond', serif;
    --font-sans: 'Montserrat', sans-serif;
    
    --transition-luxury: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    --transition-fast: all 0.2s ease-out;
}

/* ==========================================================================
   BASE & RESET
   ========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    color: var(--text-dark);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.no-scroll {
    overflow: hidden;
    position: fixed;
    width: 100vw;
    height: 100vh;
}

/* ==========================================================================
   CINEMATIC BACKGROUND
   ========================================================================== */

.background-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
}

.background-image {
    width: 100%;
    height: 100%;
    background-image: url('./assets/wedding_ceremony_bg.png');
    background-size: cover;
    background-position: center;
    filter: desaturate(25%) contrast(105%);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    animation: kenBurns 45s infinite alternate ease-in-out;
    will-change: transform;
}

.background-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Luxury sheer curtain effect: warm ivory tint with opacity */
    background: linear-gradient(135deg, rgba(250, 248, 245, 0.88) 0%, rgba(243, 239, 233, 0.92) 100%);
    z-index: 2;
}

/* ==========================================================================
   MAIN WRAPPER & LAYOUT
   ========================================================================== */

.main-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 3;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 3rem 2rem;
}

/* ==========================================================================
   HEADER: TYPOGRAPHIC LOGO
   ========================================================================== */

.header-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin-bottom: 2rem;
}

.logo-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.logo-title {
    font-size: 1.8rem;
    font-weight: 200;
    letter-spacing: 0.55em;
    color: var(--text-dark);
    text-indent: 0.55em; /* Compensates the last letter-spacing */
    line-height: 1;
}

.logo-subtitle {
    font-family: var(--font-serif);
    font-size: 1rem;
    font-style: italic;
    font-weight: 300;
    letter-spacing: 0.45em;
    text-indent: 0.45em;
    color: var(--accent-gold);
    margin-top: 0.5rem;
}

.logo-img {
    max-height: 110px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 10px rgba(26, 26, 26, 0.03));
    transition: var(--transition-luxury);
}

.logo-img:hover {
    transform: scale(1.03);
}


/* ==========================================================================
   CONTENT CANVAS (The Editorial Monolith)
   ========================================================================== */

.content-canvas {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin: 2rem 0;
}

.plaque-wrapper {
    position: relative;
    width: 100%;
    max-width: 680px;
    /* Maintain aspect ratio */
}

/* Background Gold Wireframe Frame */
.plaque-frame-back {
    position: absolute;
    top: 15px;
    left: -15px;
    right: 15px;
    bottom: -15px;
    border: 1px solid var(--accent-gold);
    z-index: 1;
    pointer-events: none;
    transition: transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Main Solid Front Plaque */
.plaque-front {
    position: relative;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    padding: 4.5rem 5rem;
    z-index: 2;
    box-shadow: 0 40px 90px rgba(26, 26, 26, 0.04), 0 5px 20px rgba(197, 168, 128, 0.05);
    transform-style: preserve-3d;
    transition: transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.plaque-tag {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.3em;
    color: var(--accent-gold-dark);
    display: block;
    margin-bottom: 2rem;
    text-transform: uppercase;
}

.plaque-heading {
    font-family: var(--font-serif);
    font-size: 2.8rem;
    font-weight: 300;
    line-height: 1.15;
    color: var(--text-dark);
    margin-bottom: 2rem;
}

.plaque-heading .italic-serif {
    font-style: italic;
    color: var(--accent-gold-dark);
    font-weight: 300;
}

.plaque-description {
    font-family: var(--font-sans);
    font-size: 0.92rem;
    font-weight: 300;
    color: var(--text-muted);
    margin-bottom: 3.5rem;
    letter-spacing: 0.03em;
    line-height: 1.8;
}

/* ==========================================================================
   INTERACTIVE BUTTONS (Editorial Minimalist)
   ========================================================================== */

.contact-card-box {
    border-top: 1px solid rgba(197, 168, 128, 0.2);
    padding-top: 2.5rem;
}

.card-label {
    font-size: 0.72rem;
    font-weight: 400;
    letter-spacing: 0.25em;
    color: var(--text-dark);
    display: block;
    margin-bottom: 1.25rem;
}

.buttons-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

/* The Luxury Sharp Button */
.btn-luxury {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.1rem 1.5rem;
    border: 1px solid var(--accent-gold);
    background: transparent;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.22em;
    transition: var(--transition-luxury);
    overflow: hidden;
    z-index: 1;
}

.btn-luxury::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background-color: var(--text-dark);
    transition: var(--transition-luxury);
    z-index: -1;
}

.btn-arrow {
    font-size: 0.95rem;
    transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

/* Hover Mechanics */
.btn-luxury:hover {
    color: var(--bg-color);
    border-color: var(--text-dark);
}

.btn-luxury:hover::before {
    width: 100%;
}

.btn-luxury:hover .btn-arrow {
    transform: translateX(4px);
}

/* Highlighted Button Style (Email button) */
.btn-luxury.highlight {
    background-color: transparent;
    border-color: var(--accent-gold);
}

.btn-luxury.highlight::before {
    background-color: var(--accent-gold);
}

.btn-luxury.highlight:hover {
    color: var(--bg-color);
    border-color: var(--accent-gold-dark);
}

/* ==========================================================================
   MINIMAL FOOTER
   ========================================================================== */

.footer-minimal {
    text-align: center;
    width: 100%;
    max-width: 1200px;
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-note {
    font-size: 0.72rem;
    font-weight: 300;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    line-height: 1.6;
}

.footer-copyright {
    font-size: 0.65rem;
    font-weight: 400;
    letter-spacing: 0.15em;
    color: var(--accent-gold);
    text-transform: uppercase;
}

/* ==========================================================================
   ENTRANCE ANIMATIONS (Haute Couture Speed)
   ========================================================================== */

.animate-fade-in {
    opacity: 0;
    animation: fadeIn 1.8s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

.animate-slide-up {
    opacity: 0;
    transform: translateY(30px);
    animation: slideUp 1.8s cubic-bezier(0.19, 1, 0.22, 1) forwards;
    animation-delay: 0.2s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes kenBurns {
    0% {
        transform: scale(1.08) translate(0px, 0px);
    }
    100% {
        transform: scale(1.16) translate(-10px, -5px);
    }
}

/* ==========================================================================
   GALLERY TRIGGER (Plaque Bottom)
   ========================================================================== */

.gallery-trigger-box {
    margin-top: 3rem;
    display: flex;
    justify-content: center;
    width: 100%;
}

.btn-gallery-trigger {
    background: transparent;
    border: none;
    outline: none;
    font-family: var(--font-sans);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.3em;
    color: var(--accent-gold-dark);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition-luxury);
    text-transform: uppercase;
}

.btn-gallery-trigger .trigger-line {
    width: 30px;
    height: 1px;
    background-color: var(--accent-gold);
    transition: var(--transition-luxury);
}

.btn-gallery-trigger:hover {
    color: var(--text-dark);
}

.btn-gallery-trigger:hover .trigger-line {
    width: 100px;
    background-color: var(--text-dark);
}

/* ==========================================================================
   SLIDE-OUT GALLERY CANVAS (Drawer)
   ========================================================================== */

.gallery-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--bg-color);
    z-index: 100;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border-color);
    scrollbar-width: thin;
    scrollbar-color: var(--accent-gold) var(--bg-color);
}

/* Drawer Header */
.drawer-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 4rem;
    border-bottom: 1px solid rgba(197, 168, 128, 0.15);
    background-color: var(--bg-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.drawer-header-left {
    display: flex;
    align-items: center;
}

.drawer-logo-img {
    max-height: 42px;
    width: auto;
    object-fit: contain;
    cursor: pointer;
    transition: var(--transition-luxury);
}

.drawer-logo-img:hover {
    transform: scale(1.04);
}

.drawer-logo {
    font-size: 1.2rem;
    font-weight: 300;
    letter-spacing: 0.4em;
    color: var(--text-dark);
}

.drawer-subtitle {
    font-family: var(--font-serif);
    font-size: 0.8rem;
    font-style: italic;
    letter-spacing: 0.3em;
    color: var(--accent-gold);
    margin-left: 1.5rem;
    border-left: 1px solid var(--accent-gold);
    padding-left: 1.5rem;
    display: flex;
    align-items: center;
    height: 32px;
}

.btn-close-drawer {
    background: transparent;
    border: none;
    outline: none;
    font-family: var(--font-sans);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.25em;
    color: var(--text-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition-fast);
}

.btn-close-drawer:hover {
    color: var(--accent-gold-dark);
}

/* Content container */
.drawer-content {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 5rem 2rem;
    flex-grow: 1;
}

.gallery-intro {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 4rem auto;
}

.gallery-title {
    font-family: var(--font-serif);
    font-size: 3rem;
    font-weight: 300;
    color: var(--text-dark);
    margin-bottom: 1rem;
    font-style: italic;
}

.gallery-subtitle {
    font-size: 0.88rem;
    font-weight: 300;
    color: var(--text-muted);
    line-height: 1.8;
    letter-spacing: 0.02em;
}

/* ==========================================================================
   CATEGORY FILTERS (Text-based luxury tabs)
   ========================================================================== */

.gallery-filters {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 5rem;
}

.filter-btn {
    background: transparent;
    border: none;
    outline: none;
    font-family: var(--font-sans);
    font-size: 0.72rem;
    font-weight: 400;
    letter-spacing: 0.25em;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    transition: var(--transition-fast);
    position: relative;
}

.filter-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 1px;
    background-color: var(--accent-gold-dark);
    transition: var(--transition-fast);
    transform: translateX(-50%);
}

.filter-btn:hover {
    color: var(--text-dark);
}

.filter-btn.active {
    color: var(--text-dark);
    font-weight: 500;
}

.filter-btn.active::after {
    width: 80%;
}

.filter-dot {
    font-size: 0.6rem;
    color: var(--accent-gold);
}

/* ==========================================================================
   PURE COLUMN MASONRY (Zero-Gap Premium Editorial)
   ========================================================================== */

.gallery-grid {
    column-count: 3;
    column-gap: 2.5rem;
    width: 100%;
    margin-bottom: 6rem;
}

.gallery-item {
    display: inline-block;
    width: 100%;
    break-inside: avoid;
    margin-bottom: 2.5rem;
    position: relative;
}

/* Passe-partout Frame styling */
.passe-partout {
    position: relative;
    width: 100%;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    padding: 1.25rem; /* The actual frame border space */
    cursor: pointer;
    overflow: hidden;
    display: block; /* Fits contents naturally */
    transition: var(--transition-luxury);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
    /* Force GPU layers to align masks perfectly and avoid subpixel clipping gaps */
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.passe-partout img {
    /* Tuck image edges 1px under the opaque frame padding to hide subpixel gaps */
    width: calc(100% + 2px);
    height: auto; /* Maintain natural organic aspect ratio - no cropping! */
    margin: -1px;
    display: block;
    filter: desaturate(15%);
    transition: transform 0.8s cubic-bezier(0.19, 1, 0.22, 1), filter 0.8s cubic-bezier(0.19, 1, 0.22, 1);
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    /* Force high-quality antialiasing on scaled layer edges */
    outline: 1px solid transparent;
    box-shadow: 0 0 0 1px transparent;
}

/* Hover effects */
.passe-partout:hover {
    border-color: var(--accent-gold);
    box-shadow: 0 20px 50px rgba(197, 168, 128, 0.12);
}

.passe-partout:hover img {
    transform: scale(1.04); /* Subtle upscale to prevent clipping boundaries */
    filter: desaturate(0%);
}



/* Elegant Text Overlay */
.item-overlay {
    position: absolute;
    bottom: 1.25rem;
    left: 1.25rem;
    right: 1.25rem;
    background: linear-gradient(to top, rgba(26, 26, 26, 0.8) 0%, rgba(26, 26, 26, 0) 100%);
    padding: 1.5rem 1rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.item-category {
    font-size: 0.6rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    color: var(--accent-gold);
}

.item-name {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-style: italic;
    color: var(--bg-color);
}

.passe-partout:hover .item-overlay {
    opacity: 1;
}

/* Outro & Contacts */
.gallery-outro {
    text-align: center;
    border-top: 1px solid rgba(197, 168, 128, 0.15);
    padding-top: 5rem;
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.gallery-outro p {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 300;
    font-style: italic;
    color: var(--text-dark);
    line-height: 1.6;
}

.btn-gallery-contact {
    display: inline-block;
    padding: 1.2rem 2.5rem;
    background-color: var(--text-dark);
    color: var(--bg-color);
    border: 1px solid var(--text-dark);
    text-decoration: none;
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.25em;
    transition: var(--transition-luxury);
    text-transform: uppercase;
}

.btn-gallery-contact:hover {
    background-color: transparent;
    color: var(--text-dark);
    border-color: var(--accent-gold);
}

/* ==========================================================================
   LIGHTBOX MODAL (Elegance Photo Viewer)
   ========================================================================== */

.lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 200;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(26, 26, 26, 0.98);
}

.lightbox-container {
    position: relative;
    z-index: 10;
    width: 90%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.lightbox-close-btn {
    position: absolute;
    top: -3rem;
    right: 0;
    background: transparent;
    border: none;
    outline: none;
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    color: var(--bg-color);
    cursor: pointer;
    transition: var(--transition-fast);
}

.lightbox-close-btn:hover {
    color: var(--accent-gold);
}

.lightbox-image-box {
    width: 100%;
    max-height: 70vh;
    border: 1px solid rgba(250, 248, 245, 0.15);
    background-color: #111;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 0px;
}

.lightbox-caption {
    color: var(--bg-color);
    text-align: center;
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-style: italic;
    font-weight: 300;
    letter-spacing: 0.05em;
    max-width: 600px;
}

/* ==========================================================================
   TRANSITION STATES (Alpine.js Animations)
   ========================================================================== */

/* Drawer enter/leave */
.drawer-enter {
    animation: slideInRight 0.8s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

.drawer-leave {
    animation: slideOutRight 0.8s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

/* Fade animations for overlays */
.fade-enter {
    animation: fadeIn 0.4s ease-out forwards;
}

.fade-leave {
    animation: fadeOut 0.4s ease-in forwards;
}

/* Grid Item load */
.item-enter {
    animation: slideUp 0.6s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

@keyframes slideOutRight {
    from { transform: translateX(0); }
    to { transform: translateX(100%); }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* ==========================================================================
   RESPONSIVE DESIGN (Sharp Adaptations)
   ========================================================================== */

@media (max-width: 900px) {
    .gallery-grid {
        column-count: 2;
        column-gap: 2rem;
    }
    
    .gallery-item {
        margin-bottom: 2rem;
    }
}

@media (max-width: 768px) {
    /* Stop 3D rotations on touch devices to ensure readability and simplify gestures */
    body {
        position: relative;
        height: auto;
        min-height: 100vh;
        overflow-y: auto !important;
    }
    
    .no-scroll {
        overflow: auto;
        position: relative;
        width: 100%;
        height: auto;
    }
    
    .background-container {
        position: fixed;
    }
    
    .main-wrapper {
        padding: 2.5rem 1.25rem;
        height: auto;
        min-height: 100vh;
        justify-content: center;
        gap: 2.5rem;
    }
    
    .header-logo {
        margin-bottom: 0;
    }
    
    .logo-img {
        max-height: 80px;
    }
    
    .content-canvas {
        margin: 0;
    }
    
    .plaque-front {
        padding: 3rem 2rem;
    }
    
    .plaque-heading {
        font-size: 2.1rem;
        margin-bottom: 1.5rem;
    }
    
    .plaque-description {
        font-size: 0.88rem;
        margin-bottom: 2.5rem;
    }
    
    .buttons-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .btn-luxury {
        padding: 0.95rem 1.25rem;
    }
    
    .footer-minimal {
        margin-top: 0;
    }
    
    /* Disable tracking transforms */
    .plaque-frame-back, .plaque-front {
        transform: none !important;
    }
    
    /* Gallery Drawer responsive overrides */
    .drawer-header {
        padding: 1.5rem 2rem;
    }
    
    .drawer-subtitle {
        display: none;
    }
    
    .drawer-content {
        padding: 3rem 1.5rem;
    }
    
    .gallery-title {
        font-size: 2.2rem;
    }
    
    .gallery-filters {
        flex-wrap: wrap;
        gap: 0.75rem 1rem;
        margin-bottom: 3.5rem;
    }
    
    .gallery-grid {
        column-count: 1;
        column-gap: 0;
    }
    
    .gallery-item {
        margin-bottom: 2rem;
    }
    
    .passe-partout {
        padding: 0.75rem;
        height: auto;
    }
    
    .item-overlay {
        opacity: 1; /* Always visible on mobile since there is no hover */
        bottom: 0.75rem;
        left: 0.75rem;
        right: 0.75rem;
        padding: 1rem 0.5rem 0.5rem 0.5rem;
    }
    
    .gallery-outro {
        padding-top: 3.5rem;
    }
    
    .gallery-outro p {
        font-size: 1.2rem;
    }
    
    .btn-gallery-contact {
        padding: 1rem 1.75rem;
        font-size: 0.7rem;
    }
    
    .lightbox-close-btn {
        top: -2.5rem;
        right: 0;
    }
}

@media (max-width: 480px) {
    .logo-title {
        font-size: 1.4rem;
    }
    
    .plaque-heading {
        font-size: 1.8rem;
    }
}

