/*
Theme Name: Performance Automotive Dealer
Description: Shared layout for every dealer blog on the Performance Automotive Network. Dealer name, logo, address, contact page and website links come from each site's own settings; brand colors come from the style variation chosen in Appearance > Editor > Styles.
Template: twentytwentyfive
Version: 1.10.0
Requires at least: 6.7
Requires PHP: 8.1
Text Domain: pan-dealer
*/

/* Top bar: address and contact link */
.pan-topbar {
	background: var(--wp--preset--color--accent-2);
	color: var(--wp--preset--color--base);
	font-size: 0.8125rem;
	letter-spacing: 0.02em;
	padding: 0.5rem var(--wp--style--root--padding-right) 0.5rem var(--wp--style--root--padding-left);
	gap: 0.25rem 1.5rem;
}
.pan-topbar p {
	margin: 0;
}
.pan-topbar a {
	color: inherit;
	text-decoration: none;
}
.pan-topbar a:hover {
	text-decoration: underline;
}

/* Header: logo + navigation. It sticks to the top; the address bar above it scrolls away
   (assets/navigation.js measures --pan-topbar-h and --pan-header-h). */
header:has(> .pan-header) {
	position: sticky;
	top: calc(var(--wp-admin--admin-bar--height, 0px) - var(--pan-topbar-h, 0px));
	z-index: 50;
}
/* The admin bar scrolls with the page on small screens */
@media (max-width: 600px) {
	header:has(> .pan-header) {
		top: calc(0px - var(--pan-topbar-h, 0px));
	}
}
html {
	scroll-padding-top: calc(var(--wp-admin--admin-bar--height, 0px) + var(--pan-header-h, 0px) + 1rem);
}
.pan-header {
	background: var(--wp--preset--color--base);
	border-bottom: 1px solid var(--wp--preset--color--accent-6);
	padding: 1rem var(--wp--style--root--padding-right) 1rem var(--wp--style--root--padding-left);
	gap: 1rem 2rem;
	transition: box-shadow 0.2s ease;
}
header.is-stuck .pan-header {
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}
.pan-header .wp-block-site-logo img {
	max-height: 56px;
	width: auto;
}
.pan-header .wp-block-site-title {
	font-size: 1.125rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	margin: 0;
}
.pan-header .wp-block-site-title a {
	text-decoration: none;
}

/* Text-style links built from Button blocks (so their URLs can come from dealer settings); the footer address matches them */
.pan-nav {
	gap: 0.5rem 1.75rem;
}
.pan-nav .wp-block-button__link,
.pan-footer-links .wp-block-button__link,
.pan-footer .pan-footer-address a {
	background: transparent;
	border: 0;
	color: var(--wp--preset--color--contrast);
	padding: 0.25rem 0;
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-decoration: none;
}
.pan-nav .wp-block-button__link:hover,
.pan-footer-links .wp-block-button__link:hover,
.pan-footer .pan-footer-address a:hover {
	background: transparent;
	color: var(--wp--preset--color--accent-3);
	text-decoration: underline;
	text-underline-offset: 0.3em;
}
.pan-nav .pan-nav-cta .wp-block-button__link {
	background: var(--wp--preset--color--accent-1);
	color: var(--wp--preset--color--base);
	padding: 0.6rem 1.1rem;
}
.pan-nav .pan-nav-cta .wp-block-button__link:hover {
	background: var(--wp--preset--color--brand-alt);
	color: var(--wp--preset--color--base);
	text-decoration: none;
}
/* Small screens: compact sticky header, menu on one row that swipes sideways */
@media (max-width: 781px) {
	.pan-header {
		padding-top: 0.6rem;
		padding-bottom: 0.6rem;
		gap: 0.4rem;
	}
	.pan-header .wp-block-site-logo img {
		max-height: 40px;
	}
	.pan-nav {
		flex-wrap: nowrap;
		gap: 1.25rem;
		width: 100%;
		overflow-x: auto;
		scrollbar-width: none;
	}
	.pan-nav::-webkit-scrollbar {
		display: none;
	}
	.pan-nav .wp-block-button {
		flex: 0 0 auto;
	}
	.pan-nav .pan-nav-cta .wp-block-button__link {
		padding: 0.45rem 0.8rem;
	}
}

/* Blog home intro */
.pan-hero {
	background: var(--wp--preset--color--accent-5);
	padding-top: var(--wp--preset--spacing--40);
	padding-bottom: var(--wp--preset--spacing--40);
}
.pan-eyebrow {
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent-4);
	margin-bottom: 0.5rem;
}
.pan-hero h1 {
	margin-top: 0;
	font-size: clamp(1.6rem, 3vw, 2.25rem);
}

