/*
 * Spacca - Issue pages: SHARED shell (all issues load this).
 * 1) Section top spacing
 * 2) Cover+retro / index pair (swipe slider on mobile, static on desktop)
 * 3) Contents section + article index rows
 * 4) Article section base + copy + image-blocks wrapper
 * 5) Back-home link + issue footer
 *
 * Per-issue photo layouts live in issue-1.css / issue-2.css (loaded per page).
 * Project breakpoints: mobile <=767px, tablet 768-1023px, desktop >=1024px.
 */

/* 1) Shared top spacing --------------------------------------------------- */
.spacca-section {
	width: 100%;
	padding-bottom: 4rem;
}

@media (min-width: 768px) {
	.spacca-section {
		padding-bottom: 6rem;
	}
}

@media (min-width: 1024px) {
	.spacca-section {
		padding-bottom: 8rem;
	}
}

/* 2) Cover+retro / index pair -------------------------------------------- */
.spacca-duo {
	--duo-h: 80vh;
}

.spacca-duo__track {
	display: flex;
	gap: 1rem;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-padding-inline: 1rem;
	padding-inline: 1rem;
	scrollbar-width: none;
}

.spacca-duo__track::-webkit-scrollbar {
	display: none;
}

.spacca-duo__item {
	flex: 0 0 85%;
}

.spacca-duo__item:first-child {
	scroll-snap-align: start;
}

.spacca-duo__item:last-child {
	scroll-snap-align: end;
}

.spacca-duo__item img {
	display: block;
	width: 100%;
	height: auto;
}

@media (min-width: 768px) {
	.spacca-duo__track {
		overflow: visible;
		scroll-snap-type: none;
		gap: 2rem;
		justify-content: flex-end;
	}

	.spacca-duo--center .spacca-duo__track {
		justify-content: center;
	}

	.spacca-duo__item {
		flex: 0 0 auto;
	}

	.spacca-duo__item img {
		width: auto;
		height: var(--duo-h);
	}
}

/* 3) Contents ------------------------------------------------------------- */
.spacca-contents {
	display: flex;
	flex-direction: column;
	row-gap: 2rem;
	padding-inline: 16px;
}

.spacca-contents__title,
.spacca-article__title {
	font-family: var(--font-inter);
	font-weight: 600;
	line-height: 1;
}

.spacca-contents__title {
	margin-bottom: 1rem;
	font-size: 3rem;
}

.spacca-article__title {
	font-size: 2.5rem;
}

@media (min-width: 768px) {
	.spacca-contents__title {
		font-size: 4rem;
	}

	.spacca-article__title {
		font-size: 3.5rem;
	}
}

.spacca-contents__list {
	display: flex;
	flex-direction: column;
	row-gap: 3rem;
}

/* Article index row */
.spacca-index-row {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.spacca-index-row__thumb {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	object-position: 50% 50%;
}

.spacca-index-row__thumb--offset {
	object-position: 0 15%;
}

.spacca-index-row__thumb--placeholder {
	background: var(--bg-alt);
}

.spacca-index-row__link {
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	gap: 1rem;
}

.spacca-index-row__text {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.spacca-index-row__credit {
	font-family: var(--font-newsreader);
	font-weight: 400;
	font-size: 1rem;
	color: var(--text);
}

.spacca-index-row__title {
	font-family: var(--font-inter);
	font-weight: 500;
	font-size: 2rem;
	line-height: 1;
	color: var(--text);
}

.spacca-index-row__icon {
	flex: 0 0 auto;
	height: 1.5rem;
	width: auto;
	margin-bottom: 0.5rem;
	transform: rotate(45deg);
	transition: transform 0.3s ease;
}

.spacca-index-row__link:hover .spacca-index-row__icon {
	transform: rotate(90deg);
}

@media (min-width: 768px) {
	.spacca-index-row {
		flex-direction: row;
		align-items: flex-end;
	}

	.spacca-index-row__thumb {
		flex: 0 0 15%;
		min-width: 0;
	}

	.spacca-index-row__link {
		flex: 1;
	}

	.spacca-index-row__credit {
		font-size: 1.125rem;
	}

	.spacca-index-row__title {
		font-size: 2.5rem;
	}

	.spacca-index-row__icon {
		height: 2rem;
	}
}

@media (min-width: 1024px) {
	.spacca-index-row__credit {
		font-size: 1.25rem;
	}

	.spacca-index-row__title {
		font-size: 3rem;
	}
}

/* 4) Article sections (base + copy) --------------------------------------- */
.spacca-article {
	width: 100%;
	padding-block: 4rem;
	padding-inline: 1rem;
	display: flex;
	flex-direction: column;
	row-gap: 3rem;
}

@media (min-width: 768px) {
	.spacca-article {
		padding-inline: 2rem;
	}
}

.spacca-article__copy {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	row-gap: 1rem;
}

.spacca-article__credit {
	margin-bottom: 1rem;
	font-family: var(--font-newsreader);
	font-weight: 400;
	font-size: 16px;
	color: var(--text);
}

.spacca-article__body {
	width: 100%;
	font-family: var(--font-newsreader);
	font-weight: 400;
	font-size: 16px;
	line-height: 1.4;
	text-align: justify;
	color: var(--text);
}

@media (min-width: 768px) {
	.spacca-article__credit,
	.spacca-article__body {
		font-size: 18px;
	}

	.spacca-article__body {
		width: 60%;
	}
}

/* Image-blocks wrapper: keeps a uniform gap between stacked photos on mobile
   (2rem) while the copy-to-first-photo gap stays at the section's 3rem.
   Shared: used by any article with more than one image block. */
.spacca-article__media {
	display: flex;
	flex-direction: column;
	row-gap: 2rem;
}

@media (min-width: 768px) {
	.spacca-article__media {
		row-gap: 3rem;
	}
}

/* 5) Issue footer -------------------------------------------------------- */
/* The .spacca-back-home link lives in base.css (shared shell component). */

/* Footer on issue pages: same look as the home footer, but transparent and
   with black text/icons; a 16px padding box, in normal flow. */
.spacca-issue .site-footer {
	margin-top: 0;
	padding: 16px;
	background: transparent;
	color: var(--text);
}

.spacca-issue .site-footer a,
.spacca-issue .site-footer__copy {
	color: var(--text);
}

.spacca-issue .site-footer a:hover {
	color: var(--text-hover);
}

.spacca-issue .site-footer__inner {
	max-width: none;
	width: 100%;
	margin: 0;
	padding: 0;
}

/* 6) Entrance reveal ------------------------------------------------------
   Sections, article copy and photo blocks fade up as they scroll into view
   (the hero and the back-home link are excluded on purpose). The hidden
   starting state applies only when JS is active (html.spacca-js, set by
   issue.js) and the visitor allows motion, so the page stays fully readable
   without JS. */
@media (prefers-reduced-motion: no-preference) {
	.spacca-js .spacca-section,
	.spacca-js .spacca-article__copy,
	.spacca-js .spacca-article__media > * {
		opacity: 0;
		transform: translateY(1.5rem);
		transition: opacity 0.7s ease, transform 0.7s ease;
	}

	.spacca-js .is-visible {
		opacity: 1;
		transform: none;
	}
}
