/* ==========================================
   AUCTION PAGES STYLES
   Silent Auction & Target Raffle Pages
   ========================================== */

/* ==========================================
   PAGE HEADER
   ========================================== */

.page-header {
    position: relative;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2C1810 0%, #5D4037 50%, #3E2723 100%);
    margin-top: 0;
    padding-top: 80px;
    overflow: hidden;
    padding-bottom: 3rem;
}

.header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="2" cy="2" r="1" fill="rgba(212,175,55,0.1)"/></svg>');
    opacity: 0.3;
}

.page-header .container {
    position: relative;
    z-index: 2;
    text-align: center;
}

.page-title {
    font-family: var(--font-heading);
    font-size: 5rem;
    color: var(--color-secondary);
    letter-spacing: 8px;
    margin-bottom: 1rem;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.7);
    animation: fadeInDown 0.8s ease-out;
}

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

.page-subtitle {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--color-light);
    margin-bottom: 1rem;
    font-style: italic;
}

.breadcrumb {
    color: var(--color-light);
    opacity: 0.8;
    margin-top: 1rem;
}

.breadcrumb a {
    color: var(--color-secondary);
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* ==========================================
   FILTER SECTION
   ========================================== */

.filter-section {
    background: var(--color-light);
    padding: 1rem 0;
    border-bottom: 1px solid var(--color-secondary);
    position: sticky;
    top: 80px;
    z-index: 100;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    transition: transform 0.35s ease-out,
                opacity 0.35s ease-out;
}

.filter-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Search Box */
.search-box {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
}

.search-box input {
    width: 100%;
    padding: 0.75rem 3rem 0.75rem 1.25rem;
    font-size: 0.95rem;
    border: 2px solid var(--color-primary);
    border-radius: 50px;
    outline: none;
    transition: var(--transition-smooth);
    background: white;
}

.search-box input:focus {
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}

.search-icon {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    pointer-events: none;
}

/* Category Filters */
.category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.filter-btn {
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid var(--color-primary);
    border-radius: 20px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--color-primary);
    cursor: pointer;
    transition: var(--transition-smooth);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.filter-btn:hover {
    background: var(--color-primary);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(139, 69, 19, 0.25);
}

.filter-btn.active {
    background: var(--color-secondary);
    color: var(--color-dark);
    border-color: var(--color-secondary);
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
}

.filter-btn .count {
    display: inline-block;
    background: rgba(0, 0, 0, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    margin-left: 0.5rem;
    font-size: 0.8rem;
}

.filter-btn.active .count {
    background: rgba(0, 0, 0, 0.2);
}

/* ==========================================
   AUCTION GRID
   ========================================== */

.auction-section {
    padding: 4rem 0;
    background: white;
}

.auction-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* Loading Spinner */
.loading-spinner {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 0;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--color-light);
    border-top: 4px solid var(--color-secondary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================
   AUCTION ITEM CARD
   ========================================== */

.auction-item {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition-smooth);
    cursor: pointer;
    position: relative;
    animation: fadeInScale 0.5s ease-out;
    animation-fill-mode: both;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.auction-item:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.auction-item:hover .item-image img {
    transform: scale(1.1);
}

/* Item Number Badge */
.item-number {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: linear-gradient(135deg, var(--color-secondary), #F4C542);
    color: var(--color-dark);
    font-family: var(--font-heading);
    font-size: 1.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    letter-spacing: 1px;
}

/* Category Badge */
.item-category {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(139, 0, 0, 0.9);
    color: white;
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    z-index: 5;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    backdrop-filter: blur(5px);
}

/* Item Image */
.item-image {
    position: relative;
    width: 100%;
    height: 280px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--color-light) 0%, #E8D4B8 100%);
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.item-image.no-photo {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-light);
    font-size: 1.2rem;
}

.item-image.no-photo::before {
    content: '📦';
    font-size: 4rem;
    opacity: 0.3;
}

/* Item Content */
.item-content {
    padding: 1.5rem;
}

.item-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    color: var(--color-primary);
    margin-bottom: 0.75rem;
    line-height: 1.3;
    font-weight: 700;
}

.item-description {
    color: var(--color-text);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.item-donor {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-text-light);
    font-size: 0.9rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-light);
}

.donor-icon {
    color: var(--color-secondary);
    font-size: 1.1rem;
}

/* View Details Button */
.view-details-btn {
    width: 100%;
    padding: 0.75rem;
    background: linear-gradient(135deg, var(--color-primary), #6D4C41);
    color: white;
    border: none;
    border-radius: 0 0 12px 12px;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: var(--transition-smooth);
    margin-top: 1rem;
}

.view-details-btn:hover {
    background: linear-gradient(135deg, #6D4C41, var(--color-primary));
}

/* ==========================================
   LIGHTBOX
   ========================================== */

.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    cursor: pointer;
}

.lightbox-content {
    position: relative;
    max-width: 1200px;
    max-height: 90vh;
    margin: 2rem;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    animation: lightboxZoom 0.3s ease-out;
}

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

/* Lightbox Header Buttons Container */
.lightbox-header-buttons {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 1rem;
    position: absolute;
    top: 0;
    right: 0;
    z-index: 10;
    gap: 0.75rem;
}

.lightbox-header-buttons .item-category {
    position: static;
    margin: 0;
}

.lightbox-close {
    position: static;
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
    flex-shrink: 0;
}

.lightbox-close:hover {
    background: var(--color-accent);
    transform: rotate(90deg);
}

/* Two-column lightbox body */
.lightbox-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    flex: 1;
    overflow: hidden;
}

.lightbox-image-container {
    background: var(--color-light);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    overflow: hidden;
}

.lightbox-image {
    width: 100%;
    height: 100%;
    max-height: 70vh;
    object-fit: contain;
}

.lightbox-image.no-photo {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-light) 0%, #E8D4B8 100%);
}

