/* Islamic Hijri Date & Calendar - Frontend Styles
   Palette: deep emerald (#0E3B36), aged gold (#C6A15B), warm ivory (#FBF7EE), ink (#1C2620)
   Type: serif display for numerals/headers, clean sans for labels, dedicated Arabic face for RTL text
*/

.ihd-date-widget,
.ihd-calendar-wrapper {
	--ihd-emerald: #0e3b36;
	--ihd-emerald-dark: #082523;
	--ihd-gold: #c6a15b;
	--ihd-gold-light: #e4c988;
	--ihd-ivory: #fbf7ee;
	--ihd-ink: #1c2620;
	font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	box-sizing: border-box;
}

.ihd-date-widget *,
.ihd-calendar-wrapper * {
	box-sizing: border-box;
}

/* ---------- Date Widget ---------- */

.ihd-date-widget {
	display: inline-flex;
	align-items: center;
	gap: 14px;
	background: linear-gradient(135deg, var(--ihd-emerald) 0%, var(--ihd-emerald-dark) 100%);
	color: var(--ihd-ivory);
	padding: 18px 24px;
	border-radius: 4px;
	position: relative;
	overflow: hidden;
	max-width: 100%;
}

.ihd-date-widget::before {
	content: '';
	position: absolute;
	top: 0;
	right: 0;
	width: 90px;
	height: 90px;
	background-image: repeating-linear-gradient(
		45deg,
		rgba(198, 161, 91, 0.12) 0,
		rgba(198, 161, 91, 0.12) 2px,
		transparent 2px,
		transparent 10px
	);
	pointer-events: none;
}

.ihd-date-widget::after {
	content: '';
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 3px;
	background: var(--ihd-gold);
}

.ihd-style-inline {
	background: transparent;
	color: var(--ihd-ink);
	padding: 4px 0;
}

.ihd-style-inline::before,
.ihd-style-inline::after {
	display: none;
}

.ihd-style-minimal {
	background: var(--ihd-ivory);
	color: var(--ihd-ink);
	border: 1px solid rgba(198, 161, 91, 0.4);
	padding: 12px 18px;
}

.ihd-style-minimal::before {
	display: none;
}

.ihd-date-icon {
	font-size: 30px;
	line-height: 1;
	color: var(--ihd-gold-light);
	flex-shrink: 0;
}

.ihd-date-content {
	position: relative;
	z-index: 1;
}

.ihd-weekday {
	font-size: 11px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--ihd-gold-light);
	margin-bottom: 4px;
	opacity: 0.9;
}

.ihd-style-inline .ihd-weekday,
.ihd-style-minimal .ihd-weekday {
	color: var(--ihd-emerald);
}

.ihd-date-en {
	font-family: Georgia, 'Times New Roman', serif;
	font-size: 20px;
	font-weight: 600;
	letter-spacing: 0.01em;
}

.ihd-date-ar {
	font-family: 'Amiri', 'Noto Naskh Arabic', 'Traditional Arabic', serif;
	font-size: 18px;
	margin-top: 3px;
	color: var(--ihd-gold-light);
}

.ihd-style-inline .ihd-date-ar,
.ihd-style-minimal .ihd-date-ar {
	color: var(--ihd-emerald-dark);
}

/* ---------- Calendar (shared grid styles - used by [islamic_calendar] and [islamic_calendar_page]) ---------- */

.ihd-calendar-wrapper {
	max-width: 640px;
	margin: 0 auto;
}

.ihd-calendar {
	background: #ffffff;
	border: 1px solid #e2e7e3;
	border-radius: 10px;
	overflow: hidden;
	transition: opacity 0.15s ease;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.ihd-calendar-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: var(--ihd-emerald);
	padding: 16px 18px;
	position: relative;
}

.ihd-calendar-header::after {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 3px;
	background: repeating-linear-gradient(
		90deg,
		var(--ihd-gold) 0,
		var(--ihd-gold) 8px,
		transparent 8px,
		transparent 16px
	);
}

.ihd-calendar-title {
	text-align: center;
	color: var(--ihd-ivory);
	line-height: 1.4;
}

.ihd-month-en {
	display: block;
	font-family: Georgia, 'Times New Roman', serif;
	font-size: 18px;
	font-weight: 600;
	letter-spacing: 0.02em;
}

.ihd-month-ar {
	display: block;
	font-family: 'Amiri', 'Noto Naskh Arabic', serif;
	font-size: 15px;
	color: var(--ihd-gold-light);
	margin-top: 2px;
}

.ihd-nav-btn {
	background: transparent;
	border: 1px solid var(--ihd-gold);
	color: var(--ihd-gold-light);
	width: 34px;
	height: 34px;
	border-radius: 50%;
	cursor: pointer;
	font-size: 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s ease, color 0.2s ease;
	flex-shrink: 0;
}

