/*
Theme Name: No Kings Broadsheet
Theme URI: https://nokings.coffee/
Description: A broadsheet-newspaper child theme for No Kings Coffee. Nameplate masthead, ruled columns, drop caps, The Market, Latest Dispatches, The Jukebox and Classifieds — every section is a block pattern you can add, edit, reorder or delete in the Site Editor. Fonts are self-hosted; embeds are click-to-play.
Author: No Kings Coffee
Template: twentytwentyfive
Version: 1.0.0
Requires at least: 6.7
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: no-kings-broadsheet
*/

/* ==========================================================================
   Tokens
   ========================================================================== */
:root {
	--nk-ink: var(--wp--preset--color--contrast);
	--nk-paper: var(--wp--preset--color--base);
	--nk-spot: var(--wp--preset--color--accent-1);
	--nk-blue: var(--wp--preset--color--accent-2);
	--nk-rule: var(--wp--preset--color--accent-3);
	--nk-muted: var(--wp--preset--color--accent-4);
	--nk-halftone: var(--wp--preset--color--accent-5);
	--nk-white: var(--wp--preset--color--accent-6);
	--nk-label: var(--wp--preset--font-family--oswald);
	--nk-display: var(--wp--preset--font-family--playfair-display);
	--nk-body: var(--wp--preset--font-family--source-serif);
	--nk-gutter: 28px;
	--nk-sheet: 1280px;
}

/* ==========================================================================
   The sheet (page width container)
   ========================================================================== */
.nk-sheet {
	max-width: var(--nk-sheet);
	margin-left: auto !important;
	margin-right: auto !important;
	padding-left: 24px;
	padding-right: 24px;
	box-sizing: border-box;
}
main.nk-sheet { padding-bottom: 32px; }

/* Shared label type (Oswald small caps feel) */
.nk-label,
.is-style-nk-kicker,
.is-style-nk-byline,
.is-style-nk-rail-head,
.is-style-nk-flag,
.nk-dateline,
.nk-index,
.nk-price {
	font-family: var(--nk-label);
	text-transform: uppercase;
	letter-spacing: 0.12em;
}

/* ==========================================================================
   Masthead
   ========================================================================== */
.nk-masthead { padding-top: 20px; }
.nk-masthead__top { margin-bottom: 0 !important; }
.nk-masthead .wp-block-site-title {
	font-family: var(--nk-display);
	font-weight: 900;
	font-size: clamp(36px, 9vw, 124px);
	line-height: 0.95;
	letter-spacing: -0.01em;
	text-align: center;
	margin: 0;
}
.nk-masthead .wp-block-site-title a { text-decoration: none; color: var(--nk-ink); }
.nk-masthead .wp-block-site-title a:hover { color: var(--nk-ink); }
.nk-masthead .wp-block-site-tagline {
	text-align: center;
	font-style: italic;
	font-size: 16px;
	color: var(--nk-muted);
	margin-top: 10px;
}
.is-style-nk-ear {
	border: 1px solid var(--nk-ink);
	padding: 10px 14px;
	max-width: 230px;
	font-size: 14px;
	line-height: 1.35;
}
.is-style-nk-ear > * { margin: 0 !important; }
.nk-ear-col--right .is-style-nk-ear { margin-left: auto; text-align: right; }
@media (max-width: 781px) {
	.nk-ear-col { display: none; }
}

.nk-dateline {
	margin-top: 12px !important;
	border-top: 1px solid var(--nk-ink);
	border-bottom: 4px solid var(--nk-ink);
	padding: 6px 0;
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0.1em;
	gap: 6px 24px;
}
.nk-dateline > * { margin: 0 !important; }

nav.nk-index {
	border-bottom: 1px solid var(--nk-ink);
	padding: 8px 0;
	margin-top: 0 !important;
	font-size: 14px;
	font-weight: 500;
	letter-spacing: 0.08em;
}
.nk-index .wp-block-navigation__container { row-gap: 4px; column-gap: 0; justify-content: center; }
.nk-index .wp-block-navigation-item__content { padding: 0 16px; text-decoration: none; }
.nk-index .wp-block-navigation-item__content:hover { text-decoration: underline; text-underline-offset: 3px; }
@media (min-width: 600px) {
	.nk-index .wp-block-navigation__container > .wp-block-navigation-item + .wp-block-navigation-item::before {
		content: "·";
		display: inline-block;
	}
}

/* ==========================================================================
   Ruled columns — vertical rules between columns, like newspaper gutters
   ========================================================================== */