.lightbox-info {
    padding: 4rem 2rem 2rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    position: relative;
}

.lightbox-info .item-number {
    position: absolute;
    top: 1rem;
    left: 1rem;
}

.lightbox-title {
    font-family: var(--font-display);
    font-size: 1.6rem;
    color: var(--color-primary);
    margin: 0;
    margin-top: 0.75rem;
    line-height: 1.3;
}

.lightbox-description {
    color: var(--color-text);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
    flex: 1;
}

.lightbox-donor {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-text-light);
    font-size: 0.9rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-light);
}

.lightbox-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding-top: 1rem;
    border-top: 1px solid var(--color-light);
}

.btn-compact {
    padding: 0.65rem 1.25rem;
    font-size: 0.9rem;
    flex: 1;
    min-width: 140px;
    text-align: center;
}

/* ==========================================
   INFO BANNER
   ========================================== */

.info-banner {
    background: linear-gradient(135deg, var(--color-primary) 0%, #6D4C41 100%);
    padding: 3rem 0;
    color: white;
}

.banner-content {
    display: flex;
    align-items: center;
    gap: 2rem;
    justify-content: space-between;
}

.banner-icon {
    font-size: 4rem;
    flex-shrink: 0;
}

.banner-text {
    flex: 1;
}

.banner-text h3 {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--color-secondary);
    margin-bottom: 0.5rem;
}

.banner-text p {
    font-size: 1.1rem;
    line-height: 1.6;
}

.banner-text a {
    color: var(--color-secondary);
    font-weight: 700;
}

.banner-text a:hover {
    text-decoration: underline;
}

/* ==========================================
   BACK TO TOP BUTTON
   ========================================== */

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */

@media (max-width: 968px) {
    .auction-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.5rem;
    }

    .banner-content {
        flex-direction: column;
        text-align: center;
    }

    .filter-section {
        top: 70px;
    }
}

@media (max-width: 768px) {
    .page-header {
        min-height: 250px;
        margin-top: 0;
        padding-top: 70px;
    }

    .page-title {
        font-size: 3.5rem;
        letter-spacing: 4px;
    }

    .page-subtitle {
        font-size: 1.2rem;
    }

    .category-filters {
        gap: 0.5rem;
    }

    .filter-btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }

    .auction-grid {
        grid-template-columns: 1fr;
    }

    .lightbox-content {
        margin: 1rem;
        max-height: 95vh;
    }

    .lightbox-body {
        grid-template-columns: 1fr;
        overflow-y: auto;
    }

    .lightbox-image-container {
        max-height: 40vh;
    }

    .lightbox-info {
        padding: 1.5rem;
    }

    .lightbox-title {
        font-size: 1.3rem;
    }

    .lightbox-description {
        font-size: 0.9rem;
    }

    .lightbox-info {
        padding-top: 5rem;
    }

    .lightbox-title {
        margin-top: 0;
    }

    .banner-text h3 {
        font-size: 1.5rem;
    }

    .banner-icon {
        font-size: 3rem;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 2.5rem;
        letter-spacing: 2px;
    }

    .search-box {
        max-width: 100%;
    }

    .item-image {
        height: 240px;
    }

    .back-to-top {
        width: 45px;
        height: 45px;
        bottom: 1rem;
        right: 1rem;
    }
}