.ihd-nav-btn:hover {
	background: var(--ihd-gold);
	color: var(--ihd-emerald-dark);
}

.ihd-nav-btn:focus-visible {
	outline: 2px solid var(--ihd-gold-light);
	outline-offset: 2px;
}

.ihd-calendar .ihd-cal-grid {
	padding: 16px 18px 6px;
}

/* Shared CSS-Grid based calendar body: 7 equal columns, no table/ul-li used
   anywhere so theme default styles for those elements can never leak in. */

.ihd-cal-grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 6px;
}

.ihd-cal-weekday {
	text-align: center;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #1a7f4b;
	padding: 6px 0 10px;
}

.ihd-cal-day-cell {
	background: #ffffff;
	border: 1px solid #e7ebe8;
	border-radius: 8px;
	text-align: center;
	padding: 10px 4px;
	min-height: 54px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 2px;
	transition: background 0.15s ease, transform 0.1s ease;
}

.ihd-cal-day-num {
	font-size: 16px;
	font-weight: 700;
	color: #1c2620;
	line-height: 1.2;
}

.ihd-cal-day-greg {
	font-size: 11px;
	color: #8a938d;
	line-height: 1.2;
}

.ihd-cal-empty {
	background: transparent;
	border-color: transparent;
}

.ihd-cal-today {
	background: #0e5c36;
	border-color: #0e5c36;
}

.ihd-cal-today .ihd-cal-day-num {
	color: #ffffff;
}

.ihd-cal-today .ihd-cal-day-greg {
	color: rgba(255, 255, 255, 0.75);
}

.ihd-cal-legend {
	padding: 12px 18px 16px;
	font-size: 12px;
	color: #6b7a71;
}

.ihd-cal-legend-dot {
	display: inline-block;
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: #0e5c36;
	margin-right: 5px;
	vertical-align: middle;
}

.ihd-calendar.ihd-loading {
	opacity: 0.5;
	pointer-events: none;
}

@media (max-width: 480px) {
	.ihd-cal-day-cell {
		min-height: 44px;
		padding: 6px 2px;
		border-radius: 6px;
	}

	.ihd-cal-day-num {
		font-size: 13px;
	}

	.ihd-cal-day-greg {
		font-size: 9px;
	}
}

/* ---------- Pakistan-style Bilingual Date Card ---------- */

