/* =========================================================================
   ABSTRACT VARIABLES (Tokens)
   Defines reusable values for colors, typography, spacing, and transitions.
========================================================================= */
:root {
    /* Colors */
    --ach-color-primary: #007bff; /* Example primary color */
    --ach-color-accent: #ff5722;  /* Example accent color (CTA) */
    --ach-color-text: #111827;    /* Dark text for body */
    --ach-color-muted: rgba(17, 24, 39, 0.6); /* Lighter text for meta/descriptions */
    --ach-color-bg: #ffffff;     /* Light background for sections */
    --ach-color-surface: #f9fafb; /* Slightly darker surface for cards/footer */
    --ach-color-border: rgba(17, 24, 39, 0.08); /* Light border color */
    --ach-color-border-subtle: rgba(17, 24, 39, 0.15); /* Slightly darker border */

    /* Typography */
    --ach-font-heading: 'System-ui', sans-serif; /* Example heading font */
    --ach-font-body: 'System-ui', sans-serif;    /* Example body font */
    --ach-font-size-base: 16px;
    --ach-font-size-sm: 13px;
    --ach-font-size-lg: 32px;
    --ach-line-height-heading: 1.2;
    --ach-line-height-body: 1.5;

    /* Spacing & Dimensions */
    --ach-space-xs: 4px;
    --ach-space-sm: 8px;
    --ach-space-md: 12px;
    --ach-space-lg: 16px;
    --ach-space-xl: 20px;
    --ach-space-xxl: 22px; /* NEW: Added 22px spacing variable */
    --ach-space-2xl: 24px;
    --ach-space-3xl: 48px;

    /* Border Radius */
    --ach-radius-sm: 4px;
    --ach-radius-md: 8px;
    --ach-radius-lg: 12px;
    --ach-radius-post-thumb: 10px;

    /* Transitions & Shadows */
    --ach-transition-speed: 0.15s;
    --ach-transition-ease: ease;
    --ach-shadow-hover: 0 10px 24px rgba(0, 0, 0, 0.08);
}

/* === GLOBAL STICKY FOOTER FIX === */
html {
    height: 100%;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column; 
    margin: 0;
    padding: 0;
    font-family: var(--ach-font-body);
    font-size: var(--ach-font-size-base);
}

.site-main-content-wrapper {
    flex-grow: 1; 
}
/* === END STICKY FOOTER FIX === */

/* =========================================================================
   LAYOUT UTILITIES
   Reusable classes for general layout structure.
========================================================================= */

.ach-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--ach-space-xl);
}

.ach-section {
    padding: var(--ach-space-md) 0; /* Base vertical padding (12px) */
    background: var(--ach-color-bg);
    color: var(--ach-color-text);
}

.ach-section__title {
    font-size: var(--ach-font-size-lg);
    line-height: var(--ach-line-height-heading);
    margin: 0 0 var(--ach-space-2xl);
    font-family: var(--ach-font-heading);
}

.ach-grid {
    display: grid;
    gap: var(--ach-space-2xl);
}

/* Grid abstractions based on number of columns */
.ach-grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ach-grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* =========================================================================
   COMPONENTS
   Styling for specific elements like buttons, cards, posts.
========================================================================= */

/* Buttons */
.ach-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    border-radius: var(--ach-radius-md);
    padding: var(--ach-space-md) var(--ach-space-xl);
    text-decoration: none;
    transition: transform var(--ach-transition-speed) var(--ach-transition-ease),
        box-shadow var(--ach-transition-speed) var(--ach-transition-ease);
}

.ach-button--primary {
    background: var(--ach-color-primary);
    color: #fff;
}

.ach-button--primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px color-mix(in oklab, var(--ach-color-primary), #000 25%);
}

.ach-button--ghost {
    background: transparent;
    color: var(--ach-color-text);
    border: 1px solid var(--ach-color-border-subtle);
}

.ach-button--ghost:hover {
    background: rgba(17, 24, 39, 0.04);
}

