/*
 * Journal archives — blog page /blog/, category, tag and author archives, search results.
 * Markup: home.php, archive.php, author.php, search.php, template-parts/journal-*.php (inc/journal.php).
 * Scoped to sg-journal*, sg-jcard*, sg-jfeat*, sg-jph*, sg-jchips*, sg-jpages*, sg-jauthor* only (never single posts).
 */

.sg-journal {
	--j-hair: rgba(255, 255, 255, .1);
	--j-meta: #94959b;
	--j-ease: cubic-bezier(.2, .7, .2, 1);
	padding: calc(var(--header-h) + 110px) 0 150px;
	background: var(--c-bg);
	color: var(--c-text);
}
.sg-journal__inner { width: calc(100% - 100px); max-width: 1290px; margin-inline: auto; }

/* ── Header ─────────────────────────────────────────────────────────────────────────────────── */
.sg-journal__head { position: relative; padding-bottom: 56px; border-bottom: 1px solid var(--j-hair); }
.sg-journal__eyebrow {
	display: flex; align-items: center; gap: 16px; margin: 0 0 22px;
	font-size: 13px; font-weight: 500; line-height: 1; letter-spacing: .28em; text-transform: uppercase; color: var(--c-accent);
}
.sg-journal__eyebrow::before { content: ""; width: 32px; height: 1px; background: currentColor; }
.sg-journal__title { margin: 0; font-size: clamp(38px, 4.6vw, 66px); font-weight: 500; line-height: 1.08; letter-spacing: -.01em; color: var(--c-white); overflow-wrap: anywhere; }
.sg-journal__desc { max-width: 640px; margin: 26px 0 0; font-size: 18px; line-height: 1.8; color: var(--c-light); }
.sg-journal__count { margin: 28px 0 0; font-size: 12px; font-weight: 500; line-height: 1; letter-spacing: .22em; text-transform: uppercase; color: var(--j-meta); }

/* Blog page: live's "est. 1984" lettering on the right of the heading. */
.sg-journal__head--letters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 44%); column-gap: 60px; }
.sg-journal__head--letters > :not(.sg-journal__letters) { grid-column: 1; }
.sg-journal__letters { grid-column: 2; grid-row: 1 / span 4; align-self: center; line-height: 0; pointer-events: none; }
.sg-journal__letters img { width: 100%; max-width: 560px; height: auto; margin-left: auto; opacity: .9; }

