/*
Theme Name: Astra Child
Template: astra
*/

/* --- 1. GLOBAL VARIABLES (Professional Palette) --- */
:root {
    --gold: #B8956B;
    --gold-dark: #8B6914;
    --dark: #0F1419;
    --cream: #F7F5F2;
    --white: #FFFFFF;
    --text-main: #1A1A1A;
    --text-muted: #6B6560;
}

/* Hebrew-capable fallbacks: Heebo (Latin + Hebrew), then system Hebrew fonts */
body {
    font-family: 'Outfit', 'Heebo', 'Frank Ruhl Libre', 'David', sans-serif;
    color: var(--text-main);
    background-color: var(--white);
}

h1, h2, h3, h4, h5, .card-title {
    font-family: 'Cormorant Garamond', 'Heebo', 'Frank Ruhl Libre', 'David', 'Times New Roman', serif;
    font-weight: 600;
}

/* Elements that may contain Hebrew/Yiddish – Heebo as primary */
.torah-hebrew-fallback,
.lot-description,
.desc-content,
.rlc-title.torah-hebrew-fallback {
    font-family: "Heebo", sans-serif;
    font-optical-sizing: auto;
    font-style: normal;
}

/* =========================================
   2. CATALOG GRID & CARD SIZES
   ========================================= */

/* --- GRID LAYOUT: 2 ITEMS PER ROW --- */
.rich-catalog-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr) !important; /* Forces 2 columns */
    gap: 40px; /* Generous spacing for luxury feel */
}

/* On Mobile, stack them 1 per row */
@media (max-width: 768px) {
    .rich-catalog-grid {
        grid-template-columns: 1fr !important;
    }
}

/* (Card image sizes are set via .rlc-image-box aspect-ratio and .torah-auction-card-custom override below) */

/* --- AUCTION HEADER --- */
.rich-auction-header {
    background: var(--dark);
    color: #fff;
    padding: 40px 28px 32px;
    text-align: center;
}
.rah-title {
    font-family: "Heebo", sans-serif;
    font-optical-sizing: auto;
    font-size: clamp(1.6rem, 3.5vw, 2.4rem);
    font-weight: 500;
    color: #fff;
    margin: 0 0 8px;
}
.rah-meta {
    color: rgba(255,255,255,0.55);
    font-size: 14px;
}
.rah-meta i { margin-right: 6px; }

/* --- CATALOG LAYOUT --- */
.catalog-layout-flex {
    display: flex;
    gap: 40px;
    max-width: 1320px;
    margin: 0 auto;
}
.catalog-main {
    flex: 1;
    min-width: 0;
}

/* --- LOT CARD --- */
.rich-lot-card {
    background: var(--white);
    border: 1px solid #E8E4DF;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.rich-lot-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 14px 36px rgba(0,0,0,0.09);
    border-color: #d4cfc8;
}

/* Custom wide layout card (3.5"H × 10"W) */
.torah-auction-card-custom .rich-lot-card {
    display: grid;
    grid-template-columns: 320px 1fr;
    grid-template-rows: auto;
}
.torah-auction-card-custom .rlc-lot-number {
    grid-column: 1 / -1;
}
.torah-auction-card-custom .rlc-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Lot number badge */
.rlc-lot-number {
    padding: 10px 16px 0;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--gold-dark);
}

/* --- IMAGE BOX --- */
/* Default card: 4.5"H × 6"W → aspect-ratio 6:4.5 (landscape) */
.rlc-image-box {
    width: 100%;
    position: relative;
    background: var(--cream);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 6 / 4.5;
}
/* Custom card: 3.5"H × 10"W → aspect-ratio 10:3.5 (wide landscape) */
.torah-auction-card-custom .rlc-image-box {
    aspect-ratio: 10 / 3.5;
}
.rlc-image-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.5s ease;
}
.rich-lot-card:hover .rlc-image-box img {
    transform: scale(1.05);
}

/* Two-image hover effect (default-size cards only) */
.rich-lot-card.rlc-two-images .rlc-image-box {
    position: relative;
}
.rich-lot-card.rlc-two-images .rlc-image-box img {
    position: absolute;
    inset: 0;
    transition: opacity 0.35s ease;
}
.rich-lot-card.rlc-two-images .rlc-image-box .rlc-img-default {
    opacity: 1;
    z-index: 1;
}
.rich-lot-card.rlc-two-images .rlc-image-box .rlc-img-hover {
    opacity: 0;
    z-index: 0;
}
.rich-lot-card.rlc-two-images:hover .rlc-image-box .rlc-img-default {
    opacity: 0;
}
.rich-lot-card.rlc-two-images:hover .rlc-image-box .rlc-img-hover {
    opacity: 1;
}
.rich-lot-card.rlc-two-images:hover .rlc-image-box img {
    transform: none;
}

