/*
 * Dubrovnik Guide — the article page and the guide index (Task 038-2).
 * One stylesheet for villas-more/guide-article and villas-more/guide-list.
 * Tokens only. Reasoning lives in inc/block-guide.php (this file is sent
 * to the browser; keep it short).
 */

/*
 * The article sits in one frame narrower than the site's container: the
 * photograph with its title, then the text and the side column (Ana,
 * 2026-11-15, docs/design/vodic-clanak-v3/v4b). 52rem holds a 52ch column
 * of body text at the site's own body size (≈ 467px, ≈ 72 characters), a
 * 4rem gap and the 300px side column; + the container padding.
 */
.vm-guide-article {
	--vm-guide-frame: calc( 52rem + 2 * var( --wp--preset--spacing--30, 1.5rem ) );
}

/*
 * Plain <div>/<figure> containers are content-box (only core's
 * .wp-block-group is border-box), so .vm-container's padding would widen
 * them and misalign them with the rest of the frame.
 */
.vm-guide-article__hero,
.vm-guide-article__head,
.vm-guide-article__end > .vm-container {
	box-sizing: border-box;
}

/* -- Article: the photograph with the title on it ------------------------ */

.vm-guide-article__hero.vm-container {
	max-width: var( --vm-guide-frame );
	margin-top: clamp( 1.5rem, 3vw, 2.5rem );
}

.vm-guide-article__hero-in {
	position: relative;
}

.vm-guide-article__lead {
	margin: 0;
}

.vm-guide-article__image {
	display: block;
	width: 100%;
	height: min( 500px, 62vh );
	object-fit: cover;
	background-color: var( --wp--preset--color--surface );
}

.vm-guide-article__head {
	padding-block: clamp( 2rem, 4.2vw, 3.5rem ) clamp( 1.25rem, 2.5vw, 2rem );
}

/* Over the photograph: white type on a gradient of the site's own dark. */
.vm-guide-article__hero:not( .vm-guide-article__hero--no-image ) .vm-guide-article__head {
	position: absolute;
	inset: auto 0 0 0;
	/* Extra room above the type, so the gradient fades out above the title
	   and the title itself always sits on the darker part. */
	padding: clamp( 4rem, 7vw, 5.5rem ) clamp( 1.5rem, 3vw, 2.5rem ) clamp( 1.5rem, 3vw, 2.5rem );
	background: linear-gradient(
		to top,
		color-mix( in srgb, var( --wp--preset--color--contrast ) 80%, transparent ),
		color-mix( in srgb, var( --wp--preset--color--contrast ) 62%, transparent ) 75%,
		transparent
	);
}

.vm-guide-article__hero:not( .vm-guide-article__hero--no-image ) :is( .vm-guide-article__title, .vm-guide-article__date, .vm-breadcrumbs ol, .vm-breadcrumbs a ) {
	color: var( --wp--preset--color--white );
}

.vm-guide-article__hero:not( .vm-guide-article__hero--no-image ) .vm-breadcrumbs li + li::before {
	color: color-mix( in srgb, var( --wp--preset--color--white ) 55%, transparent );
}

.vm-breadcrumbs ol {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35em 0;
	margin: 0;
	padding: 0;
	list-style: none;
	font-family: var( --wp--preset--font-family--display );
	font-size: var( --wp--custom--typography--eyebrow-size );
	letter-spacing: var( --wp--custom--typography--eyebrow-letter-spacing );
	line-height: 1.5;
	text-transform: uppercase;
	color: var( --wp--preset--color--muted );
}

.vm-breadcrumbs li + li::before {
	content: "/";
	margin-inline: 0.7em;
	color: var( --wp--preset--color--border );
}

.vm-breadcrumbs a {
	color: var( --vm-color-deep );
	text-decoration: none;
}

.vm-breadcrumbs a:hover,
.vm-breadcrumbs a:focus-visible {
	text-decoration: underline;
	text-underline-offset: var( --wp--custom--typography--underline-offset );
}

.vm-guide-article__date {
	margin: var( --wp--preset--spacing--20 ) 0 0;
	font-size: var( --wp--preset--font-size--small );
	color: var( --wp--preset--color--muted );
}

