/* ============================================================
   TheHomesNG Gallery — Frontend Styles
   Author: Idakwo Emmanuel | idakwoei@gmail.com
   ============================================================ */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&family=Playfair+Display:wght@500;600;700&display=swap');

:root {
    --thng-primary:       #000a1e;
    --thng-secondary:     #735c00;
    --thng-gold:          #e9c349;
    --thng-surface:       #f9f9f9;
    --thng-on-surface:    #1a1c1c;
    --thng-muted:         #44474e;
    --thng-border:        rgba(115,92,0,.2);
    --thng-overlay-from:  rgba(0,10,30,.85);
    --thng-radius:        4px;
    --thng-gap:           20px;
    --thng-transition:    .4s ease;
}

/* Wrapper */
.thng-gallery-wrap {
    font-family: 'Montserrat', sans-serif;
    color: var(--thng-on-surface);
    background: var(--thng-surface);
    padding: 40px 20px 60px;
    box-sizing: border-box;
    max-width: 1280px;
    margin: 0 auto;
}

/* ---- Hero ---- */
.thng-hero { margin-bottom: 48px; }
.thng-label {
    font-size: 12px;
    letter-spacing: .1em;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--thng-secondary);
    display: block;
    margin-bottom: 12px;
}
.thng-display {
    font-family: 'Playfair Display', serif;
    font-size: clamp(32px, 6vw, 64px);
    line-height: 1.1;
    font-weight: 700;
    color: var(--thng-primary);
    margin: 0 0 16px;
    letter-spacing: -.02em;
}
.thng-subtitle {
    font-size: clamp(15px, 2vw, 18px);
    line-height: 1.65;
    color: var(--thng-muted);
    max-width: 680px;
    margin: 0;
}
.thng-rule {
    width: 96px;
    height: 4px;
    background: var(--thng-gold);
    margin-top: 32px;
    border-radius: 2px;
}

/* ---- Grid ---- */
.thng-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--thng-gap);
    margin-bottom: 48px;
}

/* All cards equal width & height */
.thng-card {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid var(--thng-border);
    border-radius: var(--thng-radius);
    height: 300px;
    background: #111;
    outline: none;
}

.thng-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .7s ease;
    will-change: transform;
}
.thng-card:hover img,
.thng-card:focus img {
    transform: scale(1.06);
}

/* Overlay */
.thng-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 24px;
    background: linear-gradient(to top, rgba(0,10,30,.82) 0%, transparent 55%);
    opacity: 0;
    transition: opacity var(--thng-transition);
}
.thng-card:hover .thng-overlay,
.thng-card:focus .thng-overlay {
    opacity: 1;
}
.thng-cat {
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--thng-gold);
    font-weight: 600;
    margin-bottom: 6px;
    display: block;
}
.thng-card-title {
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 6px;
    line-height: 1.3;
}
.thng-card-hint {
    font-size: 12px;
    color: rgba(255,255,255,.65);
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 0;
}

/* Focus ring for accessibility */
.thng-card:focus-visible {
    box-shadow: 0 0 0 3px var(--thng-gold);
}

/* ---- Empty ---- */
.thng-empty {
    text-align: center;
    color: var(--thng-muted);
    padding: 60px 0;
}

/* ---- Pagination ---- */
.thng-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 48px;
    flex-wrap: wrap;
}
.thng-page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--thng-border);
    border-radius: var(--thng-radius);
    font-size: 14px;
    font-weight: 600;
    color: var(--thng-primary);
    text-decoration: none;
    transition: background var(--thng-transition), color var(--thng-transition), border-color var(--thng-transition);
    font-family: 'Montserrat', sans-serif;
}
.thng-page:hover {
    background: var(--thng-gold);
    border-color: var(--thng-gold);
    color: var(--thng-primary);
}
.thng-page--active {
    background: var(--thng-primary);
    border-color: var(--thng-primary);
    color: #fff;
    pointer-events: none;
}
.thng-page-info {
    font-size: 13px;
    color: var(--thng-muted);
    margin-left: 8px;
}

/* ---- CTA Bar ---- */
.thng-cta-bar {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 40px 0;
    border-top: 1px solid var(--thng-border);
    border-bottom: 1px solid var(--thng-border);
    flex-wrap: wrap;
}
.thng-cta-title {
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    font-weight: 600;
    color: var(--thng-primary);
    margin: 0 0 6px;
}
.thng-cta-sub {
    font-size: 14px;
    color: var(--thng-muted);
    margin: 0;
}
.thng-cta-btn {
    display: inline-block;
    background: var(--thng-primary);
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    padding: 16px 36px;
    text-decoration: none;
    border-radius: var(--thng-radius);
    transition: background var(--thng-transition);
    white-space: nowrap;
}
.thng-cta-btn:hover {
    background: var(--thng-secondary);
    color: #fff;
}

/* ================================================================
   Lightbox
   ================================================================ */
.thng-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.thng-lightbox[hidden] { display: none; }

.thng-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,10,30,.92);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    cursor: zoom-out;
}
.thng-lightbox__inner {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 16px;
    width: 100%;
    max-width: 1100px;
    z-index: 1;
}

.thng-lb-img-wrap {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}
#thng-lb-img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: var(--thng-radius);
    display: block;
    box-shadow: 0 32px 80px rgba(0,0,0,.6);
    object-fit: contain;
    transition: opacity .25s ease;
}
.thng-lb-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    display: none;
}
.thng-lb-loader::after {
    content: '';
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255,255,255,.2);
    border-top-color: var(--thng-gold);
    border-radius: 50%;
    animation: thng-spin .7s linear infinite;
}
@keyframes thng-spin { to { transform: rotate(360deg); } }

/* Nav buttons */
.thng-lb-close,
.thng-lb-prev,
.thng-lb-next {
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.18);
    color: #fff;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--thng-transition);
    flex-shrink: 0;
}
.thng-lb-close:hover,
.thng-lb-prev:hover,
.thng-lb-next:hover {
    background: var(--thng-gold);
    border-color: var(--thng-gold);
    color: var(--thng-primary);
}
.thng-lb-close {
    position: absolute;
    top: -60px;
    right: 0;
}
/* Caption */
.thng-lb-caption {
    position: absolute;
    bottom: -52px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}
.thng-lb-cap-cat {
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--thng-gold);
    font-weight: 600;
}
.thng-lb-cap-title {
    font-family: 'Playfair Display', serif;
    font-size: 16px;
    color: rgba(255,255,255,.9);
    font-weight: 600;
}
.thng-lb-counter {
    font-size: 12px;
    color: rgba(255,255,255,.45);
    margin-left: 6px;
}

/* ================================================================
   Responsive
   ================================================================ */

/* Tablet: 768–1023px */
@media (max-width: 1023px) {
    .thng-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Mobile: up to 767px */
@media (max-width: 767px) {
    .thng-gallery-wrap { padding: 24px 16px 48px; }

    .thng-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .thng-card { height: 200px; }

    .thng-lb-prev,
    .thng-lb-next { display: none; }

    .thng-lightbox__inner { padding: 0 8px; }

    .thng-cta-bar { flex-direction: column; align-items: flex-start; }
    .thng-cta-btn { width: 100%; text-align: center; }
}

/* Very small screens */
@media (max-width: 420px) {
    .thng-grid { grid-template-columns: 1fr; }
    .thng-card { height: 240px; }
}
