/*
Theme Name: LewisPhoto
Theme URI: https://lewisphoto.ca/
Author: Sean Lewis
Description: A standalone block theme for Lewis Photography. Owns the design that previously lived in the Flat Blocks parent, its global styles and per-block attributes. No parent theme, no page builder; one small script places the consent control in the footer.
Version: 0.2.5
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 8.1
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: lewisphoto
Tags: block-theme, photography, one-column, custom-colors, editor-style
*/

/* ---------------------------------------------------------------
   1. Header
   The header sticks. The legacy class name is kept because the
   current markup already uses it.
   --------------------------------------------------------------- */
.site-header.is-style-fixed-header {
	position: sticky;
	top: 0;
	z-index: 10;
}

.admin-bar .site-header.is-style-fixed-header {
	top: 32px;
}

@media (max-width: 782px) {
	.admin-bar .site-header.is-style-fixed-header {
		top: 46px;
	}
}

/* ---------------------------------------------------------------
   2. Light text on filled bands
   Without this the service CTA renders black on black.
   --------------------------------------------------------------- */
:where(.has-primary-background-color, .has-dark-alt-background-color):not(.has-text-color) {
	color: var(--wp--preset--color--foreground-alt);
}

:where(.has-primary-background-color, .has-dark-alt-background-color) :where(a) {
	color: inherit;
}

/* ---------------------------------------------------------------
   3. Focus
   Closes the WCAG 2.4.7 gap the old theme never fixed.
   --------------------------------------------------------------- */
:where(a, button, input, textarea, select, summary, [tabindex]):focus-visible {
	outline: 2px solid var(--wp--preset--color--primary);
	outline-offset: 2px;
}

/* ---------------------------------------------------------------
   4. FAQ
   Native details; several may be open at once.
   --------------------------------------------------------------- */
.wp-block-details {
	width: 100%;
	background: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--neutral-alt);
	border-radius: 10px;
	padding: 16px 20px 12px;
	margin-bottom: 12px;
}

.wp-block-details > summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	cursor: pointer;
	font-size: 22px;
	line-height: 1.3;
	font-weight: 500;
	list-style: none;
}

.wp-block-details[open] > summary {
	margin-bottom: 10px;
}

.wp-block-details > :last-child {
	margin-bottom: 0;
}

.wp-block-post-terms {
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.wp-block-details > summary::-webkit-details-marker {
	display: none;
}

.wp-block-details > summary::after {
	content: "";
	width: 10px;
	height: 10px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
	transition: transform 150ms ease;
	flex: none;
}

.wp-block-details[open] > summary::after {
	transform: rotate(-135deg);
}

/* ---------------------------------------------------------------
   5. Legacy block-style classes
   Page content already carries these names; re-registering them
   is cheaper and safer than rewriting every page.
   --------------------------------------------------------------- */
.is-style-thick {
	border-top-width: 3px;
}

@media (max-width: 600px) {
	.is-style-center-on-mobile {
		text-align: center;
	}
}

.is-style-rounded-border {
	border-radius: 10px;
	overflow: hidden;
}

.is-style-link-no-underline a {
	text-decoration: none;
}

.is-style-outline .wp-block-button__link {
	border: 2px solid currentColor;
	background: transparent;
}

/* ---------------------------------------------------------------
   6. Layout helpers used by patterns
   --------------------------------------------------------------- */
.lp-card {
	border-style: solid;
	border-width: 1px;
	border-color: var(--wp--preset--color--neutral-alt);
	border-radius: 10px;
	background: var(--wp--preset--color--white);
	overflow: hidden;
}

/* Testimonial meta: avatar and name stay together, left aligned. */
.lp-card .wp-block-group.is-layout-flex:has(> .wp-block-image) {
	justify-content: flex-start;
	align-items: center;
	gap: 12px;
}

.lp-card .wp-block-group.is-layout-flex:has(> .wp-block-image) .wp-block-image {
	margin: 0;
}

.wp-block-navigation a {
	text-decoration: none;
}

/* Outline buttons inherit currentColor; on a dark band that must be light. */
:where(.has-dark-alt-background-color, .has-primary-background-color) .is-style-outline .wp-block-button__link {
	color: var(--wp--preset--color--foreground-alt);
	border-color: currentColor;
}

/* Focus ring must stay visible on dark bands. */
:where(.has-dark-alt-background-color, .has-primary-background-color) :where(a, button, summary, [tabindex]):focus-visible {
	outline-color: var(--wp--preset--color--foreground-alt);
}
.lp-service-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 32px;
}

