/* CSS Variables */
:root {
    --color-primary: #5d4037;
    --color-primary-dark: #3e2723;
    --color-primary-light: #8d6e63;
    --color-secondary: #d7ccc8;
    --color-accent: #ff8f00;
    --color-text: #333;
    --color-text-light: #666;
    --color-bg: #fafafa;
    --color-white: #fff;
    --color-border: #e0e0e0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
    --border-radius: 8px;
    --max-width: 1100px;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Base Styles */
html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.7;
    color: var(--color-text);
    background-color: var(--color-bg);
}

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

/* Typography */
h1, h2, h3, h4 {
    color: var(--color-primary-dark);
    line-height: 1.3;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
}

h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--color-primary);
}

h3 {
    font-size: 1.4rem;
    margin: 1.5rem 0 0.75rem;
}

h4 {
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
}

p {
    margin-bottom: 1rem;
}

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

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

ul, ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

li {
    margin-bottom: 0.5rem;
}

/* Header / Hero */
.hero {
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
    color: var(--color-white);
    text-align: center;
    padding: 60px 20px;
}

.hero h1 {
    color: var(--color-white);
    margin-bottom: 0.5rem;
}

.tagline {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 0;
}

/* Navigation */
.main-nav {
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.main-nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
    padding: 0;
    margin: 0;
}

.main-nav li {
    margin: 0;
}

.main-nav a {
    display: block;
    padding: 15px 20px;
    color: var(--color-primary-dark);
    font-weight: 500;
    transition: background-color 0.2s, color 0.2s;
}

.main-nav a:hover {
    background-color: var(--color-secondary);
    color: var(--color-primary-dark);
}

/* Content Sections */
.content-section {
    background: var(--color-white);
    padding: 40px;
    margin: 30px 0;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
}

/* Info Box */
.info-box {
    background: var(--color-secondary);
    padding: 20px 25px;
    border-radius: var(--border-radius);
    margin: 1.5rem 0;
    border-left: 4px solid var(--color-primary);
}

.info-box h3, .info-box h4 {
    margin-top: 0;
}

/* Pro Tip */
.pro-tip {
    background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
    padding: 20px 25px;
    border-radius: var(--border-radius);
    margin: 1.5rem 0;
    border-left: 4px solid var(--color-accent);
}

.pro-tip h4 {
    color: var(--color-accent);
    margin-top: 0;
}

/* Steps */
.steps {
    margin: 2rem 0;
}

.step {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--color-border);
}

.step:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.step-number {
    flex-shrink: 0;
    width: 45px;
    height: 45px;
    background: var(--color-primary);
    color: var(--color-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
}

.step-content h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.step-content p {
    margin-bottom: 0;
}

/* Tables */
.table-container {
    overflow-x: auto;
    margin: 1.5rem 0;
}

.ratio-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 500px;
}

.ratio-table th,
.ratio-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.ratio-table th {
    background: var(--color-primary);
    color: var(--color-white);
    font-weight: 600;
}

.ratio-table tbody tr:hover {
    background: var(--color-secondary);
}

/* Calculator */
.calculator {
    background: var(--color-bg);
    padding: 25px;
    border-radius: var(--border-radius);
    margin: 2rem 0;
    border: 2px solid var(--color-primary);
}

.calculator h3 {
    margin-top: 0;
    margin-bottom: 1rem;
}

.calc-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.calc-row label {
    min-width: 140px;
    font-weight: 500;
}

.calc-row input,
.calc-row select {
    padding: 10px 15px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: 1rem;
    width: 150px;
}

.calc-row input:focus,
.calc-row select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(93, 64, 55, 0.1);
}

.calc-result {
    background: var(--color-primary);
    color: var(--color-white);
    padding: 15px 20px;
    border-radius: 4px;
    font-size: 1.2rem;
    font-weight: 600;
    display: inline-block;
}

/* Temperature Guide */
.temp-guide {
    display: grid;
    gap: 15px;
    margin: 1.5rem 0;
}

