/*
 * .blog-hero — Hero banner section at the top of the blog listing page.
 * Provides generous top padding to visually separate the heading from the
 * site navigation, and centres all child content via text-align.
 * The commented-out background-color allows quick colour changes without
 * removing the declaration entirely.
 */
.blog-hero {
    /* background-color: #f5f0eb;*/
    padding: 80px 24px 24px;
    text-align: center;
}

/*
 * .blog-hero__inner — Constrained-width wrapper inside the hero banner.
 * Limits the heading and subheading to a readable measure and centres
 * the block horizontally with auto margins.
 */
.blog-hero__inner {
    max-width: 720px;
    margin: 0 auto;
}

/*
 * .blog-hero__heading — Primary page heading displayed inside the hero.
 * Uses clamp() so the font scales fluidly between small and large screens
 * without needing breakpoints. Tight letter-spacing and a dark colour give
 * it strong visual hierarchy.
 */
.blog-hero__heading {
    font-size: clamp(2rem, 5vw, 3.25rem);
    font-weight: 700;
    color: #111827;
    line-height: 1.15;
    margin: 0 0 20px;
    letter-spacing: -0.5px;
}

/*
 * .blog-hero__subheading — Descriptive subtitle beneath the hero heading.
 * Slightly muted colour and relaxed line-height aid readability. The max-width
 * and margin-inline: auto keep the text narrower than its parent so long lines
 * don't stretch uncomfortably wide.
 */
.blog-hero__subheading {
    font-size: clamp(1rem, 2vw, 1.125rem);
    color: #6b7280;
    line-height: 1.65;
    margin: 0;
    max-width: 560px;
    margin-inline: auto;
}

/*
 * @media (max-width: 768px) — Tablet and mobile adjustments for the blog hero.
 * Reduces the top and bottom padding so the hero takes up less screen real
 * estate on smaller viewports where vertical space is more limited.
 */
@media (max-width: 768px) {
    .blog-hero {
        padding: 56px 20px;
    }
}


/* ═══════════════════════════════════════════════════════════
   BLOG LISTING
═══════════════════════════════════════════════════════════ */

/*
 * .blog-listing — Outer section wrapper for the blog post listing area.
 * Handles horizontal padding and bottom spacing for the whole list, and
 * sets the base typeface used throughout all listing cards and UI below.
 */
.blog-listing {
    padding: 16px 80px 64px;
    font-family: 'Work Sans', sans-serif;
}

/*
 * .blog-listing__inner — Centred, max-width column that holds all listing
 * content (featured card, grid, pagination). flex-direction: column with a
 * gap stacks these sections with consistent vertical rhythm.
 */
.blog-listing__inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

/*
 * .blog-meta — Shared meta-information row used on both listing cards and
 * the full article view. Displays the clock icon, read-time text, separator,
 * and date in a single inline row using flex with small gaps.
 */
.blog-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8125rem;
    color: #6b7280;
}

/*
 * .blog-meta--light — Colour modifier for .blog-meta when it appears on a
 * dark or image background (e.g. inside the featured card overlay). Switches
 * the text to a semi-transparent white so it remains legible.
 */
.blog-meta--light {
    color: rgba(255, 255, 255, 0.8);
}

/*
 * .blog-meta__icon — SVG icon (clock) displayed at the start of the meta row.
 * flex-shrink: 0 prevents the icon from collapsing when the row is narrow,
 * and color: inherit ensures it matches the parent meta colour modifier.
 */
.blog-meta__icon {
    flex-shrink: 0;
    color: inherit;
}

/*
 * .blog-meta__sep — Bullet or dot separator between meta items (read time and
 * date). Reduced font-size and partial opacity make it visually subordinate
 * to the surrounding text while still providing clear separation.
 */
.blog-meta__sep {
    font-size: 0.625rem;
    opacity: 0.6;
}

/*
 * .blog-featured-card — Large hero-style card that highlights the most recent
 * or featured blog post. It stretches to fill the listing column, shows a
 * cover image via background-image, and uses flexbox to pin its text content
 * to the bottom edge of the card over a dark overlay.
 */
.blog-featured-card {
    position: relative;
    min-height: 360px;
    border-radius: 14px;
    overflow: hidden;
    background-color: #1a1a2e;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
}

/*
 * .blog-featured-card__overlay — Semi-transparent gradient layer that sits
 * over the background image. The gradient darkens the bottom of the image
 * heavily (0.78 opacity) while fading to transparent at the top, ensuring
 * the white text content remains legible against any photo.
 */
.blog-featured-card__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.78) 0%, rgba(0,0,0,0.18) 60%, transparent 100%);
    z-index: 1;
}

