/* ==========================================================================
   CITTALIA — Nuovo sito (mockup)
   Layout ispirato a ancicomunicare.it | Brand color: magenta/rasberry + oro
   ========================================================================== */

:root {
  /* Palette brand Cittalia (allineata ad ANCIComunicare) */
  --magenta:       #9e0b4b;
  --magenta-dark:  #76063759;
  --magenta-deep:  #760637;
  --magenta-light: #c13a74;
  --gold:          #d6a400;
  --gold-dark:     #b88c00;
  --navy:          #002f6c;
  --ink:           #2b2b2b;
  --muted:         #6a6a6a;
  --line:          #e4e4e7;
  --bg:            #ffffff;
  --bg-soft:       #f5f5f7;
  --bg-grey:       #f4f4f4;

  --radius:   10px;
  --radius-l: 18px;
  --shadow:   0 6px 24px rgba(0,0,0,.08);
  --shadow-h: 0 12px 36px rgba(118,6,55,.18);
  --maxw:     1200px;
  --font:     'Titillium Web', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 17px;
}

img { max-width: 100%; display: block; }
a { color: var(--magenta); text-decoration: none; transition: color .2s; }
a:hover { color: var(--magenta-deep); }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: 72px 0; }
.section--soft { background: var(--bg-soft); }
.section__head { text-align: center; max-width: 720px; margin: 0 auto 44px; }
.section__kicker {
  display: inline-block;
  font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--magenta); margin-bottom: 10px;
}
.section__title { font-size: 2rem; font-weight: 700; margin: 0 0 12px; color: var(--ink); line-height: 1.2; }
.section__sub { color: var(--muted); margin: 0; font-size: 1.05rem; }

