/* General Styles - Half Baked Harvest inspired */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    color: var(--color-text);
    background-color: var(--color-background);
    line-height: 1.7;
    font-size: 21px;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

/* Prevent text overflow globally */
h1, h2, h3, h4, h5, h6, p, div, span, a, li {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Ensure all elements respect max width */
* {
    max-width: 100%;
}

/* Prevent images from overflowing */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 400;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: var(--color-text);
}

h1 { font-size: clamp(1.75rem, 5vw, 2.125rem); }
h2 { font-size: clamp(1.5rem, 4vw, 1.875rem); }
h3 { font-size: clamp(1.25rem, 3.5vw, 1.5rem); text-transform: lowercase; }
h4 { font-size: clamp(1.1rem, 3vw, 1.375rem); }

a {
    color: var(--color-primary);
    text-decoration: underline;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-hover);
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 16px;
    width: 100%;
}

@media (max-width: 576px) {
    .container {
        padding: 0 12px;
    }
}

/* Header */
.site-header {
    background: white;
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.site-header .navbar-brand h1 {
    font-size: 1.5rem;
    color: var(--color-primary);
    margin: 0;
    font-weight: 400;
    text-decoration: none;
}

.site-header .navbar-brand a {
    text-decoration: none;
}

.site-header .nav-link {
    font-family: var(--font-ui);
    color: var(--color-text);
    font-weight: 400;
    font-size: 16px;
    padding: 0.75rem 1rem;
    transition: color var(--transition-fast);
    text-decoration: none;
}

.site-header .nav-link:hover {
    color: var(--color-primary);
}

/* Top Bar */
.top-bar {
    background: #282524;
    padding: 8px 0;
}

.top-bar a {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

/* Main Content */
.main-content {
    min-height: 70vh;
    padding: 2rem 0;
}

/* Hero Section */
.hero-section {
    background: var(--color-secondary);
    padding: 3rem 0;
    text-align: center;
    margin-bottom: 2rem;
}

.hero-title {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    font-weight: 400;
    margin-bottom: 1rem;
    color: var(--color-text);
}

.hero-description {
    font-size: clamp(1rem, 2.5vw, 1.125rem);
    max-width: 600px;
    margin: 0 auto;
    padding: 0 1rem;
    color: var(--color-muted);
}

/* Page Header */
.page-header {
    background: var(--color-secondary);
    padding: 2rem 0;
    text-align: center;
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    margin-bottom: 0.5rem;
    color: var(--color-text);
    text-transform: lowercase;
}

/* Section Title */
.section-title {
    font-size: 1.5rem;
    color: var(--color-text);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border);
    text-transform: lowercase;
}

/* Buttons */
.btn-primary {
    background-color: var(--color-primary);
    border: none;
    color: white;
    padding: 12px 26px;
    border-radius: 0;
    font-family: var(--font-ui);
    font-weight: 400;
    font-size: 16px;
    text-decoration: none;
    display: inline-block;
    transition: background-color var(--transition-fast);
}

.btn-primary:hover {
    background-color: var(--color-hover);
    color: white;
}

.btn-read-more {
    background-color: transparent;
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
    padding: 10px 20px;
    border-radius: 0;
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 400;
    display: inline-block;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.btn-read-more:hover {
    background-color: var(--color-primary);
    color: white;
}

/* Cards - Image First Layout */
.article-card,
.excerpt-container {
    background-color: var(--color-background);
    border: none;
    margin-bottom: 2rem;
    transition: opacity var(--transition-fast);
}

.article-card:hover {
    opacity: 0.9;
}

.article-card img {
    width: 100%;
    height: auto;
    margin-bottom: 1rem;
}

.article-card-title {
    font-size: 1.25rem;
    font-weight: 400;
    margin-bottom: 0.5rem;
    text-transform: lowercase;
}

.article-card-title a {
    color: var(--color-text);
    text-decoration: none;
}

.article-card-title a:hover {
    color: var(--color-primary);
}

/* Grid Layout */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

@media (min-width: 768px) {
    .articles-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1200px) {
    .articles-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Sidebar */
.sidebar-card {
    background-color: var(--color-background);
    border: 1px solid var(--color-border);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.sidebar-card h3 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
    text-transform: lowercase;
}

/* Related Cards */
.related-card {
    border: none;
    overflow: hidden;
}

.related-card-image {
    margin-bottom: 0.75rem;
}

.related-card-body {
    padding: 0;
}

.related-card-title {
    font-weight: 400;
    font-size: 1rem;
    color: var(--color-text);
    margin: 0;
    text-transform: lowercase;
}

/* Footer */
.site-footer {
    background: var(--color-dark);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.site-footer h3 {
    color: white;
    font-size: 1.25rem;
    margin-bottom: 1rem;
    text-transform: lowercase;
}

.site-footer h4 {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    margin-bottom: 1rem;
}

.site-footer p {
    color: rgba(255, 255, 255, 0.7);
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--color-accent);
}

.footer-bottom {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
}

/* Content Page */
.content-page {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 2rem 1rem;
}

.content-page h2 {
    color: var(--color-text);
    margin-top: 2rem;
    text-transform: lowercase;
}

.content-page h2:first-child {
    margin-top: 0;
}

.content-page ul {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.content-page li {
    margin-bottom: 0.5rem;
}

/* Responsive */
@media (max-width: 992px) {
    .hero-section {
        padding: 2.5rem 0;
    }

    .page-header {
        padding: 1.5rem 0;
    }

    .main-content {
        padding: 1.5rem 0;
    }
}

@media (max-width: 768px) {
    body {
        font-size: 18px;
    }

    .hero-section {
        padding: 2rem 0;
    }

    .page-header {
        padding: 1.5rem 0;
    }

    .section-title {
        font-size: 1.25rem;
    }

    .site-header .navbar-brand h1 {
        font-size: 1.25rem;
    }

    .articles-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

@media (max-width: 576px) {
    body {
        font-size: 16px;
    }

    .hero-section {
        padding: 1.5rem 0.5rem;
    }

    .page-header {
        padding: 1rem 0.5rem;
    }

    .btn-primary,
    .btn-read-more {
        font-size: 14px;
        padding: 10px 20px;
    }

    .site-footer {
        padding: 2rem 0 1rem;
    }

    .articles-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 375px) {
    .container {
        padding: 0 8px;
    }

    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    h3 { font-size: 1.1rem; }
    h4 { font-size: 1rem; }
}