@media (min-width: 1024px) {
	.lp-service-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.lp-service-card {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 0 24px 24px;
	background: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--neutral-alt);
	border-radius: 10px;
	overflow: hidden;
}

.lp-service-card > figure {
	margin: 0 -24px;
	width: calc(100% + 48px);
	max-width: none;
}

.lp-service-card img {
	width: 100%;
	height: 300px;
	object-fit: cover;
	border-radius: 10px 10px 0 0;
}

.lp-service-card .wp-block-button {
	margin-top: auto;
}

.lp-service-card .wp-block-button__link {
	width: 100%;
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--foreground-alt);
}

.lp-service-card .wp-block-button__link:hover {
	background: var(--wp--preset--color--dark-alt);
}

/* Legacy CTA button on the portfolio page. The block markup is old;
   this gives "Next Steps" the same button treatment as the rest. */
.eb-cia-button-wrapper {
	margin-top: 18px;
}

.eb-cia-button {
	display: inline-block;
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--foreground-alt);
	padding: 12px 24px;
	border-radius: 5px;
	font-size: 18px;
	font-weight: 500;
	line-height: 1.25;
}

.eb-cia-button-wrapper a {
	color: inherit;
	text-decoration: none;
}

.eb-cia-button:hover {
	background: var(--wp--preset--color--dark-alt);
}

/* Nav wrap guard: five items fit at 390px, six do not. */
@media (max-width: 480px) {
	.site-header .wp-block-navigation__container {
		flex-wrap: wrap;
		row-gap: 4px;
	}
}

/* ---------------------------------------------------------------
   7. Post reading
   --------------------------------------------------------------- */
.wp-block-post-content > * + * {
	margin-top: 18px;
}

.wp-block-post-content h2 {
	margin-top: 36px;
	margin-bottom: 9px;
}

.wp-block-post-content h3 {
	margin-top: 27px;
	margin-bottom: 9px;
}

.wp-block-post-content p,
.wp-block-post-content li {
	font-size: 16px;
}

.wp-block-post-content figure {
	max-width: 620px;
	margin: 27px auto;
}

.wp-block-post-content img {
	width: 100%;
	height: auto;
	border-radius: 10px;
}

.wp-block-post-content figcaption {
	font-size: 14px;
	color: var(--wp--preset--color--foreground);
	margin-top: 8px;
	text-align: center;
}

.wp-block-post-content blockquote {
	border-left: 6px solid var(--wp--preset--color--primary);
	padding-left: 18px;
	font-size: 22px;
}

.wp-block-post-content ul,
.wp-block-post-content ol {
	padding-left: 2em;
}

/* ---------------------------------------------------------------
   8. Page rhythm
   The board uses 36 px after a hero and 27 px between sections.
   --------------------------------------------------------------- */
.page .wp-block-post-content > * + * {
	margin-top: 27px;
}

.page .wp-block-post-content > .wp-block-cover:first-child + * {
	margin-top: 36px;
}

/* All page heroes are centred, whatever the legacy block says. */
.page .wp-block-cover .wp-block-cover__inner-container,
.page .wp-block-cover .wp-block-cover__inner-container :is(h1, h2, h3, p) {
	text-align: center;
}

/* ---------------------------------------------------------------
   9. Footer contrast
   The dark footer carries the black logo and the default link
   colour. Without this, both disappear into the background.
   --------------------------------------------------------------- */
.site-footer,
.site-footer p,
.site-footer a {
	color: var(--wp--preset--color--foreground-alt);
}

.site-footer a {
	text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible {
	color: var(--wp--preset--color--neutral);
	text-decoration: none;
}

.site-footer .custom-logo,
.site-footer .wp-block-image img {
	filter: brightness(0) invert(1);
}

/* ---------------------------------------------------------------
   10. Consent control
   The plugin control is moved into the footer slot by
   lewisphoto_place_consent_control(), so it sits under the Privacy
   link instead of as a separate bar.
   --------------------------------------------------------------- */
.lp-consent-slot {
	margin-top: 9px;
	text-align: center;
}

.lp-consent-control {
	margin: 0;
	font-size: 14px;
}

.lp-consent-open {
	color: inherit;
	text-decoration: none;
}

.lp-consent-open:hover,
.lp-consent-open:focus-visible {
	color: var(--wp--preset--color--neutral);
	text-decoration: none;
}

.lp-consent-trigger {
	--lp-focus-ring: var(--wp--preset--color--foreground-alt);
}

/* ---------------------------------------------------------------
   11. 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;
	}
}
