/*
Theme Name: Guidi Medica
Theme URI: https://www.magentacomunicazione.it
Author: Magenta
Author URI: https://www.magentacomunicazione.it
Description: Tema custom per Guidi Medica
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
Text Domain: guidi-medica
*/

:root {
  --gm-primary: #0191c6;
  --gm-foreground: #0d1b33;
  --gm-muted: #5a6a7a;
  --gm-background: #f6fbfc;
  --gm-surface: #ffffff;
  --gm-border: #dce7ee;
  --gm-secondary-tint: #edf4fa;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", Arial, sans-serif;
  color: var(--gm-foreground);
  background: var(--gm-background);
}

h1,
h2 {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 500;
  letter-spacing: -0.01em;
}

a {
  color: inherit;
  text-decoration: none;
}

.gm-container {
  width: min(1200px, calc(100% - 2rem));
  margin-inline: auto;
}

.gm-topbar {
  background: var(--gm-primary);
  color: #fff;
  font-size: 13px;
}

.gm-topbar .gm-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0;
}

.gm-topbar-contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.gm-topbar-contacts a,
.gm-topbar-contacts span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.gm-icon {
  width: 16px;
  height: 16px;
  display: inline-block;
  flex: 0 0 16px;
}

.gm-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.gm-navbar {
  position: sticky;
  top: 0;
  z-index: 99;
  background: var(--gm-surface);
  border-bottom: 1px solid var(--gm-border);
}

.gm-navbar .gm-container {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.gm-brand img {
  max-height: 54px;
  width: auto;
  display: block;
}

.gm-brand {
  max-width: 220px;
  display: flex;
  align-items: center;
}

.gm-brand .custom-logo-link,
.gm-footer-brand .custom-logo-link {
  display: inline-block;
  line-height: 0;
  max-width: 100%;
}

.gm-brand .custom-logo {
  max-height: 48px !important;
  max-width: 100% !important;
  width: auto !important;
  height: auto !important;
}

.gm-menu-wrap {
  margin-left: auto;
}

.gm-menu {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
}

.gm-menu a {
  color: var(--gm-foreground);
  font-size: 14px;
  font-weight: 500;
}

.gm-menu .current-menu-item > a,
.gm-menu a:hover {
  color: var(--gm-primary);
}

.gm-main {
  min-height: 40vh;
}

.container-custom {
  width: min(1280px, calc(100% - 2rem));
  margin-inline: auto;
}

.gm-section {
  padding: 72px 0;
}

.gm-section--surface {
  background: var(--gm-surface);
  border-top: 1px solid var(--gm-border);
  border-bottom: 1px solid var(--gm-border);
}

.gm-eyebrow {
  margin: 0 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gm-primary);
  font-size: 13px;
  font-weight: 700;
}

.gm-title {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 3vw, 3rem);
  font-family: "Playfair Display", Georgia, serif;
}

.gm-subtitle {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  color: var(--gm-muted);
}

.gm-content {
  color: var(--gm-muted);
  line-height: 1.7;
}

.gm-content p:first-child {
  margin-top: 0;
}

.gm-hero {
  display: grid;
  gap: 2rem;
  align-items: center;
}

.gm-hero img {
  width: 100%;
  height: auto;
  border-radius: 18px;
  display: block;
}

.gm-footer {
  background: #0d1b33;
  color: rgba(255, 255, 255, 0.9);
  margin-top: 0;
}

.gm-footer-main {
  padding: 64px 0;
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.gm-footer p,
.gm-footer li,
.gm-footer a {
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
}

.gm-footer h3 {
  margin-top: 0;
  color: #fff;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.gm-footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding: 1rem 0;
  font-size: 13px;
}

.gm-home-badge {
  display: inline-block;
  border: 1px solid color-mix(in srgb, var(--gm-primary) 35%, white);
  color: var(--gm-primary);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.gm-title--sm {
  font-size: clamp(1.7rem, 2.3vw, 2.4rem);
}

.gm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  padding: 0.8rem 1.2rem;
  background: var(--gm-primary);
  color: #fff;
  font-weight: 600;
  border: 1px solid var(--gm-primary);
}

.gm-btn--ghost {
  background: transparent;
  color: var(--gm-foreground);
  border-color: var(--gm-border);
}

.gm-btn--light {
  background: #fff;
  color: var(--gm-primary);
  border-color: #fff;
}

.gm-home-hero {
  padding: 3.5rem 0 4rem;
  overflow: hidden;
  background: var(--gm-background);
}

.gm-home-hero-grid {
  display: grid;
  gap: 2rem;
  align-items: center;
}

.gm-home-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin: 1.2rem 0 1.5rem;
}