.temp-zone {
    padding: 20px;
    border-radius: var(--border-radius);
}

.temp-zone h4 {
    margin-top: 0;
}

.temp-zone p {
    margin-bottom: 0;
}

.temp-zone.optimal {
    background: #e8f5e9;
    border-left: 4px solid #4caf50;
}

.temp-zone.optimal h4 {
    color: #2e7d32;
}

.temp-zone.hot {
    background: #ffebee;
    border-left: 4px solid #f44336;
}

.temp-zone.hot h4 {
    color: #c62828;
}

.temp-zone.cold {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
}

.temp-zone.cold h4 {
    color: #1565c0;
}

/* Grind Comparison */
.grind-comparison {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 1.5rem 0;
}

.grind-type {
    padding: 20px;
    border-radius: var(--border-radius);
}

.grind-type h4 {
    margin-top: 0;
}

.grind-type p {
    margin-bottom: 0;
}

.grind-type.correct {
    background: #e8f5e9;
    border: 2px solid #4caf50;
}

.grind-type.correct h4 {
    color: #2e7d32;
}

.grind-type.incorrect {
    background: #ffebee;
    border: 2px solid #f44336;
}

.grind-type.incorrect h4 {
    color: #c62828;
}

/* Product Cards */
.product-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 1.5rem 0;
}

.product-card {
    background: var(--color-bg);
    padding: 20px;
    border-radius: var(--border-radius);
    border: 1px solid var(--color-border);
}

.product-card h4 {
    margin-top: 0;
    color: var(--color-primary);
}

.product-card p {
    margin-bottom: 0;
    font-size: 0.95rem;
}

/* Problems/Solutions */
.problem-solution {
    display: grid;
    gap: 20px;
}

.problem {
    background: var(--color-bg);
    padding: 20px;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--color-primary-light);
}

.problem h3 {
    margin-top: 0;
    color: var(--color-primary);
}

.problem ul {
    margin-bottom: 0;
}

/* Equipment Grid */
.equipment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 1.5rem 0;
}

.equipment-item {
    background: var(--color-bg);
    padding: 25px;
    border-radius: var(--border-radius);
    border: 1px solid var(--color-border);
    transition: box-shadow 0.2s, transform 0.2s;
}

.equipment-item:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.equipment-item h4 {
    margin-top: 0;
    color: var(--color-primary-dark);
}

.equipment-item p {
    font-size: 0.95rem;
    color: var(--color-text-light);
    margin-bottom: 1rem;
}

.buy-link {
    display: inline-block;
    background: var(--color-accent);
    color: var(--color-white);
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 600;
    transition: background-color 0.2s, transform 0.1s;
}

.buy-link:hover {
    background: #e65100;
    color: var(--color-white);
    transform: scale(1.02);
}

/* FAQ */
.faq-item {
    padding: 20px 0;
    border-bottom: 1px solid var(--color-border);
}

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

.faq-item h3 {
    margin-top: 0;
    color: var(--color-primary);
    font-size: 1.15rem;
}

.faq-item p {
    margin-bottom: 0;
    color: var(--color-text-light);
}

/* Footer */
footer {
    background: var(--color-primary-dark);
    color: var(--color-white);
    padding: 30px 20px;
    margin-top: 40px;
    text-align: center;
}

footer p {
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

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

/* Responsive */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.6rem;
    }

    .hero {
        padding: 40px 20px;
    }

    .content-section {
        padding: 25px 20px;
        margin: 20px 10px;
    }

    .main-nav a {
        padding: 12px 15px;
        font-size: 0.9rem;
    }

    .step {
        flex-direction: column;
        gap: 10px;
    }

    .calc-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .calc-row input,
    .calc-row select {
        width: 100%;
    }

    .equipment-grid,
    .product-cards,
    .grind-comparison {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .main-nav ul {
        flex-direction: column;
    }

    .main-nav a {
        text-align: center;
    }
}