/*
 * .blog-featured-card__content — Text content block (badge, title, excerpt)
 * rendered above the overlay via z-index: 2. flex-direction: column with a
 * gap stacks the children with even spacing, and max-width prevents the text
 * from becoming too wide on large screens.
 */
.blog-featured-card__content {
    position: relative;
    z-index: 2;
    padding: 36px 40px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 680px;
}

/*
 * .blog-featured-badge — "Featured" pill label displayed above the title on
 * the featured card. The bright yellow background and bold uppercase-like
 * letter-spacing draw the eye, while a very high border-radius creates the
 * rounded pill shape.
 */
.blog-featured-badge {
    display: inline-flex;
    align-items: center;
    background: #f5c800;
    color: #1a1a1a;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 4px 12px;
    border-radius: 999px;
    align-self: flex-start;
}

/*
 * .blog-featured-card__title — Post title displayed on the featured card.
 * Uses clamp() for fluid scaling so the heading reads well from mobile to
 * desktop without breakpoint overrides. White text contrasts against the
 * darkened card overlay.
 */
.blog-featured-card__title {
    font-size: clamp(1.25rem, 3vw, 1.875rem);
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
    margin: 0;
}

/*
 * .blog-featured-card__excerpt — Short post summary on the featured card.
 * Slightly transparent white keeps it subordinate to the title. The
 * -webkit-line-clamp and overflow: hidden combination truncates the text to
 * two lines so the card stays a consistent height regardless of excerpt length.
 */
.blog-featured-card__excerpt {
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.55;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/*
 * .blog-grid — CSS grid container that lays out the regular blog post cards
 * in a three-column row. The uniform gap between columns and rows maintains
 * consistent spacing across the entire grid.
 */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

/*
 * .blog-card — Individual post card in the blog listing grid. Uses a column
 * flex layout so the image, body, and CTA link stack vertically. A subtle
 * multi-layer box-shadow gives the card a slight lift off the page, and the
 * transition animates the shadow on hover.
 */
.blog-card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.06);
    transition: box-shadow 0.2s ease;
}

/*
 * .blog-card:hover — Elevated shadow state when the user hovers over a card.
 * The stronger shadow increases perceived depth, providing a clear interactive
 * affordance without altering the card's size or layout.
 */
.blog-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08), 0 8px 28px rgba(0,0,0,0.1);
}

/*
 * .blog-card__image-wrap — Fixed-ratio container for the card thumbnail.
 * aspect-ratio: 16 / 9 ensures every card thumbnail is the same height
 * regardless of the original image dimensions. overflow: hidden clips the
 * image during the zoom-in hover transition.
 */
.blog-card__image-wrap {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    flex-shrink: 0;
}

/*
 * .blog-card__image — The thumbnail image itself, sized to fill its container
 * with object-fit: cover so the image never distorts. The transition enables
 * the smooth scale animation triggered on card hover.
 */
.blog-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

/*
 * .blog-card:hover .blog-card__image — Subtle zoom-in effect on the card
 * thumbnail when the user hovers. The slight scale increase (1.04) adds visual
 * polish without being distracting, and is clipped by the image-wrap's
 * overflow: hidden.
 */
.blog-card:hover .blog-card__image {
    transform: scale(1.04);
}

/*
 * .blog-card__body — Text content area of the card, holding the meta row,
 * title, excerpt, and read-more link. flex: 1 lets this section grow to fill
 * remaining card height so all cards in a row align their bottom edges.
 */
.blog-card__body {
    padding: 20px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

/*
 * .blog-card__title — Post headline inside a listing card. Bold weight and
 * a dark near-black colour establish clear hierarchy over the excerpt text
 * below it.
 */
.blog-card__title {
    font-size: 1.0625rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.35;
    margin: 0;
}

/*
 * .blog-card__excerpt — Truncated post summary shown on each listing card.
 * flex: 1 pushes the read-more link to the bottom of the card. The
 * -webkit-line-clamp limits the excerpt to three lines so all cards remain
 * consistent in height.
 */
.blog-card__excerpt {
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.6;
    margin: 0;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card__read-more {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #1C48AA;
    text-decoration: none;
    margin-top: auto;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}

.blog-card__read-more:hover {
    text-decoration: underline;
}

.blog-featured-card .blog-card__read-more {
    color: #f5c800;
}

.blog-featured-card .blog-card__read-more:hover {
    color: #e6b800;
}


.blog-grid-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 -56px;
}

.blog-grid-container .blog-grid {
    flex: 1;
    min-width: 0;
}

.blog-nav-btn {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #1C48AA;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    transition: background 0.18s ease;
}

.blog-nav-btn:hover:not(:disabled) {
    background: #1C48AA;
}

.blog-nav-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}


