/*
Theme Name: Pressline News
Theme URI:
Author: marcohayes
Author URI: https://profiles.wordpress.org/marcohayes/
Description: Pressline News is a modern editorial block theme for bloggers, writers and independent magazines. Elegant serif headlines paired with a clean sans-serif body, a warm paper palette and generous whitespace put your stories first. The homepage opens with a bold masthead, a large featured story card and a responsive grid of the latest posts, followed by topic cards and a newsletter call to action. Single posts feature a centered header, wide featured image, comfortable reading width, author box and related stories. Built entirely with core WordPress blocks and full site editing, every color, font, template and pattern can be customized from the Site Editor. Includes ready-made patterns, light and dark style variations, and a fully responsive, accessible layout.
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: pressline-news
Tags: blog, news, grid-layout, one-column, wide-blocks, block-patterns, block-styles, custom-colors, custom-logo, custom-menu, editor-style, featured-images, full-site-editing, style-variations, threaded-comments, translation-ready
*/

/* ---------- Base ---------- */
html {
	scroll-behavior: smooth;
}

body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

::selection {
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--surface);
}

:where(h1, h2, h3, h4) em {
	font-style: italic;
	font-weight: 400;
	color: var(--wp--preset--color--accent);
}

:where(a, button, input, textarea, select):focus-visible {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 3px;
}

/* Eyebrow label */
.pln-eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	margin: 0;
	font-size: 0.75rem;
	font-weight: 800;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent);
}

.pln-eyebrow::before {
	content: "";
	width: 1.75rem;
	height: 2px;
	background: currentColor;
}

.has-text-align-center.pln-eyebrow {
	display: flex;
	justify-content: center;
}

/* ---------- Header ---------- */
.pln-site-header {
	position: sticky;
	top: 0;
	z-index: 50;
}

.admin-bar .pln-site-header {
	top: var(--wp-admin--admin-bar--height, 32px);
}

@media (max-width: 600px) {
	.admin-bar .pln-site-header {
		top: 0;
	}
}

/* Blur lives on a pseudo-element: backdrop-filter on the header itself would
   trap the fixed-position mobile menu overlay inside the header box. */
.pln-header {
	position: relative;
	isolation: isolate;
	background-color: transparent !important;
}

.pln-header::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background-color: color-mix(in srgb, var(--wp--preset--color--base) 88%, transparent);
	-webkit-backdrop-filter: saturate(160%) blur(12px);
	backdrop-filter: saturate(160%) blur(12px);
}

.pln-header .wp-block-navigation-item__content {
	position: relative;
	padding-block: 0.25rem;
}

.pln-header .wp-block-navigation .wp-block-navigation-item__content::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -2px;
	height: 2px;
	background: var(--wp--preset--color--accent);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 0.25s ease;
}

.pln-header .wp-block-navigation .wp-block-navigation-item__content:hover::after,
.pln-header .wp-block-navigation .current-menu-item > .wp-block-navigation-item__content::after {
	transform: scaleX(1);
}

.pln-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content::after {
	display: none;
}

/* Mobile menu overlay */
.pln-header .wp-block-navigation__responsive-container.is-menu-open {
	padding: var(--wp--preset--spacing--40) clamp(1rem, 6vw, 2.5rem);
	background-color: var(--wp--preset--color--base) !important;
	color: var(--wp--preset--color--contrast) !important;
}

.pln-header .is-menu-open .wp-block-navigation__responsive-container-content {
	padding-top: var(--wp--preset--spacing--50);
}

.pln-header .is-menu-open .wp-block-navigation__container,
.pln-header .is-menu-open .wp-block-page-list {
	align-items: flex-start !important;
	gap: 0 !important;
	width: 100%;
}

.pln-header .is-menu-open .wp-block-navigation-item {
	width: 100%;
	border-bottom: 1px solid var(--wp--preset--color--border);
}

.pln-header .is-menu-open .wp-block-navigation-item__content {
	display: block;
	width: 100%;
	padding: 1rem 0 !important;
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--x-large);
	font-weight: 500;
	letter-spacing: -0.01em;
}

.pln-header .is-menu-open .wp-block-navigation-item__content:hover {
	color: var(--wp--preset--color--accent);
}

.pln-header .wp-block-navigation__responsive-container-open,
.pln-header .wp-block-navigation__responsive-container-close {
	color: var(--wp--preset--color--contrast);
}

.pln-header-search {
	position: relative;
	z-index: 20;
}

