/*
Theme Name: Kibosh
Theme URI: https://github.com/SiavashBeheshti/kibosh-wp
Author: Siavash Beheshti
Author URI: https://siavashbeheshti.com
Description: A beautiful, minimal Persian (RTL) WordPress theme inspired by Ghost CMS's Casper theme with card-based layouts, dark/light mode, and a modern reading experience.
Version: 1.0.0
Requires at least: 5.9
Tested up to: 7.0
Requires PHP: 7.4
License: MIT License
License URI: https://opensource.org/licenses/MIT
Text Domain: kibosh
Tags: blog, one-column, two-columns, custom-background, custom-colors, custom-header, custom-logo, custom-menu, featured-images, footer-widgets, full-width-template, sticky-post, theme-options, translation-ready, rtl-language-support
*/

/* ========================================
   PERSIAN FONT: ESTEDAD
======================================== */
@font-face {
    font-family: 'Estedad';
    src: url('assets/fonts/webfonts/Estedad-Thin.woff2') format('woff2');
    font-weight: 100;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Estedad';
    src: url('assets/fonts/webfonts/Estedad-ExtraLight.woff2') format('woff2');
    font-weight: 200;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Estedad';
    src: url('assets/fonts/webfonts/Estedad-Light.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Estedad';
    src: url('assets/fonts/webfonts/Estedad-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Estedad';
    src: url('assets/fonts/webfonts/Estedad-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Estedad';
    src: url('assets/fonts/webfonts/Estedad-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Estedad';
    src: url('assets/fonts/webfonts/Estedad-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Estedad';
    src: url('assets/fonts/webfonts/Estedad-ExtraBold.woff2') format('woff2');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Estedad';
    src: url('assets/fonts/webfonts/Estedad-Black.woff2') format('woff2');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

/* ========================================
   CSS VARIABLES & RESET
======================================== */
:root {
    /* Colors - Light Mode */
    --color-bg: #ffffff;
    --color-bg-secondary: #f7f7f7;
    --color-text: #15171a;
    --color-text-secondary: #738a94;
    --color-text-accent: #3eb0ef;
    --color-border: #e5eff5;
    --color-header-bg: #15171a;
    --color-white: #ffffff;
    
    /* Typography */
    --font-sans: 'Estedad', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-serif: 'Estedad', Georgia, 'Times New Roman', serif;
    --font-mono: Menlo, Monaco, Consolas, 'Courier New', monospace;
    
    /* Spacing */
    --gap: 4rem;
    --container-width: 1320px;
    --content-width: 720px;
    
    /* Transitions */
    --transition: 0.3s ease;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
}

/* Dark Mode - System Preference */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --color-bg: #15171a;
        --color-bg-secondary: #1d1f22;
        --color-text: #ffffff;
        --color-text-secondary: #9eabb3;
        --color-border: #2e3338;
        --color-header-bg: #0d0e10;
    }
}

/* Dark Mode - Manual Toggle */
:root[data-theme="dark"],
html[data-theme="dark"] {
    --color-bg: #15171a;
    --color-bg-secondary: #1d1f22;
    --color-text: #ffffff;
    --color-text-secondary: #9eabb3;
    --color-border: #2e3338;
    --color-header-bg: #0d0e10;
}

/* Light Mode - Manual Toggle (override system dark preference) */
:root[data-theme="light"],
html[data-theme="light"] {
    --color-bg: #ffffff;
    --color-bg-secondary: #f7f7f7;
    --color-text: #15171a;
    --color-text-secondary: #738a94;
    --color-border: #e5eff5;
    --color-header-bg: #15171a;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 62.5%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
    direction: rtl;
}

body {
    font-family: var(--font-sans);
    font-size: 1.7rem;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition);
}

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

ul, ol {
    list-style: none;
}

button {
    font: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

/* ========================================
   LAYOUT & CONTAINERS
======================================== */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--gap);
}

.container--narrow {
    max-width: var(--content-width);
}

.site-main {
    flex: 1;
}

/* Post Feed Section */
.post-feed-section {
    padding: 4vmin 0 8vmin;
}

/* ========================================
   SITE HEADER
======================================== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--color-header-bg);
    transition: transform var(--transition), background var(--transition);
}

.site-header.is-hidden {
    transform: translateY(-100%);
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 3.2rem;
    height: 6.4rem;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--color-white);
}

.site-logo img {
    height: 3.2rem;
    width: auto;
}

.site-logo__text {
    letter-spacing: normal;
}

/* Navigation */
.site-nav {
    display: flex;
    align-items: center;
    gap: 2.4rem;
}

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-menu a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.4rem;
    font-weight: 500;
    transition: color var(--transition);
}

.nav-menu a:hover {
    color: var(--color-white);
}

.nav-toggle {
    display: none;
    color: var(--color-white);
    padding: 0.8rem;
}

.nav-toggle svg {
    width: 2.4rem;
    height: 2.4rem;
}

/* Theme Toggle — sits at the left end of the header (RTL: margin-inline-start pushes it away from the right-anchored nav+logo group) */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.7);
    padding: 0.8rem;
    border-radius: 50%;
    transition: all var(--transition);
    margin-inline-start: auto;
    flex-shrink: 0;
}

