/*
Theme Name: Aithor
Theme URI: https://aithor.ca
Author: Aithor
Author URI: https://aithor.ca
Description: A brutalist blog theme matching the Aithor Django frontend design.
Version: 2.0.0
Requires at least: 5.0
Tested up to: 6.4
Requires PHP: 7.4
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: aithor
Tags: blog, one-column, custom-colors, featured-images

Aithor Theme - Your Blog on Autopilot
*/

/* ==========================================================================
   Fonts
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Courier+Prime:wght@400;700&family=Space+Mono:wght@400;700&display=swap');

/* ==========================================================================
   CSS Variables & Custom Properties
   ========================================================================== */
:root {
    /* Colors */
    --aithor-text-color: #000000;
    --aithor-bg-color: #f5f0e8;
    --aithor-card-bg: #ffffff;
    --aithor-border-color: #000000;
    --aithor-yellow: #fbbf24;
    --aithor-yellow-light: #fef3c7;

    /* Typography */
    --aithor-font-body: 'Courier Prime', 'Courier New', monospace;
    --aithor-font-heading: 'Space Mono', 'Courier Prime', monospace;

    /* Spacing */
    --aithor-spacing-xs: 0.5rem;
    --aithor-spacing-sm: 1rem;
    --aithor-spacing-md: 1.5rem;
    --aithor-spacing-lg: 2rem;
    --aithor-spacing-xl: 3rem;

    /* Brutalist borders */
    --aithor-border: 4px solid #000;
    --aithor-shadow: 8px 8px 0 #000;
    --aithor-shadow-sm: 5px 5px 0 #000;

    /* Layout */
    --aithor-max-width: 1200px;
    --aithor-content-width: 800px;
}

/* ==========================================================================
   Base Styles - Brutalist
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: var(--aithor-font-body);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--aithor-text-color);
    background: linear-gradient(135deg, #f5f0e8 0%, #ede4d3 100%);
    min-height: 100vh;
    /* Paper texture */
    background-image:
        repeating-linear-gradient(0deg,
            rgba(139, 69, 19, 0.03) 0px,
            transparent 1px,
            transparent 2px,
            rgba(139, 69, 19, 0.03) 3px);
}

/* ==========================================================================
   Sticky Footer Layout
   ========================================================================== */
.site-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-main {
    flex: 1 0 auto;
}

/* ==========================================================================
   Typography
   ========================================================================== */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--aithor-font-heading);
    font-weight: 700;
    line-height: 1.3;
    color: var(--aithor-text-color);
    margin-bottom: var(--aithor-spacing-sm);
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

h5 {
    font-size: 1.125rem;
}

h6 {
    font-size: 1rem;
}

p {
    margin-bottom: var(--aithor-spacing-sm);
}

a {
    color: var(--aithor-text-color);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 2px;
    transition: all 0.1s ease;
}

a:hover {
    background: var(--aithor-yellow);
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ==========================================================================
   Layout Components
   ========================================================================== */
.site-container {
    max-width: var(--aithor-max-width);
    margin: 0 auto;
    padding: 0 var(--aithor-spacing-md);
}

.content-container {
    max-width: var(--aithor-content-width);
    margin: 0 auto;
}

/* ==========================================================================
   Brutalist Card Style
   ========================================================================== */
.brutalist-card {
    background: var(--aithor-card-bg);
    border: var(--aithor-border);
    box-shadow: var(--aithor-shadow);
    padding: var(--aithor-spacing-lg);
}

.brutalist-card:hover {
    box-shadow: 4px 4px 0 #000;
    transform: translate(4px, 4px);
}

.brutalist-button {
    display: inline-block;
    background: #000;
    color: #fff;
    border: 3px solid #000;
    box-shadow: var(--aithor-shadow-sm);
    padding: var(--aithor-spacing-sm) var(--aithor-spacing-lg);
    font-family: var(--aithor-font-heading);
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.1s ease;
}

.brutalist-button:hover {
    box-shadow: 2px 2px 0 #000;
    transform: translate(3px, 3px);
    background: #000;
    color: #fff;
}

/* ==========================================================================
   Header - Brutalist Style
   ========================================================================== */
.site-header {
    background: #fffbeb;
    border-bottom: var(--aithor-border);
    padding: var(--aithor-spacing-sm) 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header .site-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: var(--aithor-spacing-xs);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--aithor-text-color);
    text-decoration: none;
    font-family: var(--aithor-font-heading);
}

.site-logo:hover {
    background: transparent;
}

