/* ========================================
   HomeSoCool 2026 - Main Stylesheet
   Good Housekeeping-Inspired Editorial Layout
   ======================================== */

/* ========================================
   CSS Variables
   ======================================== */
:root {
    /* Container widths */
    --container-wide: 1280px;
    --container-default: 1200px;
    --container-narrow: 800px;

    /* Colors - Pastel backgrounds */
    --color-teal: #00a3a3;
    --color-mint: #e0f2f1;
    --color-lavender: #f3e5f5;
    --color-pink: #fce4ec;
    --color-yellow: #fff9c4;

    /* Brand colors */
    --color-primary: #0FB5C9;
    --color-dark: #0B2C4D;
    --color-text: #333;
    --color-text-light: #666;
    --color-border: #e5e5e5;

    /* Spacing */
    --gap-sm: 16px;
    --gap-md: 24px;
    --gap-lg: 48px;
    --gap-xl: 64px;
}

/* ========================================
   CSS Reset & Base
   ======================================== */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    height: -webkit-fill-available;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text);
    background-color: #fff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    min-height: -webkit-fill-available;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--color-dark);
}

button, input, select, textarea {
    font-family: inherit;
}

/* Touch target sizing - minimum 48x48px */
button, a.btn-primary, a.btn-secondary, .search-toggle, .menu-toggle {
    min-height: 48px;
    min-width: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Tap highlight color */
* {
    -webkit-tap-highlight-color: rgba(15, 181, 201, 0.2);
}

/* Smooth momentum scrolling on iOS */
.horizontal-scroll {
    -webkit-overflow-scrolling: touch;
}

/* ========================================
   Accessibility - Focus Indicators
   ======================================== */
/* Universal focus styles */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid #0FB5C9;
    outline-offset: 2px;
}

/* Image link focus */
.hero-thumbnail:focus img,
.featured-thumbnail:focus img,
.card-thumbnail:focus img {
    outline: 3px solid #0FB5C9;
    outline-offset: 3px;
    border-radius: 4px;
}

/* Remove default outline but keep our custom one */
*:focus:not(:focus-visible) {
    outline: none;
}

*:focus-visible {
    outline: 2px solid #0FB5C9;
    outline-offset: 2px;
}

/* ========================================
   Responsive Table Wrapper
   ======================================== */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1.75rem;
}

.table-wrapper::-webkit-scrollbar {
    height: 8px;
}

.table-wrapper::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

/* ========================================
   Empty State Messages
   ======================================== */
.empty-section-message {
    text-align: center;
    padding: 48px 20px;
    color: #999;
    font-style: italic;
}

/* ========================================
   Typography
   ======================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 1rem;
    color: var(--color-dark);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
    margin: 0 0 1.5rem;
}

/* ========================================
   Layout Containers
   ======================================== */
.site {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-content {
    flex: 1;
}

.container {
    max-width: var(--container-default);
    margin: 0 auto;
    padding: 0 20px;
}

.container-wide {
    max-width: var(--container-wide);
    margin: 0 auto;
    padding: 0 20px;
}

.container-narrow {
    max-width: var(--container-narrow);
    margin: 0 auto;
    padding: 0 20px;
}

/* ========================================
   Screen Reader Text
   ======================================== */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute !important;
    width: 1px;
    word-wrap: normal !important;
}

.skip-link {
    background-color: var(--color-primary);
    color: #fff;
    padding: 10px 15px;
    position: absolute;
    top: -100px;
    left: 20px;
    z-index: 100000;
}

.skip-link:focus {
    top: 10px;
}

/* ========================================
   Header - Good Housekeeping Style
   ======================================== */

/* Utility Bar */
.utility-bar {
    background: #f8f9fa;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.8rem;
    padding: 8px 0;
}

.utility-container {
    max-width: var(--container-wide);
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.utility-left {
    color: #555;
}

.social-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 12px;
}

.social-menu a {
    color: #555;
    font-size: 0.9rem;
}

.social-menu a:hover {
    color: var(--color-primary);
}