/* Decorative mosaic motif (richiama il logo) */
.mosaic { display: inline-grid; grid-template-columns: repeat(4, 8px); gap: 3px; vertical-align: middle; }
.mosaic span { width: 8px; height: 8px; background: var(--gold); border-radius: 1px; }
.mosaic span:nth-child(3n) { background: var(--magenta); }
.mosaic span:nth-child(4n) { opacity: .4; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: .98rem;
  padding: 12px 24px; border-radius: 999px; border: 2px solid transparent;
  cursor: pointer; transition: all .2s; text-decoration: none;
}
.btn--primary { background: var(--magenta); color: #fff; }
.btn--primary:hover { background: var(--magenta-deep); color: #fff; transform: translateY(-2px); }
.btn--ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.7); }
.btn--ghost:hover { background: #fff; color: var(--magenta); }
.btn--outline { background: transparent; color: var(--magenta); border-color: var(--magenta); }
.btn--outline:hover { background: var(--magenta); color: #fff; }

/* ==========================================================================
   TOP UTILITY BAR
   ========================================================================== */
.utilitybar { background: var(--navy); color: #fff; font-size: .85rem; }
.utilitybar .container { display: flex; align-items: center; justify-content: flex-end; gap: 4px; min-height: 42px; }
.util-item {
  display: inline-flex; align-items: center; gap: 6px;
  color: #fff; padding: 6px 12px; border-radius: 6px; cursor: pointer; background: none; border: 0;
  font-family: var(--font); font-size: .85rem; position: relative;
}
.util-item:hover { background: rgba(255,255,255,.12); color: #fff; }
.util-item svg { width: 17px; height: 17px; }

/* dropdown chips inside utility bar */
.util-dropdown { position: relative; }
.util-panel {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: #fff; color: var(--ink); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 10px; min-width: 210px;
  display: none; z-index: 60; border: 1px solid var(--line);
}
.util-dropdown.open .util-panel { display: block; }
.util-panel a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: var(--ink); font-weight: 600; font-size: .92rem; }
.util-panel a:hover { background: var(--bg-soft); color: var(--magenta); }
.util-panel a .dot { width: 26px; height: 26px; border-radius: 6px; background: var(--bg-soft); display: grid; place-items: center; }
.util-panel a svg { width: 16px; height: 16px; }

/* search inline */
.searchbox { display: none; align-items: center; gap: 8px; background: rgba(255,255,255,.14); border-radius: 999px; padding: 4px 4px 4px 14px; }
.searchbox.open { display: flex; }
.searchbox input { background: none; border: 0; color: #fff; outline: none; font-family: var(--font); width: 180px; }
.searchbox input::placeholder { color: rgba(255,255,255,.7); }
.searchbox button { background: var(--magenta); border: 0; color: #fff; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; }

/* ==========================================================================
   MAIN HEADER + NAV
   ========================================================================== */
.masthead { background: #fff; position: sticky; top: 0; z-index: 50; border-bottom: 1px solid var(--line); transition: box-shadow .25s; }
.masthead.scrolled { box-shadow: 0 4px 18px rgba(0,0,0,.07); }
.masthead .container { display: flex; align-items: center; justify-content: space-between; min-height: 92px; gap: 24px; }
.brand img { height: 52px; width: auto; }

.mainnav ul { list-style: none; display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; }
.mainnav > ul > li { position: relative; }
.mainnav > ul > li > a, .mainnav > ul > li > button {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 12px 14px; font-weight: 600; font-size: .98rem; color: var(--ink);
  background: none; border: 0; cursor: pointer; font-family: var(--font); border-radius: 8px;
}
.mainnav > ul > li > a:hover, .mainnav > ul > li > button:hover { color: var(--magenta); background: var(--bg-soft); }
.mainnav > ul > li > a.active { color: var(--magenta); }
.mainnav > ul > li > a.active::after { content:""; display:block; }
.caret { width: 12px; height: 12px; transition: transform .2s; }
.has-dd.open .caret { transform: rotate(180deg); }

.dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 240px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 8px; display: none; z-index: 60;
}
.has-dd.open .dropdown { display: block; }
.dropdown a { display: block; padding: 11px 14px; border-radius: 8px; color: var(--ink); font-weight: 600; font-size: .94rem; }
.dropdown a:hover { background: var(--bg-soft); color: var(--magenta); }
.dropdown small { display: block; font-weight: 400; color: var(--muted); font-size: .8rem; }

.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle svg { width: 30px; height: 30px; color: var(--magenta); }

/* ==========================================================================
   HERO
   ========================================================================== */
.hero {
  position: relative; color: #fff; overflow: hidden;
  background: linear-gradient(120deg, var(--magenta-deep) 0%, var(--magenta) 55%, #b5286b 100%);
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,.10) 0 30%, transparent 31%);
  background-size: 26px 26px; opacity: .35;
}
.hero .container { position: relative; z-index: 2; display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; padding-top: 84px; padding-bottom: 84px; }
.hero h1 { font-size: 3rem; line-height: 1.1; margin: 0 0 18px; font-weight: 700; }
.hero p { font-size: 1.2rem; max-width: 540px; margin: 0 0 30px; opacity: .95; }
.hero .actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-card {
  background: rgba(255,255,255,.12); backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.25); border-radius: var(--radius-l);
  padding: 28px; box-shadow: var(--shadow);
}
.hero-card h3 { margin: 0 0 6px; font-size: 1.2rem; }
.hero-card .stat-row { display: flex; gap: 22px; margin-top: 18px; }
.hero-card .stat b { font-size: 1.9rem; display: block; line-height: 1; color: var(--gold); }
.hero-card .stat span { font-size: .82rem; opacity: .9; }

/* ==========================================================================
   NEWS CARDS
   ========================================================================== */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-l); overflow: hidden;
  display: flex; flex-direction: column; transition: transform .25s, box-shadow .25s;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-h); }
