/**
 * Deadline Funnel Blog - Base Styles
 * Mobile-First Approach
 * Version: 2.1.0
 */

/* Smooth scroll for anchor links */
html {
    scroll-behavior: smooth;
}

/* ==========================================================================
   CSS Custom Properties (Design Tokens)
   ========================================================================== */
:root {
    /* Blog-specific colors (category badges, accents) - from Figma */
    --df-primary: #038181;
    --df-primary-dark: #026161;
    --df-primary-light: #CDE6E6;
    /* Yellow - Sales funnel */
    --df-accent-yellow: #CC9900;
    --df-accent-yellow-light: #FFF4CC;
    /* Red-orange - Email Marketing */
    --df-accent-red-orange: #FF4C00;
    --df-accent-red-orange-light: #FFD7CC;
    /* Blue - Shopify */
    --df-accent-blue: #004CFF;
    --df-accent-blue-light: #CCDBFF;
    /* Red - Course creators */
    --df-accent-red: #FF0000;
    --df-accent-red-light: #FFCCCC;
    /* Green - Passive income */
    --df-accent-green: #36A635;
    --df-accent-green-light: #D7EDD7;
    /* Purple - E-commerce */
    --df-accent-purple: #6B2FB5;
    --df-accent-purple-light: #E6D7FF;
    /* Pink - Sales & Marketing */
    --df-accent-pink: #D11A6F;
    --df-accent-pink-light: #FFD7EA;
    --df-text-default: #333333;
    --df-text-secondary: #727272;
    --df-text-muted: #989898;
    --df-bg-light: #FCFCFC;
    --df-bg-light-gray: #F7F7F7;
    --df-bg-pale: #FAF8F4;
    --df-bg-gray: #F5F5F5;
    --df-bg-dark-gray: #28272F;
    --df-border-light: #D8D8D8;
    --df-border-gray: #989898;

    /* Blog Layout - Mobile defaults */
    --df-container-width: 1360px;
    --df-section-padding: 60px;
    --df-card-gap: 24px;

    /* Border Radius */
    --df-radius-sm: 4px;
    --df-radius-md: 8px;
    --df-radius-lg: 12px;

    /* Shadows */
    --df-shadow-card: 0 1px 3px rgba(0, 0, 0, 0.08);
    --df-shadow-card-hover: 0 4px 16px rgba(0, 0, 0, 0.12);

    /* Transitions */
    --df-transition: 0.2s ease;
}

/* Desktop overrides */
@media (min-width: 768px) {
    :root {
        --df-section-padding: 80px;
        --df-card-gap: 32px;
    }
}

@media (min-width: 1200px) {
    :root {
        --df-card-gap: 64px 32px;
    }
}
@media (min-width: 1400px) {
    :root {
        --df-card-gap: 64px;
    }
}

/* ==========================================================================
   Base Layout (Mobile-First)
   ========================================================================== */
.df-blog-page {
    background-color: #FFFFFF;
    overflow-x: clip; /* Use clip instead of hidden to not block sticky */
}

.df-blog-container {
    max-width: var(--df-container-width);
    margin: 0 auto;
    padding: 0 15px;
}

@media (min-width: 640px) {
    .df-blog-container {
        padding: 0 30px;
    }
}

@media (min-width: 960px) {
    .df-blog-container {
        padding: 0 40px;
    }
}

/* ==========================================================================
   Breadcrumbs
   ========================================================================== */
.df-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    margin-bottom: 16px;
}

.df-breadcrumbs a {
    color: var(--df-text-muted);
    text-decoration: none;
}

.df-breadcrumbs a:hover {
    color: var(--df-primary);
}

.df-breadcrumbs__separator {
    color: var(--df-text-muted);
    display: flex;
    align-items: center;
    width: 12px;
    height: 12px;
}

.df-breadcrumbs__separator svg {
    width: 6px;
    height: 6px;
    fill: var(--df-text-muted);
}

.df-breadcrumbs__current,
.df-breadcrumbs .breadcrumb_last {
    color: var(--df-primary);
    font-weight: 600;
}

/* Yoast SEO Breadcrumbs Styling */
.df-breadcrumbs span:not(.breadcrumb_last) {
    color: var(--df-text-muted);
}