.wp-block-columns.is-style-nk-ruled { gap: 0 !important; }
@media (min-width: 782px) {
	.is-style-nk-ruled > .wp-block-column { padding-left: calc(var(--nk-gutter) / 2); padding-right: calc(var(--nk-gutter) / 2); }
	.is-style-nk-ruled > .wp-block-column:first-child { padding-left: 0; }
	.is-style-nk-ruled > .wp-block-column:last-child { padding-right: 0; }
	.is-style-nk-ruled > .wp-block-column + .wp-block-column { border-left: 1px solid var(--nk-rule); }
	.is-style-nk-ruled.nk-heavy-rule > .wp-block-column + .wp-block-column { border-left-color: var(--nk-ink); }
}
@media (max-width: 781px) {
	.is-style-nk-ruled > .wp-block-column + .wp-block-column { border-top: 1px solid var(--nk-rule); padding-top: 20px; margin-top: 20px; }
}

/* Newspaper text columns with a drop cap */
.is-style-nk-text-columns {
	column-width: 230px;
	column-gap: var(--nk-gutter);
	column-rule: 1px solid var(--nk-rule);
}
.is-style-nk-text-columns > p { margin: 0 0 12px !important; text-align: justify; hyphens: auto; }
.is-style-nk-text-columns > p:first-child::first-letter,
.nk-article .wp-block-post-content > p:first-of-type::first-letter {
	font-family: var(--nk-display);
	font-weight: 900;
	float: left;
	font-size: 76px;
	line-height: 0.82;
	padding: 6px 8px 0 0;
	color: var(--nk-ink);
}

/* ==========================================================================
   Type styles
   ========================================================================== */
.is-style-nk-kicker {
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.14em;
	color: var(--nk-spot);
	margin-bottom: 0 !important;
}
.is-style-nk-deck {
	font-family: var(--nk-display);
	font-style: italic;
	font-weight: 700;
	font-size: 23px;
	line-height: 1.3;
	color: var(--nk-muted);
}
.is-style-nk-byline {
	border-top: 1px solid var(--nk-ink);
	border-bottom: 1px solid var(--nk-ink);
	padding: 4px 0;
	font-size: 12px;
	font-weight: 500;
}
.nk-price { font-size: 13px; font-weight: 500; letter-spacing: 0.06em; margin: 0 !important; }
.nk-more a,
a.nk-more {
	font-family: var(--nk-label);
	font-weight: 600;
	font-size: 13px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	text-underline-offset: 4px;
}

/* Section flag: "OPINION ————————" */
.is-style-nk-flag {
	display: flex;
	align-items: center;
	gap: 16px;
	font-size: 20px !important;
	font-weight: 600;
	letter-spacing: 0.16em;
	line-height: 1.2;
	margin-top: 0 !important;
}
.is-style-nk-flag::after { content: ""; flex: 1; border-top: 1px solid var(--nk-ink); }
.nk-flag-row { gap: 16px !important; }
.nk-flag-row > .is-style-nk-flag { flex: 1 1 auto; margin: 0 !important; }
.nk-flag-row > p { margin: 0 !important; white-space: nowrap; }
@media (max-width: 600px) {
	.nk-flag-row { flex-wrap: wrap !important; }
	.nk-flag-row > .is-style-nk-flag { flex-basis: 100%; }
}

/* Rail head: "THE MARKET" boxed by thick/thin rules */
.is-style-nk-rail-head {
	border-top: 4px solid var(--nk-ink);
	border-bottom: 1px solid var(--nk-ink);
	padding: 6px 0;
	font-size: 18px !important;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-align: center;
	line-height: 1.3;
}

/* Separators */
hr.wp-block-separator.is-style-nk-double {
	border: 0;
	border-top: 4px double var(--nk-ink);
	height: 0;
	opacity: 1;
	width: 100%;
	margin-top: 28px;
	margin-bottom: 20px;
}
hr.wp-block-separator.is-style-nk-thick {
	border: 0;
	border-top: 4px solid var(--nk-ink);
	height: 0;
	opacity: 1;
	width: 100%;
	max-width: none;
}

/* ==========================================================================
   The Market (product listings)
   ========================================================================== */
.nk-listing { padding: 18px 0; border-bottom: 1px solid var(--nk-rule); }
.nk-listing:last-of-type { border-bottom-color: var(--nk-ink); }
.nk-listing > * { margin-top: 0 !important; margin-bottom: 8px !important; }
.nk-listing h3 { font-size: 32px; line-height: 1.05; }
.nk-listing .nk-listing__line { font-style: italic; color: var(--nk-muted); }
.nk-listing .nk-listing__notes { font-size: 15px; }

/* ==========================================================================
   Pull quote
   ========================================================================== */