.gm-home-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  border-top: 1px solid var(--gm-border);
  padding-top: 1rem;
}

.gm-home-stats strong {
  display: block;
  font-size: 1.4rem;
}

.gm-home-stats span {
  font-size: 0.85rem;
  color: var(--gm-muted);
}

.gm-home-hero-image {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 18px;
  overflow: hidden;
}

.gm-home-hero-image img {
  width: 100%;
  height: 100%;
  border-radius: 18px;
  object-fit: cover;
  object-position: center;
  display: block;
}

.gm-cover-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.gm-home-float-card {
  position: absolute;
  left: 1rem;
  bottom: -1rem;
  background: #fff;
  border-radius: 12px;
  padding: 0.8rem 1rem;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.12);
}

.gm-home-float-card h4 {
  margin: 0;
  font-size: 0.95rem;
}

.gm-home-float-card p {
  margin: 0.2rem 0 0;
  color: var(--gm-muted);
  font-size: 0.82rem;
}

.gm-grid-2,
.gm-grid-3,
.gm-grid-4 {
  display: grid;
  gap: 1rem;
}

.gm-grid-2 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

.gm-grid-3 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

.gm-grid-4 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

.gm-card {
  border: 1px solid var(--gm-border);
  border-radius: 14px;
  padding: 1rem;
  background: #fff;
}

.gm-card h3 {
  margin-top: 0;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-family: "Inter", Arial, sans-serif;
  font-weight: 600;
}

.gm-card p {
  margin-bottom: 0;
  color: var(--gm-muted);
  line-height: 1.55;
}

.gm-service-card.is-featured {
  border-color: color-mix(in srgb, var(--gm-primary) 45%, white);
  background: color-mix(in srgb, var(--gm-primary) 8%, white);
}

.gm-chip {
  display: inline-block;
  margin-bottom: 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  background: var(--gm-primary);
  color: #fff;
  padding: 0.25rem 0.55rem;
}

.gm-link {
  display: inline-block;
  margin-top: 0.7rem;
  font-weight: 600;
  color: var(--gm-primary);
}

.gm-inline-icon {
  width: 18px;
  height: 18px;
  color: var(--gm-primary);
  flex: 0 0 18px;
}

.gm-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.gm-tags span {
  border: 1px solid var(--gm-border);
  background: #fff;
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  font-size: 0.84rem;
}

@media (max-width: 767px) {
  .gm-home-tech-mobile > :first-child {
    order: 2;
  }

  .gm-home-tech-mobile > :last-child {
    order: 1;
  }

  .gm-home-insurance-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .gm-home-insurance-item {
    min-height: 64px;
  }

  .gm-home-insurance-grid > .gm-home-insurance-item:last-child:nth-child(odd) {
    grid-column: span 2;
  }
}

.gm-home-tech {
  background: #0d1b33;
  color: #fff;
}

.gm-home-tech .gm-eyebrow,
.gm-home-tech .gm-title,
.gm-home-tech .gm-subtitle,
.gm-home-tech .gm-list span {
  color: rgba(255, 255, 255, 0.8);
}

.gm-home-tech .gm-title {
  color: #fff;
}

.gm-home-tech .gm-list li {
  border-left-color: rgba(1, 145, 198, 0.9);
}

.gm-home-tech-grid {
  display: grid;
  gap: 1.2rem;
}

.gm-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.8rem;
}

.gm-list li {
  display: flex;
  flex-direction: column;
  border-left: 2px solid var(--gm-primary);
  padding-left: 0.8rem;
}

.gm-home-why {
  display: grid;
  gap: 1rem;
}

.gm-list-item h3 {
  margin: 0 0 0.3rem;
  font-size: 1rem;
}

.gm-list-item p {
  margin: 0;
  color: var(--gm-muted);
  font-size: 0.9rem;
}

.gm-home-team {
  display: grid;
  gap: 1.4rem;
}

.gm-home-team-sec {
  background: var(--gm-secondary-tint);
}

.gm-home-team-images {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.gm-home-team-images img {
  width: 100%;
  border-radius: 12px;
}

.gm-home-cta {
  background: var(--gm-primary);
  color: #fff;
}

.gm-home-cta-wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
}