.vm-guide-article__title {
	max-width: 36rem;
	margin: var( --wp--preset--spacing--20 ) 0 0;
	font-family: var( --wp--preset--font-family--heading );
	font-size: var( --wp--preset--font-size--x-large );
	font-weight: 400;
	line-height: 1.15;
	color: var( --wp--preset--color--contrast );
}

/* -- Article: body — a 52ch column at 17px (≈ 70–72 characters), the side
 *    column 4rem away, both inside the frame ------------------------------ */

.vm-guide-article__body.vm-container {
	max-width: var( --vm-guide-frame );
}

.vm-guide-article__body {
	display: grid;
	grid-template-columns: minmax( 0, 1fr ) 18.75rem;
	column-gap: 4rem;
	align-items: start;
	padding-block: clamp( 2rem, 4vw, 3.5rem ) clamp( 2.75rem, 5vw, 4.25rem );
}

/* The group's flow layout puts a block-gap margin on the second child. */
.vm-guide-article__body.vm-guide-article__body > * {
	margin-block: 0;
}

.vm-guide-article__body > .wp-block-post-content {
	max-width: 52ch;
	margin-inline: 0;
	/* The site's body size (Ana, 2026-11-15: 20px was too much, 16–17 is right). */
	font-size: var( --wp--preset--font-size--medium );
	line-height: 1.7;
	color: var( --wp--preset--color--contrast );
}

.vm-guide-article__body > .wp-block-post-content > * {
	margin-block: 0;
}

.vm-guide-article__body > .wp-block-post-content > * + * {
	margin-block-start: 1.15em;
}

.vm-guide-article__body > .wp-block-post-content > :is( h2, h3, h4 ) {
	margin-block-start: 1.8em;
	font-family: var( --wp--preset--font-family--heading );
	font-weight: 400;
	line-height: var( --wp--custom--typography--title-line-height );
}

.vm-guide-article__body > .wp-block-post-content > h2 {
	font-size: var( --wp--preset--font-size--large );
}

.vm-guide-article__body > .wp-block-post-content > :is( h3, h4 ) {
	font-size: 1em;
}

.vm-guide-article__body > .wp-block-post-content > :is( h2, h3, h4 ) + * {
	margin-block-start: 0.6em;
}

.vm-guide-article__body > .wp-block-post-content > :is( figure, .wp-block-image, .wp-block-gallery ) {
	margin-block: 1.8em;
}

.vm-guide-article__body .wp-block-post-content img {
	max-width: 100%;
	height: auto;
}

.vm-guide-article__body .wp-block-post-content figcaption {
	margin-top: 0.5em;
	font-size: var( --wp--preset--font-size--small );
	color: var( --wp--preset--color--muted );
}

.vm-guide-article__body .wp-block-post-content a {
	color: var( --vm-color-deep );
	text-underline-offset: var( --wp--custom--typography--underline-offset );
}

.vm-guide-article__body .wp-block-post-content :is( ul, ol ) {
	padding-inline-start: 1.2em;
}

/* -- Article: the side column ------------------------------------------- */

.vm-guide-article__aside {
	position: sticky;
	top: calc( var( --wp-admin--admin-bar--height, 0px ) + 6.5rem );
	font-size: 0.95rem;
}

.vm-guide-article__aside .vm-eyebrow {
	margin: 0 0 0.6rem;
}

.vm-guide-article__toc,
.vm-guide-article__nearby {
	padding-top: 1rem;
	border-top: 1px solid var( --wp--preset--color--border );
}

.vm-guide-article__toc + .vm-guide-article__nearby {
	margin-top: 2rem;
}

.vm-guide-article__toc ol {
	margin: 0;
	padding: 0;
	list-style: none;
}

.vm-guide-article__toc li {
	padding-block: 0.45rem;
	border-bottom: 1px solid var( --wp--preset--color--border );
	line-height: 1.35;
}

.vm-guide-article__toc a {
	color: var( --wp--custom--ink );
	text-decoration: none;
}

.vm-guide-article__toc a:hover,
.vm-guide-article__toc a:focus-visible {
	color: var( --vm-color-deep );
	text-decoration: underline;
	text-underline-offset: var( --wp--custom--typography--underline-offset );
}

