/*
Theme Name: Povești
Theme URI: https://story.jurnalista.net
Author: jurnalista.net
Description: Temă rapidă pentru site-uri de povești, cu panou de control (Povești în meniul din stânga): reclame AdSense în locuri fixe cu spațiu rezervat, citiri numărate fără plugin, „Cele mai citite”, analytics, pagini legale generate automat. Fără constructor de pagini, fără jQuery pe site.
Version: 2.0.2
Requires at least: 6.3
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: povesti
*/

:root {
	--bg: #fbf7f2;
	--card: #ffffff;
	--ink: #2a211c;
	--soft: #6e625a;
	--line: #eadfd4;
	--accent: #9b2c3b;
	--accent-soft: color-mix(in srgb, var(--accent) 10%, var(--bg));
	--footer: #211915;
	--footer-ink: #e9dfd6;
	--serif: Charter, 'Bitstream Charter', 'Sitka Text', Cambria, Georgia, serif;
	--sans: 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
	--radius: 14px;
}
@media (prefers-color-scheme: dark) {
	:root {
		--bg: #181412;
		--card: #221c19;
		--ink: #efe7df;
		--soft: #b0a398;
		--line: #362d28;
		--accent-soft: color-mix(in srgb, var(--accent) 22%, var(--bg));
		--footer: #110d0b;
	}
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 17px; line-height: 1.6; }
a { color: inherit; }
img { max-width: 100%; height: auto; display: block; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--card); padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }

.progress { position: fixed; top: 0; left: 0; right: 0; height: 4px; z-index: 40; pointer-events: none; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); }

/* ---------- Antet ---------- */
.top { background: var(--card); border-bottom: 1px solid var(--line); position: relative; z-index: 30; }
.has-sticky-header .top { position: sticky; top: 0; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px 28px; min-height: 72px; }
.logo { text-decoration: none; display: grid; }
.logo b { font-family: var(--serif); font-size: 1.85rem; line-height: 1.05; color: var(--accent); }
.logo span { font-size: 0.78rem; color: var(--soft); margin-top: 3px; max-width: 34ch; }
.custom-logo { max-height: 56px; width: auto; }
.nav { display: flex; align-items: center; gap: 18px; }
.nav .menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.nav .menu a { display: block; text-decoration: none; font-weight: 600; font-size: 0.95rem; padding: 8px 14px; border-radius: 99px; }
.nav .menu a:hover { background: var(--accent-soft); color: var(--accent); }
.nav .menu .current-menu-item > a, .nav .menu .current-category-ancestor > a { background: var(--accent); color: #fff; }
.search input { width: 190px; font: inherit; font-size: 0.92rem; padding: 8px 14px; border: 1px solid var(--line); border-radius: 99px; background: var(--bg); color: var(--ink); }
.search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.nav-button { display: none; }

@media (max-width: 900px) {
	.nav-button { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; cursor: pointer; background: var(--accent-soft); }
	.nav-button span, .nav-button span::before, .nav-button span::after { display: block; width: 20px; height: 2px; background: var(--accent); border-radius: 2px; position: relative; transition: transform 0.2s, background 0.2s; }
	.nav-button span::before, .nav-button span::after { content: ''; position: absolute; left: 0; }
	.nav-button span::before { top: -6px; }
	.nav-button span::after { top: 6px; }
	.nav-toggle:checked + .nav-button span { background: transparent; }
	.nav-toggle:checked + .nav-button span::before { transform: translateY(6px) rotate(45deg); }
	.nav-toggle:checked + .nav-button span::after { transform: translateY(-6px) rotate(-45deg); }
	.nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 12px; padding: 12px 16px 20px; background: var(--card); border-bottom: 1px solid var(--line); box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08); }
	.nav-toggle:checked ~ .nav { display: flex; }
	.nav .menu { flex-direction: column; }
	.nav .menu a { padding: 12px 14px; border-radius: 10px; font-size: 1.05rem; }
	.search input { width: 100%; padding: 12px 16px; }
}

