/* =============================================================
   Meridian Theme — Base Typography & Global Elements
   OJS 3.3.0.7 Compatible — Novelty-Inspired Refinement
   ============================================================= */

/* ── Reset ── */
*, *::before, *::after {
    box-sizing: border-box;
}

/* ── Body ── */
body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: var(--leading-relaxed);
    color: var(--color-text-primary);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* ── Headings ── */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: var(--leading-tight);
    color: var(--gray-900);
    letter-spacing: var(--tracking-tight);
    margin-top: 0;
    margin-bottom: var(--space-4);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

/* ── Paragraphs ── */
p {
    margin-top: 0;
    margin-bottom: var(--space-4);
    color: var(--color-text-secondary);
}

/* ── Links ── */
a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-dark);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ── Images ── */
img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
}

/* ── Tables ── */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--space-6);
    font-size: var(--text-sm);
}

table caption {
    text-align: left;
    font-weight: 600;
    margin-bottom: var(--space-2);
    color: var(--color-text-primary);
}

th, td {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

th {
    background: var(--color-bg-subtle);
    font-weight: 600;
    color: var(--color-text-primary);
}

tr:hover td {
    background: var(--color-bg-subtle);
}

/* ── Blockquotes ── */
blockquote {
    margin: var(--space-8) 0;
    padding: var(--space-5) var(--space-8);
    border-left: 4px solid var(--accent);
    background: var(--color-bg-subtle);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    color: var(--color-text-secondary);
    font-style: italic;
    line-height: var(--leading-relaxed);
}

/* ── Horizontal Rules ── */
hr {
    border: none;
    height: 1px;
    background: var(--color-border);
    margin: var(--space-12) 0;
}

/* ── Lists ── */
ul, ol {
    padding-left: var(--space-6);
    margin-bottom: var(--space-4);
    color: var(--color-text-secondary);
}

li {
    margin-bottom: var(--space-2);
}

/* ── Code ── */
code, pre {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
}

code {
    background: var(--gray-100);
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
    color: var(--accent-dark);
}

pre {
    background: var(--gray-900);
    color: var(--gray-100);
    padding: var(--space-6);
    border-radius: var(--radius-md);
    overflow-x: auto;
    line-height: 1.5;
    margin-bottom: var(--space-6);
}

pre code {
    background: none;
    color: inherit;
    padding: 0;
}

/* ── Focus Styles ── */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* ── Selection ── */
::selection {
    background: var(--accent);
    color: var(--white);
}

/* ── Breadcrumbs ── */
.pkp_breadcrumbs {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    padding: var(--space-4) 0;
    margin-bottom: var(--space-6);
    border-bottom: 1px solid var(--color-border);
}

.pkp_breadcrumbs ol {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.pkp_breadcrumbs li {
    margin: 0;
}

.pkp_breadcrumbs li a {
    color: var(--color-text-muted);
}

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

.pkp_breadcrumbs .separator {
    color: var(--color-text-muted);
    margin: 0 var(--space-1);
}

.pkp_breadcrumbs .current {
    color: var(--color-text-primary);
    font-weight: 500;
}

/* ── Page Titles ── */
.page_title {
    font-family: var(--font-display);
    font-size: var(--text-4xl);
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: var(--space-8);
    padding-bottom: var(--space-4);
    border-bottom: 2px solid var(--color-border);
    letter-spacing: var(--tracking-tight);
}

/* ── Utility ── */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--color-text-muted); }
.text-small  { font-size: var(--text-sm); }