/*
 * Studio Ramiro Tettamanti Associati
 * Responsive usability improvements — 22 November 2026
 * Loaded after page-specific CSS to retain existing desktop visual identity.
 * Shared by Italian/English homepages, profiles, articles, news, and archive.
 */

/* The original off-canvas menu had 14px grey text at 25% opacity. */
#menu-nav-wrap {
  box-sizing: border-box;
  width: 350px;
  max-width: 88vw;
  padding: 26px 23px 38px;
  color: #e8edf1;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}
#menu-nav-wrap h3 {
  color: #8ab9db;
  font-size: 22px;
  line-height: 1.35;
  margin: 5px 55px 19px 0;
}
#menu-nav-wrap .nav-list {
  margin: 20px 0 20px;
  padding: 0;
  line-height: 1.35;
}
#menu-nav-wrap .nav-list li,
#menu-nav-wrap .nav-list li:first-child {
  line-height: normal;
  border-color: rgba(255, 255, 255, .14);
}
#menu-nav-wrap .nav-list li a,
#menu-nav-wrap .nav-list li a:link,
#menu-nav-wrap .nav-list li a:visited {
  display: flex;
  align-items: center;
  gap: 9px;
  box-sizing: border-box;
  width: 100%;
  min-height: 48px;
  padding: 11px 5px;
  font-family: "montserrat-regular", sans-serif;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0;
  overflow-wrap: anywhere;
  color: #f2f4f6;
}
#menu-nav-wrap .nav-list li a:hover,
#menu-nav-wrap .nav-list li a:focus-visible,
#menu-nav-wrap .nav-list li.current a {
  color: #fff;
  background: rgba(255, 255, 255, .09);
}
#menu-nav-wrap .nav-list img {
  flex: 0 0 auto;
  max-width: 26px;
  max-height: 26px;
  width: auto;
  height: auto;
  object-fit: contain;
}
#menu-nav-wrap .close-button {
  box-sizing: border-box;
  width: 46px;
  height: 46px;
  top: 19px;
  right: 18px;
  border-radius: 3px;
}
#menu-nav-wrap .close-button span::before,
#menu-nav-wrap .close-button span::after {
  width: 22px;
  left: 12px;
}
#menu-nav-wrap a:focus-visible,
#header-menu-trigger:focus-visible {
  outline: 3px solid #b7ddf4;
  outline-offset: 3px;
}
.menu-is-open #menu-nav-wrap {
  height: 100vh;
}
@supports (height: 100dvh) {
  .menu-is-open #menu-nav-wrap { height: 100dvh; }
}
body.menu-is-open::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 790;
  background: rgba(0, 0, 0, .55);
}
body.menu-is-open #header-menu-trigger {
  opacity: 0;
  pointer-events: none;
}
body.menu-is-open {
  overflow: hidden;
}

/* More generous navigation trigger on phones and tablets. */
@media (max-width: 1100px) {
  html { font-size: 10px; }
  body { font-size: 16px; }
  #header-menu-trigger {
    box-sizing: border-box;
    min-width: 48px;
    min-height: 48px;
    width: 48px;
    height: 48px;
    line-height: 48px;
    right: 20px;
    top: 20px;
    z-index: 810;
    background: rgba(12, 12, 12, .82);
    border-radius: 3px;
  }
  #header-menu-trigger .header-menu-icon {
    right: 12px;
    background-color: #fff;
  }
  #header-menu-trigger .header-menu-text {
    top: 0;
    height: 48px;
    left: -73px;
    width: 73px;
    line-height: 48px;
    color: #fff;
    font-size: 14px;
    letter-spacing: .1rem;
    background-color: rgba(12, 12, 12, .82);
  }
  #menu-nav-wrap { z-index: 820; }
  main, article, .profile-main, #styles, #portfolio, #clients {
    overflow-wrap: break-word;
  }
  img, video, iframe, svg { max-width: 100%; }
  .map-privacy-placeholder,
  .map-privacy-card {
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
  }
  .map-privacy-card {
    width: 100%;
    overflow-wrap: anywhere;
  }
  .profile-index summary {
    box-sizing: border-box;
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    font-size: 17px;
    border: 1px solid #cbd9e4;
    border-radius: 3px;
  }
  .profile-index nav {
    box-sizing: border-box;
    max-width: calc(100vw - 26px);
    max-height: 70vh;
    font-size: 17px;
    line-height: 1.4;
    z-index: 30;
  }
  .profile-index nav a {
    box-sizing: border-box;
    min-height: 45px;
    padding: 10px 6px;
    display: flex;
    align-items: center;
    overflow-wrap: anywhere;
  }
  .profile-index nav li { border-bottom: 1px solid #e4eaf0; }
  .profile-index nav li:last-child { border-bottom: 0; }
}

