/*
Theme Name:   Aaditya Bath Journal
Theme URI:    https://aadityabath.com
Description:  Child theme for Hello Elementor. Adds a catalogue-style blog archive and single post layout in the Aaditya Bath monochrome identity.
Author:       Aaditya Bath
Template:     hello-elementor
Version:      1.0.2
Text Domain:  aaditya-bath-journal
*/

/* ==========================================================================
   Tokens — sampled from the live site's own header bands and Elementor CSS
   ========================================================================== */

:root {
	--ab-ink: #212529;        /* top utility bar — body text */
	--ab-charcoal: #494949;   /* nav bar */
	--ab-accent: #99a9b5;     /* brand blue-grey — decoration ONLY, 2.1:1 on white */
	--ab-meta: #5b6b77;       /* darkened accent for meta text — 5.6:1 on white */
	--ab-paper: #ffffff;
	--ab-wash: #f6f7f8;
	--ab-rule: #e3e6e8;
	--ab-rule-strong: #c9ced2;

	--ab-font: "Helvetica Neue", Helvetica, Arial, "Liberation Sans", sans-serif;

	/* Fluid scale, ~1.3 ratio */
	--ab-step--1: 0.8125rem;
	--ab-step-0: 1.0625rem;
	--ab-step-1: clamp(1.25rem, 1.12rem + 0.6vw, 1.5rem);
	--ab-step-2: clamp(1.5rem, 1.24rem + 1.15vw, 2.125rem);
	--ab-step-3: clamp(2rem, 1.5rem + 2.2vw, 3.25rem);
	--ab-step-4: clamp(2.5rem, 1.7rem + 3.4vw, 4.25rem);

	--ab-measure: 68ch;
	--ab-gutter: clamp(1.25rem, 0.8rem + 2vw, 3rem);
	--ab-shell: 78rem;

	--ab-ease: cubic-bezier(0.22, 1, 0.36, 1); /* ease-out-quint */

	--ab-z-sticky: 20;
}

/* ==========================================================================
   Shell
   ========================================================================== */

.ab-shell {
	width: 100%;
	max-width: var(--ab-shell);
	margin-inline: auto;
	padding-inline: var(--ab-gutter);
}

.ab-blog,
.ab-post {
	font-family: var(--ab-font);
	color: var(--ab-ink);
	background: var(--ab-paper);
}

.ab-blog *,
.ab-post * {
	box-sizing: border-box;
}

/* Skip-link + focus: the live site currently has no visible focus state */
.ab-blog :focus-visible,
.ab-post :focus-visible {
	outline: 2px solid var(--ab-ink);
	outline-offset: 3px;
	border-radius: 1px;
}

.ab-masthead :focus-visible {
	outline-color: var(--ab-paper);
}

/* ==========================================================================
   Masthead — reuses the site header's dark band as the section signature
   ========================================================================== */

.ab-masthead {
	background: var(--ab-ink);
	color: var(--ab-paper);
	padding-block: clamp(3rem, 2rem + 5vw, 6.5rem);
}

.ab-masthead__inner {
	max-width: var(--ab-shell);
	margin-inline: auto;
	padding-inline: var(--ab-gutter);
}

.ab-masthead__title {
	margin: 0;
	font-size: var(--ab-step-4);
	font-weight: 700;
	line-height: 1.02;
	letter-spacing: 0.18em;      /* echoes the AADITYA BATH wordmark */
	text-transform: uppercase;
	text-wrap: balance;
	color: var(--ab-paper);
}

.ab-masthead__lede {
	margin: 1.5rem 0 0;
	max-width: 44ch;
	font-size: var(--ab-step-0);
	line-height: 1.65;
	color: rgba(255, 255, 255, 0.78);
	text-wrap: pretty;
}

.ab-masthead__count {
	margin: 2.25rem 0 0;
	font-size: var(--ab-step--1);
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.62);
}

/* Single-post masthead runs tighter and is title-led, not label-led */
.ab-masthead--post .ab-masthead__title {
	font-size: var(--ab-step-3);
	letter-spacing: -0.02em;
	text-transform: none;
	line-height: 1.1;
	max-width: 22ch;
}

