/**
 * Welcome page — hero (two variants), promo banner, grade filter pills,
 * 2-col body (filterable product grid + 4-row sections + editorial blog
 * sidebar), responsive collapse. Merch carousel reuses the global section.
 *
 * Hero variants are picked by body class on the template:
 *   .welcome-hero--logged-in   → dark charcoal gradient, white title, gold em
 *   .welcome-hero--logged-out  → light photo + 50% white wash, dark title
 *
 * Product cards inside .welcome-product-grid / .welcome-product-row come from
 * ts_render_product_card() (main-style.css). We only own grid/layout here.
 */

.ts-welcome { background: var(--bg); }

/* ── HERO (photo flat-lay + bottom-left corner greeting; same both variants) ── */
.welcome-hero {
	padding: 24px 40px;
	background: #fff;
	border-bottom: 1px solid var(--border);
}
.welcome-hero-inner {
	position: relative;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 300px; /* 300px (was 440px) so the search box sits on screen on a laptop */
	border-radius: 16px;
}
.welcome-hero-bg {
	position: absolute;
	inset: 0;
	background-color: #E8DDD2;
	background-image: linear-gradient(135deg, #E8DDD2 0%, #CDBBAA 55%, #B9A48F 100%);
	background-size: cover;
	background-position: center;
}
/* <picture>: desktop photo, swapped for the mobile crop at ≤600px. */
.welcome-hero-bg img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}
.welcome-hero-overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(to bottom, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0.52) 100%);
}
/* Logged in: much lighter — only a soft fade along the bottom, behind the
 * "Welcome back, [name]." greeting, so the photo stays bright. */
.welcome-hero--logged-in .welcome-hero-overlay {
	background: linear-gradient(to top, rgba(0,0,0,0.38) 0%, rgba(0,0,0,0.12) 32%, rgba(0,0,0,0) 55%);
}
.welcome-hero--logged-in .welcome-hero-corner { text-shadow: 0 1px 8px rgba(0,0,0,0.35); }
/* ── CENTERED HERO HEADLINE (logged-out only, 2.1 redline) ──
 * This page doubles as the homepage, so it carries the headline the retired
 * standalone homepage used to. Sits alongside the bottom-left corner greeting,
 * which stays — do not remove it.
 *
 * CLEARANCE: the hero is a fixed 300px card, not full-viewport. The block is
 * centered but padded at the bottom so the categories line keeps clear of
 * .welcome-hero-corner (whose top sits ~200px down). With 80px padding the
 * ~171px block spans roughly 25px–195px. If these font sizes change again,
 * re-check the categories line still ends above the greeting. */
.welcome-hero-headline {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	text-align: center;
	padding: 0 40px 80px;
	pointer-events: none;
}
.welcome-hero-headline-title {
	/* Inter, NOT var(--ff-display). The reference sets --ff-display: Inter in its
	 * own :root, so its `var(--ff-display)` resolves to Inter — while ours is
	 * Playfair. Same token name, different value: hard-code Inter here. */
	font-family: 'Inter', sans-serif;
	font-size: 96px;
	font-weight: 800;
	line-height: 0.95;
	letter-spacing: -0.04em;
	color: #fff;
	margin: 0;
}
.welcome-hero-headline-sub {
	font-family: var(--ff-body);
	font-size: 20px;
	font-weight: 500;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: rgba(255,255,255,0.85);
	margin: 0;
}
.welcome-hero-headline-categories {
	font-family: var(--ff-mono);
	font-size: 18px;
	font-weight: 700;
	color: #fff;
	letter-spacing: 0.04em;
	margin: 0;
	text-shadow: 0 1px 6px rgba(0,0,0,0.5);
}
@media (max-width: 768px) {
	.welcome-hero-headline { padding-bottom: 84px; }
	.welcome-hero-headline-title { font-size: 48px; }
	.welcome-hero-headline-sub { font-size: 14px; }
}

