/*
 * Kora — the default theme of Shiram CMS.
 * One stylesheet, no build step. The accent colour comes from the theme's
 * settings as --accent; everything else derives from the tokens below.
 */

:root {
    --accent: #2f6f5e;
    --bg: #fbfaf7;
    --surface: #ffffff;
    --text: #1c1f1e;
    --muted: #5d6461;
    --rule: #e3e0d8;
    --accent-text: color-mix(in srgb, var(--accent) 88%, #000);
    --accent-soft: color-mix(in srgb, var(--accent) 10%, var(--surface));
    --radius: 12px;
    --shadow: 0 1px 2px rgb(20 24 22 / .05), 0 4px 16px rgb(20 24 22 / .04);
    --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    --font-prose: "Iowan Old Style", "Palatino Linotype", Palatino, Charter, Georgia, serif;
    color-scheme: light;
}

html[data-scheme="dark"] {
    --bg: #111413;
    --surface: #181c1b;
    --text: #e6eae8;
    --muted: #9ba49f;
    --rule: #2a302e;
    --accent-text: color-mix(in srgb, var(--accent) 55%, #fff);
    --accent-soft: color-mix(in srgb, var(--accent) 22%, var(--surface));
    --shadow: none;
    color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
    html[data-scheme="auto"] {
        --bg: #111413;
        --surface: #181c1b;
        --text: #e6eae8;
        --muted: #9ba49f;
        --rule: #2a302e;
        --accent-text: color-mix(in srgb, var(--accent) 55%, #fff);
        --accent-soft: color-mix(in srgb, var(--accent) 22%, var(--surface));
        --shadow: none;
        color-scheme: dark;
    }
}

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

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    font: 17px/1.65 var(--font);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a { color: var(--accent-text); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
img { max-width: 100%; height: auto; display: block; }

.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 1rem; top: 1rem; z-index: 10; padding: .5rem .9rem; background: var(--surface); border-radius: 8px; }

.container { width: min(72rem, 100% - 2rem); margin-inline: auto; }

/* Header ---------------------------------------------------------------- */

.masthead { border-bottom: 1px solid var(--rule); background: var(--surface); }
.masthead-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 2rem; padding-block: 1.1rem; }
.brand-name { color: var(--text); font-weight: 700; font-size: 1.3rem; letter-spacing: -.01em; text-decoration: none; }
.brand-tagline { margin: .1rem 0 0; color: var(--muted); font-size: .9rem; }

.masthead nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: .25rem; margin: 0; padding: 0; }
.masthead nav a { display: block; padding: .4rem .75rem; border-radius: 999px; color: var(--text); text-decoration: none; font-size: .95rem; }
.masthead nav a:hover, .masthead nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-text); }
.masthead nav li { position: relative; }
.masthead nav li ul { display: none; position: absolute; top: 100%; left: 0; z-index: 5; min-width: 12rem; flex-direction: column; padding: .4rem; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow); }
.masthead nav li:hover > ul, .masthead nav li:focus-within > ul { display: flex; }

/* Page ------------------------------------------------------------------ */

.page { flex: 1; display: grid; align-content: start; gap: 3rem; padding-block: 2.5rem 4rem; }
.page.has-sidebar { grid-template-columns: minmax(0, 1fr) 17rem; }
.page.sidebar-left { grid-template-columns: 17rem minmax(0, 1fr); }
.page.sidebar-left > aside { order: -1; }
main { min-width: 0; }
main:focus { outline: none; }

@media (max-width: 52rem) {
    .page.has-sidebar, .page.sidebar-left { grid-template-columns: minmax(0, 1fr); }
    .page.sidebar-left > aside { order: 0; }
}

h1, h2, h3 { line-height: 1.2; letter-spacing: -.015em; }
h1 { font-size: clamp(1.9rem, 1.4rem + 2vw, 2.7rem); margin: 0 0 .75rem; }

