/* ============================================================
   CS Blog Grid — Cornerstones Guest House
   Elegant warm-gold aesthetic matching the guesthouse brand
   ============================================================ */

/* ---------- Variables ---------- */
:root {
    --csbg-gold:       #c8a97e;
    --csbg-gold-light: #e8d5b8;
    --csbg-gold-dark:  #a08050;
    --csbg-dark:       #1a1a1a;
    --csbg-text:       #444;
    --csbg-text-light: #888;
    --csbg-bg:         #faf8f5;
    --csbg-card-bg:    #ffffff;
    --csbg-radius:     12px;
    --csbg-shadow:     0 2px 20px rgba(0,0,0,0.06);
    --csbg-shadow-hover: 0 12px 40px rgba(0,0,0,0.10);
    --csbg-transition: 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ---------- Wrapper ---------- */
#csbg-wrapper {
    max-width: 1280px;
    margin: 0 auto;
    padding: 10px 0 60px;
    font-family: inherit;
}

/* ---------- Filter Buttons ---------- */
.csbg-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 36px;
    padding: 0 16px;
}

.csbg-filter-btn {
    padding: 10px 26px;
    border: 2px solid var(--csbg-gold);
    background: transparent;
    color: var(--csbg-gold-dark);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all var(--csbg-transition);
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1;
    white-space: nowrap;
}

.csbg-filter-btn:hover {
    background: var(--csbg-gold-light);
    color: var(--csbg-dark);
}

.csbg-filter-btn.active {
    background: var(--csbg-gold);
    color: #fff;
    border-color: var(--csbg-gold);
}

/* ---------- Grid ---------- */
.csbg-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 26px;
    padding: 0 16px;
}

/* ---------- Card ---------- */
.csbg-card {
    display: flex;
    flex-direction: column;
    background: var(--csbg-card-bg);
    border-radius: var(--csbg-radius);
    overflow: hidden;
    box-shadow: var(--csbg-shadow);
    text-decoration: none;
    color: inherit;
    transition: transform var(--csbg-transition), box-shadow var(--csbg-transition);
    animation: csbgFadeUp 0.5s ease both;
}

.csbg-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--csbg-shadow-hover);
}

.csbg-card:hover .csbg-card__img {
    transform: scale(1.05);
}

.csbg-card:hover .csbg-card__readmore {
    color: var(--csbg-gold-dark);
}

/* Featured cards — first row spans wider */
.csbg-card--featured {
    /* Featured cards stay same column but taller image */
}

.csbg-card--featured .csbg-card__img-wrap {
    height: 260px;
}

/* ---------- Card Image ---------- */
.csbg-card__img-wrap {
    position: relative;
    width: 100%;
    height: 210px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--csbg-gold-light) 0%, #ede0cf 100%);
    flex-shrink: 0;
}

.csbg-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--csbg-transition);
}

.csbg-card__img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--csbg-gold);
    opacity: 0.5;
}

/* ---------- Category Badge ---------- */
.csbg-card__badge {
    position: absolute;
    top: 14px;
    left: 14px;
    padding: 5px 14px;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--csbg-gold-dark);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 30px;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* ---------- Card Body ---------- */
.csbg-card__body {
    padding: 16px 20px 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.csbg-card__title {
    font-size: 15px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    color: var(--csbg-dark) !important;
    margin: 0 0 8px 0 !important;
    padding: 0 !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    letter-spacing: -0.2px;
    word-break: break-word;
}

/* Override any theme h3 defaults inside our cards */
.csbg-card .csbg-card__title,
#csbg-wrapper .csbg-card__title,
.csbg-card h3.csbg-card__title {
    font-size: 15px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    margin: 0 0 8px 0 !important;
    padding: 0 !important;
    text-transform: none !important;
    letter-spacing: -0.2px !important;
}

.csbg-card__excerpt {
    font-size: 13px;
    line-height: 1.55;
    color: var(--csbg-text-light);
    margin: 0 0 auto 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.csbg-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #f0ece6;
}

.csbg-card__meta time {
    font-size: 12px;
    color: var(--csbg-text-light);
    letter-spacing: 0.3px;
}

.csbg-card__readmore {
    font-size: 13px;
    font-weight: 600;
    color: var(--csbg-gold);
    transition: color var(--csbg-transition);
}

/* ---------- Empty State ---------- */
.csbg-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--csbg-text-light);
    font-size: 16px;
}

