/* ==========================================================================
   Rich content (blog posts, pages, trip descriptions).
   Covers the WordPress block markup that imported content still uses
   (galleries, aligned images, columns, embeds, colour classes) so no
   WordPress stylesheet is needed.
   ========================================================================== */

.prose {
	color: var(--hd-text-secondary);
	font-size: 1.0625rem;
	line-height: 1.8;
	overflow-wrap: break-word;
}

.prose > * + * { margin-top: 1.1em; }
.prose h2, .prose h3, .prose h4 { color: var(--hd-text-primary); margin-top: 1.8em; margin-bottom: 0.5em; }
.prose h2 + *, .prose h3 + *, .prose h4 + * { margin-top: 0; }
.prose h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
.prose h3 { font-size: clamp(1.25rem, 2.4vw, 1.5rem); }
.prose a { color: var(--hd-gold-dark); font-weight: 600; }
.prose a:hover { color: var(--hd-gold); text-decoration: underline; text-underline-offset: 3px; }
.prose strong { color: var(--hd-text-primary); }
.prose a strong, .prose strong a { color: inherit; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 0.35em; }
.prose blockquote, .prose .wp-block-quote {
	border-left: 3px solid var(--hd-gold-light);
	padding: 0.25em 0 0.25em 1.25em;
	font-family: var(--hd-font-heading);
	font-style: italic;
	font-size: 1.2em;
	color: var(--hd-text-primary);
}
.prose hr, .prose .wp-block-separator { border: 0; height: 1px; background: var(--hd-border); margin: 2.5em auto; }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.95em; }
.prose th, .prose td { border-bottom: 1px solid var(--hd-border); padding: 0.6em 0.75em; text-align: left; }
.prose img { border-radius: var(--hd-radius-md); }
.prose iframe { max-width: 100%; }
.prose--justify p, .prose .has-text-align-justify { text-align: justify; hyphens: auto; }

/* Text alignment + colour helpers */
.has-text-align-center { text-align: center; }
.has-text-align-right { text-align: right; }
.has-text-align-left { text-align: left; }
.has-text-align-justify { text-align: justify; }
.has-white-color { color: #fff; }
.has-vivid-cyan-blue-color { color: #0693e3; }
.has-pale-cyan-blue-color { color: #8ed1fc; }
.has-large-font-size { font-size: 1.5em; line-height: 1.4; }
.has-small-font-size { font-size: 0.85em; }

/* Images & figures */
.prose figure { margin-left: 0; margin-right: 0; }
.wp-block-image img { height: auto; }
.wp-block-image figcaption, .wp-element-caption, .prose figcaption {
	font-size: 0.875rem;
	color: var(--hd-text-muted);
	text-align: center;
	margin-top: 0.5em;
	line-height: 1.5;
}
.prose .alignleft, .wp-block-image .alignleft { float: left; margin: 0.3em 1.5em 1em 0; max-width: 50%; }
.prose .alignright, .wp-block-image .alignright { float: right; margin: 0.3em 0 1em 1.5em; max-width: 50%; }
.prose .aligncenter, .wp-block-image .aligncenter { margin-left: auto; margin-right: auto; text-align: center; }
.prose .aligncenter img { margin: 0 auto; }
.prose .size-medium img { max-width: 300px; }
.prose::after { content: ''; display: table; clear: both; }

/* Galleries (core/gallery "has-nested-images") */
.wp-block-gallery {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6em;
	align-items: stretch;
	margin: 1.5em 0;
	padding: 0;
	list-style: none;
}
.wp-block-gallery > figure,
.wp-block-gallery .wp-block-image,
.wp-block-gallery .blocks-gallery-item {
	flex: 1 1 calc(33.333% - 0.6em);
	min-width: 140px;
	margin: 0 !important;
	position: relative;
	display: flex;
	flex-direction: column;
}
.wp-block-gallery.columns-2 > figure { flex-basis: calc(50% - 0.6em); }
.wp-block-gallery.columns-4 > figure { flex-basis: calc(25% - 0.6em); }
.wp-block-gallery.is-cropped figure img { width: 100%; height: 100%; aspect-ratio: 4 / 3; object-fit: cover; flex: 1; }
.wp-block-gallery figure a { display: block; height: 100%; }
.wp-block-gallery figcaption {
	position: absolute;
	inset: auto 0 0 0;
	margin: 0;
	padding: 1.5em 0.6em 0.5em;
	color: #fff;
	font-size: 0.8rem;
	text-align: center;
	background: linear-gradient(0deg, rgba(0, 0, 0, 0.6), transparent);
	border-radius: 0 0 var(--hd-radius-md) var(--hd-radius-md);
}
.wp-block-gallery > figcaption { position: static; background: none; color: var(--hd-text-muted); flex-basis: 100%; }

/* Constrained groups (WordPress "content width" layout) */
.is-layout-constrained { padding-left: var(--hd-gutter); padding-right: var(--hd-gutter); }
.is-layout-constrained > :not(.alignfull):not(.alignleft):not(.alignright) {
	max-width: var(--hd-content-size, 800px);
	margin-left: auto;
	margin-right: auto;
}

/* Columns */
.wp-block-columns { display: flex; gap: 2em; flex-wrap: wrap; margin: 1.5em 0; }
.wp-block-column { flex: 1 1 0; min-width: 240px; }

/* Embeds (YouTube, Vimeo…) */
.wp-block-embed { margin: 1.5em 0; }
.wp-block-embed__wrapper { position: relative; }
.wp-block-embed.is-type-video .wp-block-embed__wrapper,
.wp-block-embed-youtube .wp-block-embed__wrapper { aspect-ratio: 16 / 9; }
.wp-block-embed__wrapper iframe { width: 100%; height: 100%; border: 0; border-radius: var(--hd-radius-md); }

/* Buttons inside content */
.wp-block-buttons { display: flex; flex-wrap: wrap; gap: 0.75em; margin: 1.5em 0; }
.wp-block-button__link {
	display: inline-flex;
	align-items: center;
	padding: 0.8em 1.6em;
	border-radius: var(--hd-radius-full);
	background: linear-gradient(135deg, var(--hd-gold), var(--hd-gold-dark));
	color: #fff !important;
	font-weight: 600;
	text-decoration: none !important;
}

@media (max-width: 640px) {
	.prose .alignleft, .prose .alignright { float: none; margin: 1em auto; max-width: 100%; }
	.wp-block-gallery > figure { flex-basis: calc(50% - 0.6em); }
	.wp-block-columns { flex-direction: column; }
}

/* Justified text leaves big gaps on narrow screens */
@media (max-width: 640px) {
	.prose .has-text-align-justify, .prose--justify p, .prose p[style*="justify"] { text-align: left; }
}
