/* ==========================================================
   STORIES PAGE + SINGLE
   Archive: sidebar + 3-column grid
   Single: content + sidebar by category
========================================================== */

/* ----- Archive hero ----- */
.crusto-stories-hero {
    position: relative;
    padding: 100px 0 50px;
    text-align: center;
    background:
        linear-gradient(
            rgba(15, 10, 5, 0.58),
            rgba(15, 10, 5, 0.68)
        ),
        url('../images/stories/our-story-cover.jpg') center/cover no-repeat;
}

.crusto-stories-hero .crusto-section-subtitle {
    display: block;
    font-size: 0.85rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #D4A24C;
    font-weight: 600;
    margin-bottom: 12px;
}

.crusto-stories-hero .crusto-page-title {
    font-size: clamp(2.2rem, 4vw, 3rem);
    margin: 0 0 14px;
    line-height: 1.2;
    color: #FFFFFF;
}

.crusto-stories-hero .crusto-page-lead {
    max-width: 620px;
    margin: 0 auto;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.05rem;
    line-height: 1.7;
}

/* ----- Archive layout ----- */
.crusto-stories-archive {
    padding: 70px 0 90px;
}

.crusto-stories-layout,
.crusto-single-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    align-items: start;
}

/* Main grid: 3 columns */
.crusto-stories-grid-page {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    align-items: stretch;
}

.crusto-story-card-page {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #EFE7DE;
    transition: 0.3s;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.crusto-story-card-page:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
    transform: translateY(-3px);
}

.crusto-story-card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.crusto-story-card-image {
    aspect-ratio: 16/10;
    overflow: hidden;
    background: #F0EBE4;
    flex-shrink: 0;
}

.crusto-story-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: 0.4s;
}

.crusto-story-card-page:hover .crusto-story-card-image img {
    transform: scale(1.04);
}

.crusto-story-card-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #EFE7DE, #F7F3EE);
}

.crusto-story-card-body {
    padding: 18px 16px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.crusto-story-card-date {
    display: block;
    font-size: 0.78rem;
    color: #8B5E3C;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.crusto-story-card-body h2 {
    font-size: 1.1rem;
    margin: 0 0 8px;
    line-height: 1.35;
    color: #2B2B2B;
}

.crusto-story-card-body p {
    margin: 0 0 12px;
    font-size: 0.88rem;
    line-height: 1.55;
    color: #6D6D6D;
    flex: 1;
}

.crusto-story-card-more {
    font-size: 0.85rem;
    font-weight: 600;
    color: #8B5E3C;
    margin-top: auto;
}

.crusto-stories-empty {
    text-align: center;
    color: #6D6D6D;
    padding: 40px 0;
    grid-column: 1 / -1;
}

/* Pagination */
.crusto-stories-pagination {
    margin-top: 40px;
    text-align: center;
}

.crusto-stories-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    margin: 0 4px;
    border-radius: 8px;
    color: #2B2B2B;
    text-decoration: none;
    font-weight: 600;
}

.crusto-stories-pagination .page-numbers.current,
.crusto-stories-pagination .page-numbers:hover {
    background: #8B5E3C;
    color: #fff;
}

/* ----- Sidebar ----- */
.crusto-stories-sidebar {
    position: sticky;
    top: 100px;
    background: #fff;
    border: 1px solid #EFE7DE;
    border-radius: 14px;
    padding: 20px 18px;
}

.crusto-sidebar-title {
    font-family: "Cormorant Garamond", serif;
    font-size: 1.25rem;
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid #8B5E3C;
    color: #2B2B2B;
}

.crusto-popular-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.crusto-popular-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid #F0EBE4;
}

.crusto-popular-item:last-child {
    border-bottom: none;
}

.crusto-popular-rank {
    flex-shrink: 0;
    width: 22px;
    font-weight: 700;
    font-size: 0.9rem;
    color: #8B5E3C;
    line-height: 1.4;
}

.crusto-popular-link {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    text-decoration: none;
    color: inherit;
    flex: 1;
}

.crusto-popular-thumb {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 8px;
    overflow: hidden;
    background: #F0EBE4;
}

.crusto-popular-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.crusto-popular-title {
    font-size: 0.88rem;
    line-height: 1.4;
    color: #2B2B2B;
    font-weight: 500;
}

.crusto-popular-link:hover .crusto-popular-title {
    color: #8B5E3C;
}

.crusto-popular-empty {
    color: #999;
    font-size: 0.88rem;
    padding: 8px 0;
    list-style: none;
}

/* ----- Single story ----- */
.crusto-single-hero {
    padding: 120px 0 40px;
    background: #F7F3EE;
    text-align: center;
}

.crusto-single-hero .crusto-section-subtitle {
    display: block;
    font-size: 0.85rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #8B5E3C;
    font-weight: 600;
    margin-bottom: 12px;
}

.crusto-single-hero .crusto-page-title {
    font-size: clamp(2rem, 4vw, 2.8rem);
    margin: 0 0 16px;
    line-height: 1.25;
    color: #2B2B2B;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.crusto-single-meta {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    font-size: 0.9rem;
    color: #6D6D6D;
}

.crusto-single-cat {
    color: #8B5E3C;
    font-weight: 600;
}

.crusto-single-featured {
    padding: 0 0 40px;
    background: #F7F3EE;
}

.crusto-single-featured-image {
    max-width: 900px;
    margin: 0 auto;
    border-radius: 16px;
    overflow: hidden;
}

.crusto-single-featured-image img {
    width: 100%;
    display: block;
    object-fit: cover;
}

.crusto-single-content {
    padding: 50px 0 90px;
}

.crusto-single-layout .crusto-single-body {
    max-width: none;
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.85;
    color: #3A3A3A;
}

.crusto-single-body p {
    margin-bottom: 1.25em;
}

.crusto-single-body h2,
.crusto-single-body h3 {
    margin: 1.6em 0 0.6em;
    color: #2B2B2B;
}

.crusto-single-body img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 1.5em 0;
}

.crusto-single-layout .crusto-single-footer {
    max-width: none;
    margin-top: 40px;
    text-align: left;
}

.crusto-single-footer .crusto-button-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    border-radius: 999px;
    border: 1px solid #8B5E3C;
    color: #8B5E3C;
    font-weight: 600;
    text-decoration: none;
    transition: 0.3s;
}

.crusto-single-footer .crusto-button-outline:hover {
    background: #8B5E3C;
    color: #fff;
}

/* Responsive */
@media (max-width: 992px) {
    .crusto-stories-layout,
    .crusto-single-layout {
        grid-template-columns: 1fr;
    }

    .crusto-stories-grid-page {
        grid-template-columns: repeat(2, 1fr);
    }

    .crusto-stories-sidebar {
        position: static;
        order: 2;
    }

    .crusto-stories-hero {
        padding: 95px 0 40px;
    }
}

@media (max-width: 600px) {
    .crusto-stories-grid-page {
        grid-template-columns: 1fr;
    }

    .crusto-stories-hero {
        padding: 90px 0 35px;
    }

    .crusto-single-hero {
        padding: 100px 0 30px;
    }
}