/* theme.css - Complemento elegante e istituzionale a tufte.css per Epistechnology / exedre.org */

:root {
    --color-bg: #fbfbf9;
    --color-text: #1d232a;
    --color-primary: #1e3a5f;      /* Deep Academic Navy */
    --color-primary-hover: #12243b;
    --color-accent: #8b3a2b;       /* Warm Terracotta / Oxide Red */
    --color-accent-hover: #68291d;
    --color-muted: #536271;        /* Slate Gray */
    --color-border: #d8dee4;
    --color-badge-bg: #edf2f7;
    --color-panel-bg: #f4f6f8;
}

body {
    background-color: var(--color-bg) !important;
    color: var(--color-text) !important;
}

@media (prefers-color-scheme: dark) {
    :root {
        --color-bg: #14171a;
        --color-text: #e1e8ed;
        --color-primary: #79a8d9;
        --color-primary-hover: #a3c4ea;
        --color-accent: #e07a5f;
        --color-accent-hover: #efa08b;
        --color-muted: #8899a6;
        --color-border: #38444d;
        --color-badge-bg: #1c2732;
        --color-panel-bg: #19222d;
    }
}

/* Site Header */
.site-header {
    padding-top: 3.5rem;
    padding-bottom: 1.8rem;
    border-bottom: 2px solid var(--color-border);
    max-width: 87.5%;
}

.site-header .center-title {
    line-height: 1.15;
}

.site-header .center-title a {
    font-size: 3.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.15s ease;
}

.site-header .center-title a:hover {
    color: var(--color-primary-hover);
    text-decoration: none;
}

.site-header .center-title span {
    display: block;
    margin-top: 0.8rem;
    font-style: normal;
    font-size: 1.25rem;
    font-weight: 400;
    line-height: 1.45;
    color: var(--color-muted);
    letter-spacing: 0.01em;
}

/* Header Navigation */
.site-nav {
    margin-top: 1.6rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.8rem;
    font-size: 1.05rem;
}

.site-nav a {
    color: var(--color-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s ease;
}

.site-nav a:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

.site-nav a.nav-definition {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.85rem;
    background-color: var(--color-badge-bg);
    color: var(--color-primary);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s ease;
}

.site-nav a.nav-definition:hover {
    background-color: var(--color-primary);
    color: #ffffff;
    border-color: var(--color-primary);
    text-decoration: none;
}

.site-nav .nav-sep {
    color: var(--color-border);
    font-weight: bold;
}

/* Typography & Content Links */
a {
    color: var(--color-accent);
}

a:hover {
    color: var(--color-accent-hover);
}

.content article {
    padding: 2.2rem 0 1rem 0;
}

article header h1 {
    margin-top: 2rem;
    color: var(--color-primary);
}

article header h1 a {
    color: var(--color-primary);
}

article header h1 a:hover {
    color: var(--color-accent);
}

.post-meta {
    font-style: normal;
    font-size: 0.95rem;
    color: var(--color-muted);
    margin-top: 0.8rem;
    letter-spacing: 0.02em;
}

.post-meta a {
    color: var(--color-muted);
    text-decoration: underline;
}

.post-meta a:hover {
    color: var(--color-primary);
}

figure.featured {
    max-width: 55%;
    margin-top: 2rem;
}

figure.featured img {
    max-width: 100%;
    height: auto;
}

.post-body {
    max-width: 65%;
}

.post-body > p,
.post-body > dl,
.post-body > ol,
.post-body > ul,
.post-body > footer,
.post-body > table {
    width: auto;
}

/* Side panel */
.sidebar-panel {
    float: right;
    width: 34%;
    margin: 0 0 1.5em 2em;
    padding: 1em 1.3em;
    background-color: var(--color-panel-bg);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.sidebar-panel .sidebar-panel-title {
    font-variant: small-caps;
    letter-spacing: 0.05em;
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-primary);
}

.sidebar-panel ul {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.95rem;
}

.sidebar-panel li {
    margin: 0.3em 0;
}

.sidebar-panel a {
    text-decoration: none;
}

.sidebar-panel a:hover {
    text-decoration: underline;
}

@media (max-width: 800px) {
    .post-body {
        max-width: 100%;
    }
    .sidebar-panel {
        float: none;
        width: 100%;
        margin: 0 0 1.5em 0;
    }
}

/* Article Lists */
ul.postlist {
    list-style: none;
    margin: 0;
    padding: 0;
}

ul.postlist li {
    margin: 0 0 1.2rem 0;
}

ul.postlist a {
    text-decoration: none;
    color: var(--color-primary);
    font-weight: 500;
}

ul.postlist a:hover {
    color: var(--color-accent);
    text-decoration: underline;
}

ul.postlist .post-date {
    display: block;
    font-size: 0.95rem;
    color: var(--color-muted);
    margin-top: 0.15rem;
}

ul.postlist .post-tags {
    font-size: 0.9rem;
    color: var(--color-muted);
}

/* Buttons */
.read-more-btn {
    display: inline-block;
    margin-top: 1.2rem;
    padding: 0.45rem 1rem;
    border: 1px solid var(--color-primary);
    border-radius: 4px;
    font-size: 0.95rem;
    text-decoration: none;
    color: var(--color-primary);
    font-weight: 600;
    transition: all 0.15s ease;
}

.read-more-btn:hover {
    background-color: var(--color-primary);
    color: #ffffff;
    text-decoration: none;
}

/* Recent Posts */
.recent-posts {
    margin-top: 3.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
}

.recent-posts h2 {
    font-size: 1.5rem;
    color: var(--color-primary);
    margin-bottom: 1.2rem;
}

/* Footer */
.site-footer {
    margin-top: 4.5rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--color-border);
    font-size: 1.05rem;
    color: var(--color-muted);
}

.site-footer p {
    margin: 0.4rem 0;
}

.site-footer a {
    color: var(--color-muted);
    text-decoration: none;
}

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

@media (max-width: 600px) {
    .site-header {
        max-width: 100%;
        padding-top: 2rem;
    }
    .site-header .center-title a {
        font-size: 2.5rem;
    }
    figure.featured {
        max-width: 100%;
    }
}