.theme-toggle:hover {
    color: var(--color-white);
    background: rgba(255, 255, 255, 0.1);
}

.theme-toggle svg {
    width: 2rem;
    height: 2rem;
}

/* Light mode (default): show moon, hide sun */
.theme-toggle .icon-moon {
    display: block;
}

.theme-toggle .icon-sun {
    display: none;
}

/* Dark mode: hide moon, show sun */
html[data-theme="dark"] .theme-toggle .icon-moon,
[data-theme="dark"] .theme-toggle .icon-moon {
    display: none;
}

html[data-theme="dark"] .theme-toggle .icon-sun,
[data-theme="dark"] .theme-toggle .icon-sun {
    display: block;
}

/* Explicit light mode (when toggled back from dark) */
html[data-theme="light"] .theme-toggle .icon-moon,
[data-theme="light"] .theme-toggle .icon-moon {
    display: block;
}

html[data-theme="light"] .theme-toggle .icon-sun,
[data-theme="light"] .theme-toggle .icon-sun {
    display: none;
}

/* Mobile Nav */
@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }
    
    .nav-menu {
        position: fixed;
        top: 6.4rem;
        left: 0;
        right: 0;
        bottom: 0;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3rem;
        background: var(--color-header-bg);
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition);
    }
    
    .nav-menu.is-open {
        opacity: 1;
        visibility: visible;
    }
    
    .nav-menu a {
        font-size: 2.4rem;
    }
}

/* ========================================
   HERO SECTION (Home)
======================================== */
.site-hero {
    position: relative;
    min-height: 60vh;
    display: flex;
    align-items: center;
    /* Default gradient - can be overridden by customizer */
    background: linear-gradient(135deg, #15171a 0%, #2c3e50 100%);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 12rem var(--gap) 6rem;
    overflow: hidden;
}

/* Subtle texture overlay */
.site-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" x="0" y="0" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="white" opacity="0.02"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.4;
    pointer-events: none;
}

.site-hero__content {
    position: relative;
    z-index: 1;
    max-width: var(--content-width);
    color: var(--color-white);
}

.site-hero__title {
    font-size: clamp(3.6rem, 8vw, 6.4rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.site-hero__description {
    font-size: clamp(1.8rem, 3vw, 2.2rem);
    opacity: 0.8;
    max-width: 60ch;
    line-height: 1.5;
}

/* ========================================
   POST FEED (Grid Layout)
======================================== */
.post-feed {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: var(--gap);
    padding: var(--gap) 0;
}

/* Post 1: Featured - Full width, horizontal layout */
.post-feed .post-card:nth-child(1) {
    grid-column: span 6;
}

.post-feed .post-card:nth-child(1) .post-card__inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--gap);
    min-height: 36rem;
}

.post-feed .post-card:nth-child(1) .post-card__image {
    aspect-ratio: auto;
    height: 100%;
    border-radius: 1rem;
}

