/* ==========================================================================
   Atrium theme styles
   Original CSS. Provides the structural wrappers plugins rely on
   (.site-content, .entry-content, .page-content, .content-area) without
   imposing styles that would break self-contained plugin layouts.
   ========================================================================== */

:root {
	--rudster-accent: #2563eb;
	--rudster-accent-dark: #1d4ed8;
	--rudster-text: #1f2933;
	--rudster-text-muted: #66707a;
	--rudster-border: #e3e8ee;
	--rudster-bg: #ffffff;
	--rudster-bg-alt: #f7f9fc;
	--rudster-content-max: 1100px;
	--rudster-radius: 10px;
	--rudster-shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 4px 16px rgba(15, 23, 42, 0.06);
	--rudster-font-body: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--rudster-font-heading: var(--rudster-font-body);
	--rudster-space: 1.5rem;
}

/* ---- Reset-ish base ---- */
*,
*::before,
*::after {
	box-sizing: border-box;
}

body {
	margin: 0;
	font-family: var(--rudster-font-body);
	font-size: 1rem;
	line-height: 1.65;
	color: var(--rudster-text);
	background: var(--rudster-bg);
	-webkit-font-smoothing: antialiased;
}

a {
	color: var(--rudster-accent);
	text-decoration: none;
}

a:hover,
a:focus {
	color: var(--rudster-accent-dark);
	text-decoration: underline;
}

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

h1, h2, h3, h4, h5, h6 {
	font-family: var(--rudster-font-heading);
	line-height: 1.25;
	color: var(--rudster-text);
	margin: 0 0 0.6em;
}

/* Only apply theme heading sizes outside plugin content */
:not([class*="pcs-"]) > h1,
:not([class*="pcs-"]) > h2,
:not([class*="pcs-"]) > h3 {
	font-size: inherit;
}

.entry-header h1,
.entry-title { font-size: 2rem; }

.page-header h1,
.page-title { font-size: 2rem; }

.posts-list h2.entry-title,
.search-result h2.entry-title { font-size: 1.6rem; }

.widget-title { font-size: 1.1rem; }

/* Stand down inside self-styled plugin output. Set explicit unset values
   so the plugin's own inline <style> heading sizes win without browser
   defaults inflating them. */
[class*="pcs-"] h1,
[class*="pcs-"] h2,
[class*="pcs-"] h3,
[class*="pcs-"] h4,
[class*="pcs-"] h5,
[class*="pcs-"] h6,
[class*="be-"] h1,
[class*="be-"] h2,
[class*="be-"] h3,
[class*="be-"] h4,
[class*="be-"] h5,
[class*="be-"] h6 {
	font-size: unset;
	font-weight: unset;
	line-height: unset;
	color: unset;
	margin: unset;
}

p { margin: 0 0 1.2em; }

/* ---- Accessibility ---- */
.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	width: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute !important;
	word-wrap: normal !important;
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 100000;
	background: #fff;
	color: var(--rudster-accent);
	padding: 0.75em 1.25em;
	border-radius: 0 0 var(--rudster-radius) 0;
	box-shadow: var(--rudster-shadow);
}

.skip-link:focus {
	left: 0;
}

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

/* ---- Layout wrappers ---- */
.site-header-inner,
.site-footer-inner {
	max-width: var(--rudster-content-max);
	margin-left: auto;
	margin-right: auto;
	padding-left: var(--rudster-space);
	padding-right: var(--rudster-space);
}

/* Plugin pages get zero horizontal padding so plugin CSS controls its own edges */
.site-content-inner {
	max-width: var(--rudster-content-max);
	margin-left: auto;
	margin-right: auto;
	padding-left: var(--rudster-space);
	padding-right: var(--rudster-space);
}

/* The main content region. Kept layout-neutral so plugin shortcodes
   that style their own .entry-content / .page-content render cleanly. */
