/*
Theme Name:       Palace Catering
Theme URI:        https://conceptstadium.com/
Author:           Concept Stadium
Author URI:       https://conceptstadium.com/
Description:      Full-site editing theme for Palace Catering & Bakery — a family of catering and bakery brands.
Version:          1.0.13
Requires at least: 6.4
Tested up to:     6.7
Requires PHP:     8.0
License:          GNU General Public License v2 or later
License URI:      https://www.gnu.org/licenses/gpl-2.0.html
Text Domain:      palace-catering
Tags:             full-site-editing, block-patterns, block-styles, wide-blocks, accessibility-ready, custom-colors, custom-logo, custom-menu, editor-style, featured-images, threaded-comments, translation-ready
*/

/* -------------------------------------------------------------------------
   Base / accessibility utilities
   ------------------------------------------------------------------------- */

:root {
	/* Fallbacks; Global Styles / theme.json custom.radius override these. */
	--plct-radius-button: var(--wp--custom--radius--button, 4px);
	--plct-radius-image: var(--wp--custom--radius--image, 4px);
	--plct-radius-ui: var(--wp--custom--radius--ui, 4px);
	--plct-radius-ui-sm: min(var(--plct-radius-ui), 4px);
	--plct-radius-ui-lg: max(var(--plct-radius-ui), 8px);
	--plct-ui-radius: var(--plct-radius-ui);
	--plct-ui-radius-sm: var(--plct-radius-ui-sm);
	--plct-ui-radius-lg: var(--plct-radius-ui-lg);
}

/*
 * Section rhythm — Figma uses ~112px vertical padding on content sections.
 * Set on body so values win over compressed WP global-style presets on :root.
 */
body {
	--wp--preset--spacing--20: 0.5rem;
	--wp--preset--spacing--30: 1rem;
	--wp--preset--spacing--40: 1.5rem;
	--wp--preset--spacing--50: 2.5rem;
	--wp--preset--spacing--60: clamp(3rem, 2.5rem + 4vw, 5.5rem);
	--wp--preset--spacing--70: clamp(3.5rem, 3rem + 4.5vw, 6.5rem);
}

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

