/*
Theme Name: PRD News
Description: Editorial news-style theme for the Public Relations Database Directory.
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: prd-news
*/

:root {
	--ink: #0b0d12;
	--text: #1f2937;
	--muted: #6b7280;
	--line: #e5e9f0;
	--bg: #ffffff;
	--bg-soft: #f5f8fc;
	--accent: #2563d9;
	--accent-dark: #1d4fb0;
	--radius: 14px;
	--container: 1680px;
	--gutter: clamp(16px, 4vw, 48px);
	--font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
	margin: 0;
	font-family: var(--font);
	font-size: 17px;
	line-height: 1.6;
	color: var(--text);
	background: var(--bg);
	-webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.2; letter-spacing: -0.02em; margin: 0; }
button { font: inherit; }

.container {
	width: 100%;
	max-width: var(--container);
	margin-inline: auto;
	padding-inline: var(--gutter);
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 8px;
	z-index: 100;
	background: var(--ink);
	color: #fff;
	padding: 8px 14px;
	border-radius: 8px;
}
.skip-link:focus { left: 8px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* ---------- Ticker ---------- */
.ticker {
	background: var(--ink);
	color: #fff;
	overflow: hidden;
	white-space: nowrap;
	font-size: 15px;
	font-weight: 500;
}
.ticker__track {
	display: inline-flex;
	animation: ticker 60s linear infinite;
}
.ticker:hover .ticker__track,
.ticker:focus-within .ticker__track { animation-play-state: paused; }
.ticker a {
	display: inline-flex;
	align-items: center;
	gap: 18px;
	padding: 9px 28px 9px 0;
}
.ticker a::before {
	content: "";
	width: 8px;
	height: 8px;
	background: currentColor;
	flex: none;
}
.ticker a:hover { color: #9ec0ff; }
@keyframes ticker { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
	.ticker__track { animation: none; }
}

/* ---------- Header ---------- */
.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: #fff;
	border-bottom: 1px solid var(--line);
}
.admin-bar .site-header { top: 32px; }

.header-inner {
	position: relative;
	display: flex;
	align-items: center;
	gap: 32px;
	min-height: 82px;
}

.brand {
	display: inline-flex;
	align-items: baseline;
	gap: 4px;
	color: var(--ink);
	flex: none;
}
.brand__mark {
	font-size: 38px;
	font-weight: 800;
	letter-spacing: -0.04em;
	line-height: 1;
	font-style: italic;
	transform: skewX(-4deg);
}
.brand__sub {
	font-size: 20px;
	font-weight: 700;
	letter-spacing: -0.02em;
}
.brand__logo { max-height: 48px; width: auto; }

.primary-nav { flex: 1; display: flex; justify-content: center; }
.primary-nav .menu {
	display: flex;
	align-items: center;
	gap: 6px;
	list-style: none;
	margin: 0;
	padding: 0;
}
.primary-nav .menu > li { position: relative; }
.primary-nav .menu > li > a {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 10px 14px;
	font-size: 17px;
	font-weight: 500;
	color: var(--ink);
	border-radius: 8px;
}
.primary-nav .menu > li > a:hover,
.primary-nav .current-menu-item > a,
.primary-nav .current-menu-ancestor > a { color: var(--accent); }
.primary-nav .menu > li > a svg { transition: transform .2s; }

.primary-nav .sub-menu {
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 230px;
	list-style: none;
	margin: 0;
	padding: 8px;
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 12px;
	box-shadow: 0 16px 40px rgba(15, 23, 42, .12);
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity .15s, transform .15s, visibility .15s;
	max-height: 70vh;
	overflow-y: auto;
}
.primary-nav .sub-menu a {
	display: block;
	padding: 8px 12px;
	font-size: 15px;
	font-weight: 500;
	border-radius: 8px;
}
.primary-nav .sub-menu a:hover { background: var(--bg-soft); color: var(--accent); }

@media (hover: hover) and (min-width: 1001px) {
	.primary-nav .menu-item-has-children:hover > .sub-menu,
	.primary-nav .menu-item-has-children:focus-within > .sub-menu {
		opacity: 1;
		visibility: visible;
		transform: none;
	}
	.primary-nav .menu-item-has-children:hover > a svg { transform: rotate(180deg); }
}

.header-actions { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.icon-btn {
	display: inline-grid;
	place-items: center;
	width: 42px;
	height: 42px;
	border: 0;
	border-radius: 10px;
	background: none;
	color: var(--ink);
	cursor: pointer;
}
.icon-btn:hover { background: var(--bg-soft); }
.nav-toggle { display: none; }

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 22px;
	border-radius: 8px;
	font-size: 17px;
	font-weight: 600;
	border: 1px solid transparent;
	cursor: pointer;
	transition: background .15s;
}
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-dark); }

