/*
 * Portafolio TWeb2 — estilos principales.
 * Tokens y proporciones tomados de la plantilla Isle Thorne Collective (Codrops, MIT).
 */

:root {
	--paper: #f8f7f3;
	--brand: #790700;
	--brand-deep: #6b0200;
	--black: #000;
	--white: #fff;
	--ptw2-font: 'Instrument Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
	--gutter: 12px;
}

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

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

body {
	margin: 0;
	background: var(--white);
	color: var(--black);
	font-family: var(--ptw2-font);
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	font-synthesis: none;
	overflow-x: clip;
}

body.ground-paper {
	background: var(--paper);
}

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

a {
	color: inherit;
	text-decoration: none;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
figure,
blockquote {
	margin: 0;
}

h1,
h2,
h3,
h4 {
	font-weight: 600;
}

ul,
ol {
	padding: 0;
	list-style: none;
}

button {
	font: inherit;
	color: inherit;
	background: none;
	border: 0;
	padding: 0;
	cursor: pointer;
}

:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.underline {
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

/* Accesibilidad ----------------------------------------------------------- */

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

.skip-link:focus {
	position: fixed !important;
	top: 8px;
	left: 8px;
	z-index: 100001;
	width: auto;
	height: auto;
	margin: 0;
	padding: 10px 14px;
	clip: auto;
	clip-path: none;
	background: var(--black);
	color: var(--white);
	border-radius: 4px;
}

/* Tipografía -------------------------------------------------------------- */

.t-title {
	font-size: 1.25rem;
	line-height: 1.2;
	letter-spacing: -0.01em;
}

.t-heading {
	font-size: 1.5rem;
	line-height: 1.2;
}

/* Grilla del sitio: 2 columnas en móvil, 12 desde 1024px, 12px de separación */

.grid-site {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	column-gap: 12px;
}

@media (min-width: 64rem) {
	.grid-site {
		grid-template-columns: repeat(12, minmax(0, 1fr));
	}
}

/* Cabecera ---------------------------------------------------------------- */

.site {
	position: relative;
}

.site-header {
	position: absolute;
	inset: 0 0 auto 0;
	z-index: 20;
	padding: 12px;
}

.site-header__inner {
	align-items: start;
}

.site-title,
.menu-toggle,
.site-nav a,
.site-footer a {
	display: inline-block;
	padding-block: 5px;
	margin-block: -5px;
}

.site-title {
	grid-column: 1 / 2;
	justify-self: start;
}

.menu-toggle {
	grid-column: 2 / 3;
	justify-self: end;
	position: relative;
	z-index: 40;
}

.site-nav {
	display: none;
}

.site-nav ul {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.header-note {
	grid-column: 1 / -1;
	margin-top: 8px;
}

body.ground-white .site-header {
	color: var(--white);
}

/* Menú móvil: tarjeta negra a pantalla completa */
@media (max-width: 63.99rem) {
	body.menu-open .site-nav {
		display: block;
		position: fixed;
		inset: 4px;
		z-index: 30;
		padding: 64px 12px 12px;
		background: var(--black);
		color: var(--white);
		border-radius: 4px;
		overflow-y: auto;
	}

	body.menu-open .site-nav a {
		font-size: 1.25rem;
		letter-spacing: -0.01em;
		line-height: 1.2;
	}

	body.menu-open .site-nav ul {
		gap: 20px;
	}

	body.menu-open .menu-toggle {
		color: var(--white);
	}

	html:has(body.menu-open) {
		overflow: hidden;
	}
}

@media (min-width: 64rem) {
	.site-title {
		grid-column: 1 / 4;
	}

	.menu-toggle {
		display: none;
	}

	.site-nav {
		display: block;
		grid-column: 4 / 9;
	}

	.site-nav ul {
		flex-direction: row;
		gap: 24px;
	}

	.header-note {
		grid-column: 10 / 13;
		margin-top: 0;
		padding-block: 0;
	}
}

.site-nav .current-menu-item > a,
.site-nav .current_page_item > a,
.site-nav a[aria-current='page'] {
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

/* Tarjetas ---------------------------------------------------------------- */

.hero,
.concept,
.stories-card,
.site-footer,
.all-link {
	border-radius: 4px;
}

/* Hero (portada) ---------------------------------------------------------- */

.hero {
	position: relative;
	display: flex;
	align-items: flex-end;
	margin: 4px;
	min-height: max(520px, calc(100svh - 8px));
	background: #111;
	color: var(--white);
	overflow: hidden;
}

.hero__media {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.hero__shade {
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgb(0 0 0 / 0.5), rgb(0 0 0 / 0) 50%);
}

.hero__inner {
	position: relative;
	width: 100%;
	padding: 20px 12px;
}

.hero__title {
	grid-column: 1 / -1;
	max-width: 22ch;
	font-size: 1.25rem;
	line-height: 1.2;
	letter-spacing: -0.01em;
}

@media (min-width: 64rem) {
	.hero__title {
		grid-column: 1 / 7;
		max-width: 30ch;
	}
}

/* Conceptos (una entrada = un concepto) ----------------------------------- */

.concepts {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin: 4px;
}

.concept {
	background: var(--paper);
	padding: 8px;
	row-gap: 8px;
}

.concept__title {
	grid-column: 1 / -1;
	font-size: 1.25rem;
	line-height: 1.2;
	letter-spacing: -0.01em;
}

.concept__num {
	display: inline-block;
	min-width: 1.4em;
	font-size: 0.875rem;
	letter-spacing: 0;
	vertical-align: top;
}

.concept__title a:hover {
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

.concept__count {
	grid-column: 1 / 2;
}

.concept__materials {
	grid-column: 2 / 3;
}

.concept--empty {
	padding: 40px 12px;
}

@media (min-width: 64rem) {
	.concept__title {
		grid-column: 1 / 4;
	}

	.concept__count {
		grid-column: 4 / 7;
	}

	.concept__materials {
		grid-column: 7 / 11;
	}
}

/* Fila de imágenes: arrastrable, con scroll nativo como respaldo */

.row {
	grid-column: 1 / -1;
	margin: 16px -8px 0;
	padding-inline: 8px;
	scroll-padding-inline: 8px;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scrollbar-width: thin;
	scrollbar-color: rgb(0 0 0 / 0.2) transparent;
}

.row__list {
	display: flex;
	touch-action: pan-x pan-y pinch-zoom;
}

.row__item {
	flex: none;
	width: 312px;
	padding-right: 12px;
	scroll-snap-align: start;
}

@media (min-width: 64rem) {
	.row {
		margin-top: 24px;
	}

	.row__item {
		width: calc((100% - 132px) * 5 / 12 + 60px);
	}
}

.row[data-ready] {
	scroll-snap-type: none;
	scrollbar-width: none;
	cursor: grab;
}

.row[data-ready]::-webkit-scrollbar {
	display: none;
}

.row.is-dragging {
	cursor: grabbing;
	user-select: none;
	-webkit-user-select: none;
}

.row.is-dragging a {
	pointer-events: none;
}

.tile {
	display: block;
}

.tile__img {
	width: 100%;
	aspect-ratio: 4 / 5;
	object-fit: cover;
	border-radius: 4px;
	background: #e9e7e1;
	-webkit-user-drag: none;
}

.tile__name {
	display: block;
	margin-top: 8px;
	line-height: 1.2;
}

.all-link {
	display: flex;
	justify-content: space-between;
	padding: 20px 12px;
	background: var(--black);
	color: var(--white);
	font-size: 1.25rem;
	line-height: 1.2;
	letter-spacing: -0.01em;
}

.all-link:hover span:first-child {
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

/* Artículo (página interior) ---------------------------------------------- */

.site-main {
	outline: none;
}

.story {
	padding: 64px 12px 0;
}

@media (min-width: 64rem) {
	.story {
		padding-top: 80px;
	}
}

.story__date {
	white-space: nowrap;
}

.story__words {
	grid-column: 2 / 3;
}

.story__photo {
	grid-column: 2 / 3;
	margin-top: 8px;
}

.story__cover {
	grid-column: 1 / -1;
	width: 100%;
	margin-top: 20px;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border-radius: 4px;
}

.story__title {
	grid-column: 1 / -1;
	margin-top: 20px;
	font-size: 1.5rem;
	line-height: 1.2;
}

.story__body {
	grid-column: 1 / -1;
	margin-top: 32px;
}

.share {
	grid-column: 1 / -1;
	display: flex;
	gap: 8px;
	margin-top: 48px;
}

@media (min-width: 64rem) {
	.story__date {
		grid-column: 9 / 10;
		grid-row: 1;
		justify-self: end;
	}

	.story__words {
		grid-column: 4 / 6;
		grid-row: 1;
	}

	.story__photo {
		grid-column: 6 / 9;
		grid-row: 1;
		margin-top: 0;
	}

	.story__cover,
	.story__title,
	.story__body,
	.share {
		grid-column: 4 / 10;
	}

	.story__title {
		margin-top: 24px;
	}

	.share {
		margin-top: 64px;
	}
}

.story__title--page {
	margin-top: 0;
}

.story__cover--page {
	margin-top: 20px;
}

.story__title--page + .story__body {
	margin-top: 32px;
}

.badge {
	display: inline-grid;
	place-items: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: var(--black);
	color: var(--white);
	font-size: 0.75rem;
	letter-spacing: 0.02em;
}

a:hover > .badge {
	background: var(--brand);
}

/* Texto del artículo */

.article {
	font-size: 1rem;
	font-weight: 400;
	line-height: 1.4;
	letter-spacing: 0.01em;
}

.article > * + * {
	margin-top: 1em;
}

.article blockquote {
	margin: 40px 0;
	font-size: 1.25rem;
	font-weight: 600;
	font-style: italic;
	line-height: 1.2;
	letter-spacing: -0.01em;
}

.article blockquote p + p {
	margin-top: 0.6em;
}

.article blockquote cite {
	display: block;
	margin-top: 0.6em;
	font-size: 0.875rem;
	font-style: normal;
}

.article a {
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

.article h2,
.article h3,
.article h4 {
	margin-top: 2em;
	font-size: 1.25rem;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: -0.01em;
}

.article ul {
	list-style: disc;
	padding-left: 1.25em;
}

.article ol {
	list-style: decimal;
	padding-left: 1.25em;
}

.article li + li {
	margin-top: 0.4em;
}

.article img {
	border-radius: 4px;
}

.article figure,
.article .wp-block-image {
	margin-block: 2em;
}

.article figcaption,
.article .wp-caption-text {
	margin-top: 8px;
	font-size: 0.875rem;
	line-height: 1.2;
	opacity: 0.7;
}

.article .wp-block-gallery,
.article .gallery {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: 8px;
}

.article .wp-block-gallery figure,
.article .gallery figure {
	margin: 0;
}

.article iframe,
.article video {
	width: 100%;
	border-radius: 4px;
}

.article pre,
.article code {
	font-size: 0.875rem;
}

.article pre {
	overflow-x: auto;
	padding: 12px;
	background: rgb(0 0 0 / 0.05);
	border-radius: 4px;
}

.article .alignleft {
	float: left;
	margin: 0.4em 1.5em 1em 0;
}

.article .alignright {
	float: right;
	margin: 0.4em 0 1em 1.5em;
}

.article .aligncenter {
	margin-inline: auto;
}

.article .alignwide,
.article .alignfull {
	max-width: 100%;
}

.page-links {
	margin-top: 2em;
}

/* Más historias (tarjeta negra) y listados -------------------------------- */

.stories-card {
	margin: 80px 4px 0;
	padding: 8px;
	background: var(--black);
	color: var(--white);
}

.stories {
	display: flex;
	flex-direction: column;
	gap: 24px;
}

@media (min-width: 64rem) {
	.stories {
		gap: 12px;
	}
}

.story-item {
	row-gap: 8px;
}

.story-item__date {
	order: 3;
}

.story-item__img {
	order: 1;
	grid-column: 1 / -1;
	width: 100%;
	aspect-ratio: 1;
	object-fit: cover;
	border-radius: 4px;
}

.story-item__img--empty {
	background: rgb(127 127 127 / 0.25);
}

.story-item__title {
	order: 2;
	grid-column: 1 / -1;
	font-size: 1.5rem;
	line-height: 1.2;
}

.story-item:hover .story-item__title {
	text-decoration: underline;
}

@media (min-width: 64rem) {
	.story-item__date {
		order: 0;
		grid-column: 1 / 4;
	}

	.story-item__img {
		order: 0;
		grid-column: 4 / 7;
	}

	.story-item__title {
		order: 0;
		grid-column: 7 / 10;
	}
}

.listing-head {
	padding: 64px 12px 0;
}

.listing-head .story__title {
	margin-top: 0;
}

.stories--light {
	margin: 40px 0 0;
	padding: 0 12px;
}

.stories--light .stories {
	gap: 32px;
}

.listing-empty {
	padding: 24px 12px 0;
}

.listing-empty__body {
	grid-column: 1 / -1;
	display: flex;
	flex-direction: column;
	gap: 20px;
}

@media (min-width: 64rem) {
	.listing-head .story__title,
	.listing-empty__body {
		grid-column: 4 / 10;
	}
}

.pagination,
.navigation.pagination {
	margin: 40px 12px 0;
}

.pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
}

.pagination .page-numbers.current {
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

@media (min-width: 64rem) {
	.pagination {
		padding-left: calc((100% - 24px - 132px) / 12 * 3 + 36px);
	}
}

/* Búsqueda ---------------------------------------------------------------- */

.search-form {
	display: flex;
	gap: 8px;
}

.search-form__input {
	flex: 1;
	min-width: 0;
	padding: 12px;
	font: inherit;
	font-weight: 400;
	color: inherit;
	background: transparent;
	border: 1px solid currentColor;
	border-radius: 4px;
}

.search-form__submit {
	padding: 12px 16px;
	background: var(--black);
	color: var(--white);
	border-radius: 4px;
}

/* Pie de página ----------------------------------------------------------- */

.site-footer {
	margin: 80px 4px 4px;
	padding: 12px 12px 8px;
	background: var(--brand);
	color: var(--white);
	min-height: 160px;
}

.site-footer__inner {
	row-gap: 12px;
}

.site-footer__copy {
	grid-column: 1 / 2;
}

.site-footer__social {
	grid-column: 2 / 3;
}

.site-footer__nav {
	grid-column: 1 / -1;
}

.site-footer__nav ul {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 20px;
}

.site-footer a:hover {
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

@media (min-width: 64rem) {
	.site-footer__copy {
		grid-column: 1 / 4;
	}

	.site-footer__social {
		grid-column: 4 / 7;
	}

	.site-footer__nav {
		grid-column: 7 / 13;
	}
}

body.ground-white .site-footer,
.site-main:has(.stories-card) + .site-footer {
	margin-top: 4px;
}

/* Contenido nativo de WordPress ------------------------------------------- */

.wp-caption {
	max-width: 100%;
}

.sticky,
.bypostauthor {
	display: block;
}

/* Transición carousel ------------------------------------------------------ */

.ptw2-overlay {
	position: fixed;
	inset: 0;
	z-index: 100000;
	overflow: hidden;
	overscroll-behavior: contain;
	background: #000;
}

.ptw2-strip {
	will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
	* {
		scroll-behavior: auto !important;
	}
}