/* --- CARD INFO --- */
.rlc-info {
    padding: 16px 18px 20px;
}
.rlc-title {
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--text-main);
    margin: 0 0 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.7em;
}
.rlc-divider {
    height: 1px;
    background: #E8E4DF;
    margin-bottom: 12px;
}
.rlc-stats {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12px;
}
.rlc-bid-col, .rlc-est-col {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.rlc-est-col { text-align: right; }
.rlc-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--text-muted);
}
.rlc-price {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--gold-dark);
}
.rlc-est-val {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    color: var(--text-muted);
}
.rlc-price-sold {
    color: #2E7D32;
}
.rlc-price-leading {
    color: #C62828;
}

/* Search bar in catalog */
.torah-catalog-search {
    position: relative;
    flex: 1;
    max-width: 320px;
}
.torah-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 13px;
    pointer-events: none;
}
.torah-search-input {
    width: 100%;
    padding: 9px 14px 9px 36px;
    border: 1px solid #E8E4DF;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Outfit', 'Heebo', sans-serif;
    background: #fff;
    transition: border-color 0.2s;
}
.torah-search-input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(184,149,107,0.12);
}

/* Responsive cards */
@media (max-width: 768px) {
    .torah-auction-card-custom .rich-lot-card {
        grid-template-columns: 1fr;
    }
}

/* --- 3. PAST AUCTIONS GRID (Ice Cards) --- */
.past-auctions-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    padding: 40px 0;
}

.auction-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 4px;
    overflow: hidden;
    transition: 0.3s;
    box-shadow: 0 5px 15px rgba(0,0,0,0.03);
    cursor: pointer;
}

.auction-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.08);
}

.ac-img {
    height: 220px;
    overflow: hidden;
    background: #f4f4f4;
}

.ac-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ac-body {
    padding: 25px;
    text-align: center;
}

.ac-body h3 {
    font-size: 20px;
    margin: 0 0 10px 0;
    color: var(--dark);
}

.ac-date {
    display: block;
    font-size: 13px;
    color: var(--gold-dark);
    margin-bottom: 20px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.btn-view {
    display: inline-block;
    padding: 10px 25px;
    border: 1px solid var(--dark);
    color: var(--dark);
    text-decoration: none;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 1px;
    font-weight: 600;
    transition: 0.3s;
}

.btn-view:hover {
    background: var(--dark);
    color: var(--white);
}

/* Hide "Powered by Astra" footer text */
.ast-small-footer, .site-footer .ast-row .ast-small-footer-section-1,
.site-footer .ast-small-footer-section-2 { display: none !important; }
.ast-footer-copyright { display: none !important; }

/* Site-wide contact footer */
.torah-site-footer {
    background: #0F1419;
    color: #fff;
    padding: 52px 0 40px;
    text-align: center;
    border-top: 1px solid rgba(184,149,107,0.15);
}
.torah-site-footer-inner {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 28px;
}
.torah-site-footer a {
    color: #B8956B;
    text-decoration: none;
    transition: color 0.2s;
}
.torah-site-footer a:hover { color: #D4B896; }
.torah-site-footer p {
    margin: 0 0 8px;
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
}
.torah-sf-brand {
    font-size: 11px !important;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.35) !important;
    margin-bottom: 16px !important;
}
.torah-sf-divider {
    width: 40px;
    height: 1px;
    background: rgba(184,149,107,0.4);
    margin: 20px auto;
}
.torah-sf-tagline {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    color: rgba(255,255,255,0.45) !important;
    font-size: 1rem !important;
    margin-top: 16px !important;
}

/* --- 4. RESPONSIVE --- */
@media (max-width: 1024px) {
    .past-auctions-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .past-auctions-grid { grid-template-columns: 1fr; }
}

/* =========================================
   5. SITE HEADER – Premium Dark Bar
   ========================================= */

/* Dark header background */
.ast-primary-header,
.site-header,
.main-header-bar {
    background: #0F1419 !important;
    border-bottom: 1px solid rgba(184, 149, 107, 0.15) !important;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.15) !important;
}

/* Site title / logo — gold */
.site-title a,
.site-title,
.ast-site-identity .site-title a {
    color: #B8956B !important;
    font-family: 'Cormorant Garamond', serif !important;
    font-weight: 700 !important;
    letter-spacing: 1px !important;
    text-transform: uppercase !important;
}