/* Main Header */
.site-header {
    background: #fff;
    border-bottom: 2px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.header-main {
    background: #fff;
}

.header-container {
    max-width: var(--container-wide);
    margin: 0 auto;
    padding: 20px 20px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

/* Logo/Masthead - LEFT aligned */
.site-branding {
    text-align: left;
    flex: 0 0 auto;
}

.site-title {
    margin: 0;
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.site-title a {
    color: var(--color-dark);
}

.site-title a:hover {
    color: var(--color-primary);
}

.custom-logo-link {
    display: inline-block;
    line-height: 0;
}

.custom-logo {
    max-height: 60px;
    width: auto;
}

.site-description {
    margin: 8px 0 0;
    font-size: 0.875rem;
    color: var(--color-text-light);
    font-style: italic;
}

/* Search Icon - RIGHT */
.header-search {
    position: relative;
}

.search-toggle {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--color-text);
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-toggle:hover {
    color: var(--color-primary);
}

.search-form-container {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 10px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 4px;
    padding: 15px;
    min-width: 300px;
    z-index: 100;
}

.search-form-container[hidden] {
    display: none;
}

.search-form {
    display: flex;
    gap: 8px;
}

.search-form input[type="search"] {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95rem;
}

.search-form button {
    padding: 10px 20px;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}

.search-form button:hover {
    background: var(--color-dark);
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    padding: 12px;
    cursor: pointer;
    color: var(--color-dark);
}

.menu-toggle-icon {
    display: block;
    width: 24px;
    height: 2px;
    background: #333;
    position: relative;
    transition: all 0.3s;
}

.menu-toggle-icon::before,
.menu-toggle-icon::after {
    content: '';
    position: absolute;
    left: 0;
    width: 24px;
    height: 2px;
    background: #333;
    transition: all 0.3s;
}

.menu-toggle-icon::before {
    top: -8px;
}

.menu-toggle-icon::after {
    bottom: -8px;
}

/* Animate to X when open */
.menu-toggle[aria-expanded="true"] .menu-toggle-icon {
    background: transparent;
}

.menu-toggle[aria-expanded="true"] .menu-toggle-icon::before {
    top: 0;
    transform: rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-toggle-icon::after {
    bottom: 0;
    transform: rotate(-45deg);
}

/* Primary Navigation - Below logo */
.main-navigation {
    border-top: 1px solid var(--color-border);
    background: #fff;
}

.nav-container {
    max-width: var(--container-wide);
    margin: 0 auto;
    padding: 0 20px;
}

.primary-menu-container {
    display: flex;
    justify-content: center;
}

#primary-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 35px;
    align-items: center;
    justify-content: center;
}

#primary-menu li {
    margin: 0;
    position: relative;
}

#primary-menu a {
    color: var(--color-text);
    font-weight: 600;
    font-size: 0.875rem;
    padding: 15px 0;
    display: block;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.2s ease;
}

#primary-menu a:hover {
    color: var(--color-primary);
}

/* ========================================
   Homepage Sections - GH Layout Patterns
   ======================================== */
.homepage-section {
    padding: 64px 0;
    border-bottom: 1px solid var(--color-border);
}

.homepage-section + .homepage-section {
    padding-top: 48px;
}

.homepage-section:last-child {
    border-bottom: none;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.section-title {
    font-size: 2rem;
    margin: 0;
    color: var(--color-dark);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.section-link {
    font-weight: 600;
    color: var(--color-primary);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.section-link:hover {
    color: var(--color-dark);
}

/* ========================================
   Section 1: Hero with Sidebar (70/30)
   ======================================== */
.hero-with-sidebar {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: var(--gap-md);
}

.hero-article {
    display: flex;
    flex-direction: column;
}

.hero-thumbnail {
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #f5f5f5;
    border-radius: 8px;
    margin-bottom: 20px;
}

.hero-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.hero-article:hover .hero-thumbnail img {
    transform: scale(1.05);
}

.hero-content {
    flex: 1;
}

.hero-category {
    display: inline-block;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.hero-title {
    font-size: 2.5rem;
    line-height: 1.2;
    margin: 0 0 15px;
}

.hero-title a {
    color: var(--color-dark);
}

.hero-title a:hover {
    color: var(--color-primary);
}

.hero-excerpt {
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--color-text-light);
}

/* Hero Sidebar */
.hero-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-article {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 16px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--color-border);
}

.sidebar-article:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.sidebar-thumbnail {
    width: 120px;
    height: 80px;
    overflow: hidden;
    background: #f5f5f5;
    border-radius: 6px;
}

.sidebar-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-content {
    flex: 1;
}

.sidebar-category {
    display: inline-block;
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.sidebar-title {
    font-size: 1rem;
    line-height: 1.3;
    margin: 0;
}

.sidebar-title a {
    color: var(--color-dark);
}

.sidebar-title a:hover {
    color: var(--color-primary);
}

/* ========================================
   Section 2: Featured Story
   ======================================== */
.featured-article {
    display: flex;
    flex-direction: column;
}

.featured-thumbnail {
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #f5f5f5;
    border-radius: 8px;
    margin-bottom: 20px;
}

.featured-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.featured-article:hover .featured-thumbnail img {
    transform: scale(1.05);
}

.featured-title {
    font-size: 2rem;
    line-height: 1.2;
    margin: 0 0 15px;
}

.featured-title a {
    color: var(--color-dark);
}

.featured-title a:hover {
    color: var(--color-primary);
}

.featured-excerpt {
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--color-text-light);
}

/* ========================================
   Section 3: 4-Image Grid
   ======================================== */
.grid-4-col {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--gap-md);
}

.grid-image-card {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.grid-image-link {
    display: block;
    position: relative;
    aspect-ratio: 3/4;
    overflow: hidden;
}

.grid-image-link img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    aspect-ratio: 3/4;
    transition: transform 0.3s;
}

.grid-image-card:hover .grid-image-link img {
    transform: scale(1.05);
}

.grid-image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: #fff;
}

.grid-image-title {
    font-size: 1.125rem;
    margin: 0;
    color: #fff;
}

/* ========================================
   Section 4: Product Carousel
   ======================================== */
.horizontal-scroll {
    display: flex;
    gap: var(--gap-md);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    padding-bottom: 10px;
}

.horizontal-scroll::-webkit-scrollbar {
    height: 8px;
}