/* Cards & Quotes */
.ach-card {
    border: 1px solid var(--ach-color-border);
    border-radius: var(--ach-radius-lg);
    padding: var(--ach-space-xl);
    background: var(--ach-color-surface);
}

.ach-quote {
    border-left: 4px solid var(--ach-color-primary);
    padding-left: var(--ach-space-lg);
    color: var(--ach-color-text);
}

.ach-list {
    margin: 0;
    padding-left: 18px; /* Hardcoded padding-left for lists */
}

.ach-media-placeholder {
    width: 100%;
    aspect-ratio: 4/3;
    background: rgba(17, 24, 39, 0.06);
    border-radius: var(--ach-radius-lg);
}

/* Posts */
.ach-post-card__thumb img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--ach-radius-post-thumb);
}

.ach-post-card__body {
    margin-top: 14px; /* Hardcoded margin */
}

.ach-post-card__title {
    margin: 0 0 6px; /* Hardcoded margin */
    font-size: var(--ach-space-xl); /* Reusing a space value for font size (20px) */
    line-height: 1.35;
    font-family: var(--ach-font-heading);
}

.ach-post-card__title a {
    color: var(--ach-color-text);
    text-decoration: none;
}

.ach-post-card__title a:hover {
    text-decoration: underline;
}

.ach-post-card__meta {
    font-size: var(--ach-font-size-sm);
    color: var(--ach-color-muted);
    margin-bottom: var(--ach-space-sm);
}

.ach-post-card__excerpt {
    margin: 0 0 var(--ach-space-md);
    color: var(--ach-color-muted);
}

/* Categories */
.ach-grid--categories {
    align-items: stretch;
}

.ach-category-card {
    display: block;
    text-decoration: none;
    color: var(--ach-color-text);
    padding: 18px; /* Hardcoded padding */
    border-radius: var(--ach-radius-lg);
    border: 1px solid var(--ach-color-border);
    background: var(--ach-color-surface);
    transition: transform var(--ach-transition-speed) var(--ach-transition-ease),
        box-shadow var(--ach-transition-speed) var(--ach-transition-ease);
}

.ach-category-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--ach-shadow-hover);
}

.ach-category-card__header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 2px; /* Hardcoded gap */
    margin-bottom: var(--ach-space-sm);
}

.ach-category-card__name {
    font-family: var(--ach-font-heading);
    font-weight: 600;
}

.ach-category-card__count {
    font-size: var(--ach-font-size-sm);
    color: var(--ach-color-muted);
}

.ach-category-card__desc {
    margin: 0;
    color: var(--ach-color-muted);
}

/* CTA */
.ach-cta {
    background: var(--ach-color-accent);
    color: #fff;
}

.ach-cta .ach-section__title {
    color: #fff;
}

.ach-cta__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--ach-space-lg);
}

/* FAQ */
.ach-faq details {
    border: 1px solid var(--ach-color-border);
    border-radius: var(--ach-radius-md);
    padding: 14px var(--ach-space-lg); /* Hardcoded top/bottom padding */
    background: var(--ach-color-surface);
}

.ach-faq details + details {
    margin-top: var(--ach-space-md);
}

.ach-faq summary {
    cursor: pointer;
    font-weight: 600;
}

/* =========================================================================
   CUSTOM FIXES & OVERRIDES
========================================================================= */

/* Ensure footer stacks below any floated content */
.site-content::after {
    content: "";
    display: block;
    clear: both;
}

#colophon,
.site-footer {
    clear: both;
    display: block;
    width: 100%;
}

/* --- CRITICAL FIX: Custom padding for Categories and Posts (22px) --- */
/* Set 22px vertical padding for Categories */
.ach-categories.ach-section {
    padding: var(--ach-space-xxl) 0 !important; /* Forces 22px vertical padding */
}

/* Set 22px vertical padding for Posts */
.ach-posts.ach-section {
    padding-top: var(--ach-space-xxl) !important;
    padding-bottom: var(--ach-space-xxl) !important;
}

/* =========================================================================
   CUSTOM MINIMAL FOOTER STYLES
========================================================================= */