.gm-home-cta p {
  color: rgba(255, 255, 255, 0.85);
  max-width: 700px;
}

.gm-home-cta .gm-title {
  color: #fff;
}

.gm-topbar-badge {
  font-size: 12px;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
}

.gm-menu-toggle {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  border: 0;
  background: transparent;
  padding: 0.2rem;
}

.gm-menu-toggle span {
  width: 23px;
  height: 2px;
  background: var(--gm-foreground);
}

.gm-header-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.7rem;
  border-radius: 9px;
  background: var(--gm-primary);
  color: #fff;
  font-size: 14px;
  padding: 0.65rem 0.95rem;
  font-weight: 600;
  color: #fff !important;
}

.gm-btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--gm-border);
  color: var(--gm-foreground);
  padding: 0.65rem 1rem;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.gm-btn-light {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #fff;
  color: var(--gm-primary);
  padding: 0.7rem 1rem;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.gm-header-cta:hover {
  opacity: 0.9;
}

.gm-btn-outline:hover {
  border-color: color-mix(in srgb, var(--gm-primary) 35%, white);
  color: var(--gm-primary);
}

.gm-btn-light:hover {
  opacity: 0.92;
}

.gm-btn-white-content,
.gm-btn-white-content:hover,
.gm-btn-white-content:focus,
.gm-btn-white-content:visited {
  color: #fff !important;
}

.gm-form-field:focus,
.gm-form-field:focus-visible {
  border-color: #0191c6 !important;
  box-shadow: 0 0 0 3px rgba(1, 145, 198, 0.3);
}

.gm-logo-wrap .custom-logo {
  max-height: 50px !important;
  width: auto !important;
  height: auto !important;
}

.gm-logo-wrap {
  display: inline-flex;
  align-items: center;
  max-width: 190px;
  flex: 0 0 auto;
}

.gm-logo-wrap .custom-logo-link {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  line-height: 0;
}

.gm-logo-wrap .custom-logo {
  max-height: 42px !important;
  max-width: 100% !important;
  object-fit: contain;
}

.gm-desktop-menu {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  gap: 2rem;
}

.gm-desktop-menu li a {
  font-size: 14px;
  font-weight: 500;
  color: var(--gm-foreground);
  transition: color 0.2s ease;
}

.gm-desktop-menu li a:hover {
  color: var(--gm-primary);
}

.gm-desktop-menu li.current-menu-item > a,
.gm-desktop-menu li.current_page_item > a,
.gm-desktop-menu li.current-menu-ancestor > a,
.gm-desktop-menu li.current-page-ancestor > a {
  color: var(--gm-primary);
  font-weight: 600;
}

.gm-mobile-toggle {
  border: 0;
  background: transparent;
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
}

.gm-mobile-toggle span {
  width: 22px;
  height: 2px;
  background: var(--gm-foreground);
}

.gm-mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13, 27, 51, 0.45);
  z-index: 120;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.gm-mobile-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.gm-mobile-drawer {
  position: fixed;
  right: -420px;
  top: 0;
  bottom: 0;
  width: min(420px, 100vw);
  background: #fff;
  z-index: 130;
  padding: 2rem;
  transition: right 0.25s ease;
  overflow-y: auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.gm-mobile-drawer.is-open {
  right: 0;
}

.gm-mobile-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.gm-mobile-logo {
  max-width: 170px;
}

.gm-mobile-logo .custom-logo-link {
  display: inline-flex;
  align-items: center;
  line-height: 0;
}

.gm-mobile-logo .custom-logo {
  max-height: 40px !important;
  width: auto !important;
  height: auto !important;
}

.gm-mobile-close {
  border: 0;
  background: transparent;
  font-size: 2rem;
  line-height: 1;
  position: absolute;
  top: 1rem;
  right: 1rem;
  margin-left: 0;
  display: block;
}

.gm-mobile-menu {
  list-style: none;
  margin: 1rem 0;
  padding: 0;
  display: grid;
  gap: 0.8rem;
  justify-items: center;
}

.gm-mobile-menu a {
  font-size: 1.15rem;
}

.gm-mobile-drawer .gm-header-cta {
  display: inline-flex;
  width: auto;
  justify-content: center;
  margin-top: 0.8rem;
}

.gm-mobile-menu li.current-menu-item > a,
.gm-mobile-menu li.current_page_item > a,
.gm-mobile-menu li.current-menu-ancestor > a,
.gm-mobile-menu li.current-page-ancestor > a {
  color: var(--gm-primary);
  font-weight: 600;
}

.gm-mobile-contact-list {
  margin-top: 1rem;
  border-top: 1px solid var(--gm-border);
  padding-top: 1rem;
  display: grid;
  gap: 0.4rem;
  justify-items: center;
}

.gm-mobile-contact-list a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.gm-menu-wrap {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 100vw);
  background: #fff;
  border-left: 1px solid var(--gm-border);
  padding: 1.2rem;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
  z-index: 120;
  overflow-y: auto;
}

