/*
Theme Name: Infotexte
Description: Child theme of Twenty Twenty-Five for infotexte.de: topic register tabs, white reading panel with sidebar, self-hosted Literata and Fira Sans.
Template: twentytwentyfive
Version: 1.0.7
Requires at least: 6.7
Text Domain: infotexte
License: GPL-2.0-or-later
*/

:root {
	--itx-rule: #DDE4DA;
	--itx-radius: 8px;
	--itx-ui: var(--wp--preset--font-family--fira-sans);
}

/* Header, tabs and panel sit flush on each other. */
.wp-site-blocks > * + * { margin-block-start: 0; }
.wp-site-blocks { padding: 0; }

a:focus-visible,
button:focus-visible,
input:focus-visible {
	outline: 3px solid var(--wp--preset--color--petrol);
	outline-offset: 2px;
}
.itx-footer a:focus-visible {
	outline-color: var(--wp--preset--color--marker);
}

/* Masthead */
.itx-masthead { padding-top: clamp(1.25rem, 3vw, 2.25rem); }
.itx-masthead__bar { gap: 1rem 2rem; padding-bottom: 1rem; }
.itx-masthead > .wp-block-navigation { margin-block-start: 0; }
.itx-brand { gap: 0.15rem; }
.itx-masthead .wp-block-site-title { margin: 0; line-height: 1.1; }
.itx-masthead .wp-block-site-title a { color: var(--wp--preset--color--ink); text-decoration: none; }
.itx-masthead .wp-block-site-tagline { margin: 0; max-width: 70ch; }

.itx-search { flex: 0 1 340px; }
.wp-block-search__input {
	border: 1px solid #C3CDC0;
	border-radius: 4px;
	background: var(--wp--preset--color--panel);
	padding: 0.5rem 0.75rem;
	font-family: var(--itx-ui);
}
.wp-block-search__button { margin-left: 0.4rem; padding: 0.5rem 0.9rem; border-radius: 4px; }
.wp-block-search__label { font-family: var(--itx-ui); font-weight: 600; font-size: 1rem; }

