/*
Theme Name: I Hate Perfume
Theme URI: https://ihateperfume.com
Description: "Warning Label" block theme for ihateperfume.com: ink and signal red, condensed Archivo headlines, IBM Plex Mono labels.
Version: 0.14.4
Requires at least: 6.6
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ihateperfume
*/

/* Settings theme.json can't express: width axis, borders, block style variations. */

:root {
	--ihp-rule: 4px solid var(--wp--preset--color--ink);
	--ihp-mono: var(--wp--preset--font-family--plex-mono);
}

h1, h2, h3, h4, h5, h6,
.wp-block-post-title {
	font-stretch: 75%;
	text-wrap: balance;
}

/* ---------- Header ---------- */

.ihp-announce {
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--paper);
	font-family: var(--ihp-mono);
	font-size: var(--wp--preset--font-size--x-small);
	letter-spacing: 0.08em;
	text-align: center;
	text-transform: uppercase;
	padding-block: 0.6rem;
}
.ihp-announce p { margin: 0; }

.ihp-header {
	border-bottom: var(--ihp-rule);
	padding-block: 1.25rem;
}

.ihp-logo {
	margin: 0;
	font-size: clamp(1.5rem, 3vw, 1.875rem);
	font-stretch: 75%;
	font-weight: 900;
	letter-spacing: -0.01em;
	line-height: 1;
	text-transform: uppercase;
}
.ihp-logo a { text-decoration: none; }
/* Five menu items + the Discord button only fit on wide screens; Discord is also in the hero and footer. */
@media (max-width: 1180px) {
	.ihp-header .wp-block-buttons.ihp-header-cta { display: none; }
}
@media (max-width: 900px) {
	.ihp-header .wp-block-navigation .wp-block-navigation__container { gap: 1rem; }
	.ihp-header .wp-block-navigation { font-size: 0.875rem; }
}
.ihp-logo a::after { content: "."; color: var(--wp--preset--color--signal); }

/* Mobile menu overlay: big condensed type, like the rest of the brand */
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
	align-items: flex-start !important;
	padding-top: 4rem;
}
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
	align-items: flex-start !important;
	gap: 1.25rem !important;
}
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	font-family: var(--wp--preset--font-family--archivo);
	font-size: 2.75rem;
	font-stretch: 70%;
	font-weight: 900;
	line-height: 1;
	border-bottom: 6px solid var(--wp--preset--color--signal);
}

/* ---------- Shared pieces ---------- */

.ihp-section { padding-block: var(--wp--preset--spacing--70) 0; }
.ihp-section:last-child { padding-bottom: var(--wp--preset--spacing--70); }

.ihp-kicker,
.is-style-mono {
	font-family: var(--ihp-mono);
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}
.ihp-kicker { color: var(--wp--preset--color--signal); margin: 0; }

.ihp-lede { font-size: var(--wp--preset--font-size--large); max-width: 40rem; }
.wp-block-post-content > .ihp-lede { max-width: var(--wp--style--global--content-size); }

.ihp-display {
	margin: 0;
	font-size: var(--wp--preset--font-size--display);
	font-stretch: 62%;
	font-weight: 900;
	letter-spacing: -0.02em;
	line-height: 0.82;
	text-transform: uppercase;
}

/* Outline buttons: ink border, fills on hover */
.wp-block-button.is-style-outline > .wp-block-button__link {
	border: 3px solid currentColor;
	background: transparent;
	color: var(--wp--preset--color--ink);
	padding: calc(1rem - 3px) calc(1.75rem - 3px);
}
.wp-block-button.is-style-outline > .wp-block-button__link:hover,
.wp-block-button.is-style-outline > .wp-block-button__link:focus {
	background: var(--wp--preset--color--ink);
	border-color: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--paper);
}

:where(a, button, input, .wp-block-button__link):focus-visible {
	outline: 3px solid var(--wp--preset--color--signal);
	outline-offset: 3px;
}

/* ---------- Block style: ingredients label panel ---------- */

