/*
Theme Name: Team Migliorati
Theme URI: https://teammigliorati.com/
Author: Team Migliorati
Description: Tema immobiliare su misura, leggero e responsive, ispirato alla comunicazione RE/MAX.
Version: 1.4.0
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 8.1
Text Domain: team-migliorati
*/

:root {
  --tm-blue: #003da5;
  --tm-blue-dark: #032b6f;
  --tm-red: #dc1c2e;
  --tm-ink: #162033;
  --tm-muted: #64748b;
  --tm-line: #dbe3ee;
  --tm-soft: #f4f7fb;
  --tm-white: #fff;
  --tm-radius: 18px;
  --tm-shadow: 0 18px 46px rgba(7, 32, 74, .12);
  --tm-container: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--tm-ink);
  background: var(--tm-white);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
}
img { max-width: 100%; height: auto; }
a { color: var(--tm-blue); text-decoration: none; }
a:hover { color: var(--tm-red); }
h1, h2, h3, h4 { margin: 0 0 .55em; line-height: 1.12; letter-spacing: -.025em; }
h1 { font-size: clamp(2.4rem, 5vw, 4.8rem); }
h2 { font-size: clamp(2rem, 3.4vw, 3.25rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.55rem); }
p { margin: 0 0 1.15em; }

.tm-container { width: min(calc(100% - 40px), var(--tm-container)); margin-inline: auto; }
.tm-section { padding: clamp(64px, 8vw, 112px) 0; }
.tm-section--soft { background: var(--tm-soft); }
.tm-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  color: var(--tm-red);
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: .78rem;
}
.tm-eyebrow::before { content: ""; width: 30px; height: 3px; background: currentColor; }
.tm-lead { max-width: 760px; color: var(--tm-muted); font-size: 1.16rem; }
.tm-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 13px 24px;
  border: 2px solid transparent;
  border-radius: 999px;
  background: var(--tm-red);
  color: #fff;
  font-weight: 800;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.tm-button:hover { color: #fff; background: #bd1022; transform: translateY(-2px); box-shadow: 0 10px 24px rgba(220, 28, 46, .24); }
.tm-button--outline { border-color: rgba(255,255,255,.8); background: transparent; }
.tm-button--outline:hover { background: #fff; color: var(--tm-blue); }

.tm-topbar { background: var(--tm-blue-dark); color: #fff; font-size: .83rem; }
.tm-topbar__inner { display: flex; justify-content: flex-end; gap: 24px; padding: 8px 0; }
.tm-topbar a { color: #fff; }
.tm-header { position: sticky; top: 0; z-index: 40; background: rgba(255,255,255,.97); border-bottom: 1px solid var(--tm-line); backdrop-filter: blur(12px); }
.admin-bar .tm-header { top: 32px; }
.tm-header__inner { width: min(calc(100% - 40px), 1540px); min-height: 104px; display: flex; align-items: center; justify-content: space-between; gap: clamp(14px, 1.5vw, 26px); }
.tm-header__identity { display: flex; align-items: center; gap: 15px; min-width: 0; }
.tm-brand { display: flex; align-items: center; flex: 0 0 auto; width: auto !important; min-height: 0 !important; gap: 13px; color: var(--tm-blue); background: none !important; background-image: none !important; border-radius: 0 !important; font-weight: 900; letter-spacing: -.02em; }
.tm-brand .custom-logo { display: block; width: auto; height: 88px; max-width: 180px; object-fit: contain; object-position: left center; }
.tm-brand__mark { width: 10px; height: 38px; border-radius: 2px; background: linear-gradient(var(--tm-red) 0 48%, #fff 48% 53%, var(--tm-blue) 53%); }
.tm-brand__text { display: grid; line-height: 1.05; }
.tm-brand__text small { color: var(--tm-red); font-size: .65rem; letter-spacing: .12em; text-transform: uppercase; }
.tm-header-badges { display: flex; flex: 0 0 auto; align-items: center; gap: 9px; padding-left: 14px; border-left: 1px solid var(--tm-line); }
.tm-header-badges__italia { display: block; width: 45px; height: 45px; object-fit: contain; border-radius: 10px; }
.tm-header-badges__collection { display: grid; place-items: center; width: 104px; height: 45px; overflow: hidden; padding: 5px 8px; border-radius: 10px; background: var(--tm-blue-dark); }
.tm-header-badges__collection img { display: block; width: 100%; height: 100%; object-fit: contain; }
.tm-nav { flex: 0 0 auto; }
.tm-nav ul { display: flex; flex-wrap: nowrap; align-items: center; gap: clamp(12px, 1.35vw, 22px); margin: 0; padding: 0; list-style: none; }
.tm-nav a { display: block; color: var(--tm-ink); font-size: .9rem; font-weight: 750; line-height: 1.25; white-space: nowrap; }
.tm-nav .current-menu-item > a, .tm-nav a:hover { color: var(--tm-red); }
.tm-language-flags { display: flex; flex: 0 0 auto; align-items: center; gap: 7px; margin-left: auto; }
.tm-language-flags a { display: grid; place-items: center; width: 30px; height: 24px; border: 1px solid transparent; border-radius: 6px; opacity: .72; transition: opacity .2s ease, border-color .2s ease, transform .2s ease; }
.tm-language-flags a:hover, .tm-language-flags a:focus-visible { opacity: 1; border-color: var(--tm-line); transform: translateY(-1px); }
.tm-language-flags a[aria-current="page"] { opacity: 1; border-color: var(--tm-blue); background: var(--tm-soft); }
.tm-language-flags img { display: block; width: 24px; height: 16px; object-fit: cover; }
.tm-menu-toggle { display: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--tm-soft); color: var(--tm-blue); font-size: 1.3rem; }

.tm-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 650px;
  display: grid;
  align-items: center;
  color: #fff;
  background: linear-gradient(118deg, rgba(3,43,111,.98), rgba(0,61,165,.93) 58%, rgba(220,28,46,.85));
}
.tm-hero::before, .tm-hero::after { content: ""; position: absolute; z-index: -1; border-radius: 50%; }
.tm-hero::before { width: 620px; height: 620px; right: -180px; top: -240px; border: 100px solid rgba(255,255,255,.07); }
.tm-hero::after { width: 430px; height: 430px; right: 18%; bottom: -320px; border: 75px solid rgba(255,255,255,.05); }
.tm-hero__inner { padding: 96px 0 124px; }
.tm-hero__copy { max-width: 900px; }
.tm-hero h1 { max-width: 930px; }
.tm-hero p { max-width: 690px; color: rgba(255,255,255,.86); font-size: clamp(1.08rem, 1.8vw, 1.3rem); }
.tm-hero__actions { display: flex; flex-wrap: wrap; gap: 13px; margin-top: 30px; }
.tm-hero__search { position: relative; z-index: 2; margin-top: -66px; }

.tm-luxury-hero { background: var(--tm-blue-dark); }
.tm-luxury-hero::before {
  inset: 0;
  width: auto;
  height: auto;
  border: 0;
  border-radius: 0;
  background: linear-gradient(90deg, rgba(3, 28, 72, .70) 0%, rgba(3, 43, 111, .48) 43%, rgba(3, 43, 111, .12) 72%, rgba(220, 28, 46, .08) 100%);
}
.tm-luxury-hero::after {
  right: -140px;
  bottom: -230px;
  width: 430px;
  height: 430px;
  border: 74px solid rgba(220, 28, 46, .18);
}
.tm-luxury-hero__slides,
.tm-luxury-slide { position: absolute; inset: 0; }
.tm-luxury-hero__slides { z-index: -2; overflow: hidden; }
.tm-luxury-slide {
  opacity: 0;
  transform: none;
  filter: none;
  image-rendering: auto;
  transition: opacity .45s ease-in-out;
  will-change: opacity;
}
.tm-luxury-slide.is-active { opacity: 1; transform: none; }
.tm-luxury-slide__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: none;
  transform: none;
  image-rendering: auto;
}
.tm-luxury-property[hidden] { display: none !important; }
.tm-luxury-hero__inner { position: relative; }
.tm-luxury-hero__copy { position: relative; z-index: 2; max-width: 680px; text-shadow: 0 2px 22px rgba(0,0,0,.22); }
.tm-luxury-hero__properties {
  position: absolute;
  right: 0;
  bottom: 70px;
  z-index: 3;
  width: min(360px, 36vw);
}
.tm-luxury-property {
  display: grid;
  gap: 4px;
  padding: 22px 24px;
  border: 1px solid rgba(255,255,255,.34);
  border-radius: 18px;
  color: #fff;
  background: rgba(3, 28, 72, .78);
  box-shadow: 0 18px 50px rgba(0,0,0,.25);
  backdrop-filter: blur(12px);
}
.tm-luxury-property:hover { color: #fff; background: rgba(3, 43, 111, .9); }
.tm-luxury-property > span { color: #fff; font-size: .72rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.tm-luxury-property > strong { font-size: 1.12rem; line-height: 1.25; }
.tm-luxury-property > small { color: rgba(255,255,255,.78); }
.tm-luxury-property > b { margin-top: 5px; color: #fff; font-size: 1.15rem; }
.tm-luxury-property > em { margin-top: 4px; color: #fff; font-size: .8rem; font-style: normal; font-weight: 800; }
.tm-luxury-controls {
  position: absolute;
  right: 0;
  bottom: 18px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tm-luxury-control,
.tm-luxury-pause,
.tm-luxury-dots button {
  border: 1px solid rgba(255,255,255,.5);
  color: #fff;
  background: rgba(3,28,72,.66);
  cursor: pointer;
}
.tm-luxury-control { width: 36px; height: 36px; border-radius: 50%; font-size: 1.35rem; line-height: 1; }
.tm-luxury-pause { min-height: 34px; padding: 0 11px; border-radius: 999px; font-size: .7rem; font-weight: 800; }
.tm-luxury-dots { display: flex; gap: 6px; }
.tm-luxury-dots button { width: 10px; height: 10px; padding: 0; border-radius: 50%; }
.tm-luxury-dots button[aria-pressed="true"] { border-color: #fff; background: #fff; transform: scale(1.18); }
.tm-luxury-control:focus-visible,
.tm-luxury-pause:focus-visible,
.tm-luxury-dots button:focus-visible,
.tm-luxury-property:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

.tm-value-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 42px; }
.tm-value-card { padding: 30px; border: 1px solid var(--tm-line); border-radius: var(--tm-radius); background: #fff; box-shadow: 0 10px 30px rgba(7,32,74,.06); }
.tm-value-card__number { display: block; margin-bottom: 14px; color: var(--tm-red); font-weight: 900; font-size: .85rem; }
.tm-value-card p { color: var(--tm-muted); margin: 0; }

.tm-split { display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: clamp(36px, 7vw, 88px); }
.tm-photo-frame { position: relative; }
.tm-photo-frame::before { content: ""; position: absolute; inset: 18px -18px -18px 18px; z-index: -1; border-radius: 24px; background: var(--tm-red); }
.tm-photo-frame img { display: block; width: 100%; border-radius: 24px; box-shadow: var(--tm-shadow); }
.tm-checks { display: grid; gap: 13px; margin: 26px 0 32px; padding: 0; list-style: none; }
.tm-checks li { position: relative; padding-left: 30px; }
.tm-checks li::before { content: "✓"; position: absolute; left: 0; color: var(--tm-red); font-weight: 900; }

.tm-specializations { border-top: 1px solid var(--tm-line); background: linear-gradient(180deg, #fff, var(--tm-soft)); }
.tm-specializations__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin-top: 38px; }
.tm-specialization-card { display: flex; flex-direction: column; padding: 24px; border: 1px solid var(--tm-line); border-radius: var(--tm-radius); background: #fff; box-shadow: 0 12px 34px rgba(7,32,74,.07); }
.tm-specialization-card__logo { display: grid; place-items: center; height: 150px; margin-bottom: 22px; overflow: hidden; border-radius: 14px; background: #f8fafc; }
.tm-specialization-card__logo img { width: 128px; height: 128px; object-fit: contain; }
.tm-specialization-card__logo--dark { padding: 20px; background: var(--tm-blue-dark); }
.tm-specialization-card__logo--dark img { width: 100%; height: 100%; }
.tm-specialization-card__logo--npl { padding: 24px 12px; background: #1a2d50; }
.tm-specialization-card__logo--npl img { width: 100%; height: auto; }
.tm-specialization-card h3 { font-size: 1.2rem; }
.tm-specialization-card p { margin: 0; color: var(--tm-muted); font-size: .94rem; }
.tm-hall-of-fame { display: grid; grid-template-columns: minmax(280px, .9fr) minmax(0, 1.1fr); align-items: center; gap: clamp(28px, 5vw, 64px); margin-top: 28px; padding: clamp(24px, 4vw, 44px); border-radius: 24px; color: #fff; background: linear-gradient(120deg, var(--tm-blue-dark), #0b4fb8); box-shadow: var(--tm-shadow); }
.tm-hall-of-fame__image { overflow: hidden; border: 1px solid rgba(255,255,255,.3); border-radius: 18px; background: #fff; }
.tm-hall-of-fame__image img { display: block; width: 100%; aspect-ratio: 1.35; object-fit: cover; object-position: center 37%; }
.tm-hall-of-fame h3 { font-size: clamp(1.8rem, 3vw, 2.8rem); }
.tm-hall-of-fame p { margin: 0; color: rgba(255,255,255,.84); }

.tm-cta { color: #fff; background: linear-gradient(120deg, var(--tm-blue-dark), var(--tm-blue)); }
.tm-cta__inner { display: flex; align-items: center; justify-content: space-between; gap: 40px; }
.tm-cta h2 { max-width: 740px; }

.tm-page-hero { padding: 82px 0 58px; color: #fff; background: linear-gradient(120deg, var(--tm-blue-dark), var(--tm-blue)); }
.tm-content { padding: 64px 0 96px; }
.tm-content > * { max-width: 900px; }
.tm-content .alignwide { max-width: var(--tm-container); }

.tm-footer { padding: 64px 0 22px; color: rgba(255,255,255,.82); background: #071b3b; }
.tm-footer h3 { color: #fff; }
.tm-footer a { color: #fff; }
.tm-footer__grid { display: grid; grid-template-columns: 1.2fr .8fr .9fr; gap: 50px; }
.tm-footer__bottom { margin-top: 44px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.14); color: rgba(255,255,255,.58); font-size: .82rem; }

.tm-assistant { position: fixed; right: 22px; bottom: 22px; z-index: 80; font-size: 15px; }
.tm-assistant__launcher { display: inline-flex; align-items: center; gap: 9px; min-height: 52px; padding: 0 18px; border: 0; border-radius: 999px; color: #fff; background: var(--tm-blue); box-shadow: 0 14px 34px rgba(3,43,111,.3); font: inherit; font-weight: 800; cursor: pointer; }
.tm-assistant__launcher span:first-child { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--tm-red); }
.tm-assistant__panel { position: absolute; right: 0; bottom: 64px; width: min(390px, calc(100vw - 28px)); overflow: hidden; border: 1px solid var(--tm-line); border-radius: 22px; background: #fff; box-shadow: 0 24px 70px rgba(7,32,74,.25); }
.tm-assistant__header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 20px; color: #fff; background: linear-gradient(120deg, var(--tm-blue-dark), var(--tm-blue)); }
.tm-assistant__header div { display: grid; }
.tm-assistant__header small { color: rgba(255,255,255,.76); font-size: .72rem; }
.tm-assistant__close { width: 36px; height: 36px; border: 0; border-radius: 50%; color: #fff; background: rgba(255,255,255,.13); font-size: 1.4rem; cursor: pointer; }
.tm-assistant__messages { display: flex; flex-direction: column; gap: 10px; min-height: 210px; max-height: 310px; overflow-y: auto; padding: 18px; background: #f6f8fc; }
.tm-assistant__message { max-width: 88%; padding: 11px 13px; border-radius: 15px; line-height: 1.45; }
.tm-assistant__message--bot { align-self: flex-start; border: 1px solid var(--tm-line); border-bottom-left-radius: 4px; background: #fff; }
.tm-assistant__message--user { align-self: flex-end; border-bottom-right-radius: 4px; color: #fff; background: var(--tm-blue); }
.tm-assistant__message a { display: inline-block; margin-top: 7px; color: var(--tm-red); font-weight: 800; }
.tm-assistant__quick { display: flex; gap: 6px; overflow-x: auto; padding: 10px 14px 4px; background: #fff; }
.tm-assistant__quick button { flex: 0 0 auto; padding: 7px 10px; border: 1px solid #b9c7dd; border-radius: 999px; color: var(--tm-blue); background: #fff; font: inherit; font-size: .75rem; font-weight: 750; cursor: pointer; }
.tm-assistant__form { display: grid; grid-template-columns: 1fr auto auto; gap: 6px; padding: 12px 14px; }
.tm-assistant__form input { min-width: 0; height: 44px; padding: 0 12px; border: 1px solid #cbd5e1; border-radius: 10px; font: inherit; }
.tm-assistant__mic, .tm-assistant__send { min-width: 44px; height: 44px; border: 0; border-radius: 10px; color: #fff; background: var(--tm-blue); font: inherit; font-weight: 800; cursor: pointer; }
.tm-assistant__mic.is-listening { background: var(--tm-red); animation: tm-listening 1s ease-in-out infinite alternate; }
.tm-assistant__note { margin: 0; padding: 0 14px 13px; color: var(--tm-muted); font-size: .68rem; line-height: 1.35; }
@keyframes tm-listening { to { transform: scale(1.08); box-shadow: 0 0 0 7px rgba(220,28,46,.12); } }

@media (max-width: 1199px) {
  .tm-topbar { display: none; }
  .admin-bar .tm-header { top: 46px; }
  .tm-menu-toggle { display: inline-grid; place-items: center; }
  .tm-language-flags { margin-left: auto; }
  .tm-nav { display: none; position: absolute; left: 20px; right: 20px; top: 72px; padding: 20px; border-radius: 16px; background: #fff; box-shadow: var(--tm-shadow); }
  .tm-nav.is-open { display: block; }
  .tm-nav ul { align-items: stretch; flex-direction: column; gap: 10px; }
  .tm-nav a { display: block; padding: 8px; white-space: normal; }
  .tm-header-badges__collection { display: none; }
  .tm-value-grid, .tm-split, .tm-footer__grid, .tm-hall-of-fame { grid-template-columns: 1fr; }
  .tm-specializations__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tm-split { gap: 46px; }
  .tm-cta__inner { align-items: flex-start; flex-direction: column; }
  .tm-luxury-hero__copy { max-width: 650px; }
  .tm-luxury-hero__properties { position: relative; right: auto; bottom: auto; width: min(100%, 430px); margin-top: 34px; }
  .tm-luxury-controls { position: relative; right: auto; bottom: auto; justify-content: flex-start; margin-top: 14px; }
}

@media (max-width: 560px) {
  .tm-container { width: min(calc(100% - 28px), var(--tm-container)); }
	.tm-header__inner { width: min(calc(100% - 28px), 1540px); min-height: 76px; gap: 6px; }
	.tm-brand .custom-logo { height: 62px; max-width: 124px; }
	.tm-header__identity { gap: 0; }
	.tm-header-badges { display: none; }
	.tm-language-flags { gap: 2px; }
	.tm-language-flags a { width: 22px; height: 20px; border-radius: 4px; }
	.tm-language-flags img { width: 20px; height: 13px; }
	.tm-menu-toggle { width: 40px; height: 40px; }
  .tm-brand__text { font-size: .9rem; }
  .tm-hero { min-height: 590px; }
  .tm-hero__inner { padding: 74px 0 106px; }
  .tm-hero__actions .tm-button { width: 100%; }
  .tm-luxury-hero { min-height: 720px; }
  .tm-luxury-hero::before { background: linear-gradient(180deg, rgba(3,28,72,.68), rgba(3,43,111,.42) 62%, rgba(3,28,72,.62)); }
  .tm-luxury-property { padding: 18px; }
  .tm-luxury-pause { min-height: 36px; }
  .tm-photo-frame::before { inset: 10px -8px -10px 8px; }
  .tm-specializations__grid { grid-template-columns: 1fr; }
  .tm-assistant { right: 14px; bottom: 14px; }
  .tm-assistant__launcher span:last-child { display: none; }
  .tm-assistant__launcher { width: 54px; padding: 0; justify-content: center; }
  .tm-assistant__panel { position: fixed; left: 14px; right: 14px; bottom: 78px; width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