.horizontal-scroll::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.horizontal-scroll::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.horizontal-scroll::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.carousel-card {
    flex: 0 0 300px;
    min-width: 300px;
    max-width: 300px;
    min-height: 320px;
    scroll-snap-align: start;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.carousel-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.carousel-thumbnail {
    aspect-ratio: 3/2;
    overflow: hidden;
    background: #f5f5f5;
}

.carousel-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-content {
    padding: 20px;
}

.carousel-category {
    display: inline-block;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.carousel-title {
    font-size: 1.125rem;
    line-height: 1.3;
    margin: 0 0 10px;
}

.carousel-title a {
    color: var(--color-dark);
}

.carousel-title a:hover {
    color: var(--color-primary);
}

.carousel-excerpt {
    font-size: 0.9rem;
    color: var(--color-text-light);
    line-height: 1.5;
}

/* ========================================
   Section 5: Feature with Mini Grid (60/40)
   ======================================== */
.feature-with-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: var(--gap-lg);
}

.feature-large {
    display: flex;
    flex-direction: column;
}

.feature-large-thumbnail {
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #f5f5f5;
    border-radius: 8px;
    margin-bottom: 20px;
}

.feature-large-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.feature-large:hover .feature-large-thumbnail img {
    transform: scale(1.05);
}

.feature-large-category {
    display: inline-block;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.feature-large-title {
    font-size: 2rem;
    line-height: 1.2;
    margin: 0 0 15px;
}

.feature-large-title a {
    color: var(--color-dark);
}

.feature-large-title a:hover {
    color: var(--color-primary);
}

.feature-large-excerpt {
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--color-text-light);
}

/* Mini Grid 2x2 */
.mini-grid-right {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--gap-md);
}

.mini-grid-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mini-grid-thumbnail {
    aspect-ratio: 3/2;
    overflow: hidden;
    background: #f5f5f5;
    border-radius: 6px;
}

.mini-grid-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mini-grid-title {
    font-size: 1rem;
    line-height: 1.3;
    margin: 0;
}

.mini-grid-title a {
    color: var(--color-dark);
}

.mini-grid-title a:hover {
    color: var(--color-primary);
}

/* ========================================
   Section 6: Product Grid 2x2 Pastel
   ======================================== */
.grid-2x2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.product-card {
    padding: 24px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 350px;
    transition: transform 0.2s;
}

.product-card:hover {
    transform: translateY(-2px);
}

.product-card.mint { background: var(--color-mint); }
.product-card.lavender { background: var(--color-lavender); }
.product-card.pink { background: var(--color-pink); }
.product-card.yellow { background: var(--color-yellow); }

.product-card-thumbnail {
    aspect-ratio: 1;
    overflow: hidden;
    background: #fff;
    border-radius: 8px;
    margin-bottom: 20px;
}

