/* =========================================================
   FM COLLECTIONS — BLOG CATEGORY PAGE
   File: public/css/blog-category.css
========================================================= */


/* =========================================================
   PAGE VARIABLES
========================================================= */

.blog-category-page {
    --blog-primary: #2e7d32;
    --blog-primary-dark: #166534;
    --blog-primary-soft: #f0fdf4;

    --blog-text: #0f172a;
    --blog-text-soft: #334155;
    --blog-muted: #64748b;

    --blog-border: #dbe4ee;
    --blog-border-soft: #e8edf3;

    --blog-surface: #ffffff;
    --blog-surface-soft: #f8fafc;
    --blog-page-bg: #f4f7fb;

    width: 100%;
    min-height: 75vh;
    padding: 54px 0 80px;

    color: var(--blog-text);
    background: var(--blog-page-bg);
}


/* =========================================================
   GLOBAL BOX SIZING
========================================================= */

.blog-category-page,
.blog-category-page *,
.blog-category-page *::before,
.blog-category-page *::after {
    box-sizing: border-box;
}


/* =========================================================
   CONTAINER
========================================================= */

.blog-category-container {
    width: min(1200px, calc(100% - 40px));
    margin: 0 auto;
}


/* =========================================================
   CATEGORY HEADER
========================================================= */

.blog-category-header {
    position: relative;

    overflow: hidden;

    margin-bottom: 42px;
    padding: 44px;

    border: 1px solid var(--blog-border-soft);
    border-radius: 26px;

    background:
        radial-gradient(
            circle at top right,
            rgba(46, 125, 50, 0.14),
            transparent 34%
        ),
        linear-gradient(
            135deg,
            #ffffff,
            #f7fbf8
        );

    box-shadow:
        0 22px 52px rgba(15, 23, 42, 0.065),
        0 3px 10px rgba(15, 23, 42, 0.025);
}

.blog-category-header::before,
.blog-category-header::after {
    content: "";

    position: absolute;

    border-radius: 50%;

    pointer-events: none;
}

.blog-category-header::before {
    top: -75px;
    right: -60px;

    width: 210px;
    height: 210px;

    background: rgba(46, 125, 50, 0.05);
}

.blog-category-header::after {
    left: -65px;
    bottom: -80px;

    width: 180px;
    height: 180px;

    background: rgba(46, 125, 50, 0.04);
}


/* =========================================================
   BACK LINK
========================================================= */

.blog-category-back {
    position: relative;
    z-index: 1;

    display: inline-flex;
    align-items: center;
    gap: 9px;

    margin-bottom: 28px;

    color: var(--blog-primary-dark);

    font-size: 13px;
    font-weight: 850;
    text-decoration: none;

    transition:
        color 0.2s ease,
        transform 0.2s ease;
}