.post-feed .post-card:nth-child(1) .post-card__content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem 0;
}

.post-feed .post-card:nth-child(1) .post-card__title {
    font-size: clamp(2.6rem, 3.5vw, 4rem);
    margin-bottom: 1.2rem;
}

.post-feed .post-card:nth-child(1) .post-card__excerpt {
    font-size: 1.7rem;
    -webkit-line-clamp: 4;
    margin-bottom: 2rem;
}

/* Reset auto margin so meta sits directly below the excerpt instead of being
   pushed to the bottom of the tall 36rem featured column. */
.post-feed .post-card:nth-child(1) .post-card__meta {
    margin-top: 0;
}

/* Posts 2 & 3: Medium - Half width each */
.post-feed .post-card:nth-child(2),
.post-feed .post-card:nth-child(3) {
    grid-column: span 3;
}

.post-feed .post-card:nth-child(2) .post-card__image,
.post-feed .post-card:nth-child(3) .post-card__image {
    aspect-ratio: 16 / 10;
}

.post-feed .post-card:nth-child(2) .post-card__title,
.post-feed .post-card:nth-child(3) .post-card__title {
    font-size: 2.4rem;
}

/* Posts 4+: Standard - One third width */
.post-feed .post-card:nth-child(n+4) {
    grid-column: span 2;
}

/* Tablet: 2 columns for regular posts */
@media (max-width: 1024px) {
    .post-feed {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .post-feed .post-card:nth-child(1) {
        grid-column: span 4;
    }
    
    .post-feed .post-card:nth-child(2),
    .post-feed .post-card:nth-child(3) {
        grid-column: span 2;
    }
    
    .post-feed .post-card:nth-child(n+4) {
        grid-column: span 2;
    }
}

/* Mobile: Stack everything */
@media (max-width: 768px) {
    .post-feed {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .post-feed .post-card:nth-child(1),
    .post-feed .post-card:nth-child(2),
    .post-feed .post-card:nth-child(3),
    .post-feed .post-card:nth-child(n+4) {
        grid-column: span 1;
    }
    
    .post-feed .post-card:nth-child(1) .post-card__inner {
        grid-template-columns: 1fr;
        min-height: auto;
    }
    
    .post-feed .post-card:nth-child(1) .post-card__image {
        aspect-ratio: 16 / 9;
        height: auto;
    }
    
    .post-feed .post-card:nth-child(1) .post-card__title,
    .post-feed .post-card:nth-child(2) .post-card__title,
    .post-feed .post-card:nth-child(3) .post-card__title {
        font-size: 2.2rem;
    }
}

/* Archive/Search Grid: Equal 3-column layout without featured */
.post-feed--archive {
    grid-template-columns: repeat(3, 1fr);
}

.post-feed--archive .post-card:nth-child(1),
.post-feed--archive .post-card:nth-child(2),
.post-feed--archive .post-card:nth-child(3),
.post-feed--archive .post-card:nth-child(n+4) {
    grid-column: span 1;
}

.post-feed--archive .post-card:nth-child(1) .post-card__inner {
    display: flex;
    flex-direction: column;
    min-height: auto;
}

.post-feed--archive .post-card:nth-child(1) .post-card__image {
    aspect-ratio: 16 / 9;
    height: auto;
}

.post-feed--archive .post-card:nth-child(1) .post-card__title {
    font-size: 2rem;
}

.post-feed--archive .post-card:nth-child(1) .post-card__excerpt {
    font-size: 1.55rem;
    -webkit-line-clamp: 2;
}

@media (max-width: 1024px) {
    .post-feed--archive {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .post-feed--archive {
        grid-template-columns: 1fr;
    }
}

/* Post Card */
.post-card {
    position: relative;
    background: var(--color-bg);
    transition: opacity var(--transition);
}

.post-card:hover {
    opacity: 0.9;
}

.post-card__inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.post-card__image {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--color-bg-secondary);
    border-radius: 1rem;
}

.post-card__image a {
    display: block;
    height: 100%;
}

.post-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.post-card:hover .post-card__image img {
    transform: scale(1.05);
}

.post-card__content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: 1.8rem 0 0;
}

.post-card__tag {
    display: inline-block;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-text-accent);
    margin-bottom: 0.6rem;
    transition: opacity var(--transition);
}

