/*
Theme Name: Infinite
Description: Tema di AI NEWS ITALIA con tre colonne animate e archivio cronologico.
Version: 1.0.2
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: infinite
License: GNU General Public License v2 or later
*/

@font-face {
	font-family: Inter;
	src: url("assets/fonts/inter.woff2") format("woff2");
	font-style: oblique 0deg 10deg;
	font-weight: 100 900;
	font-display: swap;
}

:root {
	--edge: clamp(1.15rem, 1.95vw, 3.75rem);
	--gutter: clamp(1.35rem, 2.2vw, 4.25rem);
	--card-gap: clamp(3.6rem, 6.6vw, 8.5rem);
	font-family: Inter, Arial, sans-serif;
	color: #111;
	background: #fff;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; line-height: 1.55; }
a { color: inherit; }
button { color: inherit; font: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.screen-reader-text, .skip-link:not(:focus) {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}
.skip-link:focus { position: fixed; z-index: 10; top: .5rem; left: .5rem; background: white; padding: .5rem; }

.masthead {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--gutter);
	padding: clamp(1rem, 1.65vw, 2rem) var(--edge) clamp(.95rem, 1.25vw, 1.5rem);
	position: relative;
	z-index: 2;
	background: #fff;
}
.masthead a { text-decoration: none; }
.site-name {
	font-size: clamp(1.1rem, 1.2vw, 1.6rem);
	letter-spacing: -.055em;
	line-height: 1.15;
	font-weight: 800;
}
.primary-nav { width: calc((100% - 2 * var(--gutter)) / 3); }
.primary-nav ul { list-style: none; padding: 0; margin: 0; }
.primary-nav > ul, .primary-nav > div > ul {
	display: flex;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: .5rem 1.3rem;
}
.primary-nav li { position: relative; }
.primary-nav a {
	display: block;
	font-size: .875rem;
	line-height: 1.5;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: -.025em;
}
.primary-nav a:hover, .primary-nav a:focus-visible { text-decoration: underline; text-underline-offset: .2em; }
.primary-nav ul ul {
	display: none;
	position: absolute;
	z-index: 3;
	top: 100%;
	inset-inline-end: 0;
	min-width: 10rem;
	background: white;
	padding: .75rem;
	box-shadow: 0 6px 18px #0001;
}
.primary-nav ul ul ul { top: 0; inset-inline-end: 100%; }
.primary-nav li:hover > ul, .primary-nav li:focus-within > ul { display: grid; gap: .5rem; }

.news-feed, .listing { padding-inline: var(--edge); }
.news-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--gutter); }
.news-card { min-width: 0; padding-block-end: var(--card-gap); }
.card-link { text-decoration: none; display: block; }
.card-link:focus-visible { outline-offset: -2px; }
.card-image { margin-bottom: clamp(1.25rem, 2.3vw, 2.9rem); }
.card-image img, .story-image { display: block; width: 100%; height: auto; }
.news-card time, .story time { display: block; color: #6e6e6e; font-size: .875rem; letter-spacing: -.035em; }
.news-card h2 {
	font-size: clamp(1.4rem, 1.65vw, 2.2rem);
	line-height: 1.13;
	letter-spacing: -.052em;
	font-weight: 700;
	margin: clamp(.8rem, 1.15vw, 1.5rem) 0 0;
	overflow-wrap: anywhere;
}
.card-link:hover h2, .card-link:focus-visible h2 { text-decoration: underline; text-decoration-thickness: .06em; text-underline-offset: .14em; }
.news-card p {
	max-width: 48ch;
	margin: .8em 0 0;
	color: #424242;
	font-size: 1rem;
	line-height: 1.6;
	letter-spacing: -.025em;
	overflow-wrap: anywhere;
}
.feed-pages { display: flex; flex-wrap: wrap; gap: 1.5rem; padding-bottom: 2.5rem; }
.load-retry { display: block; margin: 0 auto 2rem; padding: .6rem .9rem; background: white; border: 1px solid; cursor: pointer; }

body.desktop-feed {
	display: flex;
	flex-direction: column;
	height: calc(100vh - var(--toolbar-height, 0px));
	height: calc(100dvh - var(--toolbar-height, 0px));
	overflow: hidden;
}
body.admin-bar { --toolbar-height: var(--wp-admin--admin-bar--height, 32px); }
.desktop-feed .news-feed { flex: 1; min-height: 0; }
.lanes { display: grid; grid-template-columns: repeat(var(--columns, 3), minmax(0, 1fr)); column-gap: var(--gutter); height: 100%; }
.lane {
	min-height: 0;
	overflow: auto;
	overscroll-behavior: contain;
	overflow-anchor: none;
	scrollbar-width: none;
	touch-action: pan-y pinch-zoom;
}
.lane::-webkit-scrollbar { display: none; }
.lane:first-child { --inset: min(9.6vw, 16vh); }
.lane:nth-child(2) { --inset: min(4.2vw, 8vh); }
.lane-archive { padding-top: var(--inset, 0px); }
.lane:focus-visible { outline-offset: -2px; }
.lane, .lane a { -webkit-user-drag: none; }
.is-dragging, .is-dragging .lane a { cursor: grabbing; user-select: none; }
.lane .news-card:last-child { padding-bottom: var(--card-gap); }
.lane-archive .news-card:last-child, .news-list .news-card:last-child { padding-bottom: 2.5rem; }

.reader-dialog {
	width: min(54rem, 92vw);
	max-width: none;
	height: min(90vh, 68rem);
	height: min(90dvh, 68rem);
	max-height: none;
	padding: 0;
	border: 0;
	background: #fff;
	color: #111;
}
.reader-dialog[open] { display: flex; flex-direction: column; }
.reader-dialog::backdrop { background: rgb(10 10 10 / 58%); }
html:has(.reader-dialog[open]) { overflow: hidden; }
.reader-controls { display: flex; justify-content: flex-end; padding: .5rem .8rem 0; }
.reader-close {
	width: 2.75rem;
	height: 2.75rem;
	display: grid;
	place-content: center;
	border: 0;
	background: transparent;
	font-size: 2rem;
	line-height: 1;
	cursor: pointer;
}
.reader-frame { display: block; width: 100%; min-height: 0; flex: 1; border: 0; }
.story {
	max-width: 49rem;
	margin: clamp(2rem, 6vw, 6rem) auto;
	padding-inline: max(1.25rem, 3vw);
	overflow-wrap: anywhere;
}
.article-reader .story { margin: .5rem auto 3.5rem; }
.story h1, .listing h1 { letter-spacing: -.055em; line-height: 1.08; font-size: clamp(2.1rem, 4vw, 3.8rem); }
.story h1 { margin: .4em 0 .65em; }
.story-image { margin: 1.6rem 0; }
.story-body { font-size: 1.0625rem; line-height: 1.7; }
.story-body img, .story-body video, .story-body iframe { max-width: 100%; }
.story-body img { height: auto; }
.story-body figure { max-width: 100%; margin-inline: 0; }
.story-body pre, .story-body .wp-block-table { overflow-x: auto; }
.listing { padding-block: 2rem; }

@media (max-width: 800px) {
	.masthead { flex-wrap: wrap; gap: .65rem 1rem; }
	.primary-nav { width: auto; max-width: 100%; }
	.primary-nav > ul, .primary-nav > div > ul { gap: .5rem 1rem; }
	.primary-nav a { font-size: .8125rem; }
	.news-list { display: block; }
	.news-card { padding-bottom: 3.75rem; }
	.news-card h2 { font-size: clamp(1.55rem, 5vw, 2rem); }
	.reader-dialog { width: 100%; height: 100vh; height: 100dvh; }
}
