/* Weekly Russian Timeline — "НОВОСТИ НЕДЕЛИ"
 * Central spine, navy date circles with white condensed numbers,
 * alternating text / image rows, gold "Читать далее" link and accent bar.
 * Mirrors the Figma design (IDSF / Битахонисты). Collapses to a single
 * left-spine column on mobile.
 */

/* ====================================================================
 * THEME ISOLATION
 * Re-asserts the plugin's own styling with !important so the active
 * WordPress theme (e.g. ".entry-content h2/h3/a/p" rules) cannot
 * override the timeline on the front end.
 * ================================================================== */
.wrt-head,
.wrt-head *,
.wrt-timeline,
.wrt-timeline *,
.wrt-modal,
.wrt-modal * {
	box-sizing: border-box !important;
	font-family: "Oswald", "Arial Narrow", system-ui, sans-serif !important;
	text-shadow: none !important;
	float: none !important;
}

.wrt-head a,
.wrt-timeline a,
.wrt-modal a,
.wrt-head a:hover,
.wrt-timeline a:hover,
.wrt-modal a:hover,
.wrt-head a:focus,
.wrt-timeline a:focus,
.wrt-modal a:focus {
	text-decoration: none !important;
	box-shadow: none !important;
}

/* Structural wrappers stay transparent / unstyled */
.wrt-timeline,
.wrt-head,
.wrt-head__main,
.wrt-week-nav,
.wrt-row,
.wrt-row__text,
.wrt-row__center,
.wrt-row__media {
	background: transparent !important;
	border: 0 !important;
	box-shadow: none !important;
}

.wrt-timeline ul,
.wrt-timeline ol,
.wrt-head ul,
.wrt-head ol {
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
}

.wrt-row__image img {
	border: 0 !important;
	box-shadow: none !important;
	max-width: 100% !important;
}

/* Re-assert the text styling the theme is most likely to hijack */
.wrt-row__title {
	margin: 0 0 0.55rem !important;
	color: var(--wrt-navy) !important;
	font-weight: 600 !important;
	font-size: clamp(20px, 2vw, 28px) !important;
	line-height: 1.15 !important;
}

.wrt-row__excerpt {
	margin: 0 0 0.85rem !important;
	color: var(--wrt-muted) !important;
	font-weight: 300 !important;
	font-size: clamp(15px, 1.4vw, 18px) !important;
	line-height: 1.5 !important;
}

.wrt-row__more {
	color: var(--wrt-gold) !important;
}

.wrt-row__date {
	color: #ffffff !important;
	font-weight: 600 !important;
}

.wrt-head__title {
	margin: 0 !important;
	color: #21334f !important;
	font-weight: 700 !important;
	font-size: clamp(38px, 6vw, 80px) !important;
	line-height: 0.95 !important;
	text-transform: uppercase !important;
}

.wrt-head__dates {
	color: #ecb61e !important;
}

/* Popup title + text (theme h3/p rules try to resize these too) */
.wrt-modal__title {
	margin: 0 0 16px !important;
	color: #21334f !important;
	font-weight: 600 !important;
	font-size: clamp(20px, 2vw, 28px) !important;
	line-height: 1.15 !important;
}

.wrt-modal__text,
.wrt-modal__text p,
.wrt-modal__text li {
	color: #41506a !important;
	font-weight: 300 !important;
	font-size: clamp(15px, 1.4vw, 18px) !important;
	line-height: 1.5 !important;
}

/* ================================================================== */

.wrt-timeline {
	--wrt-navy: #21334f;
	--wrt-gold: #ecb61e;
	--wrt-text: #21334f;
	--wrt-muted: #41506a;
	--wrt-spine: rgba(33, 51, 79, 0.22);

	position: relative;
	max-width: 1180px;
	margin: 2.5rem auto;
	padding: 1rem 1rem 2rem;
	box-sizing: border-box;
	direction: ltr;
	font-family: "Oswald", "Arial Narrow", system-ui, sans-serif;
}