.post-card__tag:hover {
    opacity: 0.7;
}

.post-card__title {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 0.6rem;
}

.post-card__title a {
    display: block;
    transition: opacity var(--transition);
}

.post-card__title a:hover {
    opacity: 0.7;
}

.post-card__excerpt {
    color: var(--color-text-secondary);
    font-size: 1.55rem;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 1rem;
}

.post-card__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: auto;
    font-size: 1.3rem;
    color: var(--color-text-secondary);
}

.post-card__author {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.post-card__author-image {
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--color-bg);
    box-shadow: 0 0 0 1px rgba(0,0,0,0.1);
}

.post-card__date {
    display: flex;
    align-items: center;
}

.post-card__date::before {
    content: '·';
    margin: 0 0.6rem;
    font-weight: 700;
}

.post-card__reading-time {
    display: flex;
    align-items: center;
}

.post-card__reading-time::before {
    content: '·';
    margin: 0 0.6rem;
    font-weight: 700;
}

/* Card without image */
.post-card:not(.has-post-thumbnail) .post-card__content {
    padding-top: 0;
}

.post-card:not(.has-post-thumbnail) .post-card__title {
    font-size: 2.4rem;
}

/* ========================================
   SINGLE POST
======================================== */
.post-header {
    padding-top: 10rem;
    text-align: center;
    margin-bottom: 3rem;
}

.post-header__tag {
    display: inline-block;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--color-text-accent);
    margin-bottom: 1.5rem;
}

.post-header__title {
    font-size: clamp(3.2rem, 6vw, 5rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 2rem;
    max-width: 80rem;
    margin-left: auto;
    margin-right: auto;
}

.post-header__meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.6rem;
    color: var(--color-text-secondary);
    font-size: 1.4rem;
}

.post-header__author {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.post-header__author-image {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    object-fit: cover;
}

.post-header__author-name {
    font-weight: 600;
    color: var(--color-text);
}

/* Featured Image */
.post-featured-image {
    margin: 0 auto 4rem;
    max-width: 1040px;
    border-radius: 0.8rem;
    overflow: hidden;
}

.post-featured-image img {
    width: 100%;
}

/* Full Bleed Image */
.post-featured-image--full {
    max-width: none;
    margin: -10rem auto 4rem;
    border-radius: 0;
    position: relative;
    z-index: -1;
}

.post-featured-image--full::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(transparent 70%, var(--color-bg));
}

/* Post Content */
.post-content {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 0 var(--gap) 4rem;
    font-family: var(--font-serif);
    font-size: 2rem;
    line-height: 1.75;
}

.post-content > * {
    margin-bottom: 2rem;
}

.post-content h2 {
    font-family: var(--font-sans);
    font-size: 3rem;
    font-weight: 700;
    margin-top: 4rem;
    margin-bottom: 1.5rem;
    line-height: 1.3;
}

.post-content h3 {
    font-family: var(--font-sans);
    font-size: 2.4rem;
    font-weight: 700;
    margin-top: 3rem;
    margin-bottom: 1rem;
}

.post-content h4 {
    font-family: var(--font-sans);
    font-size: 2rem;
    font-weight: 600;
    margin-top: 2rem;
}

