/* ═══════════════════════════════════════════════
   CBG Popups Portfolio — Frontend Styles v2.0.0
   ═══════════════════════════════════════════════ */

:root {
    --cbg-accent:      #0597AE;
    --cbg-accent-rgb:  5, 151, 174;
    --cbg-dark:        #22414B;
    --cbg-darker:      #244C5A;
    --cbg-heading-ff:  inherit;
    --cbg-body-ff:     inherit;

    --cbg-card-radius:  14px;
    --cbg-img-ratio:    62.5%;
    --cbg-gap:          28px;
    --cbg-shadow:       0 2px 12px rgba(0,0,0,0.06), 0 8px 32px rgba(0,0,0,0.04);
    --cbg-shadow-hover: 0 4px 20px rgba(0,0,0,0.10), 0 16px 48px rgba(0,0,0,0.08);
    --cbg-transition:   0.22s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ── GRID ────────────────────────────────────────── */
.cbg-pp-grid {
    display: grid;
    gap: var(--cbg-gap);
    width: 100%;
    box-sizing: border-box;
}

.cbg-pp-cols-1 { grid-template-columns: minmax(0, 640px); }
.cbg-pp-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cbg-pp-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cbg-pp-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ── CARD BASE ───────────────────────────────────── */
.cbg-pp-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: var(--cbg-card-radius);
    overflow: hidden;
    position: relative;
    transition: transform var(--cbg-transition), box-shadow var(--cbg-transition);
    margin: 0;
}

.cbg-pp-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--cbg-accent), var(--cbg-dark));
    z-index: 2;
    opacity: 0;
    transition: opacity var(--cbg-transition);
}

.cbg-pp-card:hover::before { opacity: 1; }

.cbg-pp-card-shadow .cbg-pp-card {
    box-shadow: var(--cbg-shadow);
    border: none;
}
.cbg-pp-card-shadow .cbg-pp-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--cbg-shadow-hover);
}

.cbg-pp-card-border .cbg-pp-card {
    border: 1.5px solid #e5e8ec;
    box-shadow: none;
}
.cbg-pp-card-border .cbg-pp-card:hover {
    transform: translateY(-4px);
    border-color: var(--cbg-accent);
    box-shadow: 0 8px 32px rgba(var(--cbg-accent-rgb), 0.12);
}

.cbg-pp-card-flat .cbg-pp-card {
    border: 1px solid #ebebeb;
    box-shadow: none;
}
.cbg-pp-card-flat .cbg-pp-card:hover {
    border-color: var(--cbg-accent);
    background: rgba(var(--cbg-accent-rgb), 0.02);
}

/* ── CARD IMAGE ──────────────────────────────────── */
.cbg-pp-card-img-wrap {
    display: block;
    position: relative;
    width: 100%;
    padding-top: var(--cbg-img-ratio);
    overflow: hidden;
    background: #f0f4f6;
    flex-shrink: 0;
}

.cbg-pp-card-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: block;
}

.cbg-pp-card:hover .cbg-pp-card-img { transform: scale(1.04); }

.cbg-pp-card-img-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #f0f4f6 0%, #e8edf0 100%);
    color: #aab4bb;
    font-size: 13px;
    font-family: var(--cbg-body-ff);
    letter-spacing: 0.02em;
}

/* ── CARD BODY ───────────────────────────────────── */
.cbg-pp-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 22px 24px 24px;
    gap: 0;
}

/* ── TAGS ────────────────────────────────────────── */
.cbg-pp-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.cbg-pp-tag {
    display: inline-block;
    background: rgba(var(--cbg-accent-rgb), 0.10);
    color: var(--cbg-accent);
    border: 1px solid rgba(var(--cbg-accent-rgb), 0.20);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 4px;
    font-family: var(--cbg-body-ff);
    white-space: nowrap;
    line-height: 1.6;
}

/* ── CARD TITLE ──────────────────────────────────── */
.cbg-pp-card-title {
    margin: 0 0 10px;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.01em;
    font-family: var(--cbg-heading-ff);
}

.cbg-pp-card-title a {
    color: var(--cbg-dark);
    text-decoration: none;
    transition: color var(--cbg-transition);
}

.cbg-pp-card-title a:hover { color: var(--cbg-accent); }

