/*
 * ============================================================
 *  Simplest Theme — Custom Blog Stylesheet
 *  Add this file as: /wp-content/themes/simplest/blog-custom.css
 *  Then enqueue it from functions.php (see blog-functions.php)
 * ============================================================
 */

/* ──────────────────────────────────────────────────────────
   0 · GOOGLE FONTS IMPORT
   ────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

/* ──────────────────────────────────────────────────────────
   1 · DESIGN TOKENS
   ────────────────────────────────────────────────────────── */
:root {
    --clr-red:        #e52a32;
    --clr-red-dark:   #c0212a;
    --clr-red-light:  #ff4f57;
    --clr-black:      #0d0d0d;
    --clr-grey-dark:  #1f1f1f;
    --clr-grey-mid:   #4a4a4a;
    --clr-grey-soft:  #7a7a7a;
    --clr-grey-line:  #e8e8e8;
    --clr-grey-bg:    #f5f5f5;
    --clr-white:      #ffffff;

    --font-main:      'Poppins', sans-serif;

    --radius-sm:      6px;
    --radius-md:      12px;
    --radius-lg:      20px;

    --shadow-card:    0 2px 8px rgba(0,0,0,.06), 0 8px 28px rgba(0,0,0,.08);
    --shadow-card-hover: 0 6px 20px rgba(0,0,0,.10), 0 20px 48px rgba(0,0,0,.12);
    --shadow-btn:     0 4px 14px rgba(229,42,50,.35);
    --shadow-btn-hover: 0 8px 24px rgba(229,42,50,.50);

    --transition-fast:   .18s ease;
    --transition-mid:    .28s cubic-bezier(.4,0,.2,1);
    --transition-smooth: .4s cubic-bezier(.4,0,.2,1);

    --max-width:      1200px;
    --gap-grid:       28px;
}

/* ──────────────────────────────────────────────────────────
   2 · BASE RESET & TYPOGRAPHY
   ────────────────────────────────────────────────────────── */
*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-main);
    font-size: 16px;
    line-height: 1.7;
    color: var(--clr-grey-mid);
    background: var(--clr-white);
    -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a   { text-decoration: none; color: inherit; }
ul  { list-style: none; }

/* ──────────────────────────────────────────────────────────
   3 · BLOG HERO SECTION
   ────────────────────────────────────────────────────────── */
.blog-hero {
    position: relative;
    background: var(--clr-black);
    padding: 96px 24px 80px;
    text-align: center;
    overflow: hidden;
}

/* Subtle red gradient wash */
.blog-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 70% 60% at 50% -10%,
                rgba(229,42,50,.22) 0%, transparent 70%);
    pointer-events: none;
}

.blog-hero__inner {
    position: relative;
    z-index: 1;
    max-width: 720px;
    margin: 0 auto;
}

.blog-hero__eyebrow {
    display: inline-block;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--clr-red);
    margin-bottom: 18px;
    padding: 5px 14px;
    border: 1px solid rgba(229,42,50,.4);
    border-radius: 100px;
    background: rgba(229,42,50,.06);
}

.blog-hero__title {
    font-size: clamp(2.2rem, 5vw, 3.6rem);
    font-weight: 800;
    color: var(--clr-white);
    line-height: 1.15;
    letter-spacing: -.02em;
    margin-bottom: 16px;
}

.blog-hero__title span,
.blog-hero__title em {
    color: var(--clr-red);
    font-style: normal;
}

.blog-hero__sub {
    font-size: 1.05rem;
    font-weight: 300;
    color: rgba(255,255,255,.55);
    letter-spacing: .01em;
}

/* Decorative floating circles */
.blog-hero__decoration {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.blog-hero__decoration span {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(229,42,50,.15);
}

.blog-hero__decoration span:nth-child(1) {
    width: 380px; height: 380px;
    top: -120px; right: -80px;
}
.blog-hero__decoration span:nth-child(2) {
    width: 220px; height: 220px;
    bottom: -60px; left: 5%;
    border-color: rgba(255,255,255,.06);
}
.blog-hero__decoration span:nth-child(3) {
    width: 100px; height: 100px;
    top: 30%; left: -30px;
    border-color: rgba(229,42,50,.1);
    background: rgba(229,42,50,.04);
}

/* ──────────────────────────────────────────────────────────
   4 · LAYOUT WRAPPER — posts + optional sidebar
   ────────────────────────────────────────────────────────── */
.blog-wrapper {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 60px 24px 80px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 48px;
}

/* When sidebar is active */
@media (min-width: 1024px) {
    .blog-wrapper:has(.blog-sidebar) {
        grid-template-columns: 1fr 300px;
        align-items: start;
    }
}

/* ──────────────────────────────────────────────────────────
   5 · POSTS GRID
   ────────────────────────────────────────────────────────── */
.blog-main {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--gap-grid);
}