.site-logo-icon {
    font-size: 1.5rem;
}

/* Logo image for subsites with custom logo */
.site-logo-image {
    max-height: 40px;
    width: auto;
    object-fit: contain;
}

/* Hide Aithor icon on subsites - only show on main site */
.is-subsite .site-logo-icon {
    display: none;
}

.site-nav {
    display: flex;
    gap: var(--aithor-spacing-md);
}

.site-nav a {
    font-weight: 700;
    text-decoration: none;
    padding: 0.25rem 0;
    border-bottom: 3px solid transparent;
}

.site-nav a:hover {
    background: transparent;
    border-bottom-color: var(--aithor-yellow);
}

/* ==========================================================================
   Main Content
   ========================================================================== */
.site-main {
    min-height: 60vh;
    padding: var(--aithor-spacing-xl) 0;
}

/* ==========================================================================
   Home Page - Aithor Main Site
   ========================================================================== */
.home-intro {
    text-align: center;
    padding: var(--aithor-spacing-xl) 0;
}

.home-intro h1 {
    font-size: 3rem;
    margin-bottom: var(--aithor-spacing-sm);
}

.home-intro p {
    font-size: 1.25rem;
    max-width: 600px;
    margin: 0 auto;
}

.home-intro .highlight {
    background: var(--aithor-yellow);
    padding: 0 0.5rem;
    display: inline-block;
    transform: rotate(-1deg);
}

/* ==========================================================================
   Blog Cards - Brutalist Grid
   ========================================================================== */
.blog-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--aithor-spacing-lg);
    margin-top: var(--aithor-spacing-xl);
}

.blog-card {
    background: var(--aithor-card-bg);
    border: var(--aithor-border);
    box-shadow: var(--aithor-shadow);
    padding: var(--aithor-spacing-lg);
    transition: all 0.1s ease;
}

.blog-card:hover {
    box-shadow: 4px 4px 0 #000;
    transform: translate(4px, 4px);
}

.blog-card h2 {
    font-size: 1.5rem;
    margin-bottom: var(--aithor-spacing-xs);
}

.blog-card .blog-description {
    margin-bottom: var(--aithor-spacing-md);
    color: #555;
}

.blog-card .article-meta {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: var(--aithor-spacing-md);
}

.blog-card .btn {
    display: inline-block;
    background: #000;
    color: #fff;
    border: 3px solid #000;
    box-shadow: var(--aithor-shadow-sm);
    padding: var(--aithor-spacing-sm) var(--aithor-spacing-lg);
    font-family: var(--aithor-font-heading);
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
    transition: all 0.1s ease;
}

.blog-card .btn:hover {
    box-shadow: 2px 2px 0 #000;
    transform: translate(3px, 3px);
    background: #000;
    color: #fff;
}

/* ==========================================================================
   Blog Archive - Article List
   ========================================================================== */
.blog-header {
    padding: var(--aithor-spacing-xl) 0 var(--aithor-spacing-lg);
    border-bottom: 4px dashed var(--aithor-border-color);
    margin-bottom: var(--aithor-spacing-xl);
}

.blog-header h1 {
    font-size: 2.5rem;
    margin-bottom: var(--aithor-spacing-xs);
}

.blog-header p {
    font-size: 1.125rem;
    color: #555;
}

.search-form {
    margin-top: var(--aithor-spacing-md);
    display: flex;
    gap: var(--aithor-spacing-xs);
    max-width: 400px;
}

.search-form input[type="search"] {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 3px solid #000;
    font-family: var(--aithor-font-body);
    font-size: 1rem;
}

.search-form button {
    padding: 0.75rem 1.25rem;
    background: #000;
    color: #fff;
    border: 3px solid #000;
    font-family: var(--aithor-font-heading);
    font-weight: 700;
    cursor: pointer;
}

.article-list {
    display: flex;
    flex-direction: column;
    gap: var(--aithor-spacing-lg);
}

.article-card {
    background: var(--aithor-card-bg);
    border: var(--aithor-border);
    box-shadow: var(--aithor-shadow-sm);
    padding: var(--aithor-spacing-lg);
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: var(--aithor-spacing-lg);
    transition: all 0.1s ease;
}

.article-card:hover {
    box-shadow: 2px 2px 0 #000;
    transform: translate(3px, 3px);
}

.article-thumbnail {
    aspect-ratio: 16/10;
    background: #eee;
    border: 2px solid #000;
    overflow: hidden;
}

