/*
 * F4.2 — Mobile and tablet layout fixes.
 *
 * Loaded after glosario-child-customizations, so it can neutralize legacy
 * absolute-position / fixed-height / fixed-margin rules that were only ever
 * tuned for desktop widths and never got a mobile/tablet counterpart.
 *
 * Every selector below is scoped to a media query with max-width <= 1024px,
 * so none of it can ever match at 1280px and above: the desktop design
 * stays byte-for-byte identical (verified against `before-*` captures).
 */

/* -----------------------------------------------------------------------
 * 1. Header / site title (logo2), phone + tablet, <= 1024px
 *
 * Root cause: #header-first .logo2 is unconditionally absolutely
 * positioned with a 24% width (css/customizations.css), and the inner h1
 * carries a desktop-only margin-right:106px + padding:0 43px meant to
 * leave room for a right-hand nav next to a wide desktop column. Inside a
 * narrow mobile/tablet column (24% of 390px ~= 94px) that margin+padding
 * alone (192px) is wider than the whole column, so the browser is left
 * with negative available width for the text and wraps the site title one
 * letter per line, inside an absolutely positioned box that is thousands
 * of pixels tall and overlaps every bit of content below it on every
 * inner page (front page is unaffected: it uses .logo, not .logo2, and
 * already has its own working mobile override in style.css).
 * ---------------------------------------------------------------------- */
@media (max-width: 1024px) {
	#header-first .logo2 {
		position: static !important;
		float: none !important;
		width: 100% !important;
		text-align: center !important;
		padding: 10px 0 !important;
	}

	#header-first .logo2 h1,
	#header-first .logo2 h1 a {
		margin-right: 0 !important;
		padding: 0 !important;
	}

	#header-first .logo2 h1 {
		font-size: 2em !important;
		line-height: 1.2 !important;
	}

	/* F6.3: mirrors the two rules above for the inner-page site title, now a
	 * non-heading .site-title element instead of <h1> (see header.php). */
	#header-first .logo2 .site-title,
	#header-first .logo2 .site-title a {
		margin-right: 0 !important;
		padding: 0 !important;
	}

	#header-first .logo2 .site-title {
		font-size: 2em !important;
		line-height: 1.2 !important;
	}
}

/* -----------------------------------------------------------------------
 * 2. Floated / fixed-size boxes and captions, phone + tablet, <= 1024px
 *
 * #alarife, .wp-caption (generic, .contento and #alarife variants) all
 * keep desktop float + percentage width + min-height/max-height rules
 * that style.css's own <= 767px query never fully overrides (the more
 * specific `.contento .wp-caption` / `#alarife .wp-caption` selectors win
 * over the generic `.wp-caption{width:100%!important}` reset), leaving
 * narrow floated, height-clamped image columns on phones and tablets.
 * ---------------------------------------------------------------------- */
@media (max-width: 1024px) {
	#alarife {
		float: none !important;
		width: 100% !important;
		height: auto !important;
	}

	.wp-caption,
	.contento .wp-caption,
	#alarife .wp-caption {
		float: none !important;
		width: 100% !important;
		max-width: 100% !important;
		min-width: 0 !important;
		min-height: 0 !important;
		max-height: none !important;
		margin: 0 auto 15px !important;
		text-align: center !important;
		/* F4.13-C: style.css's 17%-column caption variant (used on
		 * /galeriaimagenes/) keeps its own padding:10px; with the width:100%
		 * reset above and the default content-box model, that padding adds
		 * ~17px on top of 100%, overflowing the phone column. */
		box-sizing: border-box !important;
	}

	.wp-caption img,
	.contento .wp-caption img,
	#alarife .wp-caption img {
		max-width: 100% !important;
		height: auto !important;
		max-height: none !important;
	}

	/* Touch targets: the plain term-listing links (.display-posts-listing,
	 * used on archive/article pages) have no padding, so adjacent entries
	 * sit too close together for comfortable tapping. */
	.display-posts-listing .listing-item {
		padding: 8px 0;
	}

	.display-posts-listing .listing-item a.title {
		display: inline-block;
		min-height: 24px;
		line-height: 1.4;
		padding: 6px 0;
	}
}

/* -----------------------------------------------------------------------
 * 3. Phone-only refinements, <= 780px
 * ---------------------------------------------------------------------- */
@media (max-width: 780px) {
	/* style.css's own <=767px query shrinks every link to an illegible
	 * 12px (a{font-size:12px!important}). Links should read at the same
	 * size as the surrounding body copy instead. */
	a {
		font-size: 1em !important;
	}

	/* Comfortable line-height on top of the existing mobile
	 * body{font-size:1em} (16px), which is already >=16px. */
	body {
		line-height: 1.5em !important;
	}

	/* .caja had a fixed height:295px in the legacy phone query, clipping
	 * any box whose content is taller than that at narrow widths. */
	.caja {
		height: auto !important;
		min-height: 0 !important;
	}

	/* .cajita has a fixed height:66px (desktop rule, no phone override);
	 * wrapped text gets clipped at narrow widths. */
	.cajita {
		height: auto !important;
		min-height: 66px !important;
	}

	/* .cabecera/.cabecera2/.cabecera3 keep a desktop-oriented width (75%
	 * /83%); give them the same comfortable phone width as .caja. */
	.cabecera,
	.cabecera2 {
		width: 92% !important;
	}
}

/* -----------------------------------------------------------------------
 * 4. Correction: confirmed + defensive overflow fixes, <= 1024px
 *
 * A follow-up visual review found real horizontal overflow that a plain
 * document.documentElement.scrollWidth check misses, because the
 * offending element clips its own children with `overflow:hidden` (the
 * overflow is real in layout, just invisible as a page-level scrollbar).
 * Confirmed by measuring getBoundingClientRect() for every element at
 * 390/430px: `#menu-menupie` (footer menu) is a `display:flex` list with
 * no `flex-wrap` and a fixed `width:74%` (style.css, unconditional), so
 * its 11 items lay out on a single row far wider than the container and
 * get clipped mid-item ("Cantería", "Cómo se llama", ...) by the
 * container's own `overflow:hidden`. The site-title h1 and .cabecera
 * boxes measured within bounds here, but get defensive
 * overflow-wrap/box-sizing anyway since a long single word (no spaces)
 * or a font-loading race can still push text past its box without ever
 * growing the page's own scrollWidth.
 * ---------------------------------------------------------------------- */
@media (max-width: 1024px) {
	/* Footer menu: let items wrap onto multiple rows instead of being
	 * clipped by the container's overflow:hidden. */
	#menu-menupie {
		flex-wrap: wrap !important;
		width: 100% !important;
		overflow: visible !important;
	}

	#menu-menupie li {
		max-width: 100% !important;
	}

	/* Defensive: guarantee long words break inside their box instead of
	 * silently overflowing it (box-sizing:border-box so width% + padding
	 * never adds up to more than 100% of the parent). */
	#header-first .logo2 h1,
	#header-first .logo2 h1 a,
	#header-first .logo h1,
	#header-first .logo h1 a,
	#header-first .logo2 .site-title,
	#header-first .logo2 .site-title a,
	#header-first .logo .site-title,
	#header-first .logo .site-title a,
	.cabecera,
	.cabecera2,
	.cabecera p,
	.cabecera2 p {
		box-sizing: border-box !important;
		max-width: 100% !important;
		overflow-wrap: break-word !important;
		word-break: break-word !important;
		hyphens: auto !important;
	}

	/* Home title: .home #header-first .logo h1 is unconditionally 3em
	 * (48px) in customizations.css with no mobile/tablet override, unlike
	 * .logo2 h1 which section 1 already caps at 2em. At tablet widths
	 * (e.g. 768px) "arquitectónico" alone can be wider than the column at
	 * 48px, so overflow-wrap breaks it mid-word and orphans a lone "o".
	 * Match it to the same 2em used for inner pages for a clean wrap. */
	.home #header-first .logo h1 {
		font-size: 2em !important;
	}
}

