/* ===========================
   CSS Custom Properties
   =========================== */
:root {
    /* Colors */
    --corkboard-bg: #c9a76a;
    --card-white: #fefef8;
    --text-dark: #2c2c2c;
    --text-light: #666;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --shadow-soft: rgba(0, 0, 0, 0.15);
    --pushpin-red: #c84545;
    --pushpin-brass: #b8860b;
    
    /* Typography */
    --font-script: 'Dancing Script', cursive;
    --font-serif: 'Playfair Display', serif;
    --font-sans: 'Lato', sans-serif;
}

/* ===========================
   Reset & Base Styles
   =========================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    width: 100%;
    position: relative;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
    background: url('assets/images/cork-board.png') center/cover no-repeat fixed;
    position: relative;
    margin: 0;
    padding: 0;
}

/* ===========================
   Wooden Frame Borders
   =========================== */
.frame-top,
.frame-bottom {
    position: fixed;
    left: 0;
    width: 100%;
    height: 40px;
    background: url('assets/images/oak-background.jpeg') center/cover;
    z-index: 100;
    pointer-events: none;
}

.frame-top {
    top: 0;
}

.frame-bottom {
    bottom: 0;
}

.frame-left,
.frame-right {
    position: fixed;
    top: 0;
    width: 40px;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

.frame-left {
    left: 0;
    background: url('assets/images/oak-background.jpeg') center/cover;
    background-size: 100% auto;
    transform: rotate(90deg);
    transform-origin: left top;
    width: 100vh;
    height: 40px;
    top: 0;
    left: 40px;
}

.frame-right {
    background: url('assets/images/oak-background.jpeg') center/cover;
    background-size: 100% auto;
    transform: rotate(90deg);
    transform-origin: left top;
    width: 100vh;
    height: 40px;
    top: 0;
    left: 100vw;
}

/* ===========================
   Corkboard Background
   =========================== */
.corkboard-container {
    min-height: 100vh;
    background: transparent;
    margin: 0;
    padding: 80px 60px 100px;
    box-shadow: none;
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: auto 390px auto;
    grid-template-rows: auto auto;
    gap: 40px;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    justify-content: center;
    align-items: start;
}

/* ===========================
   Navigation
   =========================== */
.nav-pinned {
    display: none !important;
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 12px;
    z-index: 1000;
    flex-wrap: wrap;
}

/* Layout columns */
.photos-left,
.photos-right {
    display: flex;
    flex-direction: column;
    gap: 30px;
    align-items: center;
}

.photos-left {
    grid-column: 1;
    grid-row: 1;
    justify-self: end;
}

.photos-right {
    grid-column: 3;
    grid-row: 1;
    justify-self: start;
}

.photos-bottom {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    justify-content: center;
}

.nav-tab {
    background: var(--card-white);
    color: var(--text-dark);
    padding: 10px 20px;
    text-decoration: none;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 400;
    box-shadow: 
        0 2px 4px var(--shadow-soft),
        0 4px 8px var(--shadow-soft);
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.nav-tab::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    background: var(--pushpin-brass);
    border-radius: 50%;
    box-shadow: 
        inset 0 1px 2px rgba(0,0,0,0.3),
        0 1px 2px rgba(255,255,255,0.5);
}

.nav-tab:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 4px 8px var(--shadow-soft),
        0 8px 16px var(--shadow-soft);
}

/* ===========================
   Card Base Styles
   =========================== */
.card {
    background: var(--card-white);
    padding: 30px;
    box-shadow: 
        0 4px 6px var(--shadow-soft),
        0 8px 20px var(--shadow-color);
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: rotate(0deg) !important;
    box-shadow: 
        0 5px 8px var(--shadow-soft),
        0 10px 20px var(--shadow-color);
    z-index: 10;
}

/* Apply rotation via data attribute */
.card[data-rotation="1"] { transform: rotate(1deg); }
.card[data-rotation="2"] { transform: rotate(2deg); }
.card[data-rotation="3"] { transform: rotate(3deg); }
.card[data-rotation="4"] { transform: rotate(4deg); }
.card[data-rotation="-1"] { transform: rotate(-1deg); }
.card[data-rotation="-2"] { transform: rotate(-2deg); }
.card[data-rotation="-3"] { transform: rotate(-3deg); }
.card[data-rotation="-4"] { transform: rotate(-4deg); }

/* ===========================
   Pushpins
   =========================== */
.pushpin {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    background: var(--pushpin-brass);
    border-radius: 50%;
    box-shadow: 
        inset 0 2px 4px rgba(0,0,0,0.4),
        0 2px 4px rgba(0,0,0,0.3),
        0 1px 2px rgba(255,255,255,0.5);
    z-index: 2;
}

.pushpin::before {
    grid-column: 2;
    grid-rowion: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: radial-gradient(circle, rgba(255,255,255,0.3), transparent);
    border-radius: 50%;
}

.pushpin-red {
    background: var(--pushpin-red);
}

.pushpin-brass {
}

/* ===========================
   Save the Date Card
   =========================== */
.save-the-date {
    width: 100%;
    max-width: 390px;
    margin: 0 auto;
    text-align: center;
    padding: 20px;
    border: 2px solid #000;
    background: #000;
    flex-basis: 100%;
    order: 1;
}

.save-the-date-image {
    width: 100%;
    height: auto;
    display: block;
}

/* ===========================
   Polaroid Cards
   =========================== */
.polaroid {
    padding: 15px 15px 25px;
    background: var(--card-white);
    order: 2;
}

.polaroid-frame {
    width: 100%;
}

.polaroid-photo {
    width: 100%;
    height: 200px;
    display: block;
    object-fit: cover;
}

