/**
 * Utility pages: Unicode converter, Rashifal, BS calendar + date converter (D-53).
 * Uses the theme's custom properties, with fallbacks. Selectors are doubled up (.rashifal .x) where
 * the theme's .entry-content heading/list/table rules would otherwise win.
 */

/* Unicode converter */
.unicode-converter {
	display: grid;
	gap: var(--s-4, 16px);
}
@media (min-width: 768px) {
	.unicode-converter { grid-template-columns: 1fr 1fr; }
}
.unicode-converter__pane { display: grid; gap: var(--s-2, 8px); }
.unicode-converter label {
	color: var(--heading, #082577);
	font-weight: 700;
}
.unicode-converter textarea {
	width: 100%;
	min-height: 220px;
	padding: var(--s-3, 12px);
	border: 1px solid var(--line-strong, #8a94a6);
	border-radius: var(--radius-lg, 8px);
	background: var(--bg, #fff);
	color: var(--ink, #0b1220);
	font-size: var(--fs-body, 1.1rem);
	line-height: 1.7;
	resize: vertical;
}
.unicode-converter textarea[readonly] { background: var(--bg-soft, #f5f7fa); }
.unicode-converter textarea:focus-visible { outline: 2px solid var(--blue, #0B5ED3); outline-offset: 1px; }
.unicode-converter__actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--s-2, 8px);
}
@media (min-width: 768px) {
	.unicode-converter__actions { grid-column: 1 / -1; }
}

/* Rashifal */
.rashifal__date {
	margin: 0 0 var(--s-5, 24px);
	color: var(--muted, #5f6b7a);
}
.rashifal__note { color: var(--muted, #5f6b7a); }
.rashifal .rashifal__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
	gap: var(--gutter, 24px);
	margin: 0;
	padding: 0;
	list-style: none;
}
.rashifal .rashifal__sign {
	margin: 0;
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 0 var(--s-3, 12px);
	align-content: start;
	padding: var(--s-4, 16px);
	border: 1px solid var(--line, #e3e8ef);
	border-radius: var(--radius, 4px);
	scroll-margin-top: calc(var(--sticky-h, 56px) + 16px);
}
.rashifal__symbol {
	grid-row: span 2;
	display: grid;
	place-items: center;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: var(--tint, #EAF3FF);
	color: var(--blue, #0B5ED3);
	font-size: var(--fs-3, 1.5rem);
	line-height: 1;
}
.rashifal .rashifal__name {
	margin: 0;
	color: var(--heading, #082577);
	font-size: var(--fs-4, 1.25rem);
}
.rashifal .rashifal__letters {
	margin: 0;
	color: var(--muted, #5f6b7a);
	font-size: var(--fs-7, 0.875rem);
}
.rashifal .rashifal__text {
	grid-column: 1 / -1;
	margin: var(--s-3, 12px) 0 0;
	color: var(--text, #2b303b);
	line-height: var(--lh-ui, 1.6);
}

/* BS calendar */
.patro__head {
	display: flex;
	align-items: center;
	gap: var(--s-3, 12px);
	margin-bottom: var(--s-3, 12px);
}
.patro .patro__head h2 {
	flex: 1;
	margin: 0;
	color: var(--heading, #082577);
	font-size: var(--fs-3, 1.5rem);
	text-align: center;
}
.patro__head h2 small {
	display: block;
	color: var(--muted, #5f6b7a);
	font: 500 var(--fs-7, 0.875rem) / 1.4 var(--font-ui, sans-serif);
}
.patro .patro__grid {
	width: 100%;
	border-collapse: separate;
	border-spacing: 4px;
	table-layout: fixed;
}
.patro .patro__grid th {
	border: 0;
	background: none;
	padding-inline: 4px;
	overflow: hidden;
	color: var(--muted, #5f6b7a);
	font: 500 var(--fs-7, 0.875rem) / 1.4 var(--font-ui, sans-serif);
	white-space: nowrap;
}
/* Full weekday names need ~90px a cell (English "Wednesday" plus padding); when the calendar is narrower than 700px show the short form and keep the full name for screen readers. */
.patro { container-type: inline-size; }
.patro__wd-short { display: none; }
@container (max-width: 699px) {
	.patro__wd-long {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
	}
	.patro__wd-short { display: inline; }
}
@container (max-width: 419px) {
	.patro .patro__grid th { padding-inline: 0; text-align: center; }
}
.patro .patro__grid td {
	border: 0;
	height: 64px;
	padding: 6px 8px;
	border-radius: var(--radius, 4px);
	background: var(--bg-soft, #f5f7fa);
	vertical-align: top;
}
.patro__grid td:empty { background: none; }
.patro__bs {
	display: block;
	color: var(--heading, #082577);
	font-size: var(--fs-4, 1.25rem);
	font-weight: 700;
	line-height: 1.2;
}
.patro__ad {
	display: block;
	color: var(--muted, #5f6b7a);
	font: 500 var(--fs-7, 0.875rem) / 1.4 var(--font-ui, sans-serif);
	text-align: right;
}
.patro__grid .is-holiday,
.patro__grid .is-holiday .patro__bs { color: var(--live, #D5040A); }
.patro__grid .is-today { outline: 2px solid var(--brand, #D5040A); outline-offset: -2px; background: var(--bg, #fff); }
.patro__note {
	color: var(--muted, #5f6b7a);
	font-size: var(--fs-7, 0.875rem);
}
@media (max-width: 479px) {
	.patro__grid { border-spacing: 2px; }
	.patro__grid td { height: 52px; padding: 4px; }
	.patro__bs { font-size: var(--fs-6, 1rem); }
}

/* Date converter */
.date-converter {
	margin-top: var(--s-7, 48px);
	scroll-margin-top: calc(var(--sticky-h, 56px) + 16px);
}
.patro .date-converter h2 {
	margin-top: 0;
	color: var(--heading, #082577);
	font-size: var(--fs-4, 1.25rem);
}
.date-converter__result {
	padding: var(--s-3, 12px) var(--s-4, 16px);
	border-radius: var(--radius, 4px);
	background: var(--tint, #EAF3FF);
	color: var(--heading, #082577);
	font-weight: 700;
}
.date-converter__forms {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
	gap: var(--gutter, 24px);
}
.date-converter form {
	display: grid;
	gap: var(--s-2, 8px);
	align-content: start;
	padding: var(--s-4, 16px);
	border: 1px solid var(--line, #e3e8ef);
	border-radius: var(--radius, 4px);
}
.patro .date-converter h3 { margin: 0; font-size: var(--fs-5, 1.0625rem); }
.date-converter input,
.date-converter select {
	min-height: 44px;
	padding: 0 var(--s-2, 8px);
	border: 1px solid var(--line-strong, #8a94a6);
	border-radius: var(--radius, 4px);
	background: var(--bg, #fff);
	color: var(--ink, #0b1220);
}
.date-converter__bs {
	display: grid;
	grid-template-columns: 1.2fr 1.5fr 1fr;
	gap: var(--s-2, 8px);
}
.date-converter__bs input,
.date-converter__bs select { width: 100%; }
.date-converter button { justify-self: start; }

/* Team ([ainn_team], Phase 12) */
.entry-content .team-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
	gap: var(--gutter, 24px);
	margin: var(--s-6, 24px) 0;
	padding: 0;
	list-style: none;
}
.entry-content .team-card {
	display: flex;
	gap: var(--s-4, 16px);
	align-items: flex-start;
	margin: 0;
	padding: var(--s-4, 16px);
	border: 1px solid var(--line, #e3e8ef);
	border-radius: var(--radius-lg, 8px);
}
.team-card__avatar { flex: none; }
.entry-content .team-card__name { margin: 0; font-size: var(--fs-5, 1.0625rem); }
.entry-content .team-card__name a { color: var(--heading, #082577); text-decoration: none; }
.entry-content .team-card__name a:hover { text-decoration: underline; }
.entry-content .team-card__position { margin: 2px 0 0; color: var(--brand-ink, #A30509); font-size: var(--fs-7, 0.875rem); font-weight: 700; }
.entry-content .team-card__bio { margin: var(--s-2, 8px) 0 0; color: var(--muted, #5b6472); font-size: var(--fs-7, 0.875rem); }
