/* Monthly Prayer Timetable
 *
 * Theme isolation: every rule is scoped with `.ptt:not(#ptt-scope)`. The
 * :not(#id) adds ID-level specificity, so theme/page-builder rules such as
 * `.elementor-kit-123 h2`, `.page-wrapper p` or `td, th` can't restyle the
 * timetable. A reset (below) clears anything the theme puts on inner
 * elements; component rules then set the plugin's own look.
 */

/* ---------- Root ---------- */
.ptt:not(#ptt-scope) {
	--ptt-accent: #0f6b5c;
	--ptt-text: #1f2933;
	--ptt-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
	--ptt-line: rgba(127, 127, 127, 0.22);
	--ptt-soft: rgba(127, 127, 127, 0.07);
	--ptt-hl: rgba(15, 107, 92, 0.14);
	--ptt-bg: #fff;
	display: block;
	margin: 1.5em 0;
	padding: 0;
	font-family: var(--ptt-font);
	font-size: 16px;
	font-weight: 400;
	font-style: normal;
	line-height: 1.4;
	letter-spacing: normal;
	text-transform: none;
	text-align: left;
	color: var(--ptt-text);
	font-variant-numeric: tabular-nums;
	-webkit-font-smoothing: antialiased;
}
@supports (background: color-mix(in srgb, red 10%, transparent)) {
	.ptt:not(#ptt-scope) { --ptt-hl: color-mix(in srgb, var(--ptt-accent) 15%, transparent); }
}

/* ---------- Reset: undo theme styles on everything inside ---------- */
.ptt:not(#ptt-scope) :is(div, h1, h2, h3, h4, p, span, strong, b, em, a, button, table, caption, thead, tbody, tfoot, tr, th, td, ul, ol, li) {
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
	text-shadow: none;
	font: inherit;
	color: inherit;
	line-height: inherit;
	letter-spacing: inherit;
	text-transform: inherit;
	text-decoration: none;
	text-align: inherit;
	float: none;
	list-style: none;
	min-height: 0;
	max-width: none;
}
.ptt:not(#ptt-scope) *,
.ptt:not(#ptt-scope) *::before,
.ptt:not(#ptt-scope) *::after { box-sizing: border-box; }
.ptt:not(#ptt-scope) :is(li, p)::before,
.ptt:not(#ptt-scope) :is(li, p)::after { content: none; }
.ptt:not(#ptt-scope) strong,
.ptt:not(#ptt-scope) b { font-weight: 700; }

/* ---------- Header ---------- */
.ptt:not(#ptt-scope) .ptt-head {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 12px 20px;
	margin-bottom: 14px;
}
.ptt:not(#ptt-scope) .ptt-org {
	margin-bottom: 2px;
	font-size: 0.78em;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	opacity: 0.7;
}
.ptt:not(#ptt-scope) .ptt-month-name {
	display: block;
	font-size: 1.6em;
	font-weight: 700;
	line-height: 1.15;
	color: var(--ptt-text);
}
.ptt:not(#ptt-scope) .ptt-sub { margin-top: 4px; font-size: 0.9em; opacity: 0.75; }
.ptt:not(#ptt-scope) .ptt-controls { display: flex; flex-wrap: wrap; gap: 6px; }
.ptt:not(#ptt-scope) .ptt-btn {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 0.45em 0.85em;
	border: 1px solid var(--ptt-line);
	border-radius: 6px;
	background: transparent;
	color: var(--ptt-text);
	font-size: 0.85em;
	line-height: 1.2;
	cursor: pointer;
	transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.ptt:not(#ptt-scope) .ptt-btn:hover,
.ptt:not(#ptt-scope) .ptt-btn:focus-visible { border-color: var(--ptt-accent); color: var(--ptt-accent); }
.ptt:not(#ptt-scope) .ptt-btn-primary,
.ptt:not(#ptt-scope) .ptt-btn-primary:hover,
.ptt:not(#ptt-scope) .ptt-btn-primary:focus-visible { background: var(--ptt-accent); border-color: var(--ptt-accent); color: #fff; }
.ptt:not(#ptt-scope) .ptt-btn-primary:hover { filter: brightness(1.1); }

/* ---------- View switch ---------- */
.ptt:not(#ptt-scope)[data-ptt-view="full"] .ptt-v-jamaah,
.ptt:not(#ptt-scope)[data-ptt-view="jamaah"] .ptt-v-full { display: none !important; }
.ptt:not(#ptt-scope).ptt-today[data-begins="0"] .ptt-p-sub { display: none; }

.ptt:not(#ptt-scope) .ptt-toggle {
	display: inline-flex;
	gap: 2px;
	padding: 2px;
	border: 1px solid var(--ptt-line);
	border-radius: 7px;
}
.ptt:not(#ptt-scope) .ptt-toggle button {
	display: inline-block;
	width: auto;
	padding: 0.4em 0.75em;
	border-radius: 5px;
	background: transparent;
	color: var(--ptt-text);
	font-size: 0.8em;
	line-height: 1.2;
	white-space: nowrap;
	cursor: pointer;
}
.ptt:not(#ptt-scope) .ptt-toggle button:hover { color: var(--ptt-accent); background: var(--ptt-soft); }
.ptt:not(#ptt-scope) .ptt-toggle button:focus-visible { outline: 2px solid var(--ptt-accent); outline-offset: 1px; }
.ptt:not(#ptt-scope) .ptt-toggle button[aria-pressed="true"],
.ptt:not(#ptt-scope) .ptt-toggle button[aria-pressed="true"]:hover { background: var(--ptt-accent); color: #fff; }

/* ---------- Table ---------- */
.ptt:not(#ptt-scope) .ptt-scroll {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	border: 1px solid var(--ptt-line);
	border-radius: 8px;
}
.ptt:not(#ptt-scope) .ptt-scroll:focus-visible { outline: 2px solid var(--ptt-accent); outline-offset: 2px; }
.ptt:not(#ptt-scope) .ptt-table {
	display: table;
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	font-size: 0.9em;
	text-align: center;
	table-layout: auto;
}
.ptt:not(#ptt-scope) .ptt-table th,
.ptt:not(#ptt-scope) .ptt-table td {
	padding: 0.5em 0.6em;
	border-bottom: 1px solid var(--ptt-line);
	text-align: center;
	vertical-align: middle;
	white-space: nowrap;
}
.ptt:not(#ptt-scope) .ptt-table thead th {
	background: var(--ptt-accent);
	color: #fff;
	font-size: 0.78em;
	font-weight: 600;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	border-bottom-color: rgba(255, 255, 255, 0.18);
}
.ptt:not(#ptt-scope) .ptt-table thead .ptt-subhead th {
	font-size: 0.7em;
	font-weight: 500;
	letter-spacing: 0.02em;
	text-transform: none;
	color: rgba(255, 255, 255, 0.85);
}
.ptt:not(#ptt-scope) .ptt-table th.ptt-group,
.ptt:not(#ptt-scope) .ptt-table td.ptt-group { border-left: 1px solid var(--ptt-line); }
.ptt:not(#ptt-scope) .ptt-table thead th.ptt-group { border-left-color: rgba(255, 255, 255, 0.18); }
.ptt:not(#ptt-scope) .ptt-table tbody tr:last-child td { border-bottom: 0; }
.ptt:not(#ptt-scope) .ptt-table tbody tr:nth-child(even) td { background: var(--ptt-soft); }
.ptt:not(#ptt-scope) .ptt-table td.ptt-date { font-weight: 700; }
/* Muted text without opacity, so row stripes stay intact. */
.ptt:not(#ptt-scope) .ptt-table td.ptt-wd,
.ptt:not(#ptt-scope) .ptt-table td.ptt-hijri { color: color-mix(in srgb, var(--ptt-text) 70%, transparent); }
.ptt:not(#ptt-scope) .ptt-table td.ptt-hijri strong { color: var(--ptt-accent); font-weight: 600; }
.ptt:not(#ptt-scope) .ptt-table td.ptt-j { font-weight: 600; color: var(--ptt-accent); }
.ptt:not(#ptt-scope) .ptt-table td.ptt-t-sunrise { opacity: 0.75; }
.ptt:not(#ptt-scope) .ptt-table tr.ptt-friday td.ptt-wd { font-weight: 700; color: var(--ptt-accent); }
.ptt:not(#ptt-scope) .ptt-table tbody tr.ptt-is-today td { background: var(--ptt-hl); font-weight: 700; }
.ptt:not(#ptt-scope) .ptt-table tbody tr.ptt-is-today td:first-child { box-shadow: inset 4px 0 0 var(--ptt-accent); }

.ptt:not(#ptt-scope) .ptt-foot { margin-top: 12px; font-size: 0.88em; }
.ptt:not(#ptt-scope) .ptt-foot p + p { margin-top: 4px; }
.ptt:not(#ptt-scope) .ptt-note { opacity: 0.8; }

@media (max-width: 640px) {
	.ptt:not(#ptt-scope) .ptt-month-name { font-size: 1.3em; }
	.ptt:not(#ptt-scope) .ptt-table { font-size: 0.8em; }
	.ptt:not(#ptt-scope) .ptt-table th,
	.ptt:not(#ptt-scope) .ptt-table td { padding: 0.45em 0.4em; }
	/* Keep the date visible while scrolling sideways. Set --ptt-bg to your page colour on dark themes. */
	.ptt:not(#ptt-scope) .ptt-table td.ptt-date,
	.ptt:not(#ptt-scope) .ptt-table thead tr:first-child th:first-child {
		position: sticky;
		left: 0;
		z-index: 2;
		box-shadow: 1px 0 0 var(--ptt-line);
	}
	.ptt:not(#ptt-scope) .ptt-table td.ptt-date { background: var(--ptt-bg); }
	.ptt:not(#ptt-scope) .ptt-table tbody tr:nth-child(even) td.ptt-date { background: linear-gradient(var(--ptt-soft), var(--ptt-soft)), var(--ptt-bg); }
	.ptt:not(#ptt-scope) .ptt-table tbody tr.ptt-is-today td.ptt-date { background: linear-gradient(var(--ptt-hl), var(--ptt-hl)), var(--ptt-bg); box-shadow: inset 4px 0 0 var(--ptt-accent), 1px 0 0 var(--ptt-line); }
}

/* ---------- Today card ---------- */
.ptt:not(#ptt-scope).ptt-today {
	padding: 16px;
	border: 1px solid var(--ptt-line);
	border-radius: 10px;
	container-type: inline-size;
}
.ptt:not(#ptt-scope) .ptt-today-head {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 6px 16px;
	margin-bottom: 12px;
}
.ptt:not(#ptt-scope) .ptt-today-title { font-size: 1.1em; font-weight: 700; }
.ptt:not(#ptt-scope) .ptt-today-date { font-size: 0.85em; opacity: 0.75; }
.ptt:not(#ptt-scope) .ptt-countdown { font-weight: 600; color: var(--ptt-accent); }
.ptt:not(#ptt-scope) .ptt-today-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
@media (max-width: 520px) {
	.ptt:not(#ptt-scope).ptt-today { padding: 12px; }
	.ptt:not(#ptt-scope) .ptt-today-side { align-items: flex-start; }
}
/*
 * Always one row (5 or 6 boxes). Text sizes scale with the card's width
 * (cqi = 1% of the card), so the boxes fit on a phone without wrapping.
 * Browsers without container queries use the fixed sizes declared first.
 */
.ptt:not(#ptt-scope) .ptt-today-grid {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: minmax(0, 1fr);
	gap: 8px;
	gap: clamp(3px, 1.6cqi - 2px, 8px);
}
.ptt:not(#ptt-scope) .ptt-today-grid li {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 2px;
	min-width: 0;
	padding: 10px 8px;
	padding: clamp(7px, 2cqi, 10px) clamp(0px, 1.6cqi - 3px, 8px);
	border-radius: 8px;
	background: var(--ptt-soft);
	text-align: center;
	line-height: 1.2;
	transition: background 0.2s, color 0.2s;
}
@container (max-width: 520px) {
	.ptt:not(#ptt-scope) .ptt-today-grid li { border-radius: 6px; }
}
.ptt:not(#ptt-scope) .ptt-today-grid li > span { display: block; max-width: 100%; }
.ptt:not(#ptt-scope) .ptt-p-name {
	font-size: 0.72em;
	font-size: clamp(7px, 2.5cqi, 0.72em);
	letter-spacing: 0.07em;
	letter-spacing: clamp(0px, 0.25cqi - 0.8px, 0.07em);
	text-transform: uppercase;
	opacity: 0.75;
	white-space: nowrap;
}
.ptt:not(#ptt-scope) .ptt-p-main {
	font-size: 1.4em;
	font-size: clamp(10px, 4.1cqi, 1.4em);
	font-weight: 700;
	letter-spacing: -0.02em;
	white-space: normal; /* "12:45 pm" may wrap at the space; the digits never split. */
}
/* "Begins 11:49" wraps onto two lines when the box is narrow. */
.ptt:not(#ptt-scope) .ptt-p-sub {
	min-height: 1.2em;
	font-size: 0.76em;
	font-size: clamp(7px, 2.5cqi, 0.76em);
	opacity: 0.75;
}
.ptt:not(#ptt-scope) .ptt-today-grid li.ptt-p-sunrise .ptt-p-main { font-weight: 500; }
.ptt:not(#ptt-scope) .ptt-today-grid li.ptt-current { box-shadow: inset 0 0 0 2px var(--ptt-accent); }
.ptt:not(#ptt-scope) .ptt-today-grid li.ptt-next { background: var(--ptt-accent); color: #fff; }
.ptt:not(#ptt-scope) .ptt-today-grid li.ptt-next span { opacity: 1; }

/* ---------- Accessibility ---------- */
.ptt:not(#ptt-scope) .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

/* ---------- Standalone print page ---------- */
.ptt-print-body {
	margin: 0;
	padding: 24px;
	background: #fff;
	color: #111;
}
.ptt-print-body .ptt:not(#ptt-scope) { max-width: 1000px; margin: 0 auto; }
.ptt-print-toolbar { max-width: 1000px; margin: 0 auto 12px; text-align: right; }
.ptt-print-toolbar .ptt-btn {
	padding: 0.5em 1em;
	border: 0;
	border-radius: 6px;
	background: #0f6b5c;
	color: #fff;
	font: 600 14px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	cursor: pointer;
}

@media print {
	@page { size: A4 portrait; margin: 10mm; }
	.ptt-print-body { padding: 0; }
	.ptt-print-toolbar,
	.ptt:not(#ptt-scope) .ptt-controls { display: none !important; }
	.ptt:not(#ptt-scope) .ptt-scroll { overflow: visible; border: 1px solid #bbb; }
	.ptt:not(#ptt-scope) .ptt-table { font-size: 8.5pt; }
	.ptt:not(#ptt-scope) .ptt-table th,
	.ptt:not(#ptt-scope) .ptt-table td { padding: 2.2pt 3pt; }
	.ptt:not(#ptt-scope) .ptt-table thead th,
	.ptt:not(#ptt-scope) .ptt-table tbody tr:nth-child(even) td,
	.ptt:not(#ptt-scope) .ptt-table tbody tr.ptt-is-today td {
		-webkit-print-color-adjust: exact;
		print-color-adjust: exact;
	}
	.ptt:not(#ptt-scope) .ptt-table tbody tr.ptt-is-today td { background: transparent; font-weight: inherit; box-shadow: none; }
	.ptt:not(#ptt-scope).ptt-today { display: none; }
}
