/*
Theme Name: Da lì si vede il mare – ODV
Theme URI: https://dalsivedeilmare.org/
Author: Da lì si vede il mare – Organizzazione di Volontariato
Author URI: https://dalsivedeilmare.org/
Description: Tema WordPress istituzionale per l'ODV «Da lì si vede il mare» di Bari (Ente del Terzo Settore, D.Lgs. 117/2017). Design moderno e responsive ispirato al mare, dark mode, sezioni dedicate a missione, attività ex art. 5 CTS, trasparenza ex artt. 36-37 dello statuto, adesioni soci/volontari/sostenitori e funzioni future attivabili dal Customizer.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: dalimare
Tags: blog, one-column, custom-menu, custom-logo, translation-ready, accessibility-ready, block-styles, wide-blocks
*/

/* =========================================================
   1. Design tokens
   ========================================================= */
:root {
  --blue-950: #0a2340;
  --blue-900: #0e3055;
  --blue-800: #12447a;
  --blue-700: #185a9d;
  --blue-500: #2b7fc2;
  --blue-300: #7db4dd;
  --blue-100: #d9eaf8;
  --blue-50: #eef5fb;
  --red-600: #c0392f;
  --red-500: #d0342c;
  --green-600: #2c8b45;
  --amber-600: #b57d1e;

  --bg: #fbfaf7;
  --surface: #ffffff;
  --surface-2: #f2f7fc;
  --text: #182f45;
  --muted: #557089;
  --line: #dde7ef;
  --link: var(--blue-700);
  --hero-ink: #f4faff;

  --brand: var(--blue-700);
  --brand-strong: var(--blue-900);
  --accent: var(--red-500);
  --ok: var(--green-600);

  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 10px 30px rgba(10, 35, 64, 0.10);
  --shadow-lg: 0 18px 44px rgba(10, 35, 64, 0.16);

  --font-body: "Source Sans 3", "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --font-head: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;

  --wrap: 1180px;
  --header-h: 72px;
}

html[data-theme="dark"] {
  --bg: #0b1d30;
  --surface: #12283f;
  --surface-2: #16324d;
  --text: #e4eef8;
  --muted: #9db4ca;
  --line: #24405c;
  --link: var(--blue-300);
  --hero-ink: #f4faff;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 18px 44px rgba(0, 0, 0, 0.45);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --bg: #0b1d30;
    --surface: #12283f;
    --surface-2: #16324d;
    --text: #e4eef8;
    --muted: #9db4ca;
    --line: #24405c;
    --link: var(--blue-300);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 18px 44px rgba(0, 0, 0, 0.45);
  }
}

/* =========================================================
   2. Base
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.03rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--brand-strong); }
h1, h2, h3, h4, h5 { font-family: var(--font-head); line-height: 1.18; color: var(--text); margin: 0 0 0.6em; }
h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.35rem); }
p { margin: 0 0 1em; }
blockquote { margin: 1.2em 0; padding: 0.2em 0 0.2em 1.2em; border-left: 4px solid var(--brand); color: var(--muted); font-style: italic; }
hr { border: 0; border-top: 1px solid var(--line); }
:focus-visible { outline: 3px solid var(--blue-500); outline-offset: 2px; border-radius: 4px; }

.dm-skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--blue-900); color: #fff; padding: 10px 18px; border-radius: 0 0 10px 10px;
  transition: top .2s ease;
}
.dm-skip-link:focus { top: 0; color: #fff; }

.dm-container { width: min(100% - 2.4rem, var(--wrap)); margin-inline: auto; }
.dm-section { padding-block: clamp(3.4rem, 7vw, 6rem); }
.dm-section--alt { background: var(--surface-2); }
.dm-section--sea { background: linear-gradient(160deg, var(--blue-950) 0%, var(--blue-800) 55%, var(--blue-500) 120%); color: var(--hero-ink); }
.dm-section--sea h2, .dm-section--sea h3 { color: #fff; }
.dm-section--sea .dm-card h3 { color: var(--text); }
.dm-section--sea a { color: #cfe6f9; }

.dm-kicker {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--brand); margin-bottom: .9rem;
}
.dm-kicker::before { content: ""; width: 26px; height: 3px; border-radius: 2px; background: var(--accent); }
.dm-section--sea .dm-kicker { color: var(--blue-300); }
.dm-lead { font-size: clamp(1.05rem, 1.7vw, 1.25rem); color: var(--muted); max-width: 62ch; }
.dm-section--sea .dm-lead { color: var(--blue-100); }

/* =========================================================
   3. Buttons, badges, chips
   ========================================================= */
