/* Global Styles */
:root {
    --primary-color: #37352F;
    --secondary-color: #D9730D;
    --accent-color: #0F7B6C;
    --text-dark: #37352F;
    --text-light: #787774;
    --bg-light: #F7F6F3;
    --bg-white: #FDFCFA;
    --border-color: #E9E7E4;
    --success-color: #0F7B6C;
    --shadow-sm: 0 1px 3px rgba(55, 53, 47, 0.1);
    --shadow-md: 0 4px 8px rgba(55, 53, 47, 0.12);
    --shadow-lg: 0 8px 24px rgba(55, 53, 47, 0.15);
    --max-width: 1200px;
    --border-radius: 6px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-white);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: env(safe-area-inset-top);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
}

h2 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-top: 2rem;
}

h3 {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin-top: 0.75rem;
}

p {
    margin-bottom: 1rem;
    color: var(--text-dark);
    line-height: 1.8;
}

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

a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

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

.header-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.logo:hover {
    text-decoration: none;
}

/* Navigation */
nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
    align-items: center;
}

nav a {
    color: var(--text-dark);
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

nav a:hover {
    color: var(--secondary-color);
    text-decoration: none;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--secondary-color);
    transition: width 0.3s ease;
}

nav a:hover::after,
nav a.active::after {
    width: 100%;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--text-dark);
    margin: 5px 0;
    transition: 0.3s;
}

/* Main Content */
main {
    flex: 1;
    max-width: var(--max-width);
    margin: 2rem auto;
    padding: 0 2rem;
    width: 100%;
}

.content-container {
    max-width: 720px;
    margin: 0 auto;
    width: 100%;
}

article {
    background-color: var(--bg-white);
    padding: 2rem 0;
}

.hero {
    text-align: center;
    padding: 3rem 0;
    margin-bottom: 3rem;
}

.hero h1 {
    margin-bottom: 1.5rem;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-light);
    max-width: 800px;
    margin: 0 auto;
}

/* Content Sections */
.content-section {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

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

.content-section h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    margin-top: 0.5rem;
}

/* Cards */
.card {
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.2s ease;
    position: relative;
}

.card:hover {
    background-color: var(--bg-light);
    border-color: var(--border-color);
    box-shadow: var(--shadow-sm);
}

.card h3 {
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.4;
}

.card p {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.card p:last-child {
    margin-bottom: 0;
}

/* Card variants */
.card-feature {
    border-left: 3px solid var(--secondary-color);
    background: linear-gradient(135deg, var(--bg-white) 0%, rgba(217, 115, 13, 0.02) 100%);
}

.card-feature:hover {
    background: linear-gradient(135deg, var(--bg-light) 0%, rgba(217, 115, 13, 0.04) 100%);
}

.card-app {
    border-left: 3px solid var(--accent-color);
    background: linear-gradient(135deg, var(--bg-white) 0%, rgba(15, 123, 108, 0.02) 100%);
}

.card-app:hover {
    background: linear-gradient(135deg, var(--bg-light) 0%, rgba(15, 123, 108, 0.04) 100%);
}

/* Tables */
.table-container {
    overflow-x: auto;
    margin: 2rem 0;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
}

table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--bg-white);
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: var(--bg-light);
    font-weight: 600;
    color: var(--primary-color);
    position: sticky;
    top: 0;
}

tr:hover {
    background-color: var(--bg-light);
}

.check {
    color: var(--success-color);
    font-weight: bold;
}

.cross {
    color: var(--accent-color);
    font-weight: bold;
}

/* Lists */
ul, ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

li {
    margin-bottom: 0.5rem;
    line-height: 1.8;
}

.feature-list {
    list-style: none;
    margin-left: 0;
}

.feature-list li {
    padding-left: 2rem;
    position: relative;
    margin-bottom: 1rem;
}

.feature-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--success-color);
    font-weight: bold;
    font-size: 1.2rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.625rem 1.25rem;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    font-size: 0.875rem;
}

.btn:hover {
    background-color: #C4640B;
    text-decoration: none;
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-secondary {
    background-color: var(--bg-light);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--border-color);
    color: var(--text-dark);
    border-color: #D4D2CF;
}

/* Grid Layouts */
.grid {
    display: grid;
    gap: 2rem;
    margin: 2rem 0;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Callout Boxes */
.callout {
    background-color: var(--bg-light);
    border-left: 3px solid var(--secondary-color);
    padding: 1.25rem;
    margin: 1.5rem 0;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--secondary-color);
}

.callout-success {
    border-left-color: var(--success-color);
    background: linear-gradient(135deg, var(--bg-light) 0%, rgba(15, 123, 108, 0.03) 100%);
}

