/*
Theme Name: Arora
Description: Block theme for a Slovak register of industrial and investment projects: cool grey ground, white cards, one kiln-red accent. Bricolage Grotesque and Noticia Text ship inside the theme.
Text Domain: arora
Requires at least: 7.0
Requires PHP: 8.1
Version: 0.1.15
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Update URI: false
*/

/* Aliases for the design tokens (--arora-*) over the theme.json presets; the values live only in theme.json. */
:root {
	--arora-mill-grey: var(--wp--preset--color--mill-grey);
	--arora-clean-sheet: var(--wp--preset--color--clean-sheet);
	--arora-rack-grey: var(--wp--preset--color--rack-grey);
	--arora-coke-black: var(--wp--preset--color--coke-black);
	--arora-tool-grey: var(--wp--preset--color--tool-grey);
	--arora-weld-seam: var(--wp--preset--color--weld-seam);
	--arora-kiln-brick: var(--wp--preset--color--kiln-brick);
	--arora-fired-brick: var(--wp--preset--color--fired-brick);
	--arora-arc-blue: var(--wp--preset--color--arc-blue);
	--arora-measure: var(--wp--custom--measure);
	--arora-radius: var(--wp--custom--radius);
}

/* Root gutter: 18 px on a phone, 36 px from 1024 px. WordPress declares these variables on body, so they are overridden on body too ("html body" keeps the win independent of stylesheet order). */
@media (min-width: 64rem) {
	html body { --wp--style--root--padding-left: var(--wp--preset--spacing--unit-5); --wp--style--root--padding-right: var(--wp--preset--spacing--unit-5); }
}

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { overflow-wrap: break-word; }
img { height: auto; max-width: 100%; }
a { text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
h1, .wp-block-post-title { text-wrap: balance; }
/* List items are never direct children of a constrained container, so a measure here cannot fight core's margin auto. Grid cards are the exception: post-template renders them as li, and a measure would leave a gap on the right edge of the wide column. */
:not(.wp-block-post-template) > li { max-width: var(--arora-measure); }

/* Masthead: a hairline under the site title and the main menu. A wide band (stage ladder) pads its own sides, the full-width footer band takes the root gutter. */
.wp-block-group.arora-masthead { border-bottom: var(--wp--custom--line) solid var(--arora-weld-seam); padding-block: var(--wp--preset--spacing--unit-3); }
.wp-block-group.arora-band.alignwide { padding-inline: var(--wp--preset--spacing--unit-4); }

/* Masthead bar: the brand lockup is 30 px tall under 768 px and 40 px from 768 px; the search button sits in the bar from 768 px, under that the search is the sixth cell of the rubric grid (core+navigation.css). */
.wp-block-group.arora-masthead__brand { min-block-size: 30px; align-items: center; }
.wp-block-group.arora-masthead__menu { flex: 1 1 100%; }
.wp-block-buttons.arora-masthead__search { display: none; }
@media (width < 600px) {
	/* Phone: one row of at most 64 px (a 56 px bar between two hairline-free edges, the line under it is 1 px). The rubrics sit behind the menu button of the core navigation (overlay, core+navigation.css). */
	.wp-block-group.arora-masthead { padding-block: 0; }
	.wp-block-group.arora-masthead__bar { flex-wrap: nowrap; min-block-size: 56px; gap: var(--wp--preset--spacing--unit-2); }
	.wp-block-group.arora-masthead__brand { min-inline-size: 0; }
	.wp-block-group.arora-masthead__menu { flex: 0 0 auto; }
}
@media (width >= 768px) {
	.wp-block-group.arora-masthead__brand { min-block-size: 40px; }
	.wp-block-group.arora-masthead__menu { flex: 1 1 100%; order: 3; }
	.wp-block-buttons.arora-masthead__search { display: flex; }
}

/* Masthead is a white strip (design-system 8.1); the footer band carries a 3 px coke-black line on top (8.14). */
.wp-block-group.arora-masthead { background: var(--arora-clean-sheet); }
.wp-block-group.arora-band { border-block-start: var(--wp--custom--stage-line) solid var(--arora-coke-black); }

/* Lockup (design-system 7.5): the mark is a decorative ::before of the site-title link, the name stays text. The url lives here because block CSS is inlined and loses relative paths; it is relative to this file. Mark 24 px under 768 px and 32 px from 768 px (the 40/30 px lockup), gap 9/12 px, the link is a 44 px target. */
.arora-masthead__brand .wp-block-site-title a { box-sizing: border-box; display: inline-block; min-block-size: 44px; padding-block: 0.5rem; padding-block: calc((44px - 1lh) / 2); padding-inline-start: calc(24px + var(--wp--preset--spacing--unit-2) * 0.75); position: relative; }
.arora-masthead__brand .wp-block-site-title a::before { content: ""; position: absolute; inset-inline-start: 0; inset-block-start: 50%; translate: 0 -50%; inline-size: 24px; block-size: 24px; background: url("assets/brand/stitok.svg") center / contain no-repeat; }
@media (width >= 768px) {
	.arora-masthead__brand .wp-block-site-title a { padding-inline-start: calc(32px + var(--wp--preset--spacing--unit-2)); }
	.arora-masthead__brand .wp-block-site-title a::before { inline-size: 32px; block-size: 32px; }
}

/* List head: title, term description or search box above a feed, closed by a hairline. */
.wp-block-group.arora-list-head { border-bottom: var(--wp--custom--line) solid var(--arora-weld-seam); padding-bottom: var(--wp--preset--spacing--unit-4); }

/* Project card: the plate and the plaque live in the group and paragraph sheets; labels are small muted Bricolage text. */
p.arora-label { color: var(--arora-tool-grey); font-family: var(--wp--preset--font-family--bricolage-grotesque); font-size: var(--wp--preset--font-size--grade-a); font-weight: 600; }
.wp-block-group.arora-page-stamp { gap: var(--wp--preset--spacing--unit-2); align-items: baseline; }

/* Navigation targets: 44 px tall, links and the mobile menu buttons. */
.wp-block-navigation .wp-block-navigation-item__content { box-sizing: border-box; display: inline-block; min-block-size: 44px; padding-block: 0.5rem; padding-block: calc((44px - 1lh) / 2); }
.wp-block-navigation__responsive-container-open, .wp-block-navigation__responsive-container-close { min-block-size: 44px; min-inline-size: 44px; }

/* Keyboard focus: arc-blue ring, 2 px wide with a 2 px gap, on every surface. */
:focus-visible { outline: var(--wp--custom--focus--width) solid var(--arora-arc-blue); outline-offset: var(--wp--custom--focus--offset); }
body .skip-link.screen-reader-text:focus { background: var(--arora-coke-black); color: var(--arora-clean-sheet); font-weight: 600; }

/* Figures, dates and counts: Bricolage Grotesque has tabular digits, Noticia Text has not. */
.arora-num { font-family: var(--wp--preset--font-family--bricolage-grotesque); font-variant-numeric: tabular-nums; }
.wp-block-group.arora-dossier .arora-num, .wp-block-group.arora-page-stamp .arora-num { font-size: var(--wp--preset--font-size--grade-a); font-weight: 600; line-height: 1.4; color: var(--arora-coke-black); }

@media (forced-colors: active) {
	.arora-masthead__brand .wp-block-site-title a::before { forced-color-adjust: none; }
	.wp-element-button, .wp-block-button__link, button { border: 1px solid ButtonText; }
}
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Wide desktop (1200 px and up; phone, tablet and the 1024-1199 px laptop keep the 43rem column). The frame is 1128 px at 1200 and 1240 px from 1280.
   Text: the column of <main> grows from 43rem (688 px, 63 ch) to 50rem (800 px, 73 ch at 1440 px), under the 75 ch ceiling; list items follow with the same ceiling. The variable is set on <main>, so the masthead and the footer keep theirs.
   Tables: the content block of an article and the history and register slots take the whole frame, so a table with four or five columns is not squeezed into the text column; paragraphs inside the content block stay in the 50rem column (core centres them).
   Front page: the hero group (a default-layout group, so its children have no 43rem cap and no auto margins to undo) fills the frame, title on the left and descriptor with the button on the right, under a 3 px coke rule (the newspaper rule of the masthead). */
@media (width >= 75rem) {
	main.arora-section { --wp--style--global--content-size: 50rem; }
	:root { --arora-measure: 75ch; }
	.wp-block-post-content.is-layout-constrained, .wp-block-group.arora-history-slot, .wp-block-group.arora-register-slot { max-width: var(--wp--style--global--wide-size); }
	.wp-block-post-content > .wp-block-table { max-width: var(--wp--style--global--wide-size); }
	.wp-block-group.arora-hero { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--wp--preset--spacing--unit-6); align-items: start; max-width: var(--wp--style--global--wide-size); padding-block-start: var(--wp--preset--spacing--unit-4); border-block-start: var(--wp--custom--stage-line) solid var(--arora-coke-black); }
	.wp-block-group.arora-hero > * { grid-column: 2; }
	.wp-block-group.arora-hero > h1 { grid-column: 1; grid-row: 1 / span 2; }
}

/* Short pages: the footer sits at the bottom of the viewport. */
.wp-site-blocks {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

.wp-site-blocks > main {
	flex: 1 0 auto;
}


/* The label of an AI image (mu-plugins/arora-aicaption.php): quiet grey line under the picture, same size as a table caption. */
.wp-block-post-featured-image > figcaption.arora-ai-caption,
.wp-block-image > figcaption.arora-ai-caption {
	color: var(--arora-tool-grey);
	font-size: var(--wp--preset--font-size--grade-a);
	padding-top: var(--wp--preset--spacing--unit-2);
	text-align: left;
}

.wp-element-caption > .arora-ai-caption {
	display: block;
}