.skip-link.screen-reader-text:focus,
.skip-link.screen-reader-text:focus-visible,
.screen-reader-text:focus,
.screen-reader-text:focus-visible {
	background-color: var(--wp--preset--color--base, #fff);
	border-radius: 3px;
	box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
	clip: auto !important;
	clip-path: none !important;
	color: var(--wp--preset--color--primary, #1b2a4a);
	display: block;
	font-size: 0.875rem;
	font-weight: 700;
	height: auto;
	left: 5px;
	line-height: normal;
	overflow: visible;
	padding: 15px 23px 14px;
	position: fixed;
	text-decoration: none;
	top: 5px;
	width: auto;
	z-index: 100000;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
.wp-element-button:focus-visible,
.wp-block-navigation-item a:focus-visible,
.plct-block--header-primary a:focus-visible,
.plct-block--header-primary button:focus-visible {
	outline: 2px solid var(--wp--preset--color--accent, #c79233);
	outline-offset: 3px;
}

/* Content links stay underlined (a11y). Nav / buttons / footers / tiles handled by blocks. */
.entry-content a:where(:not(.wp-element-button)):not(.wp-block-navigation-item__content):not(.plct-btn):not(.plct-tiles__card),
.wp-block-post-content a:where(:not(.wp-element-button)):not(.wp-block-navigation-item__content):not(.plct-btn):not(.plct-tiles__card) {
	text-decoration: underline;
}

.entry-content .plct-block--footer-primary a,
.entry-content .plct-block--footer-alt a,
.wp-block-post-content .plct-block--footer-primary a,
.wp-block-post-content .plct-block--footer-alt a,
.entry-content a.plct-tiles__card,
.wp-block-post-content a.plct-tiles__card {
	text-decoration: none !important;
}

/* Flush header / footer against page edges (no site block-gap). */
.wp-site-blocks > .wp-block-template-part,
.wp-site-blocks > main,
.wp-site-blocks > .wp-block-group {
	margin-block-start: 0;
}

a.plct-btn {
	text-decoration: none;
}

/*
 * Full-bleed Palace Catering sections inside constrained post content.
 * Break out of global padding only — avoid 100vw (causes horizontal overflow).
 */
.wp-site-blocks {
	overflow-x: clip;
}

.wp-block-post-content.is-layout-constrained > .plct-block.alignfull,
.wp-block-post-content.is-layout-constrained > .plct-block.alignwide.plct-scheme--primary,
.wp-block-post-content.is-layout-constrained > .plct-block.alignwide.plct-scheme--accent,
.wp-block-post-content.is-layout-constrained > .plct-block.alignwide.plct-scheme--neutral-light,
.wp-block-post-content.is-layout-constrained > .plct-block.alignwide.plct-scheme--cream,
.wp-block-post-content.is-layout-constrained > .plct-block.plct-scheme--primary,
.wp-block-post-content.is-layout-constrained > .plct-block.plct-scheme--accent,
.wp-block-post-content.is-layout-constrained > .plct-block.plct-scheme--neutral-light,
.wp-block-post-content.is-layout-constrained > .plct-block.plct-scheme--cream,
.entry-content.is-layout-constrained > .plct-block.alignfull,
.entry-content.is-layout-constrained > .plct-block.plct-scheme--primary,
.entry-content.is-layout-constrained > .plct-block.plct-scheme--accent,
.entry-content.is-layout-constrained > .plct-block.plct-scheme--neutral-light,
.entry-content.is-layout-constrained > .plct-block.plct-scheme--cream {
	width: auto !important;
	max-width: none !important;
	margin-left: calc(-1 * var(--wp--style--root--padding-left, 0px)) !important;
	margin-right: calc(-1 * var(--wp--style--root--padding-right, 0px)) !important;
	/* Re-apply root gutter on the section so __inner can center like core headings. */
	padding-inline: var(--wp--style--root--padding-left, var(--wp--preset--spacing--40, 1.5rem))
		var(--wp--style--root--padding-right, var(--wp--preset--spacing--40, 1.5rem));
	box-sizing: border-box;
}

/*
 * Insights (posts) template: hero/CTA sit in already-full-bleed main.
 * Apply the same content gutter as page heroes — no negative-margin breakout.
 */
main.wp-block-group.alignfull > .plct-block.alignfull,
main.wp-block-group.alignfull > .plct-block.plct-scheme--primary,
main.wp-block-group.alignfull > .plct-block.plct-scheme--accent,
main.wp-block-group.alignfull > .plct-block.plct-scheme--cream {
	width: 100%;
	max-width: none;
	margin-left: 0;
	margin-right: 0;
	padding-inline: var(--wp--style--root--padding-left, var(--wp--preset--spacing--40, 1.5rem))
		var(--wp--style--root--padding-right, var(--wp--preset--spacing--40, 1.5rem));
	box-sizing: border-box;
}

/* Tighter stacking: section blocks own their vertical padding. */
.wp-block-post-content.is-layout-constrained > .plct-block + .plct-block,
.entry-content.is-layout-constrained > .plct-block + .plct-block {
	margin-block-start: 0;
}

.wp-block-post-content.is-layout-constrained > .wp-block-heading + .plct-block,
.entry-content.is-layout-constrained > .wp-block-heading + .plct-block {
	margin-block-start: var(--wp--preset--spacing--30, 1rem);
}

.wp-block-post-content.is-layout-constrained > .plct-block + .wp-block-heading,
.entry-content.is-layout-constrained > .plct-block + .wp-block-heading {
	margin-block-start: var(--wp--preset--spacing--50, 2.5rem);
}

/*
 * Core headings align with body content width (720px), not the wide section rail.
 * Groups / columns can still use the wide measure for marketing layouts.
 */
.wp-block-post-content > .wp-block-heading,
.entry-content > .wp-block-heading {
	max-width: var(--wp--style--global--content-size, 720px);
	margin-inline: auto;
	width: 100%;
	box-sizing: border-box;
}

/*
 * Document / legal template only — restore readable prose rhythm.
 * Theme blockGap is 0 for marketing full-bleed sections; keep that intact.
 */
body.page-template-page-document .wp-block-post-content > * + * {
	margin-block-start: 1.15em;
}

body.page-template-page-document .wp-block-post-content > .wp-block-heading {
	margin-block-start: 1.35em;
	margin-block-end: 0.55em;
	line-height: 1.2;
}

body.page-template-page-document .wp-block-post-content > .wp-block-heading:first-child {
	margin-block-start: 0;
}

body.page-template-page-document .wp-block-post-content > .wp-block-heading + * {
	margin-block-start: 0;
}

body.page-template-page-document .wp-block-post-content > .wp-block-list {
	margin-block: 0.85em 1.15em;
	padding-inline-start: 1.35em;
}

body.page-template-page-document .wp-block-post-content > .wp-block-list li + li {
	margin-block-start: 0.45em;
}

.wp-block-post-content.is-layout-constrained > .wp-block-group:not(.alignfull),
.wp-block-post-content.is-layout-constrained > .wp-block-columns:not(.alignfull),
.wp-block-post-content.is-layout-constrained > .wp-block-cover:not(.alignfull),
.entry-content.is-layout-constrained > .wp-block-group:not(.alignfull),
.entry-content.is-layout-constrained > .wp-block-columns:not(.alignfull),
.entry-content.is-layout-constrained > .wp-block-cover:not(.alignfull) {
	max-width: var(--wp--style--global--wide-size, 1200px);
	margin-inline: auto;
	width: 100%;
	box-sizing: border-box;
}

/*
 * Plain document pages under the global overlay header: use a solid sticky bar
 * so titles are not trapped under transparent nav (heroes keep overlay).
 */
.wp-site-blocks:has(.plct-block--header-primary.is-overlay):has(
		.wp-block-post-content > :first-child:not(.plct-block):not(.alignfull)
	)
	.plct-block--header-primary.is-overlay {
	position: sticky;
	background-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--base);
	--plct-nav-surface: var(--wp--preset--color--primary);
}

.wp-site-blocks:has(.plct-block--header-primary.is-overlay):has(
		.wp-block-post-content > :first-child:not(.plct-block):not(.alignfull)
	)
	main.wp-block-group.alignfull {
	padding-top: var(--wp--preset--spacing--60, 3rem);
	padding-bottom: var(--wp--preset--spacing--70, 4rem);
}

/* Full-bleed core Groups: break out, then restore root gutter on the group. */
.wp-block-post-content.is-layout-constrained > .wp-block-group.alignfull,
.entry-content.is-layout-constrained > .wp-block-group.alignfull {
	width: auto !important;
	max-width: none !important;
	margin-left: calc(-1 * var(--wp--style--root--padding-left, 0px)) !important;
	margin-right: calc(-1 * var(--wp--style--root--padding-right, 0px)) !important;
	box-sizing: border-box;
	padding-inline: var(--wp--style--root--padding-left, var(--wp--preset--spacing--40, 1.5rem))
		var(--wp--style--root--padding-right, var(--wp--preset--spacing--40, 1.5rem));
}

.wp-block-post-content.is-layout-constrained > .wp-block-group.alignfull > :where(.wp-block-group__inner-container, .wp-block-group-is-layout-constrained, .wp-block-group-is-layout-flow),
.entry-content.is-layout-constrained > .wp-block-group.alignfull > :where(.wp-block-group__inner-container, .wp-block-group-is-layout-constrained, .wp-block-group-is-layout-flow) {
	max-width: var(--wp--style--global--wide-size, 1200px);
	margin-inline: auto;
	width: 100%;
	box-sizing: border-box;
}

.wp-block-post-content a.plct-btn,
.entry-content a.plct-btn,
.plct-block a.plct-btn {
	text-decoration: none !important;
}

/* -------------------------------------------------------------------------
   Block styles registered in inc/block-styles.php
   ------------------------------------------------------------------------- */

.is-style-plct-outline .wp-block-button__link {
	background: transparent !important;
	border: 2px solid currentColor;
	color: inherit !important;
}

.is-style-plct-bordered {
	border: 1px solid var(--wp--preset--color--neutral, #6b7280);
	padding: var(--wp--preset--spacing--40, 1.5rem);
}

.is-style-plct-soft {
	background-color: var(--wp--preset--color--neutral-light, #f3f4f6);
	border-radius: var(--plct-radius-ui, 4px);
	padding: var(--wp--preset--spacing--40, 1.5rem);
}

.is-style-plct-rounded img,
.is-style-plct-rounded .wp-block-image img {
	border-radius: var(--plct-radius-image, 4px);
}

/* Core buttons follow the button radius token. */
.wp-element-button,
.wp-block-button__link {
	border-radius: var(--plct-radius-button, 999px);
}

.custom-logo-link img {
	height: 50px;
	width: auto;
}

.plct-hero__title em,
.plct-section-title em,
h1 em,
h2 em {
	font-family: var(--wp--preset--font-family--fraunces);
	font-style: italic;
	font-weight: 300;
	color: var(--wp--preset--color--accent);
}

.plct-btn--text {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	padding: 0;
	background: transparent;
	border: 0;
	border-bottom: 1px solid currentColor;
	border-radius: 0;
	color: var(--wp--preset--color--accent-dark);
	font-weight: 500;
	text-decoration: none !important;
}

.plct-btn--text::after {
	content: "→";
}

.plct-btn--text:hover,
.plct-btn--text:focus-visible {
	color: var(--wp--preset--color--primary);
	background: transparent;
}

.plct-form {
	display: grid;
	gap: 0.65rem;
	min-width: 0;
}

.plct-form__row {
	display: grid;
	gap: 0.65rem;
	min-width: 0;
}

@media (min-width: 782px) {
	.plct-form__row {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	}
}

.plct-form > p,
.plct-form__row > p {
	margin: 0;
	min-width: 0;
}

.plct-form label {
	display: block;
	margin-bottom: 0.25rem;
	font-size: 0.75rem;
	font-weight: 500;
	letter-spacing: 0.02em;
	color: var(--wp--preset--color--secondary);
}

.plct-form input,
.plct-form select,
.plct-form textarea {
	box-sizing: border-box;
	display: block;
	width: 100%;
	max-width: 100%;
	padding: 0.75rem 0.9rem;
	border: 1px solid var(--wp--preset--color--neutral-light);
	border-radius: 0;
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
	font: inherit;
}

.plct-form textarea {
	min-height: 8rem;
	resize: vertical;
}

.plct-form__hint {
	margin: -0.15rem 0 0;
	font-size: 0.75rem;
	opacity: 0.7;
}

.plct-form__consent {
	display: flex;
	gap: 0.75rem;
	align-items: flex-start;
	font-size: 0.8125rem;
	min-width: 0;
}

.plct-form__consent input {
	box-sizing: border-box;
	width: auto;
	margin-top: 0.2rem;
}

.plct-form__recaptcha-note {
	margin: 0;
	font-size: 0.6875rem;
	line-height: 1.45;
	opacity: 0.7;
}

.plct-form__recaptcha-note a {
	text-decoration: underline;
}

.plct-form__status {
	padding: 0.75rem 1rem;
	border-radius: var(--plct-radius-ui, 4px);
}

.plct-form__status--success {
	background: var(--wp--preset--color--olive);
	color: var(--wp--preset--color--base);
}

.plct-form__status--error {
	background: #f8e8e4;
	color: #6b1d12;
}

.plct-hp {
	position: absolute;
	left: -9999px;
	height: 1px;
	width: 1px;
	overflow: hidden;
}

.plct-news-featured {
	display: grid;
	gap: 1.75rem;
	align-items: stretch;
	margin-bottom: 2.5rem;
	min-width: 0;
	width: 100%;
	box-sizing: border-box;
}

@media (min-width: 782px) {
	.plct-news-featured {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		gap: 3rem;
	}
}

.plct-news-featured .wp-block-post-featured-image {
	margin: 0;
	min-width: 0;
	width: 100%;
}

.plct-news-featured .wp-block-post-featured-image,
.plct-news-featured .wp-block-post-featured-image a,
.plct-news-featured .wp-block-post-featured-image img {
	display: block;
	width: 100%;
	max-width: 100%;
}

.plct-news-featured .wp-block-post-featured-image img {
	aspect-ratio: 656 / 440;
	height: auto;
	object-fit: cover;
}

.plct-news-featured__copy {
	padding: 0.5rem 0 0;
	max-width: none;
	margin-inline: 0;
	text-align: start;
	min-width: 0;
}

@media (min-width: 782px) {
	.plct-news-featured__copy {
		padding: 2.5rem 0;
	}
}

.plct-news-featured__copy > * {
	max-width: none;
	margin-inline: 0;
}

.plct-news-featured__meta {
	align-items: center;
	gap: 0.75rem 1rem;
}

.plct-news-featured__badge {
	margin: 0;
	padding: 0.25rem 0.75rem;
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--accent-dark) 40%, transparent);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent-dark);
}

.plct-news-featured .wp-block-post-title {
	font-size: clamp(1.75rem, 1.2rem + 2vw, 2.5rem);
	line-height: 1.15;
	margin: 1rem 0 0;
	overflow-wrap: break-word;
}

.plct-news-featured__excerpt,
.plct-news-featured__excerpt p {
	margin: 0;
	max-width: 36rem;
	text-align: start;
}

.plct-news-featured__byline {
	gap: 0.35rem;
	margin: 0;
	max-width: 36rem;
	font-size: 0.875rem;
	color: var(--wp--preset--color--neutral);
}

.plct-news-featured__byline p {
	margin: 0;
}

.wp-block-query-title {
	margin-bottom: var(--wp--preset--spacing--50, 2.5rem);
	font-size: var(--wp--preset--font-size--x-large, clamp(1.75rem, 4vw, 3rem));
	font-weight: 400;
	line-height: 1.15;
}

.plct-news-archive.is-layout-constrained > .plct-news-archive__header {
	max-width: var(--wp--style--global--wide-size, 1360px);
}

.plct-news-archive__header {
	margin: 2rem 0 1.5rem;
	width: 100%;
	gap: 1.5rem;
}

.plct-news-archive__header h2 {
	margin: 0;
	font-size: clamp(1.75rem, 1.2rem + 2.5vw, 2.5rem);
}

.plct-news-filters-wrap {
	align-items: center;
	gap: 0.5rem;
}

.plct-news-filters,
.wp-block-categories.plct-news-filters,
.plct-news-filters__all {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.plct-news-filters li,
.wp-block-categories.plct-news-filters li {
	list-style: none;
	margin: 0;
}

.plct-news-filters__all a,
.plct-news-filters a,
.wp-block-categories.plct-news-filters a {
	display: inline-block;
	padding: 0.4rem 1rem;
	border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
	border-radius: 999px;
	text-decoration: none !important;
	font-size: 0.8125rem;
	line-height: 1.25;
}

.plct-news-filters__all a {
	background: var(--wp--preset--color--primary);
	border-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--base);
}

.plct-news-archive .wp-block-post-template.is-layout-grid {
	gap: 2rem 1.5rem;
}

.plct-news-filters-wrap .wp-block-categories {
	margin: 0;
}

.plct-job-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem 1.25rem;
	margin: 0 0 0.75rem;
	font-size: 0.875rem;
	color: var(--wp--preset--color--neutral);
}

.plct-hero--left .plct-hero__content,
.plct-hero--left .plct-hero__title {
	max-width: 54rem;
}