.eyebrow { margin: 0 0 .35rem; color: var(--muted); font-size: .85rem; letter-spacing: .02em; }
.notice { padding: .75rem 1rem; margin: 0 0 1.5rem; border-radius: var(--radius); background: var(--accent-soft); color: var(--text); }
.empty, .muted { color: var(--muted); }

/* Lists of items -------------------------------------------------------- */

.cards { display: grid; gap: 1.25rem; }
.card { display: grid; grid-template-columns: 1fr; overflow: hidden; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow); }
.card:has(.card-image) { grid-template-columns: 14rem minmax(0, 1fr); }
.card-image img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 3; }
.card-body { padding: 1.25rem 1.4rem; }
.card-title { margin: 0 0 .4rem; font-size: 1.3rem; }
.card-title a { color: var(--text); text-decoration: none; }
.card-title a:hover { color: var(--accent-text); text-decoration: underline; }
.card-excerpt { margin: 0; color: var(--muted); }

@media (max-width: 36rem) {
    .card:has(.card-image) { grid-template-columns: 1fr; }
}

.pager { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 2rem; }
.pager a { padding: .45rem .9rem; border: 1px solid var(--rule); border-radius: 999px; background: var(--surface); text-decoration: none; }

/* A single item --------------------------------------------------------- */

.entry { max-width: 42rem; }
.entry-header { margin-bottom: 1.75rem; }
.entry-lede { margin: 0; font-size: 1.2rem; color: var(--muted); }
.entry-image { margin: 0 0 2rem; }
.entry-image img { border-radius: var(--radius); }
.entry-image figcaption { margin-top: .5rem; color: var(--muted); font-size: .9rem; }

.prose { font-family: var(--font-prose); font-size: 1.12rem; line-height: 1.75; }
.prose > * + * { margin-top: 1.1em; }
.prose h2, .prose h3 { font-family: var(--font); margin-top: 2em; }
.prose blockquote { margin-inline: 0; padding-left: 1.1rem; border-left: 3px solid var(--accent); color: var(--muted); }
.prose code { font-size: .88em; padding: .1em .35em; border-radius: 5px; background: var(--accent-soft); }
.prose pre { overflow-x: auto; padding: 1rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--rule); }
.prose pre code { padding: 0; background: none; }
.prose img { border-radius: var(--radius); }

.tags { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; margin: 2.5rem 0 0; padding: 0; }
.tags a { display: inline-block; padding: .25rem .75rem; border-radius: 999px; background: var(--accent-soft); font-size: .85rem; text-decoration: none; }

/* Forms ----------------------------------------------------------------- */

input[type="search"], input[type="password"], input[type="text"] {
    width: 100%; max-width: 24rem; padding: .6rem .8rem;
    font: inherit; color: var(--text); background: var(--surface);
    border: 1px solid var(--rule); border-radius: 10px;
}
button {
    padding: .6rem 1rem; font: inherit; font-weight: 600; cursor: pointer;
    color: #fff; background: var(--accent); border: 0; border-radius: 10px;
}
button:hover { filter: brightness(1.08); }
form[role="search"] { display: flex; gap: .5rem; }
form[role="search"] input { flex: 1; }
label { display: block; margin-bottom: .35rem; font-weight: 600; }
.error { color: #c0392b; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Regions and blocks ---------------------------------------------------- */

.region-header { padding-top: 1.5rem; }
.region-sidebar { display: grid; align-content: start; gap: 2rem; }
.block-title { margin: 0 0 .75rem; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.block ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.block ul ul { padding-left: 1rem; margin-top: .45rem; }
.block-text .body > :first-child { margin-top: 0; }

/* Footer ---------------------------------------------------------------- */

.colophon { border-top: 1px solid var(--rule); background: var(--surface); color: var(--muted); font-size: .92rem; }
.colophon .container { padding-block: 2rem; display: grid; gap: 1rem; }
.colophon nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin: 0; padding: 0; }
.colophon nav a { color: var(--muted); }
.colophon-text { margin: 0; white-space: pre-line; }
.region-footer { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 2rem; }
