/* ==========================================================================
   CA CONCEPT / Ironcadence - Editorial Health & Lifestyle Portal Stylesheet
   Established Authority & Research Standards
   ========================================================================== */

:root {
    --color-primary: #1e3a8a;
    --color-primary-dark: #0f172a;
    --color-primary-light: #3b82f6;
    --color-accent: #059669;
    --color-accent-light: #10b981;
    --color-surface: #ffffff;
    --color-surface-alt: #f8fafc;
    --color-surface-subtle: #f1f5f9;
    --color-text-main: #1e293b;
    --color-text-muted: #64748b;
    --color-border: #e2e8f0;
    --color-border-dark: #cbd5e1;
    --font-serif: "Merriweather", Georgia, "Times New Roman", serif;
    --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

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

body {
    font-family: var(--font-sans);
    color: var(--color-text-main);
    background-color: var(--color-surface-alt);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .editorial-heading {
    font-family: var(--font-sans);
    color: var(--color-primary-dark);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.serif-title {
    font-family: var(--font-serif);
}

/* Reading Progress Bar */
#reading-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #059669, #3b82f6);
    width: 0%;
    z-index: 9999;
    transition: width 0.1s ease-out;
}

/* Header & Navigation */
.site-topbar {
    background-color: #0b1329;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.78rem;
    color: #94a3b8;
    padding: 0.4rem 0;
}

.site-header {
    background: #ffffff;
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
}

.nav-link {
    font-size: 0.92rem;
    font-weight: 600;
    color: #334155;
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.nav-link:hover, .nav-link.active {
    color: var(--color-primary);
    background-color: #f1f5f9;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    color: #ffffff !important;
    font-weight: 600;
    padding: 0.65rem 1.35rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(30, 58, 138, 0.2);
    transition: all 0.25s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #172554 0%, #1e3a8a 100%);
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.3);
    transform: translateY(-1px);
}

.btn-secondary {
    background: #ffffff;
    color: #1e293b !important;
    font-weight: 600;
    padding: 0.65rem 1.35rem;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    transform: translateY(-1px);
}

.btn-accent {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: #ffffff !important;
    font-weight: 600;
    padding: 0.65rem 1.35rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(5, 150, 105, 0.2);
    transition: all 0.25s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-accent:hover {
    background: linear-gradient(135deg, #047857 0%, #065f46 100%);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
    transform: translateY(-1px);
}

/* Editorial Badges & Cards */
.badge-verified {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    background-color: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge-archive {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    background-color: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.article-card {
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: #cbd5e1;
}

.article-card-img-wrapper {
    position: relative;
    overflow: hidden;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
}

.article-card-img-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.article-card:hover .article-card-img-wrapper img {
    transform: scale(1.04);
}

/* Interactive Calculator Container */
.calculator-card {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.calculator-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #1e3a8a, #059669);
}

.calc-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #e2e8f0;
    outline: none;
    transition: opacity 0.2s;
}

.calc-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #1e3a8a;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(30, 58, 138, 0.3);
    transition: transform 0.15s ease;
}

.calc-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

/* Interactive Habit Checklist & Toggles */
.habit-item {
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
    cursor: pointer;
}

.habit-item:hover {
    border-color: #3b82f6;
    background-color: #f8fafc;
}

.habit-item.completed {
    border-color: #10b981;
    background-color: #f0fdf4;
}

/* Accordion FAQ */
.faq-header {
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 1.15rem 1.5rem;
    width: 100%;
    text-align: left;
    font-weight: 600;
    font-size: 1rem;
    color: #1e293b;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.faq-header:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.faq-header.active {
    border-color: #3b82f6;
    background: #eff6ff;
    color: #1e3a8a;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.faq-content {
    display: none;
    border: 1px solid #3b82f6;
    border-top: none;
    background: #ffffff;
    padding: 1.25rem 1.5rem;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.6;
}

.faq-content.open {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

/* Subtle Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(5, 150, 105, 0); }
}

.pulse-indicator {
    animation: pulseGlow 2.5s infinite;
}

/* Floating Back to Top */
#back-to-top {
    position: fixed;
    bottom: 25px;
    right: 25px;
    background: #1e3a8a;
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    border: none;
    z-index: 900;
    transition: transform 0.2s, background-color 0.2s;
}

#back-to-top:hover {
    background: #0f172a;
    transform: translateY(-2px);
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    pointer-events: none;
}

.toast {
    background: #0f172a;
    color: #ffffff;
    padding: 0.85rem 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow-xl);
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    pointer-events: auto;
    animation: fadeIn 0.3s ease-out;
}

/* Clean Editorial Footer */
.site-footer {
    background: #090f1d;
    color: #94a3b8;
    border-top: 1px solid #1e293b;
    font-size: 0.88rem;
}

.footer-heading {
    color: #f1f5f9;
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 1.25rem;
}

.footer-link {
    color: #94a3b8;
    text-decoration: none;
    display: inline-block;
    margin-bottom: 0.65rem;
    transition: color 0.2s ease, transform 0.2s ease;
}

.footer-link:hover {
    color: #ffffff;
    transform: translateX(3px);
}

/* Compliance Banner */
.compliance-bar {
    background: #fffbeb;
    border-bottom: 1px solid #fef3c7;
    color: #92400e;
    font-size: 0.82rem;
    padding: 0.5rem 1rem;
    text-align: center;
}