.is-style-label-panel {
	border: var(--ihp-rule);
	padding: 1.5rem;
	background: var(--wp--preset--color--paper);
}
.is-style-label-panel > * { margin-block: 0; }
.is-style-label-panel > * + * { margin-top: 0.75rem; }
.is-style-label-panel .ihp-label-title {
	font-size: var(--wp--preset--font-size--x-large);
	border-bottom: 10px solid var(--wp--preset--color--ink);
	padding-bottom: 0.5rem;
}
.is-style-label-panel .is-style-mono { font-weight: 400; text-transform: none; font-size: var(--wp--preset--font-size--small); line-height: 1.55; }
.is-style-label-panel .ihp-footnote { border-top: 2px solid var(--wp--preset--color--ink); padding-top: 0.75rem; }
.ihp-ingredients strong {
	background: var(--wp--preset--color--signal);
	color: var(--wp--preset--color--paper);
	padding: 0 0.25em;
}

/* ---------- Block style: ruled card (story wall) ---------- */

.is-style-ruled {
	border-top: 10px solid var(--wp--preset--color--ink);
	padding-top: 1.25rem;
}
.is-style-ruled.ihp-accent { border-top-color: var(--wp--preset--color--signal); }

/* ---------- Hero ---------- */

.ihp-hero {
	border-bottom: var(--ihp-rule);
	padding-block: var(--wp--preset--spacing--60);
}
.ihp-hero h1 { max-width: 46rem; font-size: clamp(2.25rem, 4.5vw, 3.25rem); line-height: 1; font-stretch: 80%; }

/* ---------- Stats band ---------- */

.ihp-stats { border-bottom: var(--ihp-rule); }
.ihp-stats .wp-block-columns { gap: 0; margin: 0; }
.ihp-stats .wp-block-column { padding: var(--wp--preset--spacing--50) var(--wp--preset--spacing--40); }
.ihp-stats .wp-block-column + .wp-block-column { border-left: var(--ihp-rule); }
.ihp-stat-number {
	margin: 0;
	color: var(--wp--preset--color--signal);
	font-size: clamp(3rem, 6vw, 4.5rem);
	font-stretch: 70%;
	font-weight: 900;
	line-height: 1;
}
.ihp-stats-more { margin: 0; padding-block: 1.25rem; border-top: var(--ihp-rule); display: flex; flex-wrap: wrap; gap: 0.75rem 2rem; }
.ihp-cite { font-family: var(--ihp-mono); font-size: var(--wp--preset--font-size--x-small); }