/* ==========================================================================
   Category Buttons
   ========================================================================== */
.df-category-btn {
    --cat-color: var(--df-primary);
    --cat-bg: var(--df-bg-light-gray);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 12px;
    background-color: var(--cat-bg);
    color: var(--df-text-secondary);
    border-radius: var(--df-radius-sm);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background-color var(--df-transition), color var(--df-transition);
}

.df-category-btn.df-category-btn--featured {
    margin-right: auto;
    justify-content: center;
    height: 30px;
    padding: 0 10px;
}

/* Default hover/focus/active - uses primary teal */
.df-category-btn:hover,
.df-category-btn:focus,
.df-category-btn.df-category-btn--active {
    background-color: var(--df-primary-light);
    color: var(--df-primary);
    text-decoration: none;
}

/* Category color definitions */
.df-category-btn--course-creators {
    --cat-color: var(--df-accent-yellow);
    --cat-bg-active: var(--df-accent-yellow-light);
}

.df-category-btn--email-marketing {
    --cat-color: var(--df-accent-red-orange);
    --cat-bg-active: var(--df-accent-red-orange-light);
}

.df-category-btn--sales-funnels {
    --cat-color: var(--df-accent-blue);
    --cat-bg-active: var(--df-accent-blue-light);
}

.df-category-btn--passive-income {
    --cat-color: var(--df-accent-red);
    --cat-bg-active: var(--df-accent-red-light);
}

.df-category-btn--shopify {
    --cat-color: var(--df-accent-green);
    --cat-bg-active: var(--df-accent-green-light);
}

.df-category-btn--ecommerce {
    --cat-color: var(--df-accent-purple);
    --cat-bg-active: var(--df-accent-purple-light);
}

.df-category-btn--sales-marketing {
    --cat-color: var(--df-accent-pink);
    --cat-bg-active: var(--df-accent-pink-light);
}

/* Colored state (for badges on cards/hero) */
.df-category-btn--colored {
    background-color: var(--cat-bg-active);
    color: var(--cat-color);
}

/* Hover/focus/active with category colors (specific categories only) */
.df-category-btn--course-creators:hover,
.df-category-btn--course-creators:focus,
.df-category-btn--course-creators.df-category-btn--active,
.df-category-btn--email-marketing:hover,
.df-category-btn--email-marketing:focus,
.df-category-btn--email-marketing.df-category-btn--active,
.df-category-btn--sales-funnels:hover,
.df-category-btn--sales-funnels:focus,
.df-category-btn--sales-funnels.df-category-btn--active,
.df-category-btn--passive-income:hover,
.df-category-btn--passive-income:focus,
.df-category-btn--passive-income.df-category-btn--active,
.df-category-btn--shopify:hover,
.df-category-btn--shopify:focus,
.df-category-btn--shopify.df-category-btn--active,
.df-category-btn--ecommerce:hover,
.df-category-btn--ecommerce:focus,
.df-category-btn--ecommerce.df-category-btn--active,
.df-category-btn--sales-marketing:hover,
.df-category-btn--sales-marketing:focus,
.df-category-btn--sales-marketing.df-category-btn--active {
    background-color: var(--cat-bg-active);
    color: var(--cat-color);
}

.df-category-btn.df-category-btn--all:hover, .df-category-btn.df-category-btn--all:focus, .df-category-btn.df-category-btn--all.df-category-btn--active {
    background-color: var(--df-primary-light);
    color: var(--df-primary);
}

.df-category-btn.df-category-btn--all:hover svg path, .df-category-btn.df-category-btn--all:focus svg path, .df-category-btn.df-category-btn--all.df-category-btn--active svg path {
    stroke: var(--df-primary-light);
}