.gm-menu-wrap.is-open {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.gm-menu {
  flex-direction: column;
  gap: 0.8rem;
}

.gm-menu a {
  font-size: 1.2rem;
  font-weight: 500;
}

.gm-menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(13, 27, 51, 0.45);
  z-index: 110;
}

.gm-menu-overlay.is-open {
  display: block;
}

.gm-menu-close {
  align-self: flex-end;
  border: 0;
  background: transparent;
  color: var(--gm-foreground);
  font-size: 2rem;
  line-height: 1;
}

.gm-mobile-contacts {
  border-top: 1px solid var(--gm-border);
  padding-top: 1rem;
  display: grid;
  gap: 0.5rem;
  color: var(--gm-muted);
  font-size: 0.95rem;
}

.gm-mobile-contacts a,
.gm-mobile-contacts span {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.gm-footer-brand img {
  max-height: 50px;
}

.gm-footer-brand .custom-logo {
  max-height: 44px !important;
  width: auto !important;
  height: auto !important;
}

.gm-footer-chip {
  display: inline-block;
  margin-top: 0.6rem;
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  background: rgba(255, 255, 255, 0.15);
  font-size: 12px;
}

.gm-footer-links {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.5rem;
}

.gm-footer-bottom-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.gm-footer-bottom-links {
  display: flex;
  gap: 0.8rem;
}

.gm-footer-menu-2 {
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (max-width: 767px) {
  .gm-home-stats {
    max-width: 360px;
    margin: 0 auto;
    gap: 0.45rem;
    padding-top: 0.8rem;
    text-align: center;
    justify-items: center;
  }

  .gm-home-stats > div {
    padding: 0.25rem 0.2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .gm-home-stats strong {
    font-size: 1.2rem;
    line-height: 1.1;
  }

  .gm-home-stats span {
    font-size: 0.78rem;
    line-height: 1.2;
  }
}

@media (min-width: 768px) {
  .gm-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gm-grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gm-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 992px) {
  .gm-home-hero-grid {
    grid-template-columns: 1.1fr 0.9fr;
  }

  .gm-home-tech-grid,
  .gm-home-why,
  .gm-home-team {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem;
  }

  .gm-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .gm-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .gm-menu-toggle {
    display: none;
  }

  .gm-mobile-toggle,
  .gm-mobile-overlay,
  .gm-mobile-drawer {
    display: none !important;
  }

  .gm-logo-wrap {
    max-width: 180px;
  }

  .gm-logo-wrap .custom-logo {
    max-height: 40px !important;
  }

  .gm-menu-wrap {
    position: static;
    display: flex !important;
    align-items: center;
    margin-left: auto;
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
    gap: 1rem;
  }

  .gm-menu {
    flex-direction: row;
  }

  .gm-menu a {
    font-size: 14px;
  }

  .gm-menu-close,
  .gm-mobile-contacts,
  .gm-menu-overlay {
    display: none !important;
  }

  .gm-header-cta {
    margin-top: 0;
  }

  .gm-brand .custom-logo {
    max-height: 54px !important;
  }
}

/* Final override to keep logo aligned with original header */
.gm-logo-wrap,
.gm-logo-wrap .custom-logo-link {
  max-width: 207px !important;
}

.gm-logo-wrap .custom-logo {
  max-height: 44px !important;
  width: auto !important;
  height: auto !important;
}

.gm-logo-wrap .custom-logo-link,
.gm-logo-wrap .custom-logo-link img {
  display: inline-block !important;
  max-width: 100% !important;
  line-height: 0;
}

.gm-logo-wrap .custom-logo-link img {
  max-height: 44px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain;
}

@media (min-width: 992px) {
  .gm-logo-wrap,
  .gm-logo-wrap .custom-logo-link {
    max-width: 219px !important;
  }

  .gm-logo-wrap .custom-logo {
    max-height: 48px !important;
  }

  .gm-logo-wrap .custom-logo-link img {
    max-height: 48px !important;
  }
}