/* ── Category chips ─────────────────────────────────────────────────────────────────────────── */
.sg-jchips { padding: 28px 0; border-bottom: 1px solid var(--j-hair); }
.sg-jchips__list { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; list-style: none; }
.sg-jchips__chip {
	display: inline-flex; align-items: center; min-height: 44px; padding: 0 22px; border: 1px solid rgba(255, 255, 255, .18); border-radius: 999px;
	font-size: 13px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; color: var(--c-light);
	transition: color var(--t) ease, border-color var(--t) ease, background-color var(--t) ease;
}
.sg-jchips__chip:hover, .sg-jchips__chip:focus-visible { border-color: var(--c-white); color: var(--c-white); }
.sg-jchips__chip.is-current { border-color: var(--c-accent); background: var(--c-accent); color: #000; }

/* ── Image or branded placeholder ───────────────────────────────────────────────────────────── */
.sg-jcard__media, .sg-jfeat__media { position: relative; overflow: hidden; background: var(--c-panel); line-height: 0; }
.sg-jcard__media img:not(.sg-jph__mark), .sg-jfeat__media img:not(.sg-jph__mark) {
	width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--j-ease);
}
.sg-jph {
	position: relative; display: block; width: 100%; height: 100%;
	background: radial-gradient(120% 90% at 25% 15%, #1d1d1d 0%, #0e0e0e 55%, #070707 100%);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07);
}
.sg-jph__mark {
	position: absolute; left: 50%; top: 50%; width: 26%; max-width: 140px; height: auto; opacity: .22;
	transform: translate(-50%, -50%); transition: opacity .6s ease, transform 1.2s var(--j-ease);
}
.sg-jph__year {
	position: absolute; right: 7%; bottom: 7%; font-size: clamp(26px, 3vw, 44px); font-weight: 200; line-height: 1;
	letter-spacing: .08em; color: var(--c-accent); opacity: .55;
}
.sg-jfeat .sg-jph__year { font-size: clamp(34px, 4.4vw, 64px); }

/* ── Featured first post ────────────────────────────────────────────────────────────────────── */
.sg-jfeat { position: relative; display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 64px; align-items: center; margin-top: 72px; }
.sg-jfeat__media { aspect-ratio: 3 / 2; }
.sg-jfeat__label { margin: 0 0 18px; font-size: 12px; font-weight: 500; line-height: 1; letter-spacing: .28em; text-transform: uppercase; color: var(--c-accent); }
.sg-jfeat__meta, .sg-jcard__meta {
	display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 0;
	font-size: 12px; font-weight: 500; line-height: 1.5; letter-spacing: .16em; text-transform: uppercase; color: var(--j-meta);
}
.sg-jfeat__cat, .sg-jcard__cat { position: relative; z-index: 2; color: var(--c-light); transition: color var(--t) ease; }
.sg-jfeat__cat:hover, .sg-jcard__cat:hover { color: var(--c-white); }
.sg-jfeat__dot, .sg-jcard__dot { width: 3px; height: 3px; border-radius: 50%; background: var(--c-line); }
.sg-jfeat__title { margin: 20px 0 0; font-size: clamp(28px, 2.9vw, 42px); font-weight: 500; line-height: 1.2; color: var(--c-white); }
.sg-jfeat__link, .sg-jcard__link { color: inherit; transition: color var(--t) ease; }
.sg-jfeat__link::after, .sg-jcard__link::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.sg-jfeat__link:focus-visible, .sg-jcard__link:focus-visible { outline: none; }
.sg-jfeat__link:focus-visible::after, .sg-jcard__link:focus-visible::after { outline: 1px solid var(--c-accent); outline-offset: 10px; }
.sg-jfeat__excerpt {
	display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden;
	margin: 22px 0 0; font-size: 17px; line-height: 1.85; color: var(--c-text);
}
.sg-jfeat__more {
	display: inline-flex; align-items: center; gap: 12px; margin-top: 30px; padding-bottom: 8px; border-bottom: 1px solid var(--c-accent);
	font-size: 12px; font-weight: 500; line-height: 1; letter-spacing: .24em; text-transform: uppercase; color: var(--c-white);
}
.sg-jfeat__more svg { transition: transform .4s var(--j-ease); }

/* ── Card grid ──────────────────────────────────────────────────────────────────────────────── */
.sg-journal__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 72px 40px; margin-top: 72px; }
.sg-jfeat + .sg-journal__grid { margin-top: 96px; padding-top: 88px; border-top: 1px solid var(--j-hair); }
.sg-jcard { position: relative; display: flex; flex-direction: column; min-width: 0; }
.sg-jcard__media { aspect-ratio: 4 / 3; margin-bottom: 24px; }
.sg-jcard__title {
	display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
	margin: 14px 0 0; font-size: 22px; font-weight: 500; line-height: 1.36; color: var(--c-white);
}
.sg-jcard__excerpt {
	display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
	margin: 12px 0 0; font-size: 15px; line-height: 1.75; color: var(--c-text);
}

