/**
 * License Plate page.
 *
 * @package jpd-theme
 */


.jpd-page--license-plate {
	color: #333333;
	background: var(--jpd-white);
	padding: 0 0 72px;
}


/* =========================================================
   Content spacing
   ========================================================= */

.jpd-license-plate-content {
	padding-top: clamp(0.75rem, 2vw, 1.25rem);
}


.jpd-license-plate {
	display: flex;
	flex-direction: column;
	gap: 2.5rem;
}

/* ── Intro ────────────────────────────────────────────────────────── */
.jpd-license-plate__intro {
	text-align: center;
	margin-top: 3rem;
}

.jpd-spec-table__caption-row {
    margin-top: -1.1rem;
}

.jpd-spec-table__caption-row td {
    border-top: 0;
    border-left: 0;
    border-right: 0;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    padding-top: 1rem;
}

.jpd-license-plate__rules-block {
	max-width: 100%;
	margin: 0 auto;
	text-align: left;
}

.jpd-license-plate__section-pill {
	display: inline-block;
	margin: 0 0 1.25rem;
	padding: .6rem 1.6rem;
	border-radius: 999px;
	background: #f0b13a;
	color: #1a1a1a;
	font-size: clamp(0.85rem, 0.3vw + 0.75rem, 0.95rem);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .03em;
}

.jpd-license-plate__rules {
	padding: 1.75rem 2rem;
	border-radius: 12px;
	background: #f5f5f6;
}

.jpd-license-plate__rules-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1.5rem;
}

.jpd-license-plate__rule-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border-left: 4px solid #f0b13a;
	border-radius: 6px;
	background: var(--jpd-white);
	box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.jpd-license-plate__rule-image-wrap {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: .75rem;
	height: 250px;
	padding: 1rem;
	background: #f0f0f0;
	overflow: hidden;
}

.jpd-license-plate__rule-image {
	display: block;
	flex: 1 1 0;
	min-width: 0;
	max-width: 100%;
	height: 100%;
	object-fit: contain;
	object-position: center;
}

.jpd-license-plate__rule-body {
	display: flex;
	align-items: flex-start;
	gap: 1rem;
	padding: 1.25rem 1.5rem;
}

.jpd-license-plate__rule-number {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 2.15rem;
	height: 2.15rem;
	border-radius: 50%;
	background: #f0b13a;
	color: #1a1a1a;
	font-size: .95rem;
	font-weight: 700;
}

.jpd-license-plate__rule-text {
	margin: 0;
	color: #1a1a1a;
	font-size: clamp(0.85rem, 0.3vw + 0.75rem, 0.95rem);
	font-weight: 700;
	line-height: 1.5;
	text-align: left;
}

/* ── Section heading ──────────────────────────────────────────────── */

.jpd-license-plate__section {
	margin-top: 3rem;
}

.jpd-license-plate__section-title {
	margin: 0 0 1.25rem;
	color: #0b3a74;
	font-family: var(--jpd-font-heading);
	font-size: clamp(1.15rem, 1.8vw, 1.4rem);
	font-weight: 700;
	text-transform: uppercase;
}


/* ── License plate examples table ────────────────────────────────── */
.jpd-license-plate__table-wrapper {
	overflow-x: auto;
	border: 2px solid #e8d48a;
	border-radius: 12px;
	box-shadow: 0 1px 3px rgba(3,47,60,0.06);
}

.jpd-license-plate__table,
.jpd-license-plate__spec-table {
	width: 100%;
	border-collapse: collapse;
	border-spacing: 0;
}

.jpd-license-plate__table th,
.jpd-license-plate__table td,
.jpd-license-plate__spec-table th,
.jpd-license-plate__spec-table td {
	padding: 1rem 1.25rem;
	border: 2px solid #e8d48a;
	font-size: clamp(0.85rem, 0.3vw + 0.75rem, 0.95rem);
	line-height: 1.55;
}

/* Remove outer left border */
.jpd-license-plate__table th:first-child,
.jpd-license-plate__table td:first-child,
.jpd-license-plate__spec-table th:first-child,
.jpd-license-plate__spec-table td:first-child {
	border-left: 0;
}

/* Remove outer right border */
.jpd-license-plate__table th:last-child,
.jpd-license-plate__table td:last-child,
.jpd-license-plate__spec-table th:last-child,
.jpd-license-plate__spec-table td:last-child {
	border-right: 0;
}

.jpd-license-plate__table tbody tr:last-child td,
.jpd-license-plate__spec-table tbody tr:last-child td {
	border-bottom: 0;
}

.jpd-license-plate__table thead th,
.jpd-license-plate__spec-table thead th {
	background: #f5c842;
	color: #1a1a1a;
	font-family: var(--jpd-font-heading);
	font-size: 1.3rem;
	font-weight: 700;
	line-height: 1.3;
	text-align: center;
	vertical-align: middle;
}