/* ── BRIEF ───────────────────────────────────────── */
.cbg-pp-card-brief {
    margin: 0 0 18px;
    font-size: 13.5px;
    line-height: 1.7;
    color: #677280;
    font-family: var(--cbg-body-ff);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── READ MORE ───────────────────────────────────── */
.cbg-pp-read-more {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: auto;
    font-size: 13px;
    font-weight: 700;
    font-family: var(--cbg-body-ff);
    color: var(--cbg-accent);
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: gap var(--cbg-transition), color var(--cbg-transition);
    padding-top: 14px;
    align-self: flex-start;
    width: 100%;
    border-top: 1px solid #f0f2f4;
}

.cbg-pp-read-more:hover {
    color: var(--cbg-darker);
    gap: 8px;
}

/* ═══════════════════════════════════════════════════════
   SINGLE PROJECT PAGE
   ═══════════════════════════════════════════════════════ */

.cbg-pp-single-wrap {
    overflow: hidden;
}

/* ── HERO ────────────────────────────────────────────── */
.cbg-pp-single-hero {
    position: relative;
    min-height: 480px;
    display: flex;
    align-items: flex-end;
    /* Gradient fallback always visible, image loads on top */
    background-color: var(--cbg-darker);
    background-image:
        url('https://capitalbrandgroup.com/wp-content/uploads/2019/07/footer-bg.png'),
        linear-gradient(135deg, var(--cbg-darker) 0%, var(--cbg-accent) 55%, var(--cbg-dark) 100%);
    background-size: cover, cover;
    background-position: center center, center center;
    background-repeat: no-repeat, no-repeat;
}

.cbg-pp-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(15, 30, 36, 0.92) 0%,
        rgba(20, 40, 50, 0.65) 45%,
        rgba(20, 40, 50, 0.28) 100%
    );
}

.cbg-pp-hero-content {
    position: relative;
    z-index: 2;
    padding: 48px 72px 52px;
    width: 100%;
    box-sizing: border-box;
}

.cbg-pp-hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.cbg-pp-hero-tag {
    display: inline-block;
    background: rgba(5, 151, 174, 0.25);
    border: 1px solid rgba(5, 151, 174, 0.55);
    color: rgba(255,255,255,0.92);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    padding: 5px 14px;
    border-radius: 4px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.cbg-pp-single-title {
    margin: 0;
    font-size: clamp(28px, 4vw, 54px);
    font-weight: 800;
    color: #fff;
    line-height: 1.1;
    letter-spacing: -0.03em;
    font-family: var(--cbg-heading-ff, inherit);
    text-shadow: 0 2px 24px rgba(0,0,0,0.40);
    max-width: 840px;
}

/* ── META STRIP ──────────────────────────────────────── */
.cbg-pp-meta-strip {
    background: var(--cbg-darker);
    border-bottom: 3px solid var(--cbg-accent);
}

.cbg-pp-meta-inner {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 72px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    box-sizing: border-box;
}

.cbg-pp-strip-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    letter-spacing: 0.03em;
    white-space: nowrap;
    transition: color 0.2s ease, gap 0.2s ease;
}

.cbg-pp-strip-back:hover {
    color: #fff;
    gap: 12px;
    text-decoration: none;
}

.cbg-pp-strip-back svg { flex-shrink: 0; }

.cbg-pp-strip-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.cbg-pp-strip-tag {
    display: inline-block;
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.18);
    color: rgba(255,255,255,0.82);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 3px;
}

/* ══ IMAGE GRID (1–4 images) ═════════════════════════════ */

.cbg-pp-img-section {
    background: #fff;
    padding: 48px 0 56px;
}

.cbg-pp-img-grid {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 64px;
    display: grid;
    gap: 16px;
    box-sizing: border-box;
}

.cbg-pp-img-grid-1 { grid-template-columns: 1fr; max-width: 640px; }
.cbg-pp-img-grid-2 { grid-template-columns: repeat(2, 1fr); }
.cbg-pp-img-grid-3 { grid-template-columns: repeat(3, 1fr); }
.cbg-pp-img-grid-4 { grid-template-columns: repeat(2, 1fr); }

.cbg-pp-img-item {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 16px rgba(0,0,0,0.09);
    line-height: 0;
}

.cbg-pp-img-item img {
    display: block;
    width: 100%;
    height: auto;
}

/* ══ CAROUSEL (5+ images) ════════════════════════════════ */

.cbg-pp-carousel-section {
    background: #fff;
    padding: 48px 0 56px;
}

.cbg-pp-carousel {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 72px;
    box-sizing: border-box;
}

.cbg-pp-carousel-inner {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 32px rgba(0,0,0,0.10);
    line-height: 0;
    background: #fff;
}

.cbg-pp-carousel-slide {
    display: none;
}

.cbg-pp-carousel-slide.is-active {
    display: block;
    animation: cbgFade 0.35s ease;
}

@keyframes cbgFade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.cbg-pp-carousel-slide img {
    display: block;
    width: 100%;
    height: auto;
}

.cbg-pp-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.95);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    color: var(--cbg-dark);
    transition: background 0.2s, color 0.2s, transform 0.2s;
    padding: 0;
    line-height: 1;
}

.cbg-pp-carousel-btn:hover {
    background: var(--cbg-accent);
    color: #fff;
    transform: translateY(-50%) scale(1.08);
}

