/*
Theme Name: Eco del Cesano
Theme URI: https://ecodelcesano.it
Author: GESIMUSE SRL
Description: Tema editoriale premium per portale di informazione (Valle del Cesano). Fonturi self-hosted, dark mode, ticker, cuprins automat, sloturi pubblicitari, SEO/Discover/News integrate, sezioni Shop (Amazon) ed English, logo e dati del footer modificabili dal Customizer.
Version: 2.0.0
Requires at least: 6.3
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ecodelcesano
*/

@font-face { font-family: "Fraunces"; src: url("assets/fonts/fraunces.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("assets/fonts/fraunces-italic.woff2") format("woff2"); font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Inter"; src: url("assets/fonts/inter.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
	--accent: #0b5c63;
	--accent-text: var(--accent);
	--paper: #fcfcfa;
	--ink: #111a19;
	--soft: #55635f;
	--line: #dfe5e2;
	--stone: #f0f3f1;
	--amz: #b86e00;
	--amz-bg: #fff8ea;
	--shadow: 0 6px 24px rgba(10, 30, 30, .09);
	--max: 1200px;
	--serif: "Fraunces", Georgia, "Iowan Old Style", "Times New Roman", serif;
	--sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color-scheme: light;
}
[data-theme="dark"] {
	--accent-text: color-mix(in srgb, var(--accent) 45%, #ffffff);
	--paper: #0d1514;
	--ink: #e9efed;
	--soft: #9fb1ad;
	--line: #243230;
	--stone: #152120;
	--amz: #f0a63a;
	--amz-bg: #1d1a12;
	--shadow: 0 6px 24px rgba(0, 0, 0, .45);
	color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; }
body { margin: 0; font: 400 16.5px/1.6 var(--sans); color: var(--ink); background: var(--paper); text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent-text); }
:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3, h4 { font-family: var(--serif); line-height: 1.18; margin: 0; font-weight: 700; letter-spacing: -0.015em; }
p { margin: 0 0 1em; }
ol, ul { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.sr-only, .screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 14px; z-index: 200; }
.skip-link:focus { left: 8px; }
.site-main { padding-top: 28px; padding-bottom: 56px; }
.site-main.home { padding-top: 0; }

/* Reading progress */
.read-progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 150; background: transparent; }
.read-progress span { display: block; height: 100%; background: var(--accent-text); transform-origin: left; transform: scaleX(0); }

/* Topbar */
.topbar { background: var(--ink); color: color-mix(in srgb, var(--paper) 78%, transparent); font-size: 12.5px; }
[data-theme="dark"] .topbar { background: #070c0b; color: #9fb1ad; }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; min-height: 34px; gap: 12px; }
.lang-switch { color: var(--paper); font-weight: 600; }
[data-theme="dark"] .lang-switch { color: #fff; }
.lang-switch:hover { text-decoration: underline; color: inherit; }

/* Masthead with contour-line art */
.masthead { position: relative; overflow: hidden; padding: 22px 0 18px; text-align: center; }
.masthead-art, .footer-art { position: absolute; inset: 0; pointer-events: none; background: var(--accent-text); opacity: .10;
	-webkit-mask: url("assets/img/contours.svg") center / cover no-repeat; mask: url("assets/img/contours.svg") center / cover no-repeat; }
.masthead-inner { position: relative; }
.brand { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.brand .custom-logo { max-height: 84px; width: auto; }
.brand-name { font-family: var(--serif); font-size: clamp(38px, 8.5vw, 72px); font-weight: 900; letter-spacing: -0.035em; line-height: 1; color: var(--accent-text); }
.brand-tag { font: italic 400 15px var(--serif); color: var(--soft); margin-top: 6px; }

/* Sticky navbar */
.navbar { position: sticky; top: 0; z-index: 100; background: var(--paper); border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line); transition: box-shadow .2s; }
.navbar.is-stuck { box-shadow: var(--shadow); }
.navbar-inner { display: flex; align-items: center; justify-content: space-between; min-height: 52px; gap: 8px; }
.nav-toggle { display: inline-flex; align-items: center; gap: 10px; background: none; border: 0; padding: 8px 0; color: var(--ink); cursor: pointer; font-weight: 600; }
.nav-toggle .bars, .nav-toggle .bars::before, .nav-toggle .bars::after { display: block; width: 20px; height: 2px; background: currentColor; position: relative; content: ""; border-radius: 2px; }
.nav-toggle .bars::before { position: absolute; top: -6px; }
.nav-toggle .bars::after { position: absolute; top: 6px; }
.site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--paper); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); padding: 6px 20px 14px; }
.site-nav.is-open { display: block; }
.nav-list a { display: block; padding: 13px 0; font-weight: 600; border-bottom: 1px solid var(--line); }
.nav-list li:last-child a { border-bottom: 0; }
.tools { display: flex; align-items: center; gap: 2px; }
.icon-btn { background: none; border: 0; color: var(--ink); padding: 10px; border-radius: 50%; cursor: pointer; display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--stone); }
.theme-toggle .i-sun { display: none; }
[data-theme="dark"] .theme-toggle .i-sun { display: block; }
[data-theme="dark"] .theme-toggle .i-moon { display: none; }
.search-bar { border-top: 1px solid var(--line); padding: 14px 0; background: var(--stone); }
.search-bar[hidden] { display: none; }