.search-panel { border-top: 1px solid var(--line); padding: 16px 0; background: #fff; }
.search-form { display: flex; gap: 10px; max-width: 720px; margin-inline: auto; }
.search-form label { flex: 1; }
.search-form .search-field {
	width: 100%;
	padding: 12px 16px;
	font: inherit;
	border: 1px solid var(--line);
	border-radius: 10px;
	background: var(--bg-soft);
}
.search-form .search-submit {
	padding: 12px 22px;
	border: 0;
	border-radius: 10px;
	background: var(--accent);
	color: #fff;
	font-weight: 600;
	cursor: pointer;
}
.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* ---------- Browse bar ---------- */
.browse {
	background: var(--bg-soft);
	border-bottom: 1px solid var(--line);
}
.browse-inner {
	display: flex;
	align-items: center;
	gap: 18px;
	padding-block: 14px;
}
.browse__label {
	flex: none;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: .18em;
	text-transform: uppercase;
	color: var(--muted);
}
.browse__pills {
	display: flex;
	min-width: 0;
	gap: 12px;
	overflow-x: auto;
	scrollbar-width: none;
	padding: 2px;
}
.browse__pills::-webkit-scrollbar { display: none; }
.pill {
	flex: none;
	padding: 9px 20px;
	font-size: 17px;
	font-weight: 500;
	color: var(--ink);
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 999px;
	transition: border-color .15s, color .15s;
}
.pill:hover { border-color: var(--accent); color: var(--accent); }
.pill.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- Shared bits ---------- */
.tagline {
	margin: 44px auto 36px;
	text-align: center;
	font-size: 21px;
	font-weight: 600;
	color: var(--accent);
	letter-spacing: -0.01em;
}

.kicker {
	display: inline-block;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--accent);
}
a.kicker:hover { text-decoration: underline; }

.badge {
	display: inline-block;
	padding: 6px 16px;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: #fff;
	background: var(--accent);
	border-radius: 6px;
}
.badge:hover { background: var(--accent-dark); }

.meta { margin: 0; font-size: 15px; color: var(--muted); }
.meta span { margin-inline: 4px; }

.section { padding-block: 40px; }
.section-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
}
.section-title {
	display: flex;
	align-items: center;
	gap: 16px;
	font-size: 27px;
	font-weight: 700;
	padding-bottom: 20px;
	margin-bottom: 24px;
	border-bottom: 1px solid var(--line);
	flex: 1;
}
.section-title::before {
	content: "";
	width: 17px;
	height: 17px;
	background: var(--accent);
	flex: none;
}
.see-all {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-weight: 600;
	color: var(--accent);
	white-space: nowrap;
}
.see-all:hover { text-decoration: underline; }

/* ---------- Front page ---------- */
.front-top {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 523px;
	gap: 54px;
	align-items: start;
	padding-bottom: 24px;
}

.hero__media {
	display: block;
	aspect-ratio: 16 / 9;
	border-radius: var(--radius);
	overflow: hidden;
	margin-bottom: 28px;
	background: var(--bg-soft);
}
.hero__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.hero__media:hover img { transform: scale(1.02); }
.hero__title {
	margin: 22px 0 16px;
	font-size: clamp(34px, 4.4vw, 64px);
	font-weight: 800;
	letter-spacing: -0.035em;
	line-height: 1.05;
}
.hero__title a:hover { color: var(--accent); }
.hero__excerpt {
	margin: 0 0 14px;
	font-size: 20px;
	color: #374151;
	max-width: 62ch;
}

