/* ==========================================================================
   PTI DIY Theme - Main Stylesheet
   Priorities: 1) Speed 2) DIY Friendly 3) Affiliate 4) Mobile 5) AI Readable 6) Trust
   ========================================================================== */

/* CSS Variables - Easy to customize */
:root {
    --accent: #ff6b35;
    --accent-hover: #e55a2b;
    --dark: #1a1a1a;
    --darker: #0d0d0d;
    --gray-dark: #333;
    --gray: #666;
    --gray-light: #999;
    --light: #f5f5f5;
    --lighter: #fafafa;
    --white: #ffffff;
    --winner: #fff3ed;
    --value: #e8f5e9;
    --warning: #fff8e1;
    --danger: #ffebee;
    
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --radius: 4px;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-hover: 0 4px 12px rgba(0,0,0,0.15);
    
    --container: 1200px;
    --gap: 24px;
}

/* Reset & Base - Minimal for speed */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--dark);
    background: var(--white);
    -webkit-font-smoothing: antialiased;
}

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

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Container */
.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--gap);
}

/* Header - Full-width Hero Logo */
.site-header {
    position: sticky;
    top: 0;
    background: var(--dark);
    z-index: 100;
}

.hero-logo {
    background: var(--dark);
    text-align: center;
    padding: 2rem 1rem;
    border-bottom: 4px solid var(--accent);
}

.hero-logo img {
    max-width: 100%;
    height: auto;
    max-height: 180px;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    background: var(--dark);
}

.site-logo {
    display: none;
}

.site-logo.compact {
    display: block;
}

.site-logo img {
    max-height: 32px;
    width: auto;
}

/* When scrolled, show compact logo only */
.site-header.scrolled .hero-logo {
    display: none;
}

.site-header.scrolled .site-logo.compact {
    display: block;
}

/* Navigation - Dark header */
.site-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.site-nav ul {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

.site-nav a {
    color: var(--gray-light);
    font-weight: 500;
    font-size: 0.9375rem;
}

.site-nav a:hover {
    color: var(--accent);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.mobile-menu-toggle span {
    width: 24px;
    height: 2px;
    background: var(--white);
    transition: 0.3s;
}

/* Search */
.search-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--gray);
}

.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.search-overlay.active {
    display: flex;
}

.search-container {
    width: 90%;
    max-width: 600px;
}

.search-form input {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1.25rem;
    border: none;
    border-radius: var(--radius);
}

/* Main Content */
#site-main {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

/* Article Layout */
.article {
    max-width: 800px;
    margin: 0 auto;
}

.article-header {
    margin-bottom: 2rem;
}

.article-title {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.article-meta {
    color: var(--gray);
    font-size: 0.875rem;
}

/* Article Content - AI Readable Structure */
.article-content {
    font-size: 1.0625rem;
    line-height: 1.8;
}

.article-content h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 2.5rem 0 1rem;
    color: var(--dark);
}

.article-content h3 {
    font-size: 1.375rem;
    font-weight: 600;
    margin: 2rem 0 0.75rem;
}

.article-content h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 1.5rem 0 0.5rem;
}

.article-content p {
    margin-bottom: 1.25rem;
}

.article-content ul, .article-content ol {
    margin: 1rem 0 1.25rem 1.5rem;
}

.article-content li {
    margin-bottom: 0.5rem;
}

.article-content blockquote {
    border-left: 4px solid var(--accent);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: var(--gray-dark);
}

/* Trust Signals - Prominent Display */
.trust-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--winner);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    margin: 0.5rem 0;
}

.trust-badge .stars {
    color: #ffc107;
}

.aggregated-reviews {
    background: var(--lighter);
    border: 1px solid var(--light);
    border-radius: var(--radius);
    padding: 1rem;
    margin: 1.5rem 0;
    text-align: center;
}

.aggregated-reviews .count {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
}