.search-form { display: flex; gap: 8px; }
.search-form input[type="search"] { flex: 1; padding: 12px 14px; border: 1px solid var(--line); border-radius: 6px; font: inherit; background: var(--paper); color: var(--ink); }
.btn { display: inline-block; padding: 12px 22px; background: var(--accent); color: #fff; border: 0; border-radius: 6px; font: 600 15.5px var(--sans); cursor: pointer; text-align: center; }
.btn:hover { color: #fff; filter: brightness(1.14); }

@media (min-width: 900px) {
	.nav-toggle { display: none; }
	.site-nav { display: block; position: static; box-shadow: none; border: 0; padding: 0; background: none; }
	.nav-list { display: flex; gap: 6px; }
	.nav-list a { border: 0; padding: 15px 14px; font-size: 15px; box-shadow: inset 0 -3px 0 transparent; }
	.nav-list a:hover, .nav-list .current-menu-item > a, .nav-list .current-cat > a { box-shadow: inset 0 -3px 0 var(--accent-text); color: var(--ink); }
}

/* Ticker */
.ticker { background: var(--stone); border-bottom: 1px solid var(--line); font-size: 14px; }
.ticker-inner { display: flex; align-items: center; gap: 14px; min-height: 40px; }
.ticker-label { flex: none; background: var(--accent); color: #fff; font-weight: 700; font-size: 12.5px; padding: 3px 10px; border-radius: 3px; }
.ticker-track { display: flex; overflow: hidden; flex: 1; mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent); }
.ticker-list { display: flex; flex: none; gap: 36px; padding-right: 36px; white-space: nowrap; animation: ec-tick 48s linear infinite; }
.ticker-track:hover .ticker-list { animation-play-state: paused; }
.ticker-list a { font-weight: 500; }
.ticker-list li::before { content: ""; display: inline-block; width: 6px; height: 6px; background: var(--accent-text); transform: rotate(45deg); margin-right: 12px; vertical-align: middle; }
@keyframes ec-tick { to { transform: translateX(-100%); } }
@media (prefers-reduced-motion: reduce) {
	.ticker-track { overflow-x: auto; }
	.ticker-list { animation: none; }
	.ticker-list[aria-hidden="true"] { display: none; }
}

/* Ads */
.ad-slot { display: block; text-align: center; margin: 22px auto; }
.ad-slot:not(:empty)::before { content: "Pubblicità"; display: block; font-size: 11px; color: var(--soft); margin-bottom: 4px; letter-spacing: .04em; }
.ad-slot:empty { display: none; }
.ad-widget { display: flex; justify-content: center; }

/* Covers, cards */
.cover { position: relative; overflow: hidden; background: var(--stone); border-radius: 6px; }
.cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
a:hover > .cover img, .card-link:hover .cover img { transform: scale(1.035); }
.r169 { aspect-ratio: 16 / 9; }
.r1610 { aspect-ratio: 16 / 10; }
.r32 { aspect-ratio: 3 / 2; }
.ph { position: absolute; inset: 0; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), #0b2326); color: rgba(255, 255, 255, .8); font: 900 64px var(--serif); }

.kicker { color: var(--accent-text); font-weight: 700; font-size: 13.5px; }
.kicker.pill { display: inline-block; background: var(--accent); color: #fff; padding: 3px 11px; border-radius: 3px; font-size: 12.5px; margin-bottom: 10px; }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: var(--soft); margin-top: 8px; }
.sep { width: 4px; height: 4px; border-radius: 50%; background: var(--soft); opacity: .6; }
.excerpt { color: var(--soft); font-size: 15.5px; margin: 8px 0 0; }
.price-tag { color: var(--amz); font-weight: 700; }
.card h3 { font-size: 20px; margin-top: 12px; }
.card-link:hover h3, .side-link:hover h3 { color: var(--accent-text); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 30px 24px; }

/* Section heads: diamond mark + hairline */
.section { padding: 34px 0; }
.section-head { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.section-head h2 { font-size: clamp(22px, 3vw, 29px); display: flex; align-items: center; gap: 12px; }
.section-head h2::before { content: ""; width: 11px; height: 11px; background: var(--accent-text); transform: rotate(45deg); flex: none; }
.section-head::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.section-shop { background: var(--amz-bg); }
.section-shop .section-head h2::before { background: var(--amz); }
.section-en { background: var(--stone); }
.amz-note { font-size: 13px; color: var(--soft); font-style: italic; margin: -8px 0 20px; }

/* Hero */
.hero { padding-top: 26px; }
.hero-grid { display: grid; gap: 24px; }
.hero-lead { position: relative; border-radius: 8px; overflow: hidden; }
.hero-lead .cover { border-radius: 8px; aspect-ratio: 16 / 11; }
.hero-text { padding: 16px 2px 0; }
.hero-lead h2 { font-size: clamp(27px, 4.4vw, 44px); letter-spacing: -0.02em; }
.hero-lead .excerpt { font-size: 17px; }
.hero-lead:hover h2 { color: var(--accent-text); }
.hero-side { display: grid; align-content: start; }
.side-item { display: grid; grid-template-columns: 1fr 108px; gap: 14px; padding: 15px 0; border-bottom: 1px solid var(--line); align-items: start; }
.side-item:first-child { padding-top: 0; }
.side-item:last-child { border-bottom: 0; }
.side-item h3 { font-size: 18.5px; margin-top: 3px; }
.side-thumb .cover { border-radius: 4px; }
@media (min-width: 760px) {
	.hero-lead { background: #050c0c; color: #fff; }
	.hero-lead:hover h2 { color: #fff; }
	.hero-lead .cover { aspect-ratio: 16 / 10; border-radius: 0; }
	.hero-text { position: absolute; left: 0; right: 0; bottom: 0; padding: 110px 32px 30px; background: linear-gradient(to top, rgba(4, 12, 12, .92), rgba(4, 12, 12, .6) 55%, transparent); }
	.hero-lead .excerpt, .hero-lead .post-meta { color: rgba(255, 255, 255, .85); }
}
@media (min-width: 960px) { .hero-grid { grid-template-columns: 1.85fr 1fr; gap: 40px; } }

/* Latest + sidebar */
.home-split { display: grid; gap: 40px; }
@media (min-width: 1000px) { .home-split { grid-template-columns: minmax(0, 1fr) 320px; } }
.day-title { font: 700 13.5px var(--sans); color: var(--soft); margin: 4px 0 4px; padding-top: 10px; letter-spacing: .01em; }
.day-group + .day-group { margin-top: 18px; }
.latest-item { display: grid; grid-template-columns: 1fr 112px; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.latest-item h4 { font-size: 21px; margin: 2px 0; }
.latest-item:hover h4 { color: var(--accent-text); }
.latest-thumb .cover { border-radius: 4px; }
@media (min-width: 700px) { .latest-item { grid-template-columns: 1fr 210px; gap: 24px; } .latest-item h4 { font-size: 23px; } }

/* Trending (sidebar) */
.trending-list { display: grid; gap: 4px; }
.trending-list li { display: flex; gap: 14px; align-items: flex-start; padding: 13px 0; border-bottom: 1px solid var(--line); }
.trending-list li:last-child { border-bottom: 0; }
.trending-list .num { font: 900 36px/1 var(--serif); color: var(--accent-text); min-width: 30px; opacity: .9; }
.trending-list h3 { font-size: 17px; }
.trending-list a:hover h3 { color: var(--accent-text); }

/* Single */
.single-layout { display: grid; gap: 44px; }
@media (min-width: 1000px) { .single-layout { grid-template-columns: minmax(0, 1fr) 320px; } }
.single-article { min-width: 0; }
.breadcrumb { font-size: 13px; color: var(--soft); margin-bottom: 16px; }
.breadcrumb a:hover { text-decoration: underline; }
.crumb-sep { margin: 0 7px; opacity: .6; }
.entry-title { font-size: clamp(31px, 5.4vw, 50px); letter-spacing: -0.022em; margin: 8px 0 16px; }
.standfirst { font: 400 clamp(19px, 2.4vw, 22px)/1.45 var(--serif); color: var(--soft); margin-bottom: 20px; }
.byline { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.byline .avatar { border-radius: 50%; flex: none; }
.byline-text { display: flex; flex-direction: column; }
.byline .by a { font-weight: 700; }
.byline .by a:hover { color: var(--accent-text); }
.byline .post-meta { margin-top: 0; }

.share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 22px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.share-label { font-size: 13px; font-weight: 700; color: var(--soft); margin-right: 4px; }
.share-btn { background: var(--stone); color: var(--ink); border: 1px solid var(--line); border-radius: 99px; padding: 6px 14px; font: 600 13px var(--sans); cursor: pointer; }
.share-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

.entry-cover { margin: 0 0 26px; }
.entry-cover figcaption { font-size: 13px; color: var(--soft); margin-top: 8px; }
.credit { display: inline-block; margin-left: 8px; opacity: .85; font-style: italic; }

.key-points { background: var(--stone); border-left: 4px solid var(--accent-text); border-radius: 0 6px 6px 0; padding: 18px 22px; margin: 0 0 28px; }
.kp-title, .toc-title { font: 700 17px var(--serif); margin: 0 0 8px; }
.key-points ul { list-style: disc; padding-left: 20px; display: grid; gap: 6px; }
.key-points li::marker { color: var(--accent-text); }

.toc { border: 1px solid var(--line); border-radius: 6px; padding: 16px 22px; margin: 28px 0; font-family: var(--sans); font-size: 15.5px; background: var(--stone); }
.toc ol { list-style: decimal; padding-left: 20px; display: grid; gap: 6px; }
.toc a { color: var(--accent-text); font-weight: 500; }
.toc a:hover { text-decoration: underline; }

.entry-content { font: 400 19.5px/1.72 var(--serif); max-width: 720px; }
.entry-content > * { margin: 0; }
.entry-content > * + * { margin-top: 1.1em; }
.entry-content > p:first-child::first-letter { float: left; font: 900 3.5em/0.85 var(--serif); padding: 6px 10px 0 0; color: var(--accent-text); }
.entry-content h2 { font-size: clamp(25px, 3.4vw, 32px); margin-top: 1.8em; }
.entry-content h3 { font-size: 24px; margin-top: 1.5em; }
.entry-content a { color: var(--accent-text); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.entry-content blockquote { margin: 1.6em 0; padding: 4px 0 4px 22px; border-left: 4px solid var(--accent-text); font: italic 400 1.15em/1.5 var(--serif); }
.entry-content blockquote p { margin: 0; }
.entry-content ul, .entry-content ol { margin-left: 1.3em; list-style: revert; padding: 0; }
.entry-content li + li { margin-top: .4em; }
.entry-content figure { margin: 1.6em 0; }
.entry-content figcaption { font: 13px var(--sans); color: var(--soft); margin-top: 6px; }
.entry-content table { border-collapse: collapse; width: 100%; font: 15.5px var(--sans); }
.entry-content th, .entry-content td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; }
.entry-content th { background: var(--stone); }
.entry-content .ad-slot { font-family: var(--sans); }
.entry-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0; }
.entry-tags a { background: var(--stone); padding: 5px 13px; border-radius: 99px; font-size: 13.5px; }
.entry-tags a:hover { background: var(--accent); color: #fff; }

.author-box { display: flex; gap: 18px; padding: 22px; background: var(--stone); border-radius: 8px; margin: 32px 0; }
.author-box .avatar { border-radius: 50%; flex: none; }
.a-name { font: 700 19px var(--serif); }
.author-box p { margin: 4px 0; font-size: 15px; color: var(--soft); }
.a-more { font-size: 14px; font-weight: 600; color: var(--accent-text); }
.related { margin-top: 44px; }

/* Amazon box */
.amz-box { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; border: 2px solid var(--amz); background: var(--amz-bg); border-radius: 8px; padding: 18px 22px; margin: 26px 0; font-family: var(--sans); }
.amz-info { display: flex; flex-direction: column; gap: 4px; }
.amz-badge { align-self: flex-start; background: var(--amz); color: #111; font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 99px; }
.amz-title { font: 700 19px var(--serif); }
.amz-price { font-size: 25px; font-weight: 800; color: var(--amz); }
.amz-info small { color: var(--soft); }
.btn-amz { background: var(--amz); color: #111; font-size: 16.5px; padding: 14px 28px; }
.btn-amz:hover { color: #111; }

/* Sidebar */
.sidebar { align-self: start; }
@media (min-width: 1000px) { .sidebar { position: sticky; top: 76px; } }
.widget { margin-bottom: 34px; }
.widget-title { font-size: 20px; padding-bottom: 10px; margin-bottom: 8px; border-bottom: 2px solid var(--ink); }

/* Archive */
.archive-head { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); padding: 8px 0 24px; margin-bottom: 30px; }
.archive-head h1 { font-size: clamp(32px, 5.4vw, 48px); letter-spacing: -0.025em; }
.archive-head .desc { color: var(--soft); max-width: 700px; margin-top: 10px; }
.archive-head .avatar { border-radius: 50%; margin-bottom: 10px; }
.pagination { margin-top: 44px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.page-numbers { padding: 9px 15px; border: 1px solid var(--line); border-radius: 6px; font-weight: 600; }
.page-numbers.current { background: var(--accent); color: #fff; border-color: var(--accent); }
a.page-numbers:hover { border-color: var(--accent-text); }
.empty-state { text-align: center; padding: 48px 0; max-width: 560px; margin: 0 auto; }
.empty-state h1 { font-size: 42px; margin-bottom: 12px; }
.page-article { max-width: 760px; margin: 0 auto; }

/* Comments */
.comments { margin-top: 44px; max-width: 720px; }
.comments h2 { font-size: 25px; margin-bottom: 16px; }
.comment-list li { padding: 16px 0; border-bottom: 1px solid var(--line); list-style: none; }
.comment-list .children { margin-left: 24px; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea { width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 6px; font: inherit; background: var(--paper); color: var(--ink); }
.comment-form .submit { background: var(--accent); color: #fff; border: 0; padding: 12px 24px; border-radius: 6px; font: 600 15.5px var(--sans); cursor: pointer; }

/* Footer */
.site-footer { position: relative; overflow: hidden; background: #0b1514; color: #bccac7; margin-top: 48px; font-size: 14.5px; }
.footer-art { opacity: .12; background: #5fc3cb; }
.site-footer .container { position: relative; }
.site-footer a { color: #fff; }
.site-footer a:hover { text-decoration: underline; color: #fff; }
.footer-grid { display: grid; gap: 34px; padding-top: 52px; padding-bottom: 40px; }
@media (min-width: 900px) { .footer-grid { grid-template-columns: 1.5fr 1fr 1fr; gap: 56px; } }
.footer-brand .brand-name { color: #fff; font-size: 34px; }
.footer-brand .custom-logo { max-height: 58px; width: auto; }
.footer-about { margin: 14px 0 22px; }
.footer-h { font: 700 17px var(--serif); color: #fff; margin: 0 0 12px; }
.footer-note { margin: 0; line-height: 1.75; }
.footer-contacts li, .footer-col ul li { padding: 4px 0; }
.social { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.social a { display: inline-block; border: 1px solid rgba(255, 255, 255, .28); border-radius: 99px; padding: 5px 14px; font-size: 13px; font-weight: 600; }
.social a:hover { background: #fff; color: #0b1514; text-decoration: none; }
.footer-bottom { position: relative; border-top: 1px solid rgba(255, 255, 255, .14); padding: 22px 0 30px; font-size: 13px; }
.footer-bottom p { margin: 0 0 8px; }
.footer-legal { color: #8ea09c; }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } .cover img { transform: none !important; } }
@media print { .topbar, .navbar, .ticker, .masthead-art, .site-footer, .sidebar, .comments, .related, .share, .ad-slot, .read-progress { display: none !important; } }