.card__media { aspect-ratio: 16/10; position: relative; background: var(--bg-grey); }
.card__media .ph { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 1.1rem; }
.card__tag { position: absolute; top: 12px; left: 12px; background: var(--gold); color: #3a2c00; font-size: .72rem; font-weight: 700; padding: 5px 11px; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; }
.card__body { padding: 20px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.card__date { font-size: .8rem; color: var(--muted); margin-bottom: 8px; }
.card__title { font-size: 1.15rem; font-weight: 700; margin: 0 0 12px; line-height: 1.3; }
.card__title a { color: var(--ink); }
.card__title a:hover { color: var(--magenta); }
.card__more { margin-top: auto; font-weight: 700; font-size: .9rem; color: var(--magenta); display: inline-flex; align-items: center; gap: 6px; }
.center-cta { text-align: center; margin-top: 40px; }

/* ==========================================================================
   PROGETTI
   ========================================================================== */
.projects { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.project {
  text-align: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-l);
  padding: 32px 20px; transition: all .25s; text-decoration: none;
}
.project:hover { border-color: var(--magenta); box-shadow: var(--shadow-h); transform: translateY(-4px); }
.project__logo { width: 76px; height: 76px; margin: 0 auto 16px; border-radius: 18px; display: grid; place-items: center; font-weight: 800; font-size: 1.4rem; color: #fff; letter-spacing: .02em; }
.project h3 { margin: 0 0 6px; font-size: 1.1rem; color: var(--ink); }
.project p { margin: 0; font-size: .9rem; color: var(--muted); }

/* ==========================================================================
   DATI E RICERCHE (charts)
   ========================================================================== */
.data-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: stretch; }
.data-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-l); padding: 28px; box-shadow: var(--shadow); }
.data-card h3 { margin: 0 0 4px; font-size: 1.2rem; }
.data-card .hint { color: var(--muted); font-size: .9rem; margin: 0 0 18px; }
.data-keys { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.data-key { font-size: .82rem; font-weight: 600; padding: 7px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; color: var(--muted); }
.data-key.active { background: var(--magenta); border-color: var(--magenta); color: #fff; }
.donut-wrap { display: flex; align-items: center; gap: 26px; }
.legend { list-style: none; margin: 0; padding: 0; font-size: .9rem; }
.legend li { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.legend .sw { width: 14px; height: 14px; border-radius: 4px; }
.bars { display: flex; flex-direction: column; gap: 14px; margin-top: 4px; }
.bar-row { display: grid; grid-template-columns: 130px 1fr 56px; align-items: center; gap: 12px; font-size: .9rem; }
.bar-track { background: var(--bg-grey); border-radius: 999px; height: 14px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; width: 0; transition: width 1s cubic-bezier(.2,.8,.2,1); background: linear-gradient(90deg, var(--magenta), var(--magenta-light)); }
.bar-row b { text-align: right; color: var(--magenta-deep); }

/* ==========================================================================
   AGENDA / CALENDAR
   ========================================================================== */
.agenda-wrap { display: grid; grid-template-columns: 1.1fr .9fr; gap: 32px; align-items: start; }
.cal { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-l); padding: 24px; box-shadow: var(--shadow); }
.cal__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.cal__head h3 { margin: 0; font-size: 1.2rem; text-transform: capitalize; }
.cal__nav button { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: #fff; cursor: pointer; color: var(--magenta); font-size: 1rem; }
.cal__nav button:hover { background: var(--magenta); color: #fff; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-grid .dow { text-align: center; font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; padding-bottom: 6px; }
.cal-day { aspect-ratio: 1; border-radius: 10px; display: grid; place-items: center; position: relative; font-size: .92rem; color: var(--ink); border: 1px solid transparent; }
.cal-day.empty { visibility: hidden; }
.cal-day.has-event { cursor: pointer; background: var(--bg-soft); font-weight: 700; }
.cal-day.has-event::after { content: ""; position: absolute; bottom: 7px; width: 6px; height: 6px; border-radius: 50%; background: var(--magenta); }
.cal-day.has-event:hover { background: var(--magenta); color: #fff; }
.cal-day.has-event:hover::after { background: var(--gold); }
.cal-day.selected { background: var(--magenta); color: #fff; }
.cal-day.today { border-color: var(--gold); }

.agenda-list { display: flex; flex-direction: column; gap: 14px; }
.agenda-item { display: flex; gap: 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.agenda-item .when { text-align: center; min-width: 58px; }
.agenda-item .when b { display: block; font-size: 1.6rem; color: var(--magenta); line-height: 1; }
.agenda-item .when span { font-size: .72rem; text-transform: uppercase; color: var(--muted); }
.agenda-item .what h4 { margin: 0 0 4px; font-size: 1rem; }
.agenda-item .what p { margin: 0; font-size: .85rem; color: var(--muted); }
.agenda-item .what .badge { display: inline-block; font-size: .7rem; font-weight: 700; color: var(--gold-dark); background: #fbf2cf; padding: 2px 9px; border-radius: 999px; margin-top: 6px; }

/* ==========================================================================
   NEWSLETTER
   ========================================================================== */
.newsletter { background: linear-gradient(120deg, var(--navy), #013a85); color: #fff; }
.newsletter .container { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.newsletter h2 { font-size: 2rem; margin: 0 0 10px; }
.newsletter p { opacity: .9; margin: 0; }
.nl-form { display: flex; gap: 12px; flex-wrap: wrap; }
.nl-form input[type=email] { flex: 1; min-width: 220px; padding: 14px 18px; border-radius: 999px; border: 0; font-family: var(--font); font-size: 1rem; }
.nl-consent { display: flex; align-items: flex-start; gap: 9px; font-size: .82rem; opacity: .9; margin-top: 14px; }
.nl-msg { margin-top: 12px; font-weight: 700; color: var(--gold); min-height: 22px; }

/* ==========================================================================
   CONTATTI
   ========================================================================== */
.contact-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.contact-list { list-style: none; padding: 0; margin: 0; }
.contact-list li { display: flex; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.contact-list .ico { width: 44px; height: 44px; border-radius: 12px; background: var(--bg-soft); display: grid; place-items: center; color: var(--magenta); flex: none; }
.contact-list .ico svg { width: 20px; height: 20px; }
.contact-list b { display: block; }
.contact-list a, .contact-list span { color: var(--muted); }
.map-embed { border: 0; width: 100%; height: 100%; min-height: 340px; border-radius: var(--radius-l); }
.social-row { display: flex; gap: 12px; margin-top: 20px; }
.social-row a { width: 44px; height: 44px; border-radius: 12px; background: var(--bg-soft); display: grid; place-items: center; color: var(--magenta); }
.social-row a:hover { background: var(--magenta); color: #fff; transform: translateY(-3px); }
.social-row svg { width: 20px; height: 20px; }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer { background: #1a1a1f; color: #c7c7cf; padding-top: 64px; }
.footer a { color: #c7c7cf; }
.footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 40px; padding-bottom: 48px; }
.footer .brand-foot img { background: #fff; padding: 12px 16px; border-radius: 12px; height: 70px; }
.footer .brand-foot p { font-size: .9rem; margin: 18px 0 0; max-width: 280px; }
.footer h4 { color: #fff; font-size: 1rem; margin: 0 0 16px; }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer ul li { margin-bottom: 10px; font-size: .92rem; }
.foot-contact li { display: flex; gap: 10px; margin-bottom: 12px; font-size: .92rem; }
.foot-contact svg { width: 17px; height: 17px; color: var(--magenta-light); flex: none; margin-top: 3px; }
.foot-social { display: flex; gap: 10px; margin-top: 18px; }
.foot-social a { width: 38px; height: 38px; border-radius: 10px; background: rgba(255,255,255,.08); display: grid; place-items: center; }
.foot-social a:hover { background: var(--magenta); }
.foot-social svg { width: 18px; height: 18px; color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 22px 0; font-size: .84rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* ==========================================================================
   PAGE HEADER (inner pages)
   ========================================================================== */
.page-hero { background: linear-gradient(120deg, var(--magenta-deep), var(--magenta)); color: #fff; padding: 56px 0; position: relative; overflow: hidden; }
.page-hero::after { content:""; position:absolute; inset:0; background-image: radial-gradient(circle, rgba(255,255,255,.10) 0 30%, transparent 31%); background-size: 24px 24px; opacity:.3; }
.page-hero .container { position: relative; z-index: 2; }
.breadcrumb { font-size: .85rem; opacity: .85; margin-bottom: 10px; }
.breadcrumb a { color: #fff; }
.page-hero h1 { font-size: 2.4rem; margin: 0; }
.prose { max-width: 820px; }
.prose h2 { color: var(--magenta-deep); margin-top: 36px; }
.prose p { color: #3c3c3c; }
.list-clean { list-style: none; padding: 0; }
.list-clean li { padding: 14px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; align-items: center; }

/* ==========================================================================
   ACCESSIBILITY MODES
   ========================================================================== */
body.a11y-large { font-size: 19.5px; }
body.a11y-contrast { filter: contrast(1.35); }
body.a11y-gray { filter: grayscale(1); }
body.a11y-large.a11y-contrast { filter: contrast(1.35); }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 980px) {
  .hero .container, .newsletter .container, .data-wrap, .agenda-wrap, .contact-wrap { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr 1fr; }
  .projects { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: 2.3rem; }

  .nav-toggle { display: block; }
  .mainnav { position: fixed; inset: 0 0 0 auto; width: min(86vw, 360px); background: #fff; transform: translateX(100%); transition: transform .3s; box-shadow: -10px 0 40px rgba(0,0,0,.2); padding: 80px 20px 30px; overflow-y: auto; z-index: 70; }
  .mainnav.open { transform: translateX(0); }
  .mainnav ul { flex-direction: column; align-items: stretch; gap: 2px; }
  .mainnav > ul > li > a, .mainnav > ul > li > button { width: 100%; justify-content: space-between; }
  .dropdown { position: static; box-shadow: none; border: 0; border-left: 2px solid var(--magenta); border-radius: 0; margin-left: 14px; padding: 0; }
  .mobile-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 65; }
  .mobile-backdrop.show { display: block; }
}
@media (max-width: 620px) {
  .cards, .projects, .footer-grid { grid-template-columns: 1fr; }
  .section { padding: 52px 0; }
  .hero h1 { font-size: 2rem; }
  .utilitybar .util-item span.label { display: none; }
}