.blog-category-back svg {
    width: 18px;
    height: 18px;

    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.blog-category-back:hover {
    color: var(--blog-primary);
    transform: translateX(-2px);
}


/* =========================================================
   CATEGORY HEADING
========================================================= */

.blog-category-eyebrow {
    position: relative;
    z-index: 1;

    display: block;

    margin-bottom: 10px;

    color: var(--blog-primary);

    font-size: 11px;
    line-height: 1;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.blog-category-header h1 {
    position: relative;
    z-index: 1;

    max-width: 850px;
    margin: 0 0 15px;

    color: var(--blog-text);

    font-size: clamp(34px, 5vw, 52px);
    line-height: 1.14;
    font-weight: 950;
    letter-spacing: -0.045em;
}

.blog-category-description {
    position: relative;
    z-index: 1;

    max-width: 820px;
    margin: 0;

    color: var(--blog-muted);

    font-size: 15px;
    line-height: 1.8;
}

.blog-category-count {
    position: relative;
    z-index: 1;

    display: inline-flex;
    align-items: center;
    gap: 8px;

    margin-top: 22px;
    padding: 9px 14px;

    border: 1px solid #cde6d1;
    border-radius: 999px;

    color: var(--blog-primary-dark);
    background: var(--blog-primary-soft);

    font-size: 11px;
    font-weight: 850;
}


/* =========================================================
   CATEGORY LISTING
========================================================= */

.blog-category-listing {
    width: 100%;
}


/* =========================================================
   SECTION HEADER
========================================================= */

.blog-category-section-header {
    margin-bottom: 28px;
}

.blog-category-section-header span {
    display: block;

    margin-bottom: 8px;

    color: var(--blog-primary);

    font-size: 11px;
    line-height: 1;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.blog-category-section-header h2 {
    margin: 0;

    color: var(--blog-text);

    font-size: clamp(27px, 4vw, 38px);
    line-height: 1.2;
    font-weight: 950;
    letter-spacing: -0.035em;
}


/* =========================================================
   ARTICLE GRID
========================================================= */

.blog-category-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
}


/* =========================================================
   ARTICLE CARD
========================================================= */

.blog-category-card {
    display: flex;
    flex-direction: column;

    min-width: 0;
    overflow: hidden;

    border: 1px solid var(--blog-border-soft);
    border-radius: 22px;

    background: var(--blog-surface);

    box-shadow:
        0 16px 38px rgba(15, 23, 42, 0.055),
        0 2px 7px rgba(15, 23, 42, 0.025);

    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease,
        border-color 0.25s ease;
}

.blog-category-card:hover {
    transform: translateY(-6px);

    border-color: #c9ddcb;

    box-shadow:
        0 24px 48px rgba(15, 23, 42, 0.09),
        0 4px 12px rgba(15, 23, 42, 0.04);
}


/* =========================================================
   ARTICLE IMAGE
========================================================= */

.blog-category-card-media {
    position: relative;

    display: block;
    overflow: hidden;

    aspect-ratio: 12 / 7;

    background: var(--blog-surface-soft);

    text-decoration: none;
}

.blog-category-card-media img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;

    transition:
        transform 0.35s ease,
        filter 0.35s ease;
}

.blog-category-card:hover
.blog-category-card-media img {
    transform: scale(1.045);
}

.blog-category-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;

    width: 100%;
    height: 100%;

    color: var(--blog-primary-dark);
    background:
        linear-gradient(
            135deg,
            #f0fdf4,
            #f8fafc
        );
}

.blog-category-placeholder i {
    font-size: 38px;
}

.blog-category-placeholder small {
    font-size: 11px;
    font-weight: 850;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}


/* =========================================================
   CARD CONTENT
========================================================= */

.blog-category-card-content {
    display: flex;
    flex: 1;
    flex-direction: column;

    padding: 22px;
}


/* =========================================================
   CARD META
========================================================= */

.blog-category-card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 16px;

    margin-bottom: 14px;

    color: var(--blog-muted);

    font-size: 10px;
    line-height: 1.4;
}

.blog-category-card-meta time,
.blog-category-card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.blog-category-card-meta i {
    color: var(--blog-primary);
}


/* =========================================================
   CARD TITLE
========================================================= */

.blog-category-card h2 {
    margin: 0 0 12px;

    font-size: 21px;
    line-height: 1.38;
    font-weight: 900;
    letter-spacing: -0.025em;
}

.blog-category-card h2 a {
    color: var(--blog-text);

    text-decoration: none;

    transition: color 0.2s ease;
}

.blog-category-card h2 a:hover {
    color: var(--blog-primary-dark);
}


/* =========================================================
   CARD DESCRIPTION
========================================================= */

.blog-category-card-content > p {
    display: -webkit-box;
    overflow: hidden;

    margin: 0 0 20px;

    color: var(--blog-muted);

    font-size: 13px;
    line-height: 1.75;

    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
}


/* =========================================================
   CARD FOOTER
========================================================= */

.blog-category-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;

    margin-top: auto;
    padding-top: 17px;

    border-top: 1px solid var(--blog-border-soft);
}

.blog-category-read-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    color: var(--blog-primary-dark);

    font-size: 12px;
    font-weight: 900;
    text-decoration: none;
}

.blog-category-read-more svg {
    width: 17px;
    height: 17px;

    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;

    transition: transform 0.2s ease;
}

.blog-category-read-more:hover svg {
    transform: translateX(4px);
}

.blog-category-views {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    color: var(--blog-muted);

    font-size: 10px;
    font-weight: 750;
}


/* =========================================================
   PAGINATION
========================================================= */

.blog-category-pagination {
    margin-top: 42px;
}

.blog-category-pagination nav {
    display: flex;
    justify-content: center;
}

.blog-category-pagination nav > div {
    width: 100%;
}