/* Keyword search and category filter (parts/blog-tools.html) */
.pan-hero .wp-block-template-part {
	margin-top: var(--wp--preset--spacing--30);
}
.pan-tools {
	gap: 0.75rem;
}
.pan-tools > * {
	margin: 0;
}
.pan-search {
	flex: 1 1 340px;
	max-width: 560px;
}
.pan-search .wp-block-search__inside-wrapper {
	height: 100%;
	gap: 0;
}
.pan-search .wp-block-search__input,
.pan-cat-filter select {
	box-sizing: border-box;
	min-height: 46px;
	padding: 0.65rem 0.9rem;
	border: 1px solid #CBD0D6;
	border-radius: 0;
	background-color: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
	font-family: inherit;
	font-size: 0.95rem;
}
.pan-search .wp-block-search__input {
	border-right: 0;
}
.pan-search .wp-block-search__input:focus,
.pan-cat-filter select:focus {
	outline: 2px solid var(--wp--preset--color--accent-1);
	outline-offset: -2px;
}
.pan-search .wp-block-search__button {
	margin: 0;
	min-height: 46px;
	border-radius: 0;
}
.pan-cat-filter {
	flex: 0 1 240px;
}
.pan-cat-filter select {
	width: 100%;
	padding-right: 2.4rem;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23555' stroke-width='1.6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.9rem center;
	cursor: pointer;
}
@media (max-width: 600px) {
	.pan-search,
	.pan-cat-filter {
		flex-basis: 100%;
		max-width: none;
	}
}

/* Post grids and articles */
.pan-posts {
	margin-top: var(--wp--preset--spacing--50);
	margin-bottom: var(--wp--preset--spacing--60);
}
.pan-posts .wp-block-post-template {
	row-gap: var(--wp--preset--spacing--50);
}
.pan-posts .wp-block-query-pagination {
	margin-top: var(--wp--preset--spacing--50);
}
.pan-posts:has(> .pan-count) {
	margin-top: var(--wp--preset--spacing--30);
}
.pan-count {
	margin: 0;
	text-align: right;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent-4);
}

/* Back-to-top button (assets/navigation.js) */
.pan-to-top {
	position: fixed;
	right: 1.25rem;
	bottom: 1.25rem;
	z-index: 60;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--wp--preset--color--accent-1);
	color: var(--wp--preset--color--base);
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
	cursor: pointer;
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s, background-color 0.2s ease;
}
.pan-to-top.is-visible {
	opacity: 1;
	visibility: visible;
	transform: none;
}
.pan-to-top:hover {
	background: var(--wp--preset--color--brand-alt);
}
.pan-to-top:focus-visible {
	outline: 2px solid var(--wp--preset--color--contrast);
	outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
	.pan-to-top {
		transition: none;
	}
}
.pan-posts.pan-infinite .wp-block-query-pagination {
	display: none;
}
.pan-infinite-status {
	margin: var(--wp--preset--spacing--50) 0 0;
	text-align: center;
	font-size: 0.9rem;
	color: var(--wp--preset--color--accent-4);
}
.pan-infinite-status:empty {
	margin: 0;
}
.pan-infinite-status.is-loading::before {
	content: "";
	display: inline-block;
	width: 1em;
	height: 1em;
	margin-right: 0.5em;
	vertical-align: -0.15em;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: pan-spin 0.8s linear infinite;
}
@keyframes pan-spin {
	to {
		transform: rotate(360deg);
	}
}
@media (prefers-reduced-motion: reduce) {
	.pan-infinite-status.is-loading::before {
		animation: none;
	}
}
.pan-article-layout {
	gap: var(--wp--preset--spacing--50);
	margin-top: 0;
	margin-bottom: var(--wp--preset--spacing--50);
}
.pan-article-head {
	padding-top: 1.5rem;
}
.pan-article-head > * {
	margin-block: 0.4rem;
}
.pan-article-head .wp-block-post-title {
	font-size: clamp(1.6rem, 2.6vw, 2.1rem);
	line-height: 1.2;
}
.pan-article .wp-block-post-featured-image {
	margin-block: var(--wp--preset--spacing--30);
}
.wp-block-post-content h1 {
	font-size: clamp(1.4rem, 2.4vw, 1.85rem);
	line-height: 1.25;
}