/* Comparison Tables - DIY Optimized, Mobile First */
.comparison-table-wrapper {
    overflow-x: auto;
    margin: 1.5rem 0;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.comparison-table {
    width: 100%;
    min-width: 640px; /* Forces scroll on mobile */
    border-collapse: collapse;
    font-size: 0.9375rem;
    background: var(--white);
}

.comparison-table th {
    background: var(--dark);
    color: var(--white);
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
    position: sticky;
    top: 0;
}

.comparison-table th:first-child {
    border-radius: var(--radius) 0 0 0;
}

.comparison-table th:last-child {
    border-radius: 0 var(--radius) 0 0;
}

.comparison-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--light);
    vertical-align: top;
}

.comparison-table tr:hover {
    background: var(--lighter);
}

/* Winner & Value Highlights */
.comparison-table .winner {
    background: var(--winner) !important;
    font-weight: 600;
}

.comparison-table .value-pick {
    background: var(--value) !important;
}

.comparison-table .budget-pick {
    background: var(--warning) !important;
}

.comparison-table .splurge {
    background: var(--danger) !important;
}

/* Tool Name Column */
.tool-name {
    font-weight: 600;
}

.tool-model {
    font-size: 0.875rem;
    color: var(--gray);
    font-weight: 400;
}

/* Price Column */
.price {
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--dark);
}

.price-note {
    font-size: 0.75rem;
    color: var(--gray);
}

/* Rating Column */
.rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 600;
}

.rating .stars {
    color: #ffc107;
}

.review-count {
    font-size: 0.75rem;
    color: var(--gray);
    font-weight: 400;
}

/* Affiliate CTA Buttons */
.check-price-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--accent);
    color: var(--white) !important;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.9375rem;
    text-decoration: none !important;
    white-space: nowrap;
    transition: all 0.2s;
}

.check-price-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-hover);
}

.check-price-btn::after {
    content: "→";
}

/* Quick Picks Table - Above the Fold */
.quick-picks {
    background: var(--lighter);
    border: 2px solid var(--accent);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.quick-picks h2 {
    margin-top: 0 !important;
    color: var(--accent);
}

.quick-picks-grid {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.quick-pick-card {
    background: var(--white);
    border: 1px solid var(--light);
    border-radius: var(--radius);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: box-shadow 0.2s;
}

.quick-pick-card:hover {
    box-shadow: var(--shadow);
}

.quick-pick-card .badge {
    background: var(--accent);
    color: var(--white);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
}

.quick-pick-card .badge.value {
    background: #4caf50;
}

.quick-pick-card .badge.budget {
    background: #ff9800;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    :root {
        --gap: 16px;
    }
    
    html {
        font-size: 15px;
    }
    
    .article-title {
        font-size: 1.75rem;
    }
    
    .article-content {
        font-size: 1rem;
    }
    
    .site-nav {
        display: none;
    }
    
    .site-nav.active {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--white);
        padding: 1rem;
        border-bottom: 1px solid var(--light);
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .comparison-table {
        font-size: 0.875rem;
    }
    
    .comparison-table th,
    .comparison-table td {
        padding: 0.75rem;
    }
    
    .quick-pick-card {
        flex-direction: column;
        text-align: center;
    }
    
    .check-price-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Footer */
.site-footer {
    background: var(--dark);
    color: var(--gray-light);
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
}

.affiliate-disclosure {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 2rem;
    font-size: 0.875rem;
}

.affiliate-disclosure a {
    color: var(--accent);
}

.footer-nav {
    margin-bottom: 2rem;
}

.footer-nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    list-style: none;
}

.footer-nav a {
    color: var(--gray-light);
    font-size: 0.9375rem;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 1.5rem;
    font-size: 0.875rem;
    text-align: center;
}

/* Homepage Layout */
.hero-section {
    background: var(--darker);
    color: var(--white);
    padding: 4rem 0;
    text-align: center;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-description {
    font-size: 1.25rem;
    color: var(--gray-light);
    max-width: 600px;
    margin: 0 auto 2rem;
}

/* Post Cards - Grid Layout */
.post-feed {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.post-card {
    background: var(--white);
    border: 1px solid var(--light);
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.post-card:hover {
    box-shadow: var(--shadow-hover);
}

.post-card-image {
    aspect-ratio: 16/9;
    background: var(--light);
}

.post-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-card-content {
    padding: 1.5rem;
}

.post-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.post-card-excerpt {
    color: var(--gray);
    font-size: 0.9375rem;
    line-height: 1.6;
}

/* Loading Performance */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}