/* Smartphone — readable content, usable targets, and fewer cramped margins. */
@media (max-width: 767px) {
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  body { font-size: 16px; line-height: 1.75; }
  header .header-logo { left: 15px; top: 20px; }
  header .header-logo2 { left: 15px; top: 20px; }
  header .header-logo a,
  header .header-logo2 a {
    width: 102px;
    height: 48px;
    background-size: contain;
    background-position: left center;
  }
  #header-menu-trigger { right: 15px; top: 20px; }
  #home {
    background-attachment: scroll;
    height: 100vh;
    min-height: 620px;
  }
  @supports (height: 100svh) {
    #home { height: 100svh; }
  }
  .home-content-tablecell .row {
    padding-top: 95px;
    padding-bottom: 85px;
  }
  .home-content-tablecell h1 {
    font-size: clamp(31px, 8.3vw, 48px);
    line-height: 1.15;
    overflow-wrap: normal;
  }
  .home-content-tablecell h3 {
    font-size: clamp(15px, 3.7vw, 18px);
    letter-spacing: .12rem;
  }
  .home-content-tablecell .more { margin-top: 30px; }
  #styles { padding-top: 7rem; padding-bottom: 7rem; }
  #styles h1, .section-intro h1 { line-height: 1.2; }
  #styles p, .profile-main p, .young-news p {
    line-height: 1.78;
  }
  #styles .lead, .section-intro .lead {
    line-height: 1.65;
  }
  #services, #competences { background-attachment: scroll; }
  #services .services-list .service-item,
  #competences .services-list .service-item {
    padding-left: 5px;
    padding-right: 5px;
  }
  #cookie-consent-banner {
    box-sizing: border-box;
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
    max-width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
    overflow-y: auto;
    padding: 17px 16px 20px;
    font-size: 15px;
    line-height: 1.5;
  }
  #cookie-consent-banner .cookie-consent-close {
    min-width: 42px;
    min-height: 42px;
    right: 4px;
    top: 3px;
  }
  .cookie-consent-actions { align-items: stretch; gap: 9px; }
  .cookie-consent-button {
    min-height: 46px;
    padding: 11px 14px;
  }
  .cookie-settings-link { white-space: normal; }
  .map-privacy-placeholder { padding: 20px 12px; }
  .map-privacy-card { padding: 20px 14px; }
  .profile-main { padding-bottom: 50px; }
  .profile-index nav { width: min(330px, calc(100vw - 26px)); }
  .article-author-quote { padding: 17px 18px; margin: 25px 0; }
  .article-author-quote p { font-size: 17px; }
  table { max-width: 100%; }
  .scrolldown { display: none; }
}

/* Small smartphones and short landscape screens. */
@media (max-width: 420px) {
  #menu-nav-wrap { max-width: 92vw; padding-left: 19px; padding-right: 19px; }
  #menu-nav-wrap .nav-list li a { font-size: 18px; }
  #header-menu-trigger .header-menu-text { display: none; }
  .home-content-tablecell .row { padding-top: 85px; padding-bottom: 65px; }
  #styles { padding-top: 55px; padding-bottom: 55px; }
  .profile-masthead-inner { gap: 8px; }
  .profile-index summary { font-size: 16px; }
  #cookie-consent-banner .cookie-consent-actions { display: grid; grid-template-columns: 1fr; }
  .cookie-consent-button { width: 100%; }
}
@media (max-height: 520px) and (max-width: 1100px) {
  #menu-nav-wrap { padding-top: 15px; }
  #menu-nav-wrap h3 { margin-top: 0; }
  #home { min-height: 510px; }
}
/* Avoid animation-related discomfort without changing the usual experience. */
@media (prefers-reduced-motion: reduce) {
  #menu-nav-wrap, #header-menu-trigger { transition-duration: .01ms; }
  #home .scroll-icon { animation: none; }
}

/* Final layout corrections verified at 320px and 390px. */
body.menu-is-open header {
  /* Header creates a stacking context: it must sit above the dark scrim. */
  z-index: 900;
}
@media (max-width: 1100px) {
  header .header-logo a,
  header .header-logo2 a {
    width: clamp(150px, 22vw, 240px);
    height: 67px;
    background-size: contain;
    background-position: left center;
  }
  .map-privacy-card .button {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: auto;
    min-height: 48px;
    padding: 11px 14px;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.4;
    letter-spacing: .035rem;
  }
}
@media (max-width: 767px) {
  header .header-logo a,
  header .header-logo2 a {
    width: 158px;
    height: 58px;
  }
}

/* The bilingual privacy table becomes readable cards on narrow screens. */
@media (max-width: 700px) {
  .privacy-table,
  .privacy-table tbody,
  .privacy-table tr,
  .privacy-table td {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .privacy-table {
    margin: 18px 0 26px;
  }
  .privacy-table thead {
    /* Keep table headings available to assistive technologies. */
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .privacy-table tr {
    margin: 0 0 15px;
    border: 1px solid #d8e0e7;
    background: #fff;
  }
  .privacy-table td {
    border: 0;
    padding: 10px 12px;
    line-height: 1.55;
    overflow-wrap: anywhere;
  }
  .privacy-table td + td {
    border-top: 1px solid #e2e8ee;
  }
  .privacy-table td::before {
    display: block;
    color: #2c6793;
    font-family: "montserrat-bold", sans-serif;
    font-size: 13px;
    line-height: 1.3;
    margin-bottom: 4px;
  }
  .privacy-table td:first-child::before { content: "Nome"; }
  .privacy-table td:nth-child(2)::before { content: "Tipo e finalità"; }
  .privacy-table td:nth-child(3)::before { content: "Durata"; }
  #english ~ .privacy-table td:first-child::before { content: "Name"; }
  #english ~ .privacy-table td:nth-child(2)::before { content: "Type and purpose"; }
  #english ~ .privacy-table td:nth-child(3)::before { content: "Duration"; }
  .privacy-table code {
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
  }
}