.welcome-hero-corner {
	position: absolute;
	bottom: 32px;
	left: 40px;
	z-index: 2;
	animation: fadeUp 0.7s var(--ease-out) both;
}
.welcome-hero-hello {
	font-family: 'Inter', sans-serif;
	font-size: 36px;
	font-weight: 800;
	color: #fff;
	line-height: 1.1;
	letter-spacing: -0.03em;
	margin-bottom: 8px;
}
.welcome-hero-sub {
	font-family: var(--ff-body);
	font-size: 13px;
	font-weight: 400;
	color: rgba(255,255,255,0.88);
	letter-spacing: 0.03em;
}
.welcome-hero-signin {
	display: inline-block;
	font-family: var(--ff-body);
	font-size: 13px;
	font-weight: 500;
	color: #fff;
	text-decoration: underline;
	text-underline-offset: 3px;
	transition: opacity 0.15s;
}
.welcome-hero-signin:hover { opacity: 0.8; }

/* ── HERO ON PHONES (≤600px) ──
 * The 96px/48px headline overflowed a 375px screen ("eacherStore.i"). Here the
 * card becomes a taller portrait panel (matches the mobile photo crop) and
 * everything stacks centered: headline block, then the greeting + sign-in.
 * The title scales with the viewport so "TeacherStore.io" always fits on one
 * line: ~8.4em wide at 800 weight, inside 16px page + 20px card padding. */
@media (max-width: 600px) {
	.welcome-hero { padding: 16px; }
	/* Logged-out only (#2): the logged-in hero keeps its photo and bottom-left
	 * greeting on phones, no separate layout. */
	.welcome-hero--logged-out .welcome-hero-inner {
		flex-direction: column;
		justify-content: center;
		gap: 36px;
		min-height: 480px;
		padding: 48px 20px 40px;
	}
	.welcome-hero-headline {
		position: relative;
		inset: auto;
		padding: 0;
		gap: 12px;
		width: 100%;
	}
	.welcome-hero-headline-title {
		font-size: min(48px, calc((100vw - 72px) / 8.4));
		line-height: 1;
		white-space: nowrap;
	}
	.welcome-hero-headline-sub {
		font-size: 12px;
		letter-spacing: 0.18em;
		line-height: 1.5;
		max-width: 260px; /* "A MODERN MARKETPLACE / FOR TEACHERS" on two lines */
		text-wrap: balance;
	}
	/* #2: the category line is dropped on phones. */
	.welcome-hero-headline-categories { display: none; }
	/* Portrait phone photo, shifted so more of the table shows. */
	.welcome-hero--logged-out .welcome-hero-bg img { object-position: center 70%; }
	.welcome-hero--logged-out .welcome-hero-corner {
		position: relative;
		bottom: auto;
		left: auto;
		z-index: 2;
		text-align: center;
	}
	.welcome-hero--logged-out .welcome-hero-hello { font-size: 30px; margin-bottom: 6px; }
}

/* ── FILTER (label + text/underline pills) ── */
.welcome-filter-bar {
	background: var(--white);
	border-bottom: 1px solid var(--border);
	padding: 18px 40px;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}
.welcome-filter-bar::-webkit-scrollbar { display: none; }
/* One row, sized to its content: centered (margin auto) when it fits; when it's
 * wider than the screen it starts at the left edge and the bar scrolls, so the
 * label and first grades are never pushed off-screen (justify-content: center
 * on an overflowing row spills off BOTH sides). */
.welcome-filter-pills {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: 28px;
	width: max-content;
	max-width: 1400px;
	margin: 0 auto;
}
.welcome-filter-label {
	font-family: 'Inter', sans-serif;
	font-size: 18px;
	font-weight: 700;
	letter-spacing: -0.03em;
	color: var(--charcoal);
	white-space: nowrap;
	flex-shrink: 0;
}
.welcome-filter-pill {
	white-space: nowrap;
	font-family: var(--ff-body);
	font-size: 12px;
	font-weight: 500;
	letter-spacing: 0.04em;
	color: var(--ink);
	background: none;
	border: none;
	border-bottom: 1px solid transparent;
	padding: 2px 0;
	cursor: pointer;
	transition: color 0.15s, border-color 0.15s;
}
.welcome-filter-pill:hover { color: var(--charcoal); border-bottom-color: var(--charcoal); font-weight: 700; }
.welcome-filter-pill.is-active { color: var(--charcoal); border-bottom-color: var(--charcoal); font-weight: 600; }