.dm-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  padding: .8rem 1.5rem; border-radius: 999px; border: 2px solid transparent;
  font-weight: 700; font-size: .98rem; line-height: 1.2; text-decoration: none; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.dm-btn svg { flex: none; }
.dm-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.dm-btn--primary { background: var(--brand); color: #fff; }
.dm-btn--primary:hover { background: var(--brand-strong); color: #fff; }
.dm-btn--light { background: #fff; color: var(--blue-900); }
.dm-btn--light:hover { background: var(--blue-50); color: var(--blue-900); }
.dm-btn--ghost { border-color: currentColor; color: inherit; background: transparent; }
.dm-btn--red { background: var(--accent); color: #fff; }
.dm-btn--red:hover { background: var(--red-600); color: #fff; }
.dm-btn--sm { padding: .5rem 1rem; font-size: .88rem; }

.dm-badge {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: .3rem .7rem; border-radius: 999px; border: 1px solid transparent;
}
.dm-badge.is-green { background: rgba(44, 139, 69, .12); color: var(--green-600); border-color: rgba(44, 139, 69, .35); }
.dm-badge.is-amber { background: rgba(181, 125, 30, .13); color: var(--amber-600); border-color: rgba(181, 125, 30, .4); }
.dm-badge.is-red { background: rgba(208, 52, 44, .1); color: var(--red-600); border-color: rgba(208, 52, 44, .3); }
.dm-badge.is-blue { background: rgba(24, 90, 157, .1); color: var(--brand); border-color: rgba(24, 90, 157, .3); }

.dm-chips { display: flex; flex-wrap: wrap; gap: .6rem; list-style: none; padding: 0; margin: 1.4rem 0 0; }
.dm-chips li {
  display: inline-flex; align-items: center; gap: .5rem;
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .28);
  color: inherit; border-radius: 999px; padding: .45rem .95rem; font-size: .88rem; font-weight: 600;
}
.dm-chips--solid li { background: var(--surface); border-color: var(--line); color: var(--text); box-shadow: var(--shadow); }
.dm-chips--solid li svg { color: var(--brand); }

/* =========================================================
   4. Header e navigazione
   ========================================================= */
.dm-banner {
  background: var(--accent); color: #fff; font-size: .92rem; position: relative; z-index: 60;
}
.dm-banner a { color: #fff; text-decoration: underline; }
.dm-banner .dm-container { display: flex; align-items: center; gap: 1rem; padding-block: .6rem; }
.dm-banner svg { flex: none; }
.dm-banner__close {
  margin-left: auto; flex: none; background: rgba(255, 255, 255, .18); border: 0; color: #fff;
  width: 30px; height: 30px; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.dm-banner__close:hover { background: rgba(255, 255, 255, .32); }

.dm-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .2s ease;
}
.dm-header.is-scrolled { box-shadow: var(--shadow); }
.dm-header__inner { display: flex; align-items: center; gap: 1.2rem; min-height: var(--header-h); }
.dm-brand { display: inline-flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--text); margin-right: auto; }
.dm-brand img, .dm-brand svg { width: 44px; height: 44px; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(10,35,64,.18); flex: none; }
.dm-brand__name { font-family: var(--font-head); font-weight: 700; font-size: 1.06rem; line-height: 1.15; }
.dm-brand__tag { display: block; font-family: var(--font-body); font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--brand); }
.dm-nav ul { display: flex; align-items: center; gap: .2rem; list-style: none; margin: 0; padding: 0; }
.dm-nav a {
  display: block; padding: .55rem .8rem; border-radius: 10px; text-decoration: none;
  color: var(--text); font-weight: 600; font-size: .95rem;
}
.dm-nav a:hover, .dm-nav .current-menu-item > a, .dm-nav .current_page_item > a { background: var(--blue-50); color: var(--brand); }
html[data-theme="dark"] .dm-nav a:hover, html[data-theme="dark"] .dm-nav .current-menu-item > a { background: var(--surface-2); }
.dm-nav .sub-menu { display: none; position: absolute; min-width: 220px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: .4rem; z-index: 40; list-style: none; }
.dm-nav li { position: relative; }
.dm-nav li:hover > .sub-menu, .dm-nav li.dm-sub-open > .sub-menu { display: block; }
.dm-sub-toggle { display: none; }
.dm-header__actions { display: flex; align-items: center; gap: .6rem; }
.dm-theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); cursor: pointer;
}
.dm-theme-toggle:hover { border-color: var(--brand); color: var(--brand); }
.dm-theme-toggle span { display: inline-flex; }
.dm-theme-toggle .dm-icon-sun { display: none; }
html[data-theme="dark"] .dm-theme-toggle .dm-icon-sun { display: inline-flex; }
html[data-theme="dark"] .dm-theme-toggle .dm-icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .dm-theme-toggle .dm-icon-sun { display: inline-flex; }
  html:not([data-theme="light"]) .dm-theme-toggle .dm-icon-moon { display: none; }
}
.dm-nav__panel > .dm-btn { display: none; }
@media (max-width: 960px) {
  .dm-nav__panel > .dm-btn { display: inline-flex; margin-top: 1.2rem; width: 100%; }
}
.dm-burger { display: none; }