.product-card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-card-category {
    display: inline-block;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.product-card-title {
    font-size: 1.25rem;
    line-height: 1.3;
    margin: 0 0 12px;
}

.product-card-title a {
    color: var(--color-dark);
}

.product-card-title a:hover {
    color: var(--color-primary);
}

.product-card-excerpt {
    font-size: 0.95rem;
    color: var(--color-text-light);
    line-height: 1.5;
}

/* ========================================
   Section 7: Trust Module (Teal)
   ======================================== */
.trust-module {
    background: var(--color-teal);
    color: #fff;
    padding: 80px 40px;
    margin: 64px 0;
    border-radius: 12px;
    text-align: center;
}

.trust-module h2 {
    color: #fff;
    font-size: 2.5rem;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.trust-module p {
    font-size: 1.125rem;
    line-height: 1.7;
    margin-bottom: 30px;
    opacity: 0.95;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.btn-trust {
    display: inline-block;
    padding: 14px 35px;
    background: #fff;
    color: var(--color-teal);
    border-radius: 6px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.btn-trust:hover {
    background: var(--color-dark);
    color: #fff;
}

/* ========================================
   Section 8: Inspired Living (4-col)
   ======================================== */
.inspired-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.inspired-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.inspired-thumbnail {
    aspect-ratio: 1;
    overflow: hidden;
    background: #f5f5f5;
}

.inspired-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.inspired-card:hover .inspired-thumbnail img {
    transform: scale(1.05);
}

.inspired-content {
    padding: 20px;
    background: #fff;
}

.inspired-category {
    display: inline-block;
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.inspired-title {
    font-size: 1.125rem;
    line-height: 1.3;
    margin: 0;
}

.inspired-title a {
    color: var(--color-dark);
}

.inspired-title a:hover {
    color: var(--color-primary);
}

/* ========================================
   Section 9 & 10: Category Sections (3-col)
   ======================================== */
.grid-3-col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--gap-md);
}

/* ========================================
   Section 11: Latest Articles (4-col small)
   ======================================== */
.latest-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.latest-thumbnail {
    aspect-ratio: 1;
    overflow: hidden;
    background: #f5f5f5;
    border-radius: 8px;
}

.latest-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.latest-title {
    font-size: 1rem;
    line-height: 1.3;
    margin: 0;
}

.latest-title a {
    color: var(--color-dark);
}

.latest-title a:hover {
    color: var(--color-primary);
}

/* ========================================
   Post Cards (Template Part)
   ======================================== */
.post-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.post-card-thumbnail {
    aspect-ratio: 3/2;
    overflow: hidden;
    background: #f5f5f5;
}

.post-card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.post-card:hover .post-card-thumbnail img {
    transform: scale(1.05);
}

.post-card-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-card-category {
    display: inline-block;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.post-card-title {
    font-size: 1.125rem;
    margin: 0 0 10px;
    line-height: 1.3;
}

.post-card-title a {
    color: var(--color-dark);
}

.post-card-title a:hover {
    color: var(--color-primary);
}

.post-card-excerpt {
    font-size: 0.9rem;
    color: var(--color-text-light);
    line-height: 1.5;
    margin-bottom: 15px;
    flex: 1;
}

.post-card-meta {
    font-size: 0.85rem;
    color: #999;
    display: flex;
    gap: 10px;
    align-items: center;
}

.post-author {
    font-weight: 500;
    color: var(--color-text-light);
}

/* ========================================
   Single Post
   ======================================== */
.single-post-main {
    padding: 40px 0;
}

.article-header-wrapper {
    margin-bottom: 30px;
}

.rank-math-breadcrumb {
    margin-bottom: 20px;
    font-size: 0.875rem;
}

.rank-math-breadcrumb a {
    color: var(--color-text-light);
}

.rank-math-breadcrumb a:hover {
    color: var(--color-primary);
}

.article-category {
    margin-bottom: 15px;
}

.article-category a {
    display: inline-block;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: 0.5px;
}

.entry-header {
    margin-bottom: 30px;
}

.entry-title {
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 20px;
    color: var(--color-dark);
}

.entry-deck {
    font-size: 1.25rem;
    line-height: 1.5;
    color: var(--color-text-light);
    margin-bottom: 20px;
}

.entry-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 0.9rem;
    color: var(--color-text-light);
}

.entry-meta a {
    color: var(--color-text-light);
}

.entry-meta a:hover {
    color: var(--color-primary);
}

.updated-date {
    color: #666;
    font-style: italic;
}

.featured-image-wrapper {
    margin-bottom: 40px;
}

.featured-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

/* Entry Content - Enhanced Editorial Typography */
.entry-content {
    font-size: 1.125rem;
    line-height: 1.75;
    color: var(--color-text);
}

.entry-content h2 {
    font-size: 2rem;
    margin-top: 3rem;
    margin-bottom: 1.25rem;
    font-weight: 700;
}

.entry-content h3 {
    font-size: 1.625rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.entry-content h4 {
    font-size: 1.375rem;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.entry-content p {
    margin-bottom: 1.75rem;
}

.entry-content ul,
.entry-content ol {
    margin: 0 0 1.75rem 1.75rem;
    padding: 0;
}

.entry-content li {
    margin-bottom: 0.75rem;
    line-height: 1.75;
}

.entry-content img {
    border-radius: 8px;
    margin: 2.5rem 0;
}

.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 32px 0;
    font-size: 0.9375rem;
    background: #fff;
    border: 1px solid #ddd;
}

.entry-content th {
    background: #0B2C4D;
    color: #fff;
    padding: 16px;
    text-align: left;
    font-weight: 600;
    border: 1px solid #0B2C4D;
}

.entry-content td {
    padding: 16px;
    border: 1px solid #e5e5e5;
    vertical-align: top;
    background: #fff !important;
    color: #333 !important;
}

.entry-content tr:nth-child(even) td {
    background: #f9f9f9 !important;
}

.entry-content tr:hover td {
    background: #f0f9ff !important;
}

/* Product name/title in table */
.entry-content table .product-name,
.entry-content table h3,
.entry-content table h4 {
    color: #0B2C4D !important;
    font-weight: 600;
}

.entry-content blockquote {
    border-left: 4px solid var(--color-primary);
    padding-left: 24px;
    margin: 2.5rem 0;
    font-style: italic;
    color: var(--color-text-light);
    font-size: 1.125rem;
}

/* AffiliateCMS Shortcode Support - Comprehensive Overrides */

/* Main product card container - high specificity to override plugin defaults */
.entry-content .acms-product-card,
.acms-list-wrapper .acms-product-card,
article .acms-product-card,
.acms-reviews-list .acms-product-card {
    background: #2C3E50 !important; /* Dark background (plugin default) */
    color: #fff !important;
    border-radius: 12px !important;
    padding: 24px !important;
    margin: 32px 0 !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

/* Product title - MUST be white on dark background - MAXIMUM SPECIFICITY */
body .entry-content .acms-product-card .acms-product-title,
body .entry-content .acms-product-card .acms-title,
body .entry-content .acms-product-card h3,
body .entry-content .acms-product-card h4,
body .acms-product-card .product-title,
body .acms-product-card .title,
body article .acms-product-card .acms-product-title,
body article .acms-product-card h3,
body .acms-list-wrapper .acms-product-card h3,
body .acms-reviews-list .acms-product-card h3 {
    color: #fff !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    line-height: 1.35 !important;
    margin-bottom: 12px !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-height: 2.7em !important;
    word-break: break-word !important;
}

/* Brand name - lighter white text */
.entry-content .acms-product-card .acms-brand,
.entry-content .acms-product-card .brand-name,
.acms-product-card .product-brand {
    color: rgba(255, 255, 255, 0.75) !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
}

/* Product image container - prevent cropping */
.entry-content .acms-product-card .acms-product-image,
.entry-content .acms-product-card .product-image,
.entry-content .acms-product-card .acms-image-wrapper,
.acms-product-card .image-container {
    width: 180px !important;
    height: 180px !important;
    overflow: visible !important;
    background: #fff !important;
    border-radius: 8px !important;
    padding: 12px !important;
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Product image - show full product, not cropped */
.entry-content .acms-product-card img,
.acms-product-card .acms-product-image img {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    display: block !important;
    margin: 0 auto !important;
    border-radius: 0 !important;
}

/* Price - Amazon orange, prominent */
.entry-content .acms-product-card .acms-price,
.entry-content .acms-product-card .price,
.acms-product-card .current-price {
    color: #ff9900 !important;
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    margin: 8px 0 !important;
}

/* Original price (strikethrough) */
.entry-content .acms-product-card .acms-original-price,
.entry-content .acms-product-card .original-price,
.acms-product-card .old-price {
    color: rgba(255, 255, 255, 0.5) !important;
    font-size: 1rem !important;
    text-decoration: line-through !important;
}

/* In Stock indicator - bright green */
.entry-content .acms-product-card .in-stock,
.entry-content .acms-product-card .stock-status,
.acms-product-card .availability {
    color: #22c55e !important;
    font-weight: 600 !important;
    font-size: 0.875rem !important;
}

/* Score/Rating badge */
.entry-content .acms-product-card .acms-score,
.entry-content .acms-product-card .rating,
.entry-content .acms-product-card .score-badge,
.acms-product-card .homesocool-score {
    color: #fff !important;
    font-weight: 600 !important;
}

/* Primary CTA button - Amazon style */
.entry-content .acms-product-card .acms-button,
.entry-content .acms-product-card .btn-primary,
.entry-content .acms-product-card .amazon-button,
.acms-product-card a.button,
.acms-product-card .view-on-amazon {
    background: #ff9900 !important;
    color: #fff !important;
    border: none !important;
    padding: 12px 24px !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    font-size: 1rem !important;
    cursor: pointer !important;
    text-decoration: none !important;
    display: inline-block !important;
    transition: background 0.2s ease !important;
}

.entry-content .acms-product-card .acms-button:hover,
.entry-content .acms-product-card .btn-primary:hover,
.acms-product-card a.button:hover {
    background: #e68a00 !important;
    color: #fff !important;
}

/* PROS & CONS toggle button - secondary style, must be visible */
.entry-content .acms-product-card .pros-cons-toggle,
.entry-content .acms-product-card .toggle-pros-cons,
.entry-content .acms-product-card .btn-pros-cons,
.acms-product-card button[class*="pros"],
.acms-product-card .pros-cons-button {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    padding: 10px 20px !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    font-size: 0.875rem !important;
    cursor: pointer !important;
    text-decoration: none !important;
    display: inline-block !important;
    transition: all 0.2s ease !important;
}

.entry-content .acms-product-card .pros-cons-toggle:hover,
.acms-product-card button[class*="pros"]:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
}

/* DETAILED REVIEW toggle button - secondary style, must be visible */
.entry-content .acms-product-card .detailed-review-toggle,
.entry-content .acms-product-card .toggle-review,
.entry-content .acms-product-card .btn-review,
.acms-product-card button[class*="review"],
.acms-product-card .review-button {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    padding: 10px 20px !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    font-size: 0.875rem !important;
    cursor: pointer !important;
    text-decoration: none !important;
    display: inline-block !important;
    transition: all 0.2s ease !important;
}

.entry-content .acms-product-card .detailed-review-toggle:hover,
.acms-product-card button[class*="review"]:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
}

/* All secondary buttons */
.acms-product-card button,
.acms-product-card .btn-secondary {
    color: #fff !important;
}

/* Badge labels (BEST SELLER, EDITOR'S PICK, discount %) */
.entry-content .acms-product-card .badge,
.entry-content .acms-product-card .label,
.entry-content .acms-product-card .discount-badge,
.acms-product-card .product-badge {
    background: #ef4444 !important;
    color: #fff !important;
    padding: 4px 12px !important;
    border-radius: 4px !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    display: inline-block !important;
}

.entry-content .acms-product-card .badge.editor-pick,
.entry-content .acms-product-card .badge.editors-pick,
.acms-product-card .badge[class*="editor"] {
    background: #22c55e !important;
}

/* Update date / last checked */
.entry-content .acms-product-card .updated-date,
.entry-content .acms-product-card .last-updated,
.acms-product-card .price-updated {
    color: rgba(255, 255, 255, 0.6) !important;
    font-size: 0.75rem !important;
    font-style: italic !important;
}

/* Expandable sections (Pros/Cons content, Detailed Review content) */
.entry-content .acms-product-card .expandable-content,
.entry-content .acms-product-card .collapsible-content,
.entry-content .acms-product-card .pros-cons-content,
.entry-content .acms-product-card .review-content,
.acms-product-card .expanded-section {
    color: rgba(255, 255, 255, 0.9) !important;
    background: rgba(255, 255, 255, 0.05) !important;
    padding: 16px !important;
    border-radius: 8px !important;
    margin-top: 12px !important;
}

/* Lists inside expandable sections */
.entry-content .acms-product-card ul,
.entry-content .acms-product-card ol {
    color: rgba(255, 255, 255, 0.9) !important;
    margin: 12px 0 !important;
}

.entry-content .acms-product-card li {
    color: rgba(255, 255, 255, 0.9) !important;
    margin-bottom: 8px !important;
    line-height: 1.6 !important;
}

/* Pros list - green checkmarks */
.entry-content .acms-product-card .pros li,
.entry-content .acms-product-card .pros-list li {
    color: #22c55e !important;
}

/* Cons list - red X marks */
.entry-content .acms-product-card .cons li,
.entry-content .acms-product-card .cons-list li {
    color: #ef4444 !important;
}

/* Specifications table inside cards */
.entry-content .acms-product-card .specs-table,
.entry-content .acms-product-card .specifications {
    color: rgba(255, 255, 255, 0.9) !important;
    background: rgba(255, 255, 255, 0.05) !important;
}

.entry-content .acms-product-card .specs-table th,
.entry-content .acms-product-card .specs-table td {
    color: rgba(255, 255, 255, 0.9) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Any paragraph text inside cards */
.entry-content .acms-product-card p {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Any headings inside expandable sections */
.entry-content .acms-product-card .expandable-content h3,
.entry-content .acms-product-card .expandable-content h4,
.entry-content .acms-product-card .expandable-content h5 {
    color: #fff !important;
}

/* Fix ACMS shortcode rendering inside tables (legacy support) */
.entry-content table .acms-product-card,
.entry-content table .acms-list,
.entry-content table [class*="acms"] {
    display: block !important;
    max-width: 250px !important;
    padding: 16px !important;
    margin: 0 auto !important;
    background: #fff !important;
}

.entry-content table .acms-product-card img,
.entry-content table .acms-list img {
    max-width: 150px !important;
    height: auto !important;
    margin: 0 auto 12px !important;
}

.entry-content table .acms-product-card .acms-title {
    font-size: 1rem !important;
    line-height: 1.3 !important;
    margin-bottom: 8px !important;
    color: #333 !important;
}

.entry-content table .acms-product-card .acms-rating,
.entry-content table .acms-product-card .acms-pros,
.entry-content table .acms-product-card .acms-cons,
.entry-content table .acms-product-card .acms-specs {
    display: none !important;
}

.entry-content table .acms-product-card .acms-button {
    font-size: 0.875rem !important;
    padding: 8px 16px !important;
    background: #ff9900 !important;
    color: #fff !important;
}

/* Table product links styling */
.entry-content table .table-product-link {
    display: inline-block;
    background: #ff9900;
    color: #fff;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    transition: background 0.2s;
}

.entry-content table .table-product-link:hover {
    background: #e68a00;
    color: #fff;
}

/* Comparison card grid (alternative to tables) */
.comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin: 32px 0;
}

.comparison-card {
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    background: #fff;
}

.comparison-card img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    margin-bottom: 16px;
}

.comparison-card h4 {
    margin: 0 0 16px;
    font-size: 1.125rem;
}

.comparison-specs {
    text-align: left;
    margin: 16px 0;
}

.comparison-specs .spec {
    padding: 8px 0;
    border-bottom: 1px solid #f5f5f5;
    font-size: 0.9rem;
}

.comparison-specs .spec:last-child {
    border-bottom: none;
}

.entry-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
    font-size: 0.9rem;
}

.entry-footer span {
    margin-right: 20px;
}

/* Author Box */
.author-box-wrapper {
    background: #f9f9f9;
    margin-top: 60px;
    padding: 40px 0;
}

.author-box {
    display: flex;
    gap: 25px;
    align-items: flex-start;
}

.author-avatar img {
    border-radius: 50%;
}

.author-info {
    flex: 1;
}

.author-name {
    font-size: 1.5rem;
    margin: 0 0 5px;
    color: var(--color-dark);
}

.author-title {
    font-size: 0.95rem;
    color: var(--color-primary);
    font-weight: 600;
    margin: 0 0 10px;
}

.author-bio {
    color: var(--color-text-light);
    line-height: 1.6;
    margin: 0 0 15px;
}

.author-link {
    color: var(--color-primary);
    font-weight: 600;
}

.author-link:hover {
    color: var(--color-dark);
}

/* Related Posts */
.related-posts-wrapper {
    background: #fff;
    padding: 60px 0;
}

.related-posts-title {
    font-size: 2rem;
    margin: 0 0 30px;
    color: var(--color-dark);
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.related-post-card {
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.related-post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.related-post-thumbnail {
    aspect-ratio: 3/2;
    overflow: hidden;
    background: #f5f5f5;
}

.related-post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-post-content {
    padding: 20px;
}

.related-post-title {
    font-size: 1.125rem;
    margin: 0;
}

.related-post-title a {
    color: var(--color-dark);
}

.related-post-title a:hover {
    color: var(--color-primary);
}

/* ========================================
   Archive & Category Pages
   ======================================== */
.page-header,
.category-header {
    margin-bottom: 40px;
    text-align: center;
}

.page-title,
.category-title {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: var(--color-dark);
}

.archive-description,
.category-description {
    font-size: 1.125rem;
    color: var(--color-text-light);
    line-height: 1.6;
    max-width: 700px;
    margin: 0 auto;
}

.category-featured {
    margin-bottom: 50px;
}

.featured-post-card {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 40px;
    align-items: center;
    background: #f9f9f9;
    border-radius: 12px;
    overflow: hidden;
}

.featured-post-thumbnail {
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #e5e5e5;
}

.featured-post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-post-content {
    padding: 40px;
}

.featured-post-title {
    font-size: 2rem;
    margin: 0 0 15px;
}

.featured-post-title a {
    color: var(--color-dark);
}

.featured-post-title a:hover {
    color: var(--color-primary);
}

.featured-post-excerpt {
    font-size: 1.125rem;
    color: var(--color-text-light);
    line-height: 1.6;
    margin-bottom: 20px;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

/* Author Archive */
.author-header {
    margin-bottom: 60px;
}

.author-bio-section {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    padding: 40px;
    background: #f9f9f9;
    border-radius: 12px;
}

.author-avatar-large img {
    border-radius: 50%;
}

.author-bio-content {
    flex: 1;
}

.author-title {
    font-size: 2rem;
    margin: 0 0 5px;
    color: var(--color-dark);
}

.author-role {
    font-size: 1rem;
    color: var(--color-primary);
    font-weight: 600;
    margin: 0 0 15px;
}

.author-description {
    color: var(--color-text-light);
    line-height: 1.6;
}

.author-posts-section {
    margin-top: 40px;
}

/* ========================================
   Pagination
   ======================================== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 60px 0;
}

.page-numbers {
    padding: 10px 15px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    color: var(--color-text);
    font-weight: 500;
}

.page-numbers:hover,
.page-numbers.current {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

/* ========================================
   Buttons
   ======================================== */
.btn-primary,
.btn-secondary {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 6px;
    font-weight: 600;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
    border: 2px solid transparent;
}

.btn-primary {
    background: var(--color-primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--color-dark);
    color: #fff;
}

.btn-secondary {
    background: transparent;
    color: #fff;
    border-color: #fff;
}

.btn-secondary:hover {
    background: #fff;
    color: var(--color-primary);
}

/* ========================================
   Footer
   ======================================== */
.site-footer {
    background: var(--color-dark);
    color: #fff;
    padding: 60px 0 30px;
    margin-top: 80px;
}

.footer-container {
    max-width: var(--container-wide);
    margin: 0 auto;
    padding: 0 20px;
}

.footer-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 50px;
}

.widget {
    margin-bottom: 30px;
}

.widget-title {
    color: #fff;
    font-size: 1.125rem;
    margin-bottom: 15px;
}

.widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget li {
    margin-bottom: 10px;
}

.widget a {
    color: rgba(255,255,255,0.8);
}

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

.footer-navigation {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

#footer-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

#footer-menu a {
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
}

#footer-menu a:hover {
    color: var(--color-primary);
}

.site-info {
    text-align: center;
    color: rgba(255,255,255,0.7);
    font-size: 0.875rem;
}

.site-info p {
    margin-bottom: 10px;
}

.site-info a {
    color: rgba(255,255,255,0.95);
}

.site-info a:hover {
    color: var(--color-primary);
}

.affiliate-disclosure {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* ========================================
   404 Page
   ======================================== */
.error-404-main {
    padding: 60px 0;
}

.error-404 {
    text-align: center;
}

.error-404 .page-title {
    font-size: 3rem;
    margin-bottom: 20px;
}

.error-404-links {
    margin: 40px 0;
}

.error-404-links h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.error-404-links ul {
    list-style: none;
    padding: 0;
}

.error-404-links li {
    margin-bottom: 10px;
}

.error-404-recent {
    margin-top: 60px;
}

.recent-posts-list {
    max-width: 600px;
    margin: 30px auto 0;
    text-align: left;
}

.recent-post-item {
    padding: 15px;
    border-bottom: 1px solid var(--color-border);
}

.recent-post-item:last-child {
    border-bottom: none;
}

.recent-post-item h3 {
    font-size: 1.125rem;
    margin: 0;
}

/* ========================================
   Responsive Design
   ======================================== */

/* Mobile-specific fixes and improvements */
input, textarea, select {
    font-size: 16px; /* Prevent iOS zoom on focus */
}

/* Mobile overlay for menu */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9998;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-overlay.active {
    display: block !important;
    opacity: 1 !important;
}

/* Prevent body scroll when menu open */
body.menu-open {
    overflow: hidden;
}

/* 1200px and below */
@media (max-width: 1200px) {
    .hero-with-sidebar {
        grid-template-columns: 1fr 300px;
    }

    .grid-4-col {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 1024px and below - Tablet */
@media (max-width: 1024px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }

    .entry-title {
        font-size: 2rem;
    }

    .hero-with-sidebar {
        grid-template-columns: 1fr;
    }

    .hero-sidebar {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .sidebar-article {
        border-bottom: none;
        padding-bottom: 0;
    }

    .feature-with-grid {
        grid-template-columns: 1fr;
    }

    .grid-4-col {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-3-col {
        grid-template-columns: repeat(2, 1fr);
    }

    .featured-post-card {
        grid-template-columns: 1fr;
    }

    .featured-post-content {
        padding: 30px;
    }
}

/* 768px and below - Mobile */
@media (max-width: 768px) {
    /* Larger tap targets */
    .menu-toggle {
        padding: 16px;
        min-width: 48px;
        min-height: 48px;
        display: block !important;
    }

    /* Better mobile typography */
    body {
        font-size: 16px; /* Prevent iOS zoom on focus */
    }

    .header-container {
        padding: 15px 20px;
    }

    /* Mobile navigation - FORCE HIDDEN by default with maximum specificity */
    body .primary-menu-container,
    body .main-navigation .primary-menu-container,
    body #site-navigation .primary-menu-container {
        position: fixed !important;
        top: 0 !important;
        left: -100% !important;
        width: 80% !important;
        max-width: 320px !important;
        height: 100vh !important;
        background: #fff !important;
        z-index: 9999 !important;
        overflow-y: auto !important;
        transition: left 0.3s ease !important;
        box-shadow: 2px 0 8px rgba(0,0,0,0.1) !important;
        visibility: hidden !important;
        opacity: 0 !important;
        display: block !important;
    }

    /* Only show when active class is present */
    body .primary-menu-container.active,
    body .main-navigation .primary-menu-container.active,
    body #site-navigation .primary-menu-container.active,
    body .main-navigation.menu-open .primary-menu-container,
    body .main-navigation.toggled .primary-menu-container {
        left: 0 !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    /* Extra safeguard - hide menu items when container not active */
    body .main-navigation:not(.menu-open) .primary-menu-container,
    body .main-navigation:not(.toggled) .primary-menu-container,
    body .main-navigation:not(.menu-open):not(.toggled) #primary-menu {
        display: none !important;
    }

    body .main-navigation.menu-open .primary-menu-container,
    body .main-navigation.toggled .primary-menu-container {
        display: block !important;
    }

    #primary-menu {
        flex-direction: column;
        padding: 80px 20px 20px;
        gap: 0;
    }

    #primary-menu li {
        border-bottom: 1px solid var(--color-border);
        width: 100%;
    }

    #primary-menu a {
        padding: 16px 0;
        width: 100%;
    }

    .search-form-container {
        right: auto;
        left: 0;
    }

    /* Reduce section padding on mobile */
    .homepage-section {
        padding: 32px 0;
    }

    .homepage-section + .homepage-section {
        padding-top: 24px;
    }

    /* Container padding on mobile */
    .container,
    .container-wide,
    .container-narrow {
        padding-left: 16px;
        padding-right: 16px;
    }

    /* Typography adjustments */
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }

    .section-title {
        font-size: 1.75rem;
    }

    /* Hero section - stack on mobile */
    .hero-with-sidebar {
        grid-template-columns: 1fr;
    }

    .hero-sidebar {
        grid-template-columns: 1fr;
        order: 2;
    }

    .grid-2x2,
    .grid-3-col,
    .grid-4-col {
        grid-template-columns: 1fr;
    }

    /* Feature with grid - stack */
    .feature-with-grid {
        grid-template-columns: 1fr;
    }

    .mini-grid-right {
        grid-template-columns: 1fr;
    }

    /* Card spacing */
    .content-card,
    .post-card {
        margin-bottom: 24px;
    }

    .product-card {
        padding: 20px;
    }

    .trust-module {
        padding: 40px 20px;
    }

    .trust-module h2 {
        font-size: 2rem;
    }

    .research-box {
        padding: 30px 20px;
    }

    .author-box,
    .author-bio-section {
        flex-direction: column;
        padding: 25px;
    }

    .related-posts-grid {
        grid-template-columns: 1fr;
    }

    .entry-content {
        font-size: 1rem;
    }

    .entry-content table {
        font-size: 0.875rem;
    }

    .entry-content table th,
    .entry-content table td {
        padding: 12px 8px;
    }

    /* Stack table on mobile if too wide */
    .entry-content table.stack-mobile {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .entry-title {
        font-size: 2rem;
    }

    .footer-widgets {
        grid-template-columns: 1fr;
    }

    .horizontal-scroll {
        scroll-padding: 0 20px;
    }

    .carousel-card {
        flex: 0 0 280px;
        min-width: 280px;
    }
}

/* 390px and below - Small Mobile */
@media (max-width: 390px) {
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }

    .container,
    .container-wide,
    .container-narrow {
        padding: 0 15px;
    }

    .entry-title {
        font-size: 1.75rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .site-title {
        font-size: 2rem;
    }

    /* Even tighter spacing */
    .homepage-section {
        padding: 24px 0;
    }

    /* Smaller typography */
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.375rem; }

    /* Product cards adjust */
    .carousel-card,
    .horizontal-scroll .product-card {
        flex: 0 0 250px;
        min-width: 250px;
    }
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
    .site-header,
    .site-footer,
    .menu-toggle,
    .search-toggle,
    .related-posts-wrapper,
    .author-box-wrapper,
    .pagination,
    .comments-area {
        display: none;
    }

    body {
        font-size: 12pt;
    }

    a {
        text-decoration: underline;
    }
}

/* ========================================
   Desktop - Menu Always Visible
   ======================================== */
@media (min-width: 769px) {
    .menu-toggle {
        display: none !important;
    }

    .primary-menu-container {
        position: static !important;
        width: auto !important;
        height: auto !important;
        background: transparent !important;
        box-shadow: none !important;
        left: auto !important;
    }

    #primary-menu {
        flex-direction: row !important;
        padding: 0 !important;
        gap: 35px !important;
    }

    #primary-menu li {
        border-bottom: none !important;
        width: auto !important;
    }

    #primary-menu a {
        padding: 15px 0 !important;
        width: auto !important;
    }

    .mobile-overlay {
        display: none !important;
    }
}