/* -----------------------------------------------------------------------
 * 5. Fixed-width content boxes with content-box padding, <= 1024px
 *
 * Root cause: .cajita2 and .cabecera3 (style.css) are both
 * `width:100%; padding:27px` with the browser default content-box model,
 * so their rendered border-box is 100% + 54px wide: ~54px of real
 * horizontal overflow on every page that uses them (e.g. /alarife-2/) at
 * every width <= 1024px, confirmed by getBoundingClientRect.
 * ---------------------------------------------------------------------- */
@media (max-width: 1024px) {
	.cajita2,
	.cabecera3 {
		box-sizing: border-box !important;
		max-width: 100% !important;
	}
}

/* -----------------------------------------------------------------------
 * 6. Contact Form 7 fields, <= 1024px
 *
 * Root cause: Contact Form 7's text/email inputs use size="40" and the
 * textarea cols="40" (contacto/ markup), which give them an intrinsic
 * rendered width of ~362px regardless of their container - wider than
 * every phone column. .wpcf7-form-control is also the submit button's
 * class, so it is explicitly excluded to keep the button's look untouched.
 * ---------------------------------------------------------------------- */
@media (max-width: 1024px) {
	.wpcf7-form-control:not(.wpcf7-submit) {
		max-width: 100% !important;
		box-sizing: border-box !important;
	}
}

/* -----------------------------------------------------------------------
 * 7. Editor-inserted indents inside post/page content, phone only, <= 780px
 *
 * Root cause: pasted-from-Word content carries inline
 * `style="padding-left: Npx"` on <p>/<div> (84 published posts/pages/
 * glossary terms). #content and #content-full are the wrapper used by
 * every template that prints the_content() (single posts and glossary
 * terms nest a further div#post-N inside #content; pages print directly
 * inside #content or #content-full), so scoping to those two IDs reaches
 * every case without ever touching header/footer/sidebar chrome. Large
 * indents (up to 520px seen) push text past the phone column's right edge
 * (e.g. the "-> Volver a" lines on /almena-y-canonera-un-debate-de-altura/,
 * an empty <div style="padding-left:480px"> on /contacto/, and a <p> inside
 * a table on /glossary/estilos/ that was widening the whole table). Small
 * indents (30-90px) already fit and are kept as-is. Each known value is
 * matched with and without a space after the colon
 * ("padding-left: Npx" / "padding-left:Npx"); the "padding-left:" prefix on
 * every selector is required so e.g. "30px" can never accidentally match
 * inside "330px". The generic fallback below the value list has the same
 * attribute-selector specificity as every per-value rule, so it is placed
 * FIRST: any padding-left value not in the known list still gets a safe
 * cap, and every known value's own rule (later in the cascade) overrides it
 * with its exact min().
 * ---------------------------------------------------------------------- */