.blog-category-pagination svg {
    width: 20px;
    height: 20px;
}

.blog-category-pagination a,
.blog-category-pagination span {
    text-decoration: none;
}

.blog-category-pagination nav div:first-child {
    display: none;
}

.blog-category-pagination nav div:last-child {
    display: flex;
    justify-content: center;
}

.blog-category-pagination nav div:last-child > div {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.blog-category-pagination nav div:last-child span,
.blog-category-pagination nav div:last-child a {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 40px;
    min-height: 40px;
    padding: 8px 12px;

    border: 1px solid var(--blog-border);
    border-radius: 10px;

    color: var(--blog-text-soft);
    background: #ffffff;

    font-size: 12px;
    font-weight: 800;

    transition:
        color 0.2s ease,
        border-color 0.2s ease,
        background-color 0.2s ease;
}

.blog-category-pagination nav div:last-child a:hover {
    color: var(--blog-primary-dark);
    border-color: #9bcba3;
    background: var(--blog-primary-soft);
}

.blog-category-pagination
nav
div:last-child
span[aria-current="page"] > span,
.blog-category-pagination
nav
div:last-child > span[aria-current="page"] {
    color: #ffffff;
    border-color: var(--blog-primary);
    background: var(--blog-primary);
}


/* =========================================================
   EMPTY STATE
========================================================= */

.blog-category-empty-state {
    padding: 65px 28px;

    border: 1px solid var(--blog-border-soft);
    border-radius: 24px;

    background: #ffffff;

    text-align: center;

    box-shadow:
        0 16px 38px rgba(15, 23, 42, 0.05);
}

.blog-category-empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 68px;
    height: 68px;
    margin-bottom: 20px;

    border: 1px solid #cde6d1;
    border-radius: 20px;

    color: var(--blog-primary-dark);
    background: var(--blog-primary-soft);

    font-size: 27px;
}

.blog-category-empty-state h2 {
    margin: 0 0 10px;

    color: var(--blog-text);

    font-size: 27px;
    line-height: 1.3;
    font-weight: 900;
}

.blog-category-empty-state p {
    max-width: 560px;
    margin: 0 auto 23px;

    color: var(--blog-muted);

    font-size: 14px;
    line-height: 1.7;
}

.blog-category-empty-state a {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 44px;
    padding: 11px 18px;

    border-radius: 10px;

    color: #ffffff;
    background: var(--blog-primary);

    font-size: 12px;
    font-weight: 900;
    text-decoration: none;

    transition:
        background-color 0.2s ease,
        transform 0.2s ease;
}

.blog-category-empty-state a:hover {
    background: var(--blog-primary-dark);
    transform: translateY(-1px);
}


/* =========================================================
   ACCESSIBILITY
========================================================= */

.blog-category-page a:focus-visible {
    outline: 3px solid rgba(46, 125, 50, 0.18);
    outline-offset: 3px;
}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 1050px) {
    .blog-category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 720px) {
    .blog-category-page {
        padding-top: 30px;
        padding-bottom: 55px;
    }

    .blog-category-container {
        width: min(100% - 28px, 1200px);
    }

    .blog-category-header {
        padding: 32px 22px;

        border-radius: 20px;
    }

    .blog-category-back {
        margin-bottom: 22px;
    }

    .blog-category-description {
        font-size: 14px;
    }

    .blog-category-section-header {
        margin-bottom: 23px;
    }

    .blog-category-grid {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    .blog-category-card-content {
        padding: 20px;
    }

    .blog-category-card h2 {
        font-size: 20px;
    }

    .blog-category-pagination
    nav
    div:last-child > div {
        justify-content: center;
    }
}


/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 430px) {
    .blog-category-header h1 {
        font-size: 31px;
    }

    .blog-category-card-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .blog-category-read-more {
        width: 100%;
        justify-content: space-between;
    }
}


/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {
    .blog-category-page *,
    .blog-category-page *::before,
    .blog-category-page *::after {
        scroll-behavior: auto !important;
        transition: none !important;
        animation: none !important;
    }
}


/* =========================================================
   PRINT
========================================================= */

@media print {
    .blog-category-header,
    .blog-category-card,
    .blog-category-empty-state {
        box-shadow: none;
    }

    .blog-category-card:hover {
        transform: none;
    }
}