/*
Theme Name: Distretto del Cibo
Theme URI: https://github.com/
Description: Tema istituzionale leggero per la piattaforma «Distretto del Cibo – Dashboard territoriale». Ispirato alle linee guida Designers Italia (font Titillium Web incluso, nessun servizio esterno), con home dedicata, accessi rapidi per imprese, Comuni e cittadini, pagine a piena larghezza per dashboard e area riservata.
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 8.1
Author: Distretto del Cibo
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: distretto-cibo-tema
Tags: one-column, custom-logo, custom-menu, accessibility-ready, translation-ready
*/

/* ---------- Font locali (Titillium Web, SIL Open Font License) ---------- */
@font-face { font-family: "Titillium Web"; font-style: normal; font-weight: 400; font-display: swap; src: url("assets/fonts/titillium-400.woff2") format("woff2"); }
@font-face { font-family: "Titillium Web"; font-style: normal; font-weight: 600; font-display: swap; src: url("assets/fonts/titillium-600.woff2") format("woff2"); }
@font-face { font-family: "Titillium Web"; font-style: normal; font-weight: 700; font-display: swap; src: url("assets/fonts/titillium-700.woff2") format("woff2"); }

/* ---------- Base ---------- */
:root {
	--dct-primary: #0b6e4f;
	--dct-primary-dark: #08503a;
	--dct-primary-darker: #053124;
	--dct-ink: #1a2b33;
	--dct-muted: #5b6b73;
	--dct-line: #dfe5e8;
	--dct-bg-soft: #f4f7f6;
	--dct-radius: 10px;
	--dct-width: 1320px;
	--dct-font: "Titillium Web", "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--dct-font); font-size: 18px; line-height: 1.55; color: var(--dct-ink); background: #fff; }
img { max-width: 100%; height: auto; }
a { color: var(--dct-primary); text-underline-offset: 2px; }
a:hover { color: var(--dct-primary-dark); }
h1, h2, h3, h4 { font-family: var(--dct-font); line-height: 1.2; color: var(--dct-ink); margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(2rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
h3 { font-size: 1.25rem; }
:focus-visible { outline: 3px solid #ffb300 !important; outline-offset: 2px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
.dct-skip { position: absolute; left: 1rem; top: -100px; z-index: 1000; background: #fff; color: var(--dct-primary-darker); padding: .6rem 1rem; border-radius: 6px; font-weight: 700; }
.dct-skip:focus { top: 1rem; }
.dct-container { width: 100%; max-width: var(--dct-width); margin: 0 auto; padding: 0 24px; }
.dct-container-wide { max-width: var(--dct-width); }
.dct-narrow { max-width: 860px; }

/* ---------- Bottoni ---------- */
.dct-btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; padding: .75em 1.4em; border-radius: 6px; background: var(--dct-primary); color: #fff !important; font-weight: 700; text-decoration: none; border: 2px solid var(--dct-primary); font-size: 1rem; line-height: 1.2; cursor: pointer; font-family: inherit; }
.dct-btn:hover { background: var(--dct-primary-dark); border-color: var(--dct-primary-dark); }
.dct-btn-light { background: #fff; color: var(--dct-primary-darker) !important; border-color: #fff; }
.dct-btn-light:hover { background: #eef6f2; border-color: #eef6f2; }
.dct-btn-outline { background: transparent; border-color: rgba(255,255,255,.85); }
.dct-btn-outline:hover { background: rgba(255,255,255,.12); border-color: #fff; }

/* ---------- Testata ---------- */
.dct-slim { background: var(--dct-primary-darker); color: #fff; font-size: .9rem; }
.dct-slim-in { display: flex; justify-content: space-between; align-items: center; min-height: 48px; gap: 1rem; }
.dct-ente { color: #fff; font-weight: 600; text-decoration: none; }
a.dct-ente:hover { color: #fff; text-decoration: underline; }
.dct-slim-right { display: flex; align-items: center; gap: 1.2rem; margin-left: auto; }
.dct-menu-servizio { display: flex; gap: 1rem; list-style: none; margin: 0; padding: 0; }
.dct-menu-servizio a { color: #fff; text-decoration: none; }
.dct-login { display: inline-flex; align-items: center; gap: .5em; background: var(--dct-primary); color: #fff; text-decoration: none; font-weight: 600; align-self: stretch; padding: 0 1.1rem; min-height: 48px; }
.dct-login:hover { background: var(--dct-primary-dark); color: #fff; }
.dct-avatar { width: 26px; height: 26px; border-radius: 50%; background: #fff; color: var(--dct-primary-darker); display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 700; }
.dct-center { background: var(--dct-primary); color: #fff; }
.dct-center-in { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding-top: 1.4rem; padding-bottom: 1.2rem; }
.dct-brand { display: flex; align-items: center; gap: 1rem; color: #fff; text-decoration: none; }
.dct-brand:hover { color: #fff; }
.dct-logo { width: 64px; height: 64px; flex: 0 0 auto; object-fit: contain; }
.dct-brand-text { display: flex; flex-direction: column; }
.dct-brand-name { font-size: clamp(1.35rem, 2.6vw, 1.9rem); font-weight: 700; line-height: 1.1; }
.dct-brand-sub { font-size: .95rem; opacity: .88; margin-top: .2em; }
.dct-search { display: flex; align-items: center; background: #fff; border-radius: 999px; padding: 4px; min-width: 260px; }
.dct-search input { border: 0; background: transparent; padding: .45em .9em; font: inherit; font-size: 1rem; flex: 1; min-width: 0; color: var(--dct-ink); }
.dct-search input:focus { outline: none; }
.dct-search:focus-within { outline: 3px solid #ffb300; outline-offset: 2px; }
.dct-search button { border: 0; background: var(--dct-primary); color: #fff; width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.dct-navbar { background: var(--dct-primary); color: #fff; border-top: 1px solid rgba(255,255,255,.18); }
.dct-nav .dct-menu { display: flex; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.dct-nav .dct-menu > li { position: relative; }
.dct-nav .dct-menu a { display: block; color: #fff; text-decoration: none; font-weight: 600; padding: .85rem 1rem; border-bottom: 3px solid transparent; }
.dct-nav .dct-menu > li:first-child > a { padding-left: 0; }
.dct-nav .dct-menu a:hover, .dct-nav .current-menu-item > a, .dct-nav .current_page_item > a, .dct-nav .current-menu-ancestor > a { border-bottom-color: #fff; color: #fff; }
.dct-nav .sub-menu { display: none; position: absolute; left: 0; top: 100%; min-width: 240px; background: #fff; list-style: none; padding: .4rem 0; margin: 0; box-shadow: 0 10px 30px rgba(0,0,0,.15); border-radius: 0 0 6px 6px; z-index: 50; }
.dct-nav .sub-menu a { color: var(--dct-ink); padding: .55rem 1rem; border: 0; font-weight: 400; }
.dct-nav .sub-menu a:hover { background: var(--dct-bg-soft); }
.dct-nav li:hover > .sub-menu, .dct-nav li.is-focus > .sub-menu { display: block; }
.dct-toggle { display: none; background: none; border: 0; color: #fff; font: inherit; font-weight: 700; padding: .8rem 0; cursor: pointer; align-items: center; gap: .6em; }
.dct-burger, .dct-burger::before, .dct-burger::after { display: block; width: 22px; height: 2px; background: #fff; position: relative; }
.dct-burger::before, .dct-burger::after { content: ""; position: absolute; left: 0; }
.dct-burger::before { top: -7px; } .dct-burger::after { top: 7px; }

/* ---------- Contenuti ---------- */
.dct-main { padding: 1.5rem 0 3.5rem; min-height: 50vh; }
.dct-breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: .4em; padding: 0; margin: 0 0 1.4rem; font-size: .95rem; color: var(--dct-muted); }
.dct-breadcrumb li + li::before { content: "/"; margin-right: .4em; color: #9aa7ad; }
.dct-breadcrumb a { color: var(--dct-primary); }
.dct-page-head { margin-bottom: 2rem; }
.dct-lead { font-size: 1.2rem; color: var(--dct-muted); max-width: 70ch; }
.dct-meta { font-size: .9rem; color: var(--dct-muted); text-transform: uppercase; letter-spacing: .04em; margin: 0 0 .4rem; font-weight: 600; }
.dct-content { max-width: 80ch; }
.dct-content-app { max-width: none; }
.dct-content > * + * { margin-top: 1em; }
.dct-content blockquote { border-left: 4px solid var(--dct-primary); margin-left: 0; padding-left: 1.2em; color: var(--dct-muted); }
.dct-content table { border-collapse: collapse; width: 100%; }
.dct-content th, .dct-content td { border-bottom: 1px solid var(--dct-line); padding: .5em .6em; text-align: left; }
.dct-content .alignwide, .dct-content .alignfull { max-width: none; }
.dct-content-app .dc-app.alignwide { margin: 0; }
.dct-featured { margin: 0 0 1.8rem; }
.dct-featured img { border-radius: var(--dct-radius); width: 100%; }
.dct-updated { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--dct-line); color: var(--dct-muted); font-size: .9rem; }
.dct-tags { display: flex; flex-wrap: wrap; gap: .4em; list-style: none; padding: 0; margin: 2rem 0; }
.dct-tags a { display: inline-block; padding: .2em .8em; border-radius: 999px; background: var(--dct-bg-soft); text-decoration: none; font-size: .9rem; }
.dct-empty { color: var(--dct-muted); font-style: italic; }
.dct-search-big { max-width: 560px; border: 1px solid #b8c4ca; border-radius: 8px; margin-bottom: 2rem; }
.dct-search-big button { width: auto; border-radius: 6px; padding: 0 1.2em; font-weight: 700; font-family: inherit; }
.post-navigation .nav-links { display: flex; justify-content: space-between; gap: 1rem; margin: 2.5rem 0; padding-top: 1.5rem; border-top: 1px solid var(--dct-line); }
.pagination .nav-links { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: 2rem; }
.pagination .page-numbers { padding: .4em .8em; border: 1px solid var(--dct-line); border-radius: 6px; text-decoration: none; }
.pagination .current { background: var(--dct-primary); color: #fff; border-color: var(--dct-primary); }

/* ---------- Schede ---------- */
.dct-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.4rem; }
.dct-card { background: #fff; border: 1px solid var(--dct-line); border-radius: var(--dct-radius); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .15s, transform .15s; }
.dct-card:hover { box-shadow: 0 10px 28px rgba(0,0,0,.08); transform: translateY(-2px); }
.dct-card-img img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.dct-card-body { padding: 1.2rem 1.3rem 1.4rem; }
.dct-card h3 { font-size: 1.2rem; margin-bottom: .4rem; }
.dct-card h3 a { color: var(--dct-ink); text-decoration: none; }
.dct-card h3 a:hover { color: var(--dct-primary); text-decoration: underline; }
.dct-card p { margin: 0; color: var(--dct-muted); font-size: 1rem; }

/* ---------- Home ---------- */
.dct-home { padding-top: 0; }
.dct-hero { background: linear-gradient(135deg, var(--dct-primary-darker), var(--dct-primary) 70%); color: #fff; padding: 4rem 0 4.5rem; position: relative; overflow: hidden; }
.dct-hero::after { content: ""; position: absolute; right: -120px; top: -120px; width: 480px; height: 480px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.12), transparent 70%); pointer-events: none; }
.dct-hero-img { background: linear-gradient(90deg, rgba(5,49,36,.92), rgba(5,49,36,.55)), var(--dct-hero) center/cover no-repeat; }
.dct-hero-in { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 3rem; align-items: center; position: relative; z-index: 1; }
.dct-hero h1 { color: #fff; font-size: clamp(2.1rem, 4.6vw, 3.3rem); margin-bottom: .4em; }
.dct-eyebrow { text-transform: uppercase; letter-spacing: .1em; font-size: .85rem; font-weight: 700; opacity: .85; margin: 0 0 .6rem; }
.dct-hero-lead { font-size: 1.25rem; max-width: 60ch; opacity: .95; margin: 0 0 1.8rem; }
.dct-cta { display: flex; flex-wrap: wrap; gap: .8rem; }
.dct-hero-kpi { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.dct-hero-kpi li { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.22); border-radius: var(--dct-radius); padding: 1.1rem 1.2rem; backdrop-filter: blur(2px); }
.dct-hero-kpi b { display: block; font-size: 2.2rem; line-height: 1; }
.dct-hero-kpi span { display: block; font-size: .95rem; opacity: .9; margin-top: .4em; line-height: 1.3; }
.dct-section { padding: 3rem 0; }
.dct-section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.dct-access { padding-top: 0; margin-top: -2rem; position: relative; z-index: 2; }
.dct-access-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.dct-access-card { display: flex; flex-direction: column; gap: .4rem; background: #fff; border-radius: var(--dct-radius); padding: 1.4rem; text-decoration: none; color: var(--dct-ink); box-shadow: 0 8px 26px rgba(0,0,0,.09); border-top: 4px solid var(--dct-primary); transition: transform .15s, box-shadow .15s; }
.dct-access-card:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(0,0,0,.12); color: var(--dct-ink); }
.dct-access-card svg { width: 34px; height: 34px; color: var(--dct-primary); margin-bottom: .3rem; }
.dct-access-card strong { font-size: 1.15rem; }
.dct-access-card span { color: var(--dct-muted); font-size: .98rem; line-height: 1.45; }
.dct-questions { background: var(--dct-bg-soft); }
.dct-q-grid { list-style: none; counter-reset: q; padding: 0; margin: 1.6rem 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.dct-q-grid li { counter-increment: q; }
.dct-q-grid a { display: block; height: 100%; background: #fff; border: 1px solid var(--dct-line); border-radius: var(--dct-radius); padding: 1.3rem 1.3rem 1.3rem 4.2rem; position: relative; text-decoration: none; color: var(--dct-ink); transition: border-color .15s, box-shadow .15s; }
.dct-q-grid a::before { content: counter(q); position: absolute; left: 1.2rem; top: 1.25rem; width: 2.1rem; height: 2.1rem; border-radius: 50%; background: var(--dct-primary); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.dct-q-grid a:hover { border-color: var(--dct-primary); box-shadow: 0 8px 22px rgba(0,0,0,.07); }
.dct-q-grid strong { display: block; font-size: 1.1rem; margin-bottom: .3rem; line-height: 1.3; }
.dct-q-grid span { color: var(--dct-muted); font-size: .97rem; }

/* ---------- Piè di pagina ---------- */
.dct-footer { background: #17262c; color: #e3ebee; padding: 3rem 0 1.5rem; font-size: 1rem; }
.dct-footer a { color: #fff; }
.dct-footer-brand { padding-bottom: 1.6rem; border-bottom: 1px solid rgba(255,255,255,.15); margin-bottom: 2rem; }
.dct-footer-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 2rem; }
.dct-footer-title { color: #fff; font-size: .95rem; text-transform: uppercase; letter-spacing: .06em; padding-bottom: .6rem; border-bottom: 1px solid rgba(255,255,255,.2); margin-bottom: .9rem; }
.dct-footer-list { list-style: none; margin: 0; padding: 0; }
.dct-footer-list li { margin: 0 0 .45rem; }
.dct-footer .dct-widget ul { list-style: none; padding: 0; }
.dct-footer-note { margin-top: 2rem; font-size: .92rem; color: #b9c7cc; }
.dct-footer-legal { margin-top: 2.5rem; padding-top: 1.2rem; border-top: 1px solid rgba(255,255,255,.15); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; font-size: .9rem; color: #b9c7cc; }
.dct-legal { display: flex; flex-wrap: wrap; gap: 1.2rem; list-style: none; margin: 0; padding: 0; }
.dct-footer-legal p { margin: 0; }

/* ---------- Commenti ---------- */
.dct-comments { margin-top: 3rem; }
.dct-comment-list { padding-left: 1.2rem; }
.dct-comments textarea, .dct-comments input[type=text], .dct-comments input[type=email], .dct-comments input[type=url] { width: 100%; border: 1px solid #b8c4ca; border-radius: 6px; padding: .5em .7em; font: inherit; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
	.dct-access-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.dct-q-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
	body { font-size: 17px; }
	.dct-hero-in { grid-template-columns: 1fr; gap: 2rem; }
	.dct-search { display: none; }
	.dct-toggle { display: inline-flex; }
	.dct-nav { display: none; }
	.dct-nav.is-open { display: block; padding-bottom: .8rem; }
	.dct-nav .dct-menu { flex-direction: column; }
	.dct-nav .dct-menu a, .dct-nav .dct-menu > li:first-child > a { padding: .7rem 0; border-bottom: 1px solid rgba(255,255,255,.15); }
	.dct-nav .sub-menu { display: block; position: static; box-shadow: none; background: transparent; padding: 0 0 0 1rem; }
	.dct-nav .sub-menu a { color: #fff; }
}
@media (max-width: 600px) {
	.dct-container { padding: 0 16px; }
	.dct-access-grid, .dct-q-grid { grid-template-columns: 1fr; }
	.dct-logo { width: 48px; height: 48px; }
	.dct-login span:last-child { display: none; }
	.dct-ente { font-size: .82rem; }
	.dct-hero { padding: 2.6rem 0 3.6rem; }
	.dct-hero-kpi b { font-size: 1.7rem; }
}
@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; scroll-behavior: auto !important; }
}
@media print {
	.dct-slim, .dct-navbar, .dct-search, .dct-footer, .dct-skip { display: none; }
	.dct-center { background: none; color: #000; }
	.dct-brand, .dct-brand:hover { color: #000; }
}
@media (max-width: 600px) {
	.dct-center-in { padding-top: 1rem; padding-bottom: 1rem; }
	.dct-brand { gap: .7rem; }
	.dct-brand-name { font-size: 1.2rem; }
	.dct-brand-sub { font-size: .85rem; }
}
