/**
 * goateddeals.site - Fine Consumerism on a Budget
 * Elder Millennial Aesthetic: Sophisticated, Warm, Curated
 * Mobile-First Responsive Design
 */

/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:wght@400;500;600&family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

/* ============================================
   CSS CUSTOM PROPERTIES (Design Tokens)
   ============================================ */
:root {
    /* Colors - Warm, Sophisticated Palette - Darkened */
    --color-cream: #E8E4DD;
    --color-white: #F5F3EF;
    --color-charcoal: #0F0F0F;
    --color-stone: #6B6762;
    --color-stone-light: #B8B4AE;
    --color-terracotta: #A88A6E;
    --color-terracotta-dark: #8B7358;
    --color-sage: #5A6B5A;
    --color-warm-gray: #D4D1CC;

    /* Semantic Colors */
    --color-bg: var(--color-cream);
    --color-bg-alt: var(--color-white);
    --color-text: var(--color-charcoal);
    --color-text-muted: var(--color-stone);
    --color-accent: var(--color-terracotta);
    --color-accent-hover: var(--color-terracotta-dark);
    --color-border: var(--color-stone-light);
    --color-success: var(--color-sage);

    /* Button Colors - Slate Blue-Grey */
    --color-button: #5A6B7F;
    --color-button-hover: #4A5A6F;

    /* Typography - Editorial Feel */
    --font-display: 'DM Serif Display', Georgia, serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', monospace;

    /* Spacing Scale - Generous, Breathing Room */
    --space-xs: 0.375rem;
    --space-sm: 0.75rem;
    --space-md: 1.25rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-2xl: 4.5rem;
    --space-3xl: 6rem;

    /* Layout */
    --container-max-width: 760px;
    --container-wide: 1200px;
    --header-height: 72px;

    /* Shadows - Subtle, Premium - Enhanced for darker theme */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.15);
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.08);

    /* Transitions - Smooth, Intentional */
    --transition-fast: 150ms ease-out;
    --transition-normal: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Border Radius - Soft, Modern */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
}

/* ============================================
   CSS RESET & BASE
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.65;
    color: var(--color-text);
    background-color: var(--color-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

/* Headings - DM Serif Display (Editorial) */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 500;
    line-height: 1.2;
    color: var(--color-text);
    margin-bottom: var(--space-md);
    letter-spacing: -0.015em;
}

h1 {
    font-size: clamp(2rem, 6vw, 3.5rem);
    font-weight: 600;
    letter-spacing: -0.02em;
}

h2 {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 600;
}

h3 {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
}

h4 {
    font-size: 1.25rem;
    font-weight: 500;
}

/* Body Text */
p {
    margin-bottom: var(--space-md);
    font-size: 1.025rem;
    color: var(--color-text);
}

/* Links */
a {
    color: var(--color-text);
    text-decoration: none;
    transition: color var(--transition-fast);
    position: relative;
}

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

/* ============================================
   LAYOUT
   ============================================ */

/* Main Container */
.container {
    width: 100%;
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.container-wide {
    width: 100%;
    max-width: var(--container-wide);
    margin: 0 auto;
    padding: 0 var(--space-md);
}

/* Main Content Area */
main {
    flex: 1;
    padding: var(--space-xl) 0;
}

/* ============================================
   HEADER
   ============================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-height);
    background-color: rgba(232, 228, 221, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(107, 103, 98, 0.2);
    display: flex;
    align-items: center;
    transition: background-color var(--transition-normal);
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 var(--space-lg);
    flex-wrap: wrap;
    gap: var(--space-md);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-xl);
    flex: 1;
}

/* Navigation Menu */
.main-nav {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.main-nav a {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--color-text);
    text-decoration: none;
    transition: color var(--transition-fast);
    position: relative;
}

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

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-accent);
    transition: width var(--transition-normal);
}

.main-nav a:hover::after {
    width: 100%;
}

/* Site Name/Logo */
.site-name {
    font-family: var(--font-display);
    font-size: 1.625rem;
    font-weight: 600;
    color: var(--color-text);
    letter-spacing: -0.025em;
    position: relative;
}

.site-name::after {
    content: '';
    position: absolute;
    right: -8px;
    bottom: 6px;
    width: 5px;
    height: 5px;
    background-color: var(--color-accent);
    border-radius: 50%;
}

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

/* ============================================
   HERO SECTION (Featured Deal)
   ============================================ */
.hero-section {
    padding: var(--space-2xl) 0;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: var(--space-2xl);
}

.hero-label {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-accent);
    margin-bottom: var(--space-md);
}

.hero-label::before {
    content: '';
    width: 20px;
    height: 1px;
    background-color: var(--color-accent);
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 5vw, 2.75rem);
    font-weight: 500;
    line-height: 1.2;
    margin-bottom: var(--space-md);
    color: var(--color-text);
}

