/*
Theme Name: Turni Medici
Description: Piattaforma di gestione turni per medici e coordinatori. Accesso su invito.
Author: Salvatore Corsi
Version: 0.1.0
Text Domain: turnimedici
*/

:root {
    --tm-blue: #2b6fe0;
    --tm-blue-dark: #1f55b8;
    --tm-blue-50: #eaf1fd;
    --tm-blue-100: #d4e4fb;
    --tm-green: #1f9d5c;
    --tm-green-bg: #e5f5ec;
    --tm-green-dark: #157a48;
    --tm-red: #d64535;
    --tm-red-bg: #fdeae7;
    --tm-coral: #f0705f;
    --tm-coral-bg: #fdede9;
    --tm-amber: #b7791f;
    --tm-amber-bg: #fcf3e3;
    --tm-ink: #16293a;
    --tm-muted: #5b6b7b;
    --tm-line: #e6edf4;
    --tm-bg: #f6faff;
    --tm-radius: 16px;
    --tm-radius-lg: 22px;
    --tm-shadow: 0 4px 18px rgba(28, 70, 140, 0.07);
    --tm-shadow-hover: 0 14px 34px rgba(28, 70, 140, 0.13);
    --tm-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--tm-font);
    color: var(--tm-ink);
    background: var(--tm-bg);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--tm-blue); text-decoration: none; }

.tm-container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* Header */
.tm-header { background: rgba(255, 255, 255, 0.9); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--tm-line); position: sticky; top: 0; z-index: 100; }
.tm-header__inner { display: flex; align-items: center; gap: 28px; height: 80px; }
.tm-brand { display: flex; align-items: center; gap: 16px; color: var(--tm-ink); }
.tm-brand__logo { height: 42px; width: auto; }
.tm-brand__divider { width: 1px; height: 38px; background: var(--tm-line); flex: none; }
.tm-brand__sub { display: flex; flex-direction: column; line-height: 1.25; font-size: 13px; color: var(--tm-muted); }
.tm-nav { margin-left: auto; }
.tm-nav__list { display: flex; align-items: center; gap: 30px; list-style: none; }
.tm-nav__list a { position: relative; color: var(--tm-ink); font-size: 15px; font-weight: 600; padding: 8px 0; transition: color 0.15s; }
.tm-nav__list a:hover { color: var(--tm-blue); }
.tm-nav__list .current-menu-item a,
.tm-nav__list a[aria-current="page"],
.tm-nav__list a.is-active { color: var(--tm-blue); }
.tm-nav__list .current-menu-item a::after,
.tm-nav__list a[aria-current="page"]::after,
.tm-nav__list a.is-active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2.5px; border-radius: 2px; background: var(--tm-blue); }