.callout-warning {
    border-left-color: #E25B45;
    background: linear-gradient(135deg, var(--bg-light) 0%, rgba(226, 91, 69, 0.03) 100%);
}

/* Footer */
footer {
    background-color: var(--primary-color);
    color: white;
    padding: 3rem 0 2rem;
    margin-top: 4rem;
}

.footer-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    align-items: start;
}

@media (max-width: 768px) {
    .footer-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }
}

.footer-section h4 {
    color: white;
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
    margin-left: 0;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: white;
    text-decoration: none;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: var(--secondary-color);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 1000;
    border: none;
    font-size: 1.5rem;
}

.back-to-top.visible {
    opacity: 1;
}

.back-to-top:hover {
    transform: translateY(-5px);
    background-color: var(--primary-color);
}

/* Navbar Responsive Design */
@media (max-width: 1120px) {
    .menu-toggle {
        display: block;
    }

    nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--bg-white);
        border-bottom: 1px solid var(--border-color);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    nav.active {
        max-height: 400px;
    }

    nav ul {
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
    }
}

/* General Responsive Design */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }

    .header-container {
        padding: 1rem;
    }

    main {
        padding: 0 1rem;
        margin: 1rem auto;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .hero {
        padding: 2rem 1rem;
    }

    .table-container {
        margin: 1rem -1rem;
    }

    th, td {
        padding: 0.75rem 0.5rem;
        font-size: 0.9rem;
    }

    .card {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.75rem;
    }

    .hero p {
        font-size: 1.1rem;
    }

    .btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
}

/* Print Styles */
@media print {
    header, footer, .back-to-top, nav {
        display: none;
    }

    main {
        max-width: 100%;
    }

    a {
        color: var(--text-dark);
        text-decoration: underline;
    }

    .card {
        break-inside: avoid;
    }
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* Focus Styles */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

/* Loading Spinner */
.spinner {
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--secondary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Comparison Table Specific Styles */
.comparison-table {
    margin: 3rem 0;
}

.comparison-table th:first-child {
    background-color: var(--primary-color);
    color: white;
}

.rating {
    color: var(--accent-color);
    font-size: 1.1rem;
}

/* Quote Blocks */
blockquote {
    border-left: 4px solid var(--secondary-color);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: var(--text-light);
}

/* Code Blocks */
code {
    background-color: var(--bg-light);
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
}

pre {
    background-color: var(--bg-light);
    padding: 1rem;
    border-radius: var(--border-radius);
    overflow-x: auto;
    margin: 1rem 0;
}

pre code {
    background-color: transparent;
    padding: 0;
}

/* Reading Benefits Timeline */
.reading-benefits-timeline {
    margin: 2rem 0;
    padding: 2rem;
    background: linear-gradient(135deg, var(--bg-light) 0%, rgba(217, 115, 13, 0.05) 100%);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

.timeline-container {
    position: relative;
    max-width: 100%;
    padding-left: 40px;
}

.timeline-container::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--secondary-color) 0%, var(--success-color) 100%);
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    margin-bottom: 2.5rem;
    opacity: 0;
    transform: translateX(-20px);
    animation: slideInLeft 0.6s ease-out forwards;
}

.timeline-item:nth-child(1) { animation-delay: 0.1s; }
.timeline-item:nth-child(2) { animation-delay: 0.2s; }
.timeline-item:nth-child(3) { animation-delay: 0.3s; }
.timeline-item:nth-child(4) { animation-delay: 0.4s; }
.timeline-item:nth-child(5) { animation-delay: 0.5s; }

.timeline-dot {
    position: absolute;
    left: -29px;
    top: 8px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: var(--bg-white);
    border: 3px solid var(--secondary-color);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    z-index: 2;
}

/* Timeline Content Styles */
.timeline-content {
    background-color: var(--bg-white);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.timeline-content:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.timeline-content h3 {
    color: var(--primary-color);
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.benefit-stat {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 0.75rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, rgba(217, 115, 13, 0.1) 0%, rgba(217, 115, 13, 0.05) 100%);
    border-radius: 25px;
    display: inline-block;
}

.timeline-content p:last-child {
    margin-bottom: 0;
    color: var(--text-light);
    line-height: 1.6;
}

/* Color-coded timeline items */
.timeline-item[data-time="immediate"] .timeline-dot {
    border-color: #e74c3c;
    background-color: #e74c3c;
}

.timeline-item[data-time="daily"] .timeline-dot {
    border-color: #f39c12;
    background-color: #f39c12;
}

.timeline-item[data-time="ongoing"] .timeline-dot {
    border-color: #9b59b6;
    background-color: #9b59b6;
}

.timeline-item[data-time="lifetime"] .timeline-dot {
    border-color: var(--secondary-color);
    background-color: var(--secondary-color);
}

.timeline-item[data-time="aging"] .timeline-dot {
    border-color: var(--success-color);
    background-color: var(--success-color);
}

.timeline-item[data-time="immediate"] .benefit-stat {
    color: #e74c3c;
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.1) 0%, rgba(231, 76, 60, 0.05) 100%);
}