.wrt-timeline *,
.wrt-timeline *::before,
.wrt-timeline *::after {
	box-sizing: border-box;
}

/* One continuous central line running the full height of the timeline.
 * Columns are symmetric (below) so every circle sits exactly on it. */
.wrt-timeline__spine {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 50%;
	width: 64px;
	transform: translateX(-50%);
	background: var(--wrt-gold);
	border-radius: 10px;
	z-index: 0;
}

/* ---- Header ("НОВОСТИ НЕДЕЛИ") ---- */
.wrt-head {
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	gap: 28px;
	max-width: 1180px;
	margin: 0 auto;
	padding: 1.75rem 1rem 1.25rem;
	box-sizing: border-box;
	direction: ltr;
	font-family: "Oswald", "Arial Narrow", sans-serif;
}

.wrt-head * {
	box-sizing: border-box;
}

.wrt-head__title {
	margin: 0;
	font-weight: 700;
	font-size: clamp(38px, 6vw, 80px);
	line-height: 0.95;
	letter-spacing: 0.01em;
	text-transform: uppercase;
	color: #21334f;
}

.wrt-head__dates {
	margin-top: 0.5rem;
	font-weight: 500;
	font-size: clamp(17px, 2vw, 26px);
	color: #ecb61e;
}

.wrt-head__actions {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 18px;
	padding-bottom: 6px;
	flex: 0 0 auto;
}

.wrt-head__home {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	color: #21334f;
	font-weight: 500;
	font-size: clamp(15px, 1.4vw, 19px);
	text-decoration: none;
}

.wrt-head__home:hover {
	color: #16263d;
}

.wrt-head a.wrt-head__subscribe,
.wrt-head a.wrt-head__subscribe:hover,
.wrt-head a.wrt-head__subscribe:focus,
.wrt-head a.wrt-head__subscribe:active {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	background: #21334f;
	color: #ecb61e;
	font-weight: 600;
	font-size: clamp(15px, 1.3vw, 18px);
	line-height: 1.1;
	padding: 15px 28px;
	border-radius: 40px;
	text-decoration: none;
}

.wrt-head a.wrt-head__subscribe:hover,
.wrt-head a.wrt-head__subscribe:focus {
	background: #16263d;
}

/* Keep the label gold even if the theme restyles link text on hover */
.wrt-head__subscribe span,
.wrt-head__subscribe:hover span {
	color: #ecb61e;
}

.wrt-head__icon {
	color: #ecb61e;
	flex: 0 0 auto;
}

/* ---- Row ---- */
.wrt-row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 205px minmax(0, 1fr);
	align-items: stretch;
	column-gap: 30px;
	margin: 0 0 28px;
	padding: 44px 0;
}

.wrt-row--text-left {
	grid-template-areas: "text center media";
}

.wrt-row--text-right {
	grid-template-areas: "media center text";
}

.wrt-row__text {
	grid-area: text;
	display: flex;
	flex-direction: column;
}

.wrt-row__center {
	grid-area: center;
}

.wrt-row__media {
	grid-area: media;
	position: relative;
	width: 100%;
	max-width: 440px;
	align-self: start; /* pin the image to the top so it lines up with the title */
}

/* Push the image to the OUTER edge so it lines up with the header boundary
 * (and with the text on the opposite side). */
.wrt-row--text-left .wrt-row__media {
	justify-self: end;
}

.wrt-row--text-right .wrt-row__media {
	justify-self: start;
}

/* Both rows: text starts at the top, level with the image top. */
.wrt-row--text-left .wrt-row__text,
.wrt-row--text-right .wrt-row__text {
	text-align: left;
	justify-content: flex-start;
}

/* ---- Text block ---- */
.wrt-row__title {
	margin: 0 0 0.55rem;
	font-weight: 600;
	font-size: clamp(20px, 2vw, 28px);
	line-height: 1.15;
	letter-spacing: 0.01em;
	color: var(--wrt-navy);
}

.wrt-row__title a {
	color: inherit;
	text-decoration: none;
}