/* Bil column */
.jpd-license-plate__table tbody td:first-child {
	text-align: center;
	font-weight: 700;
}

.jpd-license-plate__table .jpd-license-plate__table-kenderaan {
	font-weight: 700;
}

/* Bil 1 subrows */
.jpd-license-plate__table tbody tr.jpd-private-commercial__table-subrow td {
	background: var(--jpd-white);
}

.jpd-license-plate__table tbody tr:nth-child(2n + 3) td {
	background: #fef6d8;
}

/* Bil 3, Bil 5, Bil 7... */
.jpd-license-plate__table tbody tr:nth-child(2n + 4) td {
	background: var(--jpd-white);
}

.jpd-license-plate__table ul {
	margin: 0;
	padding-left: 1.1rem;
}

.jpd-license-plate__table li {
	margin-bottom: .4rem;
}

.jpd-license-plate__table li:last-child {
	margin-bottom: 0;
}

/* Nested table (Kenderaan Persendirian & Komersil) */

.jpd-private-commercial__table-bil,
.jpd-private-commercial__table-kenderaan {
	vertical-align: middle;
}

.jpd-private-commercial__table-plate {
	vertical-align: middle;
}

/* ── Plate image groups ──────────────────────────────────────────── */
.jpd-private-commercial__table-plate .jpd-plate-img-group {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 1rem;
	width: 100%;
}

/* Standard BBD plate */
.jpd-private-commercial__table-plate .jpd-plate-img--large {
	display: block;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 90px;
	object-fit: contain;
}

/* Jubli Emas plates */
.jpd-private-commercial__table-plate .jpd-plate-img {
	display: block;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 75px;
	object-fit: contain;
}

/* Number font image */
.jpd-private-commercial__table-plate + td .jpd-plate-img--small {
	display: block;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 65px;
	object-fit: contain;
	margin-top: .75rem;
}

/* Small plate images at kenderaan persendirian & komersil (keterangan) column */
.jpd-plate-img--small {
	display: block;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 65px;
	object-fit: contain;
	margin-top: .75rem;
}

.jpd-license-plate__table tbody tr.jpd-private-commercial__table-subrow td {
	background: var(--jpd-white);
}

/* Multiple stacked plate examples (e.g. Motosikal front/back) */
.jpd-license-plate__examples + .jpd-license-plate__examples {
	margin-top: .75rem;
}


/* ── License Plate Specs table ───────────────────────────────────── */
.jpd-spec-table__sukatan,
.jpd-spec-table__kenderaan {
	background: #fef6d8;
}

.jpd-license-plate__spec-table td.jpd-spec-table__kenderaan {
	text-align: center;
	vertical-align: middle;
	padding: 1rem;
	font-family: var(--jpd-font-heading);
	font-size: 1.1rem;
	font-weight: 700;
	line-height: 1.3;
}

.jpd-spec-table__sukatan-inner {
	display: flex;
	align-items: center;
	justify-content: center;
	height: auto;
	min-height: 0;
	writing-mode: vertical-rl;
	transform: rotate(180deg);
	color: var(--jpd-font-heading);
	font-weight: 700;
	letter-spacing: .04em;
	font-size: 1.5rem;
}

.jpd-spec-table__caption-row td {
	text-align: center;
	background: var(--jpd-white);
	color: var(--font-text);
	vertical-align: middle;
}


/* ── Note callout ─────────────────────────────────────────────────── */
.jpd-license-plate__note {
	margin: 1.75rem 0 0;
	padding: 0.95rem 1.1rem;
	border-left: 4px solid var(--jpd-secondary);
	background: #fdf6e3;
	color: #4a3c1a;
	font-size: clamp(0.95rem, 0.3vw + 0.85rem, 1.05rem);
	line-height: 1.65;
	font-style: italic;
}

.jpd-license-plate__note-reference {
	width: fit-content;
	max-width: 100%;
	margin: 0.9rem 0 0 auto;
	text-align: left;
	font-size: 0.9em;
	line-height: 1.5;
	font-style: normal;
}


/* ── CSS-built plate badges ──────────────────────────────────────── */
.jpd-plate {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: .5rem 1rem;
	border-radius: 4px;
	font-family: 'Arial Narrow', Arial, sans-serif;
	font-size: 1.1rem;
	font-weight: 700;
	letter-spacing: .06em;
	text-align: center;
	line-height: 1.2;
	white-space: nowrap;
}

.jpd-plate--black-white {
	background: #111;
	color: var(--jpd-white);
}

.jpd-plate--stacked {
	flex-direction: column;
	white-space: normal;
	gap: .1rem;
	line-height: 1.15;
}

.jpd-plate__line {
	display: block;
	text-align: center;
}