.wp-block-pullquote.is-style-nk-rules,
.nk-pullquote {
	border-top: 4px solid var(--nk-ink);
	border-bottom: 4px solid var(--nk-ink);
	padding: 20px 0;
	text-align: left;
}
.wp-block-pullquote.is-style-nk-rules blockquote p {
	font-family: var(--nk-display);
	font-style: italic;
	font-weight: 700;
	font-size: 26px;
	line-height: 1.3;
}
.wp-block-pullquote.is-style-nk-rules cite {
	font-family: var(--nk-label);
	font-style: normal;
	font-size: 12px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--nk-muted);
}

/* ==========================================================================
   Classifieds
   ========================================================================== */
.is-style-nk-classified,
.is-style-nk-classified-bold,
.is-style-nk-classified-featured {
	border: 1px solid var(--nk-ink);
	padding: 14px 16px;
	height: 100%;
	box-sizing: border-box;
}
.is-style-nk-classified-bold { border-width: 2px; padding: 18px 20px; }
.is-style-nk-classified-featured { background: var(--nk-ink); color: var(--nk-paper); }
.is-style-nk-classified-featured a { color: var(--nk-paper); }
.is-style-nk-classified > *,
.is-style-nk-classified-bold > *,
.is-style-nk-classified-featured > * { margin-top: 0 !important; margin-bottom: 6px !important; }
.nk-ad-title {
	font-family: var(--nk-label);
	font-weight: 600;
	font-size: 16px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	line-height: 1.3;
}
.is-style-nk-classified-bold .nk-ad-title { font-size: 22px; }
.nk-classifieds-grid { gap: 16px !important; }
.nk-classifieds-grid p { font-size: 15px; }

/* ==========================================================================
   Jukebox
   ========================================================================== */