.wrt-row__title a:hover {
	color: #16263d;
}

.wrt-row__excerpt {
	margin: 0 0 0.85rem;
	font-weight: 300;
	font-size: clamp(15px, 1.4vw, 18px);
	line-height: 1.5;
	color: var(--wrt-muted);
	/* Clamp so the text block stays close to the image height */
	display: -webkit-box;
	-webkit-line-clamp: 5;
	line-clamp: 5;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.wrt-row__more {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	margin-top: 0.2rem; /* sits right after the text */
	font-family: inherit;
	font-weight: 500;
	font-size: clamp(15px, 1.3vw, 18px);
	color: var(--wrt-gold);
	text-decoration: none;
	letter-spacing: 0.02em;
	/* it is a <button> now — reset native button chrome */
	background: none;
	border: 0;
	padding: 0;
	cursor: pointer;
}

.wrt-row__more:hover {
	color: #d6a312;
}

/* "Читать далее" sits at the right side of the text block in both directions. */
.wrt-row--text-left .wrt-row__more,
.wrt-row--text-right .wrt-row__more {
	align-self: flex-end;
}

.wrt-row__more:hover {
	color: #d6a312;
}

.wrt-row__arrow {
	font-size: 1.1em;
	line-height: 1;
}

/* ---- Center spine + date circle ---- */
.wrt-row__center {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 150px;
}

.wrt-row__circle {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 122px;
	height: 122px;
	border-radius: 50%;
	background: var(--wrt-navy);
	box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.35);
}

.wrt-row__date {
	font-weight: 600;
	font-size: 32px;
	line-height: 1;
	color: #fff;
	letter-spacing: -0.01em;
}

/* ---- Media (image / video) ---- */
.wrt-row__image {
	position: relative;
	display: block;
	width: 100%;
	border-radius: 10px;
	overflow: hidden;
	/* it is a <button> now */
	border: 0;
	padding: 0;
	background: none;
	cursor: pointer;
}

.wrt-row__image img {
	display: block;
	width: 100%;
	height: auto; /* keep the image's original proportion */
}

/* Gold accent bar at the bottom-left of the image */
.wrt-row__accent {
	position: absolute;
	left: 0;
	bottom: 14px;
	width: 108px;
	height: 8px;
	background: var(--wrt-gold);
	border-radius: 0 4px 4px 0;
}

/* Responsive 16:9 video embed */
.wrt-row__video {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	border-radius: 10px;
	overflow: hidden;
	background: #000;
}

/* Vertical videos (Facebook Reels / Shorts) */
.wrt-row__video--vertical {
	aspect-ratio: 9 / 16;
	max-width: 300px;
	margin-inline: auto;
}

.wrt-row__video iframe,
.wrt-row__video video,
.wrt-row__video embed,
.wrt-row__video object {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.wrt-row__video video {
	object-fit: contain;
	background: #000;
}

/* ---- Empty state ---- */
.wrt-timeline--empty {
	text-align: center;
	color: var(--wrt-muted);
}

/* ---- Preview banner + draft badge ---- */
.wrt-preview-banner {
	max-width: 1180px;
	margin: 1rem auto 0;
	padding: 0.75rem 1rem;
	background: #fff4e5;
	border: 1px solid var(--wrt-gold);
	border-radius: 8px;
	color: #8a4b00;
	font-weight: 600;
	text-align: center;
	font-family: "Oswald", sans-serif;
}

.wrt-row__badge {
	position: absolute;
	top: 10px;
	left: 10px;
	z-index: 3;
	background: #b32d2e;
	color: #fff;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	padding: 3px 9px;
	border-radius: 4px;
}

.wrt-row--draft .wrt-row__image,
.wrt-row--draft .wrt-row__video {
	outline: 2px dashed var(--wrt-gold);
	outline-offset: 3px;
}

/* ---- Week navigation ---- */
.wrt-week-nav {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 16px;
}

.wrt-head .wrt-week-nav__btn,
.wrt-head .wrt-week-nav__btn:hover,
.wrt-head .wrt-week-nav__btn:focus {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	background: #21334f;
	color: #fff;
	font-weight: 500;
	font-size: clamp(14px, 1.2vw, 16px);
	padding: 9px 18px;
	border-radius: 30px;
	text-decoration: none;
	line-height: 1;
}

.wrt-head .wrt-week-nav__btn:hover {
	background: #16263d;
}

/* ---- Read-more popup ---- */
.wrt-row__full {
	display: none;
}

.wrt-modal[hidden] {
	display: none;
}

.wrt-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.wrt-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.62);
}

