/*
Theme Name: Press Release
Author: PressFeed
Description: A block theme built for newsrooms and press-release sites. Clean, fast and accessible out of the box, with patterns for datelines, media contacts, boilerplates and press kits. Pairs with the free PressFeed plugin to import and measure press releases, and works perfectly well on its own.
Requires at least: 6.5
Tested up to: 7.0
Requires PHP: 7.4
Version: 1.1.2
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: press-release
Tags: news, blog, one-column, block-patterns, full-site-editing, wide-blocks, editor-style, featured-images, translation-ready, block-styles, style-variations

Press Release is distributed under the terms of the GNU GPL v2 or later.
*/

/*
 * A block theme styles itself from theme.json. This file carries the theme
 * header (required by WordPress) and the handful of rules that theme.json has
 * no vocabulary for: the newsroom presentation the plugin's PHP templates
 * render, and small refinements to core blocks.
 *
 * Everything colour-ish resolves through the PressFeed plugin's --pf-* custom
 * properties with a static fallback, so the publisher's colour choices in the
 * plugin drive the theme, and the theme still looks right with no plugin.
 */

:root {
	--pr-border: color-mix(in srgb, var(--pf-muted, #6b6a66) 22%, transparent);
	--pr-border-soft: color-mix(in srgb, var(--pf-muted, #6b6a66) 14%, transparent);
	--pr-shadow: 0 12px 30px rgba(28, 25, 18, 0.10);
}

/* ---------- Skip link (accessibility-ready) ---------- */
.skip-link:focus {
	background-color: var(--pf-surface, #f4f2ed);
	color: var(--pf-text, #16161a);
	z-index: 100000;
}

/* ---------- Site chrome ---------- */
.wp-site-blocks .press-release-site-header {
	border-bottom: 1px solid var(--pr-border-soft);
}

.wp-site-blocks .press-release-site-footer {
	border-top: 1px solid var(--pr-border-soft);
}

/* Hairlines for the block templates. These are classes rather than per-block
   border attributes because the editor's border controls only understand
   preset or literal colours — a custom property there renders as black. */
.press-release-divider {
	border-bottom: 1px solid var(--pr-border);
}

.press-release-divider-soft {
	border-bottom: 1px solid var(--pr-border-soft);
}

.press-release-divider-top {
	border-top: 1px solid var(--pr-border);
}

.press-release-eyebrow {
	text-transform: uppercase;
	letter-spacing: 0.08em;
	font-weight: 600;
}

/* ---------- Newsroom patterns ---------- */
/* The editor's block styles and the patterns' own classes share one look. */
.press-release-dateline,
.is-style-press-release-dateline {
	text-transform: uppercase;
	letter-spacing: 0.06em;
	font-weight: 700;
}

.press-release-callout,
.is-style-press-release-callout {
	border-left: 3px solid var(--pf-accent, #9a330a);
	padding-left: 1.25rem;
}

.is-style-press-release-card {
	border: 1px solid var(--pr-border-soft);
	border-radius: var(--pf-radius, 12px);
	padding: 1.5rem;
}

.press-release-boilerplate,
.press-release-media-contact {
	border-top: 1px solid var(--pr-border);
}

.press-release-embargo {
	border: 1px dashed var(--pf-accent, #9a330a);
	border-radius: var(--pf-radius, 12px);
}

/* Imported releases arrive as HTML, not blocks, so a <blockquote> or a
   <figcaption> in the body never gets the block styles from theme.json.
   Style the raw elements directly. */
.wp-block-post-content blockquote {
	margin: 1.6em 0;
	padding-left: 1.25rem;
	border-left: 3px solid var(--pf-accent, #9a330a);
}

.wp-block-post-content figure {
	margin: 1.8em 0;
}

.wp-block-post-content figcaption {
	margin-top: 0.6rem;
	font-size: 0.875rem;
	line-height: 1.5;
	color: var(--pf-muted, #6b6a66);
}

/* ---------- Query loops ---------- */
.press-release-card {
	border: 1px solid var(--pr-border-soft);
	border-radius: var(--pf-radius, 12px);
	overflow: hidden;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.press-release-card:hover,
.press-release-card:focus-within {
	transform: translateY(-3px);
	box-shadow: var(--pr-shadow);
}

@media (prefers-reduced-motion: reduce) {
	.press-release-card {
		transition: none;
	}

	.press-release-card:hover,
	.press-release-card:focus-within {
		transform: none;
	}
}

/* Keep the focus ring visible on card links, whose background may be tinted. */
.press-release-card a:focus-visible,
.wp-site-blocks a:focus-visible {
	outline: 2px solid var(--pf-primary, #c2410c);
	outline-offset: 2px;
}

/* ---------- Editor parity for the plugin's colour tokens ---------- */
.editor-styles-wrapper .press-release-dateline {
	text-transform: uppercase;
}

/* ---------- Sticky footer ---------- */
/*
 * Whatever sits between header and footer grows, so a short page does not leave
 * the footer floating mid-viewport. Structural rather than a list of wrappers —
 * naming them is how the newsroom got missed. Pushing from the footer instead
 * fails: the block editor writes its top margin inline, which wins.
 */
.wp-site-blocks {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

.wp-site-blocks > *:not(header):not(footer) {
	flex: 1 0 auto;
}

/* The admin bar is outside .wp-site-blocks but still takes vertical space, so
   a flat 100vh overflows by its height and gives logged-in users a scrollbar
   on pages that should not have one. */
.admin-bar .wp-site-blocks {
	min-height: calc(100vh - 32px);
}

@media screen and (max-width: 782px) {
	.admin-bar .wp-site-blocks {
		min-height: calc(100vh - 46px);
	}
}