.site-content {
	padding-top: 2.5rem;
	padding-bottom: 3rem;
}

.site-content-inner {
	display: flex;
	gap: 2.5rem;
	align-items: flex-start;
}

.content-area {
	flex: 1 1 auto;
	min-width: 0;
}

/* Full-width context: no sidebar, content spans the row. Critical for
   shortcode dashboards/portals that manage their own internal width. */
.content-area-full,
body.full-width .content-area,
body.plugin-page .content-area {
	flex-basis: 100%;
	max-width: 100%;
	width: 100%;
}

/* Plugin pages: zero padding so plugin CSS fully controls its own edges.
   Covers both Rudster's own body.plugin-page and the plugin's own body classes. */
body.plugin-page .site-content-inner,
body.pcs-dashboard-page .site-content-inner,
body.pcs-light-page .site-content-inner,
body.pcs-login-active .site-content-inner {
	padding-left: 0;
	padding-right: 0;
	max-width: 100%;
}

body.plugin-page .content-area,
body.pcs-dashboard-page .content-area,
body.pcs-light-page .content-area,
body.pcs-login-active .content-area {
	padding: 0;
	min-width: 0;
	overflow-x: hidden;
	flex: none;
	width: 100%;
	max-width: 100%;
}

body.plugin-page .entry-content,
body.pcs-dashboard-page .entry-content,
body.pcs-light-page .entry-content,
body.pcs-login-active .entry-content {
	font-size: inherit;
	padding: 0;
}

/* Plugin page titles (.it-page-header) sit outside plugin wrappers
   so need explicit side padding to match their inner content padding. */
body.plugin-page .it-page-header,
body.pcs-dashboard-page .it-page-header,
body.pcs-light-page .it-page-header {
	padding-left: 16px;
	padding-right: 16px;
}

/* Suppress any WordPress-generated page title on plugin pages.
   Plugin shortcodes render their own headers inside their wrappers. */
body.plugin-page .entry-title,
body.plugin-page .page-title,
body.plugin-page .entry-header,
body.pcs-dashboard-page .entry-title,
body.pcs-dashboard-page .page-title,
body.pcs-light-page .entry-title,
body.pcs-light-page .page-title {
	display: none;
}

.widget-area.sidebar {
	flex: 0 0 300px;
	max-width: 300px;
}

/* Left sidebar option. */
body.sidebar-left .site-content-inner {
	flex-direction: row-reverse;
}

/* No sidebar option / no widgets. */
body.no-sidebar .content-area,
body.sidebar-none .content-area {
	max-width: 100%;
}

@media (max-width: 900px) {
	.site-content-inner {
		flex-direction: column;
	}

	.widget-area.sidebar {
		flex-basis: auto;
		max-width: 100%;
		width: 100%;
	}
}