@media (max-width: 780px) {
	/* Fallback for any padding-left value not covered by name below. */
	:is(#content, #content-full) [style*="padding-left:"] {
		padding-left: min(60px, 25%) !important;
	}

	:is(#content, #content-full) [style*="padding-left: 30px"],
	:is(#content, #content-full) [style*="padding-left:30px"] {
		padding-left: min(30px, 25%) !important;
	}

	:is(#content, #content-full) [style*="padding-left: 40px"],
	:is(#content, #content-full) [style*="padding-left:40px"] {
		padding-left: min(40px, 25%) !important;
	}

	:is(#content, #content-full) [style*="padding-left: 60px"],
	:is(#content, #content-full) [style*="padding-left:60px"] {
		padding-left: min(60px, 25%) !important;
	}

	:is(#content, #content-full) [style*="padding-left: 90px"],
	:is(#content, #content-full) [style*="padding-left:90px"] {
		padding-left: min(90px, 25%) !important;
	}

	:is(#content, #content-full) [style*="padding-left: 120px"],
	:is(#content, #content-full) [style*="padding-left:120px"] {
		padding-left: min(120px, 25%) !important;
	}

	:is(#content, #content-full) [style*="padding-left: 150px"],
	:is(#content, #content-full) [style*="padding-left:150px"] {
		padding-left: min(150px, 25%) !important;
	}

	:is(#content, #content-full) [style*="padding-left: 180px"],
	:is(#content, #content-full) [style*="padding-left:180px"] {
		padding-left: min(180px, 25%) !important;
	}

	:is(#content, #content-full) [style*="padding-left: 210px"],
	:is(#content, #content-full) [style*="padding-left:210px"] {
		padding-left: min(210px, 25%) !important;
	}

	:is(#content, #content-full) [style*="padding-left: 240px"],
	:is(#content, #content-full) [style*="padding-left:240px"] {
		padding-left: min(240px, 25%) !important;
	}

	:is(#content, #content-full) [style*="padding-left: 270px"],
	:is(#content, #content-full) [style*="padding-left:270px"] {
		padding-left: min(270px, 25%) !important;
	}

	:is(#content, #content-full) [style*="padding-left: 330px"],
	:is(#content, #content-full) [style*="padding-left:330px"] {
		padding-left: min(330px, 25%) !important;
	}

	:is(#content, #content-full) [style*="padding-left: 360px"],
	:is(#content, #content-full) [style*="padding-left:360px"] {
		padding-left: min(360px, 25%) !important;
	}

	:is(#content, #content-full) [style*="padding-left: 390px"],
	:is(#content, #content-full) [style*="padding-left:390px"] {
		padding-left: min(390px, 25%) !important;
	}

	:is(#content, #content-full) [style*="padding-left: 420px"],
	:is(#content, #content-full) [style*="padding-left:420px"] {
		padding-left: min(420px, 25%) !important;
	}

	:is(#content, #content-full) [style*="padding-left: 450px"],
	:is(#content, #content-full) [style*="padding-left:450px"] {
		padding-left: min(450px, 25%) !important;
	}

	:is(#content, #content-full) [style*="padding-left: 480px"],
	:is(#content, #content-full) [style*="padding-left:480px"] {
		padding-left: min(480px, 25%) !important;
	}

	:is(#content, #content-full) [style*="padding-left: 520px"],
	:is(#content, #content-full) [style*="padding-left:520px"] {
		padding-left: min(520px, 25%) !important;
	}
}

/* -----------------------------------------------------------------------
 * 8. Tap target height, footer menu, <= 1024px
 *
 * Root cause: #menu-menupie li > a has no padding/line-height of its own,
 * so its rendered height comes straight from the surrounding font-size
 * (measured 22px on phones, 19px on tablets - both below the WCAG 2.5.8
 * 24x24px minimum). Only layout (height) changes; color/font are untouched.
 * ---------------------------------------------------------------------- */
@media (max-width: 1024px) {
	#menu-menupie li > a {
		display: inline-block;
		min-height: 24px;
		line-height: 24px;
		padding: 3px 0;
	}
}

/* -----------------------------------------------------------------------
 * 9. Glossary A-Z index, <= 1024px
 *
 * Root cause: the glossary plugin gives .glossary-menu-atoz a fixed
 * height:25px (with its border-bottom) and floats 22px-high letters inside
 * it. Below ~1280px the 28 letters wrap onto 2-3 rows, so the rule is drawn
 * under the first row only and the other rows hang below it; each letter
 * link is only as wide as its glyph (4px for "I"). Let the list grow with
 * its rows and give each letter a 24x24px target. Colors/fonts untouched.
 * ---------------------------------------------------------------------- */
@media (max-width: 1024px) {
	.glossary-menu-atoz {
		display: flow-root;
		height: auto !important;
	}

	.glossary-menu-atoz .glossary-menu-item {
		height: auto !important;
	}

	.glossary-menu-atoz .glossary-menu-item a {
		display: inline-block;
		min-width: 24px;
		min-height: 24px;
		line-height: 24px;
		text-align: center;
	}
}

/* -----------------------------------------------------------------------
 * 10. Cookie-policy table, phone only, <= 780px
 *
 * Root cause: the 5-column cookie table (deploy/legal/cookie-policy.html)
 * sizes to its content (~530px), wider than every phone column, so the whole
 * page scrolled sideways and the "Duraci�n" / "Tipo" columns were clipped.
 * Make the table its own horizontal scroll box so only the table scrolls.
 * Scoped to the page that holds the cookie-consent reopen button (:has() is
 * supported by every evergreen browser; older ones keep today's behavior);
 * other content tables are left alone.
 * ---------------------------------------------------------------------- */
@media (max-width: 780px) {
	#content:has([data-cookie-consent-reopen]) table {
		display: block;
		max-width: 100%;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}
}

/* -----------------------------------------------------------------------
 * 11. Justified text around e-mail addresses and links, phone only, <= 780px
 *
 * Root cause: style.css sets `p{text-align:justify}`. On a ~380px column the
 * long unbreakable address alarifeglosario@gmail.com (privacy policy, section
 * 4) moves to the next line as a whole, and justification stretches the
 * previous line into wide word gaps (up to ~68px measured). The contact form
 * has the same problem in its privacy notice (the paragraph before the submit
 * button ends in a link). Left-align just those blocks; every other
 * paragraph stays justified. Desktop is untouched.
 * Captions and block-editor aligned paragraphs keep their own alignment
 * (the author caption on /alarife-2/ holds the e-mail and is centered).
 * ---------------------------------------------------------------------- */
@media (max-width: 780px) {
	/* The author caption on /alarife-2/ pads its e-mail with non-breaking
	 * spaces. On desktop the narrow caption wraps them onto their own line;
	 * the wider phone caption keeps them on the e-mail's line and pushes it
	 * right. Put the e-mail on its own line, as desktop shows it. */
	.wp-caption-text a[href^="mailto:"] {
		display: block;
	}

	:is(#content, #content-full) p:has(a[href^="mailto:"]):not(.wp-caption-text, .has-text-align-center, .has-text-align-right),
	.wpcf7-form p {
		text-align: left;
	}
}

/* -----------------------------------------------------------------------
 * 12. /contacto/ form centered in its column, phones and small tablets, <= 780px
 *
 * Root cause: the form sits inside div#diccionario, the glossary wrapper that
 * style.css indents with `margin-left:71px` (and no right margin). On a ~390px
 * column that pinned the form to the right (74px left gap, ~4px right gap) and
 * squeezed the fields; on tablets the text/email inputs (size="40") were also
 * narrower than the full-width textarea. Only the wrapper that directly holds a
 * Contact Form 7 form is touched (:has(> .wpcf7)); glossary pages keep their
 * indent. The form gets equal side gutters, every field spans the same width,
 * the submit button and the reply notice below it are centered (the labels and
 * the privacy notice stay left-aligned so they read next to their fields), and
 * the button keeps a tap target >= 24px (WCAG 2.5.8).
 * ---------------------------------------------------------------------- */
@media (max-width: 780px) {
	#diccionario:has(> .wpcf7) {
		margin-left: 12px;
		margin-right: 12px;
		text-align: center;
	}

	#diccionario:has(> .wpcf7) .wpcf7-form-control-wrap {
		display: block;
	}

	#diccionario:has(> .wpcf7) .wpcf7-form :is(input.wpcf7-text, input.wpcf7-email, textarea) {
		width: 100% !important;
	}

	#diccionario:has(> .wpcf7) .wpcf7-form p:has(.wpcf7-submit) {
		text-align: center;
	}

	/* Simón's phone, 2026-10-09 evening (P3): the button was 40px tall and only as
	   wide as its word (56px). Less tall, a bit wider; still a tap target >= 24px. */
	#diccionario:has(> .wpcf7) .wpcf7-submit {
		min-height: 32px;
		padding: 4px 28px;
	}

	/* The (hidden) sending spinner must not take inline space next to the button,
	   or the button is not centered; it shows to the right of it while sending. */
	#diccionario:has(> .wpcf7) .wpcf7-spinner {
		position: absolute;
		margin: 0 0 0 12px;
	}
}

/* -----------------------------------------------------------------------
 * 13. Page titles, phone and small tablet, <= 780px
 *
 * Root cause: style.css's <= 767px query sets every .page-title to 1.3em
 * (~20.8px), a Rouge Script face that is already light, so on a phone the
 * title under the header reads as a caption (the client's remark). Desktop
 * is 40px / line-height 1.5em. Phones get 32px with a tighter line-height so
 * a two-line title does not leave a big gap between its lines. Only
 * .page-title is touched; glossary term titles (.post-title) keep theirs.
 * ---------------------------------------------------------------------- */
@media (max-width: 780px) {
	.page-title {
		font-size: 32px;
		line-height: 1.2em;
	}
}

/* -----------------------------------------------------------------------
 * 14. A-Z term list columns, phone and small tablet, <= 780px
 *
 * Root cause: customizations.css sets `.anckla{column-count:4}` with no media
 * query. The lists on /sillares/ (and every letter page of the index) open
 * when a letter is clicked; at 390px four columns are ~90px wide, so terms
 * wrap onto two or three lines and long ones are cut in the middle
 * ("alcazab-a"). Two columns up to 480px, three from 481px to 780px; desktop
 * keeps four. Same vendor-prefixed properties as the original rule.
 * ---------------------------------------------------------------------- */
@media (max-width: 480px) {
	.anckla {
		column-count: 2;
		-webkit-column-count: 2;
		-moz-column-count: 2;
		-o-column-count: 2;
	}
}

@media (min-width: 481px) and (max-width: 780px) {
	.anckla {
		column-count: 3;
		-webkit-column-count: 3;
		-moz-column-count: 3;
		-o-column-count: 3;
	}
}

/* -----------------------------------------------------------------------
 * 15. Left-aligned body text, phone and small tablet, <= 780px
 *
 * (Extended 2026-10-06 after the whole-site phone audit: see the rules below
 * the paragraph one for list items, other inline-justified blocks, the intro
 * box .cabecera3 and the cookie banner.)
 *
 * Root cause: style.css sets `p{text-align:justify}`. On a ~380px column a
 * justified line holds four or five words, and any long word that moves to
 * the next line stretches the gaps of the line before it (section 11 fixed
 * the two worst cases, the e-mail and contact-form paragraphs). Every
 * paragraph inside #content / #content-full is left-aligned instead; desktop
 * stays justified. :where() keeps the selector at the same specificity as
 * the global `p` rule (responsive.css loads later, so it wins), which means
 * anything centered or justified on purpose by a class or an inline style
 * (.cabecera p, .cabecera2 p, .cajita p, .wp-caption-text,
 * .has-text-align-*, style="text-align:center") keeps its own alignment
 * without a list of exclusions. Checked against the pre-change rendering.
 * ---------------------------------------------------------------------- */
@media (max-width: 780px) {
	:where(#content, #content-full) p {
		text-align: left;
	}

	/* Some blocks carry the editor's own inline `text-align: justify`, which
	 * only !important can beat. That is not limited to paragraphs: the body
	 * of 235 glossary entries (and the post /el-gotico-y-sus-acreedores/) is
	 * a numbered list, <ol><li style="text-align: justify">, /glossary/domus/
	 * has it on a <ul>, and a few entries on a <div> or <ul>. Any element
	 * under #content / #content-full is left-aligned, whatever its tag; both
	 * spellings of the declaration are matched. An inline center or right is
	 * never matched, so those keep their alignment. */
	:where(#content, #content-full) :is([style*="text-align: justify"], [style*="text-align:justify"]) {
		text-align: left !important;
	}

	/* Two blocks are justified by a stylesheet rule instead, and sit outside
	 * the paragraph rule above: the intro box of /alarife-2/
	 * (style.css `.cabecera3{text-align:justify}`, which its <h5> inherits)
	 * and the first-visit cookie banner text (a <p> outside #content, so only
	 * the global `p{text-align:justify}` reaches it: four lines of ~330px
	 * with stretched gaps). Each gets a plain left alignment; they are still
	 * justified on desktop. */
	.cabecera3,
	.glosario-consent-text {
		text-align: left;
	}
}

/* -----------------------------------------------------------------------
 * 16. Legal notice under the contact form, ALL widths (not in a media query)
 *
 * The client asked for the "Responsable: ..." privacy notice under the
 * /contacto/ form to be smaller than the field labels. This is the one
 * intended desktop change of this file, so it sits outside any media query.
 * The notice is the only form paragraph that links to the privacy policy.
 * An explicit unitless line-height keeps the lines at 1.5x of the new size:
 * body's `line-height:1.5em` is inherited as a fixed length, which would leave
 * the smaller text with loose lines.
 * ---------------------------------------------------------------------- */
.wpcf7-form p:has(a[href*="politica-de-privacidad"]) {
	font-size: .85em;
	line-height: 1.5;
}

/* -----------------------------------------------------------------------
 * 17. Symmetric side margins, phones only, <= 767px
 *
 * Root cause (owner report of 2026-10-05, iPhone): three legacy rules left
 * blocks closer to one edge of the screen than to the other.
 *  a) style.css's <= 767px query gives the search widget (#header-third)
 *     `width:90%` plus `padding:0 3%` in the content-box model, so it is 96%
 *     wide, and its desktop `float:right` pins it to the right edge: ~19px
 *     gap on the left, ~4px on the right. It is centered at the same 92%
 *     width as the intro boxes (.cabecera) below it, border-box so the
 *     padding is part of the width.
 *  b) style.css gives every li a 20px left margin (`li{margin:0 0 0 20px}`),
 *     meant to make room for a list marker. The gallery tiles (li.marcas,
 *     `list-style:none!important`) and the visit counter figure have no
 *     marker, so the indent only pushed the images (which already carry a
 *     symmetric 10px padding) and the centered counter number ~10px to the
 *     right. Marker-less lists lose the indent; bulleted and numbered lists
 *     keep it.
 * Desktop and tablet (>= 768px) are not touched.
 * ---------------------------------------------------------------------- */
@media (max-width: 767px) {
	#header-third {
		float: none;
		box-sizing: border-box;
		width: 92%;
		margin-left: auto;
		margin-right: auto;
	}

	.marcas,
	#wop-1 li li {
		margin-left: 0;
	}
}

/* -----------------------------------------------------------------------
 * 18. More symmetric side margins, phones only, <= 767px
 *
 * Root cause (whole-site phone audit of 2026-10-06, 2,999 URLs at 360/390/430,
 * five blocks more than 4px off-centre; each narrowed to the pages that use it):
 *  a) /canteria/ term list (ul.display-posts-listing): each <li> keeps the 20px
 *     indent that makes room for its square bullet, but the photo box inside it
 *     (.wp-caption, with its photo and caption) was indented too, so photos sat
 *     ~10px right of the middle. The bullet and the title keep their indent;
 *     only the photo box is pulled back out by that 20px. Items of the gallery
 *     list (.marcas) already have no indent and are left alone.
 *  b) /propileos/ and /contacto-agora/, div.caja: style.css (<= 767px) makes it
 *     `width:90%!important` with 15px of padding in the content-box model, so it
 *     is 90% + 30px wide, ~8px short of the column and pinned to the left. It
 *     becomes a border-box as wide as the column, so its 15px padding is
 *     symmetric. On /contacto-agora/ the photo is an inline link inside the box
 *     (the /propileos/ ones are already centred by an inline flex style), so a
 *     bare link that is the only child of a box is centred as a block.
 *  c) /glossary/orden/: two centred paragraphs that hold a photo carry the
 *     editor's inline `padding-left: 30px` / `60px` (section 7 keeps those
 *     indents), which pushes the "centred" photo 15-30px right. The indent is
 *     dropped on the paragraphs that hold a photo; centred text paragraphs
 *     with an indent are not touched. (The first of them also starts with
 *     eight &nbsp; typed by the editor, which still shifts its photo ~27px;
 *     that is stored text and stays as written.)
 *  d) /seleccion-de-diccionarios-.../, div#diccionario: style.css indents it by
 *     71px on every width, which takes a fifth of a phone column and leaves it
 *     pinned right. The wrapper of the contact form (:has(> .wpcf7)) is handled
 *     by section 12 and is excluded here.
 * Desktop and tablet (>= 768px) are not touched.
 * ---------------------------------------------------------------------- */
@media (max-width: 767px) {
	/* Section 2 resets every .wp-caption to `width:100%; max-width:100%;
	 * margin:0 auto 15px` with !important, so the pull-out needs it too. */
	.display-posts-listing > .listing-item:not(.marcas) .wp-caption {
		margin-left: -20px !important;
		width: calc(100% + 20px) !important;
		max-width: none !important;
	}

	.caja {
		box-sizing: border-box;
		width: 100% !important;
	}

	.caja > a:only-child:not([style]) {
		display: block;
		text-align: center;
	}

	:is(#content, #content-full) p:is([style*="text-align: center"], [style*="text-align:center"]):is([style*="padding-left"]):has(img) {
		padding-left: 0 !important;
	}

	#diccionario:not(:has(> .wpcf7)) {
		margin-left: 0;
	}
}

/* -----------------------------------------------------------------------
 * 19. Quotes without stepped lines, phones only, <= 767px
 *
 * Root cause (Simón's phone review of 2026-10-08, M2): three intro texts are
 * broken into lines for the desktop width, so on a phone each stored line
 * ends early and the text reads as steps.
 *  a) /propileos/ (page 50): the header paragraph (.cabecera p) has two
 *     stored <br>. They are hidden; the newline stored after each one keeps
 *     the space between the words. `text-wrap: pretty` keeps the last line
 *     from holding a single word (browsers without it wrap as before).
 *  b) /contacto-agora/ (page 2016): Victor Hugo's quote is two <div>, one per
 *     desktop line, inside a centered <div> (the only <div> of the page with
 *     an inline `text-align: center`). They flow as one text (inline); the
 *     40px space under the quote (.margen-inferior on the second <div>, lost
 *     when it is inline) moves to the wrapper. `text-wrap: balance` evens the
 *     lines where the browser supports it (up to six lines in Chrome).
 *  c) /contacto-agora/no-es-lo-que-se-dice/ (page 4643): Confucio's words are
 *     three centered <h5 style="font-weight: inherit; ..."> (the only <h5>
 *     with that inline style on the page), one per desktop line, after an
 *     introduction <h5 style="text-align: center;"> ("En el siglo VI ...
 *     Confucio dijo:"). They flow as one text, centered like before.
 * Simón's phone, 2026-10-09 (N4): with a larger phone font the introduction,
 * on its own line, ended in a short line ("Confucio dijo:") and the last line
 * of each quote could hold one word, so the steps showed again. The
 * introduction now flows with the quote (one paragraph), and no rule here
 * depends on :has() (phones without it, e.g. Safari < 15.4 or Samsung
 * Internet < 20, would drop the whole rule and show the stored lines).
 * Desktop and tablet (>= 768px) are not touched.
 * ---------------------------------------------------------------------- */
@media (max-width: 767px) {
	.page-id-50 .cabecera p br {
		display: none;
	}

	.page-id-50 .cabecera p {
		text-wrap: pretty;
	}

	.page-id-2016 #content > div[style*="text-align: center"] {
		margin-bottom: 40px;
		text-wrap: balance;
	}

	.page-id-2016 #content > div[style*="text-align: center"] > div {
		display: inline;
	}

	/* The introduction and the three lines of the quote: the only <h5> of the
	 * page whose inline style aligns them (the list titles only have an
	 * indent). */
	.page-id-4643 #content > h5[style*="text-align: center"] {
		display: inline;
		/* Simón's phone, 2026-10-09 evening (P6): inline, the <h5> kept their
		   2em line-height and the quote read double-spaced. */
		line-height: 1.5;
	}

	/* Inline, those <h5> no longer center themselves (their inline
	 * `text-align: center` only aligns a block's own lines): the text they form
	 * is aligned by #content, the block that holds them. #content is centered
	 * and every other child of it that has no inline alignment of its own (the
	 * numbered list, the paragraphs, the comments wrapper) is put back to the
	 * left alignment it had; the page title keeps its own centering. */
	.page-id-4643 #content {
		text-align: center;
	}

	.page-id-4643 #content > :is(h5, p, div):not([style*="text-align"]) {
		text-align: left;
	}
}

/* -----------------------------------------------------------------------
 * 20. "No es lo que se dice" numbered list, phones only, <= 767px
 *
 * Root cause (Simón's phone review of 2026-10-08, M3): the 75 titles of
 * /contacto-agora/no-es-lo-que-se-dice/ (page 4643) are <h5>/<p> with an
 * inline `padding-left: 240px`, which section 7 caps at 25% of the column
 * (~95px on a 390px phone): a big empty band on the left and narrow lines.
 * In the narrow lines the titles wrap, the wrapped part starts under the
 * number instead of under the title, and a title glued with stored &nbsp;
 * ("Cenador&nbsp;íntimo,&nbsp;deambulada&nbsp;pérgola") drops below its
 * number. On this page only, the indent becomes a hanging indent the width
 * of "10. " (1.65em): numbers sit at the left edge and wrapped lines start
 * under the title (numbers 1-9 are padded with stored &nbsp; so their
 * titles line up with 10-75). Item 19 ends with a <strong> holding only
 * &nbsp; after its link, which wraps onto an empty line between 19 and 20;
 * that <strong> (the only `h5 > a + strong` of the page) is hidden.
 * Section 7's cap still applies to every other page. Desktop and tablet
 * (>= 768px) are not touched.
 * Simón's phone, 2026-10-09 (N7): with a larger phone font (Chrome scales
 * the font size but not `em` lengths of other properties) the 1.65em indent
 * stayed at its 16px width while "10. " grew, so wrapped lines started left of
 * the title. The indent is now in `ch` (the width of a digit of the item's
 * own font), which grows with the text: 2.9ch is "10. " (26.5px at 16px, as
 * the 1.65em it replaces). inc/nbsp-titles.php turns the &nbsp; inside the
 * titles into spaces, so long titles (item 75) wrap under the title too.
 * ---------------------------------------------------------------------- */
@media (max-width: 767px) {
	.page-id-4643 #content :is([style*="padding-left: 240px"], [style*="padding-left:240px"]) {
		padding-left: 2.9ch !important;
		text-indent: -2.9ch;
	}

	.page-id-4643 #content h5 > a + strong:last-child {
		display: none;
	}
}

