/* PostGhost theme styles. Colors, fonts and sizes come from CSS variables set in the Customizer. */

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
	margin: 0;
	font-family: var(--pg-font-body);
	font-size: var(--pg-font-size);
	line-height: 1.65;
	color: var(--pg-text);
	background: #fff;
	-webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6 {
	font-family: var(--pg-font-heading);
	font-weight: var(--pg-heading-weight);
	color: var(--pg-heading);
	line-height: 1.15;
	letter-spacing: -0.02em;
	margin: 0 0 0.6em;
}
h1 { font-size: clamp(2.2rem, 4.2vw, 3.7rem); }
h2 { font-size: clamp(1.8rem, 3.3vw, 3rem); }
h3 { font-size: clamp(1.25rem, 1.8vw, 1.5rem); }
p { margin: 0 0 1.1em; }
a { color: var(--pg-primary); text-underline-offset: 0.15em; }
a:hover { color: var(--pg-primary-hover); }
img, svg, video { max-width: 100%; height: auto; }
img { display: block; }
:focus-visible { outline: 3px solid var(--pg-primary); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--pg-primary); color: #fff; }

.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.screen-reader-text:focus {
	clip: auto; clip-path: none; width: auto; height: auto; margin: 0; z-index: 100000;
	top: 8px; left: 8px; padding: 12px 18px; background: #fff; color: var(--pg-primary);
	font-weight: 700; border-radius: 10px; box-shadow: 0 6px 24px rgba(14, 13, 19, 0.2);
}
.skip-link:focus { position: fixed !important; }

.pg-container { width: 100%; max-width: calc(var(--pg-container) + 48px); margin: 0 auto; padding: 0 24px; }
.pg-narrow { max-width: 820px; }
.pg-eyebrow { font-family: var(--pg-font-heading); font-weight: 700; font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--pg-primary); margin-bottom: 8px; }

