/* Jawlany Child: design tokens shared with the Flutter app. */

@font-face {
	font-family: "Noto Kufi Arabic";
	/* woff2 is the same variable font cut to Arabic + Latin (126 KB instead of 424 KB). */
	src: url("../fonts/NotoKufiArabic-var.woff2") format("woff2"),
		url("../fonts/NotoKufiArabic-VariableFont_wght.ttf") format("truetype");
	font-weight: 100 900;
	font-display: swap;
}

:root {
	/* Brand */
	--jw-red: #b5121b;
	--jw-red-dark: #9a1a1e;
	--jw-red-tint: #fff1f2;
	--jw-navy: #083e5f;

	/* Neutrals */
	--jw-text: #111827;
	--jw-text-muted: #6b7280;
	--jw-border: #e5e7eb;
	--jw-surface: #f9fafb;
	--jw-bg: #ffffff;

	/* Shape and type */
	--jw-radius: 8px;
	--jw-radius-pill: 999px;
	--jw-font: "Noto Kufi Arabic", system-ui, sans-serif;
	--jw-gap: 1.25rem;

	/* Map onto GeneratePress global colours */
	--contrast: var(--jw-text);
	--contrast-2: var(--jw-text-muted);
	--base: var(--jw-border);
	--base-2: var(--jw-surface);
	--base-3: var(--jw-bg);
	--accent: var(--jw-red);
}

body,
button,
input,
select,
textarea {
	font-family: var(--jw-font);
	color: var(--jw-text);
}

body {
	background: var(--jw-surface);
	line-height: 1.8;
}

a {
	color: var(--jw-red);
}

a:hover,
a:focus {
	color: var(--jw-red-dark);
}

/* Header: red brand band, as on the current site and the app */
.site-header {
	background: var(--jw-red);
}

.site-header a,
.main-title a,
.main-navigation .main-nav ul li a {
	color: #fff;
}

/* Cards */
.jw-card,
.separate-containers .inside-article {
	background: var(--jw-bg);
	border: 1px solid var(--jw-border);
	border-radius: var(--jw-radius);
	overflow: hidden;
}

.jw-pill {
	display: inline-block;
	padding: 0.15em 0.75em;
	border-radius: var(--jw-radius-pill);
	background: var(--jw-red-tint);
	color: var(--jw-red);
	font-size: 0.8rem;
	font-weight: 600;
}

/* Photo gallery at the end of articles imported from the 2006–2013 site. */
.jw-archive-gallery {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: 8px;
	margin-top: 1.5em;
}
.jw-archive-gallery img {
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border-radius: var(--jw-radius, 8px);
}

/* Obituary details card (jawlany-obituaries). */
.jw-obit-details {
	display: grid;
	grid-template-columns: max-content 1fr;
	gap: 6px 16px;
	margin: 0 0 1.5em;
	padding: 16px;
	background: var(--jw-surface);
	border: 1px solid var(--jw-border);
	border-radius: var(--jw-radius);
}
.jw-obit-details dt { color: var(--jw-text-muted); margin: 0; }
.jw-obit-details dd { margin: 0; font-weight: 600; }