/* -----------------------------------------------------------------------
 * 21. Ágora section boxes, phones only, <= 480px
 *
 * Root cause (Simón's phone review of 2026-10-08, M4): the two section boxes
 * of /contacto-agora/ (page 2016, .cajita: "Tus comentarios y preguntas a
 * este glosario", "No es lo que se dice") are 45% of the column on phones
 * (customizations.css), so "TUS COMENTARIOS Y PREGUNTAS A ESTE GLOSARIO"
 * wraps over three lines in a narrow box. They take the whole column, like
 * the .cajita2 boxes of /alarife-2/ (width 100%, border-box), so each title
 * takes one or two lines. Other widths keep their box widths.
 * ---------------------------------------------------------------------- */
@media (max-width: 480px) {
	.page-id-2016 .cajita {
		box-sizing: border-box;
		width: 100%;
	}
}

/* Simón's phone, 2026-10-09 (N8): thinner boxes, like the .cajita2 boxes of
 * /alarife-2/ (D1): 14px above and below the title. The title link had a
 * 12px top margin on top of the box's 14px padding (customizations.css),
 * and section 3's 66px minimum height kept the box tall. The stored <br>
 * of "NO ES<br>LO QUE SE DICE" is hidden (the newline after it keeps the
 * space), so it takes one line when it fits; the trailing <br> of the other
 * title adds no line. Phones only (<= 767px). */
