/*
Theme Name: Roma
Theme URI: https://toddanderson.eu
Author: Todd Anderson
Description: Lekki motyw w tonacji rycin Leonarda. Strona główna to izometryczny plan Rzymu, który rośnie z każdym wpisem.
Version: 1.0.0
Requires at least: 6.5
Requires PHP: 8.1
License: GNU General Public License v2 or later
Text Domain: roma
*/

:root {
	--parch: #F1E6CC;
	--parch-2: #E6D5AE;
	--parch-3: #EDE0C2;
	--ink: #2E2116;
	--ink-2: #4A3826;
	--sepia: #6B4A2B;
	--line: #B89A6E;
	--line-soft: #D6C29A;
	--sanguine: #9E3B22;
	--sanguine-dark: #6E2614;
	--wash: #9FB0A2;
	--serif-display: 'EB Garamond', 'Iowan Old Style', Georgia, serif;
	--serif: 'EB Garamond', 'Iowan Old Style', Georgia, serif;
	--serif-caps: 'Cinzel', 'Trajan Pro', 'Times New Roman', Georgia, serif;
	--wrap: 1240px;
	--gutter: clamp(16px, 4vw, 32px);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
	margin: 0;
	background: var(--parch);
	color: var(--ink);
	font-family: var(--serif);
	font-size: 19px;
	line-height: 1.6;
	text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; height: auto; }

a { color: var(--sanguine); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--sanguine-dark); }
:focus-visible { outline: 2px solid var(--sanguine); outline-offset: 3px; }

.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
.skip-link:focus {
	clip: auto; width: auto; height: auto; z-index: 100; top: 8px; left: 8px;
	padding: 10px 16px; background: var(--ink); color: var(--parch);
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding-inline: var(--gutter); }

h1, h2, h3, h4 { font-family: var(--serif-display); font-weight: 500; line-height: 1.1; color: var(--ink); }
h2 { font-family: var(--serif-caps); font-weight: 600; letter-spacing: .025em; line-height: 1.16; }

.eyebrow { margin: 0 0 14px; font-style: italic; color: var(--sanguine); font-size: 18px; letter-spacing: .04em; }
.kicker { margin: 0; font-size: 15px; letter-spacing: .08em; color: var(--sanguine); text-transform: uppercase; }