.is-style-nk-featured {
	background: var(--nk-ink);
	color: var(--nk-paper);
	padding: 22px;
}
.is-style-nk-featured > * { margin-top: 0 !important; margin-bottom: 12px !important; }
.is-style-nk-featured a { color: var(--nk-paper); }
.is-style-nk-featured .is-style-nk-kicker { color: #E9A39C; }
.is-style-nk-featured .nk-muted-on-ink { color: #D9D1C0; font-style: italic; }
.is-style-nk-featured h3 { font-size: 30px; line-height: 1.1; color: var(--nk-paper); }

ul.is-style-nk-rotation { list-style: none; padding: 0; margin-left: 0; }
ul.is-style-nk-rotation li { padding: 8px 0; border-top: 1px solid var(--nk-rule); font-size: 15px; }
ul.is-style-nk-rotation li:last-child { border-bottom: 1px solid var(--nk-rule); }

.nk-jukebox-entry { padding: 24px 0; border-bottom: 1px solid var(--nk-rule); }
.nk-jukebox-entry > * { margin-top: 0 !important; margin-bottom: 10px !important; }

/* Click-to-play facade (see functions.php) */
.nk-facade {
	position: relative;
	aspect-ratio: 16 / 9;
	background-color: #2B2620;
	background-image: radial-gradient(#4A443B 1.1px, transparent 1.3px);
	background-size: 6px 6px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	color: #F4F0E6;
	text-align: center;
	padding: 16px;
	box-sizing: border-box;
}
.nk-facade--audio { aspect-ratio: auto; min-height: 160px; }
.nk-facade__play {
	width: 64px;
	height: 64px;
	border-radius: 50%;
	border: 2px solid #F4F0E6;
	background: var(--nk-spot);
	color: #F4F0E6;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
}
.nk-facade__play:hover,
.nk-facade__play:focus-visible { filter: brightness(1.15); outline: 2px solid #F4F0E6; outline-offset: 3px; }
.nk-facade__note { font-size: 12px; line-height: 1.4; margin: 0; color: #CFC6B4; max-width: 34ch; }
.wp-block-embed .wp-block-embed__wrapper:has(> .nk-facade)::before { display: none !important; }
.nk-facade-loaded iframe { border: 0; }
.wp-block-embed:not(.wp-has-aspect-ratio) .nk-facade-loaded iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; }

/* ==========================================================================
   Dispatches (query loops)
   ========================================================================== */
.nk-lead-dispatch { padding-bottom: 20px; border-bottom: 1px solid var(--nk-ink); }
.nk-lead-dispatch .wp-block-post-title { font-size: 36px; line-height: 1.08; }
.nk-lead-dispatch .wp-block-post-title a,
.nk-brief-dispatches .wp-block-post-title a,
.nk-dispatch-list .wp-block-post-title a { text-decoration: none; }
.nk-meta { font-family: var(--nk-label); font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--nk-spot); gap: 8px !important; }
.nk-meta > * { margin: 0 !important; }
.nk-meta a { color: inherit; text-decoration: none; }
.nk-brief-dispatches .wp-block-post-title { font-size: 22px; line-height: 1.15; font-weight: 700; }
.nk-brief-dispatches .wp-block-post-date { font-family: var(--nk-label); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--nk-muted); }
.nk-brief-dispatches .wp-block-post-excerpt { font-size: 15px; }
@media (min-width: 782px) {
	.nk-brief-dispatches .wp-block-post-template.is-layout-grid { gap: 0 !important; }
	.nk-brief-dispatches .wp-block-post-template > li { padding: 0 20px; }
	.nk-brief-dispatches .wp-block-post-template > li:first-child { padding-left: 0; }
	.nk-brief-dispatches .wp-block-post-template > li:last-child { padding-right: 0; }
	.nk-brief-dispatches .wp-block-post-template > li + li { border-left: 1px solid var(--nk-rule); }
}
.nk-dispatch-list .wp-block-post-template > li { padding: 24px 0; border-bottom: 1px solid var(--nk-rule); }
.nk-dispatch-list .wp-block-post-title { font-size: 32px; line-height: 1.1; }
.wp-block-post-excerpt__more-link { font-style: italic; }

/* Lead dispatch without a featured image: let the text take the full width */
.nk-lead-dispatch .wp-block-columns:not(:has(.wp-block-post-featured-image)) > .wp-block-column:first-child { display: none; }
.nk-lead-dispatch .wp-block-columns:not(:has(.wp-block-post-featured-image)) > .wp-block-column:last-child { flex-basis: 100% !important; }
.nk-dispatch-list .wp-block-columns:not(:has(.wp-block-post-featured-image)) > .wp-block-column:first-child { display: none; }
.nk-dispatch-list .wp-block-columns:not(:has(.wp-block-post-featured-image)) > .wp-block-column:last-child { flex-basis: 100% !important; border-left: 0; padding-left: 0; }

/* Halftone placeholder for empty featured images */
.nk-halftone,
.wp-block-post-featured-image:empty {
	background-color: var(--nk-halftone);
	background-image: radial-gradient(#B9B09C 1.1px, transparent 1.3px);
	background-size: 6px 6px;
}
.wp-block-image figcaption,
.wp-block-post-featured-image figcaption {
	font-size: 13px;
	line-height: 1.4;
	color: var(--nk-muted);
	border-bottom: 1px solid var(--nk-rule);
	padding-bottom: 6px;
	text-align: left;
	margin-top: 6px;
}

/* ==========================================================================
   Articles (single posts and pages)
   ========================================================================== */
.nk-article .wp-block-post-title { font-size: clamp(40px, 5vw, 64px); line-height: 1.05; font-weight: 900; }
.nk-article .wp-block-post-content > p { text-align: justify; hyphens: auto; }

/* Previous / next dispatch */
.nk-post-nav { display: grid !important; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px !important; }
.nk-post-nav .post-navigation-link-next { text-align: right; }
.nk-post-nav .post-navigation-link__label {
	display: block;
	font-family: var(--nk-label);
	font-size: 12px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--nk-muted);
}
.nk-post-nav a { font-family: var(--nk-display); font-weight: 700; font-size: 20px; line-height: 1.2; text-decoration: none; }

/* ==========================================================================
   Roast pages
   ========================================================================== */
.nk-roast { padding-top: 24px; }
.nk-roast-title { margin-top: 8px !important; }
.nk-roast .is-style-nk-ear { max-width: none; }
* + .is-style-nk-flag { margin-top: 32px !important; }
.nk-order-box { border: 2px solid var(--nk-ink); padding: 20px; background: var(--nk-white); }
.nk-order-box > * { margin-top: 0 !important; margin-bottom: 12px !important; }
.nk-order-box > *:last-child { margin-bottom: 0 !important; }
ul.is-style-nk-rotation li strong { font-family: var(--nk-label); font-weight: 600; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; margin-right: 6px; }

/* ==========================================================================
   Colophon (footer)
   ========================================================================== */
.nk-colophon {
	margin-top: 36px;
	padding-top: 0;
	padding-bottom: 32px;
	font-size: 13px;
	color: var(--nk-muted);
}
.nk-colophon::before { content: ""; display: block; border-top: 4px solid var(--nk-ink); margin-bottom: 10px; }
.nk-colophon > * { margin-top: 0 !important; margin-bottom: 8px !important; }
.nk-colophon p { text-align: center; }
.nk-colophon .wp-block-navigation { font-family: var(--nk-label); font-size: 13px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; }

/* Buttons: printed-ink look */
.wp-element-button,
.wp-block-button__link {
	border-radius: 0 !important;
}