.post-content a {
    color: var(--color-text-accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.post-content a:hover {
    text-decoration-thickness: 2px;
}

.post-content strong {
    font-weight: 700;
}

.post-content em {
    font-style: italic;
}

.post-content ul,
.post-content ol {
    padding-right: 2.4rem;
    margin-right: 1rem;
}

.post-content ul {
    list-style: disc;
}

.post-content ol {
    list-style: decimal;
}

.post-content li {
    margin-bottom: 0.8rem;
    padding-right: 0.5rem;
}

.post-content blockquote {
    margin: 3rem 0;
    padding: 0 2rem 0 0;
    border-right: 4px solid var(--color-text-accent);
    font-style: normal;
    color: var(--color-text-secondary);
}

.post-content blockquote p {
    margin-bottom: 0;
}

.post-content pre {
    background: var(--color-bg-secondary);
    padding: 2rem;
    border-radius: 0.6rem;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 1.5rem;
    line-height: 1.5;
}

.post-content code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: var(--color-bg-secondary);
    padding: 0.2rem 0.5rem;
    border-radius: 0.3rem;
}

.post-content pre code {
    background: none;
    padding: 0;
}

.post-content figure {
    margin: 3rem 0;
}

.post-content figcaption {
    font-family: var(--font-sans);
    font-size: 1.4rem;
    color: var(--color-text-secondary);
    text-align: center;
    margin-top: 1rem;
}

.post-content img {
    border-radius: 0.4rem;
}

.post-content hr {
    border: none;
    height: 1px;
    background: var(--color-border);
    margin: 4rem 0;
}

/* Wide and Full Width Images — RTL-safe margin-only technique */
.post-content .alignwide {
    width: min(1040px, 100vw);
    max-width: min(1040px, 100vw);
    margin-left: calc(50% - min(520px, 50vw));
    margin-right: calc(50% - min(520px, 50vw));
    position: static;
    left: auto;
    right: auto;
    transform: none;
}

.post-content .alignfull {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    position: static;
    left: auto;
    right: auto;
    transform: none;
    border-radius: 0;
}

/* ========================================
   AUTHOR BOX
======================================== */
.author-box {
    display: flex;
    gap: 2.4rem;
    padding: 3rem;
    background: var(--color-bg-secondary);
    border-radius: 0.8rem;
    margin: 4rem 0;
}

.author-box__image {
    flex-shrink: 0;
    width: 8rem;
    height: 8rem;
    border-radius: 50%;
    object-fit: cover;
}

.author-box__content h4 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.author-box__content p {
    color: var(--color-text-secondary);
    font-size: 1.5rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.author-box__links {
    display: flex;
    gap: 1rem;
}

.author-box__links a {
    color: var(--color-text-accent);
    font-size: 1.4rem;
    font-weight: 600;
    transition: color var(--transition);
}

.author-box__links a:hover {
    color: var(--color-text-accent);
}

.author-box__links svg {
    width: 2rem;
    height: 2rem;
}

@media (max-width: 600px) {
    .author-box {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .author-box__links {
        justify-content: center;
    }
}

/* ========================================
   COMMENTS
======================================== */
.comments-area {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 4rem var(--gap);
    border-top: 1px solid var(--color-border);
}

.comments-title {
    font-size: 2.4rem;
    font-weight: 700;
    margin-bottom: 3rem;
}

.comment-list {
    margin-bottom: 4rem;
}

.comment {
    padding: 2rem 0;
    border-bottom: 1px solid var(--color-border);
}

.comment:last-child {
    border-bottom: none;
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin-bottom: 1rem;
}

.comment-author .avatar {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
}

.comment-author .fn {
    font-weight: 600;
    font-size: 1.5rem;
}

.comment-metadata {
    font-size: 1.3rem;
    color: var(--color-text-secondary);
}

.comment-content {
    font-size: 1.5rem;
    line-height: 1.7;
}

.comment-content p {
    margin-bottom: 1rem;
}

.comment-reply-link {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--color-text-accent);
}

/* Comment Form */
.comment-respond {
    padding-top: 2rem;
}

.comment-reply-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
}

.comment-form label {
    display: block;
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 1.2rem 1.4rem;
    border: 1px solid var(--color-border);
    border-radius: 0.4rem;
    font-size: 1.5rem;
    font-family: inherit;
    background: var(--color-bg);
    color: var(--color-text);
    transition: border-color var(--transition);
    margin-bottom: 1.5rem;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--color-text-accent);
}

.comment-form textarea {
    min-height: 15rem;
    resize: vertical;
}

