/*
Theme Name: Ordini
Theme URI: https://lucasmarazzo.com/
Author: Lucas Marazzo
Author URI: https://lucasmarazzo.com/
Description: Tema istituzionale accessibile per gli Ordini professionali: intestazione, menu e piè di pagina nativi (un solo banner, un solo contenuto principale, un solo piè di pagina), configurabili da Personalizza › Tema Ordini. Pensato per i plugin degli Ordini (shortcode mc_*); compatibile con Elementor per i contenuti delle pagine.
Version: 1.2.4
Requires at least: 6.4
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: ordini
*/

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
body {
  margin: 0;
  font-family: var(--mc-font-family, "Titillium Web", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif);
  font-size: 1.125rem;
  line-height: 1.55;
  color: var(--ot-text);
  background: #fff;
}
img, svg, video { max-width: 100%; height: auto; }
a { color: var(--ot-primary); text-underline-offset: 3px; }
h1, h2, h3, h4, h5, h6 { line-height: 1.2; margin: 0 0 .6em; }
p { margin: 0 0 1em; }
button { font: inherit; }
:focus-visible { outline: 3px solid var(--ot-text); outline-offset: 2px; }
.ot-topbar :focus-visible { outline-color: var(--ot-bar-fg); }
.ot-navbar :focus-visible { outline-color: var(--ot-nav-fg); }
.ot-footer :focus-visible { outline-color: var(--ot-foot-fg); }

.screen-reader-text {
  position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important;
  overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important;
}
.ot-skip-link {
  position: fixed; left: 12px; top: 12px; z-index: 2147483647; padding: 12px 16px; border-radius: 4px;
  background: var(--ot-dark); color: #fff !important; font-weight: 700; text-decoration: none; transform: translateY(-180%);
}
.ot-skip-link:focus { transform: none; }

.ot-wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .ot-wrap { padding: 0 24px; } }
.ot-icon { width: 1.25em; height: 1.25em; flex: none; }

/* ---------- Barra in alto ---------- */
.ot-topbar { background: var(--ot-bar-bg); color: var(--ot-bar-fg); }
.ot-topbar__inner { display: flex; align-items: center; min-height: 48px; gap: 12px; }
.ot-topbar__link { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; color: var(--ot-bar-fg); font-weight: 600; font-size: 1rem; text-decoration: none; padding: 8px 0; }
.ot-topbar__link:hover { text-decoration: underline; }
.ot-menu-toggle, .ot-menu-close {
  display: none; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 4px; background: transparent; color: inherit; cursor: pointer;
}
.ot-menu-toggle .ot-icon, .ot-menu-close .ot-icon { width: 26px; height: 26px; }

