/**
 * Tekad Pemedulian Orang Ramai (TPOR) page.
 *
 * Yellow accordion categories with maroon service-time tables,
 * matching the client TPOR mockup and existing yellow-summary language.
 *
 * @package jpd-theme
 */

.jpd-page--tpor {
	padding: 0 0 72px;
	color: #1a1a1a;
	background: var(--jpd-white);
}

.jpd-tpor {
	padding-top: clamp(2rem, 4vw, 3rem);
}

.jpd-tpor__list {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border-radius: 12px;
	background: #f3d249;
}

.jpd-tpor__item {
	min-width: 0;
	scroll-margin-top: 6rem;
	background: transparent;
}

.jpd-tpor__item:not([open]) > .jpd-tpor__panel {
	display: none;
}

.jpd-tpor__summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1.25rem;
	min-height: 3.5rem;
	padding: 1rem clamp(1.15rem, 3vw, 1.75rem);
	border: 0;
	background: transparent;
	color: #1a1a1a;
	font-family: var(--jpd-font-heading);
	font-size: clamp(0.95rem, 1.4vw, 1.15rem);
	font-weight: 800;
	line-height: 1.35;
	text-transform: uppercase;
	cursor: pointer;
	list-style: none;
	user-select: none;
}

.jpd-tpor__summary::-webkit-details-marker,
.jpd-tpor__summary::marker {
	display: none;
	content: '';
}

.jpd-tpor__summary:hover,
.jpd-tpor__summary:focus-visible {
	outline: 0;
	box-shadow: inset 0 0 0 3px rgba(232, 160, 32, 0.45);
}

.jpd-tpor__summary-text {
	min-width: 0;
	margin: 0;
	font: inherit;
	color: inherit;
}

.jpd-tpor__icon {
	position: relative;
	flex: 0 0 24px;
	width: 24px;
	height: 24px;
}

.jpd-tpor__icon::before,
.jpd-tpor__icon::after {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 16px;
	height: 2.5px;
	border-radius: 999px;
	background: currentColor;
	content: '';
	transform: translate(-50%, -50%);
	transition: transform 0.2s ease;
}

.jpd-tpor__icon::after {
	transform: translate(-50%, -50%) rotate(90deg);
}

.jpd-tpor__item[open] .jpd-tpor__icon::after {
	transform: translate(-50%, -50%) rotate(0deg);
}

.jpd-tpor__panel {
	padding: 0;
}

.jpd-tpor__table-wrap {
	max-width: 100%;
	overflow-x: visible;
	background: var(--jpd-white);
}

.jpd-tpor__table-wrap:focus-visible {
	outline: 3px solid #882461;
	outline-offset: 2px;
}

.jpd-tpor__table {
	width: 100%;
	max-width: 100%;
	table-layout: fixed;
	border-collapse: collapse;
	font-size: clamp(0.9rem, 0.3vw + 0.8rem, 1rem);
	line-height: 1.45;
}

.jpd-tpor__table th,
.jpd-tpor__table td {
	padding: 0.75rem 1rem;
	vertical-align: middle;
	overflow-wrap: break-word;
	border-bottom: 1px solid #f0e3b0;
}

.jpd-tpor__table thead th {
	background: #882461;
	color: var(--jpd-white);
	font-weight: 700;
	text-align: left;
}

.jpd-tpor__table thead th:first-child,
.jpd-tpor__table thead th:last-child,
.jpd-tpor__table tbody th,
.jpd-tpor__table .jpd-tpor__days {
	text-align: center;
}

.jpd-tpor__table thead th:first-child,
.jpd-tpor__table tbody th {
	width: 4.5rem;
}

.jpd-tpor__table thead th:last-child,
.jpd-tpor__table .jpd-tpor__days {
	width: 8.5rem;
}

.jpd-tpor__table tbody th {
	font-weight: 700;
	color: #1a1a1a;
	background: inherit;
}

.jpd-tpor__table tbody tr:nth-child(odd) th,
.jpd-tpor__table tbody tr:nth-child(odd) td {
	background: var(--jpd-white);
}

.jpd-tpor__table tbody tr:nth-child(even) th,
.jpd-tpor__table tbody tr:nth-child(even) td {
	background: #fff8e1;
}

.jpd-tpor__table tbody tr:last-child th,
.jpd-tpor__table tbody tr:last-child td {
	border-bottom: 0;
}

.jpd-tpor__row--parent .jpd-tpor__service {
	font-weight: 700;
}

.jpd-tpor__service--child {
	padding-left: 2.25rem;
}

.jpd-tpor__service--child::before {
	content: '– ';
}

@media (max-width: 768px) {
	.jpd-tpor__summary {
		gap: 1rem;
		padding: 0.9rem 1rem;
		font-size: 0.92rem;
	}

	.jpd-tpor__table-wrap {
		overflow: visible;
	}

	.jpd-tpor__table th,
	.jpd-tpor__table td {
		padding: 0.6rem 0.5rem;
	}

	.jpd-tpor__table thead th:first-child,
	.jpd-tpor__table tbody th {
		width: 2.4rem;
	}

	.jpd-tpor__table thead th:last-child,
	.jpd-tpor__table .jpd-tpor__days {
		width: 4.6rem;
	}

	.jpd-tpor__service--child {
		padding-left: 1.15rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.jpd-tpor__icon::before,
	.jpd-tpor__icon::after {
		transition: none;
	}
}
