/**
 * Capas de Jornais hub — editorial newsstand layout.
 *
 * Mobile-first: o mockup só desenha 1152px. Reflow segundo docs/RESPONSIVO.md.
 *
 * @package SuperPortistas
 */

/* Page shell ------------------------------------------------------------- */
.sp-capas-page {
	overflow-x: hidden;
	background-color: #f4f7fb;
}

.sp-capas-page .sp-page-body {
	padding-top: 0;
	padding-bottom: 4rem;
}

.sp-capas-main {
	display: block;
	margin: 0;
	padding: 0;
}

.sp-capas-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Dark hero (full-bleed) ------------------------------------------------- */
.sp-capas-hero {
	position: relative;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	background: #06152b;
	color: #fff;
	overflow: hidden;
}

.sp-capas-hero::before {
	content: "";
	position: absolute;
	inset: -40% -6% auto auto;
	width: 22rem;
	height: 22rem;
	background: radial-gradient(circle, rgba(255, 255, 255, 0.07) 0%, transparent 70%);
	pointer-events: none;
}

.sp-capas-hero__inner {
	position: relative;
	z-index: 1;
	max-width: 72rem;
	margin: 0 auto;
	padding: 28px 1rem 0;
	box-sizing: border-box;
}

@media (min-width: 640px) {
	.sp-capas-hero__inner {
		padding: 32px 1.5rem 0;
	}
}

@media (min-width: 768px) {
	.sp-capas-hero__inner {
		padding: 40px 1.5rem 0;
	}
}

.sp-capas-hero__breadcrumb {
	margin-bottom: 16px;
	font-size: 12px;
}

.sp-capas-hero__breadcrumb,
.sp-capas-hero__breadcrumb a,
.sp-capas-hero__breadcrumb .sp-breadcrumb,
.sp-capas-hero__breadcrumb .sp-breadcrumb a {
	color: rgba(255, 255, 255, 0.6);
}

.sp-capas-hero__breadcrumb a:hover {
	color: #fff;
}

.sp-capas-hero__eyebrow {
	margin: 0 0 8px;
	font-family: "Libre Franklin", ui-sans-serif, system-ui, sans-serif;
	font-size: 12px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.14em;
	color: var(--sp-accent, #ff8a3d);
}

/* Passos da escala para H1 de hub em banda escura: 26 / 32 / 40 (RESPONSIVO 1.6). */
.sp-capas-hero__title {
	margin: 0 0 8px;
	font-family: "Source Serif 4", Georgia, Cambria, "Times New Roman", serif;
	font-size: 26px;
	font-weight: 700;
	line-height: 1.1;
	letter-spacing: -0.01em;
	color: #fff;
}

@media (min-width: 768px) {
	.sp-capas-hero__title {
		font-size: 32px;
	}
}

@media (min-width: 1024px) {
	.sp-capas-hero__title {
		font-size: 40px;
	}
}

.sp-capas-hero__subtitle {
	margin: 0 0 20px;
	max-width: 560px;
	font-family: "Libre Franklin", ui-sans-serif, system-ui, sans-serif;
	font-size: 15px;
	font-weight: 400;
	line-height: 1.55;
	color: rgba(255, 255, 255, 0.7);
}

@media (min-width: 768px) {
	.sp-capas-hero__subtitle {
		margin-bottom: 24px;
	}
}

/* Hero tabs (publication anchor nav) ------------------------------------- */
.sp-capas-tabs {
	display: flex;
	gap: 2px;
	flex-wrap: wrap;
}

/* Altura fixa em 44px: alvo de toque mínimo em telemóvel e tablet. */
.sp-capas-tab {
	display: inline-flex;
	align-items: center;
	height: 44px;
	padding: 0 12px;
	font-family: "Libre Franklin", ui-sans-serif, system-ui, sans-serif;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	text-decoration: none;
	background: rgba(255, 255, 255, 0.08);
	color: rgba(255, 255, 255, 0.85);
	border-radius: 8px 8px 0 0;
	transition: background 0.2s ease, color 0.2s ease;
}

@media (min-width: 768px) {
	.sp-capas-tab {
		padding: 0 18px;
	}
}

.sp-capas-tab:hover {
	background: rgba(255, 255, 255, 0.16);
	color: #fff;
}

.sp-capas-tab--active,
.sp-capas-tab--active:hover {
	background: #f4f7fb;
	color: #004b9b;
	font-weight: 800;
}

.sp-capas-tab--active:hover {
	color: #003d7a;
}

/* Content sections ------------------------------------------------------- */
.sp-capas-today {
	margin-top: 24px;
	margin-bottom: 36px;
	scroll-margin-top: calc(var(--sp-site-header-offset, 5rem) + 1rem);
}

.sp-capas-section {
	margin-bottom: 36px;
	scroll-margin-top: calc(var(--sp-site-header-offset, 5rem) + 1rem);
}

@media (min-width: 768px) {
	.sp-capas-today {
		margin-top: 32px;
		margin-bottom: 48px;
	}

	.sp-capas-section {
		margin-bottom: 48px;
	}
}

.sp-capas-section__description {
	margin: 0 0 18px;
	max-width: 640px;
	font-size: 14px;
	line-height: 1.6;
	color: #475569;
}

/* Eyebrow + hairline rule header ----------------------------------------- */
.sp-capas-rule {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 12px;
	margin-bottom: 18px;
}

.sp-capas-rule__label {
	margin: 0;
	font-family: "Libre Franklin", ui-sans-serif, system-ui, sans-serif;
	font-size: 12px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.14em;
	color: #004b9b;
}

.sp-capas-rule__line {
	height: 1px;
	flex: 1;
	min-width: 1.5rem;
	background: #dfe5ee;
}

.sp-capas-rule__link {
	flex-shrink: 0;
	font-size: 13px;
	font-weight: 700;
	color: #004b9b;
	text-decoration: none;
	white-space: nowrap;
}

.sp-capas-rule__link:hover {
	color: #003d7a;
}

/* Cover grid ------------------------------------------------------------- */
/* Nunca desce a 1 coluna: uma capa 3:4 a 358px daria 477px de altura, uma capa
   por écran. A 2 colunas cada capa fica com 173×231px — o que o próprio mockup
   mobile do designer desenha (RESPONSIVO 3.4). */
.sp-capas-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
}