.tm-btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border-radius: 999px; font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.15s; }
.tm-btn svg { flex: none; }
.tm-btn--ghost { border: 1px solid var(--tm-line); color: var(--tm-ink); background: #fff; }
.tm-btn--ghost:hover { border-color: var(--tm-blue); color: var(--tm-blue); }
.tm-btn--primary { background: var(--tm-blue); color: #fff; }
.tm-btn--primary:hover { background: var(--tm-blue-dark); }
.tm-btn--accent { background: var(--tm-blue-50); color: var(--tm-blue); font-weight: 700; }
.tm-btn--accent:hover { background: var(--tm-blue-100); }

.tm-nav-toggle { display: none; align-items: center; justify-content: center; width: 44px; height: 44px; margin-left: auto; padding: 0; border: 0; background: transparent; color: var(--tm-ink); cursor: pointer; }
.tm-nav-toggle__close { display: none; }
.tm-nav-toggle[aria-expanded="true"] .tm-nav-toggle__open { display: none; }
.tm-nav-toggle[aria-expanded="true"] .tm-nav-toggle__close { display: block; }

.tm-main { display: block; }

/* Hero AFT */
.tm-hero { background: linear-gradient(180deg, var(--tm-blue-50) 0%, #fff 100%); }
.tm-hero__inner { display: grid; grid-template-columns: 1.1fr 0.9fr; align-items: center; gap: 40px; padding: 56px 24px; }
.tm-eyebrow { display: inline-block; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--tm-blue); margin-bottom: 12px; }
.tm-hero h1 { font-size: clamp(28px, 4vw, 44px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.tm-hero__desc { margin-top: 16px; font-size: 17px; color: var(--tm-muted); max-width: 30em; }
.tm-hero__stats { display: flex; gap: 16px; margin-top: 28px; }
.tm-stat { background: #fff; border: 1px solid var(--tm-line); border-radius: var(--tm-radius); padding: 14px 22px; box-shadow: var(--tm-shadow); }
.tm-stat strong { display: block; font-size: 30px; font-weight: 800; color: var(--tm-blue); }
.tm-stat span { font-size: 13px; color: var(--tm-muted); }
.tm-hero__art { align-self: stretch; min-height: 220px; }

/* Sezioni */
.tm-section { padding: 48px 0 64px; }
.tm-section__title { font-size: 24px; font-weight: 800; letter-spacing: -0.01em; margin-bottom: 22px; }

/* Card strutture */
.tm-cards { display: grid; gap: 14px; }
.tm-card {
    display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 18px;
    background: #fff; border: 1px solid var(--tm-line); border-radius: var(--tm-radius);
    padding: 18px 22px; box-shadow: var(--tm-shadow); transition: box-shadow .18s, transform .18s, border-color .18s;
}
.tm-card:hover { box-shadow: var(--tm-shadow-hover); transform: translateY(-2px); border-color: var(--tm-blue-100); }
.tm-card__icon { display: flex; }
.tm-card__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tm-card__name { font-size: 17px; font-weight: 700; color: var(--tm-ink); }
.tm-card__addr { font-size: 14px; color: var(--tm-muted); }
.tm-card__hours { font-size: 13px; color: var(--tm-blue-dark); font-weight: 600; margin-top: 2px; }
.tm-card__arrow { font-size: 26px; color: var(--tm-blue); line-height: 1; }

/* Badge */
.tm-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; padding: 5px 12px; border-radius: 999px; white-space: nowrap; }
.tm-badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.tm-badge--open { color: var(--tm-green); background: var(--tm-green-bg); }
.tm-badge--closed { color: var(--tm-red); background: var(--tm-red-bg); }
.tm-badge--soon { color: var(--tm-amber); background: var(--tm-amber-bg); }
.tm-badge--muted { color: var(--tm-muted); background: #eef2f6; }
.tm-badge--muted::before { display: none; }

/* Dettaglio struttura */
.tm-detail-hero { background: linear-gradient(180deg, var(--tm-blue-50) 0%, #fff 100%); padding: 28px 0 36px; }
.tm-crumbs { font-size: 14px; color: var(--tm-muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.tm-crumbs__current { color: var(--tm-ink); font-weight: 600; }
.tm-detail-hero__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.tm-detail-hero h1 { font-size: clamp(26px, 3.4vw, 38px); font-weight: 800; letter-spacing: -0.02em; }
.tm-detail-hero__addr { margin-top: 8px; color: var(--tm-muted); font-size: 16px; }

.tm-detail { display: grid; grid-template-columns: 1.6fr 1fr; gap: 24px; padding: 36px 24px 64px; align-items: start; }
.tm-detail__main, .tm-detail__side { display: flex; flex-direction: column; gap: 24px; }

.tm-panel { background: #fff; border: 1px solid var(--tm-line); border-radius: var(--tm-radius); padding: 22px; box-shadow: var(--tm-shadow); }
.tm-panel__title { font-size: 17px; font-weight: 800; margin-bottom: 14px; }
.tm-prose p { margin-bottom: 12px; color: var(--tm-muted); }

.tm-map { height: 380px; border-radius: 10px; overflow: hidden; border: 1px solid var(--tm-line); }

/* Copertura */
.tm-coverage__month { font-size: 14px; font-weight: 600; color: var(--tm-blue-dark); margin-bottom: 12px; }
.tm-coverage__bar { height: 12px; border-radius: 999px; background: var(--tm-blue-50); overflow: hidden; }
.tm-coverage__bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--tm-green), #38b06a); }
.tm-coverage__nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; text-align: center; }
.tm-coverage__nums strong { display: block; font-size: 26px; font-weight: 800; color: var(--tm-ink); }
.tm-coverage__nums span { font-size: 12px; color: var(--tm-muted); }

.tm-hours { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.tm-hours li { font-size: 16px; font-weight: 700; color: var(--tm-blue-dark); background: var(--tm-blue-50); border-radius: 8px; padding: 8px 12px; }

.tm-empty { color: var(--tm-muted); font-size: 15px; }

/* Footer */
.tm-footer { background: var(--tm-blue-50); border-top: 1px solid var(--tm-line); margin-top: 40px; }
.tm-footer__inner { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; padding: 36px 24px; }
.tm-footer__col { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--tm-muted); }
.tm-footer__col strong { color: var(--tm-ink); font-size: 15px; }
.tm-footer__bar { border-top: 1px solid var(--tm-line); padding: 14px 0; font-size: 13px; color: var(--tm-muted); }

.tm-access {
    padding: 80px 0;
}

.tm-access h1 {
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 8px 0 14px;
}

.tm-access p {
    font-size: 17px;
    color: var(--tm-muted);
    max-width: 42em;
}

/* Responsive */
@media (max-width: 980px) {
    .tm-hero__inner { grid-template-columns: 1fr; }
    .tm-hero__art { display: none; }
    .tm-detail { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
    .tm-header { background: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; }
    .tm-header__inner { gap: 14px; height: 68px; }
    .tm-brand { position: relative; z-index: 110; }
    .tm-brand__divider, .tm-brand__sub { display: none; }
    .tm-brand__logo { height: 36px; }
    .tm-nav-toggle { display: inline-flex; position: relative; z-index: 110; }
    .tm-nav {
        position: fixed;
        left: 0;
        right: 0;
        top: -100vh;
        height: 100vh;
        height: 100dvh;
        margin-left: 0;
        background: #fff;
        z-index: 95;
        display: flex;
        align-items: stretch;
        justify-content: flex-start;
        overflow-y: auto;
        transition: top 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .tm-nav.is-open { top: 0; }
    .tm-nav__list {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
        width: 100%;
        padding: 104px 28px 48px;
    }
    .tm-nav__list a {
        display: block;
        width: 100%;
        text-align: left;
        padding: 12px 0;
        font-size: clamp(36px, 12vw, 60px);
        font-weight: 800;
        line-height: 1.05;
        letter-spacing: -0.03em;
    }
    .tm-nav__list .current-menu-item a,
    .tm-nav__list a[aria-current="page"],
    .tm-nav__list a.is-active { color: var(--tm-blue); }
    .tm-nav__list .current-menu-item a::after,
    .tm-nav__list a[aria-current="page"]::after,
    .tm-nav__list a.is-active::after { display: none; }
}

body.tm-nav-open { overflow: hidden; }
@media (max-width: 720px) {
    .tm-card { grid-template-columns: auto 1fr auto; }
    .tm-card__status { grid-column: 2 / -1; }
    .tm-footer__inner { grid-template-columns: 1fr; }
}

/* === AIR: blocchi, glossario, articoli (fonte: sass/blocks/_index.scss) === */
.tm-article-hero__lead {
  margin-top: 14px;
  font-size: 19px;
  line-height: 1.5;
  color: var(--tm-muted);
  max-width: 44em;
}

.tm-article {
  max-width: 820px;
  margin: 0 auto;
  font-size: 17px;
  line-height: 1.7;
  color: var(--tm-ink);
}
.tm-article > * + * {
  margin-top: 1.1em;
}
.tm-article p {
  color: var(--tm-ink);
}
.tm-article h2 {
  margin-top: 2em;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.tm-article h3 {
  margin-top: 1.6em;
  font-size: 20px;
  font-weight: 700;
}
.tm-article h2 + p, .tm-article h3 + p {
  margin-top: 0.6em;
}
.tm-article ul, .tm-article ol {
  padding-left: 1.3em;
}
.tm-article li + li {
  margin-top: 0.4em;
}
.tm-article li {
  color: var(--tm-ink);
}
.tm-article a {
  color: var(--tm-blue-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.tm-article strong {
  color: var(--tm-ink);
  font-weight: 700;
}
.tm-article blockquote {
  margin: 1.4em 0;
  padding: 4px 0 4px 20px;
  border-left: 3px solid var(--tm-blue);
  color: var(--tm-muted);
  font-style: italic;
}
.tm-article .wp-block-table,
.tm-article table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15.5px;
  margin: 0;
}
.tm-article .wp-block-table {
  overflow-x: auto;
}
.tm-article th, .tm-article td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--tm-line);
  vertical-align: top;
}
.tm-article thead th {
  background: var(--tm-blue-50);
  color: var(--tm-ink);
  font-weight: 700;
  border-bottom: 2px solid var(--tm-blue-100);
}
.tm-article tbody tr:last-child td {
  border-bottom: none;
}

.tm-callout {
  border: 1px solid var(--tm-line);
  border-left-width: 4px;
  border-radius: var(--tm-radius);
  padding: 16px 18px;
  background: #fff;
}
.tm-callout__title {
  font-weight: 700;
  font-size: 16px;
  color: var(--tm-ink);
  margin: 0 0 4px;
}
.tm-callout__text {
  color: var(--tm-ink);
  font-size: 16px;
  line-height: 1.6;
}
.tm-callout__text > * + * {
  margin-top: 0.6em;
}
.tm-callout__text p {
  margin: 0;
}
.tm-callout__text ul, .tm-callout__text ol {
  padding-left: 1.2em;
  margin: 0.4em 0;
}
.tm-callout--info {
  border-left-color: var(--tm-blue);
  background: var(--tm-blue-50);
}
.tm-callout--ok {
  border-left-color: var(--tm-green);
  background: var(--tm-green-bg);
}
.tm-callout--warn {
  border-left-color: var(--tm-amber);
  background: var(--tm-amber-bg);
}
.tm-callout--key {
  border-left-color: var(--tm-ink);
  background: #f4f7fa;
}
.tm-callout--info .tm-callout__title {
  color: var(--tm-blue-dark);
}
.tm-callout--ok .tm-callout__title {
  color: var(--tm-green);
}
.tm-callout--warn .tm-callout__title {
  color: var(--tm-amber);
}

.tm-keystats__intro {
  font-size: 14px;
  color: var(--tm-muted);
  margin: 0 0 10px;
}

.tm-keystats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
}

.tm-keystat {
  background: #fff;
  border: 1px solid var(--tm-line);
  border-radius: var(--tm-radius);
  padding: 18px 16px;
  box-shadow: var(--tm-shadow);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tm-keystat__value {
  font-size: 26px;
  font-weight: 800;
  color: var(--tm-blue-dark);
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.tm-keystat__label {
  font-size: 14px;
  font-weight: 600;
  color: var(--tm-ink);
}
.tm-keystat__note {
  font-size: 13px;
  color: var(--tm-muted);
}

.tm-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.tm-compare__col {
  background: #fff;
  border: 1px solid var(--tm-line);
  border-radius: var(--tm-radius);
  padding: 18px;
}
.tm-compare__title {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 700;
  color: var(--tm-blue-dark);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--tm-line);
}
.tm-compare__body {
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--tm-ink);
}
.tm-compare__body > * + * {
  margin-top: 0.5em;
}
.tm-compare__body p {
  margin: 0;
}
.tm-compare__body ul, .tm-compare__body ol {
  padding-left: 1.2em;
  margin: 0;
}
.tm-compare__body li + li {
  margin-top: 0.3em;
}

.tm-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 2px solid var(--tm-blue-100);
}
.tm-timeline__item {
  position: relative;
  padding: 0 0 22px 22px;
}
.tm-timeline__item::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--tm-blue);
  border: 2px solid #fff;
}
.tm-timeline__item:last-child {
  padding-bottom: 0;
}
.tm-timeline__date {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  color: var(--tm-blue-dark);
  background: var(--tm-blue-50);
  padding: 2px 8px;
  border-radius: 6px;
  margin-bottom: 4px;
}
.tm-timeline__title {
  display: block;
  font-weight: 700;
  color: var(--tm-ink);
  font-size: 16px;
}
.tm-timeline__text {
  font-size: 15px;
  color: var(--tm-muted);
  margin-top: 2px;
}
.tm-timeline__text p {
  margin: 0;
}

.tm-termcard {
  border: 1px solid var(--tm-line);
  border-radius: var(--tm-radius);
  background: #fff;
  padding: 16px 18px;
  box-shadow: var(--tm-shadow);
}
.tm-termcard__head {
  display: block;
}
.tm-termcard__term {
  font-size: 17px;
  font-weight: 800;
  color: var(--tm-blue-dark);
  text-decoration: none;
}
.tm-termcard__full {
  display: block;
  font-size: 14px;
  color: var(--tm-muted);
  margin-top: 1px;
}
.tm-termcard__def {
  margin: 8px 0 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--tm-ink);
}
.tm-termcard:hover .tm-termcard__term {
  text-decoration: underline;
}

.tm-glossary-search {
  margin-top: 20px;
  max-width: 460px;
}
.tm-glossary-search input {
  width: 100%;
  font-size: 16px;
  padding: 12px 16px;
  border: 1px solid var(--tm-line);
  border-radius: var(--tm-radius);
  background: #fff;
  color: var(--tm-ink);
}
.tm-glossary-search input:focus {
  outline: 2px solid var(--tm-blue);
  outline-offset: 1px;
  border-color: var(--tm-blue);
}

.tm-glossary-group + .tm-glossary-group {
  margin-top: 40px;
}
.tm-glossary-group__title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--tm-blue);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--tm-line);
}

.tm-glossary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}

.tm-glossary-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: #fff;
  border: 1px solid var(--tm-line);
  border-radius: var(--tm-radius);
  padding: 16px 18px;
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.tm-glossary-card__term {
  font-size: 18px;
  font-weight: 800;
  color: var(--tm-ink);
}
.tm-glossary-card__full {
  font-size: 13.5px;
  color: var(--tm-blue-dark);
  font-weight: 600;
}
.tm-glossary-card__def {
  font-size: 14px;
  color: var(--tm-muted);
  margin-top: 4px;
  line-height: 1.5;
}
.tm-glossary-card:hover {
  border-color: var(--tm-blue);
  box-shadow: var(--tm-shadow);
}
.tm-glossary-card[hidden] {
  display: none;
}

.tm-term__full {
  font-size: 19px;
  color: var(--tm-muted);
  margin-top: 6px;
}

.tm-term__aka {
  font-size: 14px;
  color: var(--tm-muted);
  margin-top: 6px;
  font-style: italic;
}

.tm-term__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 40px;
  align-items: start;
}
.tm-term__layout .tm-article {
  margin: 0;
  max-width: none;
}

.tm-term__related {
  background: var(--tm-blue-50);
  border: 1px solid var(--tm-blue-100);
  border-radius: var(--tm-radius);
  padding: 20px;
}
.tm-term__related-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--tm-ink);
  margin: 0 0 12px;
}
.tm-term__related-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tm-term__related-list a {
  text-decoration: none;
  display: block;
}
.tm-term__related-list strong {
  display: block;
  color: var(--tm-blue-dark);
  font-size: 15px;
}
.tm-term__related-list span {
  display: block;
  font-size: 13px;
  color: var(--tm-muted);
}
.tm-term__related-list a:hover strong {
  text-decoration: underline;
}

@media (max-width: 860px) {
  .tm-compare {
    grid-template-columns: 1fr;
  }
  .tm-term__layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

/* Pagine statiche (page.php) */
.tm-page { padding-top: 48px; padding-bottom: 72px; }
.tm-page__title { max-width: 820px; margin: 0 auto 28px; font-size: clamp(30px, 4.5vw, 40px); font-weight: 800; letter-spacing: -0.02em; color: var(--tm-ink); }
.tm-page .tm-article a { color: var(--tm-blue); }
.tm-page .tm-contact { margin: 0; }
.tm-brand__sub { font-weight: 700; font-size: 16px; color: var(--tm-ink); }