/* Nagłówek */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap {
	display: flex; flex-wrap: wrap; gap: 8px 40px; align-items: center; justify-content: space-between;
	padding-block: 18px;
}
.brand { display: flex; align-items: baseline; gap: 14px; color: var(--ink); text-decoration: none; }
.brand__name { font-family: var(--serif-display); font-weight: 600; font-size: 28px; letter-spacing: .18em; }
.brand__motto { font-style: italic; font-size: 16px; color: var(--sepia); }
.site-header .brand { flex-direction: column; align-items: center; gap: 3px; }
.site-header .brand__name { display: inline-flex; align-items: center; gap: 12px; font-family: var(--serif-caps); font-weight: 600; font-size: 23px; letter-spacing: .13em; text-transform: uppercase; line-height: 1; }
.brand__sprig { height: 30px; width: auto; display: block; }
.brand__sprig .s-stem { fill: none; stroke: var(--sepia); stroke-width: 1.5; stroke-linecap: round; }
.brand__sprig .s-leaf path { fill: var(--sepia); }
.brand__sprig .s-olive circle { fill: var(--sanguine); }
.brand__motto { display: inline-flex; align-items: center; gap: 10px; font-family: var(--serif); font-style: italic; font-size: 14px; color: var(--sepia); letter-spacing: .02em; margin-top: 2px; }
.brand__rule { width: 30px; height: 1px; background: var(--line); display: inline-block; }
.contact { margin-top: 20px; }
.contact__link { display: inline-flex; align-items: center; gap: 10px; font-family: var(--serif-caps); font-size: 15px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink); text-decoration: none; padding: 11px 20px; border: 1px solid var(--line); border-radius: 2px; transition: color .15s, border-color .15s; }
.contact__link:hover { color: var(--sanguine); border-color: var(--sanguine); }
.contact__icon { display: inline-flex; color: var(--sanguine); }
.biblio { margin-top: 4px; }
.bf-radio { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.bf-search { display: block; width: 100%; max-width: 440px; padding: 11px 16px; margin: 0 0 22px; font-family: var(--serif); font-size: 16px; color: var(--ink); background: rgba(255,255,255,.3); border: 1px solid var(--line); border-radius: 2px; }
.bf-search:focus { outline: none; border-color: var(--sanguine); }
.bf-search::placeholder { color: var(--sepia); }
.bf-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 32px; }
.bf-tabs label { cursor: pointer; font-family: var(--serif-caps); font-size: 13px; letter-spacing: .06em; text-transform: uppercase; padding: 8px 15px; border: 1px solid var(--line); border-radius: 2px; color: var(--sepia); transition: color .15s, border-color .15s, background-color .15s; }
.bf-tabs label:hover { color: var(--ink); border-color: var(--sepia); }
#bf-all:checked ~ .bf-tabs label[for="bf-all"],
#bf-prawo:checked ~ .bf-tabs label[for="bf-prawo"],
#bf-panstwo:checked ~ .bf-tabs label[for="bf-panstwo"],
#bf-wojna:checked ~ .bf-tabs label[for="bf-wojna"],
#bf-etyka:checked ~ .bf-tabs label[for="bf-etyka"],
#bf-czas:checked ~ .bf-tabs label[for="bf-czas"] { color: #F2E8CE; background: var(--sanguine); border-color: var(--sanguine); }
#bf-prawo:checked ~ .bf-groups .pgroup:not([data-cat="prawo"]),
#bf-panstwo:checked ~ .bf-groups .pgroup:not([data-cat="panstwo"]),
#bf-wojna:checked ~ .bf-groups .pgroup:not([data-cat="wojna"]),
#bf-etyka:checked ~ .bf-groups .pgroup:not([data-cat="etyka"]),
#bf-czas:checked ~ .bf-groups .pgroup:not([data-cat="czas"]) { display: none; }
.pgroup { margin: 0 0 44px; }
.pgroup__title { font-family: var(--serif-caps); font-size: 20px; letter-spacing: .02em; margin: 0 0 18px; color: var(--ink); }
.pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 16px; }
.pcard { border: 1px solid var(--line); border-radius: 3px; padding: 18px 20px; background: rgba(255,255,255,.22); display: flex; flex-direction: column; transition: border-color .15s; }
.pcard:hover { border-color: var(--sanguine); }
.pcard__lat { font-family: var(--serif-caps); text-transform: uppercase; font-weight: 600; font-size: 15px; letter-spacing: .02em; line-height: 1.3; color: var(--ink); margin: 0 0 10px; }
.pcard__body { margin: 0; color: var(--ink-2); font-size: 15px; line-height: 1.5; }
.pcard__ctx { margin: 10px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--sepia); }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 28px; }
.site-nav a { display: block; padding: 10px 0; color: var(--ink); text-decoration: none; font-family: var(--serif-caps); font-size: 15px; letter-spacing: .08em; }
.site-nav a:hover, .site-nav .current-menu-item:not(.menu-item-type-custom) > a { color: var(--sanguine); }

/* Hero */
.hero {
	display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
	gap: 28px 64px; align-items: end; padding-block: 64px 36px;
}
.hero h1 { font-family: var(--serif-caps); text-transform: uppercase; font-weight: 600; margin: 0; font-size: clamp(32px, 4.4vw, 56px); line-height: 1.14; letter-spacing: .015em; }
.hero p { margin: 0; max-width: 520px; color: var(--ink-2); }
.tally { display: flex; flex-wrap: wrap; gap: 10px 32px; margin-top: 20px; font-size: 16px; color: var(--sepia); }
.tally strong { font-family: var(--serif-caps); font-size: 26px; font-weight: 600; color: var(--ink); margin-right: 4px; }
.tally .is-stage strong { color: var(--sanguine); }