/* Nav links — light with gold hover */
.main-header-menu > .menu-item > a,
.main-header-menu .menu-item > .menu-link,
.ast-header-custom-item a,
.main-navigation a {
    color: rgba(255, 255, 255, 0.85) !important;
    font-family: 'Outfit', sans-serif !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    text-transform: uppercase !important;
    letter-spacing: 1.8px !important;
    transition: color 0.2s ease !important;
}
.main-header-menu > .menu-item > a:hover,
.main-header-menu .menu-item > .menu-link:hover,
.main-header-menu .current-menu-item > a {
    color: #B8956B !important;
}

/* Login / Account button — refined gold pill */
.torah-header-account {
    margin-left: 12px;
}
.torah-header-login-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 20px;
    background: transparent;
    border: 1.5px solid rgba(184, 149, 107, 0.5);
    color: #B8956B !important;
    text-decoration: none;
    font-family: 'Outfit', sans-serif;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    border-radius: 9999px;
    transition: all 0.25s ease;
}
.torah-header-login-link:hover {
    background: #B8956B;
    color: #0F1419 !important;
    border-color: #B8956B;
    box-shadow: 0 4px 16px rgba(184, 149, 107, 0.3);
    transform: translateY(-1px);
}
.torah-header-login-link .fas {
    font-size: 12px;
}
@media (max-width: 768px) {
    .torah-header-login-text { display: none; }
    .torah-header-login-link { padding: 8px 14px; }
}

/* Mobile menu — dark */
.ast-mobile-header-wrap .ast-button-wrap .menu-toggle,
.ast-header-break-point .ast-mobile-menu-buttons-minimal .menu-toggle {
    color: #B8956B !important;
}
.ast-mobile-popup-drawer .ast-mobile-popup-inner,
.ast-mobile-header-content {
    background: #0F1419 !important;
}
.ast-mobile-popup-drawer .menu-item > a,
.ast-mobile-header-content .menu-item > a {
    color: rgba(255, 255, 255, 0.85) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

/* --- 6. AUCTION CATALOG: per-page controls + hide duplicate plugin lot list --- */
.torah-catalog-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
}
.torah-per-page-form {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.torah-per-page-form label { font-weight: 600; font-size: 13px; }
.torah-per-page-select {
    padding: 8px 12px;
    border: 1px solid var(--border, #E8E4DF);
    border-radius: 6px;
    font-size: 14px;
    min-width: 80px;
}
/* Hide plugin-injected duplicate lot list (gold “Leading bid” / watchlist style) so only server-rendered cards show */
#catalog-section.torah-catalog-server .bp-lot,
#catalog-section .bp-lot {
    display: none !important;
}

/* --- 7. HEBREW FONTS (see README / comment below) --- */
/* Backup fonts for Hebrew: Heebo & Frank Ruhl Libre (Google Fonts) are loaded in functions.php.
   Elements with .torah-hebrew-fallback use them so Hebrew text does not render as boxes.
   If Hebrew still looks garbled: (1) Ensure page charset is UTF-8 (WP default). (2) Ensure
   lot title/description content is saved in UTF-8 in the CMS. (3) Add lang="he" to container
   if needed for bidi. */
.rlc-title, .rlc-info .torah-hebrew-fallback {
    font-family: "Heebo", sans-serif;
    font-optical-sizing: auto;
    font-style: normal;
}

/* =========================================
   8. SINGLE LOT DETAIL PAGE
   ========================================= */

.torah-lot-page {
    background: var(--cream);
    min-height: 100vh;
}

/* --- Top bar --- */
.torah-lot-topbar {
    background: var(--white);
    border-bottom: 1px solid #E8E4DF;
    padding: 0 24px;
}
.torah-lot-topbar-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}
.torah-lot-back {
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--gold-dark);
    text-decoration: none;
    transition: color 0.2s;
}
.torah-lot-back:hover { color: var(--dark); }
.torah-lot-back span { margin-right: 6px; }

.torah-lot-nav {
    display: flex;
    gap: 8px;
}
.torah-lot-nav-btn {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--text-muted);
    text-decoration: none;
    padding: 6px 14px;
    border: 1px solid #E8E4DF;
    border-radius: 4px;
    transition: 0.2s;
}
.torah-lot-nav-btn:hover {
    border-color: var(--gold);
    color: var(--gold-dark);
}

/* --- Two-column layout --- */
.torah-lot-container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 48px 24px 80px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: start;
}

/* --- Gallery (left) --- */
.torah-lot-gallery {
    position: sticky;
    top: 24px;
}
.torah-lot-main-img {
    position: relative;
    background: var(--white);
    border: 1px solid #E8E4DF;
    border-radius: 6px;
    overflow: hidden;
    cursor: zoom-in;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 480px;
}
.torah-lot-main-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.4s ease;
}
.torah-lot-main-img:hover img {
    transform: scale(1.03);
}
.torah-lot-enlarge {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px;
    background: linear-gradient(transparent, rgba(0,0,0,0.45));
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s;
}
.torah-lot-main-img:hover .torah-lot-enlarge {
    opacity: 1;
}