.comment-form .form-submit input {
    display: inline-block;
    padding: 1.2rem 2.4rem;
    background: var(--color-text-accent);
    color: var(--color-white);
    border: none;
    border-radius: 0.4rem;
    font-family: var(--font-sans);
    font-size: 1.4rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity var(--transition);
}

.comment-form .form-submit input:hover {
    opacity: 0.9;
}

/* ========================================
   PAGINATION
======================================== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 4rem 0;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 4rem;
    height: 4rem;
    padding: 0 1.2rem;
    border-radius: 0.4rem;
    font-size: 1.4rem;
    font-weight: 600;
    transition: all var(--transition);
}

.pagination a {
    background: var(--color-bg-secondary);
    color: var(--color-text);
}

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

.pagination .current {
    background: var(--color-text);
    color: var(--color-bg);
}

.pagination .dots {
    background: none;
}

/* ========================================
   PAGE TEMPLATES
======================================== */
.page-header {
    padding: 12rem var(--gap) 4rem;
    text-align: center;
}

.page-header__title {
    font-size: clamp(3rem, 6vw, 4.8rem);
    font-weight: 800;
    margin-bottom: 1rem;
}

.page-header__description {
    color: var(--color-text-secondary);
    font-size: 1.8rem;
    max-width: 60ch;
    margin: 0 auto;
}

/* Search Page */
.search-form {
    display: flex;
    max-width: 50rem;
    margin: 0 auto 4rem;
}

.search-form label {
    flex: 1;
}

.search-form .search-field {
    width: 100%;
    padding: 1.4rem 1.8rem;
    border: 2px solid var(--color-border);
    border-left: none;
    border-radius: 0 0.4rem 0.4rem 0;
    font-size: 1.6rem;
    background: var(--color-bg);
    color: var(--color-text);
}

.search-form .search-field:focus {
    outline: none;
    border-color: var(--color-text-accent);
}

.search-form .search-submit {
    padding: 1.4rem 2.4rem;
    background: var(--color-text);
    color: var(--color-bg);
    border: 2px solid var(--color-text);
    border-radius: 0.4rem 0 0 0.4rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity var(--transition);
}

.search-form .search-submit:hover {
    opacity: 0.8;
}

/* 404 Page */
.error-404 {
    text-align: center;
    padding: 12rem var(--gap);
}

.error-404__code {
    font-size: clamp(10rem, 20vw, 20rem);
    font-weight: 900;
    line-height: 1;
    color: var(--color-bg-secondary);
    margin-bottom: 2rem;
}

.error-404__title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.error-404__description {
    color: var(--color-text-secondary);
    font-size: 1.8rem;
    margin-bottom: 3rem;
}

.error-404 .btn {
    display: inline-block;
    padding: 1.4rem 2.8rem;
    background: var(--color-text);
    color: var(--color-bg);
    border-radius: 0.4rem;
    font-weight: 600;
    transition: opacity var(--transition);
}

.error-404 .btn:hover {
    opacity: 0.85;
}

/* ========================================
   SITE FOOTER
======================================== */
.site-footer {
    background: var(--color-header-bg);
    color: rgba(255, 255, 255, 0.7);
    padding: 6rem 0 3rem;
    margin-top: 6rem;
}

.site-footer__inner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
    gap: 4rem;
    margin-bottom: 4rem;
}

.footer-widget__title {
    color: var(--color-white);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 2rem;
}

.footer-widget ul li {
    margin-bottom: 1rem;
}

.footer-widget ul a {
    font-size: 1.5rem;
    transition: color var(--transition);
}

.footer-widget ul a:hover {
    color: var(--color-white);
}

.footer-social {
    display: flex;
    gap: 1.5rem;
}

.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transition: all var(--transition);
}

.footer-social a:hover {
    background: var(--color-text-accent);
    color: var(--color-white);
}

.footer-social svg {
    width: 2rem;
    height: 2rem;
}

.site-footer__bottom {
    padding-top: 3rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2rem;
}

.site-footer__copyright {
    font-size: 1.4rem;
}

