/**
 * VM Location Block
 *
 * Accordion item styles come from accordion.css (enqueued alongside this file).
 * This file handles layout, header, map, CTA, and any location-specific overrides.
 *
 * @package club-garrigue
 * @since 1.0.0
 */

/* ─── Block wrapper ─────────────────────────────────────────────── */

.vm-location-block {
	container-type: inline-size;
	width: 100vw;
	max-width: 100vw !important;
	margin-left: calc(50% - 50vw) !important;
	margin-right: calc(50% - 50vw) !important;
	padding: clamp(40px, 6vw, 120px) 30px;
}

/* When a background colour is applied via the editor colour panel,
   WordPress adds has-background + has-{slug}-background-color.
   Propagate the block's text colour down to eyebrow, title, and
   map attribution so everything stays readable. */
.vm-location-block.has-text-color .vm-location-eyebrow,
.vm-location-block.has-text-color .vm-location-title {
	color: inherit;
}

/* ─── Header ─────────────────────────────────────────────────────── */

.vm-location-header {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.4rem;
	max-width: var(--max-width, 1400px);
	margin: 0 auto 48px;
	padding: 0 clamp(20px, 5vw, 60px);
	padding-left: 0;
}

.vm-location-eyebrow {
	font-family: var(--font-sans);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 3.5px;
	text-transform: uppercase;
	color: var(--wp--preset--color--stone);
	margin: 0;
}

.vm-location-title {
	font-family: var(--font-serif);
	line-height: 1.15;
	color: var(--wp--preset--color--ink);
	margin: 0;
}

.vm-location-title em {
	font-style: italic;
	color: var(--wp--preset--color--accent);
}

/* ─── Grid ───────────────────────────────────────────────────────── */

.vm-location-grid {
	display: grid;
	gap: clamp(24px, 3.5vw, 48px);
	align-items: start;
	max-width: var(--max-width, 1200px);
	margin: 0 auto;
	
}

@media (min-width: 600px) {
	
}

/* content-right (default): map left, accordion right */
.vm-location--right .vm-location-grid {
	grid-template-columns: 1fr 1fr;
	grid-template-areas: "map content";
}

/* content-left: accordion left, map right */
.vm-location--left .vm-location-grid {
	grid-template-columns: 1fr 1fr;
	grid-template-areas: "content map";
}

/* none: map full width */
.vm-location--none .vm-location-grid {
	grid-template-columns: 1fr;
	grid-template-areas: "map";
}

/* ─── Map column ─────────────────────────────────────────────────── */

.vm-location-map {
	grid-area: map;
}

.vm-location-map-wrap {
	position: relative;
	width: 100%;
	aspect-ratio: 4 / 3;
	border-radius: var(--vm-radius-lg, 0.5rem);
	overflow: hidden;
	background: var(--wp--preset--color--silver-pale);
}

.vm-location--none .vm-location-map-wrap {
	aspect-ratio: 21 / 9;
}

.vm-location-iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: none;
	display: block;
}

/* ─── Map placeholder (editor only) ────────────────────────────── */

.vm-location-map-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 4 / 3;
	background: var(--wp--preset--color--silver-pale);
	border: 1px dashed var(--wp--preset--color--silver);
	border-radius: var(--vm-radius-lg, 0.5rem);
	color: var(--wp--preset--color--stone);
	font-style: italic;
	font-size: var(--wp--preset--font-size--small);
	padding: 1rem;
	text-align: center;
}

/* ─── Content column ─────────────────────────────────────────────── */

.vm-location-content {
	grid-area: content;
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--medium, 1.5rem);
}

/* ─── Accordion overrides within location context ───────────────── */

/* The accordion block normally wraps itself full-width with its own
   padding. Inside the location column we reset those opinionated rules
   so it sits flush as a column element. */
.vm-location-content .vm-accordion {
	border-top: none; /* no top rule — items are self-contained cards */
	margin: 0;
	padding: 0;
}

.vm-accordion__content{
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--stone);
	line-height: 1.78;
    font-weight: 300;
}

/* ─── CTA (link + subtitle) ──────────────────────────────────────── */

.vm-location-cta {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.5rem;
	margin-top: var(--wp--preset--spacing--small, 0.75rem);
}

.vm-location-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 15px 34px;
	border: 1.5px solid var(--wp--preset--color--ink);
	color: var(--wp--preset--color--ink);
	font-family: var(--font-sans);
	font-size: 14px;
	font-weight: 500;
	text-decoration: none;
	border-radius: 8px;
	transition: all 0.3s ease !important;
    letter-spacing: 0.4px;
    cursor: pointer;
}

.vm-location-link:hover {
	background-color: var(--wp--preset--color--accent);
	border-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--white);
	text-decoration: none;
}

.vm-location-link-subtitle {
	font-family: var(--font-sans);
	font-size: 13px;
	color: var(--wp--preset--color--stone);
	margin: 0;
	text-align: center;
}

/* ─── Responsive ─────────────────────────────────────────────────── */

@container (max-width: 680px) {
	.vm-location--right .vm-location-grid,
	.vm-location--left .vm-location-grid {
		grid-template-columns: 1fr;
		grid-template-areas:
			"map"
			"content";
	}

	.vm-location-map-wrap {
		aspect-ratio: 16 / 9;
	}

	.vm-location--none .vm-location-map-wrap {
		aspect-ratio: 16 / 9;
	}
}