/* Match the shared 2026 type scale and simplify browsing controls. */
.page-header { padding: 3.5rem 0; min-height: 0; }
.page-title { font-size: clamp(2.3rem, 5vw, 3.5rem); line-height: 1.15; letter-spacing: -.025em; font-weight: 600; text-shadow: none; animation: none; }
.page-subtitle { font: 400 1.1rem/1.6 var(--font-body); max-width: 700px; margin: 1rem auto 0; }
.filter-section { position: static; border-bottom: 1px solid #e6d9c7; box-shadow: none; }
.filter-btn { min-height: 44px; font-size: .875rem; letter-spacing: 0; text-transform: none; border-radius: 5px; }
.search-box input { border-radius: 6px; font-size: 1rem; }
.auction-item { border: 1px solid #e8dece; box-shadow: var(--shadow-sm); }
.auction-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.item-title { font-size: 1.35rem; line-height: 1.35; letter-spacing: -.01em; }
.item-number { font-family: var(--font-body); font-variant-numeric: tabular-nums; font-weight: 700; }
.item-image { background: #f6f2ec; }
.info-banner { border-top: 1px solid rgb(212 175 55 / 30%); }
@media (max-width: 600px) {
    .page-header { padding: 2.75rem 0; }
    .category-filters { gap: .5rem; justify-content: flex-start; }
    .filter-btn { padding: .6rem .75rem; }
    .page-subtitle { font-size: 1rem; }
}
/* Native dialog stays in the viewport and provides focus containment. */
dialog.lightbox { width: 100vw; height: 100dvh; max-width: none; max-height: none; border: 0; padding: 1rem; margin: 0; background: transparent; color: var(--color-text); }
dialog.lightbox:not([open]) { display: none; }
dialog.lightbox::backdrop { background: rgb(20 12 8 / 80%); }
dialog.lightbox .lightbox-overlay { background: transparent; }
dialog.lightbox .lightbox-content { width: min(100%, 1050px); max-height: calc(100dvh - 2rem); margin: 0; animation: none; overflow-y: auto; flex-shrink: 0; }
dialog.lightbox .lightbox-header-buttons { position: sticky; top: 0; background: #fffaf1; border-bottom: 1px solid #e6d9c7; padding: .65rem; }
dialog.lightbox .lightbox-close { width: 44px; height: 44px; }
dialog.lightbox .lightbox-body { flex: none; overflow: visible; }
dialog.lightbox .lightbox-info { overflow: visible; padding: 3rem 1.5rem 1.5rem; }
dialog.lightbox .lightbox-image { max-height: 55dvh; }
@media (max-width: 768px) {
    dialog.lightbox .lightbox-body { grid-template-columns: 1fr; }
    dialog.lightbox .lightbox-image-container { max-height: none; min-height: 0; padding: 1rem; }
    dialog.lightbox .lightbox-image { height: auto; max-height: 32dvh; }
}
dialog.lightbox .lightbox-info .item-number { position: static; align-self: flex-start; font-size: .95rem; padding: .35rem .65rem; border-radius: 4px; box-shadow: none; margin-bottom: 0 !important; }
dialog.lightbox .lightbox-info { padding-top: 1.5rem; }
dialog.lightbox .lightbox-title { margin-top: 0; }

/* Browser-rendered state messages; wording comes from Site Settings */
.auction-grid .error-message { grid-column: 1 / -1; text-align: center; padding: 4rem 2rem; }
.auction-grid .error-message h3 { color: var(--color-accent); font-size: 2rem; margin-bottom: 1rem; }
.auction-grid .error-message p { color: var(--color-text-light); font-size: 1.1rem; }
.no-bids-message p + p { margin-top: 1.5rem; }
.no-bids-message a { color: var(--color-secondary); font-weight: 700; }

/* Two categories ("Gift Certificates · Restaurants & Food") wrap instead of sliding under the item number */
.auction-item > .item-category { max-width: calc(100% - 8.5rem); text-align: center; line-height: 1.35; }