.ab-masthead__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.75rem 1.5rem;
	margin: 0 0 1.75rem;
	font-size: var(--ab-step--1);
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.7);
}

.ab-masthead__meta span + span::before {
	content: "";
	display: inline-block;
	width: 1.5rem;
	height: 1px;
	margin-right: 1.5rem;
	vertical-align: middle;
	background: var(--ab-accent);
}

.ab-backlink {
	display: inline-block;
	margin-bottom: 2rem;
	font-size: var(--ab-step--1);
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.72);
	text-decoration: none;
	border-bottom: 1px solid rgba(255, 255, 255, 0.3);
	padding-bottom: 2px;
	transition: color 0.35s var(--ab-ease), border-color 0.35s var(--ab-ease);
}

.ab-backlink:hover,
.ab-backlink:focus-visible {
	color: var(--ab-paper);
	border-color: var(--ab-paper);
}

/* Fallback head for singular content that isn't an article. Every page here is
   built in Elementor and never reaches this template, but a page created without
   one would — and it should not wear the blog's masthead. */
.ab-pagehead {
	padding-block: clamp(2.5rem, 2rem + 3vw, 4.5rem) 0;
}

.ab-pagehead__title {
	margin: 0;
	font-size: var(--ab-step-3);
	font-weight: 700;
	line-height: 1.1;
	letter-spacing: -0.02em;
	text-wrap: balance;
	color: var(--ab-ink);
}

/* ==========================================================================
   Archive index — a catalogue list, not a card grid
   ========================================================================== */

.ab-index {
	padding-block: clamp(2rem, 1rem + 3vw, 4rem) clamp(3rem, 2rem + 4vw, 6rem);
}

.ab-index__list {
	list-style: none;
	margin: 0;
	padding: 0;
	border-top: 1px solid var(--ab-rule);
}

.ab-entry {
	border-bottom: 1px solid var(--ab-rule);
}

.ab-entry__link {
	display: grid;
	grid-template-columns: 1fr;
	gap: 0.5rem 2.5rem;
	padding: clamp(1.5rem, 1.1rem + 1.4vw, 2.5rem) 0;
	text-decoration: none;
	color: inherit;
	transition: background-color 0.4s var(--ab-ease), padding-inline 0.4s var(--ab-ease);
}

@media (min-width: 48rem) {
	.ab-entry__link {
		grid-template-columns: 9rem minmax(0, 1fr);
		align-items: start;
	}
}

.ab-entry__link:hover,
.ab-entry__link:focus-visible {
	background-color: var(--ab-wash);
	padding-inline: 1.25rem;
}

.ab-entry__date {
	font-size: var(--ab-step--1);
	line-height: 1.5;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--ab-meta);
	padding-top: 0.45rem;
	white-space: nowrap;
}

.ab-entry__title {
	margin: 0;
	font-size: var(--ab-step-2);
	font-weight: 700;
	line-height: 1.18;
	letter-spacing: -0.018em;
	text-wrap: balance;
	color: var(--ab-ink);
}

.ab-entry__link:hover .ab-entry__title,
.ab-entry__link:focus-visible .ab-entry__title {
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 5px;
}

.ab-entry__excerpt {
	margin: 0.75rem 0 0;
	max-width: 62ch;
	font-size: var(--ab-step-0);
	line-height: 1.6;
	color: #41474d;
	text-wrap: pretty;
}

.ab-entry__more {
	display: inline-block;
	margin-top: 1rem;
	font-size: var(--ab-step--1);
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--ab-meta);
}

.ab-entry__more::after {
	content: " \2192";
	display: inline-block;
	transition: transform 0.4s var(--ab-ease);
}

.ab-entry__link:hover .ab-entry__more::after {
	transform: translateX(5px);
}

/* Entrance: transform only — never opacity.
   Animating opacity from 0 means that during the stagger delay (and in any
   renderer where the animation never runs: print, a headless screenshot, a
   background tab that never paints) the row is genuinely invisible. Moving the
   row instead keeps the text readable at every instant, animation or not. */