/* ---------- Load More ---------- */
.csbg-loadmore-wrap {
    text-align: center;
    margin-top: 44px;
    padding: 0 16px;
}

.csbg-loadmore-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 40px;
    background: var(--csbg-gold);
    color: #fff;
    border: 2px solid var(--csbg-gold);
    border-radius: 50px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all var(--csbg-transition);
}

.csbg-loadmore-btn:hover {
    background: var(--csbg-gold-dark);
    border-color: var(--csbg-gold-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(200,169,126,0.3);
}

.csbg-loadmore-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.csbg-loadmore-spinner svg {
    animation: csbgSpin 1s linear infinite;
}

.csbg-loadmore-btn.csbg-hidden {
    display: none;
}

/* ---------- Animations ---------- */
@keyframes csbgFadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes csbgSpin {
    to { transform: rotate(360deg); }
}

/* Stagger animation for cards */
.csbg-card:nth-child(1)  { animation-delay: 0.05s; }
.csbg-card:nth-child(2)  { animation-delay: 0.10s; }
.csbg-card:nth-child(3)  { animation-delay: 0.15s; }
.csbg-card:nth-child(4)  { animation-delay: 0.20s; }
.csbg-card:nth-child(5)  { animation-delay: 0.25s; }
.csbg-card:nth-child(6)  { animation-delay: 0.30s; }

/* ---------- Responsive: Tablet ---------- */
@media (max-width: 960px) {
    .csbg-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    .csbg-card--featured .csbg-card__img-wrap {
        height: 220px;
    }
}

/* ---------- Responsive: Mobile ---------- */
@media (max-width: 600px) {
    .csbg-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }
    .csbg-filters {
        gap: 8px;
    }
    .csbg-filter-btn {
        padding: 8px 18px;
        font-size: 12px;
    }
    .csbg-card__img-wrap,
    .csbg-card--featured .csbg-card__img-wrap {
        height: 200px;
    }
    .csbg-card__title {
        font-size: 16px;
    }
    .csbg-card__body {
        padding: 16px 18px 18px;
    }
    .csbg-loadmore-btn {
        padding: 12px 32px;
        font-size: 13px;
    }
}


/* ============================================================
   HOMEPAGE CAROUSEL — [cs_blog_carousel]
   ============================================================ */

.csbg-carousel-section {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 0 20px;
    font-family: inherit;
    overflow: hidden;
}

/* Header with title + arrows */
.csbg-carousel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    margin-bottom: 24px;
}

.csbg-carousel-heading {
    font-size: 24px !important;
    font-weight: 700 !important;
    color: var(--csbg-dark) !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.3 !important;
    letter-spacing: -0.3px !important;
    text-transform: none !important;
}

/* Override theme h2 */
.csbg-carousel-section h2.csbg-carousel-heading,
.csbg-carousel-section .csbg-carousel-heading {
    font-size: 24px !important;
    font-weight: 700 !important;
    margin: 0 !important;
    padding: 0 !important;
    text-transform: none !important;
}

.csbg-carousel-nav {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.csbg-carousel-arrow {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid var(--csbg-gold);
    background: transparent;
    color: var(--csbg-gold);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--csbg-transition);
    flex-shrink: 0;
}

.csbg-carousel-arrow:hover {
    background: var(--csbg-gold);
    color: #fff;
}

/* Viewport & Track */
.csbg-carousel-viewport {
    overflow: hidden;
    padding: 0 16px;
}

