/**
 * Detail pages — projects and services.
 *
 * The frame (breadcrumb, hero, section rhythm, headings, related cards, CTA)
 * is shared by both; the blocks below "Service detail" belong only to the
 * service pages. Built on the theme's existing tokens (--color1, --color2,
 * --border_radius) so it sits inside the Palm design rather than beside it.
 *
 * The `mida-pd-` prefix reads as "page detail" and keeps every rule clear of
 * the ported Sapo classes.
 */

.mida-pd {
	--pd-line: #2a2a2a;
	--pd-muted: #999;
	--pd-alt: #141414;

	color: #fff;
}

/* Breadcrumb ---------------------------------------------------------------
 *
 * Every ported stylesheet scopes the strip to its own wrapper
 * (`.main-page .main-page-breadcrumb` and friends), so a template that prints
 * the breadcrumb outside one of those loses the band entirely. This page has
 * no such wrapper, hence its own class carrying the same values.
 */

.mida-pd-breadcrumb {
	padding: 10px 0;
	margin-bottom: 15px;
	background: #222;
}

/* Hero --------------------------------------------------------------------- */

.mida-pd-hero {
	position: relative;
	display: flex;
	align-items: flex-end;
	/* Bounded rather than plain 62vh: on a very tall window an unbounded
	   viewport unit turns the banner into several screens of photo. */
	min-height: clamp(420px, 62vh, 680px);
	padding: 4rem 0 3.5rem;
	overflow: hidden;
}

.mida-pd-hero-bg {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Keeps the copy readable whatever the photo behind it. */
.mida-pd-hero::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(0, 0, 0, 0.25) 0%, rgba(0, 0, 0, 0.85) 100%);
}

.mida-pd-hero-inner {
	position: relative;
	z-index: 1;
}

.mida-pd-tag {
	display: inline-block;
	margin-bottom: 1rem;
	padding: 5px 14px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 1px;
	text-transform: uppercase;
	border: 1px solid rgba(255, 255, 255, 0.45);
	border-radius: 999px;
}

.mida-pd-hero-title {
	margin: 0 0 1rem;
	font-size: 3.2rem;
	font-weight: 600;
	line-height: 1.1;
}

.mida-pd-hero-sub {
	max-width: 620px;
	margin: 0 0 2.25rem;
	font-size: 17px;
	font-weight: 300;
	line-height: 1.7;
	color: rgba(255, 255, 255, 0.8);
}

.mida-pd-hero-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 2.5rem;
	margin: 0;
	padding-top: 1.5rem;
	border-top: 1px solid rgba(255, 255, 255, 0.25);
}

.mida-pd-hero-meta li {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.mida-pd-hero-meta span {
	font-size: 12px;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.6);
}

.mida-pd-hero-meta strong {
	font-size: 18px;
	font-weight: 600;
}

/* Section frame ------------------------------------------------------------ */

.mida-pd-section {
	padding: 4.5rem 0;
}

.mida-pd-alt {
	background: var(--pd-alt);
}

.mida-pd-head {
	margin-bottom: 2.25rem;
}

.mida-pd-head h2 {
	margin: 0;
	font-size: 2rem;
	font-weight: 600;
	line-height: 1.2;
}

.mida-pd-lead {
	max-width: 680px;
	margin: 12px 0 0;
	font-size: 16px;
	font-weight: 300;
	line-height: 1.7;
	color: var(--pd-muted);
}

/* Overview + specs --------------------------------------------------------- */

.mida-pd-overview {
	display: grid;
	grid-template-columns: 1.35fr 1fr;
	gap: 3rem;
	align-items: start;
}

.mida-pd-overview-text p {
	margin: 0 0 1rem;
	font-size: 17px;
	font-weight: 300;
	line-height: 1.8;
	color: #d5d5d5;
}

.mida-pd-specs {
	margin: 0;
	border-top: 1px solid var(--pd-line);
}

.mida-pd-spec {
	display: grid;
	grid-template-columns: 40% 1fr;
	gap: 1rem;
	padding: 14px 0;
	border-bottom: 1px solid var(--pd-line);
}

.mida-pd-spec dt {
	margin: 0;
	font-size: 14px;
	font-weight: 400;
	color: var(--pd-muted);
}