.sp-capas-grid__item {
	min-width: 0;
}

@media (min-width: 768px) {
	.sp-capas-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 20px;
	}
}

@media (min-width: 1024px) {
	.sp-capas-grid {
		gap: 24px;
	}
}

/* Cover card ------------------------------------------------------------- */
.sp-capas-cover-card {
	display: block;
	text-decoration: none;
	cursor: pointer;
}

.sp-capas-cover-card__frame {
	position: relative;
	aspect-ratio: 3 / 4;
	border-radius: 12px;
	overflow: hidden;
	background: linear-gradient(160deg, var(--sp-porto-bright, #0a4ea3), var(--sp-navy-soft, #041f42));
	border: 1px solid #dfe5ee;
	box-shadow: 0 4px 16px rgba(6, 21, 43, 0.1);
	transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.sp-capas-cover-card:hover .sp-capas-cover-card__frame {
	box-shadow: 0 10px 30px rgba(6, 21, 43, 0.2);
	transform: translateY(-2px);
}

.sp-capas-cover-card__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: top center;
}

/* A 2 colunas em telemóvel a moldura tem ~136px: o padding e a mancha do
   cabeçalho do jornal descem, senão o nome da publicação parte em 4 linhas. */
.sp-capas-cover-card__placeholder {
	display: flex;
	flex-direction: column;
	width: 100%;
	height: 100%;
	padding: 14px;
	box-sizing: border-box;
	color: #fff;
}

.sp-capas-cover-card__masthead {
	font-family: "Source Serif 4", Georgia, Cambria, "Times New Roman", serif;
	font-size: 18px;
	font-weight: 700;
	letter-spacing: 0.02em;
	line-height: 1.15;
	margin-bottom: 8px;
}

@media (min-width: 768px) {
	.sp-capas-cover-card__placeholder {
		padding: 24px;
	}

	.sp-capas-cover-card__masthead {
		font-size: 26px;
	}
}

.sp-capas-cover-card__rule {
	display: block;
	height: 2px;
	background: rgba(255, 255, 255, 0.35);
	margin-bottom: 16px;
}

.sp-capas-cover-card__ph-text {
	margin-top: auto;
	font-size: 12px;
	color: rgba(255, 255, 255, 0.7);
}

.sp-capas-cover-card__badge {
	position: absolute;
	top: 8px;
	right: 8px;
	display: inline-flex;
	align-items: center;
	height: 22px;
	padding: 0 8px;
	border-radius: 9999px;
	background: rgba(255, 255, 255, 0.92);
	color: #004b9b;
	font-family: "Libre Franklin", ui-sans-serif, system-ui, sans-serif;
	font-size: 11px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

@media (min-width: 768px) {
	.sp-capas-cover-card__badge {
		top: 14px;
		right: 14px;
		height: 24px;
		padding: 0 10px;
	}
}

/* Envolve em vez de espremer: a 2 colunas «Revista Dragões» + data não cabem
   na mesma linha a 320px. */
.sp-capas-cover-card__meta {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: baseline;
	gap: 2px 8px;
	margin-top: 10px;
}

@media (min-width: 768px) {
	.sp-capas-cover-card__meta {
		margin-top: 12px;
	}
}

.sp-capas-cover-card__label {
	min-width: 0;
	font-family: "Libre Franklin", ui-sans-serif, system-ui, sans-serif;
	font-size: 14px;
	font-weight: 700;
	color: #0f172a;
}

.sp-capas-cover-card__date {
	font-size: 12px;
	color: #7c8aa5;
	white-space: nowrap;
}

/* FAQ -------------------------------------------------------------------- */
.sp-capas-faq {
	max-width: 720px;
}

.sp-capas-faq__list {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.sp-capas-faq__item {
	background: #fff;
	border: 1px solid #dfe5ee;
	border-radius: 12px;
	overflow: hidden;
}

.sp-capas-faq__question {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	padding: 16px 20px;
	cursor: pointer;
	list-style: none;
	font-family: "Libre Franklin", ui-sans-serif, system-ui, sans-serif;
}

.sp-capas-faq__question::-webkit-details-marker {
	display: none;
}

.sp-capas-faq__q-text {
	font-family: "Source Serif 4", Georgia, Cambria, "Times New Roman", serif;
	font-size: 16px;
	font-weight: 700;
	color: #0f172a;
}

.sp-capas-faq__icon {
	position: relative;
	flex-shrink: 0;
	width: 16px;
	height: 16px;
}

.sp-capas-faq__icon::before,
.sp-capas-faq__icon::after {
	content: "";
	position: absolute;
	background: var(--sp-ink-soft, #7c8aa5);
	transition: opacity 0.2s ease, background-color 0.2s ease;
}

.sp-capas-faq__question:hover .sp-capas-faq__icon::before,
.sp-capas-faq__question:hover .sp-capas-faq__icon::after {
	background: #004b9b;
}

.sp-capas-faq__icon::before {
	top: 50%;
	left: 0;
	width: 100%;
	height: 2px;
	transform: translateY(-50%);
}

.sp-capas-faq__icon::after {
	left: 50%;
	top: 0;
	width: 2px;
	height: 100%;
	transform: translateX(-50%);
}

.sp-capas-faq__item[open] .sp-capas-faq__icon::after {
	opacity: 0;
}

.sp-capas-faq__answer {
	padding: 0 20px 16px;
}

.sp-capas-faq__answer p {
	margin: 0;
	font-size: 14px;
	line-height: 1.6;
	color: #475569;
}

/* Empty state ------------------------------------------------------------ */
/* Mesma anatomia do estado vazio do catálogo (EstadosFormularios / PWA):
   selo redondo, título serifado de 19px e texto de 14px. */
.sp-capas-empty {
	background: #fff;
	border: 1px solid #dfe5ee;
	border-radius: 12px;
	padding: 36px 24px;
	text-align: center;
}

.sp-capas-empty__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	margin: 0 auto 14px;
	border-radius: var(--sp-radius-pill, 9999px);
	background: var(--sp-surface-muted, #f4f7fb);
	color: var(--sp-on-navy, #b9cce4);
}

.sp-capas-empty__title {
	margin: 0 0 6px;
	font-family: "Source Serif 4", Georgia, Cambria, "Times New Roman", serif;
	font-size: 19px;
	font-weight: 700;
	color: #0f172a;
}

.sp-capas-empty__text {
	margin: 0 auto;
	max-width: 480px;
	font-size: 14px;
	line-height: 1.55;
	color: #475569;
}

/* Footer note ------------------------------------------------------------ */
.sp-capas-footer {
	margin-top: 8px;
	padding-top: 24px;
	border-top: 1px solid #dfe5ee;
	text-align: center;
	font-size: 15px;
	line-height: 1.6;
	color: #475569;
}

.sp-capas-footer p {
	margin: 0;
}

.sp-capas-footer__link {
	color: #004b9b;
	font-weight: 700;
	text-decoration: none;
}

.sp-capas-footer__link:hover {
	color: #003d7a;
}

/* Motion ----------------------------------------------------------------- */
@keyframes sp-capas-fade-up {
	from {
		opacity: 0;
		transform: translateY(12px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.sp-capas-grid--today .sp-capas-grid__item {
	animation: sp-capas-fade-up 0.5s ease-out both;
}

.sp-capas-grid--today .sp-capas-grid__item:nth-child(2) {
	animation-delay: 0.08s;
}

.sp-capas-grid--today .sp-capas-grid__item:nth-child(3) {
	animation-delay: 0.16s;
}

.sp-capas-grid--today .sp-capas-grid__item:nth-child(4) {
	animation-delay: 0.24s;
}

@media (prefers-reduced-motion: reduce) {
	.sp-capas-grid--today .sp-capas-grid__item {
		animation: none;
	}

	.sp-capas-cover-card:hover .sp-capas-cover-card__frame {
		transform: none;
	}
}