/* Suggested posts: sidebar on desktop, one recommendation under the post on mobile */
.pan-sidebar-inner {
	position: sticky;
	top: calc(var(--wp-admin--admin-bar--height, 0px) + var(--pan-header-h, 0px) + 1.5rem);
	padding-top: 1.5rem;
}
.pan-sidebar-inner > .pan-meta {
	margin: 0 0 0.5rem;
}
/* Dealer blog banners are 1400x350 (4:1) */
.pan-suggest {
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	padding: 0.9rem 0;
	border-top: 1px solid var(--wp--preset--color--accent-6);
}
.pan-suggest .wp-block-post-featured-image,
.pan-mobile-rec .wp-block-post-featured-image {
	width: 100%;
	aspect-ratio: 4 / 1;
	margin: 0;
	overflow: hidden;
	background: var(--wp--preset--color--accent-5);
}
.pan-suggest .wp-block-post-featured-image a,
.pan-suggest .wp-block-post-featured-image img,
.pan-mobile-rec .wp-block-post-featured-image a,
.pan-mobile-rec .wp-block-post-featured-image img {
	display: block;
	width: 100%;
	height: 100% !important;
	object-fit: cover;
}
.pan-suggest-text > * {
	margin: 0;
}
.pan-suggest .wp-block-post-title {
	font-size: 0.95rem;
	line-height: 1.35;
}
.pan-suggest .wp-block-post-title a {
	text-decoration: none;
}
.pan-suggest .wp-block-post-title a:hover {
	text-decoration: underline;
}
.pan-suggest-text .pan-meta {
	margin-top: 0.35rem;
}
.pan-mobile-rec {
	margin-top: var(--wp--preset--spacing--40);
	padding-top: var(--wp--preset--spacing--40);
	border-top: 1px solid var(--wp--preset--color--accent-6);
}
.pan-mobile-rec .wp-block-post-template {
	margin: 0;
	padding: 0;
}
@media (max-width: 781px) {
	.pan-sidebar {
		display: none;
	}
}
@media (min-width: 782px) {
	.pan-mobile-rec {
		display: none;
	}
}

/* Post cards */
.pan-card .wp-block-post-title {
	font-size: 1.25rem;
	line-height: 1.3;
}
.pan-card {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	height: 100%;
}
.pan-card > * {
	margin: 0;
}
/* Same frame for every card so titles line up: 4:1 fits the dealer banners exactly, taller photos are cropped */
.pan-card .wp-block-post-featured-image {
	width: 100%;
	aspect-ratio: 4 / 1;
	max-height: 128px;
	overflow: hidden;
	background: var(--wp--preset--color--accent-5);
}
.pan-card .wp-block-post-featured-image a,
.pan-card .wp-block-post-featured-image img {
	display: block;
	width: 100%;
	height: 100% !important;
	object-fit: cover;
	object-position: center;
}
.pan-card .wp-block-post-featured-image img {
	transition: transform 0.3s ease;
}
.pan-card:hover .wp-block-post-featured-image img {
	transform: scale(1.03);
}
.pan-card .wp-block-post-excerpt {
	font-size: 0.95rem;
	line-height: 1.55;
	color: var(--wp--preset--color--accent-4);
}
.pan-card .wp-block-post-excerpt__excerpt {
	margin: 0;
}
.pan-card .wp-block-post-title a {
	text-decoration: none;
}
.pan-card .wp-block-post-title a:hover {
	text-decoration: underline;
	text-underline-offset: 0.15em;
}
.pan-meta,
.pan-meta a {
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent-4);
	text-decoration: none;
}

/* Elementor manages its own section widths */
.wp-block-post-content > .elementor {
	max-width: none;
}

/* Post content pasted from Dealer Inspire (Bootstrap-style rows and columns) */
.wp-block-post-content img {
	max-width: 100%;
	height: auto;
}
/* Columns share one row on tablets and desktops. On phones, full-width columns (col-xs-12, or columns
   with only sm/md sizes) stack while col-xs-6 / col-xs-4 stay side by side, as in Bootstrap.
   Rows and columns carry inline margins and padding, hence the !important. */
.wp-block-post-content .row {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 20px !important;
	margin-bottom: 20px !important;
}
/* Dealer Inspire rows carry an inline max-width:100% that would stretch them edge to edge */
.wp-block-post-content > .row {
	max-width: var(--wp--style--global--content-size) !important;
}
/* Single posts use a plain column, where rows line up with the text instead */
.wp-block-post-content.is-layout-flow > .row {
	max-width: none !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
}
.wp-block-post-content .row > [class*="col-"] {
	flex: 1 1 0;
	min-width: 0;
	margin: 0 !important;
	padding: 0 !important;
	box-sizing: border-box;
}
.wp-block-post-content .row > .col-sm-12,
.wp-block-post-content .row > .col-md-12 {
	flex-basis: 100%;
}
@media (max-width: 599px) {
	.wp-block-post-content .row > .col-xs-12,
	.wp-block-post-content .row > [class*="col-"]:not([class*="col-xs-"]) {
		flex-basis: 100%;
	}
}
.wp-block-post-content .row img {
	display: block;
	width: 100%;
}