/* Pagination sits full-width inside the grid */
.blog-pagination {
    grid-column: 1 / -1;
}

/* ──────────────────────────────────────────────────────────
   6 · BLOG CARD
   ────────────────────────────────────────────────────────── */
.blog-card {
    background: var(--clr-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-mid),
                box-shadow var(--transition-mid);
    will-change: transform;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-card-hover);
}

/* ── Featured card spans full width ── */
.blog-card--featured {
    grid-column: 1 / -1;
    flex-direction: row;
}

.blog-card--featured .blog-card__thumb {
    flex: 0 0 55%;
    max-width: 55%;
    aspect-ratio: unset;
    height: 420px;
}

.blog-card--featured .blog-card__body {
    padding: 40px 44px;
    justify-content: center;
}

.blog-card--featured .blog-card__title {
    font-size: clamp(1.4rem, 2.5vw, 2rem);
}

.blog-card--featured .blog-card__excerpt {
    -webkit-line-clamp: 4;
}

@media (max-width: 860px) {
    .blog-card--featured {
        flex-direction: column;
    }
    .blog-card--featured .blog-card__thumb {
        flex: unset;
        max-width: 100%;
        height: 260px;
    }
    .blog-card--featured .blog-card__body {
        padding: 28px 24px;
    }
}

/* ── Thumbnail ── */
.blog-card__thumb-link { display: block; overflow: hidden; }

.blog-card__thumb {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--clr-grey-bg);
}

.blog-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .6s cubic-bezier(.4,0,.2,1);
}

.blog-card:hover .blog-card__img {
    transform: scale(1.05);
}

.blog-card__thumb-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(160deg,
        transparent 40%,
        rgba(13,13,13,.35) 100%);
    opacity: 0;
    transition: opacity var(--transition-mid);
}

.blog-card:hover .blog-card__thumb-overlay {
    opacity: 1;
}

/* Placeholder thumb */
.blog-card__thumb--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0f0f0 0%, #e4e4e4 100%);
}

.blog-card__thumb--placeholder svg {
    width: 48px;
    height: 48px;
    color: #bbb;
}

/* ── Body ── */
.blog-card__body {
    padding: 24px 26px 26px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 12px;
}

/* ── Meta ── */
.blog-card__meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.blog-card__category {
    display: inline-block;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--clr-red);
    background: rgba(229,42,50,.08);
    padding: 3px 10px;
    border-radius: 100px;
    transition: background var(--transition-fast),
                color var(--transition-fast);
}

.blog-card__category:hover {
    background: var(--clr-red);
    color: var(--clr-white);
}

.blog-card__date {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: .78rem;
    font-weight: 400;
    color: var(--clr-grey-soft);
}

/* ── Title ── */
.blog-card__title {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -.01em;
    color: var(--clr-black);
    flex: 1;
}

.blog-card__title a {
    background-image: linear-gradient(var(--clr-red), var(--clr-red));
    background-repeat: no-repeat;
    background-position: 0 100%;
    background-size: 0% 2px;
    transition: background-size var(--transition-mid);
}

.blog-card__title a:hover {
    background-size: 100% 2px;
}

/* ── Excerpt ── */
.blog-card__excerpt {
    font-size: .9rem;
    font-weight: 300;
    line-height: 1.7;
    color: var(--clr-grey-mid);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Footer row ── */
.blog-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--clr-grey-line);
    gap: 12px;
}

/* ── Button ── */
.blog-card__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--clr-red);
    color: var(--clr-white);
    font-family: var(--font-main);
    font-size: .82rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: 9px 20px;
    border-radius: 100px;
    box-shadow: var(--shadow-btn);
    transition: background var(--transition-fast),
                box-shadow var(--transition-fast),
                transform var(--transition-fast);
}

.blog-card__btn svg {
    transition: transform var(--transition-fast);
    flex-shrink: 0;
}

.blog-card__btn:hover {
    background: var(--clr-red-dark);
    box-shadow: var(--shadow-btn-hover);
    transform: translateY(-1px);
}

.blog-card__btn:hover svg {
    transform: translateX(3px);
}

.blog-card__btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-btn);
}

/* ── Reading time ── */
.blog-card__read-time {
    font-size: .76rem;
    color: var(--clr-grey-soft);
    white-space: nowrap;
}

/* ──────────────────────────────────────────────────────────
   7 · SIDEBAR
   ────────────────────────────────────────────────────────── */
