/*
Theme Name: Howls Gazette
Description: Black-and-white, old-newspaper style block theme for the Howls of Winter black metal festival.
Version: 2.1.5
Requires at least: 6.6
Requires PHP: 8.0
Text Domain: howls-gazette
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Fonts: UnifrakturMaguntia, Playfair Display, EB Garamond (SIL Open Font License 1.1), self-hosted in assets/fonts.
*/

:root {
	--hg-ink: var(--wp--preset--color--ink);
	--hg-paper: var(--wp--preset--color--paper);
}

/* ---------- Newsprint ---------- */

body {
	/* Aged edges */
	background-image: radial-gradient(ellipse 130% 90% at 50% 40%, transparent 55%, rgba(120, 100, 60, 0.12) 100%);
	background-attachment: fixed;
}

/* Paper grain, non-interactive */
body::after {
	content: "";
	position: fixed;
	inset: 0;
	pointer-events: none;
	z-index: 9999;
	opacity: 0.35;
	mix-blend-mode: multiply;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.45 0 0 0 0 0.4 0 0 0 0 0.3 0 0 0 0.35 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection {
	background: var(--hg-ink);
	color: var(--hg-paper);
}

/* ---------- Rules ---------- */

/* Thick-over-thin newspaper rule on top of an element */
.hg-double-rule {
	background-image:
		linear-gradient(var(--hg-ink), var(--hg-ink)),
		linear-gradient(var(--hg-ink), var(--hg-ink));
	background-size: 100% 3px, 100% 1px;
	background-position: 0 0, 0 6px;
	background-repeat: no-repeat;
	padding-top: calc(7px + 0.6rem);
}

.hg-rule-bottom {
	border-bottom: 1px solid var(--hg-ink);
}

/* ---------- Masthead ---------- */

.hg-dateline {
	border-bottom: 1px solid var(--hg-ink);
	font-size: var(--wp--preset--font-size--x-small);
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.hg-dateline p {
	margin: 0;
}

.hg-masthead .wp-block-site-title {
	font-size: clamp(2.6rem, 9vw, 6rem);
}

.hg-nav-bar {
	border-bottom: 1px solid var(--hg-ink);
}

.hg-masthead .wp-block-navigation .current-menu-item > a {
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 0.3em;
}

.wp-block-navigation__responsive-container.is-menu-open {
	background-color: var(--hg-paper) !important;
}

/* ---------- Deck (italic standfirst) ---------- */

.hg-deck {
	font-family: var(--wp--preset--font-family--headline);
	font-style: italic;
}

/* ---------- Drop caps ---------- */

.has-drop-cap:not(:focus)::first-letter {
	font-family: var(--wp--preset--font-family--fraktur);
	font-size: 4.6em;
	line-height: 0.8;
	margin: 0.06em 0.12em 0 0;
	color: var(--hg-ink);
}

/* ---------- Boxes ---------- */

.hg-card {
	position: relative;
	border: 1px solid var(--hg-ink);
	background-color: rgba(255, 255, 255, 0.25);
}

.hg-card--link:hover {
	background-color: var(--wp--preset--color--paper-dark);
}

.hg-card--link h2 a::after,
.hg-card--link h3 a::after {
	content: "";
	position: absolute;
	inset: 0;
}

.hg-notice {
	border: 3px double var(--hg-ink);
}

/* ---------- Line-up ---------- */

.hg-band {
	display: flex;
	flex-direction: column;
	border-top: 3px solid var(--hg-ink);
	padding-top: 1rem;
}

.hg-band .wp-block-heading {
	text-align: center;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	line-height: 1.2;
	/* The embed below uses margin-top:auto, so the gap to the video lives here */
	margin: 0 0 0.9rem;
	/* Scales with the viewport so names fit a three-column row */
	font-size: clamp(1rem, 1.25vw, 1.3rem) !important;
}

.hg-band .wp-block-embed {
	margin: auto 0 0; /* pin videos to the bottom so a row lines up */
	border: 1px solid var(--hg-ink);
	padding: 6px;
	background: var(--wp--preset--color--paper-dark);
}

/* Videos print in black and white until you reach for them */
.hg-band .wp-block-embed iframe {
	display: block;
	filter: grayscale(1) contrast(1.1);
	transition: filter 0.4s ease;
}

.hg-band:hover .wp-block-embed iframe,
.hg-band:focus-within .wp-block-embed iframe {
	filter: none;
}

/* ---------- Tables & lists ---------- */

.wp-block-table table {
	border-collapse: collapse;
	width: 100%;
}

.wp-block-table thead {
	border-bottom: 3px double var(--hg-ink);
}

.wp-block-table th,
.wp-block-table td {
	border: 0;
	border-bottom: 1px solid var(--wp--preset--color--rule);
	padding: 0.8em 0.6em;
	text-align: left;
}

.wp-block-table th {
	font-size: var(--wp--preset--font-size--x-small);
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--hg-ink);
}

li::marker {
	color: var(--hg-ink);
}

/* ---------- Focus ---------- */

:where(a, button, input, .wp-element-button):focus-visible {
	outline: 2px solid var(--hg-ink);
	outline-offset: 3px;
}

/* ---------- Headline links ---------- */

:where(h1, h2, h3, h4) a {
	text-decoration: none;
}

:where(h1, h2, h3, h4) a:hover {
	text-decoration: underline;
	text-decoration-thickness: 2px;
}

/* Breathing room between the page-title rule and the content */
.hg-rule-bottom + .wp-block-post-content {
	margin-top: var(--wp--preset--spacing--50);
}

/* ---------- Logo ---------- */

.hg-logo {
	margin: 0;
	width: 100%;
	text-align: center;
}

.hg-logo img {
	width: auto;
	max-width: 100%;
	height: auto;
}

/* Footer closing rule: separator drawn as the thick-over-thin rule */
.wp-block-separator.hg-double-rule {
	border: 0;
	height: 7px;
	padding: 0;
	background-color: transparent !important;
	opacity: 1;
}

/* Legal links in the footer: very small */
.wp-block-navigation.hg-legal {
	font-size: 0.68rem;
	font-weight: 400;
	letter-spacing: 0.14em;
}

.wp-block-navigation.hg-legal a {
	color: var(--wp--preset--color--faded);
}

/* Page titles are shown by the active menu item; keep the h1 for screen readers only */
.hg-visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