.cbg-pp-carousel-prev { left: 14px; }
.cbg-pp-carousel-next { right: 14px; }

.cbg-pp-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
}

.cbg-pp-carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ccd4d8;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s, transform 0.2s;
}

.cbg-pp-carousel-dot.is-active {
    background: var(--cbg-accent);
    transform: scale(1.4);
}

/* ══ TEXT SECTION ════════════════════════════════════════ */

.cbg-pp-text-section {
    background: #fff;
    padding: 64px 0 72px;
}

.cbg-pp-text-inner {
    max-width: 820px;
    margin: 0 auto;
    padding: 0 72px;
    box-sizing: border-box;
}

.cbg-pp-text-label {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--cbg-accent);
    margin-bottom: 24px;
    font-family: var(--cbg-body-ff);
}

.cbg-pp-text-label::before {
    content: '';
    display: inline-block;
    width: 32px;
    height: 2px;
    background: var(--cbg-accent);
    border-radius: 2px;
    flex-shrink: 0;
}

.cbg-pp-text-body p {
    font-size: 17.5px;
    line-height: 1.88;
    color: #3a4d58;
    margin: 0 0 26px;
    font-family: var(--cbg-body-ff);
}

.cbg-pp-text-body p:last-child { margin-bottom: 0; }

.cbg-pp-text-body h2,
.cbg-pp-text-body h3,
.cbg-pp-text-body h4 {
    color: var(--cbg-dark);
    font-family: var(--cbg-heading-ff);
    margin: 40px 0 16px;
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.3;
}

.cbg-pp-text-body ul,
.cbg-pp-text-body ol {
    padding-left: 24px;
    margin: 0 0 26px;
}

.cbg-pp-text-body li {
    font-size: 17.5px;
    line-height: 1.80;
    color: #3a4d58;
    margin-bottom: 10px;
    font-family: var(--cbg-body-ff);
}

.cbg-pp-text-body strong {
    color: var(--cbg-dark);
    font-weight: 700;
}

/* ── BACK CTA SECTION ────────────────────────────────── */
.cbg-pp-back-section {
    background: #f0f4f6;
    padding: 48px 0 56px;
    text-align: center;
    border-top: 1px solid #e0e6ea;
}

.cbg-pp-back-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 36px;
    background: var(--cbg-dark);
    color: #fff;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    transition: background 0.22s ease, gap 0.22s ease, transform 0.22s ease;
    font-family: var(--cbg-body-ff);
    box-shadow: 0 4px 20px rgba(34,65,75,0.28);
}

.cbg-pp-back-cta:hover {
    background: var(--cbg-accent);
    gap: 14px;
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(5,151,174,0.35);
}

.cbg-pp-back-cta svg { flex-shrink: 0; }

/* ═══════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════ */

@media (max-width: 1100px) {
    .cbg-pp-cols-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

    .cbg-pp-hero-content,
    .cbg-pp-meta-inner,
    .cbg-pp-carousel,
    .cbg-pp-text-inner {
        padding-left: 48px;
        padding-right: 48px;
    }
}

@media (max-width: 860px) {
    .cbg-pp-single-hero { min-height: 380px; }

    .cbg-pp-hero-content,
    .cbg-pp-meta-inner,
    .cbg-pp-carousel,
    .cbg-pp-text-inner {
        padding-left: 36px;
        padding-right: 36px;
    }
}

@media (max-width: 640px) {
    .cbg-pp-cols-2,
    .cbg-pp-cols-3,
    .cbg-pp-cols-4 { grid-template-columns: minmax(0, 1fr); }

    .cbg-pp-grid { gap: 18px; }

    .cbg-pp-single-hero { min-height: 300px; }

    .cbg-pp-hero-content,
    .cbg-pp-meta-inner,
    .cbg-pp-carousel,
    .cbg-pp-img-grid,
    .cbg-pp-text-inner {
        padding-left: 20px;
        padding-right: 20px;
    }

    /* Mobile: all grid layouts collapse to 1 column */
    .cbg-pp-img-grid-2,
    .cbg-pp-img-grid-3,
    .cbg-pp-img-grid-4 { grid-template-columns: 1fr; }

    .cbg-pp-carousel-btn { width: 36px; height: 36px; }
    .cbg-pp-carousel-prev { left: 10px; }
    .cbg-pp-carousel-next { right: 10px; }

    .cbg-pp-meta-inner {
        height: auto;
        min-height: 48px;
        padding-top: 12px;
        padding-bottom: 12px;
        flex-direction: column;
        align-items: flex-start;
    }

    .cbg-pp-text-body p,
    .cbg-pp-text-body li { font-size: 16px; }

    .cbg-pp-img-section { padding: 40px 0 44px; }
    .cbg-pp-text-section { padding: 44px 0 52px; }
    .cbg-pp-back-section { padding: 36px 0 44px; }
}