.blog-sidebar {
    position: sticky;
    top: 32px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* Generic widget styling */
.blog-sidebar .widget {
    background: var(--clr-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    padding: 28px 24px;
}

.blog-sidebar .widget-title {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--clr-black);
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--clr-red);
}

.blog-sidebar .widget ul li {
    padding: 7px 0;
    border-bottom: 1px solid var(--clr-grey-line);
    font-size: .88rem;
}

.blog-sidebar .widget ul li:last-child { border-bottom: none; }

.blog-sidebar .widget ul li a {
    color: var(--clr-grey-mid);
    transition: color var(--transition-fast), padding-left var(--transition-fast);
    display: block;
}

.blog-sidebar .widget ul li a:hover {
    color: var(--clr-red);
    padding-left: 6px;
}

/* ──────────────────────────────────────────────────────────
   8 · PAGINATION
   ────────────────────────────────────────────────────────── */
.blog-pagination .nav-links {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 0;
}

.blog-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    font-size: .88rem;
    font-weight: 500;
    color: var(--clr-grey-mid);
    background: var(--clr-white);
    border: 1px solid var(--clr-grey-line);
    transition: all var(--transition-fast);
    gap: 6px;
}

.blog-pagination .page-numbers:hover,
.blog-pagination .page-numbers.current {
    background: var(--clr-red);
    color: var(--clr-white);
    border-color: var(--clr-red);
    box-shadow: var(--shadow-btn);
}

.blog-pagination .page-numbers.dots {
    border-color: transparent;
    background: transparent;
    pointer-events: none;
}

/* ──────────────────────────────────────────────────────────
   9 · EMPTY STATE
   ────────────────────────────────────────────────────────── */
.blog-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.blog-empty__icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--clr-grey-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--clr-grey-soft);
    margin-bottom: 8px;
}

.blog-empty__icon svg { width: 36px; height: 36px; }

.blog-empty__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--clr-black);
}

.blog-empty__text {
    font-size: .95rem;
    color: var(--clr-grey-soft);
    max-width: 380px;
}

/* ──────────────────────────────────────────────────────────
   10 · SEARCH FORM (WP default override)
   ────────────────────────────────────────────────────────── */
.search-form {
    display: flex;
    gap: 8px;
    width: 100%;
    max-width: 420px;
    margin: 20px auto 0;
}

.search-field {
    flex: 1;
    font-family: var(--font-main);
    font-size: .9rem;
    padding: 10px 16px;
    border: 1.5px solid var(--clr-grey-line);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color var(--transition-fast);
}

.search-field:focus { border-color: var(--clr-red); }

.search-submit {
    font-family: var(--font-main);
    font-size: .85rem;
    font-weight: 600;
    padding: 10px 20px;
    background: var(--clr-red);
    color: var(--clr-white);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    box-shadow: var(--shadow-btn);
    transition: background var(--transition-fast),
                box-shadow var(--transition-fast);
}

.search-submit:hover {
    background: var(--clr-red-dark);
    box-shadow: var(--shadow-btn-hover);
}

/* ──────────────────────────────────────────────────────────
   11 · RESPONSIVE BREAKPOINTS
   ────────────────────────────────────────────────────────── */

/* Tablet */
@media (max-width: 1024px) {
    .blog-wrapper { padding: 48px 20px 64px; }

    .blog-main {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

/* Mobile */
@media (max-width: 640px) {
    .blog-hero { padding: 72px 20px 60px; }

    .blog-wrapper { padding: 36px 16px 56px; gap: 36px; }

    .blog-main { grid-template-columns: 1fr; gap: 20px; }

    .blog-card--featured { grid-column: 1; }

    .blog-card__body { padding: 20px; }

    .blog-card__title { font-size: 1.05rem; }

    .blog-card__btn { font-size: .78rem; padding: 8px 16px; }
}

/* ──────────────────────────────────────────────────────────
   12 · SCROLL-IN ANIMATION (Progressive enhancement)
   ────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
    .blog-card {
        opacity: 0;
        transform: translateY(24px);
        animation: cardReveal .55s var(--transition-mid) forwards;
    }

    /* Stagger cards 1–6 */
    .blog-card:nth-child(1)  { animation-delay: .05s; }
    .blog-card:nth-child(2)  { animation-delay: .12s; }
    .blog-card:nth-child(3)  { animation-delay: .19s; }
    .blog-card:nth-child(4)  { animation-delay: .26s; }
    .blog-card:nth-child(5)  { animation-delay: .33s; }
    .blog-card:nth-child(6)  { animation-delay: .40s; }
    .blog-card:nth-child(n+7){ animation-delay: .45s; }

    @keyframes cardReveal {
        to { opacity: 1; transform: translateY(0); }
    }
}