/* ==========================================================================
   Eraclitoloscuro Blog by Salvatore Longo
   Slavoj Žižek Substack Theme (Black Background & Century Gothic Typography)
   ========================================================================== */

:root {
    --bg-main: #000000;
    --bg-surface: #0a0a0a;
    --bg-card: #111111;
    --bg-subtle: #171717;
    --bg-input: #1a1a1a;
    
    --border-color: #262626;
    --border-subtle: #1f1f1f;
    --border-highlight: #d97706;
    --border-gold: #f59e0b;
    
    --text-main: #ffffff;
    --text-muted: #e5e5e5;
    --text-dim: #a3a3a3;
    
    --accent-gold: #f59e0b;
    --accent-gold-dark: #d97706;
    --accent-gold-glow: rgba(245, 158, 11, 0.25);
    
    --font-body: 'Century Gothic', 'Didact Gothic', 'Montserrat', 'TeX Gyre Adventor', 'AppleGothic', 'Futura', sans-serif;
    --font-heading: 'Century Gothic', 'Didact Gothic', 'Montserrat', 'TeX Gyre Adventor', 'AppleGothic', 'Futura', sans-serif;
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    
    --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.05);
    --shadow-card-hover: 0 16px 40px rgba(245, 158, 11, 0.15), 0 0 0 1px rgba(245, 158, 11, 0.4);
    --shadow-modal: 0 30px 70px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(245, 158, 11, 0.3);
    
    --transition: all 0.25s ease;
}

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

html, body, button, input, select, textarea, h1, h2, h3, h4, h5, h6, p, span, a, label, div, article, section, header, footer {
    font-family: var(--font-body) !important;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.65;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ==========================================
   Header & Substack-Style Main Banner
   ========================================== */
.app-header {
    background: #050505;
    border-bottom: 2px solid var(--border-gold);
    position: relative;
    z-index: 100;
    padding: 2.2rem 2.5rem 1.8rem 2.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.9);
}

.header-container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2.5rem;
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 1.8rem;
    flex-shrink: 0;
}

.philosopher-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid var(--accent-gold);
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.3), 0 8px 20px rgba(0, 0, 0, 0.8);
    object-fit: cover;
    flex-shrink: 0;
    transition: var(--transition);
}

.philosopher-avatar:hover {
    transform: scale(1.04);
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.5);
}

.site-title {
    font-family: var(--font-heading);
    font-size: 3.2rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: 0.04em;
    color: #ffffff;
    text-transform: uppercase;
}

.site-subtitle {
    font-family: var(--font-body);
    font-size: 1.15rem;
    color: var(--text-dim);
    font-weight: 400;
    margin-top: 0.3rem;
    letter-spacing: 0.05em;
}

/* Header Quote Box */
.header-quote {
    flex: 1;
    max-width: 850px;
    padding: 1.2rem 2rem;
    border-left: 4px solid var(--accent-gold);
    background: rgba(23, 23, 23, 0.6);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    margin-left: auto;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent-gold);
}

.quote-text {
    font-family: var(--font-body);
    font-size: 1.35rem;
    font-style: italic;
    font-weight: 400;
    color: #ffffff;
    line-height: 1.45;
}

.quote-author {
    display: block;
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--accent-gold);
    margin-top: 0.5rem;
    text-align: right;
    letter-spacing: 0.08em;
}

/* ==========================================
   Navigation Bar (Home / Archivio)
   ========================================== */
.main-nav-bar {
    background: #0a0a0a;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 99;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2.5rem;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 0.5rem;
}

.nav-link {
    display: inline-block;
    padding: 1rem 1.8rem;
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-dim);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 3px solid transparent;
    transition: var(--transition);
}

.nav-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.03);
}

.nav-link.active {
    color: var(--accent-gold);
    border-bottom-color: var(--accent-gold);
    background: rgba(245, 158, 11, 0.05);
}

.nav-tagline {
    font-size: 0.85rem;
    color: var(--text-dim);
    letter-spacing: 0.05em;
    font-weight: 600;
    text-transform: uppercase;
}

/* ==========================================
   Main Container
   ========================================== */
.main-container {
    max-width: 1300px;
    margin: 2.5rem auto;
    padding: 0 2rem;
}

/* ==========================================
   High/Mid Page Search & Filter Box
   ========================================== */
.home-search-toolbar {
    background: #0d0d0d;
    border: 1px solid var(--border-color);
    border-left: 5px solid var(--accent-gold);
    border-radius: var(--radius-md);
    padding: 2rem 2.5rem;
    margin-bottom: 3.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
}

.search-header-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 1.2rem;
    letter-spacing: 0.03em;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.search-icon {
    position: absolute;
    left: 1.2rem;
    font-size: 1.2rem;
    color: var(--text-dim);
}