/* Plan miasta */
.urbs { position: relative; margin: 0; border: 1px solid var(--line); background: var(--parch-3); padding: 12px; }
.tabula .t-link { cursor: pointer; }
.urbs-tip { position: absolute; z-index: 5; pointer-events: none; max-width: 260px; padding: 8px 12px; background: var(--parch); border: 1px solid var(--ink); box-shadow: 0 6px 18px rgba(46, 33, 22, .25); display: flex; flex-direction: column; gap: 1px; }
.urbs-tip[hidden] { display: none; }
.urbs-tip__k { font-family: var(--serif-caps); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--sepia); }
.urbs-tip__k:empty { display: none; }
.urbs-tip__t { font-family: var(--serif-display); font-size: 17px; line-height: 1.2; color: var(--ink); }
.urbs-tip__cue { margin-top: 3px; font-size: 13px; color: var(--sanguine); }
.tabula { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: var(--parch-2); }
.tabula .t-link image { filter: drop-shadow(0 2px 2.5px rgba(46, 33, 22, .55)) drop-shadow(0 0 1.1px rgba(245, 236, 214, .98)) drop-shadow(0 0 1.1px rgba(245, 236, 214, .98)) saturate(1.1) contrast(1.06); transition: filter .15s ease, transform .15s ease; transform-box: fill-box; transform-origin: 50% 80%; }
.tabula .t-link:hover image, .tabula .t-link:focus-visible image {
	filter: drop-shadow(0 0 2px var(--sanguine)) brightness(1.06);
	transform: translateY(-2px);
}
.tabula .t-link:focus-visible { outline: none; }
.tabula .t-wall { fill: none; stroke: var(--sepia); stroke-width: 2.4; stroke-dasharray: 8 3; opacity: .75; }
.tabula .t-wall--aurelian { stroke: var(--ink); stroke-width: 3; stroke-dasharray: none; opacity: .6; }
.tabula .t-flag line { stroke: var(--ink); stroke-width: 1.2; }
.tabula .t-flag path { fill: var(--sanguine); }
.tabula .t-label { font-family: var(--serif-display); font-style: italic; font-weight: 600; font-size: 16px; fill: var(--ink); paint-order: stroke; stroke: rgba(243, 233, 210, .95); stroke-width: 4px; stroke-linejoin: round; }
.tabula .t-regio { font-family: var(--serif); font-style: normal; font-size: 11px; letter-spacing: .06em; fill: #8A2E16; paint-order: stroke; stroke: rgba(243, 233, 210, .95); stroke-width: 3.4px; stroke-linejoin: round; }
.tabula .t-caps { font-family: var(--serif-caps); font-size: 11px; letter-spacing: .18em; fill: var(--ink); paint-order: stroke; stroke: rgba(243, 233, 210, .95); stroke-width: 3.6px; stroke-linejoin: round; }
.tabula .t-river-name { font-family: var(--serif-display); font-style: italic; font-size: 22px; fill: #38503F; paint-order: stroke; stroke: rgba(243, 233, 210, .8); stroke-width: 3.6px; stroke-linejoin: round; }
.tabula--stage-1 .t-label { font-size: 11px; } .tabula--stage-1 .t-regio { font-size: 8px; } .tabula--stage-1 .t-caps { font-size: 7px; }
.tabula--stage-2 .t-label { font-size: 15px; } .tabula--stage-2 .t-regio { font-size: 10.5px; } .tabula--stage-2 .t-caps { font-size: 10px; }
.tabula--stage-3 .t-label { font-size: 16px; } .tabula--stage-3 .t-regio { font-size: 11px; } .tabula--stage-3 .t-caps { font-size: 11px; }
.tabula--stage-5 .t-label { font-size: 20px; } .tabula--stage-5 .t-regio { font-size: 14px; } .tabula--stage-5 .t-caps { font-size: 13px; }

.urbs figcaption {
	display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 32px;
	padding: 12px 4px 4px; font-size: 16px; color: var(--ink-2);
}
.urbs figcaption em { color: var(--ink-2); }
.urbs figcaption strong { color: var(--sanguine); font-weight: 500; }
.progress { height: 6px; background: #E0CDA4; margin: 8px 4px 4px; }
.progress span { display: block; height: 100%; background: var(--sanguine); }

/* Sekcje */
.section { padding-block: 88px 24px; }
.section__head {
	display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 12px;
	border-bottom: 1px solid var(--line); padding-bottom: 14px; margin-bottom: 32px;
}
.section__head h2, .section > .wrap > h2 { margin: 0; font-size: clamp(25px, 3.1vw, 35px); }
.lead { color: var(--ink-2); max-width: none; margin: 8px 0 32px; }

/* Karty wpisów */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 40px 32px; }
.card { display: flex; flex-direction: column; gap: 10px; }
.card__img { display: block; aspect-ratio: 4 / 3; border: 1px solid var(--line); background: var(--parch-2); overflow: hidden; }
.card__img img { width: 100%; height: 100%; object-fit: cover; filter: sepia(.35) contrast(.95); transition: filter .2s; }
.card:hover .card__img img { filter: none; }
.card__img--empty { display: flex; align-items: center; justify-content: center; }
.card__img--empty img { width: 52%; height: 78%; object-fit: contain; filter: none; transition: transform .25s ease; }
.card:hover .card__img--empty img { transform: translateY(-4px) scale(1.03); }
.card h3 { margin: 0; font-weight: 600; font-size: 28px; line-height: 1.15; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a:hover { color: var(--sanguine); }
.card p { margin: 0; color: var(--ink-2); font-size: 17px; }

/* Etapy */
.stages { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 0 20px; border-top: 1px solid var(--line); }
.stages li { padding: 20px 20px 20px 0; border-bottom: 1px solid var(--line-soft); }
.stages .num { margin: 0; font-family: var(--serif-caps); font-size: 30px; color: var(--line); line-height: 1.2; }
.stages .is-done .num, .stages .is-now .num { color: var(--sanguine); }
.stages .name { margin: 0; font-weight: 500; }
.stages .range { margin: 0; font-size: 16px; color: var(--sepia); }
.stages .stage-thumb { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border: 1px solid var(--line); margin-bottom: 10px; filter: sepia(.25) saturate(.8); opacity: .75; }
.stages .is-now .stage-thumb, .stages .is-done .stage-thumb { filter: none; opacity: 1; }
.stages .is-now .stage-thumb { outline: 2px solid var(--sanguine); outline-offset: 2px; }
.stages .era { margin: 4px 0 0; font-size: 15px; font-style: italic; color: var(--ink-2); }
.stages .is-now .name::after { content: ' · teraz'; font-style: italic; color: var(--sanguine); font-weight: 400; }
.stages .stage-link { display: block; color: inherit; text-decoration: none; }
.stages .stage-link:hover .name { color: var(--sanguine); }
.stages .stage-link:hover .stage-thumb { opacity: 1; filter: none; }

/* Regiones */
.regiones { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 0 32px; }
.regiones li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.regiones a { color: var(--ink); text-decoration: none; }
.regiones a:hover { color: var(--sanguine); }
.regiones em { color: var(--sepia); }

/* Wpis */
.entry { max-width: 900px; margin: 0 auto; padding-block: 56px 32px; }
.entry__title { margin: 0 0 12px; font-size: clamp(40px, 5.5vw, 64px); line-height: 1.04; }
.entry__meta { color: var(--sepia); font-size: 16px; margin: 0 0 32px; }
.entry__hero { margin: 0 0 36px; border: 1px solid var(--line); }
.entry__hero img { display: block; width: 100%; }
.entry-content > * { margin-block: 0 1.1em; }
.entry-content h2 { font-size: 27px; margin-top: 1.6em; }
.entry-content h3 { font-size: 28px; margin-top: 1.4em; }
.entry-content blockquote { margin-inline: 0; padding-left: 24px; border-left: 2px solid var(--sanguine); font-style: italic; color: var(--ink-2); }
.entry-content img { border: 1px solid var(--line); }
.entry-content figcaption { font-size: 15px; font-style: italic; color: var(--sepia); }
.entry-content hr { border: 0; border-top: 1px solid var(--line); margin-block: 2em; }
.entry-content .alignwide { max-width: 1040px; margin-inline: auto; }
.entry-content .alignfull { width: 100vw; margin-inline: calc(50% - 50vw); }

.entry__place { max-width: 1040px; margin: 24px auto 0; padding-inline: var(--gutter); }
.entry__place h2 { font-size: 23px; margin: 0 0 14px; }

.post-nav { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; max-width: 900px; margin: 40px auto 0; padding: 24px var(--gutter) 0; border-top: 1px solid var(--line); font-size: 17px; }
.related { max-width: 900px; margin: 56px auto 0; padding-inline: var(--gutter); }
.related h2 { font-size: 24px; margin: 0 0 18px; }
.related__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 16px; }
.related__list a { display: block; height: 100%; padding: 16px 18px; border: 1px solid var(--line); border-radius: 2px; text-decoration: none; color: var(--ink); transition: border-color .15s; }
.related__list a:hover { border-color: var(--sanguine); }
.related__title { display: block; font-family: var(--serif-display); font-size: 18px; line-height: 1.25; }
.related__cat { display: block; margin-top: 8px; font-family: var(--serif-caps); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--sanguine); }

.pagination { margin-top: 48px; display: flex; gap: 16px; flex-wrap: wrap; }
.pagination .page-numbers { padding: 8px 12px; border: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.pagination .current { background: var(--ink); color: var(--parch); border-color: var(--ink); }

.archive-head { padding-block: 56px 8px; }
.archive-head h1 { margin: 0; font-size: clamp(40px, 5.5vw, 64px); }

/* Stopka */
.site-footer { border-top: 1px solid var(--line); margin-top: 96px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px; padding-block: 32px; font-size: 16px; color: var(--sepia); }
.site-footer .brand__name { font-family: var(--serif-caps); font-size: 16px; letter-spacing: .08em; color: var(--ink); }
.site-footer a { color: var(--sepia); text-decoration: none; border-bottom: 1px solid var(--line); }
.site-footer a:hover { color: var(--sanguine); border-color: var(--sanguine); }

@media (max-width: 600px) {
	body { font-size: 18px; }
	.brand { flex-wrap: wrap; gap: 2px 10px; }
	.brand__name { font-size: 21px; letter-spacing: .12em; }
	.site-header .brand__name { font-size: 18px; letter-spacing: .1em; gap: 9px; }
	.brand__sprig { height: 24px; }
	.site-nav ul { gap: 0 20px; }
	.hero { padding-block: 40px 24px; }
	.urbs { padding: 6px; margin-inline: calc(var(--gutter) * -1 + 4px); }
	.tabula { aspect-ratio: 4 / 3; }
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.tabula .t-link image, .card__img img { transition: none; }
}

/* Baner zgody na cookies */
.cookie { position: fixed; inset-inline: 0; bottom: 0; z-index: 1000; background: var(--parch); border-top: 2px solid var(--ink); box-shadow: 0 -6px 24px rgba(46, 33, 22, .12); }
.cookie[hidden] { display: none; }
.cookie__in { max-width: 1100px; margin-inline: auto; padding: 18px var(--gutter); display: flex; align-items: center; justify-content: space-between; gap: 16px 28px; flex-wrap: wrap; }
.cookie__txt { margin: 0; font-size: 16px; line-height: 1.5; color: var(--ink); max-width: 68ch; }
.cookie__txt a { color: var(--sepia); }
.cookie__btns { display: flex; gap: 12px; flex-shrink: 0; }
.cookie__btn { font-family: var(--serif-caps); font-size: 14px; letter-spacing: .08em; text-transform: uppercase; padding: 10px 20px; border: 1px solid var(--ink); background: transparent; color: var(--ink); cursor: pointer; transition: background .15s, color .15s; }
.cookie__btn--yes { background: var(--ink); color: var(--parch); }
.cookie__btn--yes:hover { background: var(--sanguine); border-color: var(--sanguine); }
.cookie__btn--no:hover { background: var(--ink); color: var(--parch); }
@media (max-width: 600px) {
	.cookie__in { padding: 14px var(--gutter); }
	.cookie__btns { width: 100%; }
	.cookie__btn { flex: 1; text-align: center; }
}

/* Ewolucja rzymskiego domu */
.domus-evo { margin-block: 24px 8px; }
.devo-intro { max-width: 68ch; font-size: 19px; color: var(--ink-2); margin-bottom: 8px; }
.devo-step { display: grid; grid-template-columns: 320px 1fr; gap: 24px 40px; padding-block: 36px; border-top: 1px solid var(--line); align-items: center; }
.devo-step:first-of-type { border-top: none; }
.devo-fig { margin: 0; text-align: center; }
.devo-fig img { max-width: 100%; height: auto; filter: drop-shadow(0 3px 5px rgba(46, 33, 22, .18)); }
.devo-cap { font-family: var(--serif-caps); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--sepia); margin-top: 8px; }
.devo-era { display: flex; align-items: center; gap: 16px; margin: 0 0 10px; }
.devo-num { font-family: var(--serif-caps); font-size: 34px; line-height: 1; color: var(--sanguine); }
.devo-head { display: flex; flex-direction: column; }
.devo-head strong { font-family: var(--serif-display); font-weight: 600; font-size: clamp(22px, 3vw, 30px); color: var(--ink); }
.devo-stage { font-style: italic; font-size: 15px; color: var(--sepia); }
.devo-body p:not(.devo-era) { margin: .5em 0; }
.devo-sources { margin-top: 36px; padding: 22px 26px; background: var(--parch-3); border: 1px solid var(--line); }
.devo-sources h2 { font-family: var(--serif-caps); font-size: 17px; letter-spacing: .06em; margin: 0 0 10px; }
.devo-sources p { font-size: 15px; color: var(--ink-2); margin: .4em 0; }
@media (max-width: 680px) {
	.devo-step { grid-template-columns: 1fr; gap: 16px; padding-block: 28px; }
	.devo-fig { max-width: 300px; margin-inline: auto; }
}