.top-stories .section-title { margin-bottom: 0; }
.story {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 131px;
	gap: 22px;
	padding-block: 22px;
	border-bottom: 1px solid var(--line);
}
.story__title {
	margin: 6px 0 12px;
	font-size: 21px;
	font-weight: 700;
	line-height: 1.4;
	letter-spacing: -0.01em;
}
.story__title a:hover { color: var(--accent); }
.story__thumb {
	display: block;
	aspect-ratio: 1;
	border-radius: 8px;
	overflow: hidden;
	background: var(--bg-soft);
}
.story__thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Cards ---------- */
.card-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 40px 32px;
}
.card { display: flex; flex-direction: column; align-items: flex-start; }
.card__media {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 10;
	border-radius: 12px;
	overflow: hidden;
	margin-bottom: 18px;
	background: var(--bg-soft);
}
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.card__media:hover img { transform: scale(1.03); }
.card__placeholder {
	display: block;
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, #dbe6f7, #f5f8fc);
}
.card__title {
	margin: 8px 0 10px;
	font-size: 21px;
	font-weight: 700;
	line-height: 1.35;
	letter-spacing: -0.01em;
}
.card__title a:hover { color: var(--accent); }

/* ---------- Archives ---------- */
.archive-header {
	padding-bottom: 28px;
	margin-bottom: 36px;
	border-bottom: 1px solid var(--line);
}
.archive-title {
	margin-top: 6px;
	font-size: clamp(32px, 4vw, 52px);
	font-weight: 800;
	letter-spacing: -0.03em;
}
.archive-description { max-width: 70ch; color: #374151; margin-top: 12px; }
.empty { max-width: 720px; }

.pagination { margin-top: 56px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.pagination .page-numbers {
	display: inline-grid;
	place-items: center;
	min-width: 44px;
	height: 44px;
	padding-inline: 14px;
	border: 1px solid var(--line);
	border-radius: 10px;
	font-weight: 600;
}
.pagination .page-numbers.current { background: var(--accent); border-color: var(--accent); color: #fff; }
.pagination a.page-numbers:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Single ---------- */
.single__header { max-width: 1000px; padding-top: 48px; margin-bottom: 36px; }
.single__title {
	margin: 20px 0 16px;
	font-size: clamp(32px, 4.2vw, 58px);
	font-weight: 800;
	letter-spacing: -0.035em;
	line-height: 1.08;
}
.single__dek { font-size: 21px; color: #374151; margin: 0 0 16px; }
.single__media {
	max-width: 1000px;
	margin: 0 0 48px;
	border-radius: var(--radius);
	overflow: hidden;
	aspect-ratio: 16 / 9;
	background: var(--bg-soft);
}
.single__media img { width: 100%; height: 100%; object-fit: cover; }

.single__layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 440px;
	gap: 72px;
	align-items: start;
}
.single__layout .top-stories { position: sticky; top: 110px; }
.single__layout .story { grid-template-columns: minmax(0, 1fr) 100px; }
.single__layout .story__title { font-size: 18px; }

.entry-content { max-width: 760px; font-size: 19px; line-height: 1.75; }
.entry-content p,
.entry-content ul,
.entry-content ol,
.entry-content figure,
.entry-content blockquote,
.entry-content table,
.entry-content #ez-toc-container { margin: 0 0 1.2em; }
.entry-content h2 { font-size: 32px; font-weight: 700; margin: 1.6em 0 .6em; }
.entry-content h3 { font-size: 25px; font-weight: 700; margin: 1.5em 0 .5em; }
.entry-content h4 { font-size: 20px; font-weight: 700; margin: 1.4em 0 .5em; }
.entry-content > :first-child { margin-top: 0; }
.entry-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.entry-content a:hover { color: var(--accent-dark); }
.entry-content ul, .entry-content ol { padding-left: 1.3em; }
.entry-content li + li { margin-top: .4em; }
.entry-content img { border-radius: 10px; }
.entry-content figure { margin-inline: 0; }
.entry-content figcaption { font-size: 14px; color: var(--muted); margin-top: 8px; }
.entry-content blockquote {
	margin-inline: 0;
	padding: 4px 0 4px 24px;
	border-left: 4px solid var(--accent);
	font-size: 22px;
	font-weight: 500;
	color: var(--ink);
}
.entry-content table { width: 100%; border-collapse: collapse; font-size: 16px; display: block; overflow-x: auto; }
.entry-content th, .entry-content td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.entry-content th { background: var(--bg-soft); color: var(--ink); }
.entry-content hr { border: 0; border-top: 1px solid var(--line); margin-block: 2em; }
.entry-content .wp-block-latest-posts.is-grid { padding: 0; }
.entry-content #ez-toc-container {
	background: var(--bg-soft);
	border: 1px solid var(--line);
	border-radius: 12px;
	padding: 20px 24px;
	box-shadow: none;
	width: 100%;
}
.entry-content #ez-toc-container a { text-decoration: none; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2em; }
.tags a {
	font-size: 14px;
	padding: 6px 14px;
	border: 1px solid var(--line);
	border-radius: 999px;
	color: var(--ink);
	text-decoration: none;
}

.related { border-top: 1px solid var(--line); margin-top: 56px; padding-top: 56px; }
.page-article { max-width: 900px; padding-block: 56px; }
.page-article .single__title { margin-top: 0; margin-bottom: 32px; }
.page-article .entry-content { max-width: none; }

.comments-area { max-width: 760px; margin-top: 56px; }

/* ---------- Footer ---------- */
.site-footer {
	margin-top: 72px;
	background: var(--ink);
	color: #b8c0cc;
	font-size: 16px;
}
.footer-grid {
	display: grid;
	grid-template-columns: 2fr 1fr 1fr;
	gap: 48px;
	padding-block: 64px 48px;
}
.brand--light { color: #fff; }
.footer-brand p { max-width: 40ch; margin: 18px 0 0; }
.footer-title {
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: .14em;
	text-transform: uppercase;
	margin-bottom: 16px;
}
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer-links a:hover { color: #fff; }
.footer-bottom {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	padding-block: 24px;
	border-top: 1px solid rgba(255, 255, 255, .12);
	font-size: 14px;
}
.footer-bottom a:hover { color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 1300px) {
	.front-top { grid-template-columns: minmax(0, 1fr) 400px; gap: 40px; }
	.single__layout { grid-template-columns: minmax(0, 1fr) 340px; gap: 48px; }
	.story { grid-template-columns: minmax(0, 1fr) 100px; }
	.primary-nav .menu > li > a { padding-inline: 10px; }
}

@media (max-width: 1000px) {
	body { font-size: 16px; }
	.header-inner { min-height: 68px; gap: 12px; }
	.brand__mark { font-size: 30px; }
	.brand__sub { font-size: 17px; }
	.nav-toggle { display: inline-grid; }
	.header-cta { display: none; }

	.primary-nav {
		display: none;
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		background: #fff;
		border-bottom: 1px solid var(--line);
		box-shadow: 0 16px 30px rgba(15, 23, 42, .08);
		max-height: calc(100vh - 120px);
		overflow-y: auto;
	}
	.primary-nav.is-open { display: block; }
	.primary-nav .menu { flex-direction: column; align-items: stretch; gap: 0; padding: 8px var(--gutter) 16px; }
	.primary-nav .menu > li > a { width: 100%; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--line); border-radius: 0; }
	.primary-nav .sub-menu {
		position: static;
		display: none;
		opacity: 1;
		visibility: visible;
		transform: none;
		box-shadow: none;
		border: 0;
		padding: 4px 0 8px 12px;
		max-height: none;
	}
	.primary-nav .is-open > .sub-menu { display: block; }
	.primary-nav .is-open > a svg { transform: rotate(180deg); }

	.front-top, .single__layout { grid-template-columns: 1fr; }
	.single__layout .top-stories { position: static; }
	.tagline { font-size: 18px; margin-block: 28px 24px; }
	.hero__excerpt { font-size: 18px; }
	.entry-content { font-size: 18px; }
	.footer-grid { grid-template-columns: 1fr 1fr; }
	.footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 600px) {
	.browse__label { display: none; }
	.pill { font-size: 15px; padding: 7px 16px; }
	.story { grid-template-columns: minmax(0, 1fr) 88px; gap: 16px; }
	.story__title, .card__title { font-size: 18px; }
	.section-title { font-size: 23px; }
	.card-grid { grid-template-columns: 1fr; }
	.single__media { aspect-ratio: 4 / 3; }
	.footer-grid { grid-template-columns: 1fr; }
	.footer-bottom { flex-direction: column; }
	.search-form { flex-direction: column; }
}

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