.hero-subtitle {
    font-size: 1rem;
    color: var(--color-text-muted);
    max-width: 32em;
}

/* ============================================
   SECTION HEADER
   ============================================ */
.section-header {
    display: flex;
    align-items: baseline;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--color-border);
}

.section-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--color-text);
}

.section-count {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

/* ============================================
   PRODUCT CARDS (Redesigned)
   ============================================ */
.product-card {
    background-color: var(--color-bg-alt);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: var(--space-xl);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    border: 1px solid var(--color-stone-light);
    position: relative;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-accent);
}

/* Badge - New/Featured */
.card-badge {
    position: absolute;
    top: var(--space-md);
    left: var(--space-md);
    z-index: 10;
    display: none;
}

.card-badge.latest {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    background-color: var(--color-accent);
    color: var(--color-white);
    font-family: var(--font-mono);
    font-size: 0.625rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-radius: var(--radius-full);
}

/* Product Image Container */
.product-card__image {
    width: 100%;
    aspect-ratio: 4 / 3;
    background-color: var(--color-warm-gray);
    overflow: hidden;
    position: relative;
}

.product-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.product-card:hover .product-card__image img {
    transform: scale(1.02);
}

/* Product Card Content */
.product-card__content {
    padding: var(--space-lg) var(--space-xl);
}

/* Meta info (date, read time) */
.card-meta {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.card-meta__separator {
    width: 3px;
    height: 3px;
    background-color: var(--color-stone-light);
    border-radius: 50%;
}

/* Product Title */
.product-card__title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 500;
    line-height: 1.3;
    margin-bottom: var(--space-sm);
}

.product-card__title a {
    color: inherit;
    background-image: linear-gradient(to right, var(--color-text) 0%, var(--color-text) 100%);
    background-position: 0% 100%;
    background-repeat: no-repeat;
    background-size: 0% 1px;
    transition: background-size var(--transition-normal);
}

.product-card__title a:hover {
    background-image: linear-gradient(to right, var(--color-accent) 0%, var(--color-accent) 100%);
    background-size: 100% 1px;
}

/* Product Price - Redesigned */
.product-card__price {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--color-accent);
    margin-bottom: var(--space-md);
    padding: var(--space-xs) var(--space-sm);
    background-color: rgba(196, 164, 132, 0.1);
    border-radius: var(--radius-sm);
}

/* Product Review Text */
.product-card__review {
    font-size: 0.98rem;
    line-height: 1.7;
    color: rgba(26, 26, 26, 0.75);
    margin-bottom: var(--space-lg);
}

/* CTA Button - Slate Blue-Grey, Rectangular */
.product-card__cta {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 500;
    color: #FFFFFF;
    padding: var(--space-sm) var(--space-lg);
    border: 2px solid var(--color-button);
    border-radius: 4px;
    background-color: var(--color-button);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    text-decoration: none;
}