.jpd-plate--small {
	font-size: .75rem;
	padding: .35rem .6rem;
	white-space: normal;
	line-height: 1.3;
}

.jpd-license-plate__spec-diagram{
    min-height: 0;
    margin-bottom: 2rem;
    margin-top: 2rem;
}

/* =========================================================
   Responsive 
   ========================================================= */
@media (max-width: 920px) {

	.jpd-license-plate__rules-grid {
		grid-template-columns: 1fr;
	}

}


/* =========================================================
   Mobile — table → card layout
   ========================================================= */

@media (max-width: 768px) {
    
    .jpd-license-plate__rules {
	    padding: 1.25rem 1rem;
    }

	.jpd-license-plate-hero__inner {
		grid-template-columns: 1fr;
		min-height: 0;
	}

	.jpd-license-plate-hero__copy {
		padding: 38px 20px 16px;
	}

	.jpd-license-plate-hero__media {
		height: clamp(230px, 66vw, 390px);
	}

	.jpd-license-plate-hero__media img {
		object-position: center;
	}

	.jpd-page--license-plate {
		padding: 0 0 48px;
	}

	.jpd-license-plate {
		gap: 1.75rem;
		padding: 0 .75rem;
	}

    .jpd-license-plate__section-pill {
		padding: .5rem 1.1rem;
		font-size: .8rem;
		letter-spacing: .03em; 
	}


	/* =====================================================
	   Rule cards
	   ===================================================== */

	.jpd-license-plate__rule-image-wrap {
		height: 190px;
		padding: .75rem;
	}

	.jpd-license-plate__rule-body {
		padding: 1rem 1.1rem;
		gap: .75rem;
	}

	.jpd-license-plate__rule-number {
		width: 1.85rem;
		height: 1.85rem;
		font-size: .85rem;
	}

	.jpd-license-plate__rule-text {
		font-size: .85rem;
	}


	/* =====================================================
	   License plate table → mobile cards
	   ===================================================== */

	.jpd-license-plate__table-wrapper {
		overflow-x: visible;
		border: 0;
		box-shadow: none;
		border-radius: 0;
		background: transparent;
	}

	.jpd-license-plate__table,
	.jpd-license-plate__table tbody,
	.jpd-license-plate__spec-table,
	.jpd-license-plate__spec-table tbody {
		display: block;
		width: 100%;
	}

	.jpd-license-plate__table thead,
	.jpd-license-plate__spec-table thead {
		display: none;
	}


	/* Each normal row becomes a card */
	.jpd-license-plate__table tr,
	.jpd-license-plate__spec-table tr {
		display: block;
		margin-bottom: 1.1rem;
		padding: 0;
		border: 2px solid #e8d48a;
		border-radius: 12px;
		overflow: hidden;
		background: var(--jpd-white);
		box-shadow: 0 2px 6px rgba(3, 47, 60, 0.08);
	}

	.jpd-license-plate__table tr.jpd-private-commercial__table-parent-row {
		border-bottom-left-radius: 0;
		border-bottom-right-radius: 0;
	}

	/* Make Jubli Emas parent row connect with its subrow on mobile */
	.jpd-license-plate__spec-table tr.jpd-spec-table__parent-row {
		border-bottom-left-radius: 0;
		border-bottom-right-radius: 0;
	}

	/* Caption row should appear visually attached to the previous card */
	.jpd-spec-table__caption-row {
		margin-top: -1.1rem;
	}

    .jpd-spec-table__caption-row {
        border: 2px solid #e8d48a;
        border-top: 0 !important;
        border-radius: 0 0 12px 12px !important;
    }
	

	/* Ensure diagrams have breathing room (more specific selector to avoid overrides) */
	.jpd-license-plate__spec-table td:not(.jpd-spec-table__sukatan):not(.jpd-spec-table__kenderaan) .jpd-license-plate__spec-diagram {
		margin-bottom: 1.25rem;
	}


	/* =====================================================
	   Kenderaan Persendirian & Komersil subrow
	   The two desktop <tr>s become visually ONE card.
	   ===================================================== */

	.jpd-license-plate__table tr.jpd-private-commercial__table-subrow {
		margin-top: -1.1rem;
		margin-bottom: 1.1rem;
		border-top: 0;
		border-top-left-radius: 0;
		border-top-right-radius: 0;
		border-bottom-left-radius: 12px;
		border-bottom-right-radius: 12px;
		box-shadow: 0 2px 6px rgba(3, 47, 60, 0.08);
	}


	/* Remove the yellow alternating desktop row */
	.jpd-license-plate__table tbody tr:nth-child(2n + 3) td,
	.jpd-license-plate__table tbody tr:nth-child(2n + 4) td,
	.jpd-license-plate__table tbody tr.jpd-private-commercial__table-subrow td {
		background: var(--jpd-white);
	}


	/* =====================================================
	   Table cells
	   ===================================================== */

	.jpd-license-plate__table td,
	.jpd-license-plate__spec-table td {
		display: block;
		width: 100%;
		padding: 1rem 1.1rem;
		border: 0;
		border-bottom: 2px solid #e8d48a;
	}


	/* =====================================================
	   Hide Bil
	   ===================================================== */

	.jpd-license-plate__table thead th:first-child,
	.jpd-license-plate__table tbody td.jpd-private-commercial__table-bil,
	.jpd-license-plate__table tbody tr:not(.jpd-private-commercial__table-subrow)
		td:first-child:not(.jpd-private-commercial__table-kenderaan) {
		display: none !important;
	}


	/* =====================================================
	   Table header label
	   ===================================================== */

	.jpd-license-plate__table .jpd-license-plate__table-kenderaan{
		background: #f5c842 !important;
		color: #1a1a1a;
		font-size: 1.05rem;
		font-weight: 700;
		line-height: 1.3;
		text-align: left;
		padding: .85rem 1.1rem;
	}

	.jpd-license-plate__table-kenderaan::before {
		content: none;
	}


	/* =====================================================
	   Mobile labels
	   ===================================================== */

	.jpd-license-plate__table td::before {
		display: block;
		margin-bottom: .4rem;
		color: #8e1946;
		font-size: .72rem;
		font-weight: 700;
		text-transform: uppercase;
		letter-spacing: .05em;
        text-align: left;
	}


	/* .jpd-license-plate__table tr:not(.jpd-private-commercial__table-subrow)
		td:nth-child(3)::before {
		content: "Contoh Plat Lesen";
	}

	.jpd-license-plate__table tr:not(.jpd-private-commercial__table-subrow)
		td:nth-child(4)::before {
		content: "Keterangan";
	} */


	/* =====================================================
	   Private & Commercial SUBROW
	   ===================================================== */

	.jpd-license-plate__table tr.jpd-private-commercial__table-subrow
		td:first-child::before {
		content: "Contoh Plat Lesen";
	}

	.jpd-license-plate__table tr.jpd-private-commercial__table-subrow
		td:nth-child(2)::before {
		content: "Keterangan";
	}


	/* =====================================================
	   Make the subrow content visually part of same card
	   ===================================================== */

	.jpd-license-plate__table
	tr.jpd-private-commercial__table-subrow
	td:first-child {
		border-top: 1px solid #f0e6c2;
	}

	.jpd-license-plate__table
	tr.jpd-private-commercial__table-subrow
	td:nth-child(2) {
		border-bottom: 0;
	}


	/* =====================================================
	   Plate image groups
	   ===================================================== */

	.jpd-plate-img-group {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: .6rem;
		width: 100%;
		padding: .5rem;
		background: #fafafa;
		border-radius: 8px;
	}


	.jpd-private-commercial__table-plate .jpd-plate-img,
	.jpd-private-commercial__table-plate .jpd-plate-img--large {
		max-height: 60px;
	}


	.jpd-license-plate__examples + .jpd-license-plate__examples {
		margin-top: .5rem;
	}


	/* =====================================================
	   License Plate Specification table
	   ===================================================== */

	.jpd-spec-table__sukatan {
		display: none !important;
	}

	.jpd-spec-table__kenderaan {
		background: #f5c842 !important;
		color: #1a1a1a;
		text-align: left !important;
		padding: .85rem 1.1rem !important;
		border-bottom: 2px solid #e8d48a !important;
	}

	.jpd-license-plate__spec-table
	td:not(.jpd-spec-table__sukatan):not(.jpd-spec-table__kenderaan)::before {
		display: block;
		margin-bottom: .4rem;
		color: #8e1946;
		font-size: .72rem;
		font-weight: 700;
		text-transform: uppercase;
		letter-spacing: .05em;
		content: attr(data-label);
        text-align: left;
        margin-bottom: 2rem;
	}


	.jpd-spec-table__caption-row td::before {
		content: none !important;
	}

	.jpd-spec-table__caption-row td {
		text-align: left;
		font-size: .9rem;
		font-style: italic;
	}



	/* =====================================================
	   Specification diagrams
	   ===================================================== */

	.jpd-license-plate__spec-table
	td:not(.jpd-spec-table__sukatan):not(.jpd-spec-table__kenderaan) {
		overflow-x: visible;
	}

	.jpd-license-plate__spec-diagram {
		display: block;
		width: 100%;
		max-width: 100%;
		height: auto;
	    max-height: none;
        margin-top: 2rem;
	    margin-bottom: 2.5rem;
	}


	/* =====================================================
	   Note
	   ===================================================== */

	.jpd-license-plate__note {
		padding: .9rem 1rem;
		border-radius: 6px;
	}

	.jpd-license-plate__note-reference {
		margin: .75rem 0 0;
		width: 100%;
		text-align: left;
	}
}