/*
 * Idol Gallery — design system (2.0 redesign).
 *
 * Editorial, image-first design: uniform responsive card tiles, a sticky
 * glass header, a clean centred reading column on single items and a full
 * "You May Also Like" grid. The brand palette (accent ramp + heart mark)
 * is untouched: --ig-accent / --ig-brand drive the mark exactly as before.
 */

:root {
	/* Light is the default; dark only overrides the values below. */
	color-scheme: light;

	/* Palette */
	--ig-bg: #f6f5fa;
	--ig-surface: #ffffff;
	--ig-text: #1b1626;
	--ig-text-soft: #6f6880;
	--ig-nav-text: #3f3a4d;
	--ig-accent: #7144b1;
	--ig-accent-hover: #603996;
	--ig-accent-soft: #f1ecf9;
	--ig-accent-line: #d9cdef;
	/* Brand ramp, kept in step with the accent so the mark reads as part of the
	   theme rather than a separate red stamp. */
	--ig-brand: var(--ig-accent);
	--ig-brand-deep: var(--ig-accent-hover);
	--ig-brand-soft: #c9aef0;
	--ig-vote-up: #00960e;
	--ig-vote-down: #dc3545;
	--ig-border: #eceaf2;
	--ig-media: #ede9f3;
	--ig-ink: #17131f;

	/* Shape and elevation */
	--ig-radius: 10px;
	--ig-radius-lg: 16px;
	--ig-shadow: 0 10px 30px rgba(27, 22, 38, 0.08);
	--ig-shadow-soft: 0 4px 16px rgba(27, 22, 38, 0.06);
	--ig-shadow-hover: 0 18px 44px rgba(27, 22, 38, 0.14);

	/* Grid */
	--ig-gap: 16px;
	/*
	 * Room the floating category pills leave for the media-type icons in the
	 * card corner. Sized to the widest realistic icon row ("12" image counter
	 * beside the video badge, ~46px) plus the 10px inset and a small buffer.
	 * Narrowed per breakpoint below so the pills stay useful on phones.
	 */
	--ig-card-badges-reserve: 62px;

	/* Chrome */
	--ig-header-h: 64px;
	--ig-container: 1320px;

	/*
	 * Height budget for the player on the single page. The stylesheet can
	 * only guess how much room the breadcrumb, title, tag pills and meta
	 * take above the viewer; the script measures it and overrides this
	 * value, so the player and its controls stay on screen.
	 */
	--ig-video-h: calc(100dvh - var(--ig-header-h) - 240px);
}

/*
 * Header glass tint. Kept as its own variable because the header is the one
 * surface that is translucent rather than a flat --ig-surface fill; dark mode
 * needs a dark tint here or the bar stays a white slab over a dark page.
 */
:root {
	--ig-header-bg: rgba(255, 255, 255, 0.86);
}

/*
 * Dark palette.
 *
 * Every colour in this sheet already routes through the --ig-* custom
 * properties, so dark mode is a matter of redefining those on
 * <html data-theme="dark"> rather than duplicating rules. The accent is
 * lightened because the light-mode purple loses contrast on a dark surface.
 * The attribute is set by the inline bootstrap in <head> (and by the header
 * toggle afterwards), never by a class, so there is no flash of the wrong
 * theme.
 */
html[data-theme="dark"] {
	--ig-bg: #131019;
	--ig-surface: #1c1826;
	--ig-text: #f1eef7;
	--ig-text-soft: #a89fbb;
	--ig-nav-text: #ded9e9;
	--ig-accent: #a678e8;
	--ig-accent-hover: #bb96f2;
	--ig-accent-soft: #251f36;
	--ig-accent-line: #3b3153;
	--ig-brand: var(--ig-accent);
	--ig-brand-deep: var(--ig-accent-hover);
	--ig-brand-soft: #6a4a9e;
	--ig-border: #2d2739;
	--ig-media: #241f30;
	--ig-ink: #0c0a11;
	--ig-header-bg: rgba(19, 16, 25, 0.86);
	--ig-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
	--ig-shadow-soft: 0 4px 16px rgba(0, 0, 0, 0.36);
	--ig-shadow-hover: 0 18px 44px rgba(0, 0, 0, 0.55);
	color-scheme: dark;
}

/* ---------------------------------------------------------------- base ---- */

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

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
}

body {
	margin: 0;
	background-color: var(--ig-bg);
	color: var(--ig-text);
	/* Soft cross-fade when the reader flips the header switch. */
	transition: background-color 0.28s ease, color 0.28s ease;
	font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 16px;
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
}

img,
svg,
video {
	max-width: 100%;
	height: auto;
}

a {
	color: var(--ig-accent);
	text-decoration: none;
}

a:hover,
a:focus {
	color: var(--ig-accent-hover);
}

h1,
h2,
h3,
h4 {
	margin: 0 0 0.5em;
	line-height: 1.25;
	color: var(--ig-text);
}

p {
	margin: 0 0 1em;
}

button {
	font: inherit;
	color: inherit;
}

