/* ==========================================================================
   Homepage Template CSS (page-home.php)
   100% Matching savourthepho.com layout, aesthetics & responsive design
   ========================================================================== */

/* 1. Full-width Base & Reset for Homepage */
body.page-template-page-home,
body.home,
body.front-page {
    background-color: #ffffff !important;
    color: #1e293b;
}

body.page-template-page-home .site-content,
body.page-template-page-home #primary,
body.home .site-content,
body.home #primary,
body.front-page .site-content,
body.front-page #primary {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

body.page-template-page-home #page,
body.home #page,
body.front-page #page {
    max-width: 100% !important;
}

body.page-template-page-home #sidebar,
body.page-template-page-home .widget-area,
body.page-template-page-home .post-thumbnail,
body.page-template-page-home .featured-image,
body.page-template-page-home .generate-featured-image,
body.page-template-page-home .wp-block-post-featured-image,
body.home #sidebar,
body.home .widget-area,
body.home .post-thumbnail,
body.home .featured-image,
body.home .generate-featured-image,
body.home .wp-block-post-featured-image,
body.front-page #sidebar,
body.front-page .widget-area,
body.front-page .post-thumbnail,
body.front-page .featured-image,
body.front-page .generate-featured-image,
body.front-page .wp-block-post-featured-image {
    display: none !important;
}

/* 2. Container & Section Wrappers */
.stp-home-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

.stp-home-section {
    position: relative;
}

/* 3. Section Headers & Dividers */
.stp-home-section-header {
    text-align: center;
    margin-bottom: 36px;
}

.stp-home-preheading {
    display: block;
    font-family: 'Figtree', -apple-system, sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--stp-primary, #b91c1c);
    margin-bottom: 8px;
}

.stp-home-heading {
    font-family: 'Lora', Georgia, serif;
    font-size: clamp(22px, 2.6vw, 28px);
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #0f172a;
    text-align: center;
    margin: 0 0 16px;
    line-height: 1.3;
}

.stp-home-divider {
    width: 52px;
    height: 3px;
    background: var(--stp-primary, #b91c1c);
    margin: 0 auto;
    border-radius: 3px;
}

/* 4. Hero Section */
.stp-home-hero {
    background: #ffffff;
    padding: 44px 0 5px;
    text-align: center;
    border-bottom: 1px solid #f1f5f9;
}

.stp-home-hero__title {
    font-family: 'Lora', Georgia, serif;
    font-size: clamp(19px, 2.4vw, 24px);
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #0f172a;
    text-transform: uppercase;
    margin: 0 0 16px;
    line-height: 1.35;
}

.stp-home-hero__desc {
    font-family: 'Figtree', -apple-system, sans-serif;
    font-size: clamp(15px, 1.4vw, 17px);
    line-height: 1.75;
    color: #475569;
    max-width: 740px;
    margin: 20px auto 0;
}

.stp-home-hero__desc strong {
    color: #0f172a;
    font-weight: 600;
}

/* 5. Recipe Grid & Cards */
.stp-home-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px 22px;
    margin: 32px 0 0;
    padding: 0;
    list-style: none;
}

.stp-home-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.stp-home-card__thumb-link {
    display: block;
    text-decoration: none;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    background: #f8fafc;
}

.stp-home-card__thumb-wrap {
    aspect-ratio: 3 / 4;
    width: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    background: #f1f5f9;
}

.stp-home-card__img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1) !important;
}

.stp-home-card:hover .stp-home-card__img {
    transform: scale(1.05) !important;
}

.stp-home-card__fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fef2f2;
    color: var(--stp-primary, #b91c1c);
    font-size: 40px;
    font-weight: 700;
    font-family: 'Lora', Georgia, serif;
}

.stp-home-card__body {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4px 4px 0;
}

.stp-home-card__title {
    font-family: 'Figtree', -apple-system, sans-serif;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    color: #0f172a;
    margin: 12px 0 0;
    text-align: center;
}

.stp-home-card__title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.18s ease;
}