.wrt-modal__dialog {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 760px;
	max-height: 86vh;
	overflow: auto;
	background: #fff;
	border-radius: 14px;
	padding: 30px 32px 34px;
	font-family: "Oswald", "Arial Narrow", sans-serif;
	box-shadow: 0 20px 60px rgba(15, 23, 42, 0.35);
	direction: ltr;
	text-align: left;
}

.wrt-modal .wrt-modal__close,
.wrt-modal .wrt-modal__close:hover,
.wrt-modal .wrt-modal__close:focus {
	position: absolute;
	top: 14px;
	right: 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	margin: 0;
	padding: 0 0 3px;
	border: 0;
	border-radius: 50%;
	background: #21334f;
	color: #ecb61e;
	font-size: 28px;
	line-height: 1;
	font-family: "Oswald", sans-serif;
	cursor: pointer;
	box-shadow: none;
	-webkit-appearance: none;
	appearance: none;
	transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.wrt-modal .wrt-modal__close:hover,
.wrt-modal .wrt-modal__close:focus {
	background: #ecb61e;
	color: #21334f;
	transform: rotate(90deg);
}

.wrt-modal__title {
	margin: 0 0 16px;
	font-weight: 600;
	font-size: clamp(20px, 2vw, 28px); /* same as the timeline title */
	line-height: 1.15;
	color: #21334f;
}

.wrt-modal__body img {
	max-width: 100%;
	height: auto;
	border-radius: 8px;
	margin: 0 0 16px;
}

.wrt-modal__video {
	position: relative;
	aspect-ratio: 16 / 9;
	margin: 0 0 16px;
	border-radius: 8px;
	overflow: hidden;
	background: #000;
}

.wrt-modal__video iframe,
.wrt-modal__video video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.wrt-modal__text {
	font-weight: 300;
	font-size: clamp(15px, 1.4vw, 18px); /* same as the timeline description */
	line-height: 1.5;
	color: #41506a;
}

.wrt-modal__text p {
	margin: 0 0 1em;
}

/* ---- Mobile: single left-spine column ---- */
@media (max-width: 860px) {
	.wrt-head {
		flex-direction: column;
		align-items: flex-start;
		gap: 18px;
	}

	.wrt-head__actions {
		flex-direction: row;
		flex-wrap: wrap;
		align-items: center;
		align-self: stretch;
	}

	.wrt-timeline__spine {
		left: 42px;
		width: 12px;
		transform: translateX(-50%);
	}

	.wrt-row,
	.wrt-row--text-left,
	.wrt-row--text-right {
		grid-template-columns: 56px 1fr;
		grid-template-areas:
			"center media"
			"center text";
		column-gap: 16px;
		row-gap: 12px;
		align-items: start;
		padding: 12px 0;
	}

	.wrt-row--text-left .wrt-row__media,
	.wrt-row--text-right .wrt-row__media {
		justify-self: stretch;
		max-width: 100%;
	}

	.wrt-row--text-left .wrt-row__text,
	.wrt-row--text-right .wrt-row__text {
		text-align: left;
	}

	.wrt-row__center {
		min-width: 0;
		align-self: stretch;
		justify-content: flex-start;
	}

	.wrt-row__circle {
		width: 52px;
		height: 52px;
		box-shadow: 0 0 0 4px #fff;
		margin-top: 4px;
	}

	.wrt-row__date {
		font-size: 16px;
	}

	.wrt-row__media {
		margin-top: 2px;
	}
}