@media (max-width: 767px) {
	.page-id-2016 .cajita {
		min-height: 0 !important;
	}

	.page-id-2016 .cajita a {
		margin-top: 0;
	}

	.page-id-2016 .cajita a br {
		display: none;
	}
}

/* -----------------------------------------------------------------------
 * 22. "(clica encima de las imágenes)" notes, phones only, <= 767px
 *
 * Simón's phone review of 2026-10-08 (M6): the hand-typed notes that ask the
 * reader to click the images are hidden on phones. inc/click-notes.php gives
 * the class to the blocks that hold nothing but such a note. 767px is
 * style.css's own phone breakpoint (sections 17-19 use it too); tablets and
 * desktop keep the note.
 * ---------------------------------------------------------------------- */
@media (max-width: 767px) {
	.glosario-click-note {
		display: none;
	}
}

/* -----------------------------------------------------------------------
 * 23. Header search box in two lines, <= 899px
 *
 * Simón's review of 2026-10-08 (D2): on phones the box took four lines
 * (title, hint, search field, button) and the title was smaller than the
 * hint. header.php now prints the title, the search form and the hint
 * (under the form); css/customizations.css sizes them for desktop (title
 * 28px, hint 18px, two lines).
 *  a) 768-899px: the title column (half of the box) is too narrow for the
 *     28px title, so it is 24px there and stays on one line.
 *  b) Phones (<= 767px): style.css stacks the title and the form, each 100%
 *     wide. The box becomes a wrapping flex row: title (22px) and form side
 *     by side on the first line (the field takes the room left, the button
 *     is 24px instead of 32px), the hint (16px) on the second; 21px title
 *     under 375px. Below about 350px the form wraps under the title instead
 *     of shrinking the field.
 * ---------------------------------------------------------------------- */
