/* Pentothal – app.css
   Mobile-first. Su desktop l'app resta in una colonna centrale da telefono.
   Per modificare: usa le variabili qui sotto da custom/custom.css (non serve toccare questo file). */

:root {
	--p-bg: #000;
	--p-surface: #0d0e12;
	--p-surface-2: #16181d;
	--p-line: #1b1d22;
	--p-text: #fff;
	--p-muted: #9aa0aa;
	--p-accent: #c8102e;
	--p-header-h: 52px;
	--p-nav-h: 54px;
	--p-shell-w: 480px;
	--p-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--p-font-display: "Arial Black", "Helvetica Neue", Impact, system-ui, sans-serif;
	--p-vh: 100vh;
}

@supports (height: 100dvh) {
	:root { --p-vh: 100dvh; }
}

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

html, body {
	margin: 0;
	padding: 0;
	background: #050505;
	color: var(--p-text);
	font-family: var(--p-font);
	-webkit-tap-highlight-color: transparent;
	-webkit-text-size-adjust: 100%;
}

body { height: var(--p-vh); overflow: hidden; }

img { max-width: 100%; }
button { font-family: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.p-view:focus, .p-reader:focus { outline: none; }

/* ---------- Shell (colonna da telefono) ---------- */
.p-shell {
	position: relative;
	width: 100%;
	max-width: var(--p-shell-w);
	height: var(--p-vh);
	margin: 0 auto;
	overflow: hidden;
	background: var(--p-bg);
}

@media (min-width: 600px) {
	.p-shell { border-left: 1px solid var(--p-line); border-right: 1px solid var(--p-line); }
}

body.admin-bar .p-shell { height: calc(var(--p-vh) - 46px); }
@media (min-width: 783px) {
	body.admin-bar .p-shell { height: calc(var(--p-vh) - 32px); }
}

/* ---------- Header (logo al centro) ---------- */
.p-header {
	position: absolute;
	top: 0; left: 0; right: 0;
	z-index: 30;
	height: calc(var(--p-header-h) + env(safe-area-inset-top));
	padding-top: env(safe-area-inset-top);
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	background: linear-gradient(to bottom, rgba(0,0,0,.88), rgba(0,0,0,0));
	pointer-events: none;
}
.p-header > * { pointer-events: auto; }

.p-logo { display: block; line-height: 0; justify-self: center; }
.p-logo img { display: block; height: 24px; width: auto; }

.p-header__slot { display: flex; align-items: center; gap: 6px; }
.p-header__slot--left { justify-content: flex-start; padding-left: 8px; }
.p-header__slot--right { justify-content: flex-end; padding-right: 8px; }

.p-iconbtn {
	width: 42px; height: 42px;
	display: grid; place-items: center;
	border: 0; border-radius: 50%;
	background: rgba(0,0,0,.4);
	color: #fff;
	cursor: pointer;
	text-decoration: none;
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
}
.p-iconbtn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Stage (tutto tra header e barra in basso) ---------- */
.p-app,
.p-doc {
	position: absolute;
	top: 0; left: 0; right: 0;
	bottom: calc(var(--p-nav-h) + env(safe-area-inset-bottom));
}

.p-view {
	position: absolute;
	inset: 0;
	overflow-y: auto;
	overflow-x: hidden;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	visibility: hidden;
	pointer-events: none;
	opacity: 0;
	transition: opacity .18s ease, visibility 0s linear .18s;
}
.p-view::-webkit-scrollbar { display: none; }
.p-view.is-active {
	visibility: visible;
	pointer-events: auto;
	opacity: 1;
	transition-delay: 0s;
}

/* ---------- Feed ---------- */
.p-view--feed {
	scroll-snap-type: y mandatory;
	background: #000;
}

.p-card {
	position: relative;
	height: 100%;
	overflow: hidden;
	scroll-snap-align: start;
	scroll-snap-stop: always;
	background: #0b0c0f;
	isolation: isolate;
}

.p-card__img {
	position: absolute; inset: 0;
	width: 100%; height: 100%;
	object-fit: cover;
	transform: scale(1);
	transition: transform 9s ease-out;
	z-index: -3;
}
.p-card.is-active .p-card__img { transform: scale(1.07); }

.p-card__bg--empty {
	position: absolute; inset: 0;
	background: #0b0c0f;
	z-index: -3;
}
.p-card__bg--empty::before {
	content: "";
	position: absolute; inset: 0;
	background: radial-gradient(90% 60% at 85% 8%, var(--p-accent), transparent 70%);
	opacity: .55;
}

.p-card__shade {
	position: absolute; inset: 0;
	z-index: -2;
	background:
		linear-gradient(to top, rgba(0,0,0,.94) 0%, rgba(0,0,0,.6) 36%, rgba(0,0,0,0) 66%),
		linear-gradient(to bottom, rgba(0,0,0,.5), rgba(0,0,0,0) 22%);
}

.p-card__body {
	position: absolute;
	left: 0; right: 68px; bottom: 0;
	padding: 0 8px 20px 16px;
	display: flex; flex-direction: column; gap: 10px;
}

.p-chip {
	align-self: flex-start;
	background: var(--p-accent);
	color: #fff;
	font: 800 11px/1 var(--p-font);
	letter-spacing: .08em;
	text-transform: uppercase;
	padding: 6px 9px;
	border-radius: 4px;
}

.p-card__title {
	margin: 0;
	font: 900 clamp(26px, 8vw, 36px)/1.03 var(--p-font-display);
	letter-spacing: -.01em;
	text-transform: uppercase;
	overflow-wrap: anywhere;
	display: -webkit-box;
	-webkit-line-clamp: 5;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-shadow: 0 2px 18px rgba(0,0,0,.45);
}

.p-card__excerpt {
	margin: 0;
	font-size: 15px;
	line-height: 1.4;
	color: rgba(255,255,255,.86);
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.p-card__meta {
	display: flex; align-items: center; gap: 8px;
	font-size: 13px; font-weight: 600;
	color: rgba(255,255,255,.8);
}
.p-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; background: var(--p-surface-2); flex: none; }
.p-dot { opacity: .6; }

.p-card__read {
	align-self: flex-start;
	display: inline-flex; align-items: center; gap: 8px;
	border: 0;
	background: #fff; color: #000;
	font: 800 13px/1 var(--p-font);
	letter-spacing: .06em;
	text-transform: uppercase;
	text-decoration: none;
	padding: 12px 16px;
	border-radius: 999px;
	cursor: pointer;
}
.p-card__read svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }

.p-rail {
	position: absolute;
	right: 10px; bottom: 24px;
	display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.p-rail__btn {
	width: 48px; height: 48px;
	display: grid; place-items: center;
	border: 0; border-radius: 50%;
	background: rgba(255,255,255,.16);
	color: #fff;
	cursor: pointer;
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
}
.p-rail__btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.p-rail__meta { font-size: 12px; font-weight: 800; color: rgba(255,255,255,.85); text-shadow: 0 1px 6px rgba(0,0,0,.6); }

.p-sentinel { height: 1px; scroll-snap-align: none; }

.p-card--end { display: grid; place-items: center; }
.p-end { padding: 24px; text-align: center; max-width: 360px; }
.p-end__title { margin: 0 0 10px; font: 900 34px/1.02 var(--p-font-display); text-transform: uppercase; }
.p-end__text { margin: 0 0 22px; color: rgba(255,255,255,.8); font-size: 16px; line-height: 1.4; }
.p-end__actions { display: flex; flex-direction: column; align-items: center; gap: 12px; }

/* ---------- Indice ---------- */
.p-view--indice,
.p-view--chi-siamo,
.p-doc--list {
	padding: calc(var(--p-header-h) + env(safe-area-inset-top) + 6px) 14px 28px;
	background: var(--p-bg);
}
.p-doc--list { overflow-y: auto; overscroll-behavior: contain; }

.p-view__title {
	margin: 0 0 14px;
	font: 900 24px/1 var(--p-font-display);
	text-transform: uppercase;
	letter-spacing: -.005em;
}

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

.p-tile { display: block; color: #fff; text-decoration: none; }
.p-tile__thumb {
	display: block;
	position: relative;
	aspect-ratio: 3 / 4;
	border-radius: 10px;
	overflow: hidden;
	background: var(--p-surface-2);
}
.p-tile__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.p-tile__thumb--empty::before {
	content: "";
	position: absolute; inset: 0;
	background: radial-gradient(90% 60% at 85% 8%, var(--p-accent), transparent 70%);
	opacity: .5;
}
.p-tile__title {
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin-top: 8px;
	font: 700 14px/1.25 var(--p-font);
}
.p-tile:active .p-tile__thumb { transform: scale(.98); }

/* ---------- Chi siamo ---------- */
.p-view--chi-siamo { scroll-snap-type: y proximity; }
.p-about__intro { padding: 4px 2px 20px; }
.p-about__title { margin: 0 0 10px; font: 900 34px/1 var(--p-font-display); text-transform: uppercase; }
.p-about__text { margin: 0; color: #c9ccd3; font-size: 16px; line-height: 1.5; }

.p-person {
	scroll-snap-align: start;
	scroll-margin-top: calc(var(--p-header-h) + env(safe-area-inset-top));
	margin: 0 0 18px;
	background: var(--p-surface);
	border: 1px solid var(--p-line);
	border-radius: 16px;
	overflow: hidden;
}
.p-person__photo { position: relative; aspect-ratio: 4 / 5; background: var(--p-surface-2); }
.p-person__photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.p-person__photo--empty::before {
	content: "";
	position: absolute; inset: 0;
	background: radial-gradient(90% 60% at 85% 8%, var(--p-accent), transparent 70%);
	opacity: .5;
}
.p-person__body { padding: 16px 16px 18px; }
.p-person__name { margin: 0; font: 900 26px/1.04 var(--p-font-display); text-transform: uppercase; }
.p-person__role { margin: 6px 0 12px; color: var(--p-accent); font-weight: 800; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.p-person__bio { color: #d4d7dd; font-size: 15px; line-height: 1.55; }
.p-person__bio p { margin: 0 0 .8em; }
.p-person__links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.p-person__links:empty { display: none; }

.p-pill {
	display: inline-flex; align-items: center; gap: 8px;
	border: 1px solid rgba(255,255,255,.28);
	background: transparent;
	color: #fff;
	font: 700 13px/1 var(--p-font);
	padding: 10px 14px;
	border-radius: 999px;
	text-decoration: none;
	cursor: pointer;
}
.p-pill svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Lettore / articolo ---------- */
.p-reader {
	position: absolute; inset: 0;
	z-index: 20;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	background: var(--p-bg);
	transform: translateY(100%);
	visibility: hidden;
	transition: transform .28s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .28s;
}
.p-reader.is-open { transform: none; visibility: visible; transition-delay: 0s; }

.p-doc { overflow-y: auto; overscroll-behavior: contain; background: var(--p-bg); }

.p-article__hero { position: relative; margin: 0; aspect-ratio: 4 / 5; max-height: 62vh; width: 100%; overflow: hidden; background: var(--p-surface-2); }
.p-article__hero img { display: block; width: 100%; height: 100%; object-fit: cover; }
.p-article__heroshade { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0,0,0,.55), rgba(0,0,0,0) 28%, rgba(0,0,0,0) 55%, #000 100%); }
.p-article--nohero { padding-top: calc(var(--p-header-h) + env(safe-area-inset-top) + 8px); }

.p-article__inner { padding: 4px 18px 44px; }
.p-article__hero + .p-article__inner { margin-top: -34px; position: relative; }
.p-article__title {
	margin: 12px 0 14px;
	font: 900 clamp(28px, 8.2vw, 38px)/1.04 var(--p-font-display);
	text-transform: uppercase;
	letter-spacing: -.01em;
	overflow-wrap: anywhere;
}
.p-article__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--p-muted); font-size: 13px; font-weight: 600; }
.p-article__content { margin-top: 24px; font-size: 17px; line-height: 1.7; color: #e7e9ee; overflow-wrap: break-word; }
.p-article__content > *:first-child { margin-top: 0; }
.p-article__content p { margin: 0 0 1.15em; }
.p-article__content h2, .p-article__content h3, .p-article__content h4 { font-family: var(--p-font-display); text-transform: uppercase; line-height: 1.1; margin: 1.7em 0 .6em; color: #fff; }
.p-article__content h2 { font-size: 1.45em; }
.p-article__content h3 { font-size: 1.2em; }
.p-article__content a { color: #fff; text-decoration: underline; text-decoration-color: var(--p-accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.p-article__content img, .p-article__content video, .p-article__content iframe { max-width: 100%; height: auto; border-radius: 8px; }
.p-article__content iframe { aspect-ratio: 16 / 9; width: 100%; border: 0; }
.p-article__content figure { margin: 1.5em 0; }
.p-article__content figcaption { color: var(--p-muted); font-size: 13px; margin-top: 6px; }
.p-article__content blockquote { margin: 1.5em 0; padding: 2px 0 2px 16px; border-left: 4px solid var(--p-accent); font-size: 1.06em; font-style: italic; color: #fff; }
.p-article__content ul, .p-article__content ol { padding-left: 1.3em; margin: 0 0 1.15em; }
.p-article__content li { margin-bottom: .4em; }
.p-article__content hr { border: 0; border-top: 1px solid var(--p-line); margin: 2em 0; }
.p-article__foot { margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--p-line); }

.p-skel { padding: calc(var(--p-header-h) + 30px) 18px; }
.p-skel i { display: block; height: 16px; border-radius: 6px; margin-bottom: 14px; background: linear-gradient(90deg, #14161b, #1e2128, #14161b); background-size: 200% 100%; animation: p-pulse 1.2s linear infinite; }
.p-skel i:nth-child(1) { height: 220px; border-radius: 12px; margin-bottom: 24px; }
.p-skel i:nth-child(2) { height: 30px; width: 85%; }
.p-skel i:nth-child(5) { width: 70%; }
@keyframes p-pulse { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.p-error { padding: calc(var(--p-header-h) + 60px) 24px; text-align: center; color: #c9ccd3; }
.p-error p { margin: 0 0 18px; }

/* ---------- Barra in basso ---------- */
.p-nav {
	position: absolute;
	left: 0; right: 0; bottom: 0;
	z-index: 30;
	height: calc(var(--p-nav-h) + env(safe-area-inset-bottom));
	padding-bottom: env(safe-area-inset-bottom);
	display: flex;
	background: #000;
	border-top: 1px solid var(--p-line);
}
.p-nav__item {
	position: relative;
	flex: 1 1 0;
	min-width: 0;
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
	color: #7f8590;
	text-decoration: none;
	font: 700 10px/1 var(--p-font);
	letter-spacing: .07em;
	text-transform: uppercase;
}
.p-nav__item svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.p-nav__item.is-active { color: #fff; }
.p-nav__item.is-active::before { content: ""; position: absolute; top: -1px; left: 32%; right: 32%; height: 2px; background: var(--p-accent); }

/* ---------- Toast ---------- */
.p-toast {
	position: absolute;
	left: 50%;
	bottom: calc(var(--p-nav-h) + env(safe-area-inset-bottom) + 14px);
	z-index: 50;
	transform: translate(-50%, 10px);
	background: #fff; color: #000;
	font: 700 13px/1 var(--p-font);
	padding: 11px 16px;
	border-radius: 999px;
	opacity: 0;
	pointer-events: none;
	transition: opacity .2s ease, transform .2s ease;
}
.p-toast.is-show { opacity: 1; transform: translate(-50%, 0); }

.p-pagination { margin-top: 20px; }
.p-pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.p-pagination a, .p-pagination span { color: #fff; border: 1px solid rgba(255,255,255,.28); border-radius: 999px; padding: 8px 12px; text-decoration: none; font-size: 13px; font-weight: 700; }
.p-pagination .current { background: var(--p-accent); border-color: var(--p-accent); }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
	.p-card.is-active .p-card__img { transform: none; }
}