/* ---- Top bar wrapper (fills gap between logo and nav) ---- */
.site-top-bar {
	background: linear-gradient(135deg, #005a8a 0%, #0080c0 50%, #00a8e8 100%);
}

/* ---- Header ---- */
.site-header {
	background: linear-gradient(135deg, #005a8a 0%, #0080c0 50%, #00a8e8 100%);
	border-bottom: none;
	position: relative;
	z-index: 50;
	margin-bottom: 0;
	min-height: 160px;
	display: flex;
	align-items: center;
}

.site-header.is-stuck {
	position: sticky;
	top: 0;
	box-shadow: var(--rudster-shadow);
}

.site-header-inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0;
	padding-top: 0;
	padding-bottom: 0;
}

.site-title {
	font-size: 1.4rem;
	margin: 0;
}

.site-title a {
	color: #fff;
	text-decoration: none;
}

.site-description {
	margin: 0.2rem 0 0;
	font-size: 0.9rem;
	color: var(--rudster-text-muted);
}

.custom-logo {
	max-height: 180px;
	width: auto;
	display: block;
	padding: 8px 0;
}

.site-branding {
	line-height: 0;
	font-size: 0;
}

/* Default logo if none set via Customizer */
.site-branding:not(:has(.custom-logo)) {
	background: url('../images/logo.png') center/contain no-repeat;
	width: 100%;
	max-width: 600px;
	height: 160px;
}

/* ---- Navigation ---- */
.main-navigation {
	width: 100%;
	background: linear-gradient(90deg, #005a8a 0%, #0080c0 50%, #00a8e8 100%);
	position: sticky;
	top: 0;
	z-index: 100;
	margin-top: 0;
	overflow: visible;
}

/* Account for WP admin bar when logged in */
.admin-bar .main-navigation {
	top: 32px;
}

@media screen and (max-width: 782px) {
	.admin-bar .main-navigation {
		top: 46px;
	}
}

.primary-menu-list {
	list-style: none;
	margin: 0;
	padding: 0.2rem 0.5rem;
	display: flex;
	flex-wrap: nowrap;
	justify-content: center;
	gap: 0;
	align-items: center;
	width: 100%;
	position: relative;
	overflow: visible;
}

.primary-menu-list li {
	position: relative;
	overflow: visible;
}

.primary-menu-list a {
	display: block;
	padding: 0.35rem 0.6rem;
	font-size: 0.82rem;
	color: #fff;
	border-radius: var(--rudster-radius);
	text-decoration: none;
	white-space: nowrap;
	font-weight: 500;
}

.primary-menu-list a:hover,
.primary-menu-list .current-menu-item > a {
	background: rgba(255,255,255,0.15);
	color: #fff;
}


/* Submenus */
.primary-menu-list ul.sub-menu {
	list-style: none;
	margin: 0;
	padding: 0.4rem;
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 200px;
	background: #ffffff;
	border: 1px solid #ddd;
	border-radius: var(--rudster-radius);
	box-shadow: 0 4px 16px rgba(0,0,0,0.15);
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
	z-index: 9999;
	overflow: visible;
}

.primary-menu-list ul.sub-menu a {
	color: #1a1a1a;
	font-weight: 500;
	border-radius: var(--rudster-radius);
	padding: 0.45rem 0.75rem;
	display: block;
}

.primary-menu-list ul.sub-menu a:hover {
	background: color-mix(in srgb, #0080c0 10%, #ffffff);
	color: #0080c0;
}

.primary-menu-list li:hover > ul.sub-menu,
.primary-menu-list li:focus-within > ul.sub-menu,
.primary-menu-list li.submenu-open > ul.sub-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.submenu-toggle {
	display: none;
	background: none;
	border: none;
	cursor: pointer;
	padding: 0.4rem;
}

.submenu-arrow {
	display: inline-block;
	width: 0.5rem;
	height: 0.5rem;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
}

.menu-toggle {
	display: none;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	width: 44px;
	height: 44px;
	background: none;
	border: 1px solid rgba(255,255,255,0.4);
	border-radius: var(--rudster-radius);
	cursor: pointer;
	margin-left: auto;
	margin-right: 0.5rem;
}

.menu-toggle-bar,
.menu-toggle-bar::before,
.menu-toggle-bar::after {
	display: block;
	width: 22px;
	height: 2px;
	background: #fff;
	margin: 0 auto;
	position: relative;
}

.menu-toggle-bar::before,
.menu-toggle-bar::after {
	content: "";
	position: absolute;
	left: 0;
}

.menu-toggle-bar::before { top: -7px; }
.menu-toggle-bar::after { top: 7px; }

@media (max-width: 768px) {
	.site-header-inner {
		flex-direction: column;
		align-items: stretch;
		padding-bottom: 0;
	}

	.menu-toggle {
		display: flex;
		align-self: flex-end;
		margin: 0.3rem 0.5rem 0.3rem auto;
	}

	/* Hide the desktop nav bar — becomes a dropdown only */
	.main-navigation {
		position: relative;
		height: 0;
		overflow: visible;
	}

	.main-navigation .primary-menu-list {
		display: none;
		position: absolute;
		top: 0;
		left: 0;
		right: 0;
		flex-direction: column;
		align-items: stretch;
		background: linear-gradient(135deg, #005a8a 0%, #0080c0 50%, #00a8e8 100%);
		border-top: 1px solid rgba(255,255,255,0.2);
		box-shadow: 0 4px 12px rgba(0,0,0,0.2);
		padding: 0.25rem 0;
		gap: 0;
		z-index: 200;
	}

	.main-navigation.is-open .primary-menu-list {
		display: flex;
	}

	.primary-menu-list li {
		width: 100%;
		border-bottom: 1px solid rgba(255,255,255,0.15);
	}

	.primary-menu-list li:last-child {
		border-bottom: none;
	}

	.primary-menu-list a {
		font-size: 0.9rem;
		padding: 0.6rem 1rem;
		white-space: normal;
	}

	.primary-menu-list ul.sub-menu {
		position: static;
		opacity: 1;
		visibility: visible;
		transform: none;
		box-shadow: none;
		border: none;
		padding-left: 1rem;
		display: none;
		background: rgba(0,0,0,0.1);
	}

	.primary-menu-list li.submenu-open > ul.sub-menu {
		display: block;
	}

	.submenu-toggle {
		display: inline-flex;
		position: absolute;
		right: 0.5rem;
		top: 0.4rem;
	}
}

/* ---- Entry content ---- */
.page-header {
	margin-bottom: 2rem;
}

.page-title {
	margin: 0;
}

.entry-header {
	margin-bottom: 1.2rem;
}

.entry-title {
	margin: 0 0 0.4rem;
}

.entry-title a {
	color: var(--rudster-text);
	text-decoration: none;
}

.entry-title a:hover {
	color: var(--rudster-accent);
}

.entry-meta {
	font-size: 0.875rem;
	color: var(--rudster-text-muted);
	display: flex;
	gap: 1rem;
	flex-wrap: wrap;
}

/* Plugin-safe content area: only typographic rhythm, no width clamp
   that would interfere with shortcode layouts. */
.entry-content,
.page-content .entry-content {
	font-size: 1.05rem;
}

.entry-content > *:first-child {
	margin-top: 0;
}

.post-thumbnail {
	display: block;
	margin-bottom: 1.5rem;
	border-radius: var(--rudster-radius);
	overflow: hidden;
}

.post-summary,
.single-post-content,
.search-result {
	padding-bottom: 2.5rem;
	margin-bottom: 2.5rem;
	border-bottom: 1px solid var(--rudster-border);
}

.read-more {
	display: inline-block;
	font-weight: 600;
}

.entry-footer {
	margin-top: 1.5rem;
	font-size: 0.9rem;
	color: var(--rudster-text-muted);
}

.entry-categories,
.entry-tags {
	margin-bottom: 0.4rem;
}

.meta-label {
	font-weight: 600;
	color: var(--rudster-text);
}

/* ---- Author bio ---- */
.author-bio {
	display: flex;
	gap: 1.2rem;
	padding: 1.5rem;
	background: var(--rudster-bg-alt);
	border-radius: var(--rudster-radius);
	margin: 2.5rem 0;
}

.author-bio-avatar img {
	border-radius: 50%;
}

.author-bio-name {
	margin: 0 0 0.4rem;
}

/* ---- Post navigation ---- */
.post-navigation,
.posts-pagination,
.comments-pagination {
	margin: 2.5rem 0;
}

.post-navigation .nav-links {
	display: flex;
	justify-content: space-between;
	gap: 1.5rem;
}

.nav-subtitle {
	display: block;
	font-size: 0.8rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--rudster-text-muted);
}

.nav-links a {
	font-weight: 600;
}

/* ---- Pagination ---- */
.pagination .page-numbers {
	display: inline-block;
	padding: 0.5rem 0.85rem;
	margin: 0 0.15rem;
	border: 1px solid var(--rudster-border);
	border-radius: var(--rudster-radius);
	color: var(--rudster-text);
}

.pagination .page-numbers.current {
	background: var(--rudster-accent);
	color: #fff;
	border-color: var(--rudster-accent);
}

/* ---- Widgets ---- */
.widget {
	margin-bottom: 2.5rem;
}

.widget-title {
	font-size: 1.1rem;
	margin-bottom: 1rem;
	padding-bottom: 0.5rem;
	border-bottom: 2px solid var(--rudster-accent);
}

.widget ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.widget ul li {
	padding: 0.4rem 0;
	border-bottom: 1px solid var(--rudster-border);
}

/* ---- Search form ---- */
.search-form {
	display: flex;
	gap: 0.5rem;
}

.search-field {
	flex: 1 1 auto;
	padding: 0.6rem 0.85rem;
	border: 1px solid var(--rudster-border);
	border-radius: var(--rudster-radius);
	font: inherit;
}

.search-submit,
.body:not(.pcs-dashboard-page):not(.pcs-light-page):not(.pcs-login-active) button,
body:not(.pcs-dashboard-page):not(.pcs-light-page):not(.pcs-login-active) button[type="submit"] {
	padding: 0.6rem 1.2rem;
	background: var(--rudster-accent);
	color: #fff;
	border: none;
	border-radius: var(--rudster-radius);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.search-submit:hover,
.button:hover {
	background: var(--rudster-accent-dark);
}

/* ---- Footer ---- */
.site-footer {
	background: var(--rudster-bg-alt);
	border-top: 1px solid var(--rudster-border);
	padding: 2rem 0;
	margin-top: 3rem;
}

.site-footer-inner {
	max-width: var(--rudster-content-max);
	margin-left: auto;
	margin-right: auto;
	padding-left: var(--rudster-space);
	padding-right: var(--rudster-space);
}

.footer-widgets {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 2rem;
	margin-bottom: 1.5rem;
}

.footer-menu-list {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 1.2rem;
	padding: 0;
	margin: 0 0 1rem;
	justify-content: center;
}

.footer-menu-list a {
	color: var(--rudster-text-muted);
	text-decoration: none;
	font-size: 0.9rem;
}

.footer-menu-list a:hover {
	color: var(--rudster-accent);
}

.site-info {
	text-align: center;
	color: var(--rudster-text-muted);
	font-size: 0.875rem;
}

/* ---- Back to top ---- */
.back-to-top {
	position: fixed;
	right: 1.5rem;
	bottom: 1.5rem;
	width: 46px;
	height: 46px;
	border-radius: 50%;
	background: var(--rudster-accent);
	color: #fff;
	border: none;
	font-size: 1.2rem;
	cursor: pointer;
	opacity: 0;
	visibility: hidden;
	transform: translateY(10px);
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
	box-shadow: var(--rudster-shadow);
	z-index: 90;
}

.back-to-top.is-visible {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

/* ---- Comments ---- */
.comments-area {
	margin-top: 3rem;
}

.comment-list {
	list-style: none;
	padding: 0;
}

.comment-list ol.children {
	list-style: none;
	padding-left: 1.5rem;
}

/* ---- Alignments (block editor) ---- */
.alignleft {
	float: left;
	margin: 0.4rem 1.5rem 1rem 0;
}

.alignright {
	float: right;
	margin: 0.4rem 0 1rem 1.5rem;
}

.aligncenter {
	display: block;
	margin-left: auto;
	margin-right: auto;
}

.alignwide {
	margin-left: calc(-1 * var(--rudster-space));
	margin-right: calc(-1 * var(--rudster-space));
}

.wp-caption {
	max-width: 100%;
}

.wp-caption-text {
	font-size: 0.85rem;
	color: var(--rudster-text-muted);
	text-align: center;
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}