.dm-nav__close {
  display: none; align-items: center; justify-content: center; width: 40px; height: 40px;
  margin-bottom: .8rem; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer;
}
.dm-sub-toggle { display: none; background: none; border: 0; color: inherit; cursor: pointer; padding: .4rem .6rem; }
@media (max-width: 960px) { .dm-sub-toggle { display: inline-flex; } }

@media (max-width: 960px) {
  .dm-nav {
    position: fixed; inset: 0; z-index: 70; display: none;
    background: rgba(10, 35, 64, .55);
  }
  .dm-nav.is-open { display: block; }
  .dm-nav__panel {
    position: absolute; top: 0; right: 0; height: 100%; width: min(86vw, 360px);
    background: var(--surface); padding: 1.4rem; overflow-y: auto;
    box-shadow: var(--shadow-lg); transform: translateX(100%); transition: transform .25s ease;
  }
  .dm-nav.is-open .dm-nav__panel { transform: translateX(0); }
  .dm-nav ul { display: block; }
  .dm-nav a { padding: .8rem .6rem; font-size: 1.02rem; }
  .dm-nav .sub-menu { display: block; position: static; box-shadow: none; border: 0; padding-left: 1rem; background: transparent; }
  .dm-nav__close { display: inline-flex; }
  .dm-burger {
    display: inline-flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line);
    background: var(--surface); color: var(--text); cursor: pointer;
  }
}

/* =========================================================
   5. Hero
   ========================================================= */
.dm-hero {
  position: relative; overflow: hidden; color: var(--hero-ink);
  background:
    radial-gradient(1200px 420px at 85% -10%, rgba(255, 255, 255, .14), transparent 60%),
    linear-gradient(165deg, var(--blue-950) 0%, var(--blue-800) 48%, var(--blue-500) 115%);
  padding-block: clamp(4rem, 9vw, 7.5rem) clamp(5rem, 10vw, 8.5rem);
}
.dm-hero__grid { display: grid; gap: 2.4rem; align-items: center; }
@media (min-width: 920px) { .dm-hero__grid { grid-template-columns: 1.35fr .85fr; } }
.dm-hero h1 { color: #fff; margin-bottom: .45em; }
.dm-hero h1 .dm-hero__accent { color: #ffd9d6; }
.dm-hero .dm-lead { color: var(--blue-100); }
.dm-hero__cta { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.6rem; }
.dm-hero__logo {
  justify-self: center; width: min(62vw, 300px); border-radius: 24px; background: #fff;
  padding: 1.1rem 1.3rem; box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, .5);
}
.dm-waves { position: absolute; left: 0; right: 0; bottom: -2px; width: 100%; height: clamp(50px, 9vw, 110px); display: block; }
.dm-waves path { fill: var(--bg); }
.dm-waves .dm-waves__a { opacity: .45; animation: dm-drift 14s linear infinite; }
.dm-waves .dm-waves__b { opacity: .22; animation: dm-drift 21s linear infinite reverse; }
@keyframes dm-drift { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* =========================================================
   6. Cards e griglie
   ========================================================= */
.dm-grid { display: grid; gap: 1.4rem; }
.dm-grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.dm-grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); }
.dm-grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }

.dm-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.6rem 1.5rem; box-shadow: var(--shadow); position: relative;
  transition: transform .18s ease, box-shadow .18s ease;
  display: flex; flex-direction: column; gap: .55rem;
}
.dm-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.dm-card__icon {
  width: 52px; height: 52px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--blue-50); color: var(--brand); flex: none; margin-bottom: .3rem;
}
html[data-theme="dark"] .dm-card__icon { background: rgba(43, 127, 194, .16); }
.dm-card__icon svg { width: 26px; height: 26px; }
.dm-card__meta { font-size: .8rem; color: var(--muted); font-weight: 600; letter-spacing: .04em; }
.dm-card h3 { margin: 0; }
.dm-card p { color: var(--muted); margin: 0; flex: 1; }
.dm-card__foot { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-top: .4rem; }
.dm-card__link { font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; gap: .35rem; }
.dm-card--topline::before {
  content: ""; position: absolute; top: 0; left: 1.5rem; right: auto; width: 46px; height: 4px;
  border-radius: 0 0 4px 4px; background: var(--brand);
}
.dm-card--topline.is-red::before { background: var(--accent); }
.dm-card--topline.is-green::before { background: var(--green-600); }

/* Valori */
.dm-grid--values { grid-template-columns: 1fr; gap: .8rem; }
@media (min-width: 620px) { .dm-grid--values { grid-template-columns: 1fr 1fr; } }
.dm-value {
  display: flex; gap: .9rem; align-items: flex-start; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1rem 1.1rem; box-shadow: var(--shadow);
}
.dm-value svg { flex: none; color: var(--brand); margin-top: .15rem; }
.dm-value strong { display: block; font-family: var(--font-head); }

/* Cita il nome */
.dm-quote {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  border: 1px solid var(--line); padding: clamp(1.6rem, 3vw, 2.6rem); position: relative; overflow: hidden;
}
.dm-quote::before {
  content: "“"; position: absolute; top: -1.4rem; left: .8rem; font-family: var(--font-head);
  font-size: 7rem; color: var(--blue-100); line-height: 1;
}
html[data-theme="dark"] .dm-quote::before { color: rgba(125, 180, 221, .18); }
.dm-quote p { font-family: var(--font-head); font-size: clamp(1.15rem, 2.2vw, 1.5rem); font-style: italic; position: relative; }
.dm-quote cite { color: var(--muted); font-style: normal; font-size: .9rem; }

/* =========================================================
   7. Sezione trasparenza
   ========================================================= */