/* Rainfall season tables (jawlany-rainfall). */
.jw-rainfall-table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 2em;
}
.jw-rainfall-table th,
.jw-rainfall-table td {
	padding: 8px 12px;
	border-bottom: 1px solid var(--jw-border);
	text-align: right;
}
.jw-rainfall-table th { background: var(--jw-surface); color: var(--jw-red); }
.jw-rain-scroll { overflow-x: auto; }
.jw-rain-scroll .jw-rainfall-table { margin-bottom: 1em; min-width: 520px; }
.jw-rain-h { font-size: 1.15rem; margin: 1em 0 .5em; }
.jw-rain-bars { list-style: none; margin: 0 0 1.5em; padding: 0; display: grid; gap: 6px; }
.jw-rain-bars a { display: grid; grid-template-columns: 6.5em 1fr 6em; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-size: .9rem; }
.jw-rain-bar { height: 12px; background: var(--jw-surface); border-radius: 6px; overflow: hidden; }
.jw-rain-bar span { display: block; height: 100%; background: #2b7bbf; border-radius: 6px; }
.jw-rain-bars a:hover .jw-rain-bar span, .jw-rain-bars a:focus-visible .jw-rain-bar span { background: var(--jw-red); }
.jw-rain-bar-mm { color: var(--jw-text-muted); white-space: nowrap; }
.jw-rain-season { border: 1px solid var(--jw-border); border-radius: var(--jw-radius); margin-bottom: 10px; scroll-margin-top: 80px; }
.jw-rain-season > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 14px; cursor: pointer; font-weight: 700; list-style: none; }
.jw-rain-season > summary::-webkit-details-marker { display: none; }
.jw-rain-season > summary::before { content: "▾"; color: var(--jw-red); transition: transform .15s; }
.jw-rain-season[open] > summary::before { transform: rotate(180deg); }
.jw-rain-season[open] > summary { border-bottom: 1px solid var(--jw-border); }
.jw-rain-season small { font-weight: 400; color: var(--jw-text-muted); }
.jw-rain-days { font-weight: 400; font-size: .85rem; color: var(--jw-text-muted); margin-inline-start: auto; }
.jw-rain-season .jw-rainfall-table th, .jw-rain-season .jw-rainfall-table td { padding: 6px 12px; }

/* Ads from the shared ads API (jawlany-ads). Tight spacing: an ad shouldn't push content far down. */
.jw-ads-wrap { padding-top: 12px; }
.jw-ads { display: grid; gap: 8px; margin: 0; }
.entry-content .jw-ads { margin: 1em 0; }
.jw-ad { position: relative; display: block; border-radius: var(--jw-radius); overflow: hidden; }
/* Until the picture loads: a light shimmering box (never the alt text). */
.jw-ad {
	background-color: var(--jw-surface);
	background-image: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .55) 50%, transparent 70%);
	background-size: 200% 100%;
	background-repeat: no-repeat;
	box-shadow: inset 0 0 0 1px var(--jw-border);
	animation: jw-ad-wait 1.4s ease-in-out infinite;
}
@keyframes jw-ad-wait { from { background-position: 150% 0; } to { background-position: -50% 0; } }
@media (prefers-reduced-motion: reduce) { .jw-ad { animation: none; } }
html[data-jw-motion="reduce"] .jw-ad { animation: none; }
.jw-ad.is-loaded { animation: none; background: none; box-shadow: none; }
.jw-ad img {
	position: relative; display: block; width: 100%; height: 100%; object-fit: cover;
	color: transparent; font-size: 0; /* hides the alt text while loading or if the picture fails */
}
/* A slot with a "_mobile" version: computers see one, phones the other. */
.jw-ads-mobile { display: none; }
@media (max-width: 768px) {
	.jw-ads-desktop { display: none; }
	.jw-ads-mobile { display: grid; }
	.jw-ads-wrap { padding: 8px 12px 0; }
}
.jw-ad-label {
	position: absolute; top: 6px; left: 6px;
	padding: 1px 8px; font-size: 11px;
	background: rgba(0, 0, 0, .55); color: #fff; border-radius: var(--jw-radius-pill);
}
.jw-rain-season .jw-rainfall-table th,
.jw-rain-season .jw-rainfall-table td:not(:last-child) { white-space: nowrap; }
@media (max-width: 768px) {
	.jw-rain-season .jw-rainfall-table { font-size: .85rem; min-width: 0; }
	.jw-rain-season .jw-rainfall-table td:last-child { min-width: 14em; }
	.jw-rain-season .jw-rainfall-table th, .jw-rain-season .jw-rainfall-table td { padding: 6px 8px; }
	.jw-rain-bars a { grid-template-columns: 5.5em 1fr 5em; gap: 6px; font-size: .8rem; }
}
/* Weather panel (homepage and /rainfall/): this season's rain card beside the 7-day forecast. */
/* Weather */
.jw-weather-grid {
	display: grid;
	gap: var(--jw-gap);
	grid-template-columns: 1fr;
}