.product-card__cta:hover {
    background-color: var(--color-button-hover);
    border-color: var(--color-button-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.product-card__cta::after {
    content: '→';
    font-size: 1.1em;
    transition: transform var(--transition-fast);
}

.product-card__cta:hover::after {
    transform: translateX(3px);
}

/* Post CTA Button (View on Amazon) - Slate Blue-Grey, Rectangular */
.post-cta {
    display: inline-block;
    font-size: 1rem;
    font-weight: 600;
    color: #FFFFFF !important;
    padding: var(--space-sm) var(--space-xl);
    background-color: var(--color-button) !important;
    border: 2px solid var(--color-button);
    border-radius: 4px;
    text-decoration: none;
    transition: all var(--transition-normal);
}

.post-cta:hover {
    background-color: var(--color-button-hover) !important;
    border-color: var(--color-button-hover) !important;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Clickable Product Images */
.article-image a,
.post-image-wrapper a {
    display: block;
    text-decoration: none;
    transition: opacity var(--transition-normal);
}

.article-image a:hover,
.post-image-wrapper a:hover {
    opacity: 0.9;
}

.article-image a img,
.post-image-wrapper a img {
    display: block;
    width: 100%;
    transition: transform var(--transition-normal);
}

.article-image a:hover img,
.post-image-wrapper a:hover img {
    transform: scale(1.02);
}

/* Arrow icon for CTA */
.product-card__cta::after {
    content: '→';
    font-size: 1.1em;
    transition: transform var(--transition-fast);
}

.product-card__cta:hover::after {
    transform: translateX(3px);
}

/* ASIN Badge (Optional, for admin/debug) */
.product-card__asin {
    font-family: var(--font-mono);
    font-size: 0.625rem;
    color: var(--color-stone);
    margin-top: var(--space-md);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ============================================
   POST LIST (Grid Layout for Desktop)
   ============================================ */
.posts-list {
    display: grid;
    gap: var(--space-xl);
}

@media (min-width: 768px) {
    .posts-list {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-2xl);
    }
}

@media (min-width: 1024px) {
    .posts-list {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-2xl) var(--space-3xl);
    }
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
    background-color: #D9D5CF;
    border-top: 1px solid var(--color-stone-light);
    padding: var(--space-2xl) 0 var(--space-xl);
    margin-top: var(--space-3xl);
}

.site-footer .container {
    text-align: center;
}

.footer__brand {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: var(--space-sm);
}

.footer__tagline {
    font-size: 0.9375rem;
    color: var(--color-text-muted);
    margin-bottom: var(--space-md);
    max-width: 30em;
    margin-left: auto;
    margin-right: auto;
}

.footer__links {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.footer__links a {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    transition: color var(--transition-fast);
}

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

.footer__copyright {
    font-size: 0.8125rem;
    color: var(--color-stone);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Text Alignment */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* Spacing Utilities */
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }

/* Color Utilities */
.text-accent {
    color: var(--color-accent);
}

.text-muted {
    color: var(--color-text-muted);
}

/* Divider */
.divider {
    height: 1px;
    background: linear-gradient(to right, transparent, var(--color-border) 20%, var(--color-border) 80%, transparent);
    margin: var(--space-xl) 0;
}

/* ============================================
   RESPONSIVE DESIGN - Mobile First
   ============================================ */

/* Extra Small Devices (phones, less than 400px) */
@media (max-width: 399px) {
    :root {
        --space-md: 1rem;
        --space-lg: 1.5rem;
        --space-xl: 2rem;
    }

    .site-header .container {
        padding: 0 var(--space-md);
        flex-direction: column;
        align-items: flex-start;
    }

    .site-name {
        font-size: 1.375rem;
    }

    .header-content {
        flex-direction: column;
        gap: var(--space-sm);
        width: 100%;
    }

    .main-nav {
        gap: var(--space-lg);
        font-size: 0.8125rem;
        width: 100%;
        justify-content: space-between;
    }

    .product-card__content {
        padding: var(--space-md);
    }

    .product-card__title {
        font-size: 1.25rem;
    }
}

/* Small Devices (phones, 400px - 599px) */
@media (min-width: 400px) and (max-width: 599px) {
    .site-header .container {
        flex-wrap: wrap;
    }

    .header-content {
        flex-direction: column;
        gap: var(--space-sm);
        width: 100%;
    }

    .main-nav {
        gap: var(--space-md);
        font-size: 0.875rem;
        width: 100%;
        justify-content: space-between;
    }
}

/* Medium Devices (tablets, 600px - 899px) */
@media (min-width: 600px) {
    :root {
        --space-xl: 3.5rem;
        --space-2xl: 5rem;
    }

    .product-card {
        margin-bottom: var(--space-2xl);
    }
}

/* Large Devices (desktops, 900px and up) */
@media (min-width: 900px) {
    .site-header .container {
        padding: 0 var(--space-xl);
    }

    main {
        padding: var(--space-2xl) 0;
    }
}

/* Extra Large Devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    :root {
        --container-max-width: 800px;
    }
}

/* ============================================
   ANIMATIONS & TRANSITIONS
   ============================================ */

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card {
    animation: fadeIn 0.6s ease forwards;
}

/* Staggered Animation for List Items */
.posts-list .product-card:nth-child(1) { animation-delay: 0ms; }
.posts-list .product-card:nth-child(2) { animation-delay: 100ms; }
.posts-list .product-card:nth-child(3) { animation-delay: 200ms; }
.posts-list .product-card:nth-child(4) { animation-delay: 300ms; }
.posts-list .product-card:nth-child(5) { animation-delay: 400ms; }
.posts-list .product-card:nth-child(6) { animation-delay: 500ms; }

/* ============================================
   ACCESSIBILITY
   ============================================ */

/* Focus Visible for Keyboard Navigation */
:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* Skip to Content Link */
.skip-to-content {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--color-text);
    color: var(--color-white);
    padding: var(--space-sm) var(--space-md);
    text-decoration: none;
    z-index: 1000;
}

.skip-to-content:focus {
    top: 0;
}

/* Reduced Motion Preference */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .site-header,
    .site-footer,
    .product-card__cta,
    .card-badge {
        display: none;
    }

    .product-card {
        box-shadow: none;
        border: 1px solid var(--color-border);
        page-break-inside: avoid;
        break-inside: avoid;
    }
}

/* ============================================
   NETWORK BADGES
   ============================================ */

.network-badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.025em;
    text-transform: uppercase;
}

.network-badge--awin {
    background: linear-gradient(135deg, #5A6B5A 0%, #4A5A4A 100%);
    color: var(--color-white);
}

.network-badge--custom {
    background: linear-gradient(135deg, #6B5A6B 0%, #5A4A5A 100%);
    color: var(--color-white);
}