.pln-header-search .wp-block-search__inside-wrapper {
	width: auto !important;
	min-width: 0;
	padding: 0;
	border: 0;
	gap: 0;
}

.pln-header-search .wp-block-search__button {
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 2.5rem;
	height: 2.5rem;
	padding: 0;
	margin: 0;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 999px;
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--contrast);
}

.pln-header-search .wp-block-search__button svg {
	display: block;
	width: 1.25rem;
	height: 1.25rem;
	min-width: 0;
	min-height: 0;
	margin: 0;
	fill: currentColor;
}

.pln-header-search .wp-block-search__button:hover,
.pln-header-search:not(.wp-block-search__searchfield-hidden) .wp-block-search__button {
	background: var(--wp--preset--color--contrast);
	border-color: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
}

.pln-header-search .wp-block-search__input {
	position: absolute;
	top: calc(100% + 2rem);
	right: 0;
	z-index: 20;
	box-sizing: border-box;
	width: 18rem;
	max-width: calc(100vw - 2rem);
	height: 2.5rem;
	margin: 0;
	padding: 0 1.1rem;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 999px;
	background: var(--wp--preset--color--surface);
	box-shadow: var(--wp--preset--shadow--lifted);
	font-size: var(--wp--preset--font-size--small);
	transition: width 0.25s ease, opacity 0.2s ease;
}

.pln-header-search .wp-block-search__input:focus {
	outline: none;
	border-color: var(--wp--preset--color--contrast);
}

.pln-header-search.wp-block-search__searchfield-hidden .wp-block-search__input {
	width: 0;
	padding: 0;
	border-width: 0;
	opacity: 0;
	pointer-events: none;
}

/* ---------- Buttons ---------- */
.wp-element-button,
.wp-block-button__link {
	transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.wp-block-button__link:hover {
	transform: translateY(-2px);
}

.wp-block-button.is-style-outline > .wp-block-button__link {
	border: 1.5px solid currentColor;
	background: transparent;
	color: var(--wp--preset--color--contrast);
	padding: calc(0.85rem - 1.5px) calc(1.6rem - 1.5px);
}

.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: var(--wp--preset--color--contrast);
	border-color: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
}

/* ---------- Post cards ---------- */
.pln-card .wp-block-post-featured-image {
	width: 100%;
	overflow: hidden;
}