.ihd-pk-card {
	--ihd-pk-green: #1a5c3a;
	--ihd-pk-green-tint: #eef6f0;
	--ihd-pk-ink: #1c2620;
	--ihd-pk-muted: #6b7a71;
	--ihd-pk-border: #e2e7e3;
	font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	background: #ffffff;
	border: 1px solid var(--ihd-pk-border);
	border-radius: 10px;
	max-width: 680px;
	margin: 0 auto;
	overflow: hidden;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.ihd-pk-card * {
	box-sizing: border-box;
}

.ihd-pk-header {
	background: var(--ihd-pk-green-tint);
	padding: 20px 24px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 10px;
	border-bottom: 1px solid var(--ihd-pk-border);
}

.ihd-pk-title-en {
	font-size: 22px;
	font-weight: 700;
	color: var(--ihd-pk-green);
}

.ihd-pk-title-ur {
	font-family: 'Noto Nastaliq Urdu', 'Jameel Noori Nastaliq', 'Amiri', serif;
	font-size: 20px;
	font-weight: 700;
	color: var(--ihd-pk-green);
}

.ihd-pk-table {
	padding: 6px 24px;
}

.ihd-pk-row {
	display: flex;
	align-items: center;
	padding: 16px 0;
	border-bottom: 1px dashed var(--ihd-pk-border);
	gap: 12px;
}

.ihd-pk-row:last-child {
	border-bottom: none;
}

.ihd-pk-labels {
	padding: 10px 0;
}

.ihd-pk-cell {
	flex: 1;
}

.ihd-pk-label-en {
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.06em;
	color: var(--ihd-pk-muted);
}

.ihd-pk-label-mid {
	flex: 1.4;
}

.ihd-pk-label-ur {
	font-family: 'Noto Nastaliq Urdu', 'Jameel Noori Nastaliq', 'Amiri', serif;
	font-size: 15px;
	font-weight: 600;
	color: var(--ihd-pk-muted);
	text-align: right;
}

.ihd-pk-key {
	font-size: 15px;
	font-weight: 700;
	color: var(--ihd-pk-ink);
}

.ihd-pk-key-ur {
	font-family: 'Noto Nastaliq Urdu', 'Jameel Noori Nastaliq', 'Amiri', serif;
	font-size: 16px;
	font-weight: 700;
	color: var(--ihd-pk-ink);
	text-align: right;
}

.ihd-pk-val {
	flex: 1.4;
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 3px;
}

.ihd-pk-val-en {
	font-size: 16px;
	font-weight: 700;
	color: var(--ihd-pk-ink);
}

.ihd-pk-val-ur {
	font-family: 'Noto Nastaliq Urdu', 'Jameel Noori Nastaliq', 'Amiri', serif;
	font-size: 17px;
	font-weight: 600;
	color: var(--ihd-pk-ink);
}

.ihd-pk-footer {
	background: #fafbfa;
	border-top: 1px solid var(--ihd-pk-border);
	padding: 14px 24px;
	text-align: center;
	font-size: 13px;
	color: var(--ihd-pk-muted);
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	flex-wrap: wrap;
}

.ihd-pk-footer-ur {
	font-family: 'Noto Nastaliq Urdu', 'Jameel Noori Nastaliq', 'Amiri', serif;
	font-size: 14px;
}

.ihd-pk-footer-dot {
	color: var(--ihd-pk-green);
	opacity: 0.5;
}

@media (max-width: 520px) {
	.ihd-pk-header {
		flex-direction: column;
		align-items: flex-start;
	}

	.ihd-pk-row {
		flex-wrap: wrap;
	}

	.ihd-pk-key,
	.ihd-pk-key-ur {
		flex-basis: 45%;
	}

	.ihd-pk-val {
		flex-basis: 100%;
		order: 3;
		padding-top: 6px;
	}
}

/* ---------- Islamic Calendar Page ([islamic_calendar_page]) ---------- */

.ihd-cal-page {
	--ihd-cal-emerald: #0e5c36;
	--ihd-cal-emerald-dark: #082523;
	--ihd-cal-gold: #c6a15b;
	--ihd-cal-gold-dark: #a9812f;
	--ihd-cal-gold-light: #e4c988;
	--ihd-cal-ivory: #fbf7ee;
	--ihd-cal-ink: #1c2620;
	--ihd-cal-border: #e2e7e3;
	--ihd-cal-muted: #6b7a71;
	font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	max-width: 1100px;
	margin: 0 auto;
}

.ihd-cal-page,
.ihd-cal-page * {
	box-sizing: border-box;
}

.ihd-cal-page-title {
	font-family: Georgia, 'Times New Roman', serif;
	font-size: 26px;
	font-weight: 700;
	color: var(--ihd-cal-emerald);
	margin: 0 0 16px;
	text-align: center;
}

/* Dynamic "days left until Ramadan" banner - always about today's real date,
   sits outside the AJAX-swapped area so it stays put while browsing other months. */

.ihd-cal-banner {
	background: #eaf7ef;
	border-left: 4px solid var(--ihd-cal-emerald);
	border-radius: 8px;
	padding: 14px 18px;
	margin-bottom: 18px;
}

.ihd-cal-banner p {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
	color: var(--ihd-cal-emerald);
}

.ihd-cal-page-inner {
	transition: opacity 0.15s ease;
	border: 1px solid var(--ihd-cal-border);
	border-radius: 12px;
	overflow: hidden;
	background: #fff;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.ihd-cal-page-inner.ihd-loading {
	opacity: 0.5;
	pointer-events: none;
}

/* Year bar */

.ihd-cal-year-bar {
	background: var(--ihd-cal-emerald);
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 22px;
	padding: 16px 20px;
	position: relative;
}

.ihd-cal-year-bar::after {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 3px;
	background: repeating-linear-gradient(
		90deg,
		var(--ihd-cal-gold) 0,
		var(--ihd-cal-gold) 8px,
		transparent 8px,
		transparent 16px
	);
}

.ihd-cal-year-label {
	text-align: center;
	color: var(--ihd-cal-ivory);
	min-width: 140px;
}

.ihd-cal-year-en {
	display: block;
	font-family: Georgia, 'Times New Roman', serif;
	font-size: 19px;
	font-weight: 700;
	letter-spacing: 0.02em;
}

.ihd-cal-year-ar {
	display: block;
	font-family: 'Amiri', 'Noto Naskh Arabic', serif;
	font-size: 15px;
	color: var(--ihd-cal-gold-light);
	margin-top: 2px;
}

.ihd-cal-prev-year,
.ihd-cal-next-year {
	background: transparent;
	border: 1px solid var(--ihd-cal-gold);
	color: var(--ihd-cal-gold-light);
	width: 36px;
	height: 36px;
	border-radius: 50%;
	cursor: pointer;
	font-size: 17px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s ease, color 0.2s ease;
	flex-shrink: 0;
}

.ihd-cal-prev-year:hover,
.ihd-cal-next-year:hover {
	background: var(--ihd-cal-gold);
	color: var(--ihd-cal-emerald-dark);
}

.ihd-cal-prev-year:focus-visible,
.ihd-cal-next-year:focus-visible {
	outline: 2px solid var(--ihd-cal-gold-light);
	outline-offset: 2px;
}

/* Body: sidebar (30%) + main grid (70%). Div-based throughout on purpose -
   no <ul>/<li>/<table>, so a theme's default list/table CSS can never leak in
   and break the layout (this was the bug in the previous table/list version). */

.ihd-cal-page-body {
	display: flex;
	align-items: stretch;
}

.ihd-cal-sidebar {
	flex: 0 0 30%;
	max-width: 30%;
	background: var(--ihd-cal-ivory);
	border-right: 1px solid var(--ihd-cal-border);
	padding: 14px 0;
	max-height: 620px;
	overflow-y: auto;
}

.ihd-cal-sidebar-title {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--ihd-cal-muted);
	padding: 0 20px 10px;
}