/* Evidence grade badges (see research/claims): the text carries the meaning, the dot is decoration. */
.ihp-grade {
	font-family: var(--ihp-mono);
	font-size: var(--wp--preset--font-size--x-small);
	line-height: 1.5;
	margin-top: 0.75rem;
}
.ihp-grade::before {
	content: "";
	display: inline-block;
	width: 0.7em;
	height: 0.7em;
	border-radius: 50%;
	margin-right: 0.45em;
	vertical-align: 0.02em;
	background: currentColor;
}
.ihp-grade--strong::before { background: #2E7D32; }
.ihp-grade--moderate::before { background: linear-gradient(90deg, #B06F00 50%, transparent 50%); box-shadow: inset 0 0 0 0.12em #B06F00; }
.ihp-grade--weak::before { background: transparent; box-shadow: inset 0 0 0 0.14em #D2461F; }
@media (max-width: 781px) {
	.ihp-stats .wp-block-column { padding-inline: 0; }
	.ihp-stats .wp-block-column + .wp-block-column { border-left: 0; border-top: var(--ihp-rule); }
}

/* ---------- Article cards (query loop) ---------- */

/* Each card draws its own right and bottom edges (the list draws the top and left), so a short last row
   ends cleanly instead of leaving an empty framed cell. */
.ihp-cards .wp-block-post-template { gap: 0; border-top: var(--ihp-rule); border-left: var(--ihp-rule); }
.ihp-cards .wp-block-post-template > li { border-right: var(--ihp-rule); border-bottom: var(--ihp-rule); }
.ihp-card { height: 100%; padding: 2rem; box-sizing: border-box; gap: 1rem; }
.ihp-card .wp-block-post-terms { color: var(--wp--preset--color--signal); }
.ihp-card .wp-block-post-terms a { color: inherit; text-decoration: none; }
.ihp-card .wp-block-post-title { font-size: clamp(1.5rem, 1.1rem + 1vw, 2.1rem); line-height: 1.02; margin: 0; overflow-wrap: normal; word-break: normal; hyphens: manual; }
.ihp-card .wp-block-post-excerpt { margin: 0; }
.ihp-card .wp-block-post-excerpt__more-link { font-family: var(--ihp-mono); font-weight: 600; text-transform: uppercase; }
/* Guide cards (columns) too: never split a word across lines. */
.ihp-coming h3 { overflow-wrap: normal; word-break: normal; hyphens: manual; }

/* ---------- Dark campaign box ---------- */

.ihp-dark {
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--paper);
	padding: var(--wp--preset--spacing--60);
}
.ihp-dark a:not(.wp-block-button__link) { color: var(--wp--preset--color--paper); }
.ihp-dark .ihp-kicker { color: var(--wp--preset--color--signal-light); }
.ihp-dark h2 { font-size: clamp(2.75rem, 6vw, 4.75rem); }
.ihp-dark .wp-block-button.is-style-outline > .wp-block-button__link { color: var(--wp--preset--color--paper); }
.ihp-dark .wp-block-button.is-style-outline > .wp-block-button__link:hover,
.ihp-dark .wp-block-button.is-style-outline > .wp-block-button__link:focus { background: var(--wp--preset--color--paper); color: var(--wp--preset--color--ink); border-color: var(--wp--preset--color--paper); }

/* ---------- What's coming (launch page) ---------- */

.ihp-coming { margin-bottom: var(--wp--preset--spacing--60); }
.ihp-coming h3 a { text-decoration: none; }
.ihp-coming h3 a:hover, .ihp-coming h3 a:focus-visible { text-decoration: underline; }
.ihp-coming h3 { font-size: clamp(1.5rem, 2.5vw, 1.875rem); line-height: 1; margin-block: 0.5rem; }
.ihp-coming .is-style-mono { margin: 0; color: var(--wp--preset--color--signal); }
.ihp-coming .ihp-tools__go { margin-top: 0.75rem; font-weight: 600; }
.ihp-coming .ihp-tools__go a { color: inherit; }
.ihp-tools-band .ihp-coming { margin-bottom: 0; }
.ihp-stats a.ihp-cite { text-decoration: underline; }

/* ---------- Check a product ---------- */

.ihp-tools { margin-block: var(--wp--preset--spacing--50); }
.ihp-tools h3 { font-size: clamp(1.5rem, 2.5vw, 1.875rem); line-height: 1; margin-block: 0.5rem; }
.ihp-tools .is-style-mono { margin: 0; color: var(--wp--preset--color--signal); }
.ihp-tip { max-width: 46rem; }
.ihp-tip .ihp-decoder-link { border-top: 2px solid var(--wp--preset--color--ink); padding-top: 0.75rem; font-weight: 600; }

/* ---------- Merch ---------- */

.ihp-merch-tile {
	background: var(--wp--preset--color--label);
	min-height: 17rem;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.5rem;
	box-sizing: border-box;
}
.ihp-merch-meta { font-family: var(--ihp-mono); font-weight: 600; font-size: var(--wp--preset--font-size--small); text-transform: uppercase; }
.ihp-merch-meta p { margin: 0; }

.ihp-pin {
	width: 10rem;
	height: 10rem;
	margin: 0;
	border-radius: 50%;
	background: var(--wp--preset--color--ink);
	border: 6px solid var(--wp--preset--color--signal);
	box-sizing: border-box;
	color: var(--wp--preset--color--paper);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 4rem;
	font-stretch: 62%;
	font-weight: 900;
	line-height: 1;
	text-transform: uppercase;
}
.ihp-sticker {
	margin: 0;
	max-width: 21rem;
	border: 5px solid var(--wp--preset--color--ink);
	background: var(--wp--preset--color--paper);
	padding: 1.25rem 1.5rem;
	font-size: 1.875rem;
	font-stretch: 75%;
	font-weight: 900;
	line-height: 1;
	text-align: center;
	text-transform: uppercase;
}
.ihp-magnet {
	width: 14rem;
	height: 14rem;
	overflow-wrap: normal;
	hyphens: none;
	margin: 0;
	background: var(--wp--preset--color--signal);
	color: var(--wp--preset--color--paper);
	padding: 1.25rem;
	box-sizing: border-box;
	display: flex;
	align-items: flex-end;
	font-size: 2rem;
	font-stretch: 70%;
	font-weight: 900;
	line-height: 0.95;
	text-transform: uppercase;
}

/* ---------- Footer ---------- */

.ihp-footer {
	border-top: var(--ihp-rule);
	padding-block: var(--wp--preset--spacing--60);
}
.ihp-footer h2 { font-size: var(--wp--preset--font-size--x-large); }
.ihp-footer-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.75rem; font-family: var(--ihp-mono); font-weight: 600; text-transform: uppercase; font-size: var(--wp--preset--font-size--small); }
.ihp-footer-links a { text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.ihp-footer-links a:hover, .ihp-footer-links a:focus-visible { text-decoration: underline; }
.ihp-legal { font-family: var(--ihp-mono); font-size: var(--wp--preset--font-size--x-small); text-transform: uppercase; }

/* ---------- Single posts ---------- */

.ihp-post-meta { font-family: var(--ihp-mono); }
.wp-block-post-content h2 { font-size: var(--wp--preset--font-size--x-large); margin-top: 2.5em; }
.wp-block-post-content h3 { font-size: var(--wp--preset--font-size--large); margin-top: 2em; }
.wp-block-post-content > p:first-child { font-size: var(--wp--preset--font-size--large); }

/* Printable signs page */
.ihp-sign-preview img { border: 1px solid #ddd; box-shadow: 0 2px 10px rgba(0,0,0,.08); max-width: 320px; width: 100%; height: auto; }

/* Footer menu (grouped) */
.ihp-footer-nav { margin-top: 2.5rem; row-gap: 1.5rem; }
.ihp-footer-nav__title { font-family: var(--ihp-mono); font-weight: 600; text-transform: uppercase; font-size: var(--wp--preset--font-size--x-small); letter-spacing: .06em; opacity: .75; margin: 0 0 .35rem; }
.ihp-footer-nav__list { list-style: none; padding: 0; margin: 0; }
.ihp-footer-nav__list a { text-decoration: none; font-weight: 600; min-height: 40px; display: inline-flex; align-items: center; }
.ihp-footer-nav__list a:hover, .ihp-footer-nav__list a:focus-visible { text-decoration: underline; }
@media (max-width: 781px) { .ihp-footer-nav { display: grid !important; grid-template-columns: 1fr 1fr; gap: 1.5rem 1rem; } }

/* Keep reading (single posts) */
.ihp-keep-reading__title { margin-top: 3rem; }
.ihp-keep-reading__more { display: flex; flex-wrap: wrap; gap: .5rem 1.75rem; margin-top: 1.5rem; }

/* Email-address buttons: lowercase, no tracking, one line (uppercase + letter-spacing wrapped ".com" on phones). */
.ihp-footer .wp-block-button__link[href^="mailto:admin@"] { text-transform: none; letter-spacing: 0; white-space: nowrap; }
@media (max-width: 420px) { .ihp-footer .wp-block-button__link[href^="mailto:admin@"] { padding-inline: 1.1rem; font-size: 1.05rem; } }

/* Share links (single posts) */
.ihp-share { margin-top: 2rem; }
.ihp-share__label { font-family: var(--ihp-mono); font-weight: 600; text-transform: uppercase; font-size: var(--wp--preset--font-size--x-small); letter-spacing: .06em; margin: 0 0 .5rem; }
.ihp-share__row { display: flex; flex-wrap: wrap; gap: .5rem; }
.ihp-share__btn { font: 600 var(--wp--preset--font-size--small)/1 var(--ihp-mono); text-transform: uppercase; letter-spacing: .03em; padding: .7rem .9rem; min-height: 44px; display: inline-flex; align-items: center; border: 2px solid var(--wp--preset--color--ink); background: var(--wp--preset--color--paper); color: var(--wp--preset--color--ink); text-decoration: none; cursor: pointer; }
.ihp-share__btn:hover, .ihp-share__btn:focus-visible { background: var(--wp--preset--color--ink); color: var(--wp--preset--color--paper); }

/* Header search (icon that expands) */
.ihp-header-search { margin: 0; }
.ihp-header-search .wp-block-search__button { background: transparent; color: var(--wp--preset--color--ink); border: 2px solid var(--wp--preset--color--ink); padding: .45rem; min-width: 44px; min-height: 44px; }
.ihp-header-search .wp-block-search__button:hover, .ihp-header-search .wp-block-search__button:focus-visible { background: var(--wp--preset--color--ink); color: var(--wp--preset--color--paper); }
.ihp-header-search .wp-block-search__input { border: 2px solid var(--wp--preset--color--ink); border-radius: 0; font: inherit; min-height: 44px; }
.ihp-search-facts { margin-top: 1rem; }
@media (max-width: 599px) {
	.ihp-header .ihp-logo { order: 0; margin-right: auto; }
	.ihp-header .ihp-header-search { order: 1; }
	.ihp-header .ihp-nav { order: 2; }
}

/* ---------- Print: clean handouts of guides and articles ---------- */
@media print {
	@page { margin: 1.6cm 1.8cm; }
	body { background: #fff !important; color: #000 !important; font-size: 11pt; }
	.ihp-announce, .ihp-header .ihp-nav, .ihp-header-search, .ihp-header-cta,
	.ihp-share, .ihp-keep-reading, .ihp-keep-reading__title, .ihp-keep-reading__more,
	.ihp-footer .wp-block-columns, .ihp-footer nav, .ihp-copy__button, .ihp-copy__wrap button,
	.wp-block-post-navigation-link, .ihp-dark, .ihp-stories-teaser, .ihp-form, .wp-block-buttons { display: none !important; }
	.ihp-header, .ihp-footer { border: 0 !important; padding: 0 !important; background: none !important; }
	a { color: #000 !important; text-decoration: underline; }
	/* Citations: print the address so readers can look the paper up. */
	.ihp-claim__cite a[href^="http"]::after, .ihp-fact__source a[href^="http"]:not(.ihp-fact__link)::after { content: " (" attr(href) ")"; font-size: 8pt; word-break: break-all; }
	h1, h2, h3 { break-after: avoid; page-break-after: avoid; }
	.ihp-claim, li, figure, .ihp-fact { break-inside: avoid; }
	pre.ihp-copy { white-space: pre-wrap; border: 1px solid #000; }
	.ihp-dot::after { display: none !important; }
	.ihp-dot, .ihp-grade::before { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* /symbol/ download previews: keep the tall phone wallpaper from towering over its row. */
.ihp-symbol-preview img { display: block; width: auto; max-width: 100%; max-height: 360px; margin-inline: auto; }

/* Big monitors: scale the whole page up rather than stretching lines of text. The content column is in rem,
   so it grows with the text and stays about 70 characters wide; wide sections (cards, tools) get more room. */
@media (min-width: 1700px) { html { font-size: 106.25%; } }
@media (min-width: 2200px) { html { font-size: 118.75%; } }

/* Hub pages (Learn): the lede keeps a readable width but lines up with the wide column's left edge. */
.ihp-hub .wp-block-post-content > .ihp-lede { max-width: 48rem; margin-left: max(0px, calc((100% - var(--wp--style--global--wide-size)) / 2)) !important; margin-right: auto !important; }