/* Pasted buttons: brand colors (their inline colors are removed in functions.php) and default
   padding for the ones that do not set their own inline */
.wp-block-post-content a.button,
.wp-block-post-content a.btn,
.wp-block-post-content a.cta-button {
	display: inline-block;
	box-sizing: border-box;
	padding: 12px 18px;
	border-radius: 20px;
	background: var(--wp--preset--color--accent-1);
	color: var(--wp--preset--color--base);
	font-weight: 600;
	line-height: 1.3;
	text-align: center;
	text-decoration: none;
	transition: background-color 0.2s ease;
}
.wp-block-post-content .row a.button,
.wp-block-post-content .row a.btn,
.wp-block-post-content .row a.cta-button {
	display: block;
	width: 100%;
}
/* Buttons placed one after another outside a row */
.wp-block-post-content a.cta-button {
	margin: 6px 8px 6px 0;
}
.wp-block-post-content a.button:hover,
.wp-block-post-content a.button:focus,
.wp-block-post-content a.btn:hover,
.wp-block-post-content a.btn:focus,
.wp-block-post-content a.cta-button:hover,
.wp-block-post-content a.cta-button:focus {
	background: var(--wp--preset--color--brand-alt);
	color: var(--wp--preset--color--base);
}

/* Button labels stay on one line; assets/fit-buttons.js shrinks text that would not fit */
.wp-element-button,
.wp-block-post-content a.button,
.wp-block-post-content a.btn,
.wp-block-post-content a.cta-button,
.wp-block-post-content .elementor-button {
	white-space: nowrap;
}
.wp-block-post-content a.button,
.wp-block-post-content a.btn,
.wp-block-post-content a.cta-button,
.wp-block-post-content .wp-block-button__link,
.wp-block-post-content .elementor-button {
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
}
/* Pasted Dealer Inspire buttons set their padding inline */
@media (max-width: 480px) {
	.wp-block-post-content a.button,
	.wp-block-post-content a.btn,
	.wp-block-post-content a.cta-button {
		padding-left: 8px !important;
		padding-right: 8px !important;
	}
}

/* Links to other websites (they open in a new tab, see functions.php) */
.pan-external {
	display: inline-block;
	width: 0.65em;
	height: 0.65em;
	margin-left: 0.25em;
	background-color: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M4.5 1H11v6.5H9.5V3.56l-7.44 7.5L1 10l7.44-7.5H4.5z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M4.5 1H11v6.5H9.5V3.56l-7.44 7.5L1 10l7.44-7.5H4.5z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.pan-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* FAQ sections from the dealer website get the same box as the blog template's FAQ */
.wp-block-post-content [data-chunk-type="faq"] {
	margin: 30px 0;
	padding: 15px 20px;
	background: #f5f5f5;
	border-left: 4px solid var(--wp--preset--color--accent-1);
	border-radius: 10px;
}
.wp-block-post-content [data-chunk-type="faq"] > :first-child {
	margin-top: 0;
}
.wp-block-post-content [data-chunk-type="faq"] > :last-child {
	margin-bottom: 0;
}

/* Dealer call-to-action band */
.pan-cta {
	background: var(--wp--preset--color--accent-2);
	color: var(--wp--preset--color--base);
	padding-top: var(--wp--preset--spacing--60);
	padding-bottom: var(--wp--preset--spacing--60);
}
.pan-cta h2 {
	color: inherit;
}
/* The outline keeps dark brand buttons (Lexus, Ford) visible on the dark band */
.pan-cta .wp-block-button__link {
	background: var(--wp--preset--color--accent-1);
	color: var(--wp--preset--color--base);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}
.pan-cta .wp-block-button__link:hover,
.pan-cta .wp-block-button__link:focus {
	background: var(--wp--preset--color--brand-alt);
	color: var(--wp--preset--color--base);
}

/* Footer */
.pan-footer {
	background: var(--wp--preset--color--accent-5);
	padding-top: var(--wp--preset--spacing--60);
	padding-bottom: var(--wp--preset--spacing--50);
}
.pan-footer .wp-block-site-logo img {
	max-height: 64px;
	width: auto;
}
.pan-footer p {
	margin: 0.25rem 0;
}
.pan-footer a {
	color: inherit;
}
.pan-footer-links {
	flex-direction: column;
	align-items: flex-start;
	gap: 0.25rem;
}
.pan-footer-bottom {
	background: var(--wp--preset--color--accent-2);
	color: var(--wp--preset--color--base);
	font-size: 0.75rem;
	letter-spacing: 0.04em;
	padding: 0.75rem var(--wp--style--root--padding-right) 0.75rem var(--wp--style--root--padding-left);
	gap: 0.25rem 1.5rem;
}
.pan-footer-bottom p {
	margin: 0;
}