:focus-visible {
	outline: 2px solid var(--ig-accent);
	outline-offset: 2px;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.skip-link:focus {
	position: fixed;
	top: 8px;
	left: 8px;
	z-index: 1000;
	width: auto;
	height: auto;
	clip: auto;
	padding: 10px 16px;
	background: var(--ig-surface);
	border-radius: var(--ig-radius);
	box-shadow: var(--ig-shadow);
	color: var(--ig-accent);
	font-weight: 700;
}

.site-wrapper {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

.site-main {
	flex: 1 0 auto;
	width: 100%;
}

/* -------------------------------------------------------------- header ---- */

.site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: var(--ig-header-bg);
	-webkit-backdrop-filter: blur(14px);
	backdrop-filter: blur(14px);
	transition: box-shadow 0.2s ease;
}

.site-header.is-scrolled {
	box-shadow: 0 6px 24px rgba(27, 22, 38, 0.08);
	border-bottom: 1px solid var(--ig-border);
}

html[data-theme="dark"] .site-header.is-scrolled {
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
}

.header-bar {
	display: flex;
	align-items: center;
	gap: 16px;
	width: 100%;
	max-width: var(--ig-container);
	/*
	 * min-height, not height: when the primary menu holds more links than
	 * fit on one row they wrap and the bar has to grow with them instead of
	 * letting the second row spill over the brand lockup.
	 */
	min-height: var(--ig-header-h);
	margin: 0 auto;
	padding: 0 16px;
}

.header-brand {
	/*
	 * A translated brand is often much wider than the Latin one — the
	 * Japanese wordmark is full-width, so the lockup grows by roughly half.
	 * Let the brand give way rather than push the header actions, and the
	 * burger that opens the mobile menu, off the edge of the screen.
	 */
	flex: 0 1 auto;
	display: flex;
	align-items: center;
	min-width: 0;
	overflow: hidden;
}

.header-nav {
	flex: 1 1 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 0;
}

.header-actions {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 4px;
}

.icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	background: none;
	border: 0;
	border-radius: 999px;
	color: var(--ig-nav-text);
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.icon-btn svg {
	width: 20px;
	height: 20px;
	fill: currentColor;
}

.icon-btn:hover,
.icon-btn:focus-visible {
	background: var(--ig-accent-soft);
	color: var(--ig-accent);
}

.navbar-toggler {
	display: none;
	/*
	 * The three bars stack down the button. Left as a row they became flex
	 * items with no content and collapsed to 0px wide, which left the mobile
	 * menu button completely invisible. The spacing is a gap rather than
	 * margins so the bars cannot be shrunk away in the column direction.
	 */
	flex-direction: column;
	justify-content: center;
	align-items: stretch;
	gap: 4px;
	width: 40px;
	height: 40px;
	padding: 9px 10px;
	background: none;
	border: 0;
	border-radius: 999px;
	cursor: pointer;
}

.navbar-toggler-bar {
	display: block;
	flex: 0 0 auto;
	width: 100%;
	height: 2px;
	background: var(--ig-nav-text);
	border-radius: 2px;
	transition: transform 0.18s ease, opacity 0.18s ease;
}

/* Search expando under the bar */

.header-search {
	display: none;
	border-top: 1px solid var(--ig-border);
	background: var(--ig-surface);
}

.header-search.is-open {
	display: block;
}

.header-search-inner {
	max-width: var(--ig-container);
	margin: 0 auto;
	padding: 12px 16px;
}

.header-search .search-form {
	display: flex;
	gap: 8px;
	max-width: 720px;
	margin: 0 auto;
}

.header-search .search-field {
	flex: 1 1 auto;
	min-width: 0;
	padding: 10px 18px;
	background: var(--ig-bg);
	border: 1px solid var(--ig-border);
	border-radius: 999px;
	font-size: 15px;
}

.header-search .search-field:focus {
	border-color: var(--ig-accent);
	outline: none;
	box-shadow: 0 0 0 3px var(--ig-accent-soft);
}

/* --------------------------------------------------------- brand lockup ---- */

/*
 * The lockup itself is untouched (idol_gallery_brand renders the same heart
 * badge + Kpop/Idolfake wordmark, or a custom-logo image). The
 * desktop/mobile pair below only controls which copy the *header* shows;
 * the footer always shows the desktop lockup.
 */

.brand {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	width: auto;
}

.brand-logo {
	display: block;
	width: auto;
	height: 36px;
}

.brand--text {
	display: inline-flex;
	flex-direction: row;
	align-items: center;
	gap: 11px;
	width: auto;
	color: var(--ig-text);
	line-height: 1;
	text-transform: none;
}

.brand--text .brand-mark {
	transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.brand--text:hover .brand-mark,
.brand--text:focus-visible .brand-mark {
	transform: translateY(-2px);
	box-shadow: 0 8px 18px rgba(113, 68, 177, 0.42);
}

.brand-text {
	display: inline-flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 1px;
}

.site-header .brand--mobile {
	display: none;
}

@media (max-width: 991px) {
	.site-header .brand--desktop {
		display: none;
	}

	.site-header .brand--mobile {
		display: inline-flex;
	}
}

.brand-title {
	color: var(--ig-brand);
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0.26em;
	text-transform: uppercase;
}

.brand-name {
	color: var(--ig-text);
	font-size: 25px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: -0.02em;
	text-transform: none;
}

/*
 * The header lockup has to survive a translation that is wider than the
 * Latin one. Every level of the lockup is allowed to shrink and the name
 * truncates, so the wordmark gives way instead of pushing the language
 * switcher and the menu button off the edge of a phone screen.
 */
.site-header .brand--text,
.site-header .brand-text {
	min-width: 0;
}

.site-header .brand-mark {
	flex: 0 0 auto;
}

.site-header .brand-name {
	min-width: 0;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.brand--text:hover .brand-name,
.brand--text:focus .brand-name {
	color: var(--ig-brand);
}

.brand-mark {
	display: block;
	flex: 0 0 auto;
	width: 34px;
	height: 34px;
}

/* ------------------------------------------------------------ primary menu ---- */

/*
 * wp_nav_menu() emits its own markup:
 *
 *   <ul id="primary-menu" class="nav-list">
 *     <li class="menu-item current-menu-item"><a href="…">Label</a></li>
 *   </ul>
 *
 * The list items carry WordPress' `menu-item` class and the anchor carries
 * no class at all, so the rules below target exactly that. Every selector is
 * scoped with the child combinator: it keeps the top-level labels from
 * bleeding into the `.sub-menu` links, which have their own block treatment
 * further down, and it means links added from Appearance → Menus pick the
 * styling up with no extra work.
 */
.nav-list {
	display: flex;
	align-items: center;
	/* Links that no longer fit on one row wrap instead of colliding with the
	   brand lockup and the header actions. */
	flex-wrap: wrap;
	justify-content: center;
	/* The gap is the full space between two labels, so the links carry no
	   horizontal padding of their own. */
	gap: 42px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.nav-list > .menu-item {
	position: relative;
}

.nav-list > .menu-item > a {
	display: inline-flex;
	align-items: center;
	/* Vertical only: a horizontal pad would eat into the 42px gap. */
	padding: 8px 0;
	color: var(--ig-nav-text);
	font-size: 16px;
	font-weight: 700;
	letter-spacing: 1.2px;
	text-transform: uppercase;
	white-space: nowrap;
	border: 0;
	box-shadow: none;
	transition: color 0.15s ease;
}

.nav-list > .menu-item > a:hover,
.nav-list > .menu-item > a:focus {
	color: var(--ig-accent);
}

/* Active navigation indicator. */
.nav-list > .current-menu-item > a,
.nav-list > .current_page_item > a,
.nav-list > .current-menu-ancestor > a {
	color: var(--ig-accent);
}

.nav-list .sub-menu {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	z-index: 40;
	display: none;
	min-width: 200px;
	max-height: 70vh;
	overflow-y: auto;
	margin: 0;
	padding: 6px;
	background: var(--ig-surface);
	border: 1px solid var(--ig-border);
	border-radius: var(--ig-radius);
	box-shadow: var(--ig-shadow);
	list-style: none;
}

.nav-list > .menu-item:hover > .sub-menu,
.nav-list > .menu-item:focus-within > .sub-menu,
.nav-list > .menu-item.is-open > .sub-menu {
	display: block;
}

.nav-list .sub-menu a {
	display: block;
	padding: 9px 12px;
	color: var(--ig-nav-text);
	font-size: 13px;
	font-weight: 600;
	border-radius: 8px;
}

.nav-list .sub-menu a:hover,
.nav-list .sub-menu a:focus {
	background: var(--ig-accent-soft);
	color: var(--ig-accent);
}

/* ------------------------------------------------------- page headings ---- */

.feed,
.page-wrap {
	width: 100%;
	max-width: var(--ig-container);
	margin: 0 auto;
	padding: 0 16px;
}

/* Homepage runs straight into the grid, no hero above it. */
.feed--flush {
	padding-top: 14px;
}

.feed-hero,
.archive-header {
	padding: 30px 2px 22px;
}

/*
 * Archive headers that carry a profile card are centred, matching the
 * reference layout: eyebrow, title, portrait panel and item count all sit on
 * the same vertical axis. The card keeps its own left-aligned reading text.
 */
.archive-header--profile {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
}

.archive-header--profile .archive-title,
.archive-header--profile .feed-eyebrow,
.archive-header--profile .feed-count {
	text-align: center;
}

.archive-header--profile .idol-profile {
	width: 100%;
	margin: 22px auto 20px;
	text-align: left;
}

.feed-eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0 0 12px;
	padding: 4px 14px;
	background: var(--ig-accent-soft);
	color: var(--ig-accent);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.14em;
	border-radius: 999px;
	text-transform: uppercase;
}

.feed-title,
.archive-title,
.error-title {
	margin: 0 0 8px;
	font-size: clamp(30px, 4.5vw, 44px);
	font-weight: 800;
	letter-spacing: -0.02em;
	line-height: 1.08;
}

.feed-subtitle,
.archive-description,
.archive-meta {
	max-width: 60ch;
	margin: 0 0 14px;
	color: var(--ig-text-soft);
	font-size: 16px;
}

.feed-count {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	padding: 5px 14px;
	background: var(--ig-surface);
	border: 1px solid var(--ig-border);
	border-radius: 999px;
	color: var(--ig-text-soft);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

.feed-count svg {
	width: 14px;
	height: 14px;
	fill: var(--ig-accent);
}

/* ------------------------------------------------ idol profile card ---- */

/*
 * Portrait + biography panel at the top of an idol archive, mirroring the
 * reference layout: square artwork pinned to the left edge of a bordered card,
 * reading text on the right. The card only renders when the term has a portrait
 * or a description, so empty archives keep the plain heading.
 */
.idol-profile {
	display: flex;
	align-items: stretch;
	max-width: 900px;
	margin: 18px auto 18px;
	background: var(--ig-surface);
	border: 1px solid var(--ig-border);
	border-radius: var(--ig-radius);
	overflow: hidden;
}

.idol-profile-media {
	flex: 0 0 190px;
	background: var(--ig-bg);
}

.idol-profile-media img {
	display: block;
	width: 190px;
	height: 100%;
	min-height: 190px;
	object-fit: cover;
}

.idol-profile-body {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 8px;
	padding: 22px 26px;
}

.idol-profile-bio {
	margin: 0;
	color: var(--ig-text-soft);
	font-size: 15.5px;
	line-height: 1.65;
}

.idol-profile-bio p {
	margin: 0 0 10px;
}

.idol-profile-bio p:last-child {
	margin-bottom: 0;
}

.idol-profile-bio strong {
	color: var(--ig-text);
}

@media (max-width: 640px) {
	.idol-profile {
		flex-direction: column;
	}

	.idol-profile-media {
		flex: none;
	}

	.idol-profile-media img {
		width: 100%;
		height: auto;
		max-height: 260px;
		min-height: 0;
	}

	.idol-profile-body {
		padding: 18px 20px;
	}
}

/* -------------------------------------------------- grid + card tiles ---- */

.grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: var(--ig-gap);
	margin: 0;
	padding: 0 0 56px;
	list-style: none;
}

.grid-cell {
	min-width: 0;
}

.grid--related {
	grid-template-columns: repeat(3, 1fr);
	padding-bottom: 0;
}

/*
 * Ten related cards, so a phone (two columns) ends on a full row. From the
 * tablet up the grid is three columns, and there nine is the count that
 * divides evenly — so the tenth card is dropped again on those screens.
 */
@media (min-width: 768px) {
	.grid--related > .grid-cell:nth-child(n + 10) {
		display: none;
	}
}

.card {
	position: relative;
	display: flex;
	flex-direction: column;
	height: 100%;
	background: var(--ig-surface);
	border: 1px solid var(--ig-border);
	border-radius: 14px;
	overflow: hidden;
	box-shadow: var(--ig-shadow-soft);
	transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.card:hover {
	transform: translateY(-4px);
	border-color: var(--ig-accent-line);
	box-shadow: var(--ig-shadow-hover);
}

/* Media: fixed 2:3 portrait frame so every tile aligns perfectly. */

/*
 * .card-media stays static on purpose so the floating badges anchor to the
 * card itself; the stretched overlay on .card-title (see below) can then
 * cover the full card while the badges, icons and rating sit above it.
 */
.card-media {
	aspect-ratio: 2 / 3;
	overflow: hidden;
	background: var(--ig-media);
}

.card-media .card-image,
.card-media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.card:hover .card-media img {
	transform: scale(1.04);
}

/*
 * Stretched link: the title link in .card-body is the card's only link, and
 * its ::after overlay covers the whole card so the entire tile stays
 * clickable. Keeping a single link in the accessibility tree avoids the
 * duplicate, aria-hidden link the card used to ship over the thumbnail.
 *
 * The overlay hangs off the ANCHOR, not the heading. It used to sit on
 * .card-title, which made the bare <h3> the topmost element over the media:
 * a click there hit the heading (which does nothing) instead of the link, so
 * only the title text itself opened the post. Hanging the overlay on the link
 * means the thing covering the card *is* the link, so every click lands on
 * it. The link carries the overlay box instead of clipping it because the
 * ::after is out of flow: the two-line -webkit-box clamp still applies to the
 * text, while the pseudo-element stretches to the positioned .card ancestor.
 */

/*
 * Stretched link overlay. Sits on the heading (which is never clipped and
 * whose containing block is the positioned .card), but the ::after is
 * generated from the LINK so the element covering the tile is the link
 * itself — clicking anywhere on the card follows the title href rather than
 * landing on the inert heading.
 *
 * z-index: 2 keeps it under the badges, icons and rating controls (z-index: 3)
 * so those stay individually reachable, and above the media (z-index: auto).
 */
.card-title a::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 2;
}

.card-image--placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	background: var(--ig-accent-soft);
	color: var(--ig-accent);
	font-size: 56px;
	font-weight: 700;
	text-transform: uppercase;
}

/* Floating pills + media-type icon over the artwork */

.card-badges {
	position: absolute;
	top: 10px;
	left: 10px;
	/*
	 * Clear the media-type icons. The reserve is a custom property rather than
	 * the old fixed 66px because a counted badge grows with its digits: "12"
	 * is wider than "4", and an image + video pair is wider still. The value
	 * is kept in step with .card-type-icons (below), so the pills always stop
	 * short of the icons instead of sliding underneath them.
	 */
	right: var(--ig-card-badges-reserve, 62px);
	z-index: 3;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	/*
	 * The strip itself lets clicks fall through to the stretched title link
	 * (so tapping the empty part of the row still opens the post), while the
	 * pills re-enable pointer events below so the category links stay tappable.
	 * Previously the whole strip was pointer-events: none, which left the pills
	 * inert — a click there fell through to the card instead of the tag link.
	 */
	pointer-events: none;
}

/*
 * Media-type icons float in the top-right corner of the artwork. A single
 * icon (image-only, gallery, video) renders alone; when a post carries an
 * image *and* video the row shows both small icons side by side, mirroring
 * the GeneratePress dark gallery's video badge treatment.
 */
.card-type-icons {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 3;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	/*
	 * Never let the icon row run under the pills: the widest realistic row is
	 * an image counter ("999" + glyph) beside the video badge. When even that
	 * does not fit, the glyphs give way rather than the pills, because the
	 * pills carry the readable text.
	 */
	max-width: calc(100% - var(--ig-card-badges-reserve, 62px) - 10px);
	justify-content: flex-end;
	overflow: hidden;
}

.card-type-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	/* An icon-only badge stays a square; a counted badge widens into a pill. */
	gap: 4px;
	min-width: 26px;
	width: auto;
	height: 26px;
	padding: 0 5px;
	background: rgba(23, 19, 31, 0.55);
	color: #fff;
	border-radius: 8px;
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
}

/* The video companion badge leans on the accent so the two icons read apart. */
.card-type-icons .card-type-icon--video:not(:only-child) {
	background: var(--ig-accent, #7144b1);
}

/* The figure a multi-image badge prints, in the same white as the glyph. */
.card-type-icon-count {
	font-size: 14px;
	/* A tight, tabular figure keeps the pill width predictable at any count. */
	font-weight: 700;
	line-height: 1;
	letter-spacing: -0.01em;
	font-variant-numeric: tabular-nums;
}

.card-type-icon svg {
	display: block;
	flex: 0 0 auto; /* the glyph keeps its box; the figure never squashes it */
	width: 14px;
	height: 14px;
	fill: currentColor;
}

/*
 * The video badge draws a stroked film frame rather than a filled shape, so it
 * opts out of the fill above; the stroke follows the badge's own colour.
 */
.card-type-icon--video svg,
.card-type-icon--embed svg {
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
}

/*
 * Re-enable clicks on the tag pill after .card-badges turns them off for the
 * strip as a whole. Without this the pill inherited pointer-events: none and
 * its href could never be followed from the grid.
 */
.card-badges .btn-tag {
	pointer-events: auto;
}

a.btn.btn-tag,
.btn.btn-tag {
	/*
	 * The pill is a flex container (rather than inline-block), so the icons in
	 * the card corner can sit truly beside it instead of over the wrapper:
	 * max-width lets a long category name ellipsise, and min-width: 0 keeps the
	 * text from forcing the pill wider than the room the card leaves it.
	 */
	display: inline-flex;
	align-items: center;
	max-width: 100%;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	padding: 3px 10px;
	background: rgba(23, 19, 31, 0.55);
	border: 0;
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	line-height: 1.6;
	border-radius: 999px;
	letter-spacing: 0.8px;
	text-transform: uppercase;
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	transition: background-color 0.15s ease;
}

a.btn.btn-tag:hover,
a.btn.btn-tag:focus,
.btn.btn-tag:hover,
.btn.btn-tag:focus {
	background: var(--ig-accent);
	color: #fff;
}

a.btn.btn-tag.btn-premium,
.btn.btn-tag.btn-premium {
	background: rgba(23, 19, 31, 0.55);
	box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.9);
}

/* Card body */

.card-body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	gap: 8px;
	padding: 12px 14px 13px;
}