/* ---------- Carduri ---------- */
.card { position: relative; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 6px 20px rgba(60, 30, 20, 0.06); display: flex; flex-direction: column; transition: transform 0.18s, box-shadow 0.18s; }
.card:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06), 0 14px 32px rgba(60, 30, 20, 0.12); }
.card .pic { aspect-ratio: 3 / 2; background: var(--accent-soft); overflow: hidden; }
.card .pic img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.card:hover .pic img { transform: scale(1.04); }
.pic-empty { display: grid; place-items: center; height: 100%; font-family: var(--serif); font-size: 4rem; color: var(--accent); opacity: 0.5; }
.card .txt { padding: 16px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.card .title { font-family: var(--serif); font-size: 1.28rem; line-height: 1.25; margin: 8px 0 8px; }
.card .title a { text-decoration: none; }
.card .title a::after { content: ''; position: absolute; inset: 0; z-index: 1; }
.card:hover .title a { color: var(--accent); }
.card .excerpt { margin: 0 0 12px; color: var(--soft); font-size: 0.95rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .meta { margin-top: auto; margin-bottom: 0; }
.card .cat { position: relative; z-index: 2; }
.card.big { display: grid; grid-template-columns: 1.25fr 1fr; margin-top: 32px; }
.card.big .pic { aspect-ratio: auto; min-height: 340px; }
.card.big .txt { padding: 36px; justify-content: center; }
.card.big .title { font-size: clamp(1.8rem, 3.4vw, 2.5rem); line-height: 1.15; margin: 10px 0 14px; }
.card.big .excerpt { font-size: 1.05rem; -webkit-line-clamp: 4; }
.card.big .read { margin-top: 18px; align-self: flex-start; background: var(--accent); color: #fff; font-weight: 700; font-size: 0.92rem; padding: 10px 18px; border-radius: 99px; }
.cat { align-self: flex-start; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; color: var(--accent); }
.meta { font-size: 0.85rem; color: var(--soft); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; margin-bottom: 24px; }
.card-ad { box-shadow: none; background: transparent; justify-content: center; }
.card-ad:hover { transform: none; box-shadow: none; }
.section { font-family: var(--serif); font-size: 1.7rem; margin: 48px 0 20px; display: flex; align-items: center; gap: 14px; }
.section::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.popular .grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.popular .card .excerpt { display: none; }
.page-head { padding: 40px 0 8px; }
.page-head h1 { font-family: var(--serif); font-size: clamp(2rem, 5vw, 2.8rem); margin: 0 0 8px; }
.page-head p { color: var(--soft); margin: 0 0 24px; }

.pagination { margin: 8px 0 24px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.pagination .page-numbers { display: inline-block; min-width: 44px; padding: 10px 14px; text-align: center; border-radius: 99px; background: var(--card); border: 1px solid var(--line); text-decoration: none; font-weight: 600; }
.pagination .current { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- Poveste ---------- */
.story { max-width: 700px; margin: 0 auto; padding: 40px 16px 0; }
.story header { margin-bottom: 24px; }
.labels { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin: 0; }
.fiction { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--soft); border: 1px solid var(--line); border-radius: 99px; padding: 2px 10px; }
.story h1 { font-family: var(--serif); font-size: clamp(2rem, 6vw, 2.9rem); line-height: 1.13; margin: 14px 0 14px; }
.story .lead { font-family: var(--serif); font-size: 1.25rem; line-height: 1.5; color: var(--soft); margin: 0 0 14px; }
.hero { margin: 0 0 8px; }
.hero img { width: 100%; border-radius: 12px; }
.hero figcaption { font-size: 0.78rem; color: var(--soft); margin-top: 8px; }
.text { font-family: var(--serif); font-size: 1.2rem; line-height: 1.8; overflow-wrap: break-word; }
.text p { margin: 0 0 1.15em; }
.story:not(.page) .text > p:first-child::first-letter { float: left; font-size: 3.6em; line-height: 0.85; padding: 6px 10px 0 0; color: var(--accent); font-weight: 700; }
.text h2 { font-size: 1.5rem; margin: 36px 0 12px; }
.text h3 { font-size: 1.25rem; margin: 28px 0 10px; }
.text ul, .text ol { padding-left: 24px; }
.text a { color: var(--accent); }
.text img, .text figure { margin: 1.4em 0; }
.text figure img { border-radius: 10px; }
.text figcaption, .wp-caption-text { font-family: var(--sans); font-size: 0.8rem; color: var(--soft); margin-top: 6px; }
.text blockquote { margin: 1.4em 0; padding-left: 18px; border-left: 3px solid var(--accent); font-style: italic; }
.aligncenter { margin-left: auto; margin-right: auto; }
.page .text { font-size: 1.1rem; }
.end { text-align: center; font-size: 1.8rem; color: var(--accent); margin: 28px 0 10px; }
.note { font-size: 0.85rem; color: var(--soft); text-align: center; margin: 0 0 8px; }
.more { margin-top: 24px; }

/* ---------- Reclame ---------- */
.ad { margin: 30px 0; text-align: center; clear: both; }
.ad-label { display: block; font-family: var(--sans); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--soft); margin-bottom: 6px; }
/* Spațiu rezervat, ca textul să nu sară când se încarcă reclama. */
.ad-display { min-height: 300px; }
.ad-inarticle { min-height: 260px; }
.ad-multiplex { min-height: 420px; }
.ad-feed { min-height: 300px; margin: 0; }
.ad-demo { display: grid; place-content: center; gap: 4px; min-height: inherit; border: 2px dashed var(--accent); border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-family: var(--sans); font-weight: 700; font-size: 0.95rem; padding: 16px; }
.ad-demo small { font-weight: 400; }
.ad > .ad-demo { min-height: 200px; }

/* ---------- Subsol ---------- */
.bottom { margin-top: 72px; background: var(--footer); color: var(--footer-ink); padding: 48px 0 24px; font-size: 0.95rem; }
.bottom .cols { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: 32px; }
.bottom .logo b { color: #fff; }
.bottom p { margin: 12px 0 0; opacity: 0.8; }
.bottom h2 { font-family: var(--sans); font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; margin: 6px 0 14px; color: #fff; opacity: 0.6; }
.bottom .links { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.bottom .links a { text-decoration: none; opacity: 0.9; }
.bottom .links a:hover { opacity: 1; text-decoration: underline; }
.social { display: flex; gap: 10px; margin-top: 18px; }
.social a { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: rgba(255, 255, 255, 0.08); color: #fff; }
.social a:hover { background: var(--accent); }
.bottom .legal { margin-top: 36px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, 0.12); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; font-size: 0.82rem; }
.bottom .legal p { margin: 0; opacity: 0.6; }
.bottom .legal a { color: inherit; }

@media (max-width: 900px) {
	.bottom .cols { grid-template-columns: 1fr 1fr; }
	.bottom .col-about { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
	.card.big { grid-template-columns: 1fr; margin-top: 20px; }
	.card.big .pic { min-height: 0; aspect-ratio: 3 / 2; }
	.card.big .txt { padding: 20px; }
	.text { font-size: 1.12rem; }
	.section { font-size: 1.45rem; margin-top: 36px; }
}
@media (max-width: 480px) {
	.bottom .cols { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
	.card, .card .pic img { transition: none; }
	.card:hover, .card:hover .pic img { transform: none; }
}
