/*
Theme Name: CFS Recovery
Theme URI: https://thecfsrecovery.com
Author: Hanzla
Author URI: https://thecfsrecovery.com
Description: A calm editorial WordPress theme for thecfsrecovery.com. Built for chronic illness recovery content with the Dawn and Mist palette and gentle reading typography.
Version: 2.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: cfsrecovery
*/

* { box-sizing: border-box; margin: 0; padding: 0; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

:root {
    --primary: #8AA3B8;
    --primary-dark: #6E8AA3;
    --accent: #E89B7C;
    --accent-dark: #D67E5C;
    --text: #2C3848;
    --text-muted: #6B7785;
    --bg: #F8F5F0;
    --surface: #FFFFFF;
    --cream: #E6D9C5;
    --border: #E5DFD4;
    --container: 1200px;
    --narrow: 720px;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 18px;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 500;
    line-height: 1.2;
    color: var(--text);
    letter-spacing: -0.01em;
}

h1 { font-size: 3rem; }
h2 { font-size: 2.25rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p { margin-bottom: 1.5rem; }

a { color: var(--primary-dark); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--accent-dark); }

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

.narrow {
    max-width: var(--narrow);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.btn {
    display: inline-block;
    padding: 0.875rem 1.75rem;
    font-weight: 500;
    border-radius: 12px;
    text-decoration: none;
    transition: all 200ms ease;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--accent);
    color: var(--text);
}

.btn-primary:hover {
    background: var(--accent-dark);
    color: var(--surface);
    transform: translateY(-2px);
}

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

.btn-secondary:hover {
    background: var(--text);
    color: var(--bg);
}

/* Header */
.site-header {
    background: rgba(248, 245, 240, 0.95);
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
}

.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.site-logo {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
}

.site-logo em {
    color: var(--accent-dark);
    font-style: italic;
}

.main-nav ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.main-nav a {
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
}

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

/* Hero */
.hero {
    padding: 6rem 0 4rem;
    text-align: center;
    background: linear-gradient(180deg, var(--bg) 0%, var(--cream) 100%);
}

.hero-eyebrow {
    display: inline-block;
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary-dark);
    margin-bottom: 1.5rem;
}

.hero-title {
    font-size: clamp(2.25rem, 5vw, 3.75rem);
    line-height: 1.1;
    margin-bottom: 1.5rem;
    max-width: 880px;
    margin-left: auto;
    margin-right: auto;
}

.hero-title em {
    font-style: italic;
    color: var(--accent-dark);
}