/* Icon badges */
.df-post-card__category-icon {
    position: absolute;
    bottom: 10px;
    left: 10px;
    z-index: 2;
    width: 40px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #FFFFFF;
    border-radius: var(--df-radius-sm);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.df-post-card__category-icon svg {
    width: 14px;
    height: 14px;
}

/* Category icon colors matching Figma design */
.df-category-icon--course-creators {
    background-color: var(--df-accent-yellow-light);
    color: var(--df-accent-yellow);
}

.df-category-icon--email-marketing {
    background-color: var(--df-accent-red-orange-light);
    color: var(--df-accent-red-orange);
}

.df-category-icon--sales-funnels {
    background-color: var(--df-accent-blue-light);
    color: var(--df-accent-blue);
}

.df-category-icon--passive-income {
    background-color: var(--df-accent-red-light);
    color: var(--df-accent-red);
}

.df-category-icon--shopify {
    background-color: var(--df-accent-green-light);
    color: var(--df-accent-green);
}

.df-category-icon--ecommerce {
    background-color: var(--df-accent-purple-light);
    color: var(--df-accent-purple);
}

.df-category-icon--sales-marketing {
    background-color: var(--df-accent-pink-light);
    color: var(--df-accent-pink);
}

.df-category-icon--default {
    background-color: var(--df-primary-light);
    color: var(--df-primary);
}

/* ==========================================================================
   Post Card (Mobile-First)
   ========================================================================== */
.df-post-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    background-color: #FFFFFF;
    min-width: 0;
    transition: transform var(--df-transition);
}


.df-post-card__image {
    position: relative;
    height: 180px;
    overflow: hidden;
    background-color: var(--df-bg-gray);
    border-radius: var(--df-radius-md);
}

@media (min-width: 576px) {
    .df-post-card__image {
        height: 200px;
    }
}

@media (min-width: 768px) {
    .df-post-card__image {
        height: 240px;
    }
}

.df-post-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--df-radius-md);
    transition: transform var(--df-transition);
}

.df-post-card:hover .df-post-card__image img {
    transform: scale(1.03);
}

.df-post-card__content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.df-post-card__meta {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 12px;
    color: var(--df-text-muted);
}

@media (min-width: 576px) {
    .df-post-card__meta {
        align-items: center;
    }
}

.df-post-card__author {
    margin-right: 0;
    width: 100%;
}

@media (min-width: 480px) {
    .df-post-card__author {
        margin-left: auto;
        margin-right: 4px;
        width: auto;
    }
}

.df-post-card__author a {
    color: var(--df-primary);
    text-decoration: none;
    font-weight: 500;
}

.df-post-card__author a:hover {
    text-decoration: underline;
}

.df-post-card__title {
    font-family: "Cooper", sans-serif;
    font-size: 20px;
    line-height: 1.25;
    margin: 0;
    letter-spacing: 0.36px;
    text-wrap: auto;
    hyphens: none;
    -webkit-hyphens: none;
    word-break: normal;
    overflow-wrap: normal;
}

@media (min-width: 768px) {
    .df-post-card__title {
        font-size: 22px;
    }
}

.df-post-card__title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease ;
}

.df-post-card__title a:hover,
.df-post-card:hover a {
    color: var(--df-primary);
}

/* ==========================================================================
   Grid & Sections (Mobile-First)
   ========================================================================== */
.df-blog-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--df-card-gap);
}

@media (min-width: 576px) {
    .df-blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .df-blog-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .df-post-card {
        max-width: 384px;
    }
}

.df-blog-section {
    padding: var(--df-section-padding) 0;
}

.df-blog-section#latest-articles ~ .df-blog-section.df-blog-section--banner {
    padding-top: 0;
}

.df-blog-section__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.df-blog-section__title {
    color: #333333;
    margin: 0;
    letter-spacing: 0.64px;
}

@media (min-width: 768px) {
    .df-blog-section__title {
        font-size: 42px;
    }
}

/* ==========================================================================
   Pagination
   ========================================================================== */
.df-blog-pagination {
    display: flex;
    justify-content: center;
    gap: 0;
    padding: 32px 0 0;
}

@media (min-width: 1200px) {
    .df-blog-pagination {
        padding: 64px 0 0;
    }
}

.df-blog-pagination:not(:has(.df-blog-pagination__btn)) {
    padding: 0;
}

.df-blog-pagination__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--df-text-secondary);
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--df-transition);
}

.df-blog-pagination__btn:hover {
    background-color: var(--df-bg-light-gray);
    color: var(--df-primary);
}

.df-blog-pagination__btn--active {
    background-color: var(--df-primary);
    color: #FFFFFF;
}

