/* -----------------------------------------------------------------------
   Branded content category archive (category-branded.php).

   Ink and gold, the same two colours single-branded.php is drawn in — the
   palette is redeclared here rather than read from singles.css, which this
   page does not load. The hero's artwork is light only (a gold wash and one
   slow sweep across a dark plane): the brands supply the photography, and
   the section's job is to frame it, not to compete with it.

   The cards carry no publish time on purpose — see the template's docblock.
   ----------------------------------------------------------------------- */
.branded-archive {
	--branded-ink: #14141b;
	--branded-ink-soft: #23232d;
	--branded-sun: #ffd43b;
	--branded-sun-deep: #f5a623;

	/* Cancel .site-content's top padding so the disclosure strip meets the
	   site header with no seam, exactly as the single does. */
	margin-block-start: calc(-1 * var(--shivuk-space));
}

/* The site header goes dark on the branded archive so it and the hero read as
   one ink plane rather than the everyday blue bar on top of a dark section.
   `body:has()` reaches the header (a sibling that precedes #content) from the
   .branded-archive wrapper this stylesheet only loads alongside. The ink/gold
   literals mirror the --branded-* palette above, which is scoped to
   .branded-archive and so cannot reach the header. */
body:has(.branded-archive) .site-header {
	background:
		radial-gradient(60% 130% at 88% 0%, rgba(255, 212, 59, 0.12), transparent 60%),
		linear-gradient(165deg, #23232d, #14141b);
}

body:has(.branded-archive) .site-header--sticky.is-scrolled {
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
}

body:has(.branded-archive) .header-cta {
	background: linear-gradient(90deg, #ffd43b, #f5a623);
	color: #14141b;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

body:has(.branded-archive) .header-cta:hover,
body:has(.branded-archive) .header-cta:focus {
	color: #14141b;
	box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45);
}

/* On the branded archive the site tagline becomes a section label: the Hebrew
   site-description collapses (font-size:0) and a gold "Branded Content" takes
   its place beside the logo — the gold ties it to the hero below. */
body:has(.branded-archive) .site-description {
	font-size: 0;
}

body:has(.branded-archive) .site-description::after {
	content: "Branded Content";
	display: inline-block;
	direction: ltr;
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	color: #ffd43b;
}

/* -----------------------------------------------------------------------
   Hero
   ----------------------------------------------------------------------- */
.branded-archive__hero {
	position: relative;
	padding-block: clamp(2.75rem, 7vw, 5rem);
	background: var(--branded-ink-soft);
	color: #ffffff;
	overflow: hidden;
	/* Own stacking context so the negative-z artwork below can never escape
	   behind the page itself. */
	isolation: isolate;
	text-align: center;
}

.branded-archive__hero *:focus-visible {
	outline-color: #ffffff;
}

.branded-archive__stage {
	position: absolute;
	inset: 0;
	z-index: -1;
}

/* The wash: gold warming the top of the plane, strongest where the tag and
   the headline sit. */
.branded-archive__glow {
	position: absolute;
	inset: 0;
	background:
		radial-gradient(900px 420px at 50% -12%, rgba(255, 212, 59, 0.16), transparent 62%),
		radial-gradient(600px 320px at 12% 108%, rgba(245, 166, 35, 0.1), transparent 66%);
}

/* One highlight travelling the plane, very slowly — the gloss of foil on a
   printed cover. It is the only movement on the page, and at 19s it reads as
   light rather than as animation. */
.branded-archive__sweep {
	position: absolute;
	inset-block: 0;
	inset-inline-start: -40%;
	inline-size: 40%;
	background: linear-gradient(100deg, transparent 0%, rgba(255, 212, 59, 0.13) 50%, transparent 100%);
	animation: branded-sweep 19s ease-in-out infinite;
}

@keyframes branded-sweep {
	0%,
	12% {
		transform: translateX(0);
	}

	88%,
	100% {
		/* 350% of its own 40% width carries it the full plane and out. */
		transform: translateX(350%);
	}
}

@media (prefers-reduced-motion: reduce) {
	.branded-archive__sweep {
		animation: none;
		opacity: 0.5;
	}
}

.branded-archive__hero-inner {
	display: flex;
	flex-direction: column;
	align-items: center;
}

/* Same gold pill the single's hero opens with. */
.branded-archive__tag {
	display: inline-block;
	padding: 0.25em 0.9em;
	border-radius: 999px;
	background: linear-gradient(90deg, var(--branded-sun), var(--branded-sun-deep));
	color: var(--branded-ink);
	font-size: 0.78rem;
	font-weight: 800;
	letter-spacing: 0.05em;
}

.branded-archive__title {
	margin: clamp(0.85rem, 2vw, 1.15rem) 0 0;
	font-size: clamp(1.9rem, 1.1rem + 2.6vw, 3rem);
	font-weight: 800;
	line-height: 1.14;
	letter-spacing: -0.025em;
	color: #ffffff;
	text-wrap: balance;
}

.branded-archive__desc {
	max-inline-size: 56ch;
	margin: clamp(0.7rem, 1.8vw, 1rem) auto 0;
	font-size: clamp(0.98rem, 0.92rem + 0.3vw, 1.12rem);
	line-height: 1.7;
	color: rgba(255, 255, 255, 0.72);
	text-wrap: pretty;
}

/* The count sits under a short gold rule rather than in a chip — the pill
   above is the only filled gold shape the hero allows itself. */
.branded-archive__count {
	position: relative;
	margin-block-start: clamp(1.35rem, 3vw, 1.9rem);
	padding-block-start: clamp(1.1rem, 2.5vw, 1.5rem);
	font-size: 0.85rem;
	font-weight: 700;
	letter-spacing: 0.03em;
	color: rgba(255, 255, 255, 0.55);
}

.branded-archive__count::before {
	content: "";
	position: absolute;
	inset-block-start: 0;
	/* The count is a shrink-to-fit box already centred by the flex column, so
	   the rule centres inside it — no translate, which would be a physical
	   nudge inside a logical layout and break in one direction or the other. */
	inset-inline: 0;
	margin-inline: auto;
	inline-size: 44px;
	block-size: 2px;
	border-radius: 2px;
	background: linear-gradient(90deg, var(--branded-sun), var(--branded-sun-deep));
}

/* -----------------------------------------------------------------------
   Feed — two per row
   ----------------------------------------------------------------------- */
.branded-archive__body {
	padding-block: clamp(2.25rem, 5vw, 3.5rem) clamp(2.5rem, 6vw, 4rem);
}

.branded-feed {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: clamp(1.75rem, 3.5vw, 2.75rem) clamp(1.5rem, 3vw, 2.5rem);
	align-items: start;
}

@media (max-width: 640px) {
	.branded-feed {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* The Dream Job band spans both tracks. */
.branded-feed__promo,
.branded-feed .load-more {
	grid-column: 1 / -1;
}

/* .post-card ships as a horizontal media row with a hairline under it — here
   each piece is a standing card instead, so the shared divider, its padding
   and the stacking margin all come off. */
.branded-card {
	display: flex;
	flex-direction: column;
	gap: clamp(0.85rem, 1.8vw, 1.1rem);
	padding-block-end: 0;
	border-block-end: 0;
}

.branded-feed .post-card + .post-card {
	margin-block-start: 0;
}

.branded-card__thumb {
	position: relative;
	aspect-ratio: 16 / 10;
	border-radius: clamp(14px, 1.8vw, 20px);
	/* The gold frame the single gives its feature image, as a 1px gradient
	   border drawn by the padding rather than a border-image. */
	padding: 1px;
	background: linear-gradient(155deg, var(--branded-sun) 0%, rgba(255, 212, 59, 0.14) 42%, var(--branded-sun-deep) 100%);
	box-shadow: var(--shivuk-shadow-sm);
	transition:
		transform 0.5s var(--shivuk-ease),
		box-shadow 0.5s var(--shivuk-ease);
}

.branded-card__thumb img {
	border-radius: calc(clamp(14px, 1.8vw, 20px) - 1px);
}

.branded-card:hover .branded-card__thumb,
.branded-card:focus-within .branded-card__thumb {
	transform: translateY(-5px);
	box-shadow: var(--shivuk-shadow-md);
}

/* The disclosure, repeated on every card: a reader arriving mid-feed from a
   search result never saw the strip at the top of the page. */
.branded-card__tag {
	position: absolute;
	z-index: 1;
	inset-block-start: 0.7rem;
	inset-inline-start: 0.7rem;
	padding: 0.24em 0.8em;
	border-radius: 999px;
	background: linear-gradient(90deg, var(--branded-sun), var(--branded-sun-deep));
	color: var(--branded-ink);
	font-size: 0.72rem;
	font-weight: 800;
	letter-spacing: 0.04em;
	box-shadow: 0 4px 12px rgba(12, 10, 4, 0.28);
}

.branded-card__body {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	min-inline-size: 0;
}

.branded-card .entry-title {
	margin: 0;
	font-size: clamp(1.1rem, 1rem + 0.5vw, 1.32rem);
	font-weight: 800;
	line-height: 1.32;
	letter-spacing: -0.015em;
}

.branded-card .entry-title a {
	color: var(--shivuk-color-text);
	text-decoration: none;
	background-image: linear-gradient(90deg, var(--branded-sun-deep), var(--branded-sun-deep));
	background-repeat: no-repeat;
	background-position: 100% 100%;
	background-size: 0 2px;
	transition: background-size 0.3s var(--shivuk-ease);
}

.branded-card .entry-title a:hover,
.branded-card .entry-title a:focus-visible {
	background-size: 100% 2px;
}

.branded-card .entry-summary {
	margin: 0;
	font-size: 0.94rem;
	line-height: 1.7;
	color: var(--shivuk-color-muted);
}

.branded-card__more {
	display: inline-flex;
	align-items: center;
	gap: 0.35em;
	margin-block-start: 0.15rem;
	font-size: 0.85rem;
	font-weight: 700;
	color: var(--branded-sun-deep);
}

.branded-card__more svg {
	inline-size: 15px;
	block-size: 15px;
	transition: transform 0.25s var(--shivuk-ease);
}

/* RTL: the chevron points to the inline end, so it travels that way. */
.branded-card:hover .branded-card__more svg,
.branded-card:focus-within .branded-card__more svg {
	transform: translateX(-3px);
}

@media (prefers-reduced-motion: reduce) {
	.branded-card__thumb,
	.branded-card__more svg,
	.branded-card .entry-title a {
		transition: none;
	}
}

/* =======================================================================
   Makeover — hero ornaments, a featured first card, livelier cards.
   ======================================================================= */
.branded-archive__hero {
	background:
		radial-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1.6px),
		linear-gradient(180deg, #2a2a35 0%, #1c1c24 60%, #15151b 100%);
	background-size: 22px 22px, auto;
}

/* the same two rings as the single's hero */
.branded-archive__stage::before,
.branded-archive__stage::after {
	content: "";
	position: absolute;
	border: 1.5px solid rgba(255, 212, 59, 0.2);
	border-radius: 50%;
}

.branded-archive__stage::before {
	inset-block-start: -200px;
	inset-inline-end: -140px;
	inline-size: 520px;
	block-size: 520px;
	box-shadow: 0 0 0 40px rgba(255, 212, 59, 0.02);
}

.branded-archive__stage::after {
	inset-block-end: -240px;
	inset-inline-start: -180px;
	inline-size: 440px;
	block-size: 440px;
	border-color: rgba(245, 166, 35, 0.16);
}

.branded-archive__title {
	font-size: clamp(2.2rem, 1.1rem + 4vw, 4rem);
	letter-spacing: -0.03em;
}

/* count as a glass chip with a live dot */
.branded-archive__count {
	display: inline-flex;
	align-items: center;
	gap: 0.55em;
	padding: 0.45em 1.1em;
	border: 1px solid rgba(255, 212, 59, 0.35);
	border-radius: 999px;
	background: rgba(255, 212, 59, 0.08);
	color: var(--branded-sun);
}

.branded-archive__count::before {
	position: static;
	inset: auto;
	inline-size: 7px;
	block-size: 7px;
	margin: 0;
	border-radius: 50%;
	background: var(--branded-sun);
	box-shadow: 0 0 0 4px rgba(255, 212, 59, 0.2);
}

/* --- Feed ---------------------------------------------------------------- */
.branded-card {
	padding: 0.75rem 0.75rem 1.35rem;
	border-radius: 24px;
	background: #fff;
	box-shadow: 0 1px 2px rgba(20, 20, 27, 0.05), 0 14px 36px rgba(20, 20, 27, 0.07);
	transition: transform 0.35s var(--shivuk-ease), box-shadow 0.35s var(--shivuk-ease);
}

.branded-card:hover,
.branded-card:focus-within {
	transform: translateY(-4px);
	box-shadow: 0 2px 4px rgba(20, 20, 27, 0.06), 0 26px 54px rgba(20, 20, 27, 0.13);
}

/* the card itself lifts now, so the thumb stays put */
.branded-card:hover .branded-card__thumb,
.branded-card:focus-within .branded-card__thumb {
	transform: none;
	box-shadow: none;
}

.branded-card__body {
	padding-inline: 0.75rem;
}

.branded-card__more {
	align-self: flex-start;
	padding: 0.4em 1em;
	border-radius: 999px;
	background: var(--branded-ink);
	color: var(--branded-sun);
}

/* The newest piece leads: full width, image beside text. */
.branded-feed > .branded-card:first-child {
	grid-column: 1 / -1;
}

@media (min-width: 820px) {
	.branded-feed > .branded-card:first-child {
		display: grid;
		grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
		align-items: center;
		gap: clamp(1.5rem, 3vw, 2.5rem);
		padding: 1rem 1.25rem 1rem 1rem;
	}

	.branded-feed > .branded-card:first-child .branded-card__thumb {
		aspect-ratio: 16 / 11;
	}

	.branded-feed > .branded-card:first-child .entry-title {
		font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.3rem);
		line-height: 1.2;
	}

	.branded-feed > .branded-card:first-child .entry-summary {
		font-size: 1.05rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.branded-card {
		transition: none;
	}

	.branded-card:hover,
	.branded-card:focus-within {
		transform: none;
	}
}
