/*
Theme Name: ZLO
Theme URI: https://zlolit.org
Author: ZLO — literarna organizacija
Description: Tema za ZLO — književnu radionicu. Svaki autor ima svoju boju; tri sheme (Dobro, Zlo, U kvaru); klasičan knjiški slog za čitanje priča.
Version: 1.1.2
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: zlo
*/

/* ---------- Tokens ---------- */
:root {
	--bg: #FBF8F2;
	--text: #1B1A1F;
	--muted: #5E5A63;
	--rule: #E4DED3;
	--surface: #F3EEE5;
	--serif-display: 'Playfair Display', Georgia, serif;
	--serif-text: 'Libre Baskerville', Georgia, serif;
	--sans: Montserrat, 'Helvetica Neue', Arial, sans-serif;
	--wrap: 1200px;
	--radius: 6px;
	color-scheme: light;
}
html[data-scheme="bold"] {
	--bg: #141318;
	--text: #F4F1EA;
	--muted: #B5B0BB;
	--rule: #2E2C34;
	--surface: #1D1C22;
	color-scheme: dark;
}

/* Author colours: set --a-pastel / --a-bold / --a-ink / --a-light inline */
[data-a] {
	--a-card: var(--a-pastel);
	--a-card-ink: #1B1A1F;
	--a-accent: var(--a-bold);
}
html[data-scheme="bold"] [data-a] {
	--a-card: var(--a-bold);
	--a-card-ink: var(--a-ink);
	--a-accent: var(--a-light);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--serif-text);
	font-size: 17px;
	line-height: 1.7;
	transition: background-color .3s, color .3s;
}
img, video, iframe { max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
h1, h2, h3, h4 { font-family: var(--serif-display); font-weight: 400; line-height: 1.15; margin: 0; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid currentColor; outline-offset: 3px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.screen-reader-text, .skip:not(:focus) {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.skip:focus { position: fixed; top: 12px; left: 12px; z-index: 100; background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 999px; }

.kicker, .meta, .more, .btn, .site-nav, .scheme, .pill, .news__date {
	font-family: var(--sans);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 1.5px;
	text-transform: uppercase;
}
.kicker { margin: 0 0 14px; font-weight: 700; letter-spacing: 3px; }
.ornament { margin: 0; font-family: var(--serif-display); font-size: 22px; letter-spacing: 12px; color: var(--muted); text-align: center; }
.ornament--accent { color: var(--a-accent, var(--muted)); }

/* ---------- Buttons & pills ---------- */
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 40px; }
.btn {
	display: inline-flex; align-items: center; min-height: 48px; padding: 0 28px;
	border-radius: 999px; border: 1px solid currentColor; text-decoration: none; font-size: 13px;
}
.btn:hover { text-decoration: underline; }
.btn--solid { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn--line { border-width: 2px; margin-top: 24px; }
.pill {
	display: inline-block; padding: 6px 12px; border-radius: 999px;
	background: var(--a-card); color: var(--a-card-ink); text-decoration: none;
}
.pill:hover { text-decoration: underline; }

/* ---------- Dots ---------- */
.dots { display: flex; justify-content: center; gap: 8px; }
.dots > span { display: block; border-radius: 50%; background: var(--a-card); }
.dots--lg { margin-bottom: 36px; }
.dots--lg > span { width: 28px; height: 28px; }
.dots--sm { margin-bottom: 24px; }
.dots--sm > span { width: 14px; height: 14px; }
.dots--bar { gap: 6px; }
.dots--bar > span { width: 22px; height: 6px; border-radius: 3px; background: var(--a-accent); }

/* ---------- Header ---------- */
.site-header__inner {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px;
	padding-top: 28px; padding-bottom: 20px;
}
.brand { display: flex; align-items: baseline; gap: 14px; text-decoration: none; }
.brand__name { font-family: var(--serif-display); font-weight: 900; font-size: 42px; letter-spacing: -1px; line-height: 1; }
.brand__tag { font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: 3px; text-transform: uppercase; color: var(--muted); }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 24px; font-size: 13px; }
.site-nav a { text-decoration: none; display: inline-block; padding: 10px 0; }
.site-nav a:hover, .site-nav .current-menu-item > a, .site-nav .current-cat > a { text-decoration: underline; }
.scheme { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--rule); border-radius: 999px; letter-spacing: .5px; }
.scheme button {
	border: 0; border-radius: 999px; min-height: 36px; padding: 0 16px;
	background: transparent; color: var(--text); font-weight: 600;
}
.scheme button[aria-pressed="true"] { background: var(--text); color: var(--bg); }

/* ---------- Hero ---------- */
.hero { padding-top: 88px; padding-bottom: 72px; text-align: center; }
.hero__title { max-width: 900px; margin: 0 auto; font-size: clamp(38px, 6vw, 76px); line-height: 1.08; letter-spacing: -1px; }
.hero__text { max-width: 560px; margin: 28px auto 0; font-size: 18px; color: var(--muted); }

/* ---------- Featured ---------- */
.feature { background: var(--a-card); color: var(--a-card-ink); }
.feature__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 56px; padding-top: 72px; padding-bottom: 72px; }
.feature__img { flex: 0 1 420px; display: block; }
.feature__img img { display: block; width: 100%; border-radius: 4px; }
.feature__body { flex: 1 1 420px; min-width: 0; }
.feature__title { font-style: italic; font-weight: 700; font-size: clamp(38px, 5vw, 60px); line-height: 1.02; }
.feature__title a { text-decoration: none; }
.feature__title a:hover { text-decoration: underline; }
.feature__author { margin: 12px 0 0; font-family: var(--serif-display); font-size: 22px; }
.feature__excerpt { max-width: 580px; margin: 20px 0 0; }