.search-box input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1rem 3rem 1rem 3.2rem;
    color: #ffffff;
    font-family: var(--font-body);
    font-size: 1.15rem;
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    background: #141414;
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px var(--accent-gold-glow);
}

.clear-btn {
    position: absolute;
    right: 1.2rem;
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 1.5rem;
    cursor: pointer;
}

.filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: center;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.filter-item label {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-muted);
    font-family: var(--font-heading);
}

.filter-item select {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.65rem 1.2rem;
    color: #ffffff;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.filter-item select:focus {
    outline: none;
    border-color: var(--accent-gold);
}

.search-submit-btn {
    margin-left: auto;
    background: var(--accent-gold);
    color: #000000;
    border: none;
    padding: 0.7rem 1.6rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: var(--transition);
}

.search-submit-btn:hover {
    background: #fbbf24;
    transform: translateY(-2px);
}

/* ==========================================
   Presentation Cards (Home Page)
   ========================================== */
.presentation-container {
    display: flex;
    flex-direction: column;
    gap: 3.5rem;
    margin-bottom: 4rem;
}

.presentation-card {
    background: #0a0a0a;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.8);
    padding: 3.2rem 3.8rem;
    position: relative;
    overflow: hidden;
}

.presentation-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #d97706 0%, #f59e0b 50%, #d97706 100%);
}

.presentation-card-header {
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
}

.presentation-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.presentation-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 1.1rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.date-badge {
    background: #171717;
    color: #e5e5e5;
    border: 1px solid var(--border-color);
}

.gift-badge {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.manifesto-badge {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.presentation-title {
    font-family: var(--font-heading);
    font-size: 2.6rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.25;
    letter-spacing: 0.03em;
}

.presentation-body {
    font-family: var(--font-body);
    font-size: 1.28rem;
    line-height: 1.85;
    color: #e5e5e5;
}

.presentation-body p {
    margin-bottom: 1.6rem;
    text-align: justify;
}

/* Hero Quote Box */
.hero-philosophical-quote {
    background: rgba(23, 23, 23, 0.8);
    border: 1px solid var(--border-color);
    border-left: 5px solid var(--accent-gold);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    padding: 1.8rem 2.2rem;
    margin: 2.4rem 0;
}

.hero-philosophical-quote p {
    margin-bottom: 0.8rem;
}

.quote-subtext {
    font-style: italic;
    color: var(--text-dim) !important;
    font-size: 1.15rem;
}

.quote-highlight {
    font-size: 1.5rem !important;
    font-weight: 700;
    color: #fbbf24 !important;
    font-style: italic;
    line-height: 1.4 !important;
    margin-bottom: 0 !important;
}

/* Philosophical Subsections */
.philosophical-section {
    margin-top: 3.2rem;
    padding-top: 2.5rem;
    border-top: 1px dashed var(--border-color);
}

.philo-sub-title {
    font-family: var(--font-heading);
    font-size: 1.85rem;
    color: var(--accent-gold);
    margin-bottom: 1.5rem;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.philo-sub-title::before {
    content: '◆';
    font-size: 1rem;
    color: var(--accent-gold);
}

.inline-quote {
    background: #141414;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent-gold);
    padding: 1.5rem 2rem;
    margin: 1.8rem 0;
    border-radius: var(--radius-sm);
    font-style: italic;
    color: #ffffff;
    font-size: 1.25rem;
}

.dual-aforism {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    margin: 2.2rem 0;
    padding: 1.6rem;
    background: #111111;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.aforism-dark {
    font-size: 1.45rem;
    font-weight: 700;
    color: #f87171 !important;
    font-style: italic;
    margin: 0 !important;
}

.aforism-divider {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-dim);
}

.aforism-light {
    font-size: 1.45rem;
    font-weight: 700;
    color: #34d399 !important;
    font-style: italic;
    margin: 0 !important;
}

.philo-principle {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: #fbbf24;
    margin: 2.2rem 0 1.2rem 0;
    line-height: 1.4;
    font-weight: 700;
    border-left: 3px solid var(--accent-gold);
    padding-left: 1.2rem;
}

/* Signatures */
.presentation-signature {
    display: flex;
    align-items: baseline;
    gap: 0.8rem;
    margin-top: 2.8rem;
    padding-top: 1.6rem;
    border-top: 1px solid var(--border-color);
    justify-content: flex-end;
}

.sig-abbrev {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 900;
    color: var(--accent-gold);
    letter-spacing: 0.1em;
}

.sig-full {
    font-family: var(--font-body);
    font-size: 1.2rem;
    font-style: italic;
    color: var(--text-dim);
}

/* Home Archive Callout Banner */
.archive-callout-banner {
    background: linear-gradient(180deg, #111111 0%, #080808 100%);
    border: 1px solid var(--border-color);
    border-left: 6px solid var(--accent-gold);
    border-radius: var(--radius-lg);
    padding: 2.5rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    margin-bottom: 4rem;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.7);
}

.callout-content h3 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: #ffffff;
    margin-bottom: 0.5rem;
}

.callout-content p {
    font-size: 1.15rem;
    color: var(--text-dim);
}

.callout-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--accent-gold);
    color: #000000;
    padding: 1rem 2.2rem;
    border-radius: var(--radius-md);
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: var(--transition);
    flex-shrink: 0;
}

