/* =====================================================
   SECTION 06 — ARCHIVE GALLERY STYLING
===================================================== */

.archive-section {
    padding-top: 140px;
    padding-bottom: 120px;
    background-color: var(--red);
    background-position: top center;
    background-repeat: repeat;
    background-size: contain;
    background-image: url("./IMG/Vector.svg");
    position: relative;
}

.archive-ticker {
    background: var(--yellow);
    border-top: 4px solid var(--cream);
    border-bottom: 4px solid var(--cream);
}

.archive-ticker span {
    color: #000;
}

.archive-container {
    max-width: 1200px;
    width: 90%;
    margin: 0 auto 100px auto;
    position: relative;
    z-index: 10;
}

.archive-header {
    text-align: center;
    margin-bottom: 50px;
}

.archive-title-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

.archive-main-title {
    font-family: var(--font-subheading);
    font-size: var(--h1);
    color: var(--yellow);
    letter-spacing: var(--heading-spacing);
    /* text-shadow: 4px 4px 0px #000; */
    /* -webkit-text-stroke: 2px #000; */
}

.btn-admin-toggle {
    background: var(--yellow);
    border: 3px solid #000;
    box-shadow: 3px 3px 0px #000;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #000;
    transition: transform 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
}

.btn-admin-toggle:hover {
    transform: scale(1.05) rotate(45deg);
    box-shadow: 4px 4px 0px #000;
    color: var(--red);
}

.btn-admin-toggle:active {
    transform: scale(0.95);
    box-shadow: 1px 1px 0px #000;
}

.archive-subtitle {
    font-family: var(--font-subheading);
    font-weight: 700;
    font-size: .8rem;
    color: var(--cream);
    max-width: 600px;
    margin: 0 auto;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1.4;
}

/* Pinterest Masonry Grid */
.archive-masonry-grid {
    column-count: 4;
    column-gap: 16px;
    gap: 16px;
    width: 100%;
}

.archive-card {
    break-inside: avoid;
    display: inline-block;
    width: 100%;
    margin-bottom: 16px;
    background-color: var(--green);
    border: 4px solid var(--yellow);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 0 0 4px var(--red);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
}

.archive-card:hover {
    transform: translateY(-6px) scale(1.02);
}

.archive-media-wrapper {
    width: 100%;
    position: relative;
    overflow: hidden;
    background: var(--green);
}

.archive-media {
    width: 100%;
    height: auto;
    display: block;
}

/* Hover Zoom & Fade overlay micro-interactions */
.archive-hover-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 122, 63, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.archive-card:hover .archive-hover-overlay {
    opacity: 1;
}

.archive-hover-caption {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    color: var(--cream);
    text-transform: uppercase;
    text-align: center;
    line-height: 1.3;
    letter-spacing: -0.02em;
    transform: translateY(15px);
    transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.archive-card:hover .archive-hover-caption {
    transform: translateY(0);
}

/* Empty State Message */
.empty-gallery-msg {
    grid-column: 1 / -1;
    font-family: 'Outfit', sans-serif;
    color: var(--cream);
    font-size: 1.2rem;
    padding: 40px;
}

/* Footer layout constraint within archive section */
.footer-container {
    padding-top: 80px;
    border-top: none;
    z-index: 10;
    position: relative;
}

/* Pinterest-style Dynamic Masonry Grid (JS-powered) */
.archive-masonry {
    position: relative;
    width: 100%;
    transition: height 0.4s ease;
}

.archive-masonry .archive-card {
    position: absolute;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        opacity 0.4s ease,
        box-shadow 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
}

.archive-masonry .archive-card.placed {
    opacity: 1;
    transform: translateY(0);
}

.archive-masonry .archive-card:hover {
    transform: translateY(-6px) scale(1.02) !important;
    z-index: 10;
}

.archive-masonry .archive-media-wrapper {
    width: 100%;
    overflow: hidden;
    background: var(--green);
    position: relative;
}

.archive-masonry .archive-media {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease;
}

.archive-masonry .archive-card:hover .archive-media {
    transform: scale(1.05);
}


/* =====================================================
   LIGHTBOX MODAL
===================================================== */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(12px);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
    padding: 40px;
    cursor: zoom-out;
}

.lightbox-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.lightbox-img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border: 4px solid var(--yellow);
    border-radius: 16px;
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: default;
}

.lightbox-overlay.active .lightbox-img {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 24px;
    right: 32px;
    width: 48px;
    height: 48px;
    background: var(--yellow);
    border: 3px solid #000;
    border-radius: 50%;
    box-shadow: 3px 3px 0px #000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    line-height: 1;
    transition: transform 0.2s, box-shadow 0.2s;
    z-index: 10;
}

.lightbox-close:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 4px 4px 0px #000;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    background: var(--yellow);
    border: 3px solid #000;
    border-radius: 50%;
    box-shadow: 3px 3px 0px #000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    line-height: 1;
    transition: transform 0.2s, box-shadow 0.2s;
    z-index: 10;
}

.lightbox-nav:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 4px 4px 0px #000;
}

.lightbox-prev {
    left: 24px;
}

.lightbox-next {
    right: 24px;
}

.lightbox-close img,
.lightbox-nav img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    display: block;
    pointer-events: none;
}