/* ---------- Sections ---------- */
.section { padding-top: 88px; padding-bottom: 24px; }
.section__head h2 { font-size: 46px; }
.section__head--center { text-align: center; margin-bottom: 48px; }
.section__head--center .muted { margin: 10px 0 0; }
.section__head--rule {
	display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 16px;
	border-bottom: 2px solid var(--text); padding-bottom: 14px;
}
.more { text-decoration: none; }
.more:hover { text-decoration: underline; }

/* ---------- Author cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.card {
	min-height: 300px; padding: 28px; border-radius: var(--radius);
	background: var(--a-card); color: var(--a-card-ink); text-decoration: none;
	display: flex; flex-direction: column; justify-content: space-between; gap: 24px;
	transition: transform .2s;
}
.card:hover { transform: translateY(-4px); }
.card__initial { font-family: var(--serif-display); font-weight: 900; font-size: 72px; line-height: .8; }
.card__line { font-style: italic; font-size: 15px; line-height: 1.6; }
.card__foot { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; border-top: 1px solid currentColor; padding-top: 14px; }
.card__name { font-family: var(--serif-display); font-weight: 700; font-size: 20px; }

/* ---------- Post rows ---------- */
.row {
	display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; gap: 28px;
	padding: 32px 0; border-bottom: 1px solid var(--rule); align-items: start;
}
.row__bar { align-self: stretch; background: var(--a-accent); border-radius: 4px; }
.row__body { display: flex; flex-direction: column; gap: 10px; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0; color: var(--muted); }
.meta .pill { color: var(--a-card-ink); }
.meta--center { justify-content: center; }
.meta a { color: var(--muted); }
.row__title { font-size: 32px; }
.row__title a { text-decoration: none; }
.row__title a:hover { text-decoration: underline; }
.row__excerpt { max-width: 760px; font-size: 16px; color: var(--muted); }
.row__thumb { width: 200px; display: block; }
.row__thumb img { display: block; width: 200px; height: 140px; object-fit: cover; border-radius: 4px; }
@media (max-width: 720px) {
	.row { grid-template-columns: 6px minmax(0, 1fr); gap: 18px; }
	.row__thumb { display: none; }
	.row__title { font-size: 26px; }
}