/* ── MAIN CONTENT ── */
.welcome-main-wrap { background: var(--white); }
.welcome-search-zone {
	max-width: 1400px;
	margin: 0 auto;
	padding: 56px 40px 0;
}
.welcome-search-label {
	font-family: 'Inter', sans-serif;
	font-size: 42px;
	font-weight: 700;
	letter-spacing: -0.05em;
	color: var(--charcoal);
	margin: 0 0 20px;
}
/* 2.1 redline: full pill, 60px tall, with the mic + camera icon buttons on the
 * LEFT of the input and the dark Search button flush inside the right end. */
.welcome-archive-search {
	display: flex;
	align-items: center;
	gap: 14px;
	background: #fff;
	border: 1px solid var(--ink);
	border-radius: var(--radius-pill);
	overflow: hidden;
	height: 60px;
	padding: 0 0 0 26px;
	transition: border-color 0.2s, box-shadow 0.2s;
}
/* .welcome-archive-search:focus-within { border-color: var(--fri-yay); box-shadow: 0 0 0 3px rgba(196,95,78,0.08); } */
.welcome-archive-search:focus-within { border-color: var(--stone); box-shadow: 0 0 0 3px #1c1a180f; }
.welcome-archive-search-icon { color: var(--stone); font-size: 16px; display: flex; align-items: center; flex-shrink: 0; }
.welcome-archive-search input {
	flex: 1; min-width: 0;
	border: none; outline: none; background: transparent;
	font-family: var(--ff-body); font-size: 15px; color: var(--ink);
}
.welcome-archive-search input::placeholder { color: var(--dust); }
/* Mic + camera sit to the LEFT of the input in the reference. Visual
 * placeholders for future AI search — inert by design. */
.welcome-archive-search-mic,
.welcome-archive-search-camera {
	background: none; border: none; color: var(--stone); padding: 4px;
	cursor: pointer; display: flex; align-items: center; font-size: 18px;
	transition: color 0.15s; flex-shrink: 0;
}
.welcome-archive-search-mic:hover,
.welcome-archive-search-camera:hover { color: var(--ink); }
.welcome-archive-search-btn {
	align-self: stretch;
	height: 100%;
	background: var(--ink); color: #fff; border: none;
	padding: 0 40px; font-family: var(--ff-body); font-size: 12px; font-weight: 700;
	letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer; white-space: nowrap;
	flex-shrink: 0; transition: background 0.2s;
}
.welcome-archive-search-btn:hover { background: #333; }

/* ── TUTORIAL VIDEO ACCORDION ──
 * Divider under the search pill: italic tip, hairline, then the "Watch a Demo"
 * toggle. The panel animates on max-height (cheap, no JS measuring) and the tile
 * inside it is the shared .seller-welcome-video from video-banner.css, so only
 * the width cap and the chrome around it live here. */
.welcome-demo-divider {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 14px;
	max-width: 420px;
}
.welcome-demo-tip {
	font-family: 'Playfair Display', serif;
	font-style: italic;
	font-size: 15px;
	color: var(--ink);
	flex-shrink: 0;
}
.welcome-demo-line { flex: 1; height: 1px; background: var(--border); }
.welcome-demo-toggle {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
	background: none;
	border: none;
	padding: 0;
	font-family: var(--ff-body);
	font-size: 13px;
	font-weight: 700;
	color: var(--ink);
	cursor: pointer;
	transition: color 0.2s;
}
.welcome-demo-toggle:hover { color: var(--fri-yay); }
.welcome-demo-toggle i { font-size: 15px; line-height: 1; }
.welcome-demo-chevron { transition: transform 0.2s var(--ease-out, ease); }
.welcome-demo-toggle[aria-expanded="true"] .welcome-demo-chevron { transform: rotate(180deg); }
.welcome-demo-panel {
	max-height: 0;
	overflow: hidden;
	max-width: 480px;
	/* visibility keeps the play tile out of the tab order while collapsed; it
	 * flips on immediately when opening and waits out the collapse when closing. */
	visibility: hidden;
	transition: max-height 0.3s var(--ease-out, ease), visibility 0.3s;
}
.welcome-demo-panel.is-open { max-height: 320px; margin-top: 14px; visibility: visible; }

.welcome-main {
	max-width: 1400px;
	margin: 0 auto;
	padding: 56px 40px 0;
	display: grid;
	grid-template-columns: 1fr 240px;
	gap: 56px;
	align-items: start;
}
.welcome-main-left { min-width: 0; }

/* ── Section header (above each row) ── */
.welcome-section-header {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	margin-bottom: 20px;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--border);
}
.welcome-section-title {
	font-family: 'Inter', sans-serif;
	font-size: 26px;
	font-weight: 700;
	letter-spacing: -0.03em;
	color: var(--charcoal);
}
.welcome-section-title em { font-family: 'Playfair Display', serif; font-style: italic; font-weight: 400; }
.welcome-section-count {
	font-size: 12px;
	color: var(--stone);
	letter-spacing: 0.02em;
}
/* "Shop Now →" beside each row title (2.1 redline). */
.welcome-section-link {
	font-size: 13px;
	font-weight: 500;
	color: var(--ink);
	text-decoration: underline;
	text-underline-offset: 3px;
	white-space: nowrap;
	transition: color 0.15s;
}
.welcome-section-link:hover { color: var(--mascot); }

/* ── Product grid (main filterable) ── */
.welcome-product-section { margin-bottom: 56px; position: relative; }

/* Reference: .card-row is 4-up at 24px; the two "compact" rows (resources and
 * bundle clubs) tighten to 16px. */
.welcome-product-grid,
.welcome-product-row {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 24px;
}
.welcome-row-compact { gap: 16px; }

/* The Meetups row reuses ts_render_event_card(), whose card chrome lives in
 * quick-view.css (unscoped `.merch-product-card` / `-img` / `-overlay` rules).
 * That sheet is now enqueued on this page too — see functions.php — so the row
 * matches /meetups-events/ exactly. Nothing extra needed here. */

.welcome-row-section.ts-meetups .merch-product-card .event-meta{
	margin-bottom: 15px;
}
.welcome-row-section.ts-meetups .merch-product-card .merch-add-btn{
	padding: 5px 14px;
	border-radius: 4px;
}
.welcome-product-grid[aria-busy="true"],
.welcome-product-row[aria-busy="true"] { opacity: 0.55; pointer-events: none; }

/* Loader (shown while AJAX is in flight on the main grid) */
.welcome-grid-loader {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 18px 0 0;
	color: var(--stone);
	font-size: 12px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}
.welcome-grid-loader[hidden] { display: none; }
.welcome-grid-loader .loader-dots { display: inline-flex; gap: 4px; }
.welcome-grid-loader .loader-dots span {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--terra);
	animation: welcomeDot 1s infinite ease-in-out;
}
.welcome-grid-loader .loader-dots span:nth-child(2) { animation-delay: 0.15s; }
.welcome-grid-loader .loader-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes welcomeDot {
	0%, 80%, 100% { opacity: 0.25; transform: scale(0.85); }
	40% { opacity: 1; transform: scale(1); }
}