.mida-pd-spec dd {
	margin: 0;
	font-size: 15px;
	font-weight: 500;
}

/* Problem / solution ------------------------------------------------------- */

.mida-pd-duo {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 3rem;
}

.mida-pd-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.mida-pd-list li {
	position: relative;
	margin-bottom: 14px;
	padding-left: 30px;
	font-size: 16px;
	font-weight: 300;
	line-height: 1.7;
	color: #d5d5d5;
}

/* A dash for the problems, a tick for the answers — readable without colour
   alone carrying the meaning. */
.mida-pd-list-problem li::before {
	content: "—";
	position: absolute;
	top: 0;
	left: 0;
	color: #ff9d8a;
}

.mida-pd-list-solution li::before {
	content: "✓";
	position: absolute;
	top: 0;
	left: 0;
	color: #7ee0a1;
}

/* Concept ------------------------------------------------------------------ */

.mida-pd-concept {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	/* Fixed row height so the tall image can span exactly two of them. */
	grid-auto-rows: 250px;
	gap: 16px;
}

/* Each figure is a column: the image takes the leftover height and the caption
   keeps its own, instead of the image filling the cell and pushing the caption
   out of view. */
.mida-pd-concept figure {
	display: flex;
	flex-direction: column;
	min-height: 0;
	margin: 0;
}

.mida-pd-concept-main {
	grid-row: 1 / span 2;
}

.mida-pd-concept img {
	display: block;
	flex: 1 1 auto;
	width: 100%;
	min-height: 0;
	object-fit: cover;
	border-radius: var(--border_radius);
}

.mida-pd-concept figcaption {
	flex: 0 0 auto;
}

.mida-pd-concept figcaption,
.mida-pd-layout figcaption {
	margin-top: 10px;
	font-size: 13px;
	color: var(--pd-muted);
}

/* Layout ------------------------------------------------------------------- */

.mida-pd-layout {
	display: grid;
	grid-template-columns: 1.4fr 1fr;
	gap: 3rem;
	align-items: center;
}

.mida-pd-layout-plan {
	margin: 0;
}

.mida-pd-layout-plan img {
	display: block;
	width: 100%;
	border-radius: var(--border_radius);
}

.mida-pd-layout-notes {
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: none;
}

.mida-pd-layout-notes li {
	display: flex;
	gap: 14px;
	padding: 14px 0;
	font-size: 16px;
	font-weight: 300;
	line-height: 1.7;
	color: #d5d5d5;
	border-bottom: 1px solid var(--pd-line);
}

.mida-pd-layout-notes li:first-child {
	border-top: 1px solid var(--pd-line);
}

.mida-pd-layout-notes span {
	flex: 0 0 auto;
	font-size: 13px;
	font-weight: 600;
	color: var(--pd-muted);
}

/* Galleries ---------------------------------------------------------------- */

.mida-pd-gallery {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 16px;
}

.mida-pd-gallery figure,
.mida-pd-progress figure,
.mida-pd-ba figure {
	position: relative;
	margin: 0;
}

.mida-pd-gallery img,
.mida-pd-progress img,
.mida-pd-ba img {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border-radius: var(--border_radius);
}

.mida-pd-progress {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 20px;
}

.mida-pd-progress figcaption {
	margin-top: 12px;
	font-size: 15px;
	font-weight: 300;
	color: #d5d5d5;
}

.mida-pd-progress figcaption span {
	display: block;
	margin-bottom: 2px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: var(--pd-muted);
}

/* Before / after ----------------------------------------------------------- */

.mida-pd-ba {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
}

.mida-pd-ba img {
	aspect-ratio: 3 / 2;
}

.mida-pd-ba-tag {
	position: absolute;
	top: 14px;
	left: 14px;
	z-index: 1;
	padding: 5px 14px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: #fff;
	background: rgba(0, 0, 0, 0.65);
	border-radius: 999px;
}

.mida-pd-ba-tag.is-after {
	color: #000;
	background: #fff;
}

/* Video -------------------------------------------------------------------- */

.mida-pd-video {
	position: relative;
	overflow: hidden;
	border-radius: var(--border_radius);
}