@media (min-width: 768px) and (max-width: 899px) {
	#header-third .search-title {
		font-size: 24px;
	}
}

@media (max-width: 767px) {
	#header-third {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		column-gap: 8px;
	}

	#header-third::after {
		display: none;
	}

	#header-third .search-title {
		flex: 0 0 auto;
		width: auto;
		float: none;
		font-size: 22px;
	}

	#header-third .search-form {
		display: flex;
		flex: 1 1 150px;
		align-items: center;
		gap: 5px;
		width: auto;
		min-width: 0;
		float: none;
	}

	#header-third .search-form label {
		flex: 1 1 auto;
		min-width: 0;
	}

	#header-third .search-field {
		box-sizing: border-box;
		width: 100%;
		margin: 0;
	}

	/* Two classes: style.css sets the 2em with #header-third input[type="submit"]. */
	#header-third .search-form .search-submit {
		flex: 0 0 auto;
		font-size: 24px;
	}

	#header-third .search-hint {
		flex: 0 0 100%;
		font-size: 16px;
		line-height: 22px;
		padding-bottom: 6px;
	}
}

/* Narrow phones (360px): 1px less title and tighter gaps, so the field's
 * "Buscar ..." placeholder is not clipped. */
@media (max-width: 374px) {
	#header-third {
		column-gap: 6px;
	}

	#header-third .search-title {
		font-size: 21px;
	}

	#header-third .search-form {
		gap: 4px;
	}
}

/* -----------------------------------------------------------------------
 * 24. Update date under the intro box, <= 1024px
 *
 * D3 (Simón, 2026-10-08): div.glosario-update-date (inc/update-date.php,
 * css/customizations.css) mirrors the intro box (.cabecera) so the date
 * keeps starting at the box's text edge: border-box at <= 1024px
 * (section 4) and 92% wide at <= 780px (section 3).
 * ---------------------------------------------------------------------- */
@media (max-width: 1024px) {
	.glosario-update-date {
		box-sizing: border-box;
		max-width: 100%;
	}
}

@media (max-width: 780px) {
	.glosario-update-date {
		width: 92%;
	}
}

/* -----------------------------------------------------------------------
 * 25. Alarife links page (page 4049), phones only, <= 767px
 *
 * Mobile sweep of 2026-10-09 (A1): css/customizations.css gives
 * `.page-id-4049 .wp-caption` (with page 2024 and .galeria-completa) a 30%
 * width with !important and no breakpoint. Its two classes beat section 2's
 * `.wp-caption { width: 100% !important }`, so on phones every logo + link
 * block was a ~115px column and names and URLs broke mid-word. Here each
 * block takes the whole column again; the logo keeps its own size (section 2
 * caps it at 100%). The Galería selectors and wider screens are untouched.
 * ---------------------------------------------------------------------- */
@media (max-width: 767px) {
	.page-id-4049 .wp-caption {
		width: 100% !important;
	}
}

/* -----------------------------------------------------------------------
 * 26. Runs of empty paragraphs, phones only, <= 767px
 *
 * Mobile sweep of 2026-10-09 (A2): many posts and glossary entries were
 * typed with dozens of "&nbsp;" lines in a row (<p>&nbsp;</p>), up to
 * 2,875px of white on a phone before the end of the page.
 * inc/empty-blocks.php gives the class to every empty paragraph of a run of
 * two or more; here each one that follows another is hidden, so the first
 * of the run (one line of space) stays. Single spacers are never marked.
 * The class has no rule above 767px: tablets and desktop are unchanged.
 * ---------------------------------------------------------------------- */
@media (max-width: 767px) {
	.glosario-empty-p + .glosario-empty-p {
		display: none;
	}
}

/* -----------------------------------------------------------------------
 * 27. Cómo se llama tiles alternate one by one, phones only, <= 767px
 *
 * Simón's phone, 2026-10-09 (N2): js/customizations.js shades the 40 tiles of
 * /como-se-llama/ (page 41316) in runs of five (five light #a5ad80, five
 * dark #5D6149), which on desktop gives rows of one shade each. On phones
 * the tiles are one column, so the runs read as blocks of five of the same
 * shade. Here they alternate tile by tile in list order (light, dark,
 * light ...), with the same two shades. !important beats the inline
 * background the script sets. Wider screens keep the rows.
 * ---------------------------------------------------------------------- */
@media (max-width: 767px) {
	.page-id-41316 #wpsp-41324 > article:nth-of-type(odd) {
		background: #a5ad80 !important;
	}

	.page-id-41316 #wpsp-41324 > article:nth-of-type(even) {
		background: #5D6149 !important;
	}
}

/* -----------------------------------------------------------------------
 * 28. No automatic hyphenation in the intro boxes, phones only, <= 767px
 *
 * Simón's phone, 2026-10-09 (N3): with a larger phone font "conjunto" was
 * split "con-/junto" in the /como-se-llama/ intro box. Section 4 sets
 * `hyphens: auto` on every .cabecera / .cabecera2 box (and its paragraphs)
 * up to 1024px as a defence against long words; on phones the boxes take
 * the whole width, so words wrap whole instead (overflow-wrap still breaks
 * a word longer than the line). Same boxes as section 4, so every intro
 * box of the site reads the same; tablets (768-1024px) keep section 4.
 * ---------------------------------------------------------------------- */
@media (max-width: 767px) {
	.cabecera,
	.cabecera2,
	.cabecera p,
	.cabecera2 p {
		hyphens: manual !important;
	}
}

/* -----------------------------------------------------------------------
 * 29. "No es lo que se dice" post titles, phones only, <= 767px
 *
 * Simón's phone, 2026-10-09 evening (P1): the title of those posts (27px
 * from customizations.css, with !important) was too big next to the 16px
 * text. 21px with a tighter line-height, only on the posts of that category
 * (single.php puts the category class on the post's wrapper); glossary
 * entries and the other posts keep their 27px.
 * ---------------------------------------------------------------------- */
@media (max-width: 767px) {
	.category-no-es-lo-que-se-dice .post-title {
		font-size: 21px !important;
		line-height: 1.3;
	}
}

/* -----------------------------------------------------------------------
 * 30. Ágora image/box pairs, box above its image on phones, <= 767px
 *
 * Simón's phone, 2026-10-09 evening (P5): on /contacto-agora/ (page 2016)
 * each link box (.cajita) sat under its photo (.caja); he wants it above.
 * inc/agora-pairs.php wraps each pair in div.glosario-agora-pair at render
 * time. The wrapper has no box of its own above 767px (display: contents),
 * so the stored floats lay out exactly as before; on phones it is a column
 * with the box first. Section 21 already gives the box the whole column
 * up to 480px; here it does so up to 767px, inside the pair only.
 * ---------------------------------------------------------------------- */
.glosario-agora-pair {
	display: contents;
}

@media (max-width: 767px) {
	.glosario-agora-pair {
		display: flex;
		flex-direction: column;
	}

	.glosario-agora-pair > .cajita {
		order: -1;
		box-sizing: border-box;
		width: 100%;
	}
}