.csbg-carousel-track {
    display: flex;
    gap: 22px;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

/* Carousel Card */
.csbg-carousel-card {
    flex: 0 0 calc(25% - 16.5px);
    min-width: 0;
    background: var(--csbg-card-bg);
    border-radius: var(--csbg-radius);
    overflow: hidden;
    box-shadow: var(--csbg-shadow);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: transform var(--csbg-transition), box-shadow var(--csbg-transition);
}

.csbg-carousel-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--csbg-shadow-hover);
}

.csbg-carousel-card:hover img {
    transform: scale(1.05);
}

/* Card Image */
.csbg-carousel-card__img-wrap {
    position: relative;
    width: 100%;
    height: 190px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--csbg-gold-light) 0%, #ede0cf 100%);
    flex-shrink: 0;
}

.csbg-carousel-card__img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--csbg-transition);
}

.csbg-carousel-card__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--csbg-gold);
    opacity: 0.4;
}

.csbg-carousel-card__badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 12px;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--csbg-gold-dark);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 30px;
    line-height: 1;
}

/* Card Body */
.csbg-carousel-card__body {
    padding: 14px 18px 18px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.csbg-carousel-card__title {
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    color: var(--csbg-dark) !important;
    margin: 0 0 6px 0 !important;
    padding: 0 !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    letter-spacing: -0.1px;
    text-transform: none !important;
}

/* Override theme h3 inside carousel */
.csbg-carousel-card h3.csbg-carousel-card__title,
.csbg-carousel-section .csbg-carousel-card__title {
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    margin: 0 0 6px 0 !important;
    padding: 0 !important;
    text-transform: none !important;
}

.csbg-carousel-card__excerpt {
    font-size: 12px;
    line-height: 1.5;
    color: var(--csbg-text-light);
    margin: 0 0 auto 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.csbg-carousel-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #f0ece6;
}

.csbg-carousel-card__footer time {
    font-size: 11px;
    color: var(--csbg-text-light);
}

.csbg-carousel-card__readmore {
    font-size: 12px;
    font-weight: 600;
    color: var(--csbg-gold);
    transition: color var(--csbg-transition);
}

.csbg-carousel-card:hover .csbg-carousel-card__readmore {
    color: var(--csbg-gold-dark);
}

/* View All Button */
.csbg-carousel-footer {
    text-align: center;
    margin-top: 28px;
}

.csbg-carousel-viewall {
    display: inline-block;
    padding: 12px 36px;
    border: 2px solid var(--csbg-gold);
    border-radius: 50px;
    color: var(--csbg-gold-dark);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    text-decoration: none;
    transition: all var(--csbg-transition);
}

.csbg-carousel-viewall:hover {
    background: var(--csbg-gold);
    color: #fff;
    border-color: var(--csbg-gold);
    transform: translateY(-2px);
}

/* Carousel Responsive: Tablet — show 3 cards */
@media (max-width: 1024px) {
    .csbg-carousel-card {
        flex: 0 0 calc(33.333% - 14.66px);
    }
}

/* Carousel Responsive: Small tablet — show 2 cards */
@media (max-width: 768px) {
    .csbg-carousel-card {
        flex: 0 0 calc(50% - 11px);
    }
    .csbg-carousel-heading {
        font-size: 20px !important;
    }
    .csbg-carousel-section h2.csbg-carousel-heading {
        font-size: 20px !important;
    }
}

/* Carousel Responsive: Mobile — show 1.2 cards (peek) */
@media (max-width: 520px) {
    .csbg-carousel-card {
        flex: 0 0 calc(85%);
    }
    .csbg-carousel-arrow {
        width: 36px;
        height: 36px;
    }
    .csbg-carousel-arrow svg {
        width: 16px;
        height: 16px;
    }
    .csbg-carousel-card__img-wrap {
        height: 170px;
    }
}