@media (prefers-reduced-motion: no-preference) {
	.ab-entry {
		animation: ab-rise 0.6s var(--ab-ease) backwards;
	}

	.ab-entry:nth-child(1)  { animation-delay: 0.02s; }
	.ab-entry:nth-child(2)  { animation-delay: 0.06s; }
	.ab-entry:nth-child(3)  { animation-delay: 0.10s; }
	.ab-entry:nth-child(4)  { animation-delay: 0.14s; }
	.ab-entry:nth-child(5)  { animation-delay: 0.18s; }
	.ab-entry:nth-child(n + 6) { animation-delay: 0.22s; }
}

@keyframes ab-rise {
	from { transform: translateY(14px); }
	to   { transform: none; }
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.ab-pagination {
	margin-top: clamp(2.5rem, 2rem + 2vw, 4rem);
}

.ab-pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: center;
}

.ab-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 3rem;
	height: 3rem;
	padding-inline: 0.9rem;
	border: 1px solid var(--ab-rule-strong);
	font-size: var(--ab-step--1);
	letter-spacing: 0.06em;
	color: var(--ab-ink);
	text-decoration: none;
	transition: background-color 0.35s var(--ab-ease), color 0.35s var(--ab-ease), border-color 0.35s var(--ab-ease);
}

.ab-pagination .page-numbers:hover,
.ab-pagination .page-numbers:focus-visible {
	background: var(--ab-ink);
	border-color: var(--ab-ink);
	color: var(--ab-paper);
}

.ab-pagination .page-numbers.current {
	background: var(--ab-ink);
	border-color: var(--ab-ink);
	color: var(--ab-paper);
	font-weight: 700;
}

.ab-pagination .page-numbers.dots {
	border-color: transparent;
	min-width: 1.5rem;
}

/* ==========================================================================
   Article body
   ========================================================================== */

.ab-article {
	padding-block: clamp(2.5rem, 1.8rem + 3vw, 4.5rem) clamp(3rem, 2rem + 4vw, 6rem);
}

.ab-article__body {
	max-width: var(--ab-measure);
	margin-inline: auto;
	font-size: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
	line-height: 1.75;
	color: #2b3034;
	text-wrap: pretty;
}

.ab-article__body > * + * {
	margin-top: 1.4em;
}

.ab-article__body h2,
.ab-article__body h3,
.ab-article__body h4 {
	color: var(--ab-ink);
	line-height: 1.22;
	letter-spacing: -0.015em;
	text-wrap: balance;
	margin-top: 2.4em;
	margin-bottom: 0;
}

.ab-article__body h2 { font-size: var(--ab-step-2); font-weight: 700; }
.ab-article__body h3 { font-size: var(--ab-step-1); font-weight: 700; }
.ab-article__body h4 { font-size: 1.125rem; font-weight: 700; }

.ab-article__body h2 + *,
.ab-article__body h3 + *,
.ab-article__body h4 + * {
	margin-top: 0.85em;
}

.ab-article__body a {
	color: var(--ab-ink);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
	text-decoration-color: var(--ab-accent);
	transition: text-decoration-color 0.3s var(--ab-ease);
}

.ab-article__body a:hover,
.ab-article__body a:focus-visible {
	text-decoration-color: var(--ab-ink);
	text-decoration-thickness: 2px;
}

.ab-article__body ul,
.ab-article__body ol {
	padding-left: 1.35em;
}

.ab-article__body li + li {
	margin-top: 0.5em;
}

.ab-article__body ::marker {
	color: var(--ab-meta);
}

.ab-article__body blockquote {
	margin-inline: 0;
	padding: 1.5rem 0 1.5rem 0;
	border-top: 1px solid var(--ab-rule-strong);
	border-bottom: 1px solid var(--ab-rule-strong);
	font-size: var(--ab-step-1);
	line-height: 1.45;
	font-weight: 700;
	letter-spacing: -0.01em;
	color: var(--ab-ink);
}

.ab-article__body strong { font-weight: 700; color: var(--ab-ink); }

.ab-article__body img,
.ab-article__body figure {
	max-width: 100%;
	height: auto;
}