/* ═══════════════════════════════════════════════════════════
   FULL-POST ARTICLE VIEW
═══════════════════════════════════════════════════════════ */

/*
 * .blog-full-view — Wrapper section that houses the expanded single-post
 * reading view. Hidden by default (display: none) and only shown when a post
 * is opened, at which point the .has-active class is toggled on via JavaScript.
 */
.blog-full-view {
    display: none;
    padding: 0 24px 80px;
    font-family: 'Work Sans', sans-serif;
}

/*
 * .blog-full-view.has-active — Active state that makes the full-post view
 * visible. Set by JavaScript when the user clicks a card's read-more link,
 * switching display from none to block to reveal the article below the listing.
 */
.blog-full-view.has-active {
    display: block;
}

/*
 * .blog-article — Individual article container within the full-post view.
 * Each post is rendered in its own .blog-article and hidden by default.
 * A top border and padding create a clear visual break between the listing
 * section above and the article content.
 */
.blog-article {
    display: none;
    border-top: 1px solid #e5e7eb;
    padding-top: 40px;
    margin-top: 40px;
}

/*
 * .blog-article.is-active — State class applied to the article currently
 * being read. Switches the article from hidden to visible (display: block)
 * when the matching post is opened.
 */
.blog-article.is-active {
    display: block;
}

/*
 * .blog-article__inner — Narrow centred column for article body content.
 * max-width: 760px keeps line lengths within a comfortable reading measure.
 * The column flex layout with a small gap provides consistent rhythm between
 * the article's child elements.
 */