.callout-btn:hover {
    background: #fbbf24;
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(245, 158, 11, 0.3);
}

/* ==========================================
   Archive Page Specifics (`archivio.html`)
   ========================================== */
.stats-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
    color: var(--text-dim);
    font-weight: 600;
    margin-bottom: 2rem;
    padding: 0.8rem 1.2rem;
    background: #0a0a0a;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.article-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.8rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.article-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-gold);
    transition: var(--transition);
}

.article-card:hover {
    transform: translateY(-6px);
    border-color: rgba(245, 158, 11, 0.5);
    box-shadow: var(--shadow-card-hover);
}

.card-top-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 1rem;
}

.card-category-tag {
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 700;
    background: #1f1f1f;
    color: var(--accent-gold);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1.45rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.35;
    margin-bottom: 1rem;
}

.card-excerpt {
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-dim);
}

.read-more-link {
    color: var(--accent-gold);
    font-weight: 700;
    font-family: var(--font-heading);
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.8rem;
    margin: 3.5rem 0;
}

.page-btn, .page-num {
    background: #0a0a0a;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.75rem 1.4rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.page-btn:hover:not(:disabled), .page-num:hover:not(.active) {
    background: #1a1a1a;
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-num.active {
    background: var(--accent-gold);
    color: #000000;
    border-color: var(--accent-gold);
}

/* ==========================================
   Article Modal
   ========================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.modal-overlay[hidden] {
    display: none !important;
}

.modal-card {
    background: #0d0d0d;
    border: 1px solid var(--border-color);
    border-top: 4px solid var(--accent-gold);
    border-radius: var(--radius-lg);
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-modal);
    overflow: hidden;
}

.modal-header {
    padding: 2rem 2.5rem 1.5rem 2.5rem;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.modal-title {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    color: #ffffff;
    line-height: 1.3;
    margin-top: 0.5rem;
}

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    background: #171717;
    border: 1px solid var(--border-color);
    color: var(--text-dim);
    font-size: 1.8rem;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    color: #ffffff;
    background: var(--accent-gold);
    color: #000000;
}

.modal-body {
    padding: 2.5rem;
    overflow-y: auto;
    font-family: var(--font-body);
    font-size: 1.25rem;
    line-height: 1.85;
    color: #e5e5e5;
}

/* ==========================================
   Footer
   ========================================== */
.app-footer {
    background: #050505;
    border-top: 1px solid var(--border-color);
    padding: 2.5rem 2rem;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.95rem;
}

.app-footer strong {
    color: #ffffff;
}

/* Loading Spinner */
.loading-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-dim);
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top-color: var(--accent-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 900px) {
    .header-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
    }
    
    .header-quote {
        margin-left: 0;
        max-width: 100%;
    }
    
    .site-title {
        font-size: 2.4rem;
    }
    
    .presentation-card {
        padding: 2rem 1.8rem;
    }
    
    .presentation-title {
        font-size: 1.9rem;
    }
    
    .archive-callout-banner {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ==========================================
   Laptop & Desktop Landscape Layout Optimization
   ========================================== */
.horizontal-laptop-card {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.presentation-visual {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 2px solid var(--border-color);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.7);
    background: #141414;
    transition: var(--transition);
    align-self: flex-start;
    width: 100%;
}

.presentation-visual:hover {
    border-color: var(--accent-gold);
    box-shadow: 0 16px 40px rgba(245, 158, 11, 0.25);
}

.presentation-feature-img {
    width: 100%;
    height: 100%;
    max-height: 480px;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.presentation-visual:hover .presentation-feature-img {
    transform: scale(1.03);
}

.visual-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.92) 100%);
    padding: 1.5rem 1rem 0.8rem 1rem;
    font-size: 0.85rem;
    color: var(--accent-gold);
    font-weight: 700;
    text-align: center;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

@media (min-width: 992px) {
    .horizontal-laptop-card {
        display: grid;
        grid-template-columns: 380px 1fr;
        align-items: start;
        gap: 3rem;
    }
    
    .horizontal-laptop-card.reverse-layout {
        grid-template-columns: 1fr 380px;
    }

    .horizontal-laptop-card.reverse-layout .presentation-visual {
        order: 2;
    }

    .horizontal-laptop-card.reverse-layout .presentation-content-side {
        order: 1;
    }

    .presentation-visual {
        height: 100%;
        min-height: 400px;
    }

    .presentation-feature-img {
        min-height: 400px;
        height: 100%;
    }
}