.vm-guide-article__nearby .vmc-card + .vmc-card {
	margin-top: 1.5rem;
}

.vm-guide-article__body .wp-block-post-content :is( h2, h3 )[id] {
	scroll-margin-top: calc( var( --wp-admin--admin-bar--height, 0px ) + 6.5rem );
}

/* -- Dates in lists ----------------------------------------------------- */

.vm-guide-list__date {
	margin: 0 0 0.3rem;
	font-size: var( --wp--preset--font-size--small );
	color: var( --wp--preset--color--muted );
}

.vm-guide-article__others li {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.25rem 1.5rem;
}

.vm-guide-article__others em {
	font-style: normal;
	font-size: var( --wp--preset--font-size--small );
	color: var( --wp--preset--color--muted );
	white-space: nowrap;
}

/* -- Article: end — more of the guide ----------------------------------- */

.vm-guide-article__heading {
	margin: var( --wp--preset--spacing--10 ) 0 var( --wp--preset--spacing--30 );
	font-family: var( --wp--preset--font-family--heading );
	font-size: var( --wp--preset--font-size--large );
	font-weight: 400;
	line-height: var( --wp--custom--typography--title-line-height );
}

.vm-guide-article__end .vm-eyebrow {
	margin: 0;
}

.vm-guide-article__more {
	display: grid;
	grid-template-columns: minmax( 0, 1fr ) minmax( 0, 1.2fr );
	gap: clamp( 1.5rem, 4vw, 3.5rem );
	align-items: start;
}

.vm-guide-article__more .vm-guide-article__heading {
	margin-bottom: var( --wp--preset--spacing--20 );
}

.vm-guide-article__all {
	margin: 0;
}

.vm-guide-article__all-link {
	font-family: var( --wp--preset--font-family--display );
	font-size: var( --wp--custom--typography--action-size );
	letter-spacing: var( --wp--custom--typography--action-letter-spacing );
	text-transform: uppercase;
	color: var( --vm-color-deep );
	text-decoration: underline;
	text-underline-offset: var( --wp--custom--typography--underline-offset );
}

.vm-guide-article__others {
	margin: 0;
	padding: 0;
	list-style: none;
}

.vm-guide-article__others li {
	padding: 0.9rem 0;
	border-top: 1px solid var( --wp--preset--color--border );
	font-size: 0.95rem;
}

.vm-guide-article__others li:last-child {
	border-bottom: 1px solid var( --wp--preset--color--border );
}

.vm-guide-article__others a {
	color: var( --wp--preset--color--contrast );
	text-decoration: none;
}

.vm-guide-article__others a:hover,
.vm-guide-article__others a:focus-visible {
	text-decoration: underline;
	text-underline-offset: var( --wp--custom--typography--underline-offset );
}

/* -- Guide index -------------------------------------------------------- */

/*
 * The page /dubrovnik-guide/ (page-dubrovnik-guide.html) mirrors the
 * offers page (page 328): the same band rules, restated for its own
 * classes so neither page depends on the other's (those live in style.css
 * under .vm-page--offer / .vm-offers-page__intro). The padding rules carry
 * a doubled class: .vm-section in style.css has the same specificity and
 * is printed later.
 */
.vm-page--guide .entry-content.entry-content > * + * {
	margin-block-start: 0;
}

.vm-guide-page__intro.vm-guide-page__intro {
	padding-block: clamp( 1.25rem, 2.2vw, 1.85rem ) clamp( 0.9rem, 1.6vw, 1.3rem );
}

.vm-guide-page__intro .vm-section__head {
	margin-bottom: 0;
}

.vm-guide-page__intro .vm-section__head > h1 {
	max-width: 22ch;
	font-size: clamp( 1.9rem, 3vw, 2.5rem );
	line-height: 1.12;
}

.vm-guide-page__intro .vm-section__head > * + * {
	margin-top: 0.35rem;
}

.vm-guide-page__intro .vm-section__head > p:not( .vm-eyebrow ) {
	margin-top: 0.55rem;
	max-width: 58ch;
}

.vm-guide-page__intro .vm-eyebrow {
	margin-bottom: 0.55rem;
}

.vm-guide-index-section.vm-guide-index-section {
	padding-top: 0;
}