@media (max-width: 767px) {
    .lightbox-overlay {
        padding: 16px;
    }

    .lightbox-nav {
        width: 40px;
        height: 40px;
    }

    .lightbox-prev {
        left: 20px;
    }

    .lightbox-next {
        right: 20px;
    }

    .lightbox-close {
        top: 12px;
        right: 16px;
        width: 40px;
        height: 40px;
    }

    .lightbox-close img,
    .lightbox-nav img {
        width: 18px;
        height: 18px;
    }

    .lightbox-close:hover {
        transform: none;
        box-shadow: 3px 3px 0px #000;
    }

    .lightbox-nav:hover {
        transform: translateY(-50%);
        box-shadow: 3px 3px 0px #000;
    }

    .lightbox-img {
        border-width: 3px;
        border-radius: 12px;
    }
}

/* =====================================================
   ADMIN DASHBOARD MODAL STYLING
===================================================== */

.admin-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.admin-modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.admin-modal-content {
    background: var(--cream);
    border: 6px solid #000;
    box-shadow: 10px 10px 0px #000;
    border-radius: 20px;
    width: 100%;
    max-width: 580px;
    padding: 40px 30px;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.admin-modal-overlay.active .admin-modal-content {
    transform: scale(1);
}

.admin-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2.2rem;
    font-weight: bold;
    background: none;
    border: none;
    cursor: pointer;
    line-height: 1;
    color: #000;
    transition: color 0.15s;
}

.admin-modal-close:hover {
    color: var(--red);
}

/* View Controls */
.admin-view {
    display: none;
    text-align: center;
}

.admin-view.active {
    display: block;
}

.admin-view-title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: var(--red);
    letter-spacing: -0.05em;
    margin-bottom: 8px;
}

.admin-view-desc {
    font-family: 'Outfit', sans-serif;
    color: #444;
    font-size: 0.95rem;
    margin-bottom: 24px;
    line-height: 1.4;
}

/* Tabs */
.admin-tabs {
    display: flex;
    border-bottom: 4px solid #000;
    margin-bottom: 24px;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    font-family: var(--font-heading);
    font-size: 1.15rem;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #666;
    transition: all 0.2s;
}

.tab-btn.active {
    color: #000;
    background: var(--yellow);
    border-top: 4px solid #000;
    border-left: 4px solid #000;
    border-right: 4px solid #000;
    border-bottom: 4px solid var(--cream);
    margin-bottom: -4px;
    border-radius: 8px 8px 0 0;
}

.tab-content {
    display: none;
    text-align: left;
}

.tab-content.active {
    display: block;
}

/* Inputs & Form Groups */
.admin-form-group {
    margin-bottom: 18px;
}

.admin-form-row {
    display: flex;
    gap: 15px;
}

.flex-1 {
    flex: 1;
}

.admin-form-group label {
    display: block;
    font-family: 'Lilita One', 'Cooper Std', sans-serif;
    font-size: 0.95rem;
    color: #000;
    margin-bottom: 6px;
    letter-spacing: 0.02em;
}

.admin-input-text,
.admin-select {
    width: 100%;
    height: 48px;
    border: 3px solid #000;
    border-radius: 8px;
    background: #fff;
    color: #000;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    padding: 0 12px;
    box-sizing: border-box;
    outline: none;
}

.admin-input-text:focus,
.admin-select:focus {
    border-color: var(--red);
}

.admin-input-file {
    width: 100%;
    padding: 8px 0;
    font-family: 'Outfit', sans-serif;
}

/* Form Action Button */
.btn-admin-action {
    display: block;
    width: 100%;
    margin-top: 24px;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    letter-spacing: var(--heading-spacing);
    color: #fff;
    background: var(--red);
    border: 3px solid #000;
    border-radius: 22px;
    corner-shape: squircle;
    box-shadow: 4px 4px 0px #000;
    padding: 14px 20px 10px 20px;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
}

.btn-admin-action:hover {
    transform: translate(-1px, -1px);
    box-shadow: 5px 5px 0px #000;
}

.btn-admin-action:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px #000;
}

/* Items Management List */
.no-items-msg {
    font-family: 'Outfit', sans-serif;
    color: #666;
    text-align: center;
    padding: 30px;
}

.admin-items-table-wrapper {
    max-height: 300px;
    overflow-y: auto;
    border: 3px solid #000;
    border-radius: 8px;
    background: #fff;
}

.admin-items-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
}

.admin-items-table th,
.admin-items-table td {
    padding: 10px;
    border-bottom: 2px solid #ddd;
    text-align: left;
}

.admin-items-table th {
    background: #f0f0f0;
    font-weight: bold;
    color: #000;
    border-bottom: 3px solid #000;
    position: sticky;
    top: 0;
}

.admin-items-table tr:last-child td {
    border-bottom: none;
}


/* =====================================================
   RESPONSIVE MASONRY GRID BREAKPOINTS
===================================================== */

@media (max-width: 991px) {
    .archive-section {
        padding-top: 100px;
        padding-bottom: 80px;
    }

    .archive-main-title {
        font-size: 2.8rem;
    }

    .archive-masonry-grid {
        column-count: 3;
        column-gap: 12px;
    }

    .archive-card {
        margin-bottom: 12px;
        border-width: 3px;
        /* box-shadow: 4px 4px 0px #000; */
    }

    .archive-card:hover {
        transform: none;
        /* Disable 3D transforms on mobile for performance */
    }
}

@media (max-width: 767px) {
    .archive-masonry-grid {
        column-count: 2;
        column-gap: 10px;
    }

    .archive-card {
        margin-bottom: 10px;
        border-radius: 12px;
    }

    .archive-hover-caption {
        font-size: 1rem;
    }

    .btn-admin-action {
        border-radius: 18px;
        corner-shape: squircle;
    }
}

@media (max-width: 479px) {
    .archive-main-title {
        font-size: 2.2rem;
    }

    .archive-masonry-grid {
        column-count: 2;
        /* 2 vertical columns for small mobile phones */
    }
}