/* WordPress core classes */
.alignleft { float: left; margin: 0.3em 1.5em 1em 0; }
.alignright { float: right; margin: 0.3em 0 1em 1.5em; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.wp-caption, figure { max-width: 100%; margin: 0 0 1.5em; }
.wp-caption-text, figcaption { font-size: 14px; color: var(--pg-muted); margin-top: 8px; }
.sticky .pg-card-title::before { content: "\2605  "; color: var(--pg-primary); }
.bypostauthor > .comment-body .fn::after { content: " \2713"; color: var(--pg-primary); }
.gallery { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }

/* ---------- Buttons ---------- */
.pg-btn,
.wp-block-button__link,
input[type="submit"],
button[type="submit"] {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 48px; padding: 0 24px;
	font-family: var(--pg-font-heading); font-weight: 700; font-size: 16px; line-height: 1;
	border-radius: var(--pg-btn-radius); border: 2px solid transparent;
	text-decoration: none; cursor: pointer;
	transition: background-color 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
}
.pg-btn:active { transform: translateY(1px); }
.pg-btn-primary, .wp-block-button__link, input[type="submit"], button[type="submit"] { background: var(--pg-primary); color: #fff; }
.pg-btn-primary:hover, .wp-block-button__link:hover, input[type="submit"]:hover, button[type="submit"]:hover { background: var(--pg-primary-hover); color: #fff; }
.pg-btn-outline { background: #fff; color: var(--pg-primary); border-color: var(--pg-primary); }
.pg-btn-outline:hover { background: var(--pg-primary); color: #fff; }
.pg-btn-white { background: #fff; color: var(--pg-primary); }
.pg-btn-white:hover { background: var(--pg-tint); color: var(--pg-primary-hover); }
.pg-btn-ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.8); }
.pg-btn-ghost:hover { background: #fff; color: var(--pg-dark); }

/* ---------- Header ---------- */
.pg-header {
	position: relative; z-index: 50;
	background: rgba(255, 255, 255, 0.95);
	-webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
	border-bottom: 1px solid var(--pg-border);
}
.pg-sticky-header .pg-header { position: sticky; top: 0; }
.admin-bar.pg-sticky-header .pg-header { top: 32px; }
@media (max-width: 782px) { .admin-bar.pg-sticky-header .pg-header { top: 46px; } }
@media (max-width: 600px) { .admin-bar.pg-sticky-header .pg-header { top: 0; } }

.pg-header-row { display: flex; align-items: center; gap: 24px; min-height: 72px; }
.pg-brand { flex: none; }
.pg-brand img, .pg-brand .custom-logo { height: var(--pg-logo-height); width: auto; }
.pg-logo-link, .custom-logo-link { display: flex; align-items: center; }
.pg-nav { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.pg-primary { flex: 1; display: flex; justify-content: center; }

.pg-menu { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 4px; }
.pg-menu > .pg-menu-item { position: static; }
.pg-top-link {
	display: inline-flex; align-items: center; gap: 6px;
	min-height: 40px; padding: 0 14px; border-radius: 10px;
	font-family: var(--pg-font-heading); font-size: 15px; font-weight: 500;
	color: var(--pg-heading); text-decoration: none;
	background: none; border: 0; cursor: pointer;
}
.pg-top-link:hover, .pg-top-link[aria-expanded="true"], .pg-top-link.is-current, .current-menu-item > .pg-top-link { color: var(--pg-primary); background: var(--pg-tint); }
.pg-top-link .pg-icon-chevron { transition: transform 0.2s; }
.pg-top-link[aria-expanded="true"] .pg-icon-chevron { transform: rotate(180deg); }

.pg-header-actions { display: flex; align-items: center; gap: 18px; flex: none; }
.pg-header-login { font-family: var(--pg-font-heading); font-weight: 700; font-size: 16px; color: var(--pg-primary); text-decoration: none; }
.pg-header-login:hover { text-decoration: underline; }
.pg-header-actions .pg-btn { min-height: 44px; padding: 0 22px; }

/* Mega panels */
.pg-mega {
	position: absolute; left: 0; right: 0; top: 100%;
	padding: 12px 24px 24px;
	visibility: hidden; opacity: 0; transform: translateY(-6px);
	transition: opacity 0.18s, transform 0.18s, visibility 0s 0.18s;
}
.pg-menu-item.is-open > .pg-mega { visibility: visible; opacity: 1; transform: none; transition: opacity 0.18s, transform 0.18s; }
.pg-mega-inner {
	max-width: var(--pg-container); margin: 0 auto; padding: 18px;
	background: #fff; border: 1px solid var(--pg-border); border-radius: var(--pg-card-radius);
	box-shadow: 0 24px 60px rgba(14, 13, 19, 0.14);
}
.pg-mega-list {
	list-style: none; margin: 0; padding: 0;
	display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px;
}
.pg-mega-list:has(.pg-feature) { grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(260px, 0.9fr); }
.pg-mega-list > .pg-feature { grid-column: -2 / -1; grid-row: 1 / span 4; }
.pg-mega-link {
	display: flex; gap: 12px; align-items: flex-start; height: 100%;
	padding: 12px 14px; border-radius: 14px; text-decoration: none; color: var(--pg-heading);
}
.pg-mega-link:hover, .pg-mega-link:focus-visible { background: var(--pg-tint); }
.pg-mega-icon { flex: none; display: inline-flex; width: 36px; height: 36px; align-items: center; justify-content: center; border-radius: 10px; background: var(--pg-light); color: var(--pg-heading); }
.pg-mega-text { display: flex; flex-direction: column; gap: 2px; }
.pg-mega-title { font-family: var(--pg-font-heading); font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; gap: 8px; }
.pg-mega-desc { font-size: 14px; line-height: 1.45; color: var(--pg-muted); }
.pg-mega-feature {
	display: flex; flex-direction: column; gap: 8px; height: 100%;
	padding: 22px; border-radius: 18px; text-decoration: none;
	background: var(--pg-primary); color: #fff;
}
.pg-mega-feature .pg-mega-title { font-size: 20px; color: #fff; }
.pg-mega-feature .pg-mega-desc { color: rgba(255, 255, 255, 0.82); }
.pg-mega-eyebrow { align-self: flex-start; padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.16); font-size: 12px; font-weight: 700; font-family: var(--pg-font-heading); }
.pg-mega-more { margin-top: auto; display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-family: var(--pg-font-heading); }
.pg-mega-feature:hover { background: var(--pg-primary-hover); color: #fff; }

.pg-badge {
	display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px;
	background: var(--pg-primary); color: #fff; font-size: 11px; font-weight: 700; line-height: 1.5;
	font-family: var(--pg-font-heading); letter-spacing: 0.02em;
}

/* Phone menu button */
.pg-menu-toggle {
	display: none; margin-left: auto; width: 44px; height: 44px; align-items: center; justify-content: center;
	border-radius: 12px; border: 1px solid var(--pg-border); background: #fff; color: var(--pg-primary); cursor: pointer;
}
.pg-menu-toggle .pg-menu-toggle-open { display: inline-flex; }
.pg-menu-toggle .pg-menu-toggle-close { display: none; }
.pg-menu-toggle[aria-expanded="true"] .pg-menu-toggle-open { display: none; }
.pg-menu-toggle[aria-expanded="true"] .pg-menu-toggle-close { display: inline-flex; }

@media (max-width: 1080px) {
	.pg-menu-toggle { display: inline-flex; }
	.pg-nav {
		display: none; position: absolute; left: 12px; right: 12px; top: calc(100% + 8px);
		flex-direction: column; align-items: stretch; gap: 8px;
		max-height: calc(100vh - 100px); overflow-y: auto;
		padding: 10px; background: #fff; border: 1px solid var(--pg-border); border-radius: 18px;
		box-shadow: 0 18px 40px rgba(14, 13, 19, 0.14);
	}
	.pg-nav.is-open { display: flex; }
	.pg-primary { display: block; }
	.pg-menu { flex-direction: column; align-items: stretch; gap: 2px; }
	.pg-top-link { width: 100%; justify-content: space-between; min-height: 48px; font-size: 16px; font-weight: 700; }
	.pg-mega { position: static; padding: 0; display: none; visibility: visible; opacity: 1; transform: none; transition: none; }
	.pg-menu-item.is-open > .pg-mega { display: block; }
	.pg-mega-inner { padding: 4px; border: 0; box-shadow: none; background: var(--pg-light); border-radius: 14px; }
	.pg-mega-list, .pg-mega-list:has(.pg-feature) { grid-template-columns: 1fr; }
	.pg-mega-list > .pg-feature { grid-column: auto; grid-row: auto; }
	.pg-mega-desc { display: none; }
	.pg-mega-feature .pg-mega-desc { display: block; }
	.pg-header-actions { flex-direction: column; align-items: stretch; gap: 8px; padding: 8px 4px 4px; border-top: 1px solid var(--pg-border); }
	.pg-header-login { padding: 10px 14px; }
	.pg-header-actions .pg-btn { width: 100%; }
	.pg-hide-mobile-cta .pg-header-cta { display: none; }
}

/* ---------- Main areas ---------- */
.pg-main { display: block; }
.pg-main:not(.pg-main-elementor) { padding-bottom: 80px; }
.pg-main.pg-container.pg-narrow { padding-top: 64px; }
.pg-archive-header { padding: 72px 0 40px; background: var(--pg-light); margin-bottom: 48px; text-align: center; }
.pg-archive-title { margin-bottom: 10px; }
.pg-archive-title span { color: var(--pg-primary); }
.pg-archive-intro { color: var(--pg-muted); font-size: 18px; max-width: 640px; margin: 0 auto; }
.pg-archive-header .pg-search-form { max-width: 520px; margin: 20px auto 0; }

.pg-content-wrap { display: block; }
.pg-has-sidebar .pg-content-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; }
@media (max-width: 960px) { .pg-has-sidebar .pg-content-wrap { grid-template-columns: 1fr; } }

/* Post cards */
.pg-cards { display: grid; gap: 28px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.pg-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--pg-border); border-radius: var(--pg-card-radius); overflow: hidden; transition: box-shadow 0.2s, transform 0.2s; }
.pg-card:hover { box-shadow: 0 16px 40px rgba(14, 13, 19, 0.08); transform: translateY(-2px); }
.pg-card-image img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.pg-card-body { display: flex; flex-direction: column; gap: 10px; padding: 22px 24px 26px; flex: 1; }
.pg-card-title { font-size: 21px; margin: 0; }
.pg-card-title a { color: var(--pg-heading); text-decoration: none; }
.pg-card-title a:hover { color: var(--pg-primary); }
.pg-card-excerpt { color: var(--pg-text); font-size: 15px; }
.pg-card-excerpt p { margin: 0; }
.pg-card-more { margin-top: auto; display: inline-flex; align-items: center; gap: 6px; font-family: var(--pg-font-heading); font-weight: 700; font-size: 15px; text-decoration: none; }

.pg-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; color: var(--pg-muted); font-family: var(--pg-font-heading); }
.pg-meta-cat { font-weight: 700; text-decoration: none; text-transform: uppercase; letter-spacing: 0.06em; font-size: 12px; }

/* Pagination */
.pagination, .comments-pagination { margin-top: 48px; }
.nav-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.page-numbers { display: inline-flex; min-width: 44px; min-height: 44px; align-items: center; justify-content: center; padding: 0 14px; border-radius: 12px; border: 1px solid var(--pg-border); text-decoration: none; color: var(--pg-heading); font-weight: 700; font-family: var(--pg-font-heading); }
.page-numbers.current, .page-numbers:hover { background: var(--pg-primary); color: #fff; border-color: var(--pg-primary); }

/* Single post / page */
.pg-entry { margin: 0 auto; }
.pg-entry-header { margin: 48px 0 28px; }
.pg-entry-header .pg-meta { margin-bottom: 14px; }
.pg-entry-image img { width: 100%; border-radius: var(--pg-card-radius); }
.pg-entry-content { font-size: 18px; line-height: 1.75; }
.pg-entry-content h2 { font-size: 30px; margin-top: 1.6em; }
.pg-entry-content h3 { font-size: 23px; margin-top: 1.4em; }
.pg-entry-content ul, .pg-entry-content ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.pg-entry-content li { margin-bottom: 0.4em; }
.pg-entry-content blockquote { margin: 1.5em 0; padding: 18px 24px; border-left: 4px solid var(--pg-primary); background: var(--pg-tint); border-radius: 0 14px 14px 0; font-size: 19px; }
.pg-entry-content table { width: 100%; border-collapse: collapse; margin: 0 0 1.5em; font-size: 16px; }
.pg-entry-content th, .pg-entry-content td { padding: 10px 14px; border-bottom: 1px solid var(--pg-border); text-align: left; }
.pg-entry-content th { background: var(--pg-tint); color: var(--pg-primary); font-family: var(--pg-font-heading); font-size: 14px; }
.pg-entry-content pre { overflow-x: auto; padding: 16px; background: var(--pg-dark); color: #fff; border-radius: 12px; font-size: 14px; }
.pg-entry-content code { font-size: 0.9em; background: var(--pg-light); padding: 2px 6px; border-radius: 6px; }
.pg-entry-content pre code { background: none; padding: 0; }
.pg-entry-content hr { border: 0; border-top: 1px solid var(--pg-border); margin: 2em 0; }
.pg-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 32px; }
.pg-tags a { padding: 6px 12px; border-radius: 999px; background: var(--pg-light); font-size: 14px; text-decoration: none; }
.pg-page-links { margin-top: 24px; font-weight: 700; }

.post-navigation { margin: 56px auto 0; max-width: 820px; }
.post-navigation .nav-links { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.post-navigation a { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 18px 20px; border: 1px solid var(--pg-border); border-radius: 16px; text-decoration: none; }
.post-navigation .nav-next a { text-align: right; }
.pg-nav-label { font-size: 13px; color: var(--pg-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.pg-nav-title { font-family: var(--pg-font-heading); font-weight: 700; color: var(--pg-heading); }

/* Forms */
input[type="text"], input[type="email"], input[type="url"], input[type="search"], input[type="password"], input[type="number"], input[type="tel"], textarea, select {
	width: 100%; min-height: 48px; padding: 10px 14px;
	font: inherit; color: var(--pg-heading); background: #fff;
	border: 1px solid #D5D7DE; border-radius: 12px;
}
input:focus, textarea:focus, select:focus { border-color: var(--pg-primary); outline: 3px solid rgba(139, 21, 56, 0.15); }
label { font-weight: 700; color: var(--pg-heading); }
.pg-search-form { display: flex; gap: 8px; }
.pg-search-form .pg-btn { flex: none; padding: 0 18px; }

/* Comments */
.pg-comments { margin: 56px auto 0; }
.pg-comment-list { list-style: none; padding: 0; margin: 0 0 32px; }
.pg-comment-list .children { list-style: none; padding-left: 28px; }
.comment-body { padding: 18px 0; border-bottom: 1px solid var(--pg-border); }
.comment-author { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.comment-author img { border-radius: 50%; }
.comment-metadata { font-size: 13px; color: var(--pg-muted); }
.comment-metadata a { color: inherit; }
.comment-form p { margin-bottom: 16px; }

/* Widgets */
.pg-sidebar .widget { margin-bottom: 32px; padding: 22px; border: 1px solid var(--pg-border); border-radius: var(--pg-card-radius); }
.widget-title { font-size: 18px; margin-bottom: 14px; }
.widget ul { list-style: none; padding: 0; margin: 0; }
.widget li { padding: 6px 0; }

.pg-404 { text-align: center; padding-top: 96px !important; }
.pg-404 .pg-search-form { max-width: 480px; margin: 24px auto; }
.pg-none { text-align: center; padding: 48px 0; }

/* ---------- Footer ---------- */
.pg-footer { background: var(--pg-dark); color: #fff; padding: 80px 0 40px; font-size: 15px; }
.pg-footer a { color: rgba(255, 255, 255, 0.7); text-decoration: none; }
.pg-footer a:hover { color: #fff; }
.pg-footer-cols { display: grid; grid-template-columns: repeat(var(--pg-cols, 5), minmax(0, 1fr)); gap: 32px; }
.pg-footer-title { display: flex; align-items: center; gap: 8px; font-family: var(--pg-font-heading); font-weight: 700; font-size: 14px; line-height: 1.3; color: #fff; margin: 0 0 16px; letter-spacing: 0; }
.pg-footer-title::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--pg-primary); box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12); }
.pg-footer-menu { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.pg-footer-menu .pg-top-link { display: inline-flex; gap: 8px; min-height: 0; padding: 0; border-radius: 0; font-family: var(--pg-font-body); font-size: 15px; font-weight: 400; color: rgba(255, 255, 255, 0.7); background: none; }
.pg-footer-menu .pg-top-link:hover { color: #fff; background: none; }

.pg-footer-help {
	display: flex; flex-wrap: wrap; align-items: center; gap: 18px 24px;
	margin-top: 56px; padding: 24px 28px; border-radius: var(--pg-card-radius);
	background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.1);
}
.pg-footer-help-icon { flex: none; display: inline-flex; width: 48px; height: 48px; align-items: center; justify-content: center; border-radius: 14px; background: var(--pg-primary); color: #fff; }
.pg-footer-help-text { flex: 1 1 260px; display: flex; flex-direction: column; gap: 2px; }
.pg-footer-help-text strong { font-family: var(--pg-font-heading); font-size: 20px; }
.pg-footer-help-text span { color: rgba(255, 255, 255, 0.7); }
.pg-footer-help-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.pg-footer .pg-btn-white { color: var(--pg-primary); }
.pg-footer .pg-btn-ghost { color: #fff; }
.pg-footer .pg-btn-ghost:hover { color: var(--pg-dark); }

.pg-footer-widgets { margin-top: 40px; }

.pg-footer-brand { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 24px 48px; margin-top: 56px; padding-top: 40px; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.pg-footer-brand-text { max-width: 420px; }
.pg-footer-logo { display: inline-flex; margin-bottom: 16px; }
.pg-footer-logo.has-box { padding: 14px 18px; background: #fff; border-radius: 16px; }
.pg-footer-logo img { height: 40px; width: auto; }
.pg-footer-about { color: rgba(255, 255, 255, 0.7); margin: 0; }
.pg-footer-brand-links { display: flex; flex-direction: column; align-items: flex-end; gap: 16px; }
.pg-social { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.pg-social a { display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center; border-radius: 50%; background: rgba(255, 255, 255, 0.08); color: #fff; }
.pg-social a:hover { background: var(--pg-primary); }
.pg-legal-menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 16px; font-size: 14px; }
.pg-footer-legal { margin: 32px 0 0; font-size: 13px; color: rgba(255, 255, 255, 0.55); }

@media (max-width: 960px) {
	.pg-footer-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.pg-footer-brand-links { align-items: flex-start; }
}
@media (max-width: 520px) {
	.pg-footer-cols { grid-template-columns: 1fr; }
	.pg-footer-help-actions, .pg-footer-help-actions .pg-btn { width: 100%; }
}

/* ---------- Elementor pages ---------- */
.pg-elementor-page .pg-main-elementor { overflow-x: clip; }

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