.card-title {
	margin: 0;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.35;
}

/*
 * Stacking, top layer to bottom: .card-badges / .card-type-icons (z-index: 3)
 * and the rating controls stay clickable above everything; the stretched
 * overlay on .card-title sits just under them at z-index: 2 so the rest of the
 * tile clicks through; the media (z-index: auto) stays underneath.
 *
 * The link itself is lifted to z-index: 3 so its own text stays directly
 * clickable and keeps its hover colour, but it stays position: static so it
 * never opens a stacking context that would trap the heading's overlay.
 */
.card-title a {
	/*
	 * Deliberately NOT positioned. If the link were position: relative it would
	 * become the containing block for its own ::after, and inset: 0 would then
	 * resolve to the link's padding box (~270x20) instead of the card — the
	 * overlay would collapse onto the title and only the text would be
	 * clickable. Left static, the overlay resolves against the positioned .card
	 * and stretches over the whole tile.
	 */
	color: var(--ig-text);
	transition: color 0.15s ease;
}

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

/*
 * Two-line title clamp. Applied to the inner span so the link above it stays
 * a static, unclipped box — clipping the link would clip its stretched
 * overlay to the title box.
 */
@media (min-width: 768px) {
	.card-title-text {
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 2;
		line-clamp: 2;
		overflow: hidden;
	}
}

.card-meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-top: auto;
}

.card-date {
	position: relative;
	z-index: 3;
	color: var(--ig-text-soft);
	font-size: 12px;
	font-weight: 600;
}

/* Card rating reuses the shared controls at a compact scale. */

.card-rating {
	position: relative;
	z-index: 3;
}

.card-rating .rating-btn {
	padding: 2px;
}

.card-rating .rating-btn svg {
	width: 15px;
	height: 15px;
}

.card-rating .rating-value {
	font-size: 11px;
	padding: 1px 7px;
	border-radius: 999px;
}

/* ----------------------------------------------------------- rating ------- */

.rating-controls {
	display: flex;
	align-items: center;
	gap: 4px;
	font-size: 1.15em;
}

.rating-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 5px;
	background: none;
	border: 0;
	border-radius: 8px;
	color: var(--ig-text-soft);
	cursor: pointer;
	transition: color 0.15s ease, background-color 0.15s ease;
}

.rating-btn svg {
	display: block;
	width: 18px;
	height: 18px;
	fill: currentColor;
}

.rating-btn:hover,
.rating-btn:focus-visible {
	color: var(--ig-accent);
	background: var(--ig-accent-soft);
}

.rating-btn--up.is-active {
	color: var(--ig-vote-up);
}

.rating-btn--down.is-active {
	color: var(--ig-vote-down);
}

.rating-btn--up:hover,
.rating-btn--up:focus-visible {
	color: var(--ig-vote-up);
}

.rating-btn--down:hover,
.rating-btn--down:focus-visible {
	color: var(--ig-vote-down);
}

.rating-value {
	display: inline-block;
	padding: 2px 9px;
	background: var(--ig-accent-soft);
	color: var(--ig-text);
	font-weight: 700;
	font-size: 12px;
	border-radius: 999px;
}

.rating-value.is-busy {
	opacity: 0.5;
}

.rating-controls--inline {
	gap: 2px;
	font-size: 15px;
}

.rating-controls--inline .rating-btn svg {
	width: 19px;
	height: 19px;
}

