/* ============================================================
   P3 Gallery – Frontend Styles
   ============================================================ */

/* ── Main wrappers — NO max-width so hero bleeds full width ── */
.sg-archive-main,
.sg-category-main,
.sg-single-main {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ── Content container — centres everything below the hero ── */
.p3-container {
    max-width: 1410px;
    margin: 0 auto;
    padding: 60px 0px 60px;
    box-sizing: border-box;
}

/* ============================================================
   FULL-WIDTH HERO / PAGE TITLE BANNER
   Used on both archive and single category pages.
   The cover image is set inline via style="background-image:url(…)"
   on the element itself. A fallback dark colour shows when no
   image is set.
   ============================================================ */
.sg-page-title-wrap {
    position: relative;
    width: 100%;
    /* Layout */
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 440px;
    /* Background */
    background-color: #1a1a1a;          /* fallback when no image */
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
    /* Spacing */
    padding-top: 0;
    padding-bottom: 0;
    padding-left: 30px;
    padding-right: 30px;
    /* Push down below fixed/sticky nav if needed */
    margin-bottom: 0;
    box-sizing: border-box;
}

/* Dark overlay so white text is always readable */
.sg-page-title-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.6);
    pointer-events: none;
}

/* Inner wrapper — centres text, sits above overlay */
.sg-page-title-inner {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 900px;
    width: 100%;
}

/* Archive eyebrow inside the hero */
.sg-archive-eyebrow {
    display: block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 12px;
}

/* H1 title inside the hero */
.sg-page-title {
    font-size: clamp(32px, 5vw, 60px);
    font-weight: 700;
    line-height: 1.1;
    margin: 0;
    color: #768D91;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

/* ============================================================
   ARCHIVE PAGE – Category Cards
   ============================================================ */
/* .sg-archive-grid {
    display: grid;
    gap: 20px;
    margin-top: 0;
} */
.sg-archive-grid {
    display: grid;
    gap: 20px;
    padding: 50px 0px;
    margin-top: 0;
}
.sg-archive-grid.sg-cols-2 { grid-template-columns: repeat(2, 1fr); }
.sg-archive-grid.sg-cols-3 { grid-template-columns: repeat(3, 1fr); }
.sg-archive-grid.sg-cols-4 { grid-template-columns: repeat(4, 1fr); }

.sg-cat-card {
    position: relative;
    display: block;
    min-height: 320px;
    background-color: #1a1a1a;
    background-size: cover;
    background-position: center;
    text-decoration: none;
    overflow: hidden;
    border-radius: 4px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.sg-cat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}
.sg-cat-card__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.15) 60%, transparent 100%);
    transition: background 0.3s ease;
}
.sg-cat-card:hover .sg-cat-card__overlay {
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.3) 60%, transparent 100%);
}
.sg-cat-card__content {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 24px 28px;
    color: #fff;
}
.sg-cat-card__title {
    font-size: clamp(20px, 2.5vw, 28px);
    font-weight: 700;
    margin: 0 0 6px;
    line-height: 1.2;
    color: #fff;
}
.sg-cat-card__count {
    display: block;
    font-size: 13px;
    opacity: 0.8;
    margin-bottom: 10px;
    
}
.sg-cat-card__cta {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #fff;
    border-bottom: 2px solid rgba(255,255,255,0.6);
    padding-bottom: 2px;
    transition: border-color 0.2s;
}
.sg-cat-card:hover .sg-cat-card__cta { border-color: #fff; }

/* ============================================================
   SINGLE CATEGORY PAGE – Content block
   ============================================================ */
.sg-content-block {
    margin-bottom: 40px;
    max-width: 860px;
}

.sg-content-block__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #555;
    margin-bottom: 12px;
}
.sg-eyebrow-icon {
    font-size: 16px;
    line-height: 1;
    color: #555;
    display: inline-block;
}
.sg-content-block__heading {
    font-size: clamp(24px, 3.5vw, 40px);
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 16px;
    color: #1a1a1a;
}
.sg-content-block__desc {
    font-size: 15px;
    line-height: 1.7;
    color: #555;
    margin: 0;
    max-width: 820px;
}

