/*
Theme Name: Endless Storage
Theme URI: https://myendlessstorage.com
Author: Tribal Codes
Author URI: https://tribalcodesllc.com
Description: Purpose-built block theme for My Endless Storage. A 2-location self-storage business (Punta Gorda, FL and Corpus Christi, TX) with a facility-scoped Monument rental integration. Full Site Editing: templates are HTML, styling is theme.json, and repeatable sections are block patterns, so the site owner can edit everything from WordPress with no code and no licence.
Version: 1.0.0
Requires at least: 6.5
Tested up to: 7.1
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: endless-storage
Tags: block-patterns, full-site-editing, custom-colors, custom-logo, editor-style, wide-blocks, accessibility-ready
*/

/*
 * This theme ships almost no CSS on purpose.
 *
 * Colour, typography, spacing, layout widths, buttons and shadows are all declared in
 * theme.json and exposed to the owner through Appearance > Editor > Styles — no code.
 *
 * Only what theme.json cannot express lives here: a small number of component rules
 * (the sticky mobile header, the unit grid, the amenity strip, the Monument iframe box).
 *
 * Keep this file small. Every rule here is a rule the owner cannot edit from WordPress.
 */

/* ---------------------------------------------------------------------------
 * Layout helpers
 * ------------------------------------------------------------------------ */

/* Full-bleed sections inside a padded container. */
.es-full-bleed {
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	width: 100vw;
	max-width: 100vw;
}

/* Section wrapper: consistent vertical rhythm between page bands. */
.es-section {
	padding-block: var(--wp--preset--spacing--60);
}

.es-section--tight {
	padding-block: var(--wp--preset--spacing--50);
}

.es-section--surface {
	background-color: var(--wp--preset--color--surface);
}

/* ---------------------------------------------------------------------------
 * Header
 * ------------------------------------------------------------------------ */

/* The sticky property has to sit on the <header> element itself. Applying it to
   the inner .es-header group only sticks within that group's own height, which
   is one row tall, so the bar scrolled away instantly. */
header.wp-block-template-part,
.wp-block-template-part:has(> .es-header) {
	position: sticky;
	top: 0;
	z-index: 100;
	/* Lets content read as passing under the bar rather than meeting its edge. */
	box-shadow: 0 1px 0 rgba(26, 60, 88, 0.08);
}

.es-header {
	background-color: var(--wp--preset--color--background);
	border-bottom: 1px solid var(--wp--preset--color--border);
	position: relative;
}

.es-header .wp-block-navigation {
	position: relative;
}

/* Mobile: the Rent Now button and phone must stay reachable. Tap target >= 44px. */
@media (max-width: 781px) {
	.es-header__actions .wp-block-button__link {
		min-height: 44px;
		display: inline-flex;
		align-items: center;
	}
}

/* ---------------------------------------------------------------------------
 * Location hero
 * ------------------------------------------------------------------------ */

.es-location-hero {
	background-color: var(--wp--preset--color--secondary);
	color: #ffffff;
	padding-block: var(--wp--preset--spacing--60);
}

.es-location-hero h1,
.es-location-hero h2,
.es-location-hero a {
	color: #ffffff;
}

.es-location-hero .es-meta-label {
	font-size: var(--wp--preset--font-size--small);
	text-transform: uppercase;
	letter-spacing: 0.06em;
	opacity: 0.75;
	display: block;
}

/* ---------------------------------------------------------------------------
 * Unit grid
 * ------------------------------------------------------------------------ */

.es-unit-grid {
	display: grid;
	gap: var(--wp--preset--spacing--40);
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.es-unit-card {
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 8px;
	overflow: hidden;
	background-color: var(--wp--preset--color--background);
	box-shadow: var(--wp--preset--shadow--soft);
	display: flex;
	flex-direction: column;
}

.es-unit-card__media {
	aspect-ratio: 16 / 10;
	background-color: var(--wp--preset--color--surface);
	overflow: hidden;
}

.es-unit-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	margin: 0;
	display: block;
}

.es-unit-card__body {
	padding: var(--wp--preset--spacing--40);
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--20);
	flex: 1;
}