.site-footer__copyright a {
    color: var(--color-white);
}

.site-footer__credits {
    font-size: 1.3rem;
}

/* ========================================
   WIDGETS & SIDEBAR
======================================== */
.widget {
    margin-bottom: 4rem;
}

.widget-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--color-text);
}

.widget ul li {
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--color-border);
}

.widget ul li:last-child {
    border-bottom: none;
}

.widget ul a {
    font-size: 1.5rem;
    transition: color var(--transition);
}

.widget ul a:hover {
    color: var(--color-text-accent);
}

/* Tag Cloud */
.tagcloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.tagcloud a {
    display: inline-block;
    padding: 0.5rem 1.2rem;
    background: var(--color-bg-secondary);
    border-radius: 0.3rem;
    font-size: 1.3rem !important;
    transition: all var(--transition);
}

.tagcloud a:hover {
    background: var(--color-text);
    color: var(--color-bg);
}

/* ========================================
   UTILITIES
======================================== */
.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.sticky .post-card {
    border: 2px solid var(--color-text-accent);
}

/* ========================================
   ANIMATIONS
======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post-feed {
    animation: fadeIn 0.4s ease;
}

.post-card {
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    opacity: 0;
}

.post-card:nth-child(1) { animation-delay: 0.05s; }
.post-card:nth-child(2) { animation-delay: 0.1s; }
.post-card:nth-child(3) { animation-delay: 0.15s; }
.post-card:nth-child(4) { animation-delay: 0.2s; }
.post-card:nth-child(5) { animation-delay: 0.25s; }
.post-card:nth-child(6) { animation-delay: 0.3s; }
.post-card:nth-child(7) { animation-delay: 0.35s; }
.post-card:nth-child(8) { animation-delay: 0.4s; }
.post-card:nth-child(9) { animation-delay: 0.45s; }
.post-card:nth-child(10) { animation-delay: 0.5s; }
.post-card:nth-child(n+11) { animation-delay: 0.55s; }

/* ========================================
   RESPONSIVE TYPOGRAPHY
======================================== */
@media (max-width: 600px) {
    :root {
        --gap: 2rem;
    }
    
    .post-content {
        font-size: 1.8rem;
    }
    
    .post-content h2 {
        font-size: 2.4rem;
    }
    
    .post-content h3 {
        font-size: 2rem;
    }
}

/* ========================================
   POST TAGS
======================================== */
.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 3rem;
}

.post-tag {
    display: inline-block;
    padding: 0.5rem 1.2rem;
    background: var(--color-bg-secondary);
    border-radius: 2rem;
    font-size: 1.3rem;
    font-weight: 500;
    transition: all var(--transition);
}

.post-tag:hover {
    background: var(--color-text);
    color: var(--color-bg);
}

/* ========================================
   POST NAVIGATION
======================================== */
.post-navigation {
    background: var(--color-bg-secondary);
    margin-top: 4rem;
}

.post-navigation__inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.post-navigation__link {
    display: flex;
    flex-direction: column;
    padding: 3rem var(--gap);
    transition: background var(--transition);
}

.post-navigation__link:hover {
    background: var(--color-border);
}

.post-navigation__link--next {
    text-align: start;
    border-inline-end: 1px solid var(--color-border);
}

.post-navigation__label {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-bottom: 0.5rem;
}

.post-navigation__title {
    font-size: 1.6rem;
    font-weight: 600;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 600px) {
    .post-navigation__inner {
        grid-template-columns: 1fr;
    }
    
    .post-navigation__link--next {
        border-inline-end: none;
        border-top: 1px solid var(--color-border);
    }
}

/* ========================================
   AUTHOR HEADER (Author Archive)
======================================== */
.author-header {
    padding: 12rem var(--gap) 4rem;
    background: var(--color-bg-secondary);
}

.author-header__inner {
    display: flex;
    gap: 3rem;
    align-items: center;
}

.author-header__avatar {
    flex-shrink: 0;
    width: 12rem;
    height: 12rem;
    border-radius: 50%;
    object-fit: cover;
}