/* -----------------------------------------------------------------------
 * 31. Single entries and posts, less white around the label, phones only,
 *     <= 767px
 *
 * Simón's phone, 2026-10-09 evening (P7): on the "No es lo que se dice"
 * posts the category label ("No es lo que se dice") floated in white: 59px
 * of #content margin above it (style.css), 10px of label padding and 40px
 * of title margin below it. 2026-10-10 (his item 1, Q1): the glossary
 * entries reached from Sillares and Tapial (label "Sillares y mampuestos" /
 * "Sillarejo y tapial") had the same white, and so did every other single
 * entry or post; the phone audit of that day (F1) found them all on
 * single.php, whose <body> carries .single. The same values now cover them
 * all (the #content margin-top of 15px is section 32's, for every view).
 * Only the spacing is shared: the 21px title of the "No es" posts
 * (section 29) stays with those posts; glossary terms keep 27px. A post
 * outside the labelled groups and categories (/berroquena/) prints an empty
 * label: its title needs no margin from it.
 * The label keeps the classes it had (heading-outline-test compares it with
 * an <h4> of the same classes, inserted next to it).
 * ---------------------------------------------------------------------- */
@media (max-width: 767px) {
	.single #content .page-title {
		padding-bottom: 0;
	}

	.single #content .post-title {
		margin-top: 16px;
	}

	.single #content .page-title:empty + .post-title {
		margin-top: 0;
	}
}

/* -----------------------------------------------------------------------
 * 32. Less white above the title of every #content view, phones only,
 *     <= 767px
 *
 * Simón's phone, 2026-10-09 evening (P8): /monumentos/ (2035),
 * /localizacion/ (2029), /galeriaimagenes/ (2024), /contacto-agora/ (2016)
 * and /como-se-llama/ (41316) opened with 59px of white between the header
 * and the title (style.css's #content margin); this section listed those
 * five pages. The phone audit of 2026-10-10 (F2) found the same 59px on
 * every other view that prints into #content: pages (page.php), single
 * entries and posts, search results, archives (categories, glossary groups)
 * and the 404. One rule for all of them; it replaces the five page ids
 * and section 31's own #content rule. Views in #content-full (page-full.php,
 * the home) already have no margin there.
 * ---------------------------------------------------------------------- */
@media (max-width: 767px) {
	#content {
		margin-top: 15px;
	}
}

/* -----------------------------------------------------------------------
 * 33. Dictionary list at the left of the column, phones only, <= 767px
 *
 * Simón's phone, 2026-10-09 evening (P9): the 42 numbered links of
 * /seleccion-de-diccionarios-y-glosarios-sobre-arte-arquitectonico/ (page
 * 4045, #diccionario) are stored with padding-left: 120px, which section 7
 * caps at a quarter of the column, and items 12 and 28 were typed without
 * it and pushed right with non-breaking spaces instead. Every item starts
 * at the left of the column, with a hanging indent so a wrapped title
 * continues under its first word rather than under its number; the
 * non-breaking spaces of 12 and 28 (wrapped by inc/tree-indents.php) are
 * hidden. Same specificity as section 7's rules (id + class + element
 * beats id + attribute), later in the cascade.
 * 2026-10-10 (Q9): the indent was 2em, ~6px right of where the title
 * starts after "N." on the first line. Measured in the page: the title
 * starts 2.82ch after a one-digit number ("7." + nbsp, space, nbsp) and
 * 2.92ch after a two-digit one ("10." + space); 2.87ch is within 0.6px of
 * both. ch, not em: with Android's larger text (text-size-adjust) ch grows
 * with the glyphs, em lengths do not.
 * ---------------------------------------------------------------------- */
@media (max-width: 767px) {
	.page-id-4045 #diccionario > p {
		padding-left: 2.87ch !important;
		text-indent: -2.87ch;
	}

	.page-id-4045 #diccionario .glosario-lead-spaces {
		display: none;
	}
}

/* -----------------------------------------------------------------------
 * 34. Style trees of /glossary/estilos/ and /glossary/romanico/, phones
 *     only, <= 767px
 *
 * Simón's phone, 2026-10-09 evening (P10): section 7 caps the stored pixel
 * indents of the two trees (150/180/210px on estilos, post 1298; 60px on
 * románico, post 2307) to a quarter of the column, so the levels flatten
 * and a wrapped line returns under the bullet; the lines typed without an
 * indent (pushed right with non-breaking spaces) fell to the left edge.
 * inc/tree-indents.php gives each line glosario-tree-<level> and wraps the
 * leading non-breaking spaces in .glosario-lead-spaces. Here each level is
 * 1.2em further in, with a 1.2em hanging indent so the bullet stands out
 * and the wrapped text lines up, and the leading spaces are hidden. The
 * classes have no style above 767px. Specificity (id + 2 classes + element)
 * beats section 7's id + attribute rules. The estilos tree sits in a
 * one-cell table (width 100%, td width 30%) whose automatic layout grew
 * past the column with a larger phone font; fixed layout keeps it in the
 * column and the cell takes the whole width. Románico's lists are stored
 * 60px in from its paragraphs, so its whole tree sits one more step in, to
 * keep reading as a level below the text.
 * ---------------------------------------------------------------------- */
@media (max-width: 767px) {
	.postid-1298 #content table {
		table-layout: fixed;
		width: 100% !important;
	}

	.postid-1298 #content td {
		width: auto;
	}

	.postid-1298 #content p.glosario-tree-1 {
		padding-left: 1.2em !important;
		text-indent: -1.2em;
	}

	.postid-1298 #content p.glosario-tree-2,
	.postid-2307 #content p.glosario-tree-1 {
		padding-left: 2.4em !important;
		text-indent: -1.2em;
	}

	.postid-1298 #content p.glosario-tree-3,
	.postid-2307 #content p.glosario-tree-2 {
		padding-left: 3.6em !important;
		text-indent: -1.2em;
	}

	.postid-2307 #content p.glosario-tree-3 {
		padding-left: 4.8em !important;
		text-indent: -1.2em;
	}

	.postid-1298 #content .glosario-lead-spaces,
	.postid-2307 #content .glosario-lead-spaces {
		display: none;
	}
}

/* -----------------------------------------------------------------------
 * 35. Search result, less white under its label, phones only, <= 767px
 *
 * Phone audit of 2026-10-10 (F1, search): search.php prints the result's
 * group label (div.page-title, "Sillares y mampuestos"...) and its title
 * (h2.post-title) like single.php does, with the same 51px between them
 * (10px of label padding, 40px of title margin). Same values as section 31.
 * The title rule uses ~ rather than +: heading-outline-test inserts an <h4>
 * clone right before each element it compares, which must get the same
 * margin. search.php shows one result, so ~ reaches that one title.
 * ---------------------------------------------------------------------- */
@media (max-width: 767px) {
	.search #content > .page-title {
		padding-bottom: 0;
	}

	.search #content > .page-title ~ .post-title {
		margin-top: 16px;
	}
}

/* -----------------------------------------------------------------------
 * 36. Dictionary list and contact form closer to the title, phones only,
 *     <= 767px
 *
 * Phone audit of 2026-10-10 (F3): div#diccionario, the wrapper of the list
 * of /seleccion-de-diccionarios-y-glosarios-sobre-arte-arquitectonico/
 * (page 4045) and of the form of /contacto/ (page 4651), the only two pages
 * that use it, has style.css's 30px top margin under the title: 41px of
 * white on /contacto/, 69px on 4045, where the list also opens with a
 * stored empty paragraph (28px). inc/diccionario-lead.php marks that
 * paragraph (glosario-lead-empty-p) only when it is truly empty; it is
 * hidden here. Desktop keeps both.
 * 2026-10-10 (Q9): most posts and many glossary entries open their content
 * with the same stored empty paragraph, ~45px of white between the title
 * and the first text; inc/diccionario-lead.php marks it the same way on
 * single views (only the first block of the main post's content) and it is
 * hidden here too.
 * ---------------------------------------------------------------------- */