.mida-pd-video img {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

.mida-pd-video-play {
	position: absolute;
	top: 50%;
	left: 50%;
	display: grid;
	place-items: center;
	width: 76px;
	height: 76px;
	padding: 0;
	color: #000;
	background: rgba(255, 255, 255, 0.92);
	border: 0;
	border-radius: 50%;
	transform: translate(-50%, -50%);
	cursor: pointer;
	transition: transform 0.25s ease, background 0.25s ease;
}

.mida-pd-video-play:hover {
	background: #fff;
	transform: translate(-50%, -50%) scale(1.08);
}

/* Feedback ----------------------------------------------------------------- */

.mida-pd-quote {
	max-width: 780px;
	margin: 0 auto;
	text-align: center;
}

.mida-pd-quote .ic-quote {
	display: inline-block;
	width: 27px;
	height: 22px;
	margin-bottom: 1.25rem;
	background-color: #fff;
	-webkit-mask-image: url("../images/ic_quote.svg");
	mask-image: url("../images/ic_quote.svg");
}

.mida-pd-quote p {
	margin: 0 0 1.5rem;
	font-size: 1.5rem;
	font-weight: 300;
	line-height: 1.6;
}

.mida-pd-quote footer strong {
	display: block;
	font-size: 16px;
	font-weight: 600;
}

.mida-pd-quote footer span {
	font-size: 14px;
	color: var(--pd-muted);
}

/* Related ------------------------------------------------------------------ */

.mida-pd-related {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 20px;
}

.mida-pd-related-item {
	display: block;
	color: inherit;
}

.mida-pd-related-thumb {
	display: block;
	overflow: hidden;
	border-radius: var(--border_radius);
}

.mida-pd-related-thumb img {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	transition: transform 0.5s ease;
}

.mida-pd-related-item:hover .mida-pd-related-thumb img {
	transform: scale(1.05);
}

.mida-pd-related-cat {
	display: block;
	margin: 14px 0 4px;
	font-size: 12px;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: var(--pd-muted);
}

.mida-pd-related-title {
	display: block;
	font-size: 16px;
	font-weight: 500;
	line-height: 1.5;
}

/* Responsive --------------------------------------------------------------- */

@media (max-width: 991px) {
	.mida-pd-hero-title {
		font-size: 2.4rem;
	}

	.mida-pd-overview,
	.mida-pd-duo,
	.mida-pd-layout {
		grid-template-columns: minmax(0, 1fr);
		gap: 2rem;
	}

	.mida-pd-gallery,
	.mida-pd-progress,
	.mida-pd-related {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.mida-pd-concept-main img {
		min-height: 240px;
	}
}

@media (max-width: 767px) {
	.mida-pd-hero {
		min-height: clamp(340px, 52vh, 520px);
		padding: 3rem 0 2.5rem;
	}

	.mida-pd-hero-title {
		font-size: 2rem;
	}

	.mida-pd-hero-meta {
		gap: 1.5rem;
	}

	.mida-pd-section {
		padding: 3rem 0;
	}

	.mida-pd-head h2 {
		font-size: 1.6rem;
	}

	.mida-pd-gallery,
	.mida-pd-progress,
	.mida-pd-related,
	.mida-pd-concept,
	.mida-pd-ba {
		grid-template-columns: minmax(0, 1fr);
	}

	.mida-pd-concept-main {
		grid-row: auto;
	}

	.mida-pd-quote p {
		font-size: 1.15rem;
	}

}

/* ==========================================================================
   Service detail — blocks used only by the service page templates
   ========================================================================== */

/* Quy trình ---------------------------------------------------------------- */

.mida-pd-steps {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 24px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.mida-pd-steps li {
	padding: 26px 24px 28px;
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid var(--pd-line);
	border-radius: var(--border_radius);
}

/* Unlike the section counters, these numbers carry meaning — they are the
   order of the steps, so they stay. */
.mida-pd-step-num {
	display: block;
	margin-bottom: 14px;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 2px;
	color: var(--pd-muted);
}

.mida-pd-steps h3 {
	margin: 0 0 8px;
	font-size: 1.05rem;
	font-weight: 600;
}

.mida-pd-steps p {
	margin: 0;
	font-size: 15px;
	font-weight: 300;
	line-height: 1.7;
	color: #d5d5d5;
}

/* Timeline ----------------------------------------------------------------- */

.mida-pd-timeline {
	position: relative;
	margin: 0;
	padding: 0 0 0 2rem;
	list-style: none;
}

/* The rail runs behind the markers rather than being drawn per item, so the
   line stays unbroken whatever the row heights are. */
.mida-pd-timeline::before {
	content: "";
	position: absolute;
	top: 10px;
	bottom: 24px;
	left: 5px;
	width: 1px;
	background: var(--pd-line);
}

.mida-pd-timeline li {
	position: relative;
	display: grid;
	grid-template-columns: 190px minmax(0, 1fr);
	gap: 2rem;
	/* A rule under each row: without it the short copy makes the block look
	   narrower than the container it actually fills. */
	padding: 0 0 1.75rem;
	margin-bottom: 1.75rem;
	border-bottom: 1px solid var(--pd-line);
}

.mida-pd-timeline li:last-child {
	padding-bottom: 0;
	margin-bottom: 0;
	border-bottom: 0;
}

.mida-pd-timeline li::before {
	content: "";
	position: absolute;
	top: 8px;
	left: -2rem;
	width: 11px;
	height: 11px;
	background: var(--color_bg);
	border: 2px solid #fff;
	border-radius: 50%;
}

.mida-pd-timeline-when {
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: var(--pd-muted);
	padding-top: 3px;
}

.mida-pd-timeline-body h3 {
	margin: 0 0 6px;
	font-size: 1.1rem;
	font-weight: 600;
}

.mida-pd-timeline-body p {
	margin: 0;
	font-size: 15px;
	font-weight: 300;
	line-height: 1.7;
	color: #d5d5d5;
}

/* Hồ sơ bàn giao ----------------------------------------------------------- */

.mida-pd-deliver {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 20px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.mida-pd-deliver li {
	position: relative;
	padding: 22px 22px 24px 52px;
	border: 1px solid var(--pd-line);
	border-radius: var(--border_radius);
}

.mida-pd-deliver li::before {
	content: "✓";
	position: absolute;
	top: 22px;
	left: 22px;
	font-size: 15px;
	color: #7ee0a1;
}

.mida-pd-deliver h3 {
	margin: 0 0 6px;
	font-size: 1rem;
	font-weight: 600;
}

.mida-pd-deliver p {
	margin: 0;
	font-size: 14px;
	font-weight: 300;
	line-height: 1.7;
	color: #d5d5d5;
}

/* FAQ ----------------------------------------------------------------------
 *
 * <details>/<summary> rather than a scripted accordion: it opens without JS,
 * is keyboard operable for free, and browser find-in-page can reach the
 * answers.
 */

.mida-pd-faq {
	border-top: 1px solid var(--pd-line);
}

.mida-pd-faq details {
	border-bottom: 1px solid var(--pd-line);
}

.mida-pd-faq summary {
	position: relative;
	padding: 20px 44px 20px 0;
	font-size: 1.05rem;
	font-weight: 500;
	line-height: 1.5;
	list-style: none;
	cursor: pointer;
	transition: color 0.2s ease;
}

/* Hides the default disclosure triangle in WebKit. */
.mida-pd-faq summary::-webkit-details-marker {
	display: none;
}

.mida-pd-faq summary:hover {
	color: var(--pd-muted);
}

.mida-pd-faq summary:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 4px;
}

.mida-pd-faq summary::after {
	content: "";
	position: absolute;
	top: 50%;
	right: 8px;
	width: 10px;
	height: 10px;
	border-right: 1px solid currentColor;
	border-bottom: 1px solid currentColor;
	transform: translateY(-70%) rotate(45deg);
	transition: transform 0.25s ease;
}

.mida-pd-faq details[open] summary::after {
	transform: translateY(-30%) rotate(-135deg);
}

.mida-pd-faq details p {
	margin: 0;
	padding: 0 44px 22px 0;
	font-size: 15px;
	font-weight: 300;
	line-height: 1.8;
	color: #d5d5d5;
}

/* Responsive --------------------------------------------------------------- */

@media (max-width: 991px) {
	.mida-pd-steps,
	.mida-pd-deliver {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.mida-pd-timeline li {
		grid-template-columns: minmax(0, 1fr);
		gap: 6px;
	}
}

@media (max-width: 767px) {
	.mida-pd-steps,
	.mida-pd-deliver {
		grid-template-columns: minmax(0, 1fr);
	}

	.mida-pd-faq summary {
		font-size: 1rem;
	}
}

/* Moodboard ----------------------------------------------------------------
 *
 * A mosaic rather than an even grid: the lead image reads as the anchor and
 * the rest as references around it, which is how a physical moodboard is laid
 * out. Fixed row height so the lead can span exactly two of them.
 */

.mida-pd-mood {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	grid-auto-rows: 190px;
	gap: 16px;
}

.mida-pd-mood figure {
	margin: 0;
	min-height: 0;
}

.mida-pd-mood-lead {
	grid-column: span 2;
	grid-row: span 2;
}

.mida-pd-mood img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: var(--border_radius);
}

/* Material -----------------------------------------------------------------
 *
 * Each entry is a swatch plus a name and a group — the one block here that
 * carries structured data rather than pictures alone.
 */

.mida-pd-materials {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 20px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.mida-pd-material-swatch {
	display: block;
	margin-bottom: 12px;
	overflow: hidden;
	border-radius: var(--border_radius);
}

.mida-pd-material-swatch img {
	display: block;
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	transition: transform 0.5s ease;
}

.mida-pd-material:hover .mida-pd-material-swatch img {
	transform: scale(1.05);
}

.mida-pd-material strong {
	display: block;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.4;
}

.mida-pd-material-group {
	display: block;
	margin-top: 2px;
	font-size: 12px;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: var(--pd-muted);
}

/* 3D visualisation --------------------------------------------------------- */

.mida-pd-shots {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 20px;
}

.mida-pd-shots figure {
	margin: 0;
}

.mida-pd-shots img {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border-radius: var(--border_radius);
}

.mida-pd-shots figcaption {
	margin-top: 10px;
	font-size: 14px;
	font-weight: 300;
	color: var(--pd-muted);
}

/* Responsive --------------------------------------------------------------- */

@media (max-width: 991px) {
	.mida-pd-materials {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.mida-pd-shots {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.mida-pd-mood {
		grid-auto-rows: 150px;
	}
}

@media (max-width: 767px) {
	.mida-pd-materials {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.mida-pd-shots {
		grid-template-columns: minmax(0, 1fr);
	}

	/* Two columns keep the mosaic readable; the lead still leads. */
	.mida-pd-mood {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		grid-auto-rows: 130px;
	}
}

/* Scope row ----------------------------------------------------------------
 *
 * Image beside a list of what the stage covers. `is-flip` swaps the sides so
 * two rows stacked on top of each other alternate instead of marching.
 */

.mida-pd-scope {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 3rem;
	align-items: center;
}

.mida-pd-scope-media {
	margin: 0;
}

.mida-pd-scope-media img {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border-radius: var(--border_radius);
}

.mida-pd-scope.is-flip .mida-pd-scope-media {
	order: 2;
}

.mida-pd-scope .mida-pd-list li:last-child {
	margin-bottom: 0;
}

/* Warranty table ----------------------------------------------------------- */

/* A narrow window scrolls the table rather than squeezing three columns into
   an unreadable width. */
.mida-pd-table-wrap {
	overflow-x: auto;
}

.mida-pd-table {
	width: 100%;
	min-width: 620px;
	border-collapse: collapse;
}

.mida-pd-table th,
.mida-pd-table td {
	padding: 16px 20px 16px 0;
	font-size: 15px;
	font-weight: 300;
	line-height: 1.6;
	text-align: left;
	vertical-align: top;
	color: #d5d5d5;
	border-bottom: 1px solid var(--pd-line);
}

.mida-pd-table thead th {
	padding-top: 0;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: var(--pd-muted);
}

.mida-pd-table tbody th {
	font-weight: 600;
	color: #fff;
}

.mida-pd-table tbody tr:last-child th,
.mida-pd-table tbody tr:last-child td {
	border-bottom: 0;
}

.mida-pd-note {
	margin: 16px 0 0;
	font-size: 13px;
	font-weight: 300;
	color: var(--pd-muted);
}

/* Responsive --------------------------------------------------------------- */

@media (max-width: 991px) {
	.mida-pd-scope {
		grid-template-columns: minmax(0, 1fr);
		gap: 1.75rem;
	}

	/* Stacked, the image belongs on top whichever side it took on desktop. */
	.mida-pd-scope.is-flip .mida-pd-scope-media {
		order: 0;
	}
}