/* ---------- News ---------- */
.news { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.news__item {
	display: flex; flex-direction: column; gap: 14px; padding: 28px;
	border: 1px solid var(--rule); border-top: 6px solid var(--a-accent); border-radius: var(--radius);
	text-decoration: none;
}
.news__item:hover .news__title { text-decoration: underline; }
.news__img img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 4px; }
.news__date { color: var(--muted); }
.news__title { font-family: var(--serif-display); font-size: 26px; line-height: 1.2; }
.news__text { font-size: 15px; color: var(--muted); }
.section .center { margin-top: 36px; }

/* ---------- Reading layout ---------- */
.topbar { height: 8px; background: var(--a-accent); }
.reading { max-width: 720px; margin: 0 auto; padding: 72px 24px 48px; }
.reading__head { text-align: center; margin-bottom: 48px; }
.reading__title { margin: 26px 0 18px; font-size: clamp(38px, 6vw, 62px); line-height: 1.08; }
.reading__head .ornament { margin-top: 28px; }
.reading__img { margin: 0 0 40px; }
.reading__img img { display: block; width: 100%; border-radius: 4px; }
.reading--page .reading__title { margin-top: 0; }

.entry { font-size: 19px; line-height: 1.85; }
.entry p { margin: 0 0 1.4em; }
.entry h2 { font-size: 34px; margin: 1.6em 0 .6em; }
.entry h3 { font-size: 26px; margin: 1.4em 0 .5em; }
.entry a { text-decoration: underline; text-decoration-color: var(--a-accent, currentColor); }
.entry blockquote {
	margin: 1.8em 0; padding: 0 0 0 28px; border-left: 3px solid var(--a-accent, var(--text));
	font-style: italic; font-size: 20px;
}
.entry hr { border: 0; text-align: center; margin: 2.4em 0; }
.entry hr::after { content: '· · ·'; font-family: var(--serif-display); letter-spacing: 12px; color: var(--muted); }
.entry ul, .entry ol { padding-left: 1.3em; margin: 0 0 1.4em; }
.entry figure { margin: 2em 0; }
.entry figcaption, .wp-caption-text { font-family: var(--sans); font-size: 13px; color: var(--muted); margin-top: 8px; text-align: center; }
.entry img { border-radius: 4px; }
.entry .alignleft { float: left; margin: .4em 1.4em 1em 0; }
.entry .alignright { float: right; margin: .4em 0 1em 1.4em; }
.entry .aligncenter { display: block; margin-left: auto; margin-right: auto; }
.entry .alignwide { margin-left: -120px; margin-right: -120px; max-width: none; }
@media (max-width: 960px) { .entry .alignwide { margin-left: 0; margin-right: 0; } }
.entry::after { content: ''; display: table; clear: both; }

/* Drop cap on stories */
.is-story .entry > p:first-of-type::first-letter {
	float: left; font-family: var(--serif-display); font-weight: 900;
	font-size: 5.2em; line-height: .8; margin: .08em .12em 0 0; color: var(--a-accent);
}

/* Galleries (classic + block) */
.gallery { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 2em 0; }
.gallery-columns-1 { grid-template-columns: 1fr; }
.gallery-columns-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gallery-columns-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.gallery-columns-5, .gallery-columns-6, .gallery-columns-7, .gallery-columns-8, .gallery-columns-9 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 600px) { .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } }
.gallery-item { margin: 0; }
.gallery-item img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.gallery br { display: none; }
.wp-block-gallery { margin: 2em 0; }