@media (min-width: 700px) {
	.jw-weather-grid { grid-template-columns: minmax(260px, 320px) minmax(0, 1fr); }
	.jw-weather-grid .jw-card { flex-direction: row; align-items: stretch; }
	.jw-weather-grid .jw-card { min-height: 250px; }
	.jw-weather-grid .jw-card-img { position: relative; flex: 0 0 58%; background: #fff; }
	/* Forecast charts carry text, so show the whole image rather than cropping it */
	.jw-weather-grid .jw-card-img img {
		position: absolute;
		inset: 0;
		width: 100%;
		height: 100%;
		aspect-ratio: auto;
		object-fit: contain;
	}
	.jw-weather-grid .jw-card-body {
		flex: 1;
		justify-content: center;
		padding: 1.25rem 1.5rem;
	}
	.jw-weather-grid .jw-card-title {
		font-size: 1.2rem;
	}
}

.jw-rain-card {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: .35rem;
	padding: 1.25rem 1.35rem;
	border-radius: var(--jw-radius);
	background: var(--jw-navy);
	color: #fff;
}

.jw-rain-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.jw-rain-card .jw-rain-title { opacity: 1; font-size: 1rem; font-weight: 700; }
.jw-rain-card .jw-rain-years { font-size: .85rem; opacity: .72; }
.jw-rain-total { margin: .35rem 0 0; font-size: 1.05rem; line-height: 1.7; }
.jw-rain-total b { font-weight: 700; white-space: nowrap; }

.jw-rain-card strong {
	font-size: 2.6rem;
	line-height: 1.15;
}

.jw-rain-card small {
	font-size: 1rem;
	font-weight: 400;
}

.jw-rain-card span {
	opacity: .85;
	font-size: .85rem;
}

.jw-rain-card .jw-rain-label {
	font-size: .8rem;
	opacity: .75;
}

.jw-rain-compare {
	margin-top: .6rem;
	padding-top: .75rem;
	border-top: 1px solid rgb(255 255 255 / .15);
}

.jw-rain-meter {
	height: 6px;
	border-radius: 999px;
	background: rgb(255 255 255 / .18);
	overflow: hidden;
}

.jw-rain-meter i {
	display: block;
	height: 100%;
	border-radius: inherit;
	background: #7cc4f0;
}

.jw-rain-compare dl {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: .5rem;
	margin: .6rem 0 0;
}

.jw-rain-compare dt {
	font-size: .72rem;
	opacity: .7;
}

.jw-rain-compare dd {
	margin: 0;
	font-size: .9rem;
	font-weight: 600;
}

/* Weather: live forecast beside the season card */
.jw-weather-forecast {
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-height: 200px;
	padding: .75rem 1rem;
	border-radius: var(--jw-radius);
	/* Same navy as the widget (jawlany_forecast_color) and the rain card: one panel, no white frame */
	background: #083e5f;
	color: #fff;
	overflow: hidden;
}

.jw-weather-forecast .weatherwidget-io {
	color: #fff;
}

.jw-weather-forecast .jw-forecast { margin: 0; }

/* 7-day forecast widget (weatherwidget.io); reserve its height so the page doesn't jump. */
.jw-forecast { margin-bottom: 1em; border-radius: var(--jw-radius); overflow: hidden; line-height: 0; }
.jw-forecast .weatherwidget-io { display: block; line-height: normal; }
.jw-forecast iframe { display: block; }

/* 7-day forecast graph (jawlany-rainfall forecast.php): white on the navy panel. */
.jw-fc { color: #fff; line-height: 1.4; padding: .75rem 1rem; background: #083e5f; border-radius: var(--jw-radius); }
.jw-weather-forecast .jw-fc { padding: 0; background: none; border-radius: 0; }
.jw-fc-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; margin-bottom: .5rem; }
.jw-fc-title { display: flex; flex-direction: column; }
.jw-fc-title strong { font-size: 1.05rem; }
.jw-fc-title span, .jw-fc-now small { font-size: .8rem; color: rgba(255, 255, 255, .72); }
.jw-fc-now { display: flex; align-items: center; gap: .5rem; }
.jw-fc-now strong { font-size: 2rem; font-weight: 700; line-height: 1; direction: ltr; }
.jw-fc-now span { display: flex; flex-direction: column; font-size: .9rem; }
.jw-fc-scroll { position: relative; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; }
/* Phones: the week scrolls sideways; a fade on the far edge shows there is more. */
.jw-fc-wrap { position: relative; }
.jw-fc-wrap::after { content: ""; position: absolute; inset-block: 0; inset-inline-end: 0; width: 28px; pointer-events: none; background: linear-gradient(to left, #083e5f, transparent); transition: opacity .2s; }
.jw-fc-wrap.is-end::after { opacity: 0; }
@media (min-width: 560px) { .jw-fc-wrap::after { display: none; } }
.jw-fc-scroll::-webkit-scrollbar { display: none; }
.jw-fc-chart { display: block; width: 100%; min-width: 500px; height: auto; font-family: inherit; }
.jw-fc-chart text { fill: #fff; text-anchor: middle; font-size: 15px; }
.jw-fc-day { font-weight: 600; fill: rgba(255, 255, 255, .85) !important; }
.jw-fc-day.is-today { fill: #fff !important; font-weight: 700; }
.jw-fc-sep { stroke: rgba(255, 255, 255, .08); }
.jw-fc-base { stroke: rgba(255, 255, 255, .18); }
.jw-fc-hi, .jw-fc-lo { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.jw-fc-hi { stroke: #ffb4a6; }
.jw-fc-lo { stroke: #8fd0ff; }
.jw-fc-hi-dot { fill: #ffb4a6; }
.jw-fc-lo-dot { fill: #8fd0ff; }
.jw-fc-t { font-weight: 700; font-size: 16px !important; direction: ltr; }
.jw-fc-bar { fill: #7cc7ff; }
.jw-fc-mm { font-size: 12px !important; fill: #cfeaff !important; direction: ltr; }
.jw-fc-chance { font-size: 12px !important; fill: rgba(255, 255, 255, .6) !important; direction: ltr; }
.jw-fc-legend { display: flex; flex-wrap: wrap; gap: .25rem 1rem; margin: .4rem 0 0; font-size: .75rem; color: rgba(255, 255, 255, .7); }
.jw-fc-legend span::before { content: ""; display: inline-block; width: 12px; height: 3px; margin-inline-end: .35rem; vertical-align: middle; border-radius: 2px; }
.jw-fc-key-hi::before { background: #ffb4a6; }
.jw-fc-key-lo::before { background: #8fd0ff; }
.jw-fc-key-rain::before { height: 8px !important; width: 6px !important; background: #7cc7ff; }
.jw-fc-legend a { margin-inline-start: auto; color: rgba(255, 255, 255, .6); text-decoration: none; }
.jw-fc-legend a:hover, .jw-fc-legend a:focus-visible { color: #fff; text-decoration: underline; }
@media (max-width: 768px) {
	.jw-fc-now strong { font-size: 1.6rem; }
}

/* Phones: smaller gaps everywhere (grids, cards, page edges). */
@media (max-width: 768px) {
	:root { --jw-gap: .75rem; }
	.site-main,
	.separate-containers .site-main { margin-block: 12px; }
}

/* Village buttons above the 7-day graph (homepage and /rainfall/) (jawlany_forecast_villages_chart). */
.jw-fcv-tabs { display: flex; gap: .35rem; margin-bottom: .6rem; overflow-x: auto; scrollbar-width: none; }
.jw-fcv-tabs::-webkit-scrollbar { display: none; }
.jw-fcv-tabs button { flex: 0 0 auto; padding: .3rem .8rem; border: 1px solid rgba(255, 255, 255, .25); border-radius: 999px; background: transparent; color: rgba(255, 255, 255, .85); font: inherit; font-size: .85rem; line-height: 1.4; cursor: pointer; }
.jw-fcv-tabs button:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.jw-fcv-tabs button[aria-selected="true"] { background: #fff; border-color: #fff; color: #083e5f; font-weight: 700; }
.jw-fcv-tabs button:focus-visible { outline: 2px solid #ffcf5c; outline-offset: 2px; }
