/**
 * Domechy model page layout.
 *
 * This used to be pasted into every post as an inline <style> block,
 * which meant fourteen copies drifting apart and a layout change costing
 * fourteen edits. It lives here now: one file, every page.
 *
 * Colours and roundness come from custom properties so they can be
 * overridden from Additional CSS or the styling snippet without touching
 * the plugin. Structure stays here.
 *
 * Mobile first per the Domechy Mobile UX Standard: base styles are
 * phone, min-width bumps at 601 and 922. Tap targets 44px, font floor
 * 15px body / 13px meta.
 */

.dm-model *,
.dm-model *::before,
.dm-model *::after { box-sizing: border-box; }

.dm-model {
	--dm-orange: #F47C1A;
	--dm-teal: #00C4CC;
	--dm-ink: #111111;
	--dm-line: #e5e5e5;
	--dm-muted: #6b6b6b;
	--dm-radius: 16px;
	--dm-heading: 'Poppins', system-ui, -apple-system, sans-serif;
	--dm-body: 'Roboto', system-ui, -apple-system, sans-serif;

	font-family: var(--dm-body);
	color: var(--dm-ink);
	-webkit-font-smoothing: antialiased;
	max-width: 1180px;
	margin: 0 auto;
	padding: 0 16px 24px;
}

.dm-model h1,
.dm-model h2,
.dm-model p,
.dm-model ul,
.dm-model figure { margin: 0; padding: 0; }

.dm-model ul { list-style: none; }

/* ── GALLERY ─────────────────────────────────────────────── */

.dm-gallery { margin: 0 0 18px; }

.dm-gallery__main {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	border-radius: var(--dm-radius);
	background: #f2f2f2;
	border: 1px solid var(--dm-line);
}

.dm-gallery__main img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.dm-tag {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 2;
	padding: 6px 12px;
	border-radius: 999px;
	background: var(--dm-orange);
	color: #fff;
	font-family: var(--dm-heading);
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.dm-gallery__thumbs {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 8px;
	margin-top: 8px;
}

.dm-gallery__thumb {
	position: relative;
	aspect-ratio: 1 / 1;
	min-height: 44px;
	overflow: hidden;
	border-radius: 10px;
	border: 2px solid transparent;
	background: #f2f2f2;
	padding: 0;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.dm-gallery__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.dm-gallery__thumb[aria-current="true"] { border-color: var(--dm-orange); }
.dm-gallery__thumb:focus-visible { outline: 2px solid var(--dm-teal); outline-offset: 2px; }

/* ── HEADER ──────────────────────────────────────────────── */

.dm-eyebrow {
	font-family: var(--dm-heading);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--dm-teal);
	margin-bottom: 8px;
}

.dm-title {
	font-family: var(--dm-heading);
	font-size: 26px;
	font-weight: 800;
	line-height: 1.15;
	letter-spacing: -0.02em;
	margin-bottom: 14px;
}

.dm-authorbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
	padding: 14px 0;
	border-top: 1px solid var(--dm-line);
	border-bottom: 1px solid var(--dm-line);
	margin-bottom: 16px;
}

.dm-stats-wrap { margin-bottom: 18px; }

/* ── WARNING ─────────────────────────────────────────────── */

.dm-callout {
	display: flex;
	gap: 10px;
	padding: 14px 16px;
	margin-bottom: 18px;
	border: 1px solid #F5C4B3;
	border-radius: 12px;
	background: #FAECE7;
	font-size: 14px;
	line-height: 1.6;
	color: #712B13;
}

.dm-callout svg {
	width: 17px;
	height: 17px;
	flex-shrink: 0;
	margin-top: 2px;
	stroke: #993C1D;
}

/* ── DESCRIPTION AND BADGES ──────────────────────────────── */

.dm-desc {
	font-size: 15px;
	line-height: 1.75;
	color: #333;
	margin-bottom: 16px;
}

.dm-desc p { margin: 0; }
.dm-desc p + p { margin-top: 10px; }

.dm-badges {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 20px;
}

.dm-badge {
	display: inline-flex;
	align-items: center;
	padding: 7px 14px;
	border: 1px solid var(--dm-line);
	border-radius: 999px;
	background: #fafafa;
	font-size: 13px;
	font-weight: 500;
	color: #444;
}