/* ── Toolbar / Column Switcher ────────────────────────────── */
.sg-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}
.sg-toolbar__left { display: flex; align-items: center; gap: 8px; }
.sg-toolbar__total { font-size: 13px; color: #888; }
.sg-col-switcher { display: flex; gap: 4px; }
.sg-col-btn {
    width: 36px; height: 36px;
    border: 2px solid #ddd;
    background: #fff;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    color: #555;
}
.sg-col-btn:hover,
.sg-col-btn.active { border-color: #333; background: #333; color: #fff; }

/* ============================================================
   GALLERY GRID
   ============================================================ */
.sg-gallery-grid { display: grid; gap: 20px; }
.sg-gallery-grid.sg-cols-2 { grid-template-columns: repeat(2, 1fr); }
.sg-gallery-grid.sg-cols-3 { grid-template-columns: repeat(3, 1fr); }
.sg-gallery-grid.sg-cols-4 { grid-template-columns: repeat(4, 1fr); }
.sg-gallery-grid.sg-cols-6 { grid-template-columns: repeat(6, 1fr); }

.sg-gallery-item {
    position: relative;
    overflow: hidden; 
    border-radius: 4px;
    background: #f0f0f0;
    aspect-ratio: 1 / 1;
    animation: sg-fade-in 0.4s ease both;
}
.sg-gallery-item a { display: block; width: 100%; height: 100%; text-decoration: none; }
.sg-gallery-item__img {
    width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.4s ease;
}
.sg-gallery-item:hover .sg-gallery-item__img { transform: scale(1.06); }
.sg-gallery-item__caption {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 10px 12px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: #fff;
    font-size: 13px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}
.sg-gallery-item:hover .sg-gallery-item__caption { transform: translateY(0); }

@keyframes sg-fade-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   SINGLE GALLERY POST
   ============================================================ */
.sg-single-wrap { max-width: 900px; margin: 0 auto; }
.sg-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    border-bottom: 2px solid #333;
    padding-bottom: 2px;
    transition: color 0.2s, border-color 0.2s;
}
.sg-back-btn:hover { color: #000; border-color: #000; }

.sg-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #888;
    margin-bottom: 20px;
}
.sg-breadcrumb a { color: #555; text-decoration: none; }
.sg-breadcrumb a:hover { color: #000; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .p3-container { padding: 40px 24px 48px; }
}

@media (max-width: 900px) {
    .sg-archive-grid.sg-cols-4        { grid-template-columns: repeat(2, 1fr); }
    .sg-gallery-grid.sg-cols-4,
    .sg-gallery-grid.sg-cols-6        { grid-template-columns: repeat(3, 1fr); }
    .sg-page-title-wrap               { min-height: 320px; }
}

@media (max-width: 640px) {
    .p3-container                     { padding: 28px 16px 40px; }

    .sg-archive-grid.sg-cols-2,
    .sg-archive-grid.sg-cols-3,
    .sg-archive-grid.sg-cols-4        { grid-template-columns: 1fr; }

    .sg-gallery-grid.sg-cols-2,
    .sg-gallery-grid.sg-cols-3,
    .sg-gallery-grid.sg-cols-4,
    .sg-gallery-grid.sg-cols-6        { grid-template-columns: repeat(2, 1fr); }

    .sg-col-switcher                  { display: none; }
    .sg-content-block__heading        { font-size: 24px; }
    .sg-page-title-wrap               { min-height: 240px; padding-left: 20px; padding-right: 20px; }
    .sg-page-title                    { font-size: clamp(26px, 8vw, 40px); }
}

.sg-toolbar{
    display: none;
}