.article-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-content h2 {
    font-size: 1.25rem;
    margin-bottom: var(--aithor-spacing-xs);
}

.article-content h2 a {
    text-decoration: none;
}

.article-content h2 a:hover {
    background: var(--aithor-yellow);
}

.article-meta {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: var(--aithor-spacing-xs);
}

.article-excerpt {
    font-size: 0.95rem;
    color: #555;
}

/* ==========================================================================
   Single Article
   ========================================================================== */
.single-article {
    max-width: var(--aithor-content-width);
    margin: 0 auto;
}

.article-header {
    margin-bottom: var(--aithor-spacing-xl);
    padding-bottom: var(--aithor-spacing-lg);
    border-bottom: 4px dashed #000;
}

.article-header h1 {
    font-size: 2.5rem;
    margin-bottom: var(--aithor-spacing-sm);
}

.article-header .article-meta {
    font-size: 1rem;
    color: #666;
}

.article-featured-image {
    width: 100%;
    aspect-ratio: 16/9;
    border: var(--aithor-border);
    overflow: hidden;
    margin-bottom: var(--aithor-spacing-xl);
    background: #eee;
}

.article-featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-body {
    font-size: 1.125rem;
    line-height: 1.8;
}

.article-body h2 {
    margin-top: var(--aithor-spacing-xl);
    margin-bottom: var(--aithor-spacing-sm);
    padding-bottom: var(--aithor-spacing-xs);
    border-bottom: 2px solid #000;
}

.article-body h3 {
    margin-top: var(--aithor-spacing-lg);
    margin-bottom: var(--aithor-spacing-sm);
}

.article-body p {
    margin-bottom: var(--aithor-spacing-md);
}

.article-body ul,
.article-body ol {
    margin-bottom: var(--aithor-spacing-md);
    padding-left: var(--aithor-spacing-lg);
}

.article-body li {
    margin-bottom: var(--aithor-spacing-xs);
}

.article-body blockquote {
    border-left: 6px solid #000;
    padding: var(--aithor-spacing-md) var(--aithor-spacing-lg);
    margin: var(--aithor-spacing-lg) 0;
    background: var(--aithor-yellow-light);
    font-style: italic;
}

.article-body pre,
.article-body code {
    background: #f5f5f5;
    border: 2px solid #000;
    padding: 2px 6px;
    font-family: 'Courier Prime', monospace;
    font-size: 0.9em;
}

.article-body pre {
    padding: var(--aithor-spacing-md);
    overflow-x: auto;
}

/* ==========================================================================
   Footer - Brutalist
   ========================================================================== */
.site-footer {
    margin-top: auto;
    /* Push to bottom with flexbox */
    padding: var(--aithor-spacing-lg) 0;
    border-top: var(--aithor-border);
    text-align: center;
    background: #fffbeb;
    flex-shrink: 0;
    /* Prevent footer from shrinking */
}

.site-footer p {
    color: #555;
    font-size: 0.9rem;
}

.site-footer a {
    font-weight: 700;
}

/* ==========================================================================
   Empty State
   ========================================================================== */
.empty-state {
    text-align: center;
    padding: var(--aithor-spacing-xl);
    background: var(--aithor-card-bg);
    border: var(--aithor-border);
    box-shadow: var(--aithor-shadow);
    margin-top: var(--aithor-spacing-xl);
}

.empty-state p {
    font-size: 1.125rem;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 768px) {
    :root {
        --aithor-border: 3px solid #000;
        --aithor-shadow: 4px 4px 0 #000;
        --aithor-shadow-sm: 3px 3px 0 #000;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .home-intro h1 {
        font-size: 2rem;
    }

    .blog-cards {
        grid-template-columns: 1fr;
    }

    .article-card {
        grid-template-columns: 1fr;
    }

    .article-thumbnail {
        aspect-ratio: 16/9;
    }

    .article-header h1 {
        font-size: 1.75rem;
    }

    .site-nav {
        display: none;
    }
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */
.text-center {
    text-align: center;
}

.mt-sm {
    margin-top: var(--aithor-spacing-sm);
}

.mt-md {
    margin-top: var(--aithor-spacing-md);
}

.mt-lg {
    margin-top: var(--aithor-spacing-lg);
}

.mb-sm {
    margin-bottom: var(--aithor-spacing-sm);
}

.mb-md {
    margin-bottom: var(--aithor-spacing-md);
}

.mb-lg {
    margin-bottom: var(--aithor-spacing-lg);
}