.pln-card .wp-block-post-featured-image img {
	transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.pln-card:hover .wp-block-post-featured-image img {
	transform: scale(1.04);
}

.pln-card .wp-block-post-title a {
	background-image: linear-gradient(currentColor, currentColor);
	background-size: 0 1px;
	background-position: 0 100%;
	background-repeat: no-repeat;
	transition: background-size 0.35s ease, color 0.2s ease;
}

.pln-card:hover .wp-block-post-title a {
	background-size: 100% 1px;
}

.pln-card .wp-block-post-excerpt__excerpt {
	margin: 0;
}

.pln-card .wp-block-post-excerpt__more-text {
	display: none;
}

.pln-meta {
	color: var(--wp--preset--color--contrast-2);
}

.pln-meta > * + *::before {
	content: "·";
	margin-right: 0.5rem;
	opacity: 0.7;
}

/* ---------- Featured story card ---------- */
.pln-feature-card {
	overflow: hidden;
}

.pln-feature-card .wp-block-cover__image-background {
	transition: transform 1.2s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.pln-feature-card:hover .wp-block-cover__image-background {
	transform: scale(1.03);
}

.pln-feature-card .wp-block-post-title {
	max-width: 18ch;
}

.pln-feature-card .wp-block-post-excerpt {
	max-width: 56ch;
}

.pln-feature-card .wp-block-post-excerpt__more-text {
	display: none;
}

.pln-feature-card .pln-meta {
	color: var(--wp--preset--color--surface);
}

/* Category & tag labels: plain colored text */
.pln-chip .wp-block-post-terms__separator {
	display: none;
}

.pln-chip a + a::before {
	content: "/";
	margin: 0 0.5rem;
	opacity: 0.5;
}

.pln-feature-card .pln-chip a {
	color: var(--wp--preset--color--surface) !important;
}

.pln-feature-card .pln-chip a:hover {
	color: var(--wp--preset--color--accent-soft) !important;
}

.is-style-pill a {
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	letter-spacing: 0;
	text-transform: none;
	margin-right: 0.75rem;
	color: var(--wp--preset--color--contrast-2) !important;
}

.is-style-pill a::before {
	content: "#";
	color: var(--wp--preset--color--accent);
	margin-right: 1px;
}

.is-style-pill a:hover {
	color: var(--wp--preset--color--accent) !important;
}

.is-style-pill .wp-block-post-terms__separator {
	display: none;
}

/* ---------- Topics ---------- */
.pln-topic .wp-block-image {
	overflow: hidden;
	border-radius: 18px;
}

.pln-topic .wp-block-image img {
	transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.pln-topic:hover .wp-block-image img {
	transform: scale(1.05);
}

/* ---------- Newsletter ---------- */
.pln-newsletter .wp-block-image {
	margin: 0;
}

/* ---------- Single post ---------- */
.pln-byline {
	color: var(--wp--preset--color--contrast-2);
}

.pln-byline .wp-block-avatar img {
	display: block;
}

.pln-prose :where(p, li) a {
	text-decoration-color: var(--wp--preset--color--accent);
	text-decoration-thickness: 1.5px;
	text-underline-offset: 3px;
}

.pln-prose :where(h2, h3) {
	margin-top: 2.5em;
}

.pln-author-box {
	display: flex;
	align-items: flex-start;
	gap: 1.25rem;
}

.pln-author-box .wp-block-post-author__avatar {
	margin: 0;
}

.pln-author-box .wp-block-post-author__avatar img {
	border-radius: 999px;
}

.pln-author-box .wp-block-post-author__name {
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--large);
	margin: 0 0 0.25rem;
}

.pln-author-box .wp-block-post-author__bio {
	margin: 0;
	color: var(--wp--preset--color--contrast-2);
	font-size: var(--wp--preset--font-size--small);
}

.pln-post-nav > * {
	max-width: 48%;
}

.pln-post-nav a {
	transition: color 0.2s ease;
}

.pln-comments .wp-block-comment-reply-link a {
	text-decoration: none;
	color: var(--wp--preset--color--accent);
}

.pln-comments .comment-form :where(input:not([type="submit"]):not([type="checkbox"]), textarea) {
	width: 100%;
	padding: 0.85rem 1rem;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 12px;
	background: var(--wp--preset--color--surface);
	font: inherit;
	font-size: var(--wp--preset--font-size--small);
}

/* ---------- Search ---------- */
.pln-search-pill .wp-block-search__inside-wrapper {
	padding: 0.35rem;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 999px;
	background: var(--wp--preset--color--surface);
}

.pln-search-pill .wp-block-search__input {
	border: 0;
	background: transparent;
	padding-inline: 1rem;
	font-size: var(--wp--preset--font-size--small);
}

.pln-search-pill .wp-block-search__input:focus {
	outline: none;
}

.pln-search-pill .wp-block-search__inside-wrapper:focus-within {
	border-color: var(--wp--preset--color--contrast);
}

.pln-search-pill .wp-block-search__button {
	margin: 0;
}

/* ---------- Pagination ---------- */
.pln-pagination {
	padding-top: var(--wp--preset--spacing--40);
	border-top: 1px solid var(--wp--preset--color--border);
}

.pln-pagination .page-numbers {
	display: inline-grid;
	place-items: center;
	min-width: 2.5rem;
	height: 2.5rem;
	border-radius: 999px;
}

.pln-pagination .page-numbers.current,
.pln-pagination a.page-numbers:hover {
	background: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
}

/* ---------- Footer ---------- */
.pln-footer .wp-block-site-title a {
	color: var(--wp--preset--color--base);
}

.pln-footer-list {
	list-style: none;
	padding: 0;
	margin: 0;
	display: grid;
	gap: 0.65rem;
}

.pln-footer-list a {
	text-decoration: none;
	font-size: var(--wp--preset--font-size--small);
	color: #e8e4dc;
}

.pln-footer-list a:hover {
	color: var(--wp--preset--color--accent) !important;
}

.pln-footer .wp-block-social-links a:hover {
	color: var(--wp--preset--color--accent);
}

/* ---------- Block style: card ---------- */
.wp-block-group.is-style-card {
	padding: var(--wp--preset--spacing--40);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 20px;
	background: var(--wp--preset--color--surface);
	box-shadow: var(--wp--preset--shadow--soft);
}

/* ---------- Responsive ---------- */
@media (max-width: 781px) {
	.pln-feature-card {
		min-height: 480px !important;
	}

	.pln-section-head {
		gap: 0.5rem;
	}

	.pln-author-box {
		flex-direction: column;
	}
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		transition: none !important;
		animation: none !important;
	}
}