.timeline-item[data-time="daily"] .benefit-stat {
    color: #f39c12;
    background: linear-gradient(135deg, rgba(243, 156, 18, 0.1) 0%, rgba(243, 156, 18, 0.05) 100%);
}

.timeline-item[data-time="ongoing"] .benefit-stat {
    color: #9b59b6;
    background: linear-gradient(135deg, rgba(155, 89, 182, 0.1) 0%, rgba(155, 89, 182, 0.05) 100%);
}

.timeline-item[data-time="lifetime"] .benefit-stat {
    color: var(--secondary-color);
    background: linear-gradient(135deg, rgba(217, 115, 13, 0.1) 0%, rgba(217, 115, 13, 0.05) 100%);
}

.timeline-item[data-time="aging"] .benefit-stat {
    color: var(--success-color);
    background: linear-gradient(135deg, rgba(15, 123, 108, 0.1) 0%, rgba(15, 123, 108, 0.05) 100%);
}

/* Animations */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.timeline-dot:hover {
    transform: scale(1.1);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .reading-benefits-timeline {
        padding: 1rem;
    }
    
    .timeline-container {
        padding-left: 30px;
    }
    
    .timeline-container::before {
        left: 15px;
    }
    
    .timeline-item {
        margin-bottom: 2rem;
    }
    
    .timeline-dot {
        left: -22px;
        width: 14px;
        height: 14px;
        border-width: 2px;
    }
    
    .timeline-content {
        padding: 1rem;
    }
    
    .timeline-content h3 {
        font-size: 1.1rem;
    }
    
    .benefit-stat {
        font-size: 1rem;
        padding: 0.4rem 0.8rem;
    }
}

/* Homepage Specific Styles */

/* Featured Article Section */
.featured-article {
    margin: 3rem 0 4rem 0;
    padding: 2rem 0;
    background: linear-gradient(135deg, var(--bg-white) 0%, var(--bg-light) 100%);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.featured-card {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
}

.featured-content h1 {
    font-size: 2.75rem;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    font-weight: 700;
}

.featured-excerpt {
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--text-light);
    margin-bottom: 2rem;
    max-width: 65ch;
}

.read-more-btn {
    display: inline-block;
    background-color: var(--secondary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.read-more-btn:hover {
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Articles Grid Section */
.articles-grid {
    margin: 4rem 0;
}

.articles-grid .grid {
    gap: 2rem;
    margin: 2rem 0 0 0;
}

.articles-grid .card {
    padding: 2rem;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: var(--bg-white);
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.articles-grid .card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--secondary-color);
}

.articles-grid .card h2 {
    font-size: 1.375rem;
    margin: 0 0 1rem 0;
    font-weight: 600;
}

.articles-grid .card h2 a {
    color: var(--primary-color);
    text-decoration: none;
}

.articles-grid .card h2 a:hover {
    color: var(--secondary-color);
    text-decoration: none;
}

.articles-grid .card p {
    flex-grow: 1;
    margin-bottom: 1.5rem;
    color: var(--text-light);
    line-height: 1.6;
}

.card-link {
    color: var(--secondary-color);
    font-weight: 600;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s ease;
    margin-top: auto;
}

.card-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Mobile Responsiveness for Homepage */
@media (max-width: 768px) {
    .featured-content h1 {
        font-size: 2.25rem;
        line-height: 1.25;
    }
    
    .featured-excerpt {
        font-size: 1rem;
        line-height: 1.6;
    }
    
    .featured-card {
        padding: 0 1.5rem;
    }
    
    .featured-article {
        margin: 2rem 0 3rem 0;
        padding: 1.5rem 0;
    }
    
    .articles-grid .card {
        padding: 1.5rem;
    }
    
    .articles-grid {
        margin: 3rem 0;
    }
}

@media (max-width: 480px) {
    .featured-content h1 {
        font-size: 1.875rem;
    }
    
    .featured-card {
        padding: 0 1rem;
    }
    
    .read-more-btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.95rem;
    }
}