.dm-doc { display: flex; align-items: center; gap: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1rem 1.2rem; box-shadow: var(--shadow); }
.dm-doc svg { flex: none; color: var(--brand); }
.dm-doc__body { flex: 1; min-width: 0; }
.dm-doc__title { font-weight: 700; display: block; }
.dm-doc__meta { font-size: .84rem; color: var(--muted); }
.dm-doc__foot { flex: none; }
.dm-compliance { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); margin-top: 2rem; }
.dm-compliance li { list-style: none; display: flex; gap: .7rem; align-items: flex-start; color: var(--blue-100); font-size: .95rem; }
.dm-compliance svg { flex: none; color: #9fd3a9; margin-top: .12rem; }

/* =========================================================
   8. Moduli futuri attivabili
   ========================================================= */
.dm-mod { position: relative; }
.dm-mod.is-soon { opacity: .88; }
.dm-mod.is-on { border-color: rgba(44, 139, 69, .45); }
.dm-mod__status { margin-top: .3rem; }
.dm-mod__demo {
  margin-top: .9rem; border-top: 1px dashed var(--line); padding-top: .9rem; font-size: .92rem; color: var(--muted);
}
.dm-mod__demo .dm-btn { margin-top: .6rem; }
.dm-future-note {
  display: flex; gap: .8rem; align-items: flex-start; margin-top: 1.8rem;
  background: rgba(255, 255, 255, .1); border: 1px dashed rgba(255, 255, 255, .35);
  border-radius: var(--radius-sm); padding: 1rem 1.2rem; font-size: .92rem; color: var(--blue-100);
}
.dm-future-note svg { flex: none; color: #ffd9d6; margin-top: .1rem; }

/* =========================================================
   9. Form
   ========================================================= */
.dm-form { display: grid; gap: 1rem; }
.dm-form__row { display: grid; gap: 1rem; }
@media (min-width: 640px) { .dm-form__row { grid-template-columns: 1fr 1fr; } }
.dm-field { display: flex; flex-direction: column; gap: .35rem; }
.dm-field label { font-weight: 700; font-size: .92rem; }
.dm-field .dm-hint { font-size: .8rem; color: var(--muted); }
.dm-field input[type="text"], .dm-field input[type="email"], .dm-field input[type="tel"], .dm-field input[type="url"], .dm-field select, .dm-field textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 1.5px solid var(--line);
  border-radius: 12px; padding: .72rem .9rem; width: 100%;
}
.dm-field input:focus, .dm-field select:focus, .dm-field textarea:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px rgba(43, 127, 194, .18); }
.dm-check { display: flex; gap: .6rem; align-items: flex-start; font-size: .9rem; color: var(--muted); }
.dm-check input { margin-top: .25rem; width: 1.05rem; height: 1.05rem; accent-color: var(--brand); }
.dm-check a { color: inherit; }
.dm-antispam { position: absolute !important; left: -9999px !important; }
.dm-notice { border-radius: var(--radius-sm); padding: 1rem 1.2rem; font-size: .95rem; border: 1px solid; }
.dm-notice.is-ok { background: rgba(44, 139, 69, .1); border-color: rgba(44, 139, 69, .4); color: var(--text); }
.dm-notice.is-err { background: rgba(208, 52, 44, .08); border-color: rgba(208, 52, 44, .35); color: var(--text); }
.dm-notice strong { display: block; margin-bottom: .2rem; }