/* Size variations - all smaller than save-the-date (390px) */
.polaroid.size-small {
    max-width: 180px;
}

.polaroid.size-medium {
    max-width: 240px;
}

.polaroid.size-large {
    max-width: 300px;
}



/* ===========================
   Detail Sections
   =========================== */
.detail-section {
    display: none;
    min-height: 100vh;
    padding: 120px 20px 60px;
    background: var(--card-white);
}

.detail-section:target {
    display: block;
}

.section-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px;
}

.section-content h2 {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    margin-bottom: 30px;
    color: var(--text-dark);
}

.section-content p {
    font-family: var(--font-sans);
    font-size: 1.1rem;
    color: var(--text-light);
    line-height: 1.8;
}

/* ===========================
   Responsive Design
   =========================== */
@media (max-width: 768px) {
    /* Ensure frame borders work on mobile */
    .frame-top,
    .frame-bottom {
        height: 20px;
    }
    
    .frame-left,
    .frame-right {
        height: 20px;
    }
    
    .frame-left {
        left: 20px;
    }
    
    .frame-right {
        left: 100vw;
    }
    
    .corkboard-container {
        padding: 60px 10px 40px;
        gap: 20px;
        grid-template-columns: auto 200px auto;
        margin: 20px;
        min-height: calc(100vh - 40px);
    }
    
    .save-the-date {
        max-width: 200px;
        padding: 10px;
    }
    
    .save-the-date-image {
        width: 100%;
    }
    
    .photos-left,
    .photos-right {
    /* Reduce rotation slightly on mobile */
    .card[data-rotation="3"],
    .card[data-rotation="4"],
    .card[data-rotation="-3"],
    .card[data-rotation="-4"] {
        transform: rotate(2deg);
    }
}

@media (max-width: 480px) {
    .corkboard-container {
        grid-template-columns: auto 160px auto;
        gap: 15px;
        padding: 50px 8px 30px;
    }
    
    .save-the-date {
        max-width: 160px;
        padding: 8px;
    }
    
    .polaroid.size-small {
        max-width: 80px;
    }
    
    .polaroid.size-medium {
        max-width: 100px;
    }
    
    .polaroid.size-large {
        max-width: 120px;
    }
    
    .polaroid-photo {
        height: 90px;
    }
    
    .polaroid {
        padding: 8px 8px 1
    
    .wedding-location {
        font-size: 1.1rem;
    }
    
    .card {
        padding: 25px;
    }
    
    .polaroid {
        padding: 15px 15px 50px;
    }
    
    /* Reduce rotation on mobile for better readability */
    .card[data-rotation="3"],
    .card[data-rotation="4"],
    .card[data-rotation="-3"],
    .card[data-rotation="-4"] {
        transform: rotate(2deg);
    }
    
    .card[data-rotation="3"]:hover,
    .card[data-rotation="4"]:hover,
    .card[data-rotation="-3"]:hover,
    .card[data-rotation="-4"]:hover {
        transform: rotate(0deg) !important;
    }
}

@media (max-width: 480px) {
    .couple-names {
        font-size: 2rem;
    }
    
    .wedding-date {
        font-size: 1.2rem;
    }
    
    .wedding-location {
        font-size: 1rem;
    }
    
    .save-text {
        font-size: 0.85rem;
        letter-spacing: 2px;
    }
}

/* ===========================
   Accessibility
   =========================== */
@media (prefers-reduced-motion: reduce) {
    .card,
    .nav-tab {
        transition: none;
    }
    
    .card:hover {
        transform: none !important;
    }
}

/* Focus states for accessibility */
.nav-tab:focus,
.card:focus {
    outline: 3px solid var(--pushpin-brass);
    outline-offset: 4px;
}

/* ===========================
   Print Styles
   =========================== */
@media print {
    .nav-pinned {
        display: none;
    }
    
    .corkboard-container {
        background: white;
        padding: 20px;
    }
    
    .card {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* ===========================
   Lightbox
   =========================== */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 999999;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: auto;
}

.lightbox-content img {
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
    display: block;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: fixed;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.6);
    color: white;
    font-size: 2.5rem;
    font-weight: 300;
    cursor: pointer;
    padding: 15px 25px;
    transition: all 0.3s ease;
    z-index: 1000000;
    line-height: 1;
    margin: 0;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.9);
}

.lightbox-close {
    top: 30px;
    right: 30px;
    left: auto;
    bottom: auto;
}

.lightbox-prev {
    left: 30px;
    top: 50%;
    right: auto;
    bottom: auto;
    transform: translateY(-50%);
}

.lightbox-next {
    right: 30px;
    top: 50%;
    left: auto;
    bottom: auto;
    transform: translateY(-50%);
}

/* Make images clickable */
.polaroid-photo,
.save-the-date-image {
    cursor: pointer;
    transition: opacity 0.2s ease;
    position: relative;
    z-index: 2;
    pointer-events: auto;
}

.polaroid-photo:hover,
.save-the-date-image:hover {
    opacity: 0.9;
}

/* Desktop image expansion */
.image-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    z-index: 999999;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.image-overlay.active {
    display: flex;
}

.image-overlay img {
    max-width: 70vw;
    max-height: 80vh;
    width: auto;
    height: auto;
    object-fit: contain;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.8);
    border-radius: 4px;
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.image-overlay-close {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    color: white;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    z-index: 1000000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.image-overlay-close:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.9);
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .lightbox-close,
    .lightbox-prev,
    .lightbox-next {
        font-size: 2rem;
        padding: 8px 15px;
    }
    
    .lightbox-close {
        top: 10px;
        right: 10px;
        padding: 4px 15px;
    }
    
    .lightbox-prev {
        left: 10px;
    }
    
    .lightbox-next {
        right: 10px;
    }
}
