/* Homepage sections (inc/home.php), plus the cards and lists that other pages reuse. */

.home .site-content .content-area { width: 100%; }

.jw-home-section {
	margin: 0 0 1.5rem;
}

.jw-section-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: .65rem;
	border-bottom: 2px solid var(--jw-red);
}

.jw-section-head h2 {
	margin: 0;
	padding-bottom: .3rem;
	font-size: 1.15rem;
	font-weight: 700;
}
.jw-section-head h2 a { color: inherit; text-decoration: none; }
.jw-section-head h2 a:hover, .jw-section-head h2 a:focus-visible { color: var(--jw-red); text-decoration: underline; text-underline-offset: .2em; }

.jw-more {
	font-size: .875rem;
	text-decoration: none;
}

/* Cards */
.jw-card {
	display: flex;
	flex-direction: column;
	margin: 0;
}

.jw-card-img img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

/* Obituary without a photo: quiet placeholder in the same frame */
.jw-card-noimg {
	display: grid;
	place-items: center;
	aspect-ratio: 16 / 9;
	background: var(--jw-surface);
	color: var(--jw-text-muted);
	border: 1px solid var(--jw-border);
	border-radius: inherit;
}

.jw-card-noimg svg {
	width: 40px;
	height: 40px;
	opacity: .6;
}

.jw-card-compact .jw-card-noimg {
	aspect-ratio: 1;
	border-radius: calc(var(--jw-radius) - 2px);
}

.jw-card-compact .jw-card-noimg svg {
	width: 28px;
	height: 28px;
}

.jw-card-body {
	padding: .75rem 1rem 1rem;
}

.jw-card-title {
	margin: .35rem 0;
	font-size: 1.05rem;
	line-height: 1.6;
	font-weight: 700;
}

.jw-card-title a {
	color: var(--jw-text);
	text-decoration: none;
}

.jw-card-title a:hover,
.jw-card-title a:focus {
	color: var(--jw-red);
}

.jw-card-date {
	color: var(--jw-text-muted);
	font-size: .8rem;
}

.jw-card-excerpt {
	color: var(--jw-text-muted);
	margin: .25rem 0 .5rem;
}

.jw-pill {
	display: inline-block;
	padding: .1rem .65rem;
	border-radius: var(--jw-radius-pill);
	background: var(--jw-red-tint);
	color: var(--jw-red);
	font-size: .75rem;
	text-decoration: none;
}

.jw-card-lead .jw-card-title {
	font-size: 1.5rem;
}

.jw-card-compact {
	flex-direction: row;
	align-items: center;
	gap: .75rem;
	padding: .5rem;
}

.jw-card-compact .jw-card-img {
	flex: 0 0 96px;
}

.jw-card-compact .jw-card-img img {
	aspect-ratio: 1;
	border-radius: calc(var(--jw-radius) - 2px);
}

.jw-card-compact .jw-card-body {
	padding: 0;
}

.jw-card-compact .jw-card-title {
	font-size: .95rem;
	margin: 0 0 .15rem;
}

/* Hero: lead story with its image full size and the title on it, four more beside it. */
.jw-hero {
	display: grid;
	gap: var(--jw-gap);
	grid-template-columns: 1fr;
}

.jw-hero-lead {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	min-height: 300px;
	border-radius: var(--jw-radius);
	overflow: hidden;
	background: var(--jw-red-dark);
	color: #fff;
	isolation: isolate;
}

.jw-hero-img {
	position: absolute;
	inset: 0;
	z-index: -2;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .5s ease;
}

.jw-hero-lead:hover .jw-hero-img {
	transform: scale(1.03);
}

/* Dark fade under the text so the title reads on any photo. */
.jw-hero-lead::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: linear-gradient(to top, rgba(0, 0, 0, .88) 0%, rgba(0, 0, 0, .55) 38%, rgba(0, 0, 0, 0) 68%);
}

.jw-hero-lead.no-image::before {
	display: none;
}

.jw-hero-body {
	padding: 1.25rem 1.5rem 1.4rem;
}

.jw-hero-lead .jw-pill {
	position: relative;
	z-index: 1;
	background: var(--jw-red);
	color: #fff;
}

.jw-hero-title {
	margin: .5rem 0 .4rem;
	font-size: 1.85rem;
	line-height: 1.45;
	font-weight: 700;
	text-wrap: balance;
}