.es-unit-card__dimensions {
	font-size: var(--wp--preset--font-size--x-large);
	font-weight: 700;
	color: var(--wp--preset--color--primary);
	line-height: 1.1;
}

.es-unit-card__category {
	font-size: var(--wp--preset--font-size--small);
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--wp--preset--color--secondary);
	opacity: 0.7;
}

/* ---------------------------------------------------------------------------
 * Amenity strip
 * ------------------------------------------------------------------------ */

.es-amenity-strip {
	display: grid;
	gap: var(--wp--preset--spacing--40);
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	text-align: center;
}

.es-amenity {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--wp--preset--spacing--20);
}

.es-amenity__icon {
	width: 44px;
	height: 44px;
	display: grid;
	place-items: center;
	border-radius: 50%;
	background-color: var(--wp--preset--color--primary);
	color: #ffffff;
}

/* ---------------------------------------------------------------------------
 * Monument rental embed
 *
 * The iframe is third-party content with a fixed intrinsic height. Reserve the box
 * before it loads so the page does not jump (CLS). The height is set inline by the
 * pattern; this rule only guards the wrapper.
 * ------------------------------------------------------------------------ */

.es-rental-embed {
	position: relative;
	width: 100%;
	overflow: hidden;
	background-color: var(--wp--preset--color--surface);
}

.es-rental-embed iframe {
	display: block;
	width: 100%;
	border: 0;
	margin: 0;
}

/* ---------------------------------------------------------------------------
 * Reviews
 * ------------------------------------------------------------------------ */

.es-review {
	border-left: 3px solid var(--wp--preset--color--primary);
	padding-left: var(--wp--preset--spacing--40);
}

.es-review__author {
	font-weight: 700;
	color: var(--wp--preset--color--secondary);
}

/* ---------------------------------------------------------------------------
 * CTA band
 * ------------------------------------------------------------------------ */

.es-cta-band {
	background-color: var(--wp--preset--color--secondary);
	color: #ffffff;
	padding-block: var(--wp--preset--spacing--60);
	text-align: center;
}

.es-cta-band h2,
.es-cta-band p {
	color: #ffffff;
}

/* ---------------------------------------------------------------------------
 * Footer
 * ------------------------------------------------------------------------ */

.es-footer {
	background-color: var(--wp--preset--color--secondary);
	color: #ffffff;
	padding-block: var(--wp--preset--spacing--60);
}

.es-footer a {
	color: #ffffff;
}

.es-footer .es-footer__locations {
	display: grid;
	gap: var(--wp--preset--spacing--50);
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

/* ---------------------------------------------------------------------------
 * Accessibility
 * ------------------------------------------------------------------------ */

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

/* Visible keyboard focus everywhere. */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
	outline: 2px solid var(--wp--preset--color--primary);
	outline-offset: 2px;
	border-radius: 2px;
}

/* Skip link — the first tab stop on every page. */
.es-skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	background: var(--wp--preset--color--primary);
	color: #ffffff;
	padding: 0.75rem 1.25rem;
	z-index: 1000;
	border-radius: 0 0 6px 0;
}

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

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

.screen-reader-text:focus {
	clip-path: none;
	height: auto;
	width: auto;
	left: 5px;
	top: 5px;
	display: block;
	font-size: 0.875rem;
	padding: 15px 23px 14px;
	background: #f0f0f0;
	color: #000;
	z-index: 100000;
	line-height: normal;
}

/* Print: drop chrome, keep content. */
@media print {
	.es-header,
	.es-footer,
	.es-cta-band,
	.es-rental-embed {
		display: none !important;
	}

	body {
		color: #000;
		background: #fff;
		font-size: 12pt;
	}
}

/* ------------------------------------------------------------------
   Unit size pages
   ------------------------------------------------------------------ */
.es-breadcrumb-text {
	font-size: 0.85rem;
	margin: 0 0 0.5rem;
}
.es-breadcrumb-text a {
	text-decoration: none;
}
.es-breadcrumb-text a:hover {
	text-decoration: underline;
}