.blog-article__inner {
    max-width: 760px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/*
 * .blog-article__meta — Container for the meta row (read time, date) shown
 * above the article title. The small bottom margin separates it from the
 * heading without adding too much vertical space.
 */
.blog-article__meta {
    margin-bottom: 8px;
}

/*
 * .blog-article__title — Main heading of the full blog post. clamp() gives
 * fluid sizing between a comfortable mobile size and a large desktop display.
 * Tight letter-spacing and a near-black colour reinforce strong typographic
 * hierarchy at the top of the article.
 */
.blog-article__title {
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 700;
    color: #111827;
    line-height: 1.15;
    margin: 0 0 4px;
    letter-spacing: -0.4px;
}

/*
 * .blog-article__excerpt — Lead paragraph or deck text displayed directly
 * below the article title. Slightly larger than body copy and with relaxed
 * line-height, it acts as a brief introductory summary before the main content.
 */
.blog-article__excerpt {
    font-size: 1.0625rem;
    color: #374151;
    line-height: 1.7;
    margin: 16px 0 28px;
}

/*
 * .blog-article__section-subtext — Supporting or explanatory text that appears
 * directly beneath a section header. The left padding visually indents it
 * relative to the header, and the muted colour distinguishes it from primary
 * body copy.
 */
.blog-article__section-subtext {
    font-size: 1rem;
    color: #6b7280;
    line-height: 1.7;
    padding-left: 20px;
    margin: -8px 0 16px;
}

/*
 * .blog-article__section — A discrete content block within the article body,
 * typically comprising a section header and one or more paragraphs. The bottom
 * margin creates consistent breathing room between consecutive sections.
 */
.blog-article__section {
    margin-bottom: 32px;
}

/*
 * .blog-article__section-header — Sub-heading that labels each section of the
 * article. clamp() keeps it proportionally sized across screen widths, and the
 * bottom margin separates it clearly from the content that follows.
 */
.blog-article__section-header {
    font-size: clamp(1.125rem, 2.5vw, 1.5rem);
    font-weight: 700;
    color: #111827;
    line-height: 1.25;
    margin: 0 0 14px;
}

/*
 * .blog-article__content — Primary body-copy container inside each article
 * section. Generous line-height (1.75) and a slightly softened text colour
 * optimise reading comfort for longer passages.
 */
.blog-article__content {
    font-size: 1rem;
    color: #374151;
    line-height: 1.75;
}

/*
 * .blog-article__content p — Paragraph spacing within article body copy.
 * Bottom margin on each paragraph creates visual separation between thoughts
 * without requiring extra wrapper elements.
 */
.blog-article__content p {
    margin: 0 0 16px;
}

/*
 * .blog-article__content p:last-child — Removes the bottom margin from the
 * final paragraph in a content block so there is no extra space between the
 * last line of text and whatever element follows.
 */
.blog-article__content p:last-child {
    margin-bottom: 0;
}

/*
 * .blog-article__content strong — Bold inline text within article body copy.
 * Uses a slightly darker colour than the surrounding paragraph text to give
 * emphasised words additional visual weight beyond bold alone.
 */
.blog-article__content strong {
    color: #111827;
    font-weight: 600;
}

/*
 * .blog-article__figure — Wrapper element for in-article images and their
 * captions. Top margin creates breathing room between a figure and the
 * paragraph or section header that precedes it.
 */
.blog-article__figure {
    margin: 24px 0 0;
}

/*
 * .blog-article__image — Full-width image inside an article figure. The
 * rounded corners soften the appearance and match the card style used
 * elsewhere on the page, maintaining visual consistency.
 */
.blog-article__image {
    width: 100%;
    border-radius: 10px;
    display: block;
}

/*
 * .blog-article__caption — Descriptive caption displayed below an article
 * image. Small size, italic style, and muted colour ensure it is visually
 * subordinate to the image and body copy, functioning as supplementary
 * context rather than primary content.
 */
.blog-article__caption {
    font-size: 0.8125rem;
    color: #6b7280;
    font-style: italic;
    text-align: center;
    margin: 10px 0 0;
}

/*
 * .blog-back-btn — "Back to blog" navigation button displayed at the top
 * (and optionally the bottom) of a full article. Styled as a borderless
 * text link with an arrow icon rather than a traditional button, keeping
 * the article reading area visually clean.
 */
.blog-article__footer-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

.blog-article__nav-article {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #1C48AA;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: 'Work Sans', sans-serif;
    white-space: nowrap;
}

.blog-article__nav-article:hover {
    text-decoration: underline;
}

.blog-article__nav-article--prev {
    justify-self: start;
}

.blog-article__nav-article--next {
    justify-self: end;
}


@media (max-width: 600px) {
    .blog-article__footer-nav {
        gap: 8px;
    }

    .blog-article__nav-article {
        font-size: 0.75rem;
    }
}


/*
 * .blog-article__cta — Call-to-action box displayed at the end of each full
 * article, prompting the reader to take a next step (e.g. sign up or explore
 * a product). The soft gradient background and generous padding give it a
 * card-like appearance that stands out from the article body without being
 * visually jarring.
 */
.blog-article__cta {
    margin-top: 48px;
    background: linear-gradient(135deg, #eef1f8 0%, #e4e9f4 100%);
    border-radius: 16px;
    padding: 40px 36px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

/*
 * .blog-article__cta-heading — Headline text inside the article CTA box.
 * Bold weight and dark colour ensure it reads clearly against the light
 * gradient background and draws the reader's eye to the call-to-action.
 */
.blog-article__cta-heading {
    font-size: 1.125rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
    line-height: 1.35;
}

/*
 * .blog-article__cta-btn — Primary action button inside the article CTA box.
 * The solid brand-blue fill, pill shape (border-radius: 999px), and generous
 * padding make it the most visually prominent element in the CTA. The
 * transition animates the background on hover for a polished feel.
 */
.blog-article__cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
    background-color: #1C48AA;
    color: #ffffff;
    font-size: 1.2rem;
    font-weight: bold;
    padding: 15px 30px;
    border-radius: 6px;
    text-decoration: none;
    transition: background-color 0.2s;
}

.blog-article__cta-btn:hover {
    background-color: #1C48AA;
}


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

/*
 * @media (max-width: 960px) — Tablet breakpoint adjustments.
 * Collapses the three-column blog grid to two columns so cards remain a
 * comfortable width on medium-sized screens like tablets in landscape orientation.
 */
@media (max-width: 960px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/*
 * @media (max-width: 600px) — Mobile breakpoint adjustments for the blog section.
 * Reduces padding on the listing wrapper, switches the grid to a single column
 * so cards stack vertically, shrinks the featured card's minimum height, tightens
 * the featured card's inner padding, and reduces side padding on the full article
 * view — all optimised for narrow phone screens.
 */
@media (max-width: 600px) {
    .blog-listing {
        padding: 32px 16px 48px;
    }

    .blog-featured-card {
        min-height: 280px;
    }

    .blog-featured-card__content {
        padding: 24px 20px;
    }

    .blog-full-view {
        padding: 0 16px 56px;
    }

    .blog-grid-container {
        position: relative;
        margin: 0;
        padding: 16px 48px;
        background: #f8f9fa;
        border-radius: 12px;
        overflow: hidden;
        display: flex;
        align-items: center;
    }

    .blog-nav-btn {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 36px;
        height: 36px;
        z-index: 10;
    }

    #blog-prev { left: 6px; }
    #blog-next { right: 6px; }

    .blog-grid {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 16px;
        width: 100%;
        border-radius: 12px;
    }

    .blog-grid::-webkit-scrollbar {
        display: none;
    }

    .blog-card {
        flex: 0 0 100%;
        min-width: 100%;
        scroll-snap-align: start;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08), 0 8px 28px rgba(0,0,0,0.1);
    }
}