.dm-actions {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-bottom: 22px;
}

/* ── SECTIONS ────────────────────────────────────────────── */

.dm-section {
	padding: 22px 0;
	border-top: 1px solid var(--dm-line);
}

.dm-section__title {
	font-family: var(--dm-heading);
	font-size: 18px;
	font-weight: 800;
	letter-spacing: -0.01em;
	margin-bottom: 20px;
}

/* ── RELATED ─────────────────────────────────────────────── */

/* Compact rows on purpose. Card grids at gallery size read as a second
   gallery, which is confusing right after the real one. */
.dm-related {
	display: grid;
	grid-template-columns: 1fr;
	gap: 8px;
}

.dm-related__card,
.dm-related__card:visited {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 44px;
	padding: 10px 12px;
	border: 1px solid var(--dm-line);
	border-radius: 12px;
	background: #fafafa;
	text-decoration: none;
	color: inherit;
	transition: border-color 0.16s ease, background 0.16s ease;
}

.dm-related__card:hover,
.dm-related__card:focus {
	border-color: #c9c9c9;
	background: #fff;
	color: inherit;
}

.dm-related__thumb {
	width: 52px;
	height: 52px;
	flex-shrink: 0;
	overflow: hidden;
	border-radius: 8px;
	background: #eee;
}

.dm-related__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.dm-related__body { min-width: 0; }

.dm-related__title {
	display: block;
	font-family: var(--dm-heading);
	font-size: 14.5px;
	font-weight: 700;
	line-height: 1.35;
	margin-bottom: 2px;
}

.dm-related__meta {
	display: block;
	font-size: 13px;
	color: var(--dm-muted);
}

.dm-related__more { margin-top: 14px; }

.dm-allmodels,
.dm-allmodels:visited {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	font-size: 14px;
	font-weight: 500;
	color: var(--dm-teal);
	text-decoration: none;
}

.dm-allmodels:hover { text-decoration: underline; }

/* ── LICENCE ─────────────────────────────────────────────── */

.dm-licence-card {
	padding: 22px;
	border: 1px solid var(--dm-line);
	border-radius: 14px;
	background: #fafafa;
}

.dm-licence-card__label {
	font-family: var(--dm-heading);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.11em;
	text-transform: uppercase;
	color: var(--dm-muted);
	margin-bottom: 10px;
}

.dm-licence-card__title {
	font-family: var(--dm-heading);
	font-size: 17px;
	font-weight: 700;
	line-height: 1.35;
	margin-bottom: 10px;
}

.dm-licence-card p {
	font-size: 14.5px;
	line-height: 1.75;
	color: var(--dm-muted);
}

.dm-licence-card p + p { margin-top: 10px; }

.dm-licence-card a {
	color: var(--dm-teal);
	text-decoration: none;
	font-weight: 500;
}

.dm-licence-card a:hover { text-decoration: underline; }

/* ── EDITOR NOTICE ───────────────────────────────────────── */

.dm-editor-notice {
	padding: 12px 16px;
	border-left: 3px solid #F47C1A;
	background: rgba(244, 124, 26, 0.08);
	font-size: 14px;
	line-height: 1.6;
}

/* ── 601px AND UP ────────────────────────────────────────── */

@media (min-width: 601px) {
	.dm-model { padding: 0 24px 32px; }
	.dm-title { font-size: 32px; }
	.dm-gallery__thumbs { grid-template-columns: repeat(6, 1fr); }
	.dm-actions { flex-direction: row; align-items: center; gap: 16px; }
	.dm-related { grid-template-columns: repeat(2, 1fr); }
	.dm-licence-card { padding: 28px 32px; }
}

/* ── 922px AND UP ────────────────────────────────────────── */

@media (min-width: 922px) {
	.dm-top {
		display: grid;
		grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
		gap: 36px;
		align-items: start;
	}

	.dm-gallery { margin-bottom: 0; }
	.dm-title { font-size: 34px; }
	.dm-gallery__main { aspect-ratio: 1 / 1; }
	.dm-related { grid-template-columns: repeat(3, 1fr); }
}