.author-header__name {
    font-size: clamp(2.4rem, 5vw, 3.6rem);
    font-weight: 800;
    margin-bottom: 1rem;
}

.author-header__bio {
    color: var(--color-text-secondary);
    font-size: 1.7rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.author-header__meta {
    display: flex;
    gap: 2rem;
    font-size: 1.4rem;
}

.author-header__posts-count {
    color: var(--color-text-secondary);
}

.author-header__website {
    color: var(--color-text-accent);
    font-weight: 600;
}

@media (max-width: 600px) {
    .author-header__inner {
        flex-direction: column;
        text-align: center;
    }
    
    .author-header__meta {
        justify-content: center;
    }
}

/* ========================================
   RELATED POSTS
======================================== */
.related-posts {
    margin-top: 6rem;
    padding-top: 4rem;
    border-top: 1px solid var(--color-border);
}

.related-posts__title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
}

.related-posts__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--gap);
}

.related-posts__grid .post-card {
    animation: none;
    opacity: 1;
}

@media (max-width: 900px) {
    .related-posts__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .related-posts__grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   NO POSTS / EMPTY STATE
======================================== */
.no-posts {
    text-align: center;
    padding: 6rem 0;
}

.no-posts h2 {
    font-size: 2.4rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.no-posts p {
    color: var(--color-text-secondary);
    font-size: 1.7rem;
    margin-bottom: 2rem;
}

.no-posts .search-form {
    margin-top: 2rem;
}

/* ========================================
   PAGE LINKS (Multi-page posts)
======================================== */
.page-links {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
    font-weight: 600;
}

.page-links a,
.page-links > span:not(.page-links-title) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 3.6rem;
    height: 3.6rem;
    padding: 0 1rem;
    border-radius: 0.4rem;
    background: var(--color-bg-secondary);
}

.page-links a:hover {
    background: var(--color-text);
    color: var(--color-bg);
}

.page-links > span:not(.page-links-title) {
    background: var(--color-text);
    color: var(--color-bg);
}

/* ========================================
   WORDPRESS SPECIFIC
======================================== */
.wp-block-image {
    margin: 2rem 0;
}

.wp-block-image.aligncenter {
    text-align: center;
}

.wp-block-image.alignleft {
    float: right;
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.wp-block-image.alignright {
    float: left;
    margin-right: 2rem;
    margin-bottom: 1rem;
}

.wp-caption-text {
    font-size: 1.4rem;
    color: var(--color-text-secondary);
    text-align: center;
    margin-top: 0.5rem;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.gallery-item {
    margin: 0;
}

.gallery-item img {
    border-radius: 0.4rem;
}

/* Gutenberg Blocks */
.wp-block-quote {
    margin: 3rem 0;
    padding: 0 2rem 0 0;
    border-right: 4px solid var(--color-text-accent);
    font-style: normal;
}

.wp-block-pullquote {
    padding: 3rem 0;
    border-top: 4px solid var(--color-text);
    border-bottom: 4px solid var(--color-text);
    text-align: center;
}

.wp-block-pullquote blockquote {
    border: none;
    padding: 0;
}

.wp-block-pullquote p {
    font-size: 2.4rem;
    line-height: 1.4;
}

.wp-block-code {
    background: var(--color-bg-secondary);
    padding: 2rem;
    border-radius: 0.6rem;
}

.wp-block-separator {
    border: none;
    height: 1px;
    background: var(--color-border);
    margin: 4rem auto;
    max-width: 10rem;
}

.wp-block-separator.is-style-wide {
    max-width: 100%;
}

.wp-block-separator.is-style-dots {
    background: none;
    max-width: 100%;
    text-align: center;
}

.wp-block-separator.is-style-dots::before {
    content: '···';
    color: var(--color-text-secondary);
    font-size: 2rem;
    letter-spacing: 1rem;
}

.has-text-align-center {
    text-align: center;
}

.has-text-align-left {
    text-align: left;
}

.has-text-align-right {
    text-align: right;
}