.hero-subtitle {
    font-size: 1.25rem;
    line-height: 1.5;
    color: var(--text-muted);
    max-width: 640px;
    margin: 0 auto 3rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Sections */
.section {
    padding: 5rem 0;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 { margin-bottom: 0.75rem; }
.section-header p {
    color: var(--text-muted);
    font-size: 1.125rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Category cards */
.category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.category-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2.5rem;
    transition: all 200ms ease;
    text-decoration: none;
    color: inherit;
    display: block;
}

.category-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 12px 32px rgba(44, 56, 72, 0.10);
}

.category-card h3 {
    margin-bottom: 0.75rem;
}

.category-card p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.category-card-link {
    color: var(--primary-dark);
    font-weight: 500;
    font-size: 0.95rem;
    border-bottom: 1px solid var(--primary-dark);
    padding-bottom: 2px;
}

/* About section */
.section-about {
    background: var(--cream);
    padding: 5rem 0;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 3rem;
    align-items: center;
}

.about-image {
    aspect-ratio: 1;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
}

.about-content h2 { margin-bottom: 1.5rem; }
.about-content p {
    font-size: 1.125rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

/* Post grid */
.post-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
}

.post-card {
    display: flex;
    flex-direction: column;
}

.post-card-image {
    aspect-ratio: 16 / 10;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
}

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

.post-card-category {
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
    text-decoration: none;
}

.post-card-title {
    font-size: 1.25rem;
    line-height: 1.3;
    margin-bottom: 0.75rem;
}

.post-card-title a {
    color: var(--text);
    text-decoration: none;
}

.post-card-title a:hover { color: var(--accent-dark); }

.post-card-meta {
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* Newsletter */
.newsletter {
    background: var(--text);
    color: var(--bg);
    padding: 5rem 0;
    text-align: center;
}

.newsletter h2, .newsletter p { color: var(--bg); }
.newsletter h2 { margin-bottom: 0.75rem; }
.newsletter p {
    color: rgba(248, 245, 240, 0.8);
    font-size: 1.125rem;
    margin-bottom: 2.5rem;
}

.newsletter-form {
    display: flex;
    gap: 0.75rem;
    max-width: 480px;
    margin: 0 auto;
}

.newsletter-form input {
    flex: 1;
    padding: 0.875rem 1.25rem;
    font: inherit;
    color: var(--bg);
    background: rgba(248, 245, 240, 0.08);
    border: 1px solid rgba(248, 245, 240, 0.2);
    border-radius: 12px;
}

.newsletter-form input::placeholder { color: rgba(248, 245, 240, 0.5); }

.newsletter small {
    display: block;
    font-size: 0.8125rem;
    color: rgba(248, 245, 240, 0.5);
    margin-top: 1rem;
}

/* Single post */
.post-header {
    padding: 4rem 0 2rem;
    text-align: center;
}

.post-header-category {
    display: inline-block;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary-dark);
    margin-bottom: 1rem;
}

.post-header-title {
    font-size: clamp(2rem, 4.5vw, 2.75rem);
    line-height: 1.15;
    max-width: 880px;
    margin: 0 auto 1.5rem;
}

.post-header-meta {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.post-featured {
    max-width: var(--container);
    margin: 0 auto 3rem;
    padding: 0 1.5rem;
}

.post-featured img { width: 100%; border-radius: 20px; }

.post-content {
    max-width: var(--narrow);
    margin: 0 auto;
    padding: 0 1.5rem 4rem;
}

.post-content h2 { margin: 3rem 0 1.5rem; }
.post-content h3 { margin: 2.5rem 0 1rem; }
.post-content p, .post-content ul, .post-content ol { margin-bottom: 1.5rem; }
.post-content ul, .post-content ol { padding-left: 2rem; }
.post-content li { margin-bottom: 0.5rem; }
.post-content blockquote {
    border-left: 3px solid var(--accent);
    padding: 0.75rem 2rem;
    margin: 2.5rem 0;
    font-family: 'Fraunces', Georgia, serif;
    font-style: italic;
    font-size: 1.25rem;
}
.post-content img { border-radius: 12px; margin: 2rem 0; }
.post-content a {
    color: var(--primary-dark);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.post-content a:hover { color: var(--accent-dark); }

/* Archive */
.archive-header {
    padding: 4rem 0 2rem;
    text-align: center;
    background: var(--cream);
}

.archive-header h1 { margin-bottom: 0.75rem; }
.archive-header p { color: var(--text-muted); }

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 4rem;
}

.pagination a, .pagination span {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    text-decoration: none;
    color: var(--text);
}

.pagination a:hover, .pagination .current {
    background: var(--text);
    color: var(--bg);
    border-color: var(--text);
}

/* Footer */
.site-footer {
    background: var(--cream);
    padding: 4rem 0 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-brand p {
    color: var(--text-muted);
    font-size: 0.95rem;
    max-width: 320px;
    margin-top: 1rem;
}

.footer-col h4 {
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.footer-col ul {
    list-style: none;
}

.footer-col li { margin-bottom: 0.5rem; }

.footer-col a {
    color: var(--text-muted);
    font-size: 0.95rem;
    text-decoration: none;
}

.footer-col a:hover { color: var(--accent-dark); }

.footer-bottom {
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* 404 */
.error-404 {
    text-align: center;
    padding: 8rem 0;
}

.error-404-number {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 8rem;
    font-style: italic;
    line-height: 1;
    color: var(--accent);
    margin-bottom: 1.5rem;
}

.error-404 p {
    color: var(--text-muted);
    margin: 1.5rem 0 2.5rem;
}

/* Responsive */
@media (max-width: 900px) {
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    .category-grid, .post-grid { grid-template-columns: repeat(2, 1fr); }
    .about-grid { grid-template-columns: 1fr; }
    .about-image { max-width: 280px; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
    body { font-size: 16px; }
    .main-nav ul { display: none; }
    .category-grid, .post-grid { grid-template-columns: 1fr; }
    .newsletter-form { flex-direction: column; }
    .footer-grid { grid-template-columns: 1fr; }
    .hero { padding: 3rem 0; }
    .section, .section-about, .newsletter { padding: 3rem 0; }
}

/* A11y */
.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
}

a:focus-visible, button:focus-visible, input:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}