.stp-home-card__title a:hover,
.stp-home-card:hover .stp-home-card__title a {
    color: var(--stp-primary, #b91c1c);
}

/* Star rating row inside card */
.stp-card-rating {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 7px;
    line-height: 1;
}

.stp-card-stars {
    display: inline-flex;
    align-items: center;
    gap: 1px;
}

.stp-card-star {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
    fill: #d1d5db;       /* empty — grey */
    stroke: none;
}

.stp-card-star--full {
    fill: #f59e0b;       /* filled — amber */
}

.stp-card-star--half {
    fill: url(#stp-star-half-grad);
    /* fallback: show partial amber via clip */
    fill: #f59e0b;
    opacity: 0.65;
}

.stp-card-rating-value {
    font-family: 'Figtree', -apple-system, sans-serif;
    font-size: 12.5px;
    font-weight: 700;
    color: #374151;
    line-height: 1;
}

.stp-card-rating-count {
    font-family: 'Figtree', -apple-system, sans-serif;
    font-size: 12px;
    font-weight: 400;
    color: #9ca3af;
    line-height: 1;
}


/* 6. Buttons & View All */
.stp-home-view-all {
    text-align: center;
    margin-top: 40px;
}

.stp-home-pill-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: 'Figtree', -apple-system, sans-serif;
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    padding: 12px 32px;
    border-radius: 9999px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 12px rgba(185, 28, 28, 0.2);
}

.stp-home-pill-btn--primary {
    background: var(--stp-primary, #b91c1c);
    color: #ffffff !important;
    border: none;
}

.stp-home-pill-btn--primary:hover {
    background: #991b1b;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(185, 28, 28, 0.32);
    color: #ffffff !important;
}

/* 7. Pagination */
.stp-home-pagination {
    margin: 44px 0 10px;
    text-align: center;
}

.stp-home-pagination ul.page-numbers {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.stp-home-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 8px;
    font-family: 'Figtree', -apple-system, sans-serif;
    font-size: 14.5px;
    font-weight: 600;
    color: #334155;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    text-decoration: none;
    transition: all 0.15s ease;
}

.stp-home-pagination .page-numbers:hover {
    color: var(--stp-primary, #b91c1c);
    border-color: var(--stp-primary, #b91c1c);
    background: #fef2f2;
}

.stp-home-pagination .page-numbers.current {
    background: var(--stp-primary, #b91c1c);
    border-color: var(--stp-primary, #b91c1c);
    color: #ffffff;
}

.stp-home-pagination .page-numbers.dots {
    border: none;
    background: transparent;
    color: #94a3b8;
}

/* 8. Substack Newsletter Card */
.stp-home-newsletter-section {
    padding: 24px 0 40px;
}

.stp-home-newsletter-card {
    padding: 8px;
}

/* 9. Welcome & Cooking Demystified Section (2 Columns) */
.stp-home-welcome-section {
    background: #faf8f5;
    border-top: 1px solid #f1ece4;
    border-bottom: 1px solid #f1ece4;
    padding: 60px 0;
}

.stp-home-welcome-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 48px;
    align-items: center;
}

.stp-home-welcome-card {
    display: flex;
    gap: 28px;
    align-items: flex-start;
    background: #ffffff;
    border-radius: 16px;
    padding: 32px 30px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
    border: 1px solid #f1ede7;
}

.stp-home-welcome-avatar-wrap {
    flex-shrink: 0;
}

.stp-home-welcome-avatar {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    border: 4px solid #ffffff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
}

.stp-home-welcome-text {
    flex: 1;
}

.stp-home-welcome-title {
    font-family: 'Lora', Georgia, serif;
    font-size: 23px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 14px;
    line-height: 1.3;
}

.stp-home-welcome-bio {
    font-family: 'Figtree', -apple-system, sans-serif;
    font-size: 15px;
    line-height: 1.7;
    color: #475569;
    margin-bottom: 22px;
    text-align: center;
}

.stp-home-welcome-bio strong {
    color: #0f172a;
}

.stp-home-welcome-btn-wrap {
    margin-top: 10px;
    text-align: center;
}

/* Right: Demystified Pillar Pills */
.stp-home-demystified-card {
    text-align: center;
}

.stp-home-demystified-title {
    font-family: 'Lora', Georgia, serif;
    font-size: 21px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 24px;
}

.stp-home-demystified-links {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 380px;
    margin: 0 auto;
}

.stp-home-large-pill {
    display: block;
    background: #872c03;
    color: #ffffff !important;
    text-decoration: none;
    font-family: 'Figtree', -apple-system, sans-serif;
    font-size: 15.5px;
    font-weight: 600;
    padding: 14px 22px;
    border-radius: 9999px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 14px rgba(135, 44, 3, 0.22);
}

.stp-home-large-pill:hover {
    background: #6e2402;
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(135, 44, 3, 0.32);
    color: #ffffff !important;
}

/* 10. Regional & Appliance Circular Icon Grid (12 Items) */
.stp-home-categories-section {
    padding: 54px 0;
}

.stp-home-cat-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 28px 16px;
    justify-items: center;
}

.stp-home-cat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #1e293b;
    transition: all 0.2s ease;
    width: 100%;
    max-width: 210px;
}

.stp-home-cat-icon-wrap {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    border: 3px solid #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
}

.stp-home-cat-icon {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
}

.stp-home-cat-name {
    font-family: 'Figtree', -apple-system, sans-serif;
    font-size: 14px;
    font-weight: 600;
    margin-top: 10px;
    text-align: center;
    line-height: 1.35;
    transition: color 0.18s ease;
}

.stp-home-cat-item:hover .stp-home-cat-icon-wrap {
    transform: scale(1.08);
    box-shadow: 0 8px 22px rgba(185, 28, 28, 0.2);
}

.stp-home-cat-item:hover .stp-home-cat-name {
    color: var(--stp-primary, #b91c1c);
}

/* 11. Sweet Treats Ingredients Pills (5 Items) */
.stp-home-sweets-section {
    background: #faf8f5;
    border-top: 1px solid #f1ece4;
    border-bottom: 1px solid #f1ece4;
}

.stp-home-sweet-pills {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 32px;
    margin: 28px 0 10px;
}

.stp-home-sweet-pills .stp-home-cat-item {
    max-width: 110px;
}

/* 12. Beyond the Pho (4 Feature Cards) */
.stp-home-beyond-section {
    padding: 60px 0 80px;
}

.stp-home-beyond-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 26px;
    margin-top: 32px;
}

.stp-home-beyond-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: #0f172a;
}

.stp-home-beyond-card__thumb {
    aspect-ratio: 3 / 4;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: #f1f5f9;
}

.stp-home-beyond-card__img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1) !important;
}