/* Thumbnails */
.torah-lot-thumbs {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    overflow-x: auto;
    padding-bottom: 4px;
}
.torah-lot-thumb {
    flex: 0 0 72px;
    height: 72px;
    border: 2px solid #E8E4DF;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s;
    background: var(--white);
}
.torah-lot-thumb.active {
    border-color: var(--gold);
}
.torah-lot-thumb:hover {
    border-color: var(--gold-dark);
}
.torah-lot-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- Details (right) --- */
.torah-lot-details-inner {
    position: sticky;
    top: 24px;
}
.torah-lot-number {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--gold-dark);
    margin-bottom: 12px;
}
.torah-lot-title {
    font-family: "Heebo", sans-serif;
    font-optical-sizing: auto;
    font-size: 32px;
    font-weight: 600;
    line-height: 1.25;
    color: var(--text-main);
    margin: 0 0 28px 0;
}

/* Bid box */
.torah-lot-bid-box {
    background: var(--white);
    border: 1px solid #E8E4DF;
    border-radius: 6px;
    padding: 28px;
    margin-bottom: 32px;
}
.torah-lot-price-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 16px;
}
.torah-lot-price-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
}
.torah-lot-price-value {
    font-family: 'Cormorant Garamond', serif;
    font-size: 36px;
    font-weight: 700;
    color: var(--gold-dark);
    line-height: 1;
}
.torah-lot-estimate {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 16px;
    border-top: 1px solid #f0ece7;
    margin-bottom: 16px;
    font-size: 15px;
    color: var(--text-muted);
}
.torah-lot-bid-box .bp-from {
    margin-top: 20px;
}
.torah-lot-bid-box .bp-control__title {
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 12px;
}

/* Description */
.torah-lot-description {
    border-top: 1px solid #E8E4DF;
    padding-top: 28px;
}
.torah-lot-desc-heading {
    font-family: "Heebo", sans-serif;
    font-optical-sizing: auto;
    font-size: 22px;
    font-weight: 600;
    margin: 0 0 16px 0;
    color: var(--text-main);
}
.torah-lot-desc-body {
    font-family: "Heebo", sans-serif;
    font-optical-sizing: auto;
    font-style: normal;
    line-height: 1.8;
    font-size: 15px;
    color: #444;
}
.torah-lot-desc-body p {
    margin-bottom: 14px;
}

/* --- Lightbox --- */
.torah-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(10, 10, 10, 0.92);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    flex-direction: column;
}
.torah-lightbox.open {
    display: flex;
}
.torah-lightbox-close {
    position: absolute;
    top: 20px;
    right: 28px;
    font-size: 36px;
    color: #fff;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 10;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.torah-lightbox-close:hover { opacity: 1; }

.torah-lightbox-body {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80vw;
    height: 82vh;
}
.torah-lightbox-body img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
}
.torah-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    font-size: 24px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    z-index: 5;
}
.torah-lb-prev { left: -70px; }
.torah-lb-next { right: -70px; }
.torah-lightbox-nav:hover {
    background: rgba(255,255,255,0.25);
}
.torah-lightbox-counter {
    color: rgba(255,255,255,0.6);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 2px;
    margin-top: 16px;
}

/* --- Responsive --- */
@media (max-width: 960px) {
    .torah-lot-container {
        grid-template-columns: 1fr;
        gap: 32px;
        padding: 24px 16px 60px;
    }
    .torah-lot-gallery {
        position: static;
    }
    .torah-lot-details-inner {
        position: static;
    }
    .torah-lot-title {
        font-size: 26px;
    }
}
@media (max-width: 960px) {
    .torah-lot-main-img { height: 420px; }
    .torah-lb-prev { left: 8px; }
    .torah-lb-next { right: 8px; }
    .torah-lightbox-body { width: 94vw; }
}
@media (max-width: 600px) {
    .torah-lot-topbar-inner {
        flex-direction: column;
        height: auto;
        padding: 12px 0;
        gap: 8px;
    }
    .torah-lot-main-img {
        height: 300px;
    }
    .torah-lot-thumb {
        flex: 0 0 56px;
        height: 56px;
    }
    .torah-lot-price-value {
        font-size: 28px;
    }
    .torah-lightbox-nav { width: 40px; height: 40px; font-size: 18px; }
    .torah-lb-prev { left: 4px; }
    .torah-lb-next { right: 4px; }
}