html .jw-hero-title a,
html .jw-hero-title a:hover,
html .jw-hero-title a:focus {
	color: #fff;
	text-decoration: none;
}

/* Whole card clickable. */
.jw-hero-title a::after {
	content: "";
	position: absolute;
	inset: 0;
}

.jw-hero-title a:focus-visible {
	outline: none;
}

.jw-hero-lead:focus-within {
	outline: 3px solid var(--jw-red);
	outline-offset: 2px;
}

.jw-hero-excerpt {
	margin: 0 0 .6rem;
	max-width: 62ch;
	color: rgba(255, 255, 255, .88);
	font-size: .95rem;
	line-height: 1.8;
}

.jw-hero-lead time {
	color: rgba(255, 255, 255, .75);
	font-size: .8rem;
}

/* Side list: one panel, rows share the hero's height. */
.jw-hero-side {
	display: flex;
	flex-direction: column;
	background: var(--jw-bg);
	border: 1px solid var(--jw-border);
	border-radius: var(--jw-radius);
	overflow: hidden;
}

.jw-hero-list {
	flex: 1;
	display: grid;
	grid-auto-rows: 1fr;
	list-style: none;
	margin: 0;
	padding: 0;
}

.jw-hero-list li + li {
	border-top: 1px solid var(--jw-border);
}

.jw-hero-list a {
	display: flex;
	align-items: center;
	gap: .85rem;
	height: 100%;
	padding: .75rem 1rem;
	color: var(--jw-text);
	text-decoration: none;
}

.jw-hero-list a:hover,
.jw-hero-list a:focus-visible {
	background: var(--jw-surface);
}

.jw-hero-list a:hover strong,
.jw-hero-list a:focus-visible strong {
	color: var(--jw-red);
}

.jw-hero-thumb {
	flex: 0 0 84px;
}

.jw-hero-thumb img {
	display: block;
	width: 84px;
	height: 84px;
	object-fit: cover;
	border-radius: calc(var(--jw-radius) - 2px);
}

.jw-hero-item {
	display: grid;
	gap: .25rem;
	min-width: 0;
}