/* ── Row sections ── */
.welcome-row-section { margin-bottom: 48px; }

/* ── Editorial sidebar (right column) ── */
.welcome-sidebar {
	display: flex;
	flex-direction: column;
	gap: 40px;
	padding-top: 8px;
	padding-bottom: 64px;
}
.welcome-sidebar-item { display: block; color: inherit; }
.welcome-sidebar-img {
	width: 100%;
	aspect-ratio: 4/5;
	background: linear-gradient(145deg, #E8E0D8, #D4C8BC);
	background-size: cover;
	background-position: center;
	border-radius: 6px;
	overflow: hidden;
	margin-bottom: 14px;
	transition: transform 0.3s var(--ease-out);
}
.welcome-sidebar-item:hover .welcome-sidebar-img { transform: scale(1.02); }
.welcome-sidebar-eyebrow {
	font-size: 9px;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	font-weight: 600;
	color: var(--gold);
	margin-bottom: 6px;
}
.welcome-sidebar-title {
	font-family: 'Inter', sans-serif;
	font-size: 18px;
	font-weight: 700;
	letter-spacing: -0.02em;
	color: #000000;
	line-height: 1.35;
	margin-bottom: 8px;
}
.welcome-sidebar-title em { font-style: italic; }
.welcome-sidebar-excerpt {
	font-size: 12.5px;
	color: var(--ink);
	line-height: 1.6;
	margin-bottom: 10px;
}
.welcome-sidebar-link {
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.06em;
	color: var(--terra);
	transition: color 0.15s;
}
.welcome-sidebar-link:hover { color: var(--terra-hover); }
.welcome-sidebar-divider {
	width: 40px;
	height: 1px;
	background: var(--border);
	margin: 0 auto;
}

/* Empty-state across the full grid width when filters return nothing */
.welcome-product-grid > .ts-empty-state,
.welcome-product-row > .ts-empty-state { grid-column: 1 / -1; }

/* ── RESPONSIVE ── */
@media (max-width: 1100px) {
	.welcome-product-grid,
	.welcome-product-row { grid-template-columns: repeat(3, 1fr); }
	.welcome-main { grid-template-columns: 1fr 200px; gap: 40px; }
}
@media (max-width: 900px) {
	.welcome-hero-content { padding: 56px 20px; }
	.welcome-hero-title { font-size: 48px; }
	.welcome-promo { flex-direction: column; gap: 10px; padding: 12px 20px; }
	.welcome-promo-text { font-size: 20px; text-align: center; }
	.welcome-filter-bar { padding: 16px 20px; }
	.welcome-search-zone { padding: 40px 20px 0; }
	.welcome-main { grid-template-columns: 1fr; padding: 24px 20px 0; gap: 32px; }
	.welcome-sidebar {
		flex-direction: row;
		overflow-x: auto;
		gap: 24px;
		padding-bottom: 32px;
	}
	.welcome-sidebar-item { min-width: 240px; flex-shrink: 0; }
	.welcome-sidebar-divider { display: none; }
	.welcome-product-grid,
	.welcome-product-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
	.welcome-hero-title { font-size: 36px; }
	.welcome-greeting { font-size: 26px; }
	.welcome-section-title { font-size: 22px; }
	/* Search: the 42px heading wrapped to three tall lines and the 40px-a-side
	 * button + icons left the input ~20px wide. Phone sizing matches the shop. */
	.welcome-search-label { font-size: 28px; line-height: 1.15; margin-bottom: 16px; }
	.welcome-archive-search { height: 52px; gap: 6px; padding-left: 16px; }
	.welcome-archive-search-btn { padding: 0 18px; }
	/* Tip + toggle + hairline don't fit on a phone — keep the toggle, drop the tip. */
	.welcome-demo-tip { display: none; }
	.welcome-demo-panel { max-width: 100%; }
	.welcome-product-grid,
	.welcome-product-row { grid-template-columns: 1fr 1fr; gap: 10px; }
}

/* ── "Read the TeacherStore Blog" row ──
 * Same .more-blog-card markup as single.php's "More From the Blog" strip
 * (styles in single-post.css, which isn't loaded here), laid out on the
 * welcome row grid. */
.welcome-blog-row .more-blog-card {
	display: block;
	text-decoration: none;
	color: inherit;
	background: var(--white);
	border: 1px solid rgba(216,212,206,0.5);
	border-radius: var(--radius-card);
	box-shadow: 0 2px 8px rgba(28,26,24,0.04);
	overflow: hidden;
	transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}
.welcome-blog-row .more-blog-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(28,26,24,0.08); }
.welcome-blog-row .more-blog-img {
	position: relative;
	aspect-ratio: 16 / 10;
	background-color: #EDEAE4;
	background-size: cover;
	background-position: center;
}
/* TV / Podcast rows: same card, square art for podcasts + a length badge. */
.welcome-blog-row .more-blog-img.square { aspect-ratio: 1 / 1; }
.welcome-blog-row .more-blog-duration {
	position: absolute;
	right: 10px;
	bottom: 10px;
	font-size: 11px;
	font-weight: 600;
	color: #fff;
	background: rgba(28,26,24,0.75);
	padding: 3px 8px;
	border-radius: 4px;
}
.welcome-blog-row .more-blog-category {
	position: absolute;
	top: 12px;
	left: 12px;
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	background: #fff;
	color: var(--ink);
	padding: 4px 10px;
	border-radius: 3px;
}
.welcome-blog-row .more-blog-body { padding: 16px 16px 20px; color: var(--ink); }
.welcome-blog-row .more-blog-title {
	font-family: 'Inter', sans-serif;
	font-size: 16px;
	font-weight: 600;
	letter-spacing: -0.02em;
	line-height: 1.35;
	margin-bottom: 6px;
}
.welcome-blog-row .more-blog-excerpt {
	font-size: 13px;
	line-height: 1.55;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin-bottom: 8px;
}
.welcome-blog-row .more-blog-footer { font-size: 11px; color: var(--stone); letter-spacing: 0.02em; }