@media (max-width: 767px) {
	#diccionario {
		margin-top: 0;
	}

	.page-id-4045 #diccionario > p.glosario-lead-empty-p,
	.single #content p.glosario-lead-empty-p {
		display: none;
	}
}

/* -----------------------------------------------------------------------
 * 37. Separators right under the title of 4049 and Alarife, phones only,
 *     <= 767px
 *
 * Phone audit of 2026-10-10 (F4): /alarife/2-paginas-web-de-actualidad-
 * sobre-arte-arquitectonico/ (page 4049) prints, right after its title, an
 * empty <div> and five empty div.separador4 whose 35px top margins
 * (style.css) collapse into one; /alarife-2/ (page 92) one separador4 before
 * its first photo: 45px between title and content. Only the separators of
 * that leading run lose their margin: the selector takes a separador4 that
 * follows the title with nothing but the title, empty elements and other
 * separators before it, so a separator placed after any content (a logo
 * row, a caption) keeps its 35px. Desktop keeps them all.
 * ---------------------------------------------------------------------- */
@media (max-width: 767px) {
	:is(.page-id-4049 #content, .page-id-92 #content-full) > h1.page-title ~ .separador4:not(:not(h1, .separador4, :empty) ~ *) {
		margin-top: 0;
	}
}

/* -----------------------------------------------------------------------
 * 38. Glossary group archives, first title closer to the header, phones
 *     only, <= 767px
 *
 * Phone audit of 2026-10-10 (F5): /glosario/grupo/<group>/ (archive.php,
 * body .tax-wpglossarygroup) has no heading; its first entry title keeps
 * the 40px top margin of every .post-title (customizations.css), 76px
 * under the header even with section 32. The first title gets no margin
 * (~36px, like the other views); the titles further down keep their 40px.
 * The first title is the one with no entry's .postmetadata before it,
 * rather than :first-child or :first-of-type: heading-outline-test inserts
 * an <h4> clone of the same classes right before each <h2> it compares, and
 * the clone and the <h2> must get the same margin.
 * ---------------------------------------------------------------------- */
@media (max-width: 767px) {
	.tax-wpglossarygroup #content > .post-title:not(.postmetadata ~ *) {
		margin-top: 0;
	}
}

/* -----------------------------------------------------------------------
 * 39. Home "Última actualización", a little smaller on phones, <= 767px
 *
 * Simón's phone, 2026-10-10 (his item 4): the date line of the Pórtico
 * (an <h4> typed in page 17, printed as div.glosario-h4 by
 * inc/headings.php, h4 look from customizations.css: 1.5em) is 24px on a
 * phone, where the body text is 16px; on desktop it is 21.6px next to
 * 14.4px text and reads fine. 22px on phones (line-height follows, 1.5em).
 * The other div.glosario-h4 of #container are empty spacers (no box). The
 * h4 selector covers the line if it is ever printed as the <h4> it is
 * stored as (and heading-outline-test's <h4> clone, which must match).
 * ---------------------------------------------------------------------- */
@media (max-width: 767px) {
	.home #container > :is(div.glosario-h4, h4) {
		font-size: 22px;
	}
}

/* -----------------------------------------------------------------------
 * 40. Category archives, first post closer to the archive heading, phones
 *     only, <= 767px
 *
 * Phone audit of 2026-10-10: /category/<slug>/ (archive.php) prints its
 * heading ("Archive | …", .page-title, 10px bottom padding) and then the
 * first post title with the 40px top margin of every .post-title, 49px of
 * white between them. Same treatment as the entry labels of section 31:
 * no heading padding, 16px above the first title only; the titles further
 * down keep their 40px. The first title is the one with no post's
 * .postmetadata before it (see section 38 for why not :first-of-type).
 * ---------------------------------------------------------------------- */
@media (max-width: 767px) {
	.category #content > .page-title {
		padding-bottom: 0;
	}

	.category #content > .post-title:not(.postmetadata ~ *) {
		margin-top: 16px;
	}
}

/* -----------------------------------------------------------------------
 * 41. Image gallery intro, touch wording on phones, <= 767px
 *
 * Simón, 2026-10-12 (item 1 of his sixth list): /galeriaimagenes/ (page
 * 2024) opens with two stored paragraphs written for a mouse ("Situando el
 * cursor…", "Pon a prueba…"). inc/gallery-phone-intro.php marks them
 * .glosario-gallery-intro-desktop and inserts one paragraph with the touch
 * wording, .glosario-gallery-intro-phone, centred like them. The phone
 * paragraph has no box by default, so above 767px the page is exactly as
 * before; at <= 767px the stored pair is hidden and the phone paragraph
 * shows in its place (it already ends with the "Pon a prueba" sentence).
 * ---------------------------------------------------------------------- */
.glosario-gallery-intro-phone {
	display: none;
}

@media (max-width: 767px) {
	.glosario-gallery-intro-desktop {
		display: none;
	}

	.glosario-gallery-intro-phone {
		display: block;
	}
}

/* -----------------------------------------------------------------------
 * 42. CANTERÍA and CÓMO SE LLAMA intro boxes as wide as their text, > 780px
 *
 * Simón, 2026-10-12 (item 3): on a computer the shaded intro box (.cabecera,
 * 75% wide, style.css) of /canteria/ (page 64) and /como-se-llama/ (page
 * 41316) holds one short line and looks empty at its sides; he wants it to
 * shrink to its text, still centred. Both boxes are stored inside a
 * div.contenedor, which has no style of its own; CANTERÍA's "Última
 * actualización" line is moved by inc/update-date.php into a
 * div.glosario-update-date right after the box, inside the same wrapper.
 * The wrapper shrinks to its widest child (width: fit-content), never wider
 * than the box was (75% + the 20px padding above 1024px, where the box is
 * content-box; 75% at 781-1024px, where section 4 makes it border-box), and
 * is centred; the box and the date line fill it, so the date still starts at
 * the box's text edge. A text too long for one line keeps the old width.
 * Padding, colours, margins and fonts are untouched; vertical margins still
 * collapse through the wrapper (no padding, border or new formatting
 * context), so nothing moves up or down. At <= 780px section 3 keeps its 92%
 * boxes. Without the wrapper (if the page is ever retyped) none of this
 * applies and the box keeps its 75%. Other pages are not affected.
 * ---------------------------------------------------------------------- */
@media (min-width: 781px) {
	.page-id-64 .contenedor,
	.page-id-41316 .contenedor {
		width: -moz-fit-content;
		width: fit-content;
		max-width: 75%;
		margin-left: auto;
		margin-right: auto;
	}

	.page-id-64 .contenedor > .cabecera,
	.page-id-64 .contenedor > .glosario-update-date,
	.page-id-41316 .contenedor > .cabecera,
	.page-id-41316 .contenedor > .glosario-update-date {
		width: auto;
	}
}

@media (min-width: 1025px) {
	.page-id-64 .contenedor,
	.page-id-41316 .contenedor {
		max-width: calc(75% + 20px);
	}
}