/* ---------- Logo e nome ---------- */
.ot-brand { background: var(--ot-head-bg); color: var(--ot-head-fg); }
.ot-brand__inner { display: flex; align-items: center; gap: 24px; min-height: 112px; padding-top: 16px; padding-bottom: 16px; }
.ot-brand__link { display: flex; align-items: center; gap: 18px; color: var(--ot-name); text-decoration: none; min-width: 0; }
.ot-brand__link:hover .ot-brand__name { text-decoration: underline; }
.ot-logo { width: auto; height: var(--ot-logo-h, 80px); display: block; }
.ot-brand__name { font-size: 1.85rem; font-weight: 700; line-height: 1.15; color: var(--ot-name); max-width: 22em; }
.ot-brand__tools { margin-left: auto; display: flex; align-items: center; gap: 28px; }
.ot-search {
  display: inline-flex; align-items: center; gap: 10px; padding: 8px 4px; border: 0; background: transparent;
  color: var(--ot-head-fg); font-size: 1.15rem; font-weight: 600; text-decoration: none; cursor: pointer;
}
.ot-search .ot-icon { width: 30px; height: 30px; padding: 6px; border-radius: 50%; background: var(--ot-primary); color: #fff; box-sizing: content-box; }
.ot-search:hover span { text-decoration: underline; }
.ot-social { display: flex; align-items: center; gap: 10px; }
.ot-social__label { font-size: 1rem; font-weight: 600; }
.ot-social__list { display: flex; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ot-social__list a { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; color: var(--ot-head-link); }
.ot-social__list a:hover { background: color-mix(in srgb, var(--ot-primary) 10%, transparent); }

/* ---------- Menu ---------- */
.ot-navbar { position: relative; z-index: 20; background: var(--ot-nav-bg); color: var(--ot-nav-fg); }
body.ot-menu-in-fascia:not(.ot-ombra-menu) .ot-navbar { border-bottom: 1px solid color-mix(in srgb, var(--ot-nav-fg) 15%, transparent); }
body.ot-ombra-menu .ot-navbar { box-shadow: 0 6px 14px -4px rgba(0, 0, 0, .35); }
.ot-navbar__inner { display: flex; align-items: stretch; gap: 16px; }
.ot-navbar__head, .ot-navbar__extra { display: none; }
.ot-nav--secondary { margin-left: auto; }
.ot-menu { display: flex; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; }
.ot-menu > li { position: relative; display: flex; align-items: center; }
.ot-menu a { color: inherit; text-decoration: none; }
.ot-menu > li > a { display: block; padding: 16px 18px; font-size: 1.15rem; font-weight: 600; }
.ot-nav--secondary .ot-menu > li > a { font-size: 1.05rem; font-weight: 700; }
.ot-menu > li > a:hover, .ot-menu > li > a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.ot-menu > li.menu-item-has-children > a { padding-right: 4px; }
.ot-submenu-toggle {
  display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 44px; margin-right: 8px;
  padding: 0; border: 0; background: transparent; color: inherit; cursor: pointer; border-radius: 4px;
}
.ot-submenu-toggle svg { transition: transform .15s; }
.ot-submenu-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.ot-menu .sub-menu {
  display: none; position: absolute; top: 100%; left: 0; z-index: 50; min-width: 260px; margin: 0; padding: 8px 0; list-style: none;
  background: #fff; color: var(--ot-text); border-radius: 0 0 6px 6px; box-shadow: 0 10px 28px rgba(0, 0, 0, .18);
}
.ot-menu .sub-menu a { display: block; padding: 10px 20px; font-size: 1.05rem; color: var(--ot-text); }
.ot-menu .sub-menu a:hover, .ot-menu .sub-menu a[aria-current="page"] { background: color-mix(in srgb, var(--ot-primary) 8%, #fff); color: var(--ot-primary); text-decoration: underline; }
.ot-menu .sub-menu :focus-visible { outline-color: var(--ot-text); outline-offset: -3px; }
.ot-submenu-toggle[aria-expanded="true"] + .sub-menu { display: block; }
@media (min-width: 992px) and (hover: hover) {
  .ot-menu > li:hover > .sub-menu { display: block; }
}

/* ---------- Mobile: pannello laterale ---------- */
@media (max-width: 991.98px) {
  .ot-menu-toggle { display: inline-flex; margin-left: -10px; }
  .ot-brand__inner { min-height: 0; gap: 12px; }
  .ot-logo { height: 56px; }
  .ot-brand__name { font-size: 1.2rem; }
  .ot-brand__tools { gap: 8px; }
  .ot-search span:first-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .ot-social--header { display: none; }
  .ot-navbar {
    position: fixed; inset: 0 auto 0 0; z-index: 1000; width: min(86vw, 380px); overflow-y: auto;
    background: #fff; color: var(--ot-text); transform: translateX(-100%); visibility: hidden;
    transition: transform .2s ease, visibility 0s linear .2s; box-shadow: 4px 0 24px rgba(0, 0, 0, .25);
  }
  .ot-nav-open .ot-navbar { transform: none; visibility: visible; transition: transform .2s ease; }
  .ot-navbar :focus-visible { outline-color: var(--ot-text); }
  .ot-navbar__inner { flex-direction: column; gap: 8px; padding: 0 0 24px; }
  .ot-navbar__head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid #dde1e5; }
  .ot-navbar__title { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 1rem; line-height: 1.2; }
  .ot-logo--small { height: 40px; }
  .ot-menu-close { display: inline-flex; margin-left: auto; }
  .ot-nav--secondary { margin-left: 0; border-top: 1px solid #dde1e5; }
  .ot-menu { flex-direction: column; }
  .ot-menu > li { flex-wrap: wrap; }
  .ot-menu > li > a { flex: 1; padding: 14px 16px; font-size: 1.1rem; }
  .ot-menu > li > a[aria-current="page"] { color: var(--ot-primary); }
  .ot-submenu-toggle { width: 48px; margin: 0; }
  .ot-menu .sub-menu { position: static; width: 100%; min-width: 0; padding: 0 0 8px 16px; box-shadow: none; border-radius: 0; }
  html:not(.ot-js) .ot-menu .sub-menu { display: block; }
  .ot-navbar__extra { display: block; padding: 8px 16px; }
  .ot-overlay { position: fixed; inset: 0; z-index: 999; background: rgba(0, 0, 0, .45); }
  body.ot-nav-open { overflow: hidden; }
}
.ot-overlay[hidden] { display: none; }

/* ---------- Contenuto ---------- */
.ot-main:focus { outline: none; }
.ot-home-content > p:empty, .ot-home-content > br { display: none; margin: 0; }
.ot-home-content { margin: 0; padding-top: 0; }
.ot-content { padding-top: 32px; padding-bottom: 56px; }
.ot-title { font-size: clamp(1.8rem, 1.4rem + 1.6vw, 2.5rem); font-weight: 700; }
.ot-entry > * + * { margin-top: 1em; }
.ot-cover { display: block; margin: 0 0 24px; border-radius: 6px; }
.ot-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.ot-list__item { padding: 20px 24px; border: 1px solid #dde1e5; border-radius: 6px; }
.ot-list__title { font-size: 1.3rem; margin-bottom: .3em; }
.ot-list__meta { margin-bottom: .4em; font-size: .95rem; color: color-mix(in srgb, var(--ot-text) 75%, #fff); }
.ot-button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 20px; border: 0; border-radius: 4px;
  background: var(--ot-primary); color: #fff; font-weight: 600; text-decoration: none; cursor: pointer;
}
.ot-button:hover { background: var(--ot-dark); color: #fff; }
.ot-searchform { margin: 16px 0 32px; max-width: 640px; }
.ot-searchform label { display: block; font-weight: 600; margin-bottom: 6px; }
.ot-searchform__row { display: flex; gap: 8px; }
.ot-searchform input[type="search"] { flex: 1; min-height: 44px; padding: 8px 12px; border: 1px solid #5c6f82; border-radius: 4px; font: inherit; }
.ot-404 { text-align: center; }
.ot-404 .ot-searchform { margin-left: auto; margin-right: auto; text-align: left; }
.ot-404__code { font-size: 5rem; font-weight: 700; line-height: 1; margin: 0; color: var(--ot-primary); }

/* ---------- Piè di pagina ---------- */
.ot-footer { background: var(--ot-foot-bg); color: var(--ot-foot-fg); padding: 40px 0 24px; font-size: 1rem; }
.ot-footer a { color: var(--ot-foot-fg); }
.ot-footer__brand { display: flex; align-items: center; gap: 14px; padding-bottom: 24px; margin-bottom: 28px; border-bottom: 1px solid color-mix(in srgb, var(--ot-foot-fg) 35%, transparent); }
.ot-logo--footer { height: 64px; padding: 6px; border-radius: 8px; background: #fff; }
body.ot-logo-footer-libero .ot-logo--footer { height: 70px; padding: 0; border-radius: 0; background: none; }
.ot-footer__name { font-size: 1.5rem; font-weight: 600; line-height: 1.2; color: var(--ot-foot-title); }
.ot-footer__cols { display: grid; gap: 28px 32px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.ot-footer__title { color: var(--ot-foot-title); font-size: 1rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 14px; }
.ot-footer__list { list-style: none; margin: 0; padding: 0; }
.ot-footer__list li { margin-bottom: 8px; }
.ot-footer .ot-social__list a { color: var(--ot-foot-fg); border: 1px solid color-mix(in srgb, var(--ot-foot-fg) 60%, transparent); }
.ot-footer .ot-social__list a:hover { background: color-mix(in srgb, var(--ot-foot-fg) 15%, transparent); }
.ot-footer .ot-social { flex-wrap: wrap; }
.ot-footer__note { margin: 28px 0 0; }
.ot-footer__legal { margin-top: 28px; padding-top: 20px; border-top: 1px solid color-mix(in srgb, var(--ot-foot-fg) 35%, transparent); }
.ot-legal { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0; padding: 0; list-style: none; }
.ot-footer__copy { margin: 16px 0 0; font-size: .95rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print {
  .ot-topbar, .ot-navbar, .ot-brand__tools, .ot-footer__legal { display: none !important; }
  .ot-footer { background: none; color: #000; }
}

/* ---------- Colori dei link protetti ----------
   Il kit di Elementor (se attivo) imposta il colore di tutti i link
   (".elementor-kit-N a"): qui il tema riafferma i propri colori nelle sue
   zone, così non compaiono link blu su sfondo blu. */
body.ordini-tema .ot-topbar a,
body.ordini-tema .ot-topbar button { color: var(--ot-bar-fg); }
body.ordini-tema .ot-brand__link { color: var(--ot-name); }
body.ordini-tema .ot-brand .ot-search,
body.ordini-tema .ot-brand .ot-social__label { color: var(--ot-head-fg); }
body.ordini-tema .ot-brand .ot-social__list a { color: var(--ot-head-link); }
body.ordini-tema .ot-navbar .ot-menu a,
body.ordini-tema .ot-navbar .ot-submenu-toggle { color: var(--ot-nav-fg); }
body.ordini-tema .ot-navbar .ot-menu .sub-menu a { color: var(--ot-text); }
body.ordini-tema .ot-navbar .ot-menu .sub-menu a:hover,
body.ordini-tema .ot-navbar .ot-menu .sub-menu a[aria-current="page"] { color: var(--ot-primary); }
body.ordini-tema .ot-footer,
body.ordini-tema .ot-footer a,
body.ordini-tema .ot-footer .ot-social__list a { color: var(--ot-foot-fg); }
body.ordini-tema .ot-footer .ot-footer__title,
body.ordini-tema .ot-footer .ot-footer__name { color: var(--ot-foot-title); }
body.ordini-tema .ot-button,
body.ordini-tema .ot-button:hover { color: #fff; }
@media (max-width: 991.98px) {
  body.ordini-tema .ot-navbar .ot-menu a,
  body.ordini-tema .ot-navbar .ot-submenu-toggle,
  body.ordini-tema .ot-navbar .ot-menu-close { color: var(--ot-text); }
  body.ordini-tema .ot-navbar .ot-menu > li > a[aria-current="page"] { color: var(--ot-primary); }
  body.ordini-tema .ot-navbar .ot-social__list a { color: var(--ot-primary); }
}

/* ---------- Link: sottolineati solo al passaggio del mouse o con la tastiera ----------
   Eccezione: i link dentro un paragrafo di testo restano sottolineati,
   perché lì il solo colore non basta a riconoscerli (WCAG 1.4.1, richiesto da AGID). */
body.ordini-tema a { text-decoration: none; }
body.ordini-tema a:hover,
body.ordini-tema a:focus-visible { text-decoration: underline; text-decoration-thickness: 2px; }
body.ordini-tema main p a:not([class]),
body.ordini-tema main .ot-entry li a:not([class]) { text-decoration: underline; text-decoration-thickness: 1px; }
body.ordini-tema main p a:not([class]):hover { text-decoration-thickness: 2px; }
.ot-logo--svg { aspect-ratio: auto; }

/* Elenchi di documenti a card del plugin (Modulistica, Normativa, O.C.C., Amministrazione trasparente):
   spazio dopo ogni gruppo, così il titolo del gruppo successivo non resta attaccato alle card. */
body .odcec-document-cards { margin-bottom: 2.75rem !important; }
body .odcec-document-cards + :is(h2, h3, h4),
body section:has(> .odcec-document-cards) + section > :is(h2, h3, h4):first-child { margin-top: 0; }
body :is(h2, h3, h4) + .odcec-document-cards { margin-top: .75rem !important; }

/* ---------- Avviso in evidenza (barra e finestra) ---------- */
.ot-avviso { --av-bg: #e8f1fb; --av-bd: #1d60a1; --av-fg: #0b2c4d; color: var(--av-fg); }
.ot-avviso--importante { --av-bg: #fff4d6; --av-bd: #a66b00; --av-fg: #3d2a00; }
.ot-avviso--urgente { --av-bg: #fde8e8; --av-bd: #b3261e; --av-fg: #5c0f0b; }
.ot-avviso--barra { background: var(--av-bg); border-bottom: 4px solid var(--av-bd); }
.ot-avviso__inner { display: flex; gap: 14px; align-items: flex-start; padding-top: 16px; padding-bottom: 16px; }
.ot-avviso__icona { flex: none; color: var(--av-bd); margin-top: 2px; }
.ot-avviso__body { min-width: 0; }
.ot-avviso__titolo { margin: 0 0 4px; font-size: 1.15rem; font-weight: 700; }
.ot-avviso__testo p { margin: 0 0 6px; }
.ot-avviso__testo > :last-child { margin-bottom: 0; }
.ot-avviso__azione { margin: 6px 0 0; }
body.ordini-tema .ot-avviso a { color: var(--av-fg); text-decoration: underline; font-weight: 600; }
.ot-avviso--popup {
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; border: 0; border-top: 6px solid var(--av-bd);
  border-radius: 8px; background: #fff; box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}
.ot-avviso--popup::backdrop { background: rgba(0, 0, 0, .5); }
.ot-avviso--popup .ot-avviso__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 0 24px; }
.ot-avviso--popup .ot-avviso__body { padding: 8px 24px 0; }
.ot-avviso--popup .ot-avviso__titolo { font-size: 1.4rem; }
.ot-avviso__chiudi { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--ot-text); cursor: pointer; }
.ot-avviso__chiudi:hover { background: #eef0f2; }
.ot-avviso__footer { display: flex; justify-content: flex-end; margin: 0; padding: 16px 24px 24px; }
.ot-avviso--popup:focus-visible, .ot-avviso :focus-visible { outline: 3px solid var(--av-fg); outline-offset: 2px; }
@media print { .ot-avviso--popup { display: none !important; } }

/* ---------- Contatti con icone ---------- */
.ot-contatti__voce { display: flex; align-items: flex-start; gap: 12px; }
.ot-contatti__voce .ot-icon { width: 22px; height: 22px; margin-top: 2px; flex: none; opacity: .9; }
.ot-contatti__vuota { width: 22px; flex: none; }
.ot-contatti__testo { min-width: 0; overflow-wrap: anywhere; }