.jw-hero-item strong {
	font-size: .98rem;
	line-height: 1.6;
	font-weight: 700;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.jw-hero-item time {
	color: var(--jw-text-muted);
	font-size: .78rem;
}

.jw-hero-more {
	display: block;
	padding: .6rem 1rem;
	border-top: 1px solid var(--jw-border);
	font-size: .85rem;
	font-weight: 700;
	text-decoration: none;
	color: var(--jw-red);
}

.jw-hero-more::after {
	content: " ←";
}

@media (min-width: 900px) {
	.jw-hero {
		grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
	}

	.jw-hero-lead {
		min-height: 500px;
	}
}

@media (max-width: 600px) {
	.jw-hero-lead {
		min-height: 0;
		aspect-ratio: 4 / 5;
		max-height: 75vh;
	}

	.jw-hero-body {
		padding: 1rem;
	}

	.jw-hero-title {
		font-size: 1.3rem;
	}

	.jw-hero-excerpt {
		display: none;
	}

	.jw-hero-thumb,
	.jw-hero-thumb img {
		flex-basis: 72px;
		width: 72px;
		height: 72px;
	}
}

/* عاجل strip: only rendered while flashes are fresh (inc/home.php). */
.jw-flash {
	display: flex;
	align-items: flex-start;
	gap: .85rem;
	margin-bottom: .75rem;
	padding: .5rem .85rem;
	background: var(--jw-bg);
	border: 1px solid var(--jw-border);
	border-inline-start: 4px solid var(--jw-red);
	border-radius: var(--jw-radius);
}

.jw-flash-label {
	flex: none;
	display: inline-flex;
	align-items: center;
	gap: .4rem;
	padding: .15rem .7rem;
	border-radius: var(--jw-radius-pill);
	background: var(--jw-red);
	color: #fff;
	font-size: .85rem;
	font-weight: 700;
}

/* Live dot; it stops when the reader asks for less motion. */
.jw-flash-label i {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #fff;
	animation: jw-pulse 1.6s ease-in-out infinite;
}

@keyframes jw-pulse {
	50% { opacity: .25; }
}

@media (prefers-reduced-motion: reduce) {
	.jw-flash-label i { animation: none; }
}

.jw-flash ul {
	display: grid;
	gap: .35rem;
	margin: 0;
	padding: .1rem 0 0;
	list-style: none;
	min-width: 0;
}

.jw-flash li {
	line-height: 1.6;
}

.jw-flash li strong,
.jw-flash li a {
	font-weight: 700;
	color: var(--jw-text);
}

.jw-flash li a {
	text-decoration: underline;
	text-decoration-color: var(--jw-red);
	text-underline-offset: 4px;
}

.jw-flash li a:hover,
.jw-flash li a:focus {
	color: var(--jw-red);
}

.jw-flash time {
	margin-inline-start: .5rem;
	color: var(--jw-red);
	font-size: .78rem;
	white-space: nowrap;
}

/* «خدمات جولاني»: its own tinted band with a title, five equal tiles (icon + name) in one row */
.jw-home-services {
	--jw-strip: var(--jw-red-tint);
	padding-block: 1.2rem 1.4rem;
	background: var(--jw-strip);
	box-shadow: 0 0 0 100vmax var(--jw-strip);
	clip-path: inset(0 -100vmax);
}
.jw-services {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: .75rem;
}
.jw-services > li { min-width: 0; }
.jw-services a {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: .55rem;
	height: 100%;
	padding: 1rem .5rem .9rem;
	background: var(--jw-bg);
	border: 1px solid rgb(181 18 27 / .12);
	border-radius: 12px;
	box-shadow: 0 1px 2px rgb(17 24 39 / .05);
	color: var(--jw-text);
	text-align: center;
	text-decoration: none;
	transition: border-color .15s, box-shadow .15s, transform .15s;
}
.jw-service-icon {
	flex: none;
	display: grid;
	place-items: center;
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background: var(--jw-red-tint);
	color: var(--jw-red);
	transition: background .15s, color .15s;
}
.jw-service-icon svg {
	width: 26px;
	height: 26px;
}
.jw-service-name {
	max-width: 100%;
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.35;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.jw-service-short { display: none; }
.jw-services a:hover,
.jw-services a:focus-visible {
	border-color: var(--jw-red);
	box-shadow: 0 6px 18px rgb(17 24 39 / .08);
	transform: translateY(-2px);
}
.jw-services a:hover .jw-service-icon,
.jw-services a:focus-visible .jw-service-icon {
	background: var(--jw-red);
	color: #fff;
}
/* Phones and small tablets: still one row of five, smaller tiles with the short names
   (الدليل، السوق، الأعراس، الأمطار، الوظائف, as in the bottom bar). The full name stays for screen readers. */
@media (max-width: 640px) {
	.jw-home-services { padding-block: .9rem 1rem; }
	.jw-services { gap: .4rem; }
	.jw-services a { gap: .4rem; padding: .7rem .15rem .6rem; border-radius: 10px; }
	.jw-service-icon { width: 42px; height: 42px; }
	.jw-service-icon svg { width: 22px; height: 22px; }
	.jw-service-name { font-size: .8rem; }
	.jw-service-name.has-short .jw-service-full {
		position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
	}
	.jw-service-short { display: inline; }
}

.jw-obit-list,
.jw-wed-list {
	list-style: none;
	margin: 0;
	padding: 0;
	background: var(--jw-bg);
	border: 1px solid var(--jw-border);
	border-radius: var(--jw-radius);
}

.jw-obit-list li,
.jw-wed-list li {
	border-bottom: 1px solid var(--jw-border);
}

.jw-obit-list li:last-child,
.jw-wed-list li:last-child {
	border-bottom: 0;
}

.jw-obit-list a {
	display: flex;
	flex-direction: column;
	padding: .65rem 1rem;
	color: var(--jw-text);
	text-decoration: none;
}

.jw-obit-list a:hover strong,
.jw-obit-list a:focus strong {
	color: var(--jw-red);
}

.jw-obit-list span {
	color: var(--jw-text-muted);
	font-size: .8rem;
}

.jw-wed-list li {
	display: flex;
	align-items: center;
	gap: 1rem;
	padding: .55rem 1rem;
}

.jw-wed-list time {
	flex: 0 0 4rem;
	display: flex;
	flex-direction: column;
	align-items: center;
	color: var(--jw-red);
	font-size: .75rem;
	line-height: 1.3;
}

.jw-wed-list time span {
	font-size: 1.35rem;
	font-weight: 700;
}

/* Full-width colour strips: the background runs edge to edge, the content stays in the column */
.jw-home-weather,
.jw-home-videos,
.jw-home-archive {
	--jw-strip: #eef0f3; /* neutral grey: the page stays red, white and grey; navy only in the weather cards */
	padding-block: 1.4rem;
	background: var(--jw-strip);
	box-shadow: 0 0 0 100vmax var(--jw-strip);
	clip-path: inset(0 -100vmax);
}

.jw-home-videos {
	--jw-strip: #3a0b0f;
	color: #fff;
}

.jw-home-videos .jw-section-head {
	border-bottom-color: rgb(255 255 255 / .35);
}

.jw-home-videos .jw-section-head h2 {
	color: #fff;
}

.jw-home-videos .jw-video {
	box-shadow: 0 8px 24px rgb(0 0 0 / .25);
}

.jw-home-videos a:focus-visible {
	outline-color: #fff;
}

.jw-home-videos .jw-video-rail {
	scrollbar-color: rgb(255 255 255 / .35) transparent;
}

/* Opinion with a narrow side column */
.jw-with-aside {
	display: grid;
	gap: var(--jw-gap);
}

@media (min-width: 900px) {
	.jw-with-aside {
		grid-template-columns: minmax(0, 1fr) 320px;
		align-items: stretch;
	}
	.jw-with-aside-main {
		display: flex;
		flex-direction: column;
	}
	.jw-with-aside-main .jw-grid-2 {
		flex: 1;
		grid-auto-rows: 1fr;
	}
	.jw-onthisday {
		align-self: stretch;
	}
}

.jw-grid-2 {
	display: grid;
	gap: .75rem;
}

@media (min-width: 600px) {
	.jw-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.jw-opinion {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
}

.jw-opinion p {
	margin: 0 0 .75rem;
	color: var(--jw-text-muted);
	font-size: .85rem;
	line-height: 1.7;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.jw-opinion time {
	margin-top: auto;
	color: var(--jw-text-muted);
	font-size: .78rem;
}

.jw-opinion::before {
	content: "”";
	position: absolute;
	inset-inline-end: .9rem;
	top: .2rem;
	font-size: 3rem;
	line-height: 1;
	color: var(--jw-navy);
	opacity: .15;
	pointer-events: none;
}

.jw-onthisday {
	padding: 1rem 1.1rem;
	background: var(--jw-bg);
	border: 1px solid var(--jw-border);
	border-radius: var(--jw-radius);
}

.jw-onthisday .jw-section-head h2 {
	font-size: 1.05rem;
}

.jw-onthisday-date {
	color: var(--jw-text-muted);
	font-size: .8rem;
}

.jw-onthisday ol {
	list-style: none;
	margin: 0;
	padding: 0;
}

.jw-onthisday li + li {
	border-top: 1px dashed var(--jw-border);
}

.jw-onthisday a {
	display: flex;
	gap: .75rem;
	align-items: baseline;
	padding: .6rem 0;
	color: var(--jw-text);
	text-decoration: none;
	font-size: .9rem;
	line-height: 1.6;
}

.jw-onthisday span {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.jw-onthisday a:hover span,
.jw-onthisday a:focus-visible span {
	color: var(--jw-red);
}

.jw-onthisday b {
	flex: none;
	min-width: 3.2em;
	padding: .1rem .4rem;
	border-radius: 6px;
	background: var(--jw-red-tint);
	color: var(--jw-red);
	font-size: .78rem;
	text-align: center;
}

/* Opinion */
.jw-grid-4 {
	display: grid;
	gap: .75rem;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.jw-opinion {
	padding: 1rem;
	background: var(--jw-bg);
	border: 1px solid var(--jw-border);
	border-top: 3px solid var(--jw-navy);
	border-radius: var(--jw-radius);
}

.jw-opinion h3 {
	margin: 0 0 .5rem;
	font-size: 1rem;
	line-height: 1.6;
}

.jw-opinion h3 a {
	color: var(--jw-text);
	text-decoration: none;
}

.jw-opinion span {
	color: var(--jw-text-muted);
	font-size: .8rem;
}

/* Videos: horizontal rail */
.jw-video-rail {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: minmax(240px, 1fr);
	gap: .75rem;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	padding-bottom: .5rem;
}

.jw-video {
	position: relative;
	display: block;
	scroll-snap-align: start;
	border-radius: var(--jw-radius);
	overflow: hidden;
	background: #000;
	color: #fff;
	text-decoration: none;
}

.jw-video img {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	opacity: .85;
}

.jw-video.is-short img {
	aspect-ratio: 9 / 16;
	max-height: 320px;
}

.jw-video-play {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	font-size: 2rem;
	text-shadow: 0 2px 8px rgba(0, 0, 0, .6);
}

.jw-video-title {
	position: absolute;
	inset-inline: 0;
	bottom: 0;
	padding: 1.5rem .75rem .5rem;
	background: linear-gradient(transparent, rgba(0, 0, 0, .8));
	font-size: .9rem;
	line-height: 1.5;
}

.jw-video:hover,
.jw-video:focus {
	color: #fff;
}

/* «من الأرشيف»: old photos on a warm paper strip */
.jw-home-archive {
	--jw-strip: #f4ede1;
	--jw-text-muted: #5c544a; /* 4.5:1 on the paper colour */
}

.jw-section-sub {
	margin: .15rem 0 0;
	color: var(--jw-text-muted);
	font-size: .85rem;
}

.jw-archive-rail {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: minmax(220px, 1fr);
	gap: .75rem;
	margin: 0;
	padding: 0 0 .5rem;
	list-style: none;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
}

.jw-archive-rail li {
	scroll-snap-align: start;
}

.jw-archive-photo {
	display: block;
	height: 100%;
	padding: .5rem .5rem .75rem;
	background: var(--jw-bg);
	border-radius: 4px;
	box-shadow: 0 4px 14px rgb(60 40 20 / .14);
	color: var(--jw-text);
	text-decoration: none;
}

.jw-archive-photo img {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border-radius: 2px;
	filter: sepia(.18);
	transition: filter .2s;
}

.jw-archive-photo:hover img,
.jw-archive-photo:focus-visible img {
	filter: none;
}

.jw-archive-cap {
	display: block;
	padding-top: .5rem;
}

.jw-archive-title {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	font-size: .9rem;
	font-weight: 600;
	line-height: 1.55;
}

.jw-archive-photo:hover .jw-archive-title {
	color: var(--jw-red);
}

.jw-archive-meta {
	display: block;
	margin-top: .2rem;
	color: var(--jw-text-muted);
	font-size: .8rem;
}

@media (prefers-reduced-motion: reduce) {
	.jw-archive-photo img { transition: none; }
}

/* Category blocks */
.jw-cat-blocks {
	display: grid;
	gap: 1.5rem var(--jw-gap);
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

/* Each category is one panel: lead story on top, then hairline-separated rows */
.jw-cat-block {
	display: grid;
	grid-template-rows: auto 1fr;
	align-content: start;
}

.jw-cat-block-body {
	background: var(--jw-bg);
	border: 1px solid var(--jw-border);
	border-radius: var(--jw-radius);
	overflow: hidden;
}

.jw-cat-block .jw-card {
	border: 0;
	border-radius: 0;
}

.jw-cat-block .jw-card + .jw-card {
	border-top: 1px solid var(--jw-border);
}

.jw-cat-block .jw-card-compact {
	padding: .65rem .85rem;
}

.jw-cat-block .jw-card-compact .jw-card-img {
	flex-basis: 76px;
}

.jw-cat-block .jw-card:not(.jw-card-compact) .jw-card-body {
	padding: .6rem .85rem .75rem;
}

.jw-cat-block .jw-card:not(.jw-card-compact) .jw-card-title {
	margin: 0 0 .25rem;
}

.jw-cat-block .jw-section-head {
	margin-bottom: 0;
}

/* Visible keyboard focus everywhere on the page */
.jw-home-section a:focus-visible {
	outline: 2px solid var(--jw-red);
	outline-offset: 2px;
}

/* Inside a category block the category pill repeats the heading */
.jw-cat-block .jw-pill {
	display: none;
}

/* Phones: side gutter */
@media (max-width: 768px) {
	.home .site-main {
		padding-inline: 12px;
	}
	.jw-card-lead .jw-card-title {
		font-size: 1.25rem;
	}
	.jw-video.is-short img {
		max-height: 260px;
	}
}

@media (max-width: 600px) {
	/* Wide, not square, so the first screen shows more than one story (app: ~16:10). */
	.jw-hero-lead {
		aspect-ratio: 3 / 2;
	}

	.jw-flash {
		flex-wrap: wrap;
		gap: .45rem;
		padding: .55rem .7rem;
	}

	.jw-flash-label {
		font-size: .78rem;
		padding: .1rem .6rem;
	}

	.jw-flash ul {
		flex-basis: 100%;
		gap: .45rem;
		padding: 0;
	}

	.jw-flash li {
		font-size: .92rem;
		line-height: 1.55;
	}

	/* Phones: the newest flash only. */
	.jw-flash li + li {
		display: none;
	}
}

/* High contrast: strips go back to the plain page colours */
html[data-jw-contrast="high"] .jw-home-weather,
html[data-jw-contrast="high"] .jw-home-videos,
html[data-jw-contrast="high"] .jw-home-archive {
	--jw-strip: var(--jw-bg);
	color: var(--jw-text);
}
html[data-jw-contrast="high"] .jw-home-videos .jw-section-head h2 {
	color: var(--jw-text);
}

/* Phones: shorter category panels (lead story + two rows) */
@media (max-width: 768px) {
	.jw-home-section { margin-bottom: 1.25rem; }
	.jw-home-weather,
	.jw-home-videos { padding-block: 1.1rem; }
	.jw-cat-block .jw-card:nth-of-type(n+4) { display: none; }
}

/* حدث في مثل هذا اليوم */
.jw-onthisday {
	display: flex;
	flex-direction: column;
}

.jw-onthisday ol:focus-visible {
	outline: 2px solid var(--jw-red);
	outline-offset: 2px;
}

/* Phones and tablets: no scrolling box inside the page (a finger dragging on it got stuck
   at its end and the page seemed to stop). The first six show; «كل أخبار … من الأرشيف»
   under the list opens the rest. */
@media (max-width: 899px) {
	.jw-onthisday li:nth-child(n+7) { display: none; }
}

@media (min-width: 900px) {
	/* Computers: the box takes the opinion column's height and the longer list scrolls
	   inside it (mouse wheel). At its end the wheel carries on scrolling the page. */
	.jw-onthisday { contain: size; min-height: 22rem; }
	.jw-onthisday ol {
		flex: 1 1 0;
		min-height: 0;
		overflow-y: auto;
		scrollbar-width: thin;
		padding-inline-end: .35rem;
		margin-inline-end: -.35rem;
	}
}

/* Reels and videos: two rails in the one burgundy strip */
.jw-video-group + .jw-video-group { margin-top: 1.25rem; }
.jw-video-rail.is-reels { grid-auto-columns: 172px; }
.jw-video-rail.is-reels .jw-video.is-short img { max-height: none; }
.jw-video-rail.is-reels .jw-video-title { font-size: .82rem; }

@media (max-width: 600px) {
	.jw-video-rail.is-reels { grid-auto-columns: 140px; }
}
.jw-onthisday-more { display: block; margin-top: .5rem; padding-top: .5rem; border-top: 1px solid var(--jw-border); font-size: .85rem; text-align: center; }

/* «الكاتب» on opinion cards */
.jw-card-writer,
.jw-opinion-writer {
	display: block;
	margin: -.1rem 0 .35rem;
	color: var(--jw-navy);
	font-size: .85rem;
	font-weight: 600;
	text-decoration: none;
}
.jw-card-writer:hover, .jw-card-writer:focus-visible,
.jw-opinion-writer:hover, .jw-opinion-writer:focus-visible { color: var(--jw-red); text-decoration: underline; }

/* ---- Rails (old photos, videos): no scrollbar, arrows on computers, swipe/drag ---- */
.jw-rail { position: relative; }
.jw-rail-track {
	scrollbar-width: none;
	overscroll-behavior-x: contain;
	padding-bottom: 0 !important;
}
.jw-rail-track::-webkit-scrollbar { display: none; }
.jw-rail-track.is-dragging { cursor: grabbing; scroll-snap-type: none; user-select: none; }
.jw-rail-track.is-dragging a { pointer-events: none; }

.jw-rail-btn {
	position: absolute;
	top: 50%;
	z-index: 2;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--jw-bg);
	color: var(--jw-text);
	box-shadow: 0 4px 14px rgb(0 0 0 / .18);
	cursor: pointer;
	transform: translateY(-50%);
	transition: opacity .2s, background .2s, color .2s;
}
.jw-rail-back { inset-inline-start: 8px; }
.jw-rail-more { inset-inline-end: 8px; }
.jw-rail-btn:hover,
.jw-rail-btn:focus-visible { background: var(--jw-red); color: #fff; }
.jw-rail-btn:disabled { opacity: 0; pointer-events: none; }
.jw-rail.is-static .jw-rail-btn { display: none; }

/* A soft fade on the side that has more to see. */
.jw-rail::before,
.jw-rail::after {
	content: "";
	position: absolute;
	inset-block: 0;
	z-index: 1;
	width: 48px;
	pointer-events: none;
	transition: opacity .2s;
}
.jw-rail::before { inset-inline-start: 0; background: linear-gradient(to left, var(--jw-strip, var(--jw-surface)), transparent); }
.jw-rail::after { inset-inline-end: 0; background: linear-gradient(to right, var(--jw-strip, var(--jw-surface)), transparent); }
[dir="ltr"] .jw-rail::before { background: linear-gradient(to right, var(--jw-strip, var(--jw-surface)), transparent); }
[dir="ltr"] .jw-rail::after { background: linear-gradient(to left, var(--jw-strip, var(--jw-surface)), transparent); }
.jw-rail.is-start::before,
.jw-rail.is-end::after,
.jw-rail.is-static::before,
.jw-rail.is-static::after { opacity: 0; }

/* Phones and tablets: swipe, no buttons. */
@media (hover: none), (max-width: 768px) {
	.jw-rail-btn { display: none; }
	.jw-rail::before, .jw-rail::after { width: 28px; }
}
@media (prefers-reduced-motion: reduce) {
	.jw-rail-track { scroll-behavior: auto; }
}

/* Phones: tighter spacing so sections read as one flow, not separate islands. */
@media (max-width: 768px) {
	.jw-home-section { margin-bottom: .9rem; }
	.jw-home-weather,
	.jw-home-videos,
	.jw-home-archive { padding-block: .9rem; }
	.jw-section-head { margin-bottom: .5rem; }
	.jw-hero-list a { padding: .55rem .75rem; gap: .7rem; }
	.jw-hero-body { padding: 12px; }
	.jw-opinion,
	.jw-onthisday { padding: .75rem; }
	.jw-rain-card { padding: 14px; }
	.jw-cat-blocks { row-gap: 1rem; }
	.jw-video-group + .jw-video-group { margin-top: .9rem; }
}

/* Opinion cards: the writer's portrait large at the side (like a column photo), then the
   writer, the title and the date. No excerpt: the bigger photo and title carry the card. */
.jw-opinion { flex-direction: row; align-items: stretch; justify-content: flex-start; gap: .9rem; padding: .85rem; border-top: 1px solid var(--jw-border); border-inline-start: 3px solid var(--jw-navy); }
.jw-opinion::before { top: auto; bottom: .1rem; inset-inline-end: .75rem; font-size: 3.5rem; }
.jw-opinion-media { flex: 0 0 96px; display: block; line-height: 0; }
.jw-opinion-photo { display: block; width: 96px; height: 116px; border-radius: var(--jw-radius); object-fit: cover; object-position: center 15%; background: var(--jw-surface); }
.jw-opinion .jw-opinion-initial { display: grid; place-items: center; color: #fff; background: var(--jw-navy); font-weight: 700; font-size: 2rem; line-height: 1; }
.jw-opinion-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.jw-opinion-body .jw-opinion-writer { margin: 0 0 .2rem; font-size: .9rem; line-height: 1.5; }
.jw-opinion h3 { margin: 0 0 .4rem; font-size: 1.02rem; line-height: 1.65; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.jw-opinion h3 a:hover, .jw-opinion h3 a:focus-visible { color: var(--jw-red); }
.jw-opinion-body time { margin-top: auto; color: var(--jw-text-muted); font-size: .78rem; }
@media (max-width: 600px) {
	.jw-opinion-media { flex-basis: 84px; }
	.jw-opinion-photo { width: 84px; height: 100px; }
	.jw-opinion h3 { font-size: .98rem; }
}