/* Tabs adesione */
.dm-tabs__list { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.6rem; padding: 0; list-style: none; }
.dm-tabs__list button {
  font: inherit; font-weight: 700; cursor: pointer; border-radius: 999px; padding: .65rem 1.3rem;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--muted);
}
.dm-tabs__list button[aria-selected="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.dm-tab { display: none; }
.dm-tab.is-active { display: block; }
.dm-tab__grid { display: grid; gap: 1.6rem; }
@media (min-width: 900px) { .dm-tab__grid { grid-template-columns: .9fr 1.1fr; align-items: start; } }
.dm-rights { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: .6rem; }
.dm-rights li { display: flex; gap: .6rem; align-items: flex-start; font-size: .94rem; color: var(--muted); }
.dm-rights svg { flex: none; color: var(--green-600); margin-top: .16rem; }

/* =========================================================
   10. Contenuti interni (index, single, archive, page)
   ========================================================= */
.dm-layout { display: grid; gap: 2.4rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1024px) { .dm-layout--sidebar { grid-template-columns: minmax(0, 1fr) 300px; } }
.dm-pagehead { background: linear-gradient(160deg, var(--blue-950), var(--blue-800)); color: var(--blue-100); padding-block: clamp(2.6rem, 6vw, 4.5rem); }
.dm-pagehead h1 { color: #fff; margin-bottom: .3em; }
.dm-breadcrumb { font-size: .84rem; margin-bottom: 1rem; color: var(--blue-300); }
.dm-breadcrumb a { color: inherit; }
.dm-breadcrumb span[aria-current] { color: #fff; }
.dm-postgrid { display: grid; gap: 1.4rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.dm-postcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform .18s ease, box-shadow .18s ease; }
.dm-postcard:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.dm-postcard__body { padding: 1.3rem 1.4rem 1.5rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.dm-postcard__thumb { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; display: block; background: var(--surface-2); }
.dm-postcard__meta { font-size: .8rem; color: var(--muted); font-weight: 600; display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.dm-postcard h3 { margin: 0; font-size: 1.18rem; }
.dm-postcard h3 a { text-decoration: none; color: var(--text); }
.dm-postcard h3 a:hover { color: var(--brand); }
.dm-postcard p { color: var(--muted); margin: 0; flex: 1; }
.dm-entry { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(1.4rem, 3vw, 2.6rem); }
.dm-entry__meta { color: var(--muted); font-size: .88rem; margin-bottom: 1.4rem; }
.dm-entry__thumb { border-radius: var(--radius-sm); margin-bottom: 1.4rem; }
.dm-entry h2, .dm-entry h3 { margin-top: 1.6em; }
.dm-entry ul, .dm-entry ol { padding-left: 1.3rem; }
.dm-entry .wp-block-button__link { text-decoration: none; }
.dm-entry-tags { margin-top: 1.6rem; display: flex; gap: .5rem; flex-wrap: wrap; }
.dm-entry-tags a { font-size: .8rem; font-weight: 700; text-decoration: none; border: 1px solid var(--line); border-radius: 999px; padding: .25rem .8rem; color: var(--muted); }
.dm-entry-tags a:hover { border-color: var(--brand); color: var(--brand); }
.dm-navlinks { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2rem; font-size: .92rem; }
.dm-pagination { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: 2.4rem; }
.dm-pagination .page-numbers { display: inline-flex; min-width: 42px; height: 42px; align-items: center; justify-content: center; border-radius: 12px; border: 1px solid var(--line); text-decoration: none; font-weight: 700; color: var(--text); background: var(--surface); }
.dm-pagination .page-numbers.current { background: var(--brand); border-color: var(--brand); color: #fff; }
.dm-widget { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.4rem; margin-bottom: 1.4rem; }
.dm-widget h2, .dm-widget h3 { font-size: 1.05rem; font-family: var(--font-body); text-transform: uppercase; letter-spacing: .08em; }
.dm-widget ul { list-style: none; margin: 0; padding: 0; }
.dm-widget li { padding: .4rem 0; border-bottom: 1px dashed var(--line); }
.dm-widget li:last-child { border-bottom: 0; }
.dm-searchform { display: flex; gap: .5rem; }
.dm-searchform input { flex: 1; font: inherit; border: 1.5px solid var(--line); border-radius: 12px; padding: .6rem .9rem; background: var(--surface); color: var(--text); min-width: 0; }
.dm-error-404 { text-align: center; padding-block: 4rem; }
.dm-error-404 > svg { color: var(--brand); margin-bottom: 1rem; }

/* Commenti */
.dm-comments { margin-top: 2.4rem; }
.dm-comments ol { list-style: none; padding: 0; }
.dm-comments .comment-body { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1rem 1.2rem; margin-bottom: 1rem; }
.dm-comments .children { padding-left: 1.6rem; }
.dm-comment-form label { display: block; font-weight: 700; font-size: .92rem; margin-bottom: .3rem; }
.dm-comment-form input, .dm-comment-form textarea { width: 100%; font: inherit; border: 1.5px solid var(--line); border-radius: 12px; padding: .65rem .9rem; background: var(--surface); color: var(--text); }

/* =========================================================
   11. CTA band e footer
   ========================================================= */
.dm-cta { border-radius: var(--radius); padding: clamp(1.8rem, 4vw, 3rem); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.4rem; color: #fff; background: linear-gradient(140deg, var(--blue-900), var(--blue-700) 60%, var(--blue-500)); box-shadow: var(--shadow-lg); }
.dm-cta h2 { margin: 0 0 .3em; color: #fff; }
.dm-cta p { margin: 0; color: var(--blue-100); }
.dm-cta__actions { display: flex; gap: .8rem; flex-wrap: wrap; }

.dm-footer { background: var(--blue-950); color: var(--blue-100); margin-top: 0; }
.dm-footer a { color: var(--blue-100); }
.dm-footer__grid { display: grid; gap: 2rem; padding-block: clamp(2.6rem, 6vw, 4rem) 1.6rem; }
@media (min-width: 900px) { .dm-footer__grid { grid-template-columns: 1.4fr 1fr 1fr 1.2fr; } }
.dm-footer h3 { color: #fff; font-family: var(--font-body); font-size: .85rem; text-transform: uppercase; letter-spacing: .12em; }
.dm-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; font-size: .94rem; }
.dm-footer__legal { border-top: 1px solid rgba(255, 255, 255, .14); padding-block: 1.3rem; font-size: .82rem; color: var(--blue-300); }
.dm-footer__legal .dm-container { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: space-between; align-items: center; }
.dm-footer__brand { display: flex; gap: .9rem; align-items: flex-start; }
.dm-footer__brand img, .dm-footer__brand svg { width: 54px; height: 54px; background: #fff; border-radius: 50%; padding: 4px; flex: none; }
.dm-social { display: flex; gap: .5rem; margin-top: .8rem; }
.dm-social a { display: inline-flex; width: 38px; height: 38px; align-items: center; justify-content: center; border-radius: 10px; background: rgba(255, 255, 255, .1); }
.dm-social a:hover { background: rgba(255, 255, 255, .22); }

/* I figli delle griglie non superano mai il traccia (evita overflow su schermi stretti) */
.dm-grid > *, .dm-layout > *, .dm-tab__grid > *, .dm-compliance > *, .dm-footer__grid > *, .dm-postgrid > * { min-width: 0; }
[id] { scroll-margin-top: calc(var(--header-h) + 14px); }
.dm-footer { overflow-wrap: break-word; }

/* =========================================================
   12. Effetti, accessibilità, varie
   ========================================================= */
.dm-reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.dm-reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .dm-reveal { opacity: 1; transform: none; transition: none; }
  .dm-waves .dm-waves__a, .dm-waves .dm-waves__b { animation: none; }
  .dm-btn, .dm-card, .dm-postcard { transition: none; }
}
.dm-totop {
  position: fixed; right: 18px; bottom: 18px; z-index: 40;
  width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--brand); color: #fff; box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: opacity .25s ease; display: inline-flex; align-items: center; justify-content: center;
}
.dm-totop.is-visible { opacity: 1; pointer-events: auto; }
.screen-reader-text { border: 0; clip-path: inset(50%); height: 1px; width: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute !important; word-wrap: normal !important; }
.alignwide { max-width: min(100% - 2.4rem, 1080px); margin-inline: auto; }
.alignfull { max-width: 100%; }
.wp-caption { max-width: 100%; }
.sticky { display: block; }
.byline, .updated:not(.published) { display: none; }
body.page .dm-entry, body.single .dm-entry { overflow-wrap: break-word; }

/* =========================================================
   13. Admin bar compat + dettagli
   ========================================================= */
body.admin-bar .dm-header { top: 32px; }
@media screen and (max-width: 782px) { body.admin-bar .dm-header { top: 46px; } }
.dm-attivita-stato { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; font-weight: 700; }
.dm-attivita-stato svg { color: var(--amber-600); }
.dm-cta__note { font-size: .85rem; color: var(--muted); margin-top: .8rem; }


/* =========================================================
   14. Smartphone (ottimizzato per display 6 pollici, 360-430px)
   ========================================================= */
@media (max-width: 480px) {
  /* Spaziature e contenitore */
  .dm-container { width: calc(100% - 2rem); }
  .dm-section { padding-block: 2.9rem; }
  .dm-grid, .dm-postgrid, .dm-tab__grid, .dm-layout { gap: 1.1rem; }
  .dm-lead { font-size: 1.02rem; }

  /* Tipografia compatta ma leggibile */
  body { font-size: 1rem; }
  h1 { font-size: 2rem; }
  h2 { font-size: 1.55rem; }
  h3 { font-size: 1.18rem; }
  .dm-quote p { font-size: 1.15rem; }
  .dm-quote::before { font-size: 5.2rem; top: -1rem; }

  /* Header: brand compatto, touch target >= 44px */
  .dm-header__inner { gap: .6rem; min-height: 62px; }
  .dm-brand { gap: .55rem; }
  .dm-brand img, .dm-brand svg { width: 40px; height: 40px; }
  .dm-brand__name { font-size: .98rem; }
  .dm-brand__tag { font-size: .62rem; }
  .dm-burger, .dm-theme-toggle, .dm-nav__close { width: 44px; height: 44px; }
  .dm-banner .dm-container { font-size: .86rem; gap: .6rem; }

  /* Menu a pannello pieno e comodo da toccare */
  .dm-nav__panel { width: min(92vw, 340px); padding: 1.2rem; }
  .dm-nav a { padding: .8rem .5rem; font-size: 1.05rem; }

  /* Hero: pulsanti a tutta larghezza, impilati */
  .dm-hero { padding-block: 3.4rem 4.4rem; }
  .dm-hero h1 { font-size: 2.05rem; }
  .dm-hero__logo { width: min(72vw, 250px); padding: .9rem 1rem; }
  .dm-hero__cta { flex-direction: column; align-items: stretch; gap: .7rem; }
  .dm-hero__cta .dm-btn { width: 100%; min-height: 48px; }

  /* Bottoni e controlli: touch target generosi */
  .dm-btn { min-height: 46px; }
  .dm-btn--sm { min-height: 38px; }
  .dm-tabs__list button { padding: .6rem 1.05rem; min-height: 44px; font-size: .92rem; }
  .dm-chips li { padding: .5rem .9rem; }
  .dm-totop { right: 12px; bottom: 12px; width: 48px; height: 48px; }

  /* Card più vicine al bordo */
  .dm-card { padding: 1.25rem 1.15rem; }
  .dm-card__icon { width: 46px; height: 46px; border-radius: 12px; }
  .dm-card__icon svg { width: 24px; height: 24px; }
  .dm-postcard__body { padding: 1.15rem 1.2rem 1.3rem; }

  /* Documenti trasparenza: riga che va a capo, pulsante a tutta larghezza */
  .dm-doc { flex-wrap: wrap; padding: .95rem 1.05rem; }
  .dm-doc__foot { width: 100%; }
  .dm-doc__foot .dm-btn { width: 100%; }

  /* Head di pagina e contenuti */
  .dm-pagehead { padding-block: 2.3rem; }
  .dm-entry { padding: 1.3rem 1.2rem; }
  .dm-widget { padding: 1.2rem; }
  .dm-navlinks { flex-direction: column; gap: .7rem; }
  .dm-navlinks span { max-width: 100%; }

  /* CTA band: colonna singola, pulsanti estesi */
  .dm-cta { flex-direction: column; align-items: stretch; }
  .dm-cta__actions { flex-direction: column; }
  .dm-cta__actions .dm-btn { width: 100%; }

  /* Footer: blocchi impilati e dati a capo */
  .dm-footer__legal .dm-container { flex-direction: column; align-items: flex-start; gap: .45rem; }
  .dm-social a { width: 44px; height: 44px; }
}
@media (max-width: 380px) {
  /* Telefono da 6 pollici in scala ridotta (es. 360px CSS) */
  h1 { font-size: 1.85rem; }
  .dm-hero h1 { font-size: 1.9rem; }
  .dm-brand__name { font-size: .92rem; }
  .dm-card { padding: 1.15rem 1.05rem; }
}
/* L'overlay del menu mobile deve coprire tutta la finestra: con backdrop-filter
   l'header diventerebbe contenitore del pannello fixed, confinando il menu
   all'interno della barra (bug visibile solo su smartphone/tablet) */
@media (max-width: 960px) {
  .dm-header { backdrop-filter: none; background: color-mix(in srgb, var(--surface) 96%, transparent); }
}
/* Con il menu aperto l'overlay (figlio dell'header, z-index 50) deve coprire
   anche il banner avvisi: su mobile il banner torna nel flusso normale */
@media (max-width: 960px) {
  .dm-banner { position: static; z-index: auto; }
}