/* Register tabs: one tab per main topic, the current topic joins the panel. */
.itx-tabs.wp-block-navigation {
	gap: 3px;
	overflow-x: auto;
	scrollbar-width: thin;
	align-items: flex-end;
	padding-top: 6px;
}
.itx-tabs .wp-block-navigation__container { gap: 3px; flex-wrap: nowrap; align-items: flex-end; }
.itx-tabs .wp-block-navigation-item { flex: 0 0 auto; }
.itx-tabs .wp-block-navigation-item__content {
	display: block;
	padding: 0.5rem 0.72rem 0.45rem;
	background: var(--wp--preset--color--tab);
	border-radius: var(--itx-radius) var(--itx-radius) 0 0;
	border-top: 3px solid transparent;
	color: var(--wp--preset--color--ink);
	text-decoration: none;
	white-space: nowrap;
}
@media (min-width: 782px) {
	.itx-tabs.wp-block-navigation { font-size: 0.875rem; }
}
/* Hint that the tab row scrolls where not all tabs fit. */
@media (max-width: 1240px) {
	.itx-tabs.wp-block-navigation {
		-webkit-mask-image: linear-gradient(to right, #000 calc(100% - 2.5rem), transparent);
		mask-image: linear-gradient(to right, #000 calc(100% - 2.5rem), transparent);
	}
	.itx-tabs .wp-block-navigation__container { padding-right: 2.5rem; }
}
.itx-tabs .wp-block-navigation-item__content:hover { background: #E1E8DE; }
.itx-tabs .current-menu-item > .wp-block-navigation-item__content {
	background: var(--wp--preset--color--panel);
	border-top-color: var(--wp--preset--color--marker);
	color: var(--wp--preset--color--petrol);
	font-weight: 600;
	padding-bottom: 0.6rem;
}

/* Reading panel */
.itx-shell { padding-bottom: clamp(2rem, 5vw, 4rem); }
.itx-columns.wp-block-columns {
	margin-top: 0;
	background: var(--wp--preset--color--panel);
	border-radius: 0 var(--itx-radius) var(--itx-radius) var(--itx-radius);
	padding: clamp(1.25rem, 3.5vw, 3rem);
	gap: clamp(2rem, 4vw, 3.5rem);
}
.itx-main { min-width: 0; }
.itx-page-title { margin-top: 0; margin-bottom: 0.5rem; }

/* Post lists */
.itx-list .wp-block-post-template { margin: 0; padding: 0; }
.itx-entry {
	padding: 1.4rem 0 1.5rem;
	border-bottom: 1px solid var(--itx-rule);
}
.itx-entry > * + * { margin-block-start: 0.5rem; }
.itx-entry__title { margin: 0; font-size: var(--wp--preset--font-size--large); }
.itx-entry__title a { color: var(--wp--preset--color--ink); text-decoration: none; }
.itx-entry__title a:hover { color: var(--wp--preset--color--petrol); text-decoration: underline; text-underline-offset: 0.15em; }
.itx-meta { gap: 0.2rem 1rem; }
.itx-meta a, .itx-kicker a { text-decoration: none; }
.itx-meta a:hover, .itx-kicker a:hover { text-decoration: underline; }
.itx-entry .wp-block-post-excerpt { margin-top: 0.6rem; }
.wp-block-post-excerpt__excerpt { margin: 0; }
.wp-block-post-excerpt__more-text { margin-top: 0.35rem; font-family: var(--itx-ui); font-size: var(--wp--preset--font-size--small); }

.itx-pagination { margin-top: 2rem; gap: 0.4rem; font-size: var(--wp--preset--font-size--small); }
.itx-pagination a,
.itx-pagination .page-numbers {
	display: inline-block;
	min-width: 2.2rem;
	padding: 0.35rem 0.65rem;
	border: 1px solid var(--itx-rule);
	border-radius: 4px;
	text-align: center;
	text-decoration: none;
}
.itx-pagination .page-numbers.current { background: var(--wp--preset--color--ink); border-color: var(--wp--preset--color--ink); color: var(--wp--preset--color--panel); }
.itx-pagination .page-numbers.dots { border: 0; }

/* Single post */
.itx-kicker { margin-bottom: 0.4rem; }
.itx-date { margin-top: 0.4rem; }
.itx-content { margin-top: 1.75rem; max-width: 68ch; }
.itx-content img { max-width: 100%; height: auto; }
.itx-content table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.itx-content td, .itx-content th { padding: 0.35rem 0.6rem; vertical-align: top; }
.itx-content blockquote { margin-left: 0; padding-left: 1.25rem; border-left: 4px solid var(--wp--preset--color--marker); }
.itx-content iframe, .itx-content .wp-block-embed { max-width: 100%; }
.itx-content iframe { width: 100%; height: auto; aspect-ratio: 16 / 9; border: 0; }
.itx-content iframe[height="375"] { aspect-ratio: 4 / 3; }

/* Legacy markup from the old CMS: font tags, forced justification, fixed sizes. */
.itx-content font { font: inherit; color: inherit; }
.itx-content p,
.itx-content div,
.itx-content li { text-align: start; }
.itx-content [width] { max-width: 100%; }

.itx-pages {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.4rem;
	margin: 2rem 0 0;
	font-family: var(--itx-ui);
	font-size: var(--wp--preset--font-size--small);
}
.itx-pages__label { margin-right: 0.4rem; color: var(--wp--preset--color--muted); }
.itx-pages .post-page-numbers {
	display: inline-block;
	min-width: 2.2rem;
	padding: 0.35rem 0.65rem;
	border: 1px solid var(--itx-rule);
	border-radius: 4px;
	text-align: center;
	text-decoration: none;
}
.itx-pages .post-page-numbers.current { background: var(--wp--preset--color--ink); border-color: var(--wp--preset--color--ink); color: var(--wp--preset--color--panel); }

.itx-tags { margin-top: 2rem; color: var(--wp--preset--color--muted); }
.itx-postnav {
	margin-top: 2.5rem;
	padding-top: 1.25rem;
	border-top: 1px solid var(--itx-rule);
	gap: 1rem 2rem;
}
.itx-postnav > * { flex: 1 1 14rem; margin: 0; }
.itx-postnav .post-navigation-link-next { text-align: right; }

/* Sidebar */
.itx-sidebar { font-family: var(--itx-ui); font-size: var(--wp--preset--font-size--small); line-height: 1.5; }
.itx-widget + .itx-widget { margin-top: 2.25rem; }
.itx-widget__title {
	margin: 0 0 0.75rem;
	padding-bottom: 0.4rem;
	border-bottom: 2px solid var(--wp--preset--color--ink);
	font-family: var(--itx-ui);
	font-size: 1rem;
	font-weight: 600;
	letter-spacing: 0;
}
.itx-sidebar ul { list-style: none; margin: 0; padding: 0; }
.itx-sidebar li { margin: 0; padding: 0.3rem 0; }
.itx-sidebar a { text-decoration: none; }
.itx-sidebar a:hover { text-decoration: underline; }
.itx-sidebar .wp-block-latest-posts li { border-bottom: 1px solid var(--itx-rule); padding: 0.5rem 0; }
.itx-cats > li > a { font-weight: 500; color: var(--wp--preset--color--ink); }
.itx-cats > li { padding: 0.55rem 0; border-bottom: 1px solid var(--itx-rule); }
.itx-cats .children { display: flex; flex-wrap: wrap; gap: 0.15rem 0.9rem; margin: 0.3rem 0 0; }
.itx-cats .children li { padding: 0; }
.itx-archive { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1rem; }

/* Footer */
.itx-footer {
	background: var(--wp--preset--color--ink);
	color: #D3DCD0;
	padding-top: 2.5rem;
	padding-bottom: 2.5rem;
	font-family: var(--itx-ui);
	font-size: var(--wp--preset--font-size--small);
}
.itx-footer__inner { gap: 1.5rem 3rem; }
.itx-footer__about { max-width: 52ch; }
.itx-footer__about p { margin: 0 0 0.5rem; }
.itx-footer__name { font-family: var(--wp--preset--font-family--literata); font-size: 1.25rem; font-weight: 700; color: var(--wp--preset--color--panel); }
.itx-footer a { color: var(--wp--preset--color--marker); }
.itx-footer__links { list-style: none; margin: 0; padding: 0; }
.itx-footer__links li { padding: 0.2rem 0; }

@media (max-width: 781px) {
	.itx-masthead__bar { flex-direction: column; align-items: stretch; }
	.itx-search { flex-basis: auto; }
	.itx-columns.wp-block-columns { border-radius: 0; margin-left: -16px; margin-right: -16px; }
	.itx-aside { border-top: 1px solid var(--itx-rule); padding-top: 1.5rem; }
	.itx-postnav .post-navigation-link-next { text-align: left; }
}
.itx-footer .wp-block-site-title a { color: var(--wp--preset--color--panel); text-decoration: none; }
.itx-footer .wp-block-site-tagline { color: #D3DCD0; margin-top: 0.25rem; }