.df-blog-pagination__dots {
    color: var(--df-text-muted);
    font-size: 12px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================================================
   CTA Banner (Mobile-First)
   ========================================================================== */
.df-blog-banner {
    background-color: var(--df-primary);
    border-radius: var(--df-radius-lg);
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    max-width: var(--df-container-width);
    margin: 0 auto;
}

@media (min-width: 768px) { 
    .df-blog-banner {
        gap: 24px;
    }
}

.df-blog-banner__image {
    order: -1;
    flex-shrink: 0;
    max-width: 352px;
    max-height: 322px;
    width: 100%;
    height: auto;
}

.df-blog-banner__image img {
    max-width: 352px;
    max-height: 322px;
}

.df-blog-banner__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    max-width: 100%;
}

@media (min-width: 768px) {
    .df-blog-banner__content {
        gap: 16px;
    }
}

.df-blog-banner__title {
    color: #FFFFFF;
    margin: 0;
    letter-spacing: 0.84px;
    line-height: 1.2;
    text-wrap: auto;
}

.df-blog-banner__text {
    font-size: 16px;
    line-height: 1.5;
    color: #FFFFFF;
    margin: 0;
}

.df-blog-banner__btn {
    padding: 12px 40px;
    height: auto;
    background-color: var(--df-bg-light);
    color: var(--df-primary-dark);
    width: fit-content;
}

.df-blog-banner__title ~ .df-blog-banner__btn {
    margin-top: 20px;
}

.df-blog-banner__btn:hover {
    background-color: #FFFFFF;
    transform: translateY(-1px);
}

.df-blog-banner__image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Tablet styles */
@media (min-width: 576px) {

    .df-blog-banner__text {
        font-size: 18px;
    }
}

/* Desktop styles */
@media (min-width: 1024px) {
    .df-blog-banner {
        flex-direction: row;
        text-align: left;
        padding: 20px 62px 20px 80px;
        height: 360px;
        gap: 20px;
    }

    .df-blog-banner__image {
        order: 0;
    }

    .df-blog-banner__content {
        align-items: flex-start;
        gap: 24px;
        max-width: 685px;
    }

    .df-blog-banner__content:not(:has(.df-blog-banner__text)) {
        min-height: 182px;
        justify-content: space-between;
    }

    .df-blog-banner__title {
        line-height: 1.2;
    }

    .df-blog-banner__text {
        line-height: 22px;
    }
}

/* Light variant */
.df-blog-banner--light {
    background-color: var(--df-primary-light);
}

.df-blog-banner--light .df-blog-banner__title,
.df-blog-banner--light .df-blog-banner__text {
    color: #333333;
}

.df-blog-banner--light .df-blog-banner__btn {
    background-color: var(--df-primary);
    color: #FFFFFF;
}

/* ==========================================================================
   Loading States
   ========================================================================== */
@keyframes df-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes df-shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

#df-blog-grid-container {
    position: relative;
    min-height: 400px;
    padding-top: 24px;
}

@media (min-width: 768px) {
    #df-blog-grid-container {
        min-height: 600px;
        padding-top: 32px;
    }
}

#df-blog-grid-container.is-loading::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.85);
    z-index: 10;
}

#df-blog-grid-container.is-loading::after {
    content: '';
    position: absolute;
    top: 150px;
    left: 50%;
    width: 40px;
    height: 40px;
    margin-left: -20px;
    border: 3px solid var(--df-border-light);
    border-top-color: var(--df-primary);
    border-radius: 50%;
    animation: df-spin 0.8s linear infinite;
    z-index: 11;
}

@media (min-width: 768px) {
    #df-blog-grid-container.is-loading::after {
        top: 200px;
    }
}

.df-blog-no-posts {
    grid-column: 1 / -1;
    text-align: center;
    padding: 32px 16px;
    color: var(--df-text-secondary);
}

@media (min-width: 768px) {
    .df-blog-no-posts {
        padding: 48px 24px;
    }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

.df-category-btn:focus-visible,
.df-post-card:focus-visible,
.df-blog-pagination__btn:focus-visible {
    outline: 2px solid var(--df-primary);
    outline-offset: 2px;
    color: #fff;
}

/* ==========================================================================
   Print
   ========================================================================== */
@media print {

    .df-blog-search,
    .df-blog-categories,
    .df-blog-banner,
    .df-blog-pagination {
        display: none !important;
    }
}