.stp-home-beyond-card:hover .stp-home-beyond-card__img {
    transform: scale(1.06) !important;
}

.stp-home-beyond-card__title {
    font-family: 'Figtree', -apple-system, sans-serif;
    font-size: 16.5px;
    font-weight: 700;
    margin: 14px 0 0;
    text-align: center;
    line-height: 1.35;
    color: #0f172a;
    transition: color 0.18s ease;
}

.stp-home-beyond-card:hover .stp-home-beyond-card__title {
    color: var(--stp-primary, #b91c1c);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

@media (max-width: 1024px) {
    .stp-home-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 26px 18px;
    }

    .stp-home-welcome-grid {
        grid-template-columns: 1fr;
        gap: 36px;
    }

    .stp-home-cat-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 24px 14px;
    }

    .stp-home-beyond-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 22px;
    }
}

@media (max-width: 768px) {
    .stp-home-section {
        padding: 36px 0;
    }

    .stp-home-welcome-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 28px 20px;
    }

    .stp-home-welcome-avatar {
        width: 120px;
        height: 120px;
    }

    .stp-home-cat-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px 10px;
    }

    .stp-home-cat-icon-wrap {
        width: 68px;
        height: 68px;
    }

    .stp-home-sweet-pills {
        gap: 16px;
    }
}

@media (max-width: 640px) {
    .stp-home-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px 12px;
    }

    .stp-home-card__title {
        font-size: 14px;
        margin-top: 8px;
    }

    .stp-home-hero {
        padding: 28px 0 16px;
    }

    .stp-home-heading {
        font-size: 20px;
        margin-bottom: 12px;
    }

    .stp-home-cat-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px 8px;
    }

    .stp-home-cat-name {
        font-size: 12.5px;
    }

    .stp-home-beyond-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .stp-home-beyond-card__title {
        font-size: 14.5px;
        margin-top: 10px;
    }
}

/* ==========================================================================
   Load More Button — "LATEST FROM MY KITCHEN"
   ========================================================================== */

.stp-home-load-more-wrap {
    display: flex;
    justify-content: center;
    margin-top: 44px;
}

.stp-home-load-more-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 40px;
    background: transparent;
    color: #0f172a;
    border: 2px solid #0f172a;
    border-radius: 50px;
    font-family: 'Figtree', -apple-system, sans-serif;
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.22s ease, color 0.22s ease, border-color 0.22s ease, transform 0.18s ease, box-shadow 0.22s ease;
    min-width: 180px;
    outline: none;
}

.stp-home-load-more-btn:hover:not([disabled]) {
    background: #0f172a;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.15);
}

.stp-home-load-more-btn:active:not([disabled]) {
    transform: translateY(0);
    box-shadow: none;
}

.stp-home-load-more-btn[disabled] {
    opacity: 0.65;
    cursor: not-allowed;
}

/* Spinner (shown during loading) */
.stp-load-more-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2.5px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: stp-spin 0.7s linear infinite;
    flex-shrink: 0;
}

.stp-home-load-more-btn.stp-load-more-loading .stp-load-more-spinner {
    display: inline-block;
}

.stp-home-load-more-btn.stp-load-more-loading .stp-load-more-text {
    opacity: 0.7;
}

@keyframes stp-spin {
    to {
        transform: rotate(360deg);
    }
}