/* =========================================================
   Mobile / tablet — barra, testo centrato, footer
   Tutela Penale editorial responsive
   ========================================================= */

/* ---------- Mobile bar: contatto | logo | menu ---------- */
.mobile-tablet-only {
  display: none;
}

@media (max-width: 1024px) {
  .desktop-only {
    display: none !important;
  }

  .mobile-tablet-only {
    display: block;
    width: 100%;
  }

  /* Solo mobile/tablet: annulla padding/logo luxa che fanno sporgere la barra */
  .site-header {
    position: sticky !important;
    top: 0 !important;
    z-index: 1100 !important;
    padding: 0 !important;
    margin: 0 !important;
    min-height: 0 !important;
    background: rgba(8, 14, 40, 0.96) !important;
    border-bottom: 1px solid rgba(212, 175, 55, 0.35);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: none !important;
  }

  .site-header.scrolled {
    padding: 0 !important;
    background: rgba(8, 14, 40, 0.98) !important;
    box-shadow: none !important;
  }

  /* Critico: niente padding-top su main (evita striscia sotto la linea oro) */
  main,
  #main-content {
    padding-top: 0 !important;
  }

  .site-header .site-logo img {
    height: 72px !important;
    max-height: 72px !important;
  }

  .mbar {
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    align-items: center;
    gap: 0.35rem;
    min-height: 76px;
    height: 76px;
    padding: 0 max(0.85rem, env(safe-area-inset-right)) 0 max(0.85rem, env(safe-area-inset-left));
    max-width: 100%;
    box-sizing: border-box;
    position: relative;
    z-index: 1110;
  }

  .mbar-contact,
  .nav-butter {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    justify-self: start;
    border: 1.5px solid rgba(212, 175, 55, 0.65);
    background: rgba(212, 175, 55, 0.06);
    color: #e8c547;
    text-decoration: none;
    border-radius: 0;
    transition: border-color 0.25s ease, color 0.25s ease, background 0.25s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .nav-butter {
    justify-self: end;
    cursor: pointer;
    padding: 0;
    flex-direction: column;
    gap: 5px;
  }

  .mbar-contact:hover,
  .mbar-contact:focus-visible,
  .nav-butter:hover,
  .nav-butter:focus-visible {
    border-color: #f4d03f;
    color: #f4d03f;
    background: rgba(212, 175, 55, 0.14);
    outline: none;
  }

  .mbar-contact svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .mbar-logo {
    justify-self: center;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    max-width: min(240px, 62vw);
  }

  .mbar-logo img {
    display: block;
    height: 72px !important;
    width: auto !important;
    max-width: 100% !important;
    max-height: 72px !important;
    object-fit: contain;
  }

  .nav-butter span {
    display: block;
    width: 20px;
    height: 2.5px;
    background: #e8c547;
    border-radius: 1px;
    box-shadow: 0 0 0 0.5px rgba(212, 175, 55, 0.35);
    transition: transform 0.28s ease, opacity 0.2s ease;
  }

  .nav-butter.active span:nth-child(1) {
    transform: translateY(7.5px) rotate(45deg);
  }

  .nav-butter.active span:nth-child(2) {
    opacity: 0;
  }

  .nav-butter.active span:nth-child(3) {
    transform: translateY(-7.5px) rotate(-45deg);
  }

  /* ========== Pannello menu mobile — editoriale ========== */
  .mbar-backdrop {
    position: fixed;
    top: 76px;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1090;
    background: rgba(4, 8, 22, 0.62);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.35s ease, visibility 0.35s ease;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
  }

  .mbar-backdrop.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .mobile-tablet-only .navigation .menu {
    position: fixed !important;
    top: 76px !important;
    right: 0 !important;
    left: auto !important;
    width: min(100%, 340px) !important;
    max-width: 90vw !important;
    height: calc(100vh - 76px) !important;
    height: calc(100dvh - 76px) !important;
    margin: 0 !important;
    padding: 1.35rem 1.35rem calc(2.25rem + env(safe-area-inset-bottom)) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0 !important;
    list-style: none !important;
    background:
      linear-gradient(180deg, rgba(12, 18, 48, 0.98) 0%, rgba(8, 14, 40, 0.99) 100%) !important;
    border-left: 1px solid rgba(212, 175, 55, 0.28);
    box-shadow: -20px 0 48px rgba(0, 0, 0, 0.45);
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    z-index: 1105 !important;
    transform: translateX(105%);
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .mobile-tablet-only .navigation .menu::before {
    content: 'Navigazione';
    display: block;
    margin: 0 0 1.15rem;
    padding: 0 0 0.85rem;
    border-bottom: 1px solid rgba(212, 175, 55, 0.22);
    font-family: var(--font-body), 'Source Sans 3', sans-serif;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(212, 175, 55, 0.9);
  }

  .mobile-tablet-only .navigation .menu.active {
    transform: translateX(0);
  }

  .mobile-tablet-only .navigation .menu > li {
    width: 100% !important;
    margin: 0 !important;
    border-bottom: 1px solid rgba(212, 175, 55, 0.1);
  }

  .mobile-tablet-only .navigation .menu > li:last-child {
    border-bottom: none;
  }

  .mobile-tablet-only .navigation .menu > li > a {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1.05rem 0.1rem !important;
    min-height: 52px;
    font-family: var(--font-display), 'Libre Baskerville', Georgia, serif !important;
    font-size: 1.12rem !important;
    font-weight: 400 !important;
    letter-spacing: 0.01em;
    line-height: 1.3;
    color: #f4f1e8 !important;
    text-align: left !important;
    border: none !important;
    background: transparent !important;
    text-shadow: none !important;
    border-radius: 0 !important;
    transition: color 0.25s ease;
  }

  .mobile-tablet-only .navigation .menu > li > a span {
    color: inherit !important;
  }

  .mobile-tablet-only .navigation .menu > li > a:hover,
  .mobile-tablet-only .navigation .menu > li > a:focus-visible {
    color: var(--primary-gold, #d4af37) !important;
    background: transparent !important;
    transform: none !important;
  }

  /* Nessun chevron / triangolo nel menu mobile */
  .mobile-tablet-only .navigation .menu li.has-dropdown > a::after,
  .mobile-tablet-only .navigation .menu li.has-dropdown.active > a::after {
    display: none !important;
    content: none !important;
    border: none !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
  }

  .mobile-tablet-only .dropdown-menu {
    position: static !important;
    display: none;
    max-height: 0;
    overflow: hidden;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 0 0.65rem !important;
    margin: 0 !important;
    min-width: 0 !important;
    list-style: none !important;
    transition: max-height 0.35s ease;
  }

  .mobile-tablet-only .dropdown-menu::before {
    display: none !important;
  }

  .mobile-tablet-only .has-dropdown.active .dropdown-menu {
    display: block;
    max-height: 65vh;
    overflow-y: auto;
  }

  .mobile-tablet-only .dropdown-menu li {
    margin: 0 !important;
    border: none !important;
  }

  .mobile-tablet-only .dropdown-menu li:not(:last-child)::after {
    display: none !important;
  }

  .mobile-tablet-only .dropdown-menu li a {
    display: block !important;
    padding: 0.72rem 0.15rem 0.72rem 0.95rem !important;
    margin: 0 !important;
    border-left: 1px solid rgba(212, 175, 55, 0.4) !important;
    border-radius: 0 !important;
    font-family: var(--font-body), 'Source Sans 3', sans-serif !important;
    font-size: 0.92rem !important;
    font-weight: 400 !important;
    letter-spacing: 0.01em;
    line-height: 1.4;
    color: rgba(198, 204, 220, 0.92) !important;
    background: transparent !important;
    transform: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
    transition: color 0.22s ease, border-color 0.22s ease;
  }

  .mobile-tablet-only .dropdown-menu li a:hover,
  .mobile-tablet-only .dropdown-menu li a:focus-visible {
    color: var(--primary-gold, #d4af37) !important;
    background: transparent !important;
    border-left-color: var(--primary-gold, #d4af37) !important;
    transform: none !important;
    box-shadow: none !important;
  }

  .mobile-tablet-only .dropdown-menu li a:hover::before,
  .mobile-tablet-only .dropdown-menu li a:hover::after {
    display: none !important;
  }

  /* Contatti in evidenza */
  .mobile-tablet-only .navigation .menu > li.mnav-cta {
    margin-top: 1.15rem !important;
    padding-top: 1.15rem;
    border-top: 1px solid rgba(212, 175, 55, 0.22);
    border-bottom: none;
  }

  .mobile-tablet-only .navigation .menu > li.mnav-cta > a {
    font-family: var(--font-body), 'Source Sans 3', sans-serif !important;
    font-size: 0.72rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.16em !important;
    text-transform: uppercase !important;
    color: rgba(212, 175, 55, 0.95) !important;
    justify-content: flex-start;
    padding: 0.85rem 0 !important;
    min-height: 0;
    border-bottom: 1px solid rgba(212, 175, 55, 0.35);
    align-self: flex-start;
    width: fit-content;
  }

  .mobile-tablet-only .navigation .menu > li.mnav-cta > a:hover {
    color: #f4d03f !important;
    border-bottom-color: #f4d03f;
  }

  body.nav-open {
    overflow: hidden;
  }
}

@media (min-width: 1025px) {
  .mobile-tablet-only {
    display: none !important;
  }

  .desktop-only {
    display: block;
  }
}

/* ---------- Testo centrato su mobile ---------- */
@media (max-width: 768px) {
  body.luxa-theme {
    font-size: 1.05rem;
    text-align: center;
  }

  body.luxa-theme main {
    text-align: center;
  }

  /* Heroes */
  .sp-hero-content,
  .rp-hero-content,
  .areas-hero-content,
  .blog-hero-content,
  .lawyer-hero-content,
  .contact-hero-content,
  .ba-hero .container,
  .le-hero .container,
  .le-hero--center .container {
    text-align: center !important;
    margin-left: auto;
    margin-right: auto;
    max-width: 36rem;
  }

  .sp-title-rule,
  .rp-title-rule,
  .areas-title-rule,
  .blog-title-rule,
  .lawyer-title-rule,
  .ba-title-rule,
  .le-title-rule,
  .areas-aside-rule,
  .sp-aside-rule,
  .bio-rule,
  .reach-rule,
  .contact-title-rule {
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .contact-title-rule {
    background: linear-gradient(90deg, transparent, var(--primary-gold, #d4af37), transparent) !important;
  }

  .contact-eyebrow {
    display: flex !important;
    justify-content: center !important;
  }

  .reach-item {
    text-align: center !important;
  }

  .reach-link {
    justify-content: center !important;
  }

  .sp-hero-lead,
  .rp-hero-lead,
  .areas-hero-lead,
  .blog-hero-lead,
  .lawyer-title,
  .ba-title,
  .le-lead,
  .le-meta {
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .sp-eyebrow,
  .rp-eyebrow,
  .areas-eyebrow,
  .blog-eyebrow,
  .lawyer-eyebrow,
  .ba-meta,
  .ba-crumb,
  .le-eyebrow {
    justify-content: center !important;
  }

  .ba-crumb {
    justify-content: center;
  }

  /* Intro / sezioni */
  .sp-intro-grid,
  .rp-intro-grid,
  .areas-why-grid,
  .lawyer-profile {
    text-align: center !important;
  }

  .sp-intro-aside,
  .rp-intro-aside,
  .areas-why-aside,
  .sp-intro-body,
  .rp-intro-body,
  .areas-why-body,
  .sp-lead,
  .rp-lead,
  .areas-why-lead {
    text-align: center !important;
    margin-left: auto;
    margin-right: auto;
  }

  .sp-aside-rule,
  .rp-aside-rule,
  .areas-aside-rule {
    margin-left: auto;
    margin-right: auto;
  }

  .sp-points,
  .rp-benefits,
  .areas-item-points {
    text-align: left;
    display: inline-grid;
    margin-left: auto;
    margin-right: auto;
    max-width: 22rem;
  }

  .sp-points li,
  .rp-benefits li,
  .areas-item-points li {
    text-align: left;
  }

  .sp-item,
  .rp-service,
  .areas-item,
  .blog-item {
    text-align: center !important;
    border-left: none !important;
    border-top: 1px solid rgba(212, 175, 55, 0.28) !important;
    padding: 1.5rem 0.35rem 0.5rem !important;
  }

  .sp-item-link,
  .rp-service-link,
  .areas-item-link,
  .blog-item-link,
  .ba-cta-link,
  .sp-cta-link,
  .areas-cta-link {
    align-self: center;
    margin-left: auto;
    margin-right: auto;
  }

  .blog-item-foot,
  .ba-nav,
  .areas-cta-links,
  .sp-cta-links {
    justify-content: center !important;
  }

  .sp-callout,
  .ba-callout,
  .sp-quote,
  .ba-quote {
    text-align: left;
    margin-left: auto;
    margin-right: auto;
  }

  .sp-steps,
  .rp-steps {
    text-align: left;
    margin-left: auto;
    margin-right: auto;
  }

  .sp-step,
  .rp-step,
  .areas-why-list li {
    text-align: left;
  }

  .sp-section-head,
  .rp-section-head,
  .areas-section-head,
  .blog-section-head,
  .form-band-header,
  .ba-cta,
  .sp-cta-inner,
  .areas-cta-inner,
  .le-utility {
    text-align: center !important;
  }

  .ba-prose,
  .le-prose {
    text-align: left;
    margin-left: auto;
    margin-right: auto;
  }

  .ba-prose h2,
  .ba-prose h3,
  .le-prose h2,
  .le-prose h3,
  .le-prose h4 {
    text-align: center;
  }

  /* Forms */
  .contact-form-band,
  .form-band-inner,
  .form-band-header,
  .reach-title,
  .reach-subtitle {
    text-align: center !important;
  }

  .form-band-shell,
  .rp-contact-form {
    text-align: left;
  }

  /* Lawyer profile: Profilo prima, Contatti dopo, tutto centrato */
  .lawyer-profile {
    text-align: center !important;
  }

  .lawyer-profile .bio-text {
    order: 1 !important;
    text-align: center !important;
    padding-right: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .lawyer-profile .lawyer-aside {
    order: 2 !important;
    text-align: center !important;
  }

  .lawyer-aside,
  .lawyer-aside-meta,
  .bio-text,
  .bio-header,
  .bio-text .section-title,
  .bio-text .lead,
  .bio-text p,
  .bio-text h3 {
    text-align: center !important;
  }

  .lawyer-aside-meta {
    align-items: center !important;
    border-left: none !important;
    padding-left: 0 !important;
  }

  .profile-image {
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .bio-rule,
  .lawyer-title-rule {
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .lawyer-aside-meta .contact-line {
    display: flex;
    justify-content: center;
    text-align: center;
  }

  .lawyer-aside-meta .contact-value {
    text-align: center;
  }

  .lawyer-eyebrow {
    justify-content: center !important;
  }

  /* Cookie / banner leftovers */
  .banner-content,
  .hero-content {
    text-align: center !important;
  }

  /* Utility */
  .le-utility-links {
    justify-content: center;
  }

  .container {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }

  /* Hero sotto la barra sticky: padding = altezza mbar + respiro */
  body.luxa-theme main section.sp-hero,
  body.luxa-theme main section.rp-hero,
  body.luxa-theme main section.areas-hero,
  body.luxa-theme main section.blog-hero,
  body.luxa-theme main section.lawyer-hero-section,
  body.luxa-theme main section.ba-hero,
  body.luxa-theme main section.le-hero,
  body.luxa-theme main section.contact-hero-section,
  body.luxa-theme main section.banner-slider {
    padding: 0 !important;
    margin: 0 !important;
    align-items: flex-start !important;
  }

  body.luxa-theme main section.banner-slider .min-vh-hero,
  body.luxa-theme main section.banner-slider .row {
    align-items: flex-start !important;
  }

  body.luxa-theme main section.banner-slider .banner-content {
    padding-top: calc(76px + 1.5rem) !important;
    padding-bottom: 2.5rem !important;
  }

  .sp-hero .container,
  .rp-hero .container,
  .areas-hero .container,
  .blog-hero .container,
  .lawyer-hero-section .container,
  .contact-hero-section .container {
    padding-top: calc(76px + 1.5rem) !important;
    padding-bottom: clamp(2.5rem, 6vw, 3.75rem) !important;
  }

  .sp-hero-content,
  .rp-hero-content,
  .areas-hero-content,
  .blog-hero-content,
  .lawyer-hero-content,
  .contact-hero-content {
    padding-top: 0 !important;
  }

  .ba-hero,
  .le-hero {
    padding-top: calc(76px + 1.75rem) !important;
    padding-bottom: clamp(2.5rem, 5vw, 3.5rem) !important;
  }
}

/* ---------- Footer centrato ---------- */
@media (max-width: 768px) {
  .site-footer {
    text-align: center !important;
    padding: 3.5rem 0 1.75rem !important;
  }

  .footer-grid {
    grid-template-columns: 1fr !important;
    max-width: 22rem !important;
    margin: 0 auto !important;
    gap: 2.25rem !important;
  }

  .footer-col {
    text-align: center !important;
    border-top: 1px solid rgba(212, 175, 55, 0.28);
    padding-top: 1.25rem;
    align-items: center;
  }

  .footer-label {
    text-align: center;
  }

  .footer-list {
    align-items: center !important;
  }

  .footer-list li {
    align-items: center !important;
    text-align: center !important;
  }

  .footer-bottom {
    text-align: center !important;
  }

  .copyright {
    max-width: 22rem;
    margin-left: auto;
    margin-right: auto;
  }
}

/* ---------- Small phones ---------- */
@media (max-width: 380px) {
  .mbar {
    grid-template-columns: 40px 1fr 40px;
    min-height: 70px;
    height: 70px;
    padding-left: 0.65rem;
    padding-right: 0.65rem;
  }

  .mbar-logo {
    max-width: min(220px, 64vw);
  }

  .mbar-logo img {
    height: 64px !important;
    max-height: 64px !important;
  }

  .mbar-contact,
  .nav-butter {
    width: 40px;
    height: 40px;
  }

  .nav-butter span {
    width: 18px;
    height: 2.25px;
  }

  .mbar-backdrop,
  .mobile-tablet-only .navigation .menu {
    top: 70px !important;
  }

  .mobile-tablet-only .navigation .menu {
    height: calc(100vh - 70px) !important;
    height: calc(100dvh - 70px) !important;
  }

  body.luxa-theme main section.banner-slider .banner-content,
  .sp-hero .container,
  .rp-hero .container,
  .areas-hero .container,
  .blog-hero .container,
  .lawyer-hero-section .container,
  .contact-hero-section .container,
  .lawyer-hero-content {
    padding-top: calc(70px + 1.35rem) !important;
  }

  .ba-hero,
  .le-hero {
    padding-top: calc(70px + 1.5rem) !important;
  }
}

/* iOS input zoom prevention */
@media (max-width: 1024px) {
  input,
  textarea,
  select {
    font-size: 16px !important;
  }
}