.ab-article__body table {
	width: 100%;
	border-collapse: collapse;
	font-size: var(--ab-step-0);
}

.ab-article__body th,
.ab-article__body td {
	border-bottom: 1px solid var(--ab-rule);
	padding: 0.75rem 0.5rem 0.75rem 0;
	text-align: left;
	vertical-align: top;
}

/* Wide content must scroll inside itself, never the page */
.ab-article__scroll {
	overflow-x: auto;
}

/* ==========================================================================
   Article footer — no article is a dead end
   ========================================================================== */

.ab-next {
	max-width: var(--ab-measure);
	margin: clamp(3rem, 2rem + 3vw, 5rem) auto 0;
	border-top: 1px solid var(--ab-rule-strong);
}

.ab-next__row {
	display: grid;
	grid-template-columns: 1fr;
}

@media (min-width: 44rem) {
	.ab-next__row--two {
		grid-template-columns: 1fr 1fr;
	}
}

.ab-next__link {
	display: block;
	padding: 1.75rem 0;
	text-decoration: none;
	color: inherit;
	border-bottom: 1px solid var(--ab-rule);
	transition: background-color 0.4s var(--ab-ease);
}

@media (min-width: 44rem) {
	.ab-next__row--two .ab-next__link + .ab-next__link {
		padding-left: 2rem;
		border-left: 1px solid var(--ab-rule);
	}
}

.ab-next__link:hover,
.ab-next__link:focus-visible {
	background: var(--ab-wash);
}

.ab-next__dir {
	display: block;
	font-size: var(--ab-step--1);
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--ab-meta);
	margin-bottom: 0.6rem;
}

.ab-next__title {
	font-size: var(--ab-step-1);
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: -0.015em;
	color: var(--ab-ink);
	text-wrap: balance;
}

/* Showroom CTA — the one route out of every article */
.ab-cta {
	margin-top: clamp(3rem, 2rem + 3vw, 5rem);
	background: var(--ab-charcoal);
	color: var(--ab-paper);
}

.ab-cta__inner {
	max-width: var(--ab-shell);
	margin-inline: auto;
	padding: clamp(2.5rem, 2rem + 3vw, 4.5rem) var(--ab-gutter);
	display: grid;
	gap: 1.75rem;
	align-items: center;
}

@media (min-width: 52rem) {
	.ab-cta__inner {
		grid-template-columns: minmax(0, 1fr) auto;
		gap: 3rem;
	}
}

.ab-cta__title {
	margin: 0;
	font-size: var(--ab-step-2);
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: -0.015em;
	text-wrap: balance;
}

.ab-cta__text {
	margin: 0.9rem 0 0;
	max-width: 52ch;
	font-size: var(--ab-step-0);
	line-height: 1.65;
	color: rgba(255, 255, 255, 0.82);
	text-wrap: pretty;
}

.ab-cta__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 1.05rem 2.25rem;
	border: 1px solid var(--ab-paper);
	color: var(--ab-paper);
	font-size: var(--ab-step--1);
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 0.4s var(--ab-ease), color 0.4s var(--ab-ease);
}

.ab-cta__button:hover,
.ab-cta__button:focus-visible {
	background: var(--ab-paper);
	color: var(--ab-ink);
}

/* ==========================================================================
   Empty state
   ========================================================================== */

.ab-empty {
	max-width: 46ch;
	margin-inline: auto;
	padding-block: clamp(3rem, 2rem + 4vw, 6rem);
	text-align: center;
}

.ab-empty__title {
	margin: 0 0 0.9rem;
	font-size: var(--ab-step-2);
	font-weight: 700;
	letter-spacing: -0.015em;
}

.ab-empty__text {
	margin: 0;
	font-size: var(--ab-step-0);
	line-height: 1.65;
	color: var(--ab-meta);
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
	.ab-blog *,
	.ab-post * {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}

	.ab-entry__link:hover {
		padding-inline: 0;
	}

	/* Cancel the stagger too. With a delay still in place, `backwards` fill
	   holds the row at its start frame for the length of the delay. */
	.ab-entry {
		animation-delay: 0s !important;
	}
}