/* Author box */
.author-box {
	display: flex; flex-wrap: wrap; gap: 24px; align-items: center;
	margin-top: 48px; padding: 32px; border-radius: var(--radius);
	background: var(--a-card); color: var(--a-card-ink);
}
.author-box__initial {
	width: 80px; height: 80px; border-radius: 50%; border: 2px solid currentColor;
	display: flex; align-items: center; justify-content: center;
	font-family: var(--serif-display); font-weight: 900; font-size: 40px;
}
.author-box__body { flex: 1 1 260px; display: flex; flex-direction: column; gap: 8px; }
.author-box__name { font-family: var(--serif-display); font-weight: 700; font-size: 24px; }
.author-box__bio { font-style: italic; font-size: 15px; line-height: 1.6; }
.author-box__link { font-family: var(--sans); font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; }

/* Prev / next */
.postnav { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; padding-bottom: 48px; }
.postnav__item {
	display: flex; flex-direction: column; padding: 28px; border-radius: var(--radius);
	background: var(--a-card); color: var(--a-card-ink); text-decoration: none;
}
.postnav__item .kicker { margin-bottom: 8px; letter-spacing: 1.5px; }
.postnav__title { font-family: var(--serif-display); font-size: 28px; line-height: 1.15; }
.postnav__item:hover .postnav__title { text-decoration: underline; }

/* ---------- Author page ---------- */
.author-hero { background: var(--a-card); color: var(--a-card-ink); }
.author-hero__inner { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 48px; padding-top: 72px; padding-bottom: 88px; }
.author-hero__initial { font-family: var(--serif-display); font-weight: 900; font-size: clamp(120px, 18vw, 220px); line-height: .78; }
.author-hero__body { flex: 1 1 420px; min-width: 0; }
.author-hero__name { font-weight: 900; font-size: clamp(46px, 7vw, 92px); line-height: .95; letter-spacing: -1px; }
.author-hero__bio { margin-top: 28px; max-width: 620px; font-style: italic; font-size: 18px; }
.author-hero__bio p { margin: 0 0 1em; }

/* ---------- Archive ---------- */
.archive-head { text-align: center; margin-bottom: 40px; }
.archive-head h1 { font-size: clamp(40px, 6vw, 64px); margin-top: 12px; }
.archive-head__desc { max-width: 620px; margin: 16px auto 0; }
.search-form { display: flex; justify-content: center; gap: 8px; margin: 28px auto; max-width: 480px; }
.search-form label { flex: 1; }
.search-field {
	width: 100%; min-height: 48px; padding: 0 18px; border: 1px solid var(--rule); border-radius: 999px;
	background: var(--surface); color: var(--text); font: inherit; font-size: 16px;
}
.search-submit {
	min-height: 48px; padding: 0 22px; border: 0; border-radius: 999px;
	background: var(--text); color: var(--bg); font-family: var(--sans); font-weight: 600; font-size: 13px;
}
.pagination { margin: 48px 0; }
.pagination .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; font-family: var(--sans); font-size: 14px; font-weight: 600; }
.pagination .page-numbers {
	min-width: 44px; min-height: 44px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center;
	border: 1px solid var(--rule); border-radius: 999px; text-decoration: none;
}
.pagination .current { background: var(--text); color: var(--bg); border-color: var(--text); }

/* ---------- Comments ---------- */
.reading--comments { padding-top: 0; }
.comments__title { font-size: 30px; margin-bottom: 20px; }
.comment-list { list-style: none; padding: 0; }
.comment-list .comment { border-top: 1px solid var(--rule); padding: 20px 0; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
	width: 100%; padding: 12px 14px; border: 1px solid var(--rule); border-radius: var(--radius);
	background: var(--surface); color: var(--text); font: inherit;
}
.comment-form .submit {
	min-height: 48px; padding: 0 28px; border: 0; border-radius: 999px;
	background: var(--text); color: var(--bg); font-family: var(--sans); font-weight: 600;
}

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--rule); margin-top: 72px; }
.site-footer__inner {
	display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 20px;
	padding-top: 40px; padding-bottom: 40px; font-family: var(--sans); font-size: 13px; color: var(--muted);
}
.site-footer__brand .brand__name { font-size: 22px; color: var(--text); }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 20px; }