/* Hover: slow zoom, title warms to the accent. */
@media (hover: hover) {
	.sg-jcard:hover .sg-jcard__media img:not(.sg-jph__mark), .sg-jfeat:hover .sg-jfeat__media img:not(.sg-jph__mark) { transform: scale(1.05); }
	.sg-jcard:hover .sg-jph__mark, .sg-jfeat:hover .sg-jph__mark { opacity: .38; transform: translate(-50%, -50%) scale(1.06); }
	.sg-jcard:hover .sg-jcard__link, .sg-jfeat:hover .sg-jfeat__link { color: var(--c-accent); }
	.sg-jfeat:hover .sg-jfeat__more svg { transform: translateX(6px); }
}
.sg-jcard:focus-within .sg-jcard__media img:not(.sg-jph__mark) { transform: scale(1.05); }

/* ── Author header ──────────────────────────────────────────────────────────────────────────── */
.sg-jauthor { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 56px; align-items: center; }
.sg-jauthor__photo { line-height: 0; }
.sg-jauthor__avatar { width: 168px; height: 168px; border-radius: 50%; object-fit: cover; background: var(--c-panel); box-shadow: 0 0 0 1px rgba(210, 202, 194, .45), 0 0 0 10px #000, 0 0 0 11px var(--j-hair); }
.sg-jauthor__avatar--mark { display: grid; place-items: center; background: radial-gradient(120% 120% at 30% 20%, #222 0%, #0e0e0e 60%, #070707 100%); }
.sg-jauthor__avatar--mark img { width: 46%; height: auto; opacity: .85; }
.sg-jauthor__role { margin: 14px 0 0; font-size: 14px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--c-accent); }
.sg-jauthor .sg-journal__desc { margin-top: 22px; }

/* ── Pagination: Previous · 1 … 4 5 6 … 63 · Next ───────────────────────────────────────────── */
.sg-jpages { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; margin-top: 110px; padding-top: 40px; border-top: 1px solid var(--j-hair); }
.sg-jpages__nums { display: flex; align-items: center; justify-content: center; gap: 6px; }
.sg-jpages__next { justify-self: end; }
.sg-jpages__status { display: none; margin: 0; font-size: 12px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--j-meta); text-align: center; }
.sg-jpages .page-numbers {
	position: relative; display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; padding: 0 6px;
	font-size: 15px; font-weight: 500; color: var(--j-meta); transition: color var(--t) ease;
}
.sg-jpages a.page-numbers:hover, .sg-jpages a.page-numbers:focus-visible { color: var(--c-white); }
.sg-jpages .page-numbers.current { color: var(--c-white); }
.sg-jpages .page-numbers.current::after { content: ""; position: absolute; left: 50%; bottom: 6px; width: 18px; height: 1px; background: var(--c-accent); transform: translateX(-50%); }
.sg-jpages .page-numbers.dots { min-width: 24px; color: var(--c-line); }
.sg-jpages .prev, .sg-jpages .next { gap: 14px; padding: 0; font-size: 12px; letter-spacing: .24em; text-transform: uppercase; color: var(--c-light); }
.sg-jpages__arrow { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 1px solid rgba(255, 255, 255, .18); border-radius: 50%; transition: border-color var(--t) ease, background-color var(--t) ease, color var(--t) ease; }
.sg-jpages__arrow--prev svg { transform: rotate(180deg); }
.sg-jpages .prev:hover .sg-jpages__arrow, .sg-jpages .next:hover .sg-jpages__arrow,
.sg-jpages .prev:focus-visible .sg-jpages__arrow, .sg-jpages .next:focus-visible .sg-jpages__arrow { border-color: var(--c-white); background: var(--c-white); color: #000; }

/* ── Empty states ───────────────────────────────────────────────────────────────────────────── */
.sg-journal__none { margin: 64px 0 0; font-size: 18px; line-height: 1.8; color: var(--c-light); }
.sg-journal__none a { color: var(--c-link); }
.sg-journal__none a:hover { color: var(--c-white); }
.sg-journal--empty { padding-bottom: 120px; }

/* ── Laptop ─────────────────────────────────────────────────────────────────────────────────── */
@media (max-width: 1280px) {
	.sg-journal__inner { width: calc(100% - 80px); }
	.sg-jfeat { gap: 48px; }
	.sg-journal__grid { column-gap: 32px; }
}

/* ── Tablet ─────────────────────────────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
	.sg-journal { padding: 150px 0 120px; }
	.sg-journal__inner { width: calc(100% - 60px); }
	.sg-journal__head { padding-bottom: 44px; }
	.sg-journal__desc { font-size: 17px; }
	.sg-jfeat { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 36px; margin-top: 48px; }
	.sg-jfeat__title { font-size: 30px; }
	.sg-jfeat__excerpt { -webkit-line-clamp: 3; }

	/* Chips scroll sideways in their own row (the page itself never scrolls sideways). */
	.sg-jchips { margin-inline: -30px; padding: 22px 0; }
	.sg-jchips__list { flex-wrap: nowrap; overflow-x: auto; padding: 0 30px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
	.sg-jchips__list::-webkit-scrollbar { display: none; }
	.sg-journal__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 60px 30px; }
	.sg-jfeat + .sg-journal__grid { margin-top: 72px; padding-top: 64px; }
	.sg-jauthor { gap: 40px; }
	.sg-jauthor__avatar { width: 136px; height: 136px; }
	.sg-jpages { margin-top: 88px; }
}

/* ── Phone ──────────────────────────────────────────────────────────────────────────────────── */
@media (max-width: 880px) {
	.sg-jfeat { grid-template-columns: minmax(0, 1fr); gap: 28px; }
	.sg-jfeat__title { font-size: 32px; }
}

@media (max-width: 767px) {
	.sg-journal { padding: 112px 0 90px; }
	.sg-journal__inner { width: calc(100% - 40px); }
	.sg-journal__head { padding-bottom: 36px; }
	.sg-journal__eyebrow { margin-bottom: 16px; font-size: 12px; }
	.sg-journal__title { font-size: 38px; }
	.sg-journal__desc { margin-top: 18px; font-size: 16px; line-height: 1.75; }
	.sg-journal__count { margin-top: 20px; }
	.sg-journal__head--letters { grid-template-columns: minmax(0, 1fr); }
	.sg-journal__letters { grid-column: 1; grid-row: auto; order: -1; margin: 0 0 18px; }
	.sg-journal__letters img { width: 260px; margin: 0; }
	.sg-journal__head--letters > :not(.sg-journal__letters) { grid-column: 1; }

	.sg-jchips { margin-inline: -20px; padding: 20px 0; }
	.sg-jchips__list { padding: 0 20px; }
	.sg-jchips__chip { padding: 0 18px; font-size: 12px; }

	.sg-jfeat { gap: 24px; margin-top: 36px; }
	.sg-jfeat__title { margin-top: 16px; font-size: 28px; }
	.sg-jfeat__excerpt { margin-top: 16px; font-size: 16px; -webkit-line-clamp: 3; }
	.sg-jfeat__more { margin-top: 22px; }
	.sg-journal__grid { grid-template-columns: minmax(0, 1fr); gap: 52px; margin-top: 44px; }
	.sg-jfeat + .sg-journal__grid { margin-top: 52px; padding-top: 52px; }
	.sg-jcard__media { margin-bottom: 20px; }
	.sg-jcard__title { font-size: 21px; }

	.sg-jauthor { grid-template-columns: minmax(0, 1fr); gap: 28px; }
	.sg-jauthor__avatar { width: 112px; height: 112px; }

	.sg-jpages { grid-template-columns: auto 1fr auto; margin-top: 64px; padding-top: 28px; }
	.sg-jpages__nums { display: none; }
	.sg-jpages__status { display: block; grid-column: 2; grid-row: 1; }
	.sg-jpages__prev { grid-column: 1; grid-row: 1; }
	.sg-jpages__next { grid-column: 3; grid-row: 1; }
	.sg-jpages__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
	.sg-jcard__media img, .sg-jfeat__media img, .sg-jph__mark, .sg-jfeat__more svg { transition: none; }
}