.post-info-views {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--ig-text-soft);
	font-size: 13px;
}

.post-info-views svg {
	width: 16px;
	height: 16px;
	fill: var(--ig-accent);
}

.post-info-views-value {
	font-weight: 600;
}

/* ------------------------------------------------------- pagination ------- */

/*
 * Numbered pages with prev/next. The current page is a non-interactive span
 * rendered by idol_gallery_pagination(); the is-current item carries it.
 */

.gallery-pagination {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	padding: 8px 12px 48px;
}

.pagination {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.pagination .page-numbers {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 42px;
	height: 42px;
	padding: 0 14px;
	background: var(--ig-surface);
	color: var(--ig-accent);
	font-size: 15px;
	font-weight: 700;
	line-height: 1;
	text-decoration: none;
	border: 1px solid var(--ig-border);
	border-radius: 999px;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.pagination a.page-numbers:hover,
.pagination a.page-numbers:focus-visible {
	background: var(--ig-accent);
	color: #fff;
	border-color: var(--ig-accent);
}

.pagination .page-numbers.current {
	background: var(--ig-accent);
	color: #fff;
	border-color: var(--ig-accent);
	cursor: default;
}

.pagination .page-numbers.dots {
	min-width: 24px;
	padding: 0 2px;
	background: none;
	color: var(--ig-text-soft);
	border-color: transparent;
}

.pagination .is-prev .page-numbers,
.pagination .is-next .page-numbers {
	min-width: 46px;
	font-size: 18px;
}

.pagination-status {
	margin: 0;
	color: var(--ig-text-soft);
	font-size: 13px;
	letter-spacing: 0.02em;
}

.pagination-status strong {
	color: var(--ig-text);
}

@media (max-width: 480px) {
	.pagination .page-numbers {
		min-width: 38px;
		height: 38px;
		padding: 0 10px;
		font-size: 14px;
	}
}

/* --------------------------------------------------------- single view ---- */

.single-media {
	width: 100%;
	max-width: var(--ig-container);
	margin: 0 auto;
	padding: 18px 16px 56px;
}

.breadcrumb {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 8px;
	padding: 2px 0 16px;
	color: var(--ig-text-soft);
	font-size: 13px;
	text-align: center;
}

.breadcrumb a.crumb {
	color: var(--ig-text-soft);
	font-weight: 600;
}

.breadcrumb a.crumb:hover,
.breadcrumb a.crumb:focus {
	color: var(--ig-accent);
}

.crumb-sep {
	color: var(--ig-accent-line);
}

.crumb-current {
	overflow: hidden;
	color: var(--ig-text);
	font-weight: 600;
	text-overflow: ellipsis;
	white-space: nowrap;
	max-width: 100%;
}

.single-header {
	padding: 4px 0 22px;
}

.single-tags {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-bottom: 14px;
}

/*
 * The single post title is visually hidden, matching the GeneratePress
 * single layout where the tag pills and meta lead straight into the media
 * viewer. It stays in the markup for screen readers and SEO.
 */
.single-title {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	border: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.single-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 10px 14px;
	color: var(--ig-text-soft);
	font-size: 14px;
}

.post-date-inside {
	color: var(--ig-text-soft);
	font-size: 14px;
	font-weight: 600;
}

.meta-sep {
	color: var(--ig-accent-line);
}

.meta-source {
	overflow: hidden;
	font-weight: 600;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.post-info-wrapper {
	display: flex;
	align-items: center;
	gap: 14px;
}

/* Media viewer: art-hugging stage with thumbnail strip. */

.viewer {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.viewer-stage {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: center;
	width: fit-content;
	max-width: 100%;
	height: auto;
	margin: 0 auto;
	background: var(--ig-ink);
	border-radius: var(--ig-radius-lg);
	box-shadow: var(--ig-shadow);
	overflow: hidden;
}

.viewer-image {
	display: block;
	width: auto;
	height: auto;
	max-width: 100%;
	/* Keep the whole artwork on screen under the sticky header. */
	max-height: calc(100dvh - var(--ig-header-h) - 56px);
	object-fit: contain;
}

.post-media-item {
	display: none;
	opacity: 0;
	transition: opacity 0.2s ease;
}

.post-media-item.active {
	display: block;
	opacity: 1;
}

.post-media {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	padding: 6px;
	overflow: hidden;
}

/*
 * Video viewer. The stage paints --ig-ink so images sit on a dark mat; a video
 * post must not inherit that padding, otherwise the player floats inside a
 * black frame. Reset the stage mat here and let the clip fill the column so it
 * reads as one centred item.
 */
.viewer[data-media-type="video"] .viewer-stage,
.viewer[data-media-type="embed"] .viewer-stage {
	width: 100%;
	max-width: 960px;
	background: transparent;
	box-shadow: none;
	border-radius: 0;
	overflow: visible;
}

.post-media--video {
	position: relative;
	display: block;
	width: 100%;
	max-width: 960px;
	height: auto;
	margin: 0 auto;
	padding: 0;
	overflow: visible;
	text-align: center;
}

/* The clip itself: centred, width-capped, never taller than the viewport. */
.post-media--video video,
.post-media--video .wp-video-shortcode,
.post-media--video .mejs-container {
	display: block;
	/*
	 * The player is sized from the clip's own ratio: the width is the
	 * smaller of the column and the height budget scaled by that ratio, so
	 * the frame hugs the video and the native controls sit right under the
	 * picture instead of across a wide empty mat. The script fills in the
	 * ratio once the metadata has loaded; the 9/16 default is the fallback.
	 */
	width: min(100%, calc(var(--ig-video-h) * var(--ig-video-rw, 9) / var(--ig-video-rh, 16))) !important;
	height: auto !important;
	max-width: 100%;
	/* The player and its controls have to fit between the post header and
	   the fold, so the box is bounded rather than left to the clip's own
	   ratio. object-fit keeps the frame undistorted inside that box. */
	max-height: var(--ig-video-h);
	margin: 0 auto;
	background: #000;
	border-radius: var(--ig-radius-lg);
	box-shadow: var(--ig-shadow);
}

/* The shortcode wrapper is a plain box around the player, not a frame. */
.post-media--video .wp-video {
	display: block;
	width: 100% !important;
	max-width: 100%;
	margin: 0 auto;
}

/* The generated <video> keeps its own poster ratio; bound it to the same box. */
.post-media--video video {
	object-fit: contain;
}

.post-media--video iframe {
	display: block;
	width: 100%;
	max-width: 100%;
	/* The provider's own height attribute must not win over the ratio. */
	height: auto !important;
	margin: 0 auto;
	aspect-ratio: 16 / 9;
	border: 0;
	border-radius: var(--ig-radius-lg);
	box-shadow: var(--ig-shadow);
}

/* Trailing copy the posting pipeline writes under the player. */
.post-media--video p {
	margin: 14px auto 0;
	max-width: 720px;
	color: var(--ig-text-soft);
	font-size: 14px;
	text-align: center;
}

.post-media--video .wp-block-video {
	margin: 0 auto;
	max-width: 100%;
}

.post-thumbs {
	display: flex;
	align-items: center;
	justify-content: center;
	/* Keeps the strip scrollable without clipping when it overflows wide galleries. */
	justify-content: safe center;
	gap: 8px;
	margin: 0;
	padding: 6px 2px 2px;
	overflow-x: auto;
	scroll-behavior: smooth;
	scrollbar-width: thin;
}

.post-thumb {
	flex-shrink: 0;
	width: 68px;
	height: 68px;
	padding: 0;
	background: var(--ig-media);
	border: 2px solid transparent;
	border-radius: 10px;
	overflow: hidden;
	cursor: pointer;
	transition: border-color 0.15s ease;
}

.post-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}

.post-thumb.active {
	border-color: var(--ig-accent);
}

/* Reading column */

.single-body {
	max-width: 760px;
	margin: 26px auto 0;
}

.single-content {
	max-width: 74ch;
}

.entry-content p {
	margin: 0 0 1.2em;
}

.entry-content > p:last-child {
	margin-bottom: 0;
}

.entry-content h2,
.entry-content h3 {
	margin: 1.4em 0 0.6em;
}

.entry-content img {
	max-width: 100%;
	height: auto;
	border-radius: var(--ig-radius);
}

/*
 * When the media viewer owns the gallery (GeneratePress-style switcher),
 * images are hoisted out of the reading column, so the originals inside the
 * post body stay hidden to avoid duplicates.
 */
.single-media--mediaonly .single-content img {
	display: none;
}

.entry-content blockquote {
	margin: 1.2em 0;
	padding: 0.4em 0 0.4em 16px;
	border-left: 4px solid var(--ig-accent);
	color: var(--ig-text-soft);
}

.single-hashtags {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-top: 20px;
}

.single-actions {
	display: flex;
	justify-content: center;
	padding-top: 18px;
	margin-top: 18px;
	border-top: 1px solid var(--ig-border);
}

.single-actions .btn-outline {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 1px;
}

.single-actions .btn-outline svg {
	width: 15px;
	height: 15px;
	fill: currentColor;
}

/* Previous / next / back-to-home */

.post-navigation {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	max-width: 980px;
	margin: 40px auto 0;
	padding-top: 22px;
	border-top: 1px solid var(--ig-border);
}

.post-nav-link {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	max-width: 34%;
	min-height: 44px;
	color: var(--ig-text-soft);
	transition: color 0.15s ease;
}

.post-nav-link:hover,
.post-nav-link:focus {
	color: var(--ig-accent);
}

.post-nav-link--next {
	text-align: right;
}

.post-nav-arrow {
	font-size: 26px;
	line-height: 1;
	color: var(--ig-accent);
}

.post-nav-text {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.post-nav-label {
	color: var(--ig-text-soft);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.post-nav-title {
	overflow: hidden;
	color: var(--ig-text);
	font-size: 14px;
	font-weight: 700;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.post-nav-link:hover .post-nav-title,
.post-nav-link:focus .post-nav-title {
	color: var(--ig-accent);
}

.post-nav-home {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	min-height: 44px;
	padding: 8px 18px;
	background: var(--ig-accent-soft);
	border-radius: 999px;
	color: var(--ig-accent);
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.post-nav-home:hover,
.post-nav-home:focus {
	background: var(--ig-accent);
	color: #fff;
}

.post-nav-home svg {
	width: 15px;
	height: 15px;
	fill: currentColor;
}

.post-nav-spacer {
	flex: 0 0 1px;
}

/* ------------------------------------------------------- related grid ----- */

.related {
	margin-top: 56px;
}

.related-head {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 0 0 16px;
}

.related-title {
	margin: 0;
	font-size: 22px;
	font-weight: 800;
	letter-spacing: -0.01em;
}

.related-title::before {
	content: "";
	flex: 0 0 auto;
	display: inline-block;
	width: 4px;
	height: 20px;
	background: var(--ig-accent);
	border-radius: 999px;
}

/* --------------------------------------------------------- shared boxes ---- */

.box {
	background: var(--ig-surface);
	border: 1px solid var(--ig-border);
	border-radius: var(--ig-radius-lg);
	box-shadow: var(--ig-shadow-soft);
	padding: 24px;
}

.empty-state,
.error-404 {
	max-width: 640px;
	margin: 40px auto;
	text-align: center;
}

.empty-title,
.error-title {
	font-size: 32px;
}

.empty-text,
.error-text {
	color: var(--ig-text-soft);
}

.search-form {
	display: flex;
	align-items: center;
	gap: 8px;
	max-width: 480px;
	margin: 12px 0;
}

.search-field {
	flex: 1 1 auto;
	min-width: 0;
	padding: 10px 14px;
	background: var(--ig-surface);
	color: var(--ig-text);
	border: 1px solid var(--ig-border);
	border-radius: var(--ig-radius);
}

.search-field:focus {
	border-color: var(--ig-accent);
	outline: 2px solid var(--ig-accent-soft);
}

.btn {
	display: inline-block;
	padding: 8px 16px;
	background: var(--ig-surface);
	color: var(--ig-text);
	border: 1px solid var(--ig-border);
	border-radius: var(--ig-radius);
	cursor: pointer;
	text-align: center;
}

.btn:hover {
	border-color: var(--ig-accent);
	color: var(--ig-accent);
}

.btn-primary,
.search-submit {
	background: var(--ig-accent);
	border-color: var(--ig-accent);
	color: #fff;
}

.btn-primary:hover,
.search-submit:hover {
	background: var(--ig-accent-hover);
	border-color: var(--ig-accent-hover);
	color: #fff;
}

.btn-outline {
	background: none;
	border-color: var(--ig-accent);
	color: var(--ig-accent);
}

/* Outline tag pills (single view) */

a.btn-outline-tag,
.btn-outline-tag {
	display: inline-block;
	padding: 4px 14px;
	background: var(--ig-surface);
	border: 1px solid var(--ig-accent-line);
	border-radius: 999px;
	color: var(--ig-accent);
	font-size: 12px;
	font-weight: 700;
	line-height: 1.6;
	letter-spacing: 0.6px;
	text-transform: uppercase;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

a.btn-outline-tag:hover,
a.btn-outline-tag:focus {
	background: var(--ig-accent);
	border-color: var(--ig-accent);
	color: #fff;
}

a.btn-outline-tag--premium,
.btn-outline-tag--premium {
	border-color: var(--ig-accent);
	border-style: dashed;
}

a.btn-outline-tag--light,
.btn-outline-tag--light {
	border-color: var(--ig-border);
	color: var(--ig-text-soft);
	text-transform: none;
	letter-spacing: 0;
}

a.btn-outline-tag--light:hover,
a.btn-outline-tag--light:focus {
	background: var(--ig-accent-soft);
	border-color: var(--ig-accent-line);
	color: var(--ig-accent);
}

/* ----------------------------------------------------------- A-Z index ---- */

.az-nav {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
	padding: 12px 2px 20px;
}

.az-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	padding: 5px 9px;
	background: var(--ig-surface);
	color: var(--ig-accent);
	font-size: 14px;
	font-weight: 700;
	text-transform: uppercase;
	border: 1px solid var(--ig-border);
	border-radius: 8px;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.az-link:hover,
.az-link:focus {
	background: var(--ig-accent);
	border-color: var(--ig-accent);
	color: #fff;
}

.az-link--empty {
	color: #c9c3d6;
	background: none;
	border-color: transparent;
	cursor: default;
}

.az-sections {
	padding-bottom: 40px;
}

.az-section {
	padding: 18px 0;
	border-bottom: 1px solid var(--ig-border);
	scroll-margin-top: calc(var(--ig-header-h) + 16px);
}

.az-heading {
	margin: 0 0 10px;
	color: var(--ig-accent);
	font-size: 22px;
	text-transform: uppercase;
	letter-spacing: 2px;
}

.az-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 4px 18px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.az-item a {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px;
	padding: 3px 0;
	color: var(--ig-text);
}

.az-item a:hover {
	color: var(--ig-accent);
}

.az-count {
	color: var(--ig-text-soft);
	font-size: 13px;
}

.az-back {
	display: inline-block;
	margin-top: 12px;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 1px;
}

/* ------------------------------------------------------------- creators --- */

.creator-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: var(--ig-gap);
	margin: 0;
	padding: 0 0 60px;
	list-style: none;
}

.creator-card {
	border-radius: 14px;
}

.creator-card-link {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 16px;
	color: var(--ig-text);
}

.creator-card-link:hover .creator-name {
	color: var(--ig-accent);
}

.creator-avatar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	background: var(--ig-accent-soft);
	color: var(--ig-accent);
	border-radius: 50%;
	font-weight: 700;
	text-transform: uppercase;
}

.creator-name {
	font-weight: 700;
}

.creator-count {
	margin-left: auto;
	color: var(--ig-text-soft);
	font-size: 13px;
}

/* --------------------------------------------------------------- pages ---- */

.page-article {
	margin: 24px 0;
}

.entry-title {
	font-size: 32px;
}

.entry-thumbnail {
	margin: 0 0 18px;
}

.entry-thumbnail img {
	width: 100%;
	border-radius: var(--ig-radius);
}

.entry-content {
	max-width: 76ch;
}

.comments-area,
.comment-respond {
	margin: 24px 0;
}

.comment-list {
	margin: 0;
	padding: 0 0 0 4px;
	list-style: none;
}

.comment-list .children {
	margin-left: 24px;
	list-style: none;
}

.comment-body {
	padding: 12px 0;
	border-bottom: 1px solid var(--ig-border);
}

.comment-meta {
	font-size: 14px;
	color: var(--ig-text-soft);
}

.comment-form label {
	display: block;
	margin-bottom: 4px;
	font-size: 14px;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--ig-border);
	border-radius: var(--ig-radius);
}

.comment-form input:focus,
.comment-form textarea:focus {
	border-color: var(--ig-accent);
	outline: 2px solid var(--ig-accent-soft);
}

/* -------------------------------------------------------------- footer ---- */

.site-footer {
	margin-top: 48px;
	border-top: 1px solid var(--ig-border);
	background: var(--ig-surface);
}

.footer-inner {
	max-width: var(--ig-container);
	margin: 0 auto;
	padding: 32px 16px 24px;
}

.footer-top {
	display: flex;
	flex-wrap: wrap;
	gap: 16px 32px;
	align-items: center;
	justify-content: space-between;
	padding-bottom: 22px;
	border-bottom: 1px solid var(--ig-border);
}

/* The desktop lockup is always visible in the footer. */
.footer-brand .brand-name {
	font-size: 19px;
}

.footer-brand .brand-title {
	font-size: 10px;
}

.footer-brand .brand-mark {
	width: 30px;
	height: 30px;
}

.footer-brand .brand-logo {
	height: 30px;
}

.footer-menu {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 20px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.footer-menu a {
	color: var(--ig-nav-text);
	font-size: 13px;
	font-weight: 600;
	transition: color 0.15s ease;
}

.footer-menu a:hover,
.footer-menu a:focus {
	color: var(--ig-accent);
}

.footer-widgets {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
	padding: 22px 0;
}

.footer-widgets .widget-title {
	font-size: 14px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--ig-text);
}

.footer-widgets ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.footer-widgets li {
	margin-bottom: 6px;
	font-size: 14px;
}

.footer-note {
	color: var(--ig-text-soft);
	font-size: 13px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 1px;
}

.footer-legal {
	margin-top: 6px;
	padding: 16px 18px;
	background: var(--ig-bg);
	border: 1px solid var(--ig-border);
	border-radius: var(--ig-radius-lg);
	color: var(--ig-text-soft);
	font-size: 12px;
}

.legal-18 {
	margin: 0 0 6px;
	color: var(--ig-accent);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 1px;
}

.legal-note {
	margin: 0 0 6px;
	line-height: 1.6;
}

.footer-extra {
	margin-top: 10px;
	padding: 0 4px;
	color: var(--ig-text-soft);
	font-size: 13px;
}

/*
 * Long-form homepage copy. Sits between the legal notice and the copyright
 * baseline, capped at 78ch so it stays readable inside the 1320px container,
 * and set one step quieter than body text because it is background reading
 * rather than the page's main argument.
 */
.footer-prose {
	max-width: 78ch;
	margin: 22px 0 0;
	padding: 18px 0 0;
	border-top: 1px solid var(--ig-border);
	color: var(--ig-text-soft);
	font-size: 13.5px;
	line-height: 1.75;
}

.footer-prose p {
	margin: 0;
}

.footer-bottom {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px 24px;
	padding-top: 18px;
	margin-top: 20px;
	border-top: 1px solid var(--ig-border);
	color: var(--ig-text-soft);
	font-size: 13px;
}

.footer-copyright {
	margin: 0;
}

.footer-baseline-links {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 20px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.footer-baseline-links a {
	color: var(--ig-text-soft);
	font-weight: 600;
}

.footer-baseline-links a:hover,
.footer-baseline-links a:focus {
	color: var(--ig-accent);
}

/* --------------------------------------------------------- responsive ---- */

@media (max-width: 1023px) {
	.grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (max-width: 991px) {
	:root {
		--ig-header-h: 56px;
	}

	.header-bar {
		gap: 8px;
	}

	/* The menu drops into a full-width drawer under the bar. */
	.header-nav {
		position: absolute;
		/*
		 * 100% of the header rather than a fixed offset, so the drawer always
		 * starts under the bar even when the bar has grown to fit a wrapped
		 * row of links.
		 */
		top: 100%;
		left: 0;
		right: 0;
		display: none;
		max-height: calc(100dvh - var(--ig-header-h) - 24px);
		margin: 0;
		overflow-y: auto;
		background: var(--ig-surface);
		border-top: 1px solid var(--ig-border);
		box-shadow: var(--ig-shadow);
	}

	.header-nav.is-open {
		display: block;
	}

	.nav-list {
		flex-direction: column;
		align-items: stretch;
		/* A column that wraps would spill into a second column sideways. */
		flex-wrap: nowrap;
		justify-content: flex-start;
		gap: 0;
		padding: 6px 0 10px;
	}

	.nav-list > .menu-item > a {
		display: block;
		padding: 13px 20px;
		/* Long labels wrap inside the drawer instead of running off it. */
		white-space: normal;
		border-radius: 0;
		border-bottom: 1px solid var(--ig-border);
	}

	.nav-list .sub-menu {
		position: static;
		display: block;
		max-height: none;
		margin: 0;
		padding: 0 12px 8px;
		border: 0;
		border-radius: 0;
		box-shadow: none;
		background: none;
	}

	.nav-list .sub-menu a {
		padding: 10px 12px 10px 32px;
	}

	.navbar-toggler {
		display: inline-flex;
	}

	.single-media {
		padding: 14px 12px 44px;
	}

	.viewer-stage .viewer-image {
		max-height: 65dvh;
	}

	/* The player should claim most of a phone screen without clipping. */
	.post-media--video video,
	.post-media--video .wp-video-shortcode,
	.post-media--video .mejs-container {
		max-height: var(--ig-video-h);
	}

	/* The mobile lockup shrinks to fit the 56px bar. */
	.site-header .brand-mark {
		width: 28px;
		height: 28px;
	}

	.site-header .brand-logo {
		height: 28px;
	}

	.site-header .brand-title {
		font-size: 10px;
	}

	.site-header .brand-name {
		/*
		 * Fluid so a full-width translation (Japanese, Thai, Chinese) still
		 * fits next to the switcher and the menu button on a narrow phone.
		 */
		font-size: clamp(15px, 5.4vw, 21px);
	}
}

@media (min-width: 1600px) {
	:root {
		--ig-container: 1560px;
	}

	.grid {
		grid-template-columns: repeat(5, 1fr);
	}
}

@media (max-width: 767px) {
	:root {
		--ig-gap: 10px;
		/*
		 * A two-column phone tile is only ~176px wide, so the icons get a
		 * tighter reserve and a smaller counter. The row still stops short of
		 * the pills, it just claims less of the tile to do it.
		 */
		--ig-card-badges-reserve: 50px;
	}

	.grid {
		grid-template-columns: repeat(2, 1fr);
		padding-bottom: 40px;
	}

	.grid--related {
		grid-template-columns: repeat(2, 1fr);
	}

	.card {
		border-radius: 12px;
	}

	.card-body {
		gap: 6px;
		padding: 9px 10px 10px;
	}

	.card-type-icon-count {
		font-size: 12px;
	}

	.card-title {
		font-size: 13.5px;
	}

	.card-rating .rating-btn {
		padding: 4px;
	}

	.card-rating .rating-btn svg {
		width: 14px;
		height: 14px;
	}

	.card-rating .rating-value {
		font-size: 10px;
		padding: 2px 6px;
	}

	.feed-hero,
	.archive-header {
		padding: 22px 0 18px;
	}

	.header-search .search-form,
	.post-info-wrapper {
		margin-left: 0;
	}

	.view-feed .post-info-wrapper {
		margin-left: 0;
	}

	.post-navigation {
		gap: 10px;
	}

	.post-nav-text {
		display: none;
	}

	.post-nav-spacer {
		display: none;
	}

	.post-nav-link {
		flex: 1 1 0;
		justify-content: center;
		padding: 10px 14px;
		background: var(--ig-surface);
		border: 1px solid var(--ig-border);
		border-radius: 999px;
		max-width: none;
	}

	.post-nav-home {
		flex: 2 1 0;
	}
}

@media (max-width: 480px) {
	.feed,
	.page-wrap,
	.single-media {
		padding-left: 12px;
		padding-right: 12px;
	}

	.viewer-stage .viewer-image {
		max-height: 70dvh;
	}

	.post-thumb {
		width: 56px;
		height: 56px;
	}

	.footer-widgets {
		grid-template-columns: 1fr;
	}

	.header-bar {
		padding: 0 12px;
	}
}

@media (prefers-reduced-motion: reduce) {
	* {
		animation-duration: 0.001ms !important;
		transition-duration: 0.001ms !important;
	}

	html {
		scroll-behavior: auto;
	}
}

/* ------------------------------------------------- back to top + switcher --- */

/*
 * Back to top: mirrors the GeneratePress control — a fixed square in the
 * bottom-right that fades in once the page is scrolled. The markup ships
 * `hidden`, so with JS disabled the control simply never appears.
 */
.back-to-top {
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 40;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	background: var(--ig-accent);
	color: #fff;
	border: 0;
	border-radius: 50%;
	box-shadow: var(--ig-shadow);
	cursor: pointer;
	opacity: 0;
	transform: translateY(16px);
	transition: opacity 0.25s ease, transform 0.25s ease, background-color 0.15s ease;
}

.back-to-top[hidden] {
	display: none;
}

.back-to-top.is-visible {
	opacity: 1;
	transform: translateY(0);
}

.back-to-top svg {
	width: 22px;
	height: 22px;
	fill: currentColor;
}

.back-to-top:hover,
.back-to-top:focus-visible {
	background: var(--ig-accent-hover);
}

/*
 * Language switcher: a header control that wraps whichever multilingual
 * plugin switcher is active. Renders nothing at all when no plugin is
 * loaded, so the header never shows a dead icon.
 */
.lang-switcher {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 0 10px 0 8px;
	height: 40px;
	border-radius: 999px;
	color: var(--ig-nav-text);
}

.lang-switcher-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
}

.lang-switcher-icon svg {
	width: 20px;
	height: 20px;
	fill: currentColor;
}

.lang-switcher-body {
	display: inline-flex;
	align-items: center;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
}

/* Plugin switchers arrive with wildly different markup; normalise the common
   shapes (TranslatePress list/dropdown, Polylang list, WPML list). */
.lang-switcher-body ul,
.lang-switcher-body .trp-ls-shortcode-language,
.lang-switcher-body .trp-language-switcher-container {
	margin: 0;
	padding: 0;
	list-style: none;
}

.lang-switcher-body li {
	margin: 0;
	padding: 0;
}

.lang-switcher-body a,
.lang-switcher-body select {
	color: inherit;
	font: inherit;
	text-decoration: none;
	background: none;
	border: 0;
	cursor: pointer;
}

.lang-switcher-body a:hover,
.lang-switcher-body a:focus-visible {
	color: var(--ig-accent);
}

.lang-switcher-body select {
	appearance: none;
	-webkit-appearance: none;
	padding-right: 4px;
}

@media (max-width: 991px) {
	/*
	 * The globe badge was removed, so the plugin's own current-language control
	 * (flag + native name) is what stays visible when the header tightens — the
	 * switcher must never collapse to nothing.
	 */
	.lang-switcher {
		padding: 0;
		gap: 0;
	}

	.lang-switcher-body .trp-shortcode-switcher__wrapper {
		display: inline-flex;
		padding: 0;
	}

	/*
	 * Only the flag is left on a phone, so the plugin's item padding is
	 * dead weight here. It was eating 20px of a bar that a translated brand
	 * badly needs — the Japanese wordmark is full-width and was pushing the
	 * menu button off the edge of the screen.
	 */
	.lang-switcher-body .trp-current-language-item__wrapper .trp-language-item {
		padding-left: 0;
		padding-right: 0;
	}

	/*
	 * Keep the current language's flag and drop only its name: hiding the whole
	 * .trp-current-language-item__wrapper also collapsed the flag's containing
	 * block, which left the switcher 0px wide with nothing to show.
	 */
	.lang-switcher-body .trp-current-language-item__wrapper {
		display: inline-flex;
		align-items: center;
		padding-right: 0;
	}

	.lang-switcher-body .trp-language-item-name,
	.lang-switcher-body .trp-shortcode-arrow {
		display: none;
	}
}

@media (max-width: 480px) {
	.back-to-top {
		right: 14px;
		bottom: 14px;
		width: 40px;
		height: 40px;
	}
}

/* ------------------------------------------- dark mode toggle + polish ---- */

/*
 * Light/dark switch.
 *
 * A 52x28 pill: the track cross-fades its background while the thumb slides
 * from the light end to the dark end, and the two glyphs (sun / moon) swap by
 * rotating and fading. Only transform / opacity / background are animated, so
 * the switch stays on the compositor and never reflows the header. It sits in
 * the same .header-actions cluster as the language switcher and the search
 * control, at the same 40px hit height, so the three read as one group.
 */
.theme-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	/*
	 * Intrinsic width, fixed 40px hit height. The button must be at least as
	 * wide as the 52px track: a hard 40px width made the track a shrunken
	 * (flex-shrink: 1) 40px item while the thumb still travelled 24px, so the
	 * thumb overran the right edge by 9px in dark mode.
	 */
	flex: 0 0 auto;
	width: auto;
	min-width: 52px;
	height: 40px;
	padding: 0;
	margin: 0 2px;
	background: none;
	border: 0;
	color: var(--ig-nav-text);
	cursor: pointer;
	border-radius: 999px;
	transition: color 0.2s ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
	color: var(--ig-accent);
}

.theme-toggle-track {
	position: relative;
	display: block;
	/* Never let the flex parent compress the pill below its designed size. */
	flex: 0 0 auto;
	width: 52px;
	height: 28px;
	background: var(--ig-border);
	border: 1px solid var(--ig-accent-line);
	border-radius: 999px;
	transition: background-color 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
}

.theme-toggle:hover .theme-toggle-track {
	box-shadow: 0 0 0 3px var(--ig-accent-soft);
}

/* The thumb carries both glyphs; the inactive one is rotated out of view. */
.theme-toggle-thumb {
	position: absolute;
	top: 2px;
	left: 2px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	background: var(--ig-surface);
	border-radius: 50%;
	box-shadow: 0 1px 3px rgba(27, 22, 38, 0.28);
	transition: transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.28s ease;
}

.theme-toggle-icon {
	position: absolute;
	width: 13px;
	height: 13px;
	fill: currentColor;
	transition: opacity 0.24s ease, transform 0.32s ease;
}

.theme-toggle-icon--sun {
	color: var(--ig-accent);
	opacity: 1;
	transform: rotate(0deg) scale(1);
}

.theme-toggle-icon--moon {
	color: var(--ig-accent);
	opacity: 0;
	transform: rotate(-90deg) scale(0.4);
}

/* Dark: thumb slides right, track darkens, glyphs swap. */
html[data-theme="dark"] .theme-toggle-track {
	background: var(--ig-accent-soft);
	border-color: var(--ig-accent);
}

html[data-theme="dark"] .theme-toggle-thumb {
	/*
	 * left/top resolve against the track's padding box, so the travel is:
	 * 52px track - 2x1px border - 2px inset - 22px thumb - 2px inset = 24px.
	 * The track is flex: 0 0 auto and the button is min-width: 52px, so this
	 * distance is always measured against a real 52px pill.
	 */
	transform: translateX(24px);
	background: var(--ig-accent);
}

html[data-theme="dark"] .theme-toggle-icon--sun {
	opacity: 0;
	transform: rotate(90deg) scale(0.4);
}

html[data-theme="dark"] .theme-toggle-icon--moon {
	opacity: 1;
	color: #fff;
	transform: rotate(0deg) scale(1);
}

/* The switcher list the theme builds from TranslatePress records. */
.lang-switcher-body .lang-list {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.lang-switcher-body .lang-item a {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	color: inherit;
	text-decoration: none;
}

.lang-switcher-body .lang-item a:hover,
.lang-switcher-body .lang-item a:focus-visible {
	color: var(--ig-accent);
}

.lang-switcher-body .trp-flag-image {
	flex: 0 0 auto;
	width: 18px;
	height: 12px;
	object-fit: cover;
	border-radius: 2px;
}

/*
 * TranslatePress shortcode switcher.
 *
 * The plugin prints its palette as inline custom properties on
 * .trp-shortcode-switcher__wrapper (--bg:#ffffff, --text:#143852, ...) and its
 * own stylesheet paints .trp-shortcode-switcher{background:var(--bg,#fff)}. In
 * dark mode that left a white dropdown with dark-navy text sitting in the
 * glass header, so the theme re-points those variables at the active palette
 * instead of trying to out-specify the plugin's background rule.
 */
.lang-switcher-body .trp-shortcode-switcher__wrapper {
	--bg: var(--ig-surface);
	--bg-hover: var(--ig-accent-soft);
	--text: var(--ig-text);
	--text-hover: var(--ig-accent);
	--border: 1px solid var(--ig-border);
	--border-color: var(--ig-border);
	--border-radius: 8px;
	display: inline-flex;
	align-items: center;
}

/*
 * In the header the switcher is a flat control, not a card: drop the plugin's
 * 10px vertical padding and its white panel so the current language sits on the
 * header glass like the rest of .header-actions.
 */
.lang-switcher-body .trp-shortcode-switcher {
	background: none;
	border: 0;
	box-shadow: none;
	padding: 0;
}

.lang-switcher-body .trp-current-language-item__wrapper {
	padding-right: 0;
	gap: 2px;
}

.lang-switcher-body .trp-language-item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--ig-nav-text);
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	border-radius: 999px;
	transition: color 0.15s ease;
}

.lang-switcher-body .trp-language-item:hover,
.lang-switcher-body .trp-language-item:focus-visible {
	color: var(--ig-accent);
}

.lang-switcher-body .trp-language-item-name {
	color: inherit;
}

/* The hover/focus dropdown is a real panel, so it keeps a surface and border. */
.lang-switcher-body .trp-switcher-dropdown-list {
	background: var(--ig-surface);
	border: 1px solid var(--ig-border);
	border-radius: 10px;
	box-shadow: var(--ig-shadow);
	overflow: hidden;
}

.lang-switcher-body .trp-switcher-dropdown-list .trp-language-item {
	display: flex;
	width: 100%;
	padding: 7px 12px;
	border-radius: 0;
}

.lang-switcher-body .trp-switcher-dropdown-list .trp-language-item:hover,
.lang-switcher-body .trp-switcher-dropdown-list .trp-language-item:focus-visible {
	background: var(--ig-accent-soft);
	color: var(--ig-accent);
}

/* The plugin strokes its chevron with var(--text); make it inherit the chrome. */
.lang-switcher-body .trp-shortcode-arrow path {
	stroke: currentColor;
}

/* Below 992px the header tightens: keep the switch, shrink it slightly. */
@media (max-width: 991px) {
	.theme-toggle {
		margin: 0;
		min-width: 46px;
	}

	.theme-toggle-track {
		width: 46px;
		height: 26px;
	}

	.theme-toggle-thumb {
		width: 20px;
		height: 20px;
	}

	/* 46px track - 2x1px border - 2px inset - 20px thumb - 2px inset = 20px. */
	html[data-theme="dark"] .theme-toggle-thumb {
		transform: translateX(20px);
	}
}

/* Respect a reader who has asked the system to reduce motion. */
@media (prefers-reduced-motion: reduce) {
	.theme-toggle-track,
	.theme-toggle-thumb,
	.theme-toggle-icon {
		transition: none;
	}
}

/* ----------------------------------------------------- homepage SEO ---- */

/*
 * Front page introduction. Sits on the same 1320px container as .feed, so the
 * H1 lines up with the first grid column on every breakpoint.
 */
.home-intro {
	width: 100%;
	max-width: var(--ig-container);
	margin: 0 auto;
	padding: 30px 16px 30px;
}

.home-title {
	max-width: 30ch;
	margin-bottom: 12px;
}

.home-lede {
	max-width: 72ch;
	margin-bottom: 0;
	font-size: 16.5px;
	line-height: 1.7;
}

/* Section headings inside the front page feed. */
.home-section {
	padding-top: 6px;
}

.home-section + .home-section {
	padding-top: 8px;
}

.home-section-head {
	max-width: 74ch;
	padding: 0 2px 18px;
}

.home-section-head--center {
	max-width: 64ch;
	margin: 0 auto 22px;
	padding: 0 2px;
	text-align: center;
}

.home-section-title {
	position: relative;
	margin: 0 0 10px;
	font-size: clamp(22px, 2.6vw, 28px);
	font-weight: 800;
	letter-spacing: -0.015em;
	line-height: 1.2;
}

.home-section-text {
	margin: 0;
	color: var(--ig-text-soft);
	font-size: 15.5px;
	line-height: 1.7;
}

/* ------------------------------------------------------ "what is" copy ---- */

/*
 * Long-form prose block. Measured at 68ch rather than the full container: past
 * roughly 75 characters a line the eye starts losing its place on the return,
 * and this block is the only place on the page that runs to several paragraphs.
 */
.home-about {
	max-width: 68ch;
	margin: 0 auto 46px;
	padding: 0 2px;
}

.home-about .home-section-title {
	margin-bottom: 14px;
}

.home-about-text {
	margin: 0 0 14px;
	color: var(--ig-text-soft);
	font-size: 15.5px;
	line-height: 1.75;
}

.home-about-text:last-child {
	margin-bottom: 0;
}

/* ---------------------------------------------------------------- faq ---- */

/*
 * FAQ accordion.
 *
 * Alignment contract: the block, its heading and its supporting description
 * are centred on the page axis; the question text and the answer copy inside
 * each card are left-aligned, because centred paragraphs are measurably slower
 * to read once they run past a line or two.
 *
 * Everything here is scoped to .home-faq, so the sheet cannot leak into other
 * components. Colours and radii come from the existing --ig-* tokens, so the
 * block follows the theme accent and dark mode with no extra rules.
 */
.home-faq {
	--ig-faq-width: 780px;
	--ig-faq-pad: 22px;
	width: 100%;
	max-width: var(--ig-faq-width);
	margin: 14px auto 56px;
	/*
	 * No horizontal padding here: the block already sits inside .feed, which
	 * carries the page's own 16px gutter. Adding a second one would inset the
	 * cards twice on a phone (32px each side) and make the block look narrower
	 * than every other section on the page.
	 */
	padding: 0;
}

.home-faq-head {
	max-width: 62ch;
	margin: 0 auto 24px;
	text-align: center;
}

.home-faq-head .home-section-text {
	margin-top: 8px;
}

.home-faq-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.home-faq-item {
	background: var(--ig-surface);
	border: 1px solid var(--ig-border);
	border-radius: var(--ig-radius-lg);
	box-shadow: var(--ig-shadow-soft);
	overflow: hidden;
	transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.home-faq-item:hover {
	border-color: var(--ig-accent-line);
}

/* An open card lifts out of the stack and picks up the accent edge. */
.home-faq-item.is-open {
	border-color: var(--ig-accent-line);
	box-shadow: var(--ig-shadow);
}

/*
 * The heading wrapper exists for document structure (each question is an H3
 * under the section's H2), so it must not add its own type or margins. The
 * button inside carries all of the question's presentation.
 */
.home-faq-heading {
	margin: 0;
	font-size: inherit;
	font-weight: inherit;
	line-height: inherit;
}

.home-faq-q {
	display: flex;
	align-items: center;
	gap: 16px;
	width: 100%;
	margin: 0;
	padding: var(--ig-faq-pad);
	background: none;
	border: 0;
	border-radius: 0;
	color: var(--ig-text);
	font-family: inherit;
	font-size: 15.5px;
	font-weight: 700;
	line-height: 1.45;
	text-align: left;
	cursor: pointer;
	transition: color 0.15s ease, background-color 0.15s ease;
}

.home-faq-q:hover {
	color: var(--ig-accent);
}

.home-faq-q:focus-visible {
	outline: 2px solid var(--ig-accent);
	outline-offset: -3px;
	border-radius: var(--ig-radius-lg);
}

/*
 * The text takes the free space and the icon keeps its intrinsic width, so a
 * long question wraps under itself instead of pushing the chevron off the card
 * or running underneath it. min-width:0 is what allows the flex item to
 * shrink below its longest word.
 */
.home-faq-q-text {
	flex: 1 1 auto;
	min-width: 0;
	overflow-wrap: break-word;
}

.home-faq-icon {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	background: var(--ig-accent-soft);
	border-radius: 50%;
	color: var(--ig-accent);
	transition: transform 0.22s ease, background-color 0.15s ease, color 0.15s ease;
}

.home-faq-icon svg {
	display: block;
	width: 16px;
	height: 16px;
}

.home-faq-q:hover .home-faq-icon,
.home-faq-item.is-open .home-faq-icon {
	background: var(--ig-accent);
	color: #fff;
}

/* Down when collapsed, up when open — a plain rotation, no icon swap. */
.home-faq-item.is-open .home-faq-icon {
	transform: rotate(180deg);
}

/*
 * Panel height. The closed state is driven by the `js` class that the inline
 * head bootstrap puts on <html> before first paint, not by JavaScript at the
 * foot of the page: the stylesheet therefore collapses the panels while the
 * body is still parsing, so a slow connection cannot flash five open answers
 * and then snap them shut.
 *
 * The 0fr/1fr grid track is used instead of an explicit pixel height, so the
 * card re-measures itself when the answer reflows (font swap, rotation,
 * resize) and no stored height can go stale and clip the text.
 *
 * Without JavaScript there is no `js` class, every panel keeps 1fr and the
 * answers stay readable — the buttons are the only inert part, and they are
 * still labelled correctly.
 */
.home-faq-a {
	display: grid;
	grid-template-rows: 1fr;
	transition: grid-template-rows 0.28s ease;
}

html.js .home-faq-a {
	grid-template-rows: 0fr;
}

html.js .home-faq-item.is-open .home-faq-a {
	grid-template-rows: 1fr;
}

.home-faq-a-inner {
	min-height: 0;
	overflow: hidden;
	/*
	 * Bottom padding is the open state's. The base (padding present) is the
	 * no-JS case, where every answer is on show and needs its own breathing
	 * room against the card edge. Once the document is scripted the padding is
	 * driven by .is-open instead, because padding sits outside a 0fr grid
	 * track and a constant value would leave a stub under every closed row.
	 */
	padding: 0 var(--ig-faq-pad) var(--ig-faq-pad);
	color: var(--ig-text-soft);
	font-size: 15px;
	line-height: 1.75;
	text-align: left;
	transition: padding-bottom 0.28s ease;
}

html.js .home-faq-a-inner {
	padding-bottom: 0;
}

html.js .home-faq-item.is-open .home-faq-a-inner {
	padding-bottom: var(--ig-faq-pad);
}

/*
 * Hairline between question and answer. It is always in the markup rather than
 * added on .is-open: switching it on mid-transition would remove 14px of
 * height in one frame while the track was still animating, which reads as a
 * small jump. A closed card clips it anyway, because the track is 0fr tall.
 */
.home-faq-a-inner::before {
	content: "";
	display: block;
	margin: 0 0 14px;
	border-top: 1px solid var(--ig-border);
}

.home-faq-a p {
	margin: 0;
}

.home-faq-a p + p {
	margin-top: 1em;
}

.home-faq-more {
	max-width: 62ch;
	margin: 20px auto 0;
	color: var(--ig-text-soft);
	font-size: 14px;
	line-height: 1.6;
	text-align: center;
}

.home-faq-more a {
	color: var(--ig-accent);
	font-weight: 700;
}

@media (max-width: 1023px) {
	/* Tablet: keep a little more air at the card edge, narrow the track. */
	.home-faq {
		--ig-faq-width: 700px;
		--ig-faq-pad: 20px;
	}
}

@media (max-width: 767px) {
	.home-intro {
		padding: 22px 16px 24px;
	}

	.home-about {
		margin-bottom: 36px;
	}

	.home-about-text {
		font-size: 15px;
		line-height: 1.72;
	}

	/*
	 * Mobile: the block goes full width with the page's own 16px gutter, and
	 * the card padding tightens. The icon keeps its 28px box and its 16px
	 * gap, so it can never sit on top of the question text.
	 */
	.home-faq {
		--ig-faq-pad: 16px;
		margin-bottom: 44px;
		padding: 0;
	}

	.home-faq-head {
		margin-bottom: 18px;
	}

	.home-faq-q {
		gap: 12px;
		font-size: 14.5px;
	}

	.home-faq-icon {
		width: 26px;
		height: 26px;
	}

	.home-faq-icon svg {
		width: 15px;
		height: 15px;
	}

	.home-faq-a-inner {
		font-size: 14.5px;
		line-height: 1.7;
	}
}

/*
 * Reduced motion: the panel still expands, it just stops sliding. Scoped to
 * the FAQ so the rest of the sheet's motion rules stay where they are.
 */
@media (prefers-reduced-motion: reduce) {
	.home-faq-a,
	.home-faq-icon,
	.home-faq-item,
	.home-faq-q {
		transition: none;
	}
}