/* ---------- U kvaru: the broken scheme ---------- */
html[data-scheme="kvar"] {
	--bg: #12002B;
	--text: #FFF5A5;
	--muted: #7DF9FF;
	--rule: #FF2BD6;
	--surface: #1E0640;
	--n1: #FF2BD6;
	--n2: #7DF9FF;
	--n3: #B6FF00;
	--n4: #FFF5A5;
	color-scheme: dark;
}
html[data-scheme="kvar"] [data-a] {
	--a-card: var(--a-bold);
	--a-card-ink: var(--a-ink);
	--a-accent: var(--n1);
}
html[data-scheme="kvar"] body {
	background:
		radial-gradient(circle at 12% 18%, rgba(255, 43, 214, .35) 0, transparent 32%),
		radial-gradient(circle at 88% 8%, rgba(125, 249, 255, .28) 0, transparent 30%),
		radial-gradient(circle at 50% 60%, rgba(182, 255, 0, .18) 0, transparent 40%),
		var(--bg);
	background-attachment: fixed;
}
html[data-scheme="kvar"] .brand__name {
	background: linear-gradient(90deg, var(--n1), var(--n4), var(--n2), var(--n3), var(--n1));
	background-size: 300% 100%;
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	animation: zlo-shimmer 6s linear infinite;
}
html[data-scheme="kvar"] .scheme button[aria-pressed="true"] {
	background: var(--n3);
	color: #12002B;
}
html[data-scheme="kvar"] .card { transition: transform .25s, filter .25s; }
html[data-scheme="kvar"] .card:nth-child(4n+1) { transform: rotate(-2deg); box-shadow: 8px 8px 0 var(--n1), 16px 16px 0 var(--n2); }
html[data-scheme="kvar"] .card:nth-child(4n+2) { transform: rotate(1.5deg); box-shadow: 8px 8px 0 var(--n2), 16px 16px 0 var(--n3); }
html[data-scheme="kvar"] .card:nth-child(4n+3) { transform: rotate(-1deg); box-shadow: 8px 8px 0 var(--n3), 16px 16px 0 var(--n4); }
html[data-scheme="kvar"] .card:nth-child(4n+4) { transform: rotate(2.5deg); box-shadow: 8px 8px 0 var(--n4), 16px 16px 0 var(--n1); }
html[data-scheme="kvar"] .card:hover { transform: rotate(0) scale(1.03); filter: hue-rotate(90deg) saturate(1.4); }
html[data-scheme="kvar"] .cards { gap: 36px; }
html[data-scheme="kvar"] .row:nth-of-type(4n+1) .row__bar { background: var(--n1); }
html[data-scheme="kvar"] .row:nth-of-type(4n+2) .row__bar { background: var(--n2); }
html[data-scheme="kvar"] .row:nth-of-type(4n+3) .row__bar { background: var(--n3); }
html[data-scheme="kvar"] .row:nth-of-type(4n+4) .row__bar { background: var(--n4); }
html[data-scheme="kvar"] .section__head--rule { border-bottom-style: dashed; border-bottom-color: var(--n1); }
html[data-scheme="kvar"] .news__item { border-style: dashed; }
html[data-scheme="kvar"] .news__item:nth-child(3n+2) { border-top-color: var(--n2); }
html[data-scheme="kvar"] .news__item:nth-child(3n+3) { border-top-color: var(--n3); }
html[data-scheme="kvar"] .hero__title em { color: var(--n1); }
html[data-scheme="kvar"] .dots > span { box-shadow: 0 0 14px var(--a-card); }
html[data-scheme="kvar"] .btn--solid { background: var(--n3); border-color: var(--n3); color: #12002B; }
@keyframes zlo-shimmer { to { background-position: 300% 0; } }

@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; animation: none !important; }
}