/* A house page's "Beyond the property": the block carries .vm-container
   from the saved page; as a plain div it would be content-box. */
.vm-guide-list--house.vm-container {
	box-sizing: border-box;
}

/* The same rhythm as the site's .vm-section__head, without its own
   padding (the block's .vm-container already has it). */
.vm-guide-list--house > .vm-guide-list__head {
	margin-bottom: clamp( 1.75rem, 3vw, 2.5rem );
}

.vm-guide-list--house > .vm-guide-list__head > * {
	max-width: 42rem;
	margin-block: 0;
}

.vm-guide-list--house > .vm-guide-list__head > * + * {
	margin-top: 0.5rem;
}

.vm-guide-list__more {
	margin: clamp( 1.5rem, 3vw, 2rem ) 0 0;
}

.vm-guide-list--index {
	margin-block: 0;
	padding-inline: var( --wp--preset--spacing--30 );
	box-sizing: border-box;
}

.vm-guide-list__rows {
	margin: clamp( 2rem, 4vw, 3rem ) 0 0;
	padding: 0;
	list-style: none;
	border-top: 1px solid var( --wp--preset--color--border );
}

.vm-guide-list__row {
	display: grid;
	grid-template-columns: 200px minmax( 0, 1fr );
	gap: var( --wp--preset--spacing--30 );
	align-items: center;
	padding-block: 1.25rem;
	border-bottom: 1px solid var( --wp--preset--color--border );
}

.vm-guide-list__thumb {
	display: block;
	aspect-ratio: 3 / 2;
	overflow: hidden;
	background-color: var( --wp--preset--color--surface );
}

.vm-guide-list__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.vm-guide-list__title {
	margin: 0 0 0.35rem;
	font-family: var( --wp--preset--font-family--heading );
	font-size: 1.25rem;
	font-weight: 400;
	line-height: 1.3;
}

.vm-guide-list__title a {
	color: var( --wp--preset--color--contrast );
	text-decoration: none;
}

.vm-guide-list__title a:hover,
.vm-guide-list__title a:focus-visible {
	text-decoration: underline;
	text-underline-offset: var( --wp--custom--typography--underline-offset );
}

.vm-guide-list__excerpt {
	max-width: 44rem;
	margin: 0;
	font-size: 0.95rem;
	line-height: var( --wp--custom--typography--description-line-height );
	color: var( --wp--preset--color--muted );
}

.vm-guide-list__editor-note {
	margin: 0 0 0.75rem;
	font-size: var( --wp--preset--font-size--small );
	color: var( --wp--preset--color--muted );
}

/* -- Phone -------------------------------------------------------------- */

@media ( max-width: 781px ) {
	/* Edge to edge on a phone; two classes so it beats .vm-container. */
	.vm-guide-article__hero.vm-container {
		margin-top: 0;
		padding-inline: 0;
	}

	.vm-guide-article__image {
		height: 420px;
	}

	.vm-guide-article__hero:not( .vm-guide-article__hero--no-image ) .vm-guide-article__head {
		padding: 4rem var( --wp--preset--spacing--30, 1.5rem ) 1.4rem;
	}

	.vm-guide-article__title {
		font-size: var( --wp--preset--font-size--large );
	}

	.vm-guide-article__more {
		grid-template-columns: minmax( 0, 1fr );
		gap: 1.25rem;
	}

	.vm-guide-article__body {
		grid-template-columns: minmax( 0, 1fr );
		row-gap: 2.5rem;
	}

	.vm-guide-article__aside {
		position: static;
	}

	/* On a phone the last crumb only repeats the title right below it. */
	.vm-breadcrumbs li[aria-current] {
		display: none;
	}

	/* The contents list helps while reading on a wide screen; below the
	   text on a phone it would only be a second ending. */
	.vm-guide-article__toc {
		display: none;
	}

	.vm-guide-article__toc + .vm-guide-article__nearby {
		margin-top: 0;
	}

	.vm-guide-list__row {
		grid-template-columns: 96px minmax( 0, 1fr );
		gap: var( --wp--preset--spacing--20 );
		padding-block: 1rem;
	}

	.vm-guide-list__title {
		font-size: var( --wp--preset--font-size--medium );
	}

	.vm-guide-list__excerpt {
		display: none;
	}
}