.minimal-footer {
    background-color: var(--ach-color-surface);
    color: var(--ach-color-text);
    padding: var(--ach-space-xl) 15px 0; /* Use variable for top padding */
    border-top: 1px solid var(--ach-color-border);
    width: 100%;
    box-sizing: border-box;
    clear: both;
    display: block;
}

.minimal-footer .footer-content {
    display: flex;
    justify-content: space-between;
    max-width: 1000px; /* Hardcoded width */
    margin: 0 auto 5px; /* Hardcoded margin */
    padding-bottom: 15px; /* Hardcoded padding */
    border-bottom: 1px solid var(--ach-color-border);
    gap: 15px; /* Hardcoded gap */
}

.footer-info {
    flex: 1;
    max-width: 40%;
}

.footer-description {
    font-size: 0.9em;
    line-height: 1.3;
    margin: 0 0 10px 0; /* Hardcoded margin */
}

.social-icons a {
    color: var(--ach-color-muted);
    font-size: 1.1em;
    margin-right: 10px; /* Hardcoded margin */
    transition: color 0.3s; /* Hardcoded transition speed */
}

.social-icons a:hover {
    color: var(--ach-color-primary);
}

.footer-newsletter {
    flex: 1.5;
    max-width: 50%;
}

.footer-newsletter h4 {
    font-size: 1em;
    margin: 0 0 var(--ach-space-sm);
}

.footer-newsletter form {
    display: flex;
    gap: 5px; /* Hardcoded gap */
}

.footer-newsletter input[type="email"] {
    flex-grow: 1;
    padding: var(--ach-space-sm);
    border: 1px solid var(--ach-color-border-subtle);
    border-radius: var(--ach-radius-sm);
    font-size: 0.85em;
}

.footer-newsletter button {
    padding: var(--ach-space-sm) 15px; /* Hardcoded padding */
    background-color: var(--ach-color-text);
    color: #fff;
    border: 0;
    border-radius: var(--ach-radius-sm);
    cursor: pointer;
    font-size: 0.85em;
    text-transform: uppercase;
    transition: background-color 0.3s; /* Hardcoded transition speed */
}

.footer-newsletter button:hover {
    background-color: var(--ach-color-muted);
}

.footer-bottom {
    max-width: 1000px; /* Hardcoded width */
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75em;
    color: var(--ach-color-muted);
    padding: var(--ach-space-sm) 0;
}

.footer-bottom p {
    margin: 0;
}

.developer-credit {
    font-size: 1em;
    white-space: nowrap;
}

.footer-links a {
    color: var(--ach-color-muted);
    text-decoration: none;
    margin-left: 10px; /* Hardcoded margin */
}

.footer-links a:hover {
    text-decoration: underline;
    color: var(--ach-color-primary);
}

/* =========================================================================
   RESPONSIVE UTILITIES (Media Queries)
========================================================================= */

@media (max-width: 992px) {
    .ach-grid--3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .minimal-footer .footer-content {
        flex-direction: column;
        max-width: 100%;
        gap: var(--ach-space-xl);
        margin-bottom: var(--ach-space-md);
    }
    .footer-info,
    .footer-newsletter {
        max-width: 100%;
        width: 100%;
    }
    .footer-info {
        order: 2;
        text-align: center;
    }
    .footer-newsletter {
        order: 1;
    }
    .footer-newsletter form {
        flex-direction: column;
    }
    .footer-newsletter input[type="email"],
    .footer-newsletter button {
        width: 100%;
    }
    .footer-bottom {
        flex-direction: column;
        text-align: center;
        padding: 10px 0; /* Hardcoded padding */
    }
    .footer-bottom p {
        margin-bottom: 4px; /* Hardcoded margin */
    }
    .footer-links {
        margin-top: 4px; /* Hardcoded margin */
    }
    .footer-links a {
        margin: 0 4px; /* Hardcoded margin */
    }
}

@media (max-width: 640px) {
    .ach-grid--2,
    .ach-grid--3 {
        grid-template-columns: 1fr;
    }
    .ach-cta__inner {
        flex-direction: column;
        align-items: flex-start;
    }
}