.es-unit__sqft {
	font-size: 1.1rem;
	font-weight: 600;
	color: var(--wp--preset--color--primary, #008B8B);
	margin: 0 0 0.75rem;
}

.es-unit__lede {
	font-size: 1.05rem;
	line-height: 1.65;
	max-width: 62ch;
}

.es-badges {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 1rem 0;
}
.es-badge {
	display: inline-block;
	padding: 0.3rem 0.75rem;
	border-radius: 999px;
	background: var(--wp--preset--color--base-muted, #f1f4f6);
	border: 1px solid var(--wp--preset--color--border, #d8dee4);
	font-size: 0.8rem;
	font-weight: 600;
}

.es-fits {
	list-style: none;
	padding: 0;
	margin: 0 0 1.5rem;
	max-width: 62ch;
}
.es-fits li {
	position: relative;
	padding: 0.4rem 0 0.4rem 1.75rem;
	border-bottom: 1px solid var(--wp--preset--color--border, #e8ecef);
}
.es-fits li::before {
	content: "\2713";
	position: absolute;
	left: 0;
	top: 0.4rem;
	color: var(--wp--preset--color--primary, #008B8B);
	font-weight: 700;
}

.es-unit-details h2 {
	font-size: 1.15rem;
	margin: 2rem 0 0.75rem;
}

.es-unit__price-note {
	color: var(--wp--preset--color--secondary-muted, #55606b);
	font-size: 0.92rem;
	max-width: 56ch;
}
.es-unit__cta {
	margin-top: 0.75rem;
}

/* Availability table */
.es-avail {
	list-style: none;
	padding: 0;
	margin: 0;
	max-width: 46rem;
	border: 1px solid var(--wp--preset--color--border, #d8dee4);
	border-radius: 12px;
	overflow: hidden;
}
.es-avail__item {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.6rem;
	padding: 0.85rem 1rem;
	border-bottom: 1px solid var(--wp--preset--color--border, #e8ecef);
}
.es-avail__item:last-child {
	border-bottom: 0;
}
.es-avail__link {
	font-weight: 600;
	text-decoration: none;
}
.es-avail__state {
	font-size: 0.78rem;
	font-weight: 700;
	padding: 0.18rem 0.6rem;
	border-radius: 999px;
}
.es-avail__state.is-yes {
	background: rgba(0, 139, 139, 0.12);
	color: var(--wp--preset--color--primary, #008B8B);
}
.es-avail__state.is-no {
	background: rgba(179, 57, 43, 0.1);
	color: #b3392b;
}
.es-avail__note {
	font-size: 0.8rem;
	color: var(--wp--preset--color--secondary-muted, #55606b);
}

/* Related sizes */
.es-related {
	margin-top: 3rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--wp--preset--color--border, #e8ecef);
}
.es-related h2 {
	font-size: 1.1rem;
	margin: 0 0 0.75rem;
}
.es-related__list {
	list-style: none;
	padding: 0;
	margin: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
	gap: 0.5rem;
}
.es-related__list a {
	display: block;
	padding: 0.7rem 0.9rem;
	border: 1px solid var(--wp--preset--color--border, #d8dee4);
	border-radius: 10px;
	text-decoration: none;
	font-weight: 600;
	font-size: 0.95rem;
	transition: border-color 0.15s ease, background 0.15s ease;
}
.es-related__list a:hover {
	border-color: var(--wp--preset--color--primary, #008B8B);
	background: rgba(0, 139, 139, 0.05);
}
.es-related__kind,
.es-related__sqft {
	display: block;
	font-weight: 400;
	font-size: 0.8rem;
	color: var(--wp--preset--color--secondary-muted, #55606b);
}

/* Archive card meta */
.es-unit-card__meta {
	font-size: 0.82rem;
	font-weight: 600;
	color: var(--wp--preset--color--primary, #008B8B);
	margin: 0.25rem 0 0.5rem;
}
.es-unit-card__excerpt {
	font-size: 0.9rem;
	line-height: 1.55;
	color: var(--wp--preset--color--secondary-muted, #55606b);
	margin: 0;
}

@media (max-width: 640px) {
	.es-related__list {
		grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
	}
	.es-avail__item {
		align-items: flex-start;
		flex-direction: column;
		gap: 0.35rem;
	}
}

/* ------------------------------------------------------------------
   Location facts + per-location unit listing
   ------------------------------------------------------------------ */
.es-facts {
	margin: 1.25rem 0 0;
	display: grid;
	gap: 0.85rem;
	max-width: 40rem;
}
.es-facts__row {
	display: grid;
	gap: 0.15rem;
}
.es-facts__row .es-meta-label {
	margin: 0;
	opacity: 0.85;
}
.es-facts__value {
	margin: 0;
	line-height: 1.55;
}
.es-facts__value a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
}
.es-facts__map {
	margin: 1.25rem 0 0;
}

.es-loc-units h2 {
	margin: 0 0 1rem;
}
.es-loc-units__list {
	list-style: none;
	padding: 0;
	margin: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
	gap: 0.6rem;
}
.es-loc-units__list a {
	display: block;
	padding: 0.85rem 1rem;
	border: 1px solid var(--wp--preset--color--border, #d8dee4);
	border-radius: 10px;
	text-decoration: none;
	transition: border-color 0.15s ease, background 0.15s ease;
}
.es-loc-units__list a:hover {
	border-color: var(--wp--preset--color--primary, #008B8B);
	background: rgba(0, 139, 139, 0.05);
}
.es-loc-units__dims {
	display: block;
	font-weight: 600;
	font-size: 1.05rem;
}
.es-loc-units__meta {
	display: block;
	font-size: 0.82rem;
	color: var(--wp--preset--color--secondary-muted, #55606b);
	margin-top: 0.15rem;
}

@media (max-width: 640px) {
	.es-loc-units__list {
		grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
	}
}

/* Footer locations grid - previously supplied by a block layout attribute,
   which the dynamic es/footer-locations block no longer carries. */
.es-footer__locations {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1.5rem 2rem;
}
@media (max-width: 640px) {
	.es-footer__locations {
		grid-template-columns: 1fr;
	}
}

/* ------------------------------------------------------------------
   FAQ accordion
   Native <details> so answers are in the DOM and match FAQPage schema.
   ------------------------------------------------------------------ */
.es-faq { max-width: 52rem; margin: 0; }
.es-faq__item {
	border: 1px solid var(--wp--preset--color--border, #d8dee4);
	border-radius: 12px;
	margin-bottom: 0.6rem;
	background: var(--wp--preset--color--base, #fff);
	overflow: hidden;
}
.es-faq__q {
	cursor: pointer;
	list-style: none;
	padding: 1rem 1.2rem;
	font-weight: 600;
	line-height: 1.4;
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
}
.es-faq__q::-webkit-details-marker { display: none; }
.es-faq__q::after {
	content: "+";
	margin-left: auto;
	font-size: 1.25rem;
	line-height: 1;
	color: var(--wp--preset--color--primary, #008B8B);
	transition: transform 0.15s ease;
}
.es-faq__item[open] .es-faq__q::after { content: "\2212"; }
.es-faq__q:focus-visible {
	outline: 2px solid var(--wp--preset--color--primary, #008B8B);
	outline-offset: -2px;
}
.es-faq__a {
	padding: 0 1.2rem 1.15rem;
	color: var(--wp--preset--color--secondary, #333f4a);
}
.es-faq__a p { margin: 0; line-height: 1.65; max-width: 62ch; }

/* ---------------------------------------------------------------------------
   Visual polish pass
   ---------------------------------------------------------------------------
   Driven by an audit of the rendered pages, not by taste alone:
   - the rental embed was rendering at 760px inside a 1280px band (60% width)
   - the hero measure matched body copy, so the headline had no presence
   - section rhythm alternated between two very different widths
   ------------------------------------------------------------------------ */

/* Rental embed: let it use the wide measure, centred, with breathing room.
   It is the primary conversion surface and was the most constrained thing
   on the page. */
.es-section--surface .es-rental-embed {
	max-width: var(--wp--style--global--wide-size);
	margin-inline: auto;
	padding-inline: var(--wp--preset--spacing--40, 1.25rem);
}

/* Hero: give the headline room to be the headline, and stop the lede from
   breaking across a full-width line. */
.wp-block-group.es-section:first-child {
	padding-top: var(--wp--preset--spacing--60, 3rem);
	padding-bottom: var(--wp--preset--spacing--50, 2rem);
}

.wp-block-group.es-section:first-child .wp-block-heading.has-xx-large-font-size {
	max-width: 18ch;
	line-height: 1.08;
	letter-spacing: -0.02em;
	text-wrap: balance;
	margin-block: 0 0.75rem;
}

.wp-block-group.es-section:first-child .has-large-font-size {
	max-width: 46ch;
	color: var(--wp--preset--color--text);
	opacity: 0.85;
	line-height: 1.55;
	margin-block: 0 1.75rem;
	text-wrap: pretty;
}

/* Buttons: consistent gap and a touch more presence. */
.wp-block-group.es-section:first-child .wp-block-button__link {
	padding-inline: 1.6rem;
}

/* Headings everywhere: tighter tracking at display sizes reads as deliberate. */
.wp-block-heading.has-xx-large-font-size,
.wp-block-heading.has-x-large-font-size {
	letter-spacing: -0.015em;
	text-wrap: balance;
}

/* Section rhythm: even out the vertical spacing so alternating bands feel
   like one system rather than two. */
.es-section {
	padding-block: clamp(2.5rem, 5vw, 4.25rem);
}

.es-section--surface {
	padding-block: clamp(2.5rem, 5vw, 4.25rem);
}

/* Long-form page titles (FAQ, About, Contact) were undersized relative to
   the new scale. */
.wp-block-post-title.has-xx-large-font-size,
h1.wp-block-heading {
	line-height: 1.1;
	letter-spacing: -0.015em;
}

/* Body copy on content pages: keep the measure readable now the container
   is wider. */
.wp-block-post-content p,
.wp-block-post-content li {
	line-height: 1.65;
}

/* Header: even distribution and a little more height so it stops reading
   as a thin strip. */
.wp-block-group.es-header > .wp-block-group,
.wp-block-group.es-header .wp-block-group.has-global-padding {
	padding-block: 0.7rem;
}

.es-header .wp-block-navigation__responsive-container.is-menu-open {
	padding: 1rem;
}

/* Buttons: shared shape so primary and secondary sit on the same baseline. */
.wp-element-button,
.wp-block-button__link {
	border-radius: 8px;
	font-weight: 600;
	letter-spacing: 0.005em;
}

/* ---------------------------------------------------------------------------
   Call-to-action weighting
   ---------------------------------------------------------------------------
   Phone is a primary conversion channel for a local storage business, so the
   "Call or Text" button must read as a co-equal action rather than a ghost
   button. It keeps the outline treatment for visual differentiation but gains
   real weight, and fills on hover like the primary.
   ------------------------------------------------------------------------ */
.wp-block-group.es-section:first-child .wp-block-button.is-style-outline .wp-block-button__link,
.es-cta-band .wp-block-button.is-style-outline .wp-block-button__link {
	border-width: 2px;
	border-color: currentColor;
	font-weight: 600;
	background-color: transparent;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.wp-block-group.es-section:first-child .wp-block-button.is-style-outline .wp-block-button__link:hover,
.es-cta-band .wp-block-button.is-style-outline .wp-block-button__link:hover {
	background-color: var(--wp--preset--color--secondary, #1A3C58);
	border-color: var(--wp--preset--color--secondary, #1A3C58);
	color: #ffffff;
}

/* On the dark CTA band the outline button inverts instead. */
.es-cta-band .wp-block-button.is-style-outline .wp-block-button__link:hover {
	background-color: #ffffff;
	border-color: #ffffff;
	color: var(--wp--preset--color--secondary, #1A3C58);
}

/* Keep both hero buttons on one baseline with a consistent gap. */
.wp-block-group.es-section:first-child .wp-block-buttons {
	gap: 0.75rem;
	align-items: center;
}