.ihd-cal-month-list {
	display: flex;
	flex-direction: column;
	gap: 3px;
	padding: 0 10px;
}

.ihd-cal-month-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 11px 12px;
	cursor: pointer;
	border-radius: 8px;
	transition: background 0.15s ease, color 0.15s ease;
}

.ihd-cal-month-item:hover {
	background: rgba(198, 161, 91, 0.14);
}

.ihd-cal-month-item.active {
	background: var(--ihd-cal-emerald);
}

.ihd-cal-month-num {
	font-family: Georgia, 'Times New Roman', serif;
	font-size: 12px;
	color: var(--ihd-cal-gold-dark);
	font-weight: 700;
	flex-shrink: 0;
	width: 20px;
}

.ihd-cal-month-item.active .ihd-cal-month-num {
	color: var(--ihd-cal-gold-light);
}

.ihd-cal-month-name {
	font-size: 14px;
	font-weight: 600;
	color: var(--ihd-cal-ink);
}

.ihd-cal-month-item.active .ihd-cal-month-name {
	color: #ffffff;
}

.ihd-cal-main {
	flex: 1 1 70%;
	max-width: 70%;
	padding: 22px 24px;
}

.ihd-cal-month-header {
	display: flex;
	align-items: baseline;
	justify-content: flex-end;
	gap: 10px;
	margin-bottom: 16px;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--ihd-cal-border);
	flex-wrap: wrap;
}

.ihd-cal-month-title-en {
	font-family: Georgia, 'Times New Roman', serif;
	font-size: 19px;
	font-weight: 700;
	color: var(--ihd-cal-gold-dark);
}

.ihd-cal-month-title-ur {
	font-family: 'Amiri', 'Noto Naskh Arabic', serif;
	font-size: 16px;
	color: var(--ihd-cal-gold);
}

/* Grid cells inside the calendar page reuse the shared .ihd-cal-grid /
   .ihd-cal-day-cell rules defined in the Calendar section above. */

.ihd-cal-main .ihd-cal-weekday {
	color: var(--ihd-cal-emerald);
}

.ihd-cal-main .ihd-cal-today {
	background: var(--ihd-cal-emerald);
	border-color: var(--ihd-cal-emerald);
}

.ihd-cal-main .ihd-cal-legend-dot {
	background: var(--ihd-cal-emerald);
}

/* Responsive - mobile: sidebar becomes a horizontal scroll strip on top, grid below */

@media (max-width: 720px) {
	.ihd-cal-page-body {
		flex-direction: column;
	}

	.ihd-cal-sidebar {
		flex: 1 1 auto;
		max-width: 100%;
		max-height: none;
		border-right: none;
		border-bottom: 1px solid var(--ihd-cal-border);
		overflow-x: auto;
		overflow-y: visible;
		padding: 10px 0;
	}

	.ihd-cal-sidebar-title {
		padding: 0 14px 8px;
	}

	.ihd-cal-month-list {
		flex-direction: row;
		padding: 0 10px;
	}

	.ihd-cal-month-item {
		flex-shrink: 0;
		white-space: nowrap;
	}

	.ihd-cal-main {
		max-width: 100%;
		padding: 18px 14px;
	}

	.ihd-cal-month-header {
		justify-content: center;
		text-align: center;
	}

	.ihd-cal-year-bar {
		gap: 14px;
	}
}

/* ---------- Responsive ---------- */

@media (max-width: 480px) {
	.ihd-date-widget {
		padding: 14px 16px;
	}

	.ihd-date-en {
		font-size: 17px;
	}

	.ihd-date-ar {
		font-size: 15px;
	}
}
