/* AirAdmin8 Robotics 共通ヘッダー・フッター
   includes/site-header.html / includes/site-footer.html 専用 */

.site-header[data-shared-layout="header"] {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  overflow-x: clip;
  border-bottom: 1px solid #d9e5ea;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(12px);
}

.site-header[data-shared-layout="header"] .header-inner {
  width: min(1280px, calc(100% - 64px));
  min-height: 72px;
  margin-inline: auto;
  display: grid;
  grid-template-columns: 190px minmax(0,1fr);
  align-items: center;
  gap: 28px;
  box-sizing: border-box;
}

.site-header[data-shared-layout="header"] .brand {
  display: block !important;
  width: 190px !important;
  height: 42px !important;
  min-width: 0 !important;
  background: none !important;
  font-size: 0 !important;
  line-height: 0 !important;
  overflow: visible !important;
}

.site-header[data-shared-layout="header"] .brand-logo {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: contain !important;
  object-position: left center !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.site-header[data-shared-layout="header"] .brand-logo-pc { display: block !important; }
.site-header[data-shared-layout="header"] .brand-logo-sp { display: none !important; }

.site-header[data-shared-layout="header"] .nav {
  position: static;
  display: flex;
  min-width: 0;
  max-width: 100%;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(10px,1vw,18px);
  font-size: clamp(.8rem,.8vw,.92rem);
  font-weight: 800;
}

.site-header[data-shared-layout="header"] .nav > a {
  flex: 0 1 auto;
  min-width: 0;
  white-space: nowrap;
  text-decoration: none;
}

.site-header[data-shared-layout="header"] .nav-cta {
  flex: 0 0 auto;
  display: inline-flex;
  min-height: 44px;
  padding: 10px 16px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #fff;
  background: #009ad2;
}

.site-header[data-shared-layout="header"] .menu {
  display: none;
  min-width: 48px;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #007fae;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.site-header[data-shared-layout="header"] .menu:focus-visible,
.site-header[data-shared-layout="header"] .nav > a:focus-visible {
  outline: 3px solid rgba(0,132,197,.28);
  outline-offset: 3px;
}

.footer[data-shared-layout="footer"] {
  padding: 52px 0 24px;
  color: #d8e8ee;
  background: #061923;
}

.footer[data-shared-layout="footer"] .footer-grid {
  width: min(1180px, calc(100% - 64px));
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(280px,.95fr) minmax(420px,1.25fr);
  align-items: start;
  gap: clamp(56px,8vw,120px);
}

.footer[data-shared-layout="footer"] .footer-brand-block {
  max-width: 420px;
}

.footer[data-shared-layout="footer"] .footer-brand-block p {
  max-width: 360px;
  margin: 18px 0 0;
  line-height: 1.8;
}

.footer[data-shared-layout="footer"] .footer-links {
  display: grid;
  grid-template-columns: repeat(3,minmax(120px,1fr));
  gap: 18px 28px;
  align-content: start;
}

.footer[data-shared-layout="footer"] .footer-links a {
  display: flex;
  min-height: 40px;
  align-items: center;
}

.footer[data-shared-layout="footer"] a {
  color: inherit;
  text-decoration: none;
}

.footer[data-shared-layout="footer"] p { color: #9fb5bf; }

.footer[data-shared-layout="footer"] .aa8-main-logo {
  display: block;
  width: min(270px,72vw);
  max-height: 56px;
  object-fit: contain;
  object-position: left center;
}

.footer[data-shared-layout="footer"] .footer-bottom {
  width: min(1180px, calc(100% - 64px));
  margin: 38px auto 0;
  padding-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid rgba(216,232,238,.18);
}

.footer[data-shared-layout="footer"] .footer-utility-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
}

.footer[data-shared-layout="footer"] .footer-utility-links a,
.footer[data-shared-layout="footer"] .footer-bottom small {
  color: #9fb5bf;
  font-size: .84rem;
  line-height: 1.5;
}

.footer[data-shared-layout="footer"] .footer-utility-links a:hover,
.footer[data-shared-layout="footer"] .footer-utility-links a:focus-visible {
  color: #fff;
}

@media (max-width:1240px) and (min-width:981px) {
  .site-header[data-shared-layout="header"] .header-inner {
    width: min(100% - 40px,1180px);
    grid-template-columns: 164px minmax(0,1fr);
    gap: 14px;
  }
  .site-header[data-shared-layout="header"] .brand {
    width: 164px !important;
    height: 38px !important;
  }
  .site-header[data-shared-layout="header"] .nav {
    gap: 8px;
    font-size: .76rem;
  }
  .site-header[data-shared-layout="header"] .nav-cta { padding-inline: 11px; }
}

@media (max-width:980px) {
  .site-header[data-shared-layout="header"] {
    overflow: visible !important;
    backdrop-filter: none;
  }
  .site-header[data-shared-layout="header"] .header-inner {
    position: relative;
    width: min(100% - 24px,1200px);
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }
  .site-header[data-shared-layout="header"] .brand {
    width: 135px !important;
    height: 35px !important;
    flex: 0 0 135px !important;
  }
  .site-header[data-shared-layout="header"] .brand-logo-pc { display: none !important; }
  .site-header[data-shared-layout="header"] .brand-logo-sp { display: block !important; }
  .site-header[data-shared-layout="header"] .menu {
    position: relative;
    z-index: 2101;
    display: inline-flex !important;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
  }
  .site-header[data-shared-layout="header"] .menu[aria-expanded="true"] {
    color: #fff;
    background: #007fae;
  }
  .site-header[data-shared-layout="header"] .nav {
    position: fixed;
    z-index: 2100;
    top: 60px;
    right: 0;
    bottom: 0;
    left: 0;
    display: none;
    width: 100%;
    max-width: none;
    max-height: none;
    box-sizing: border-box;
    overflow-y: auto;
    overscroll-behavior: contain;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 12px 16px calc(20px + env(safe-area-inset-bottom));
    border-bottom: 1px solid #d9e5ea;
    background: #fff;
    box-shadow: 0 18px 32px rgba(6,25,35,.14);
  }
  .site-header[data-shared-layout="header"] .nav.open { display: flex !important; }
  .site-header[data-shared-layout="header"] .nav > a {
    display: flex;
    min-height: 48px;
    padding: 10px 12px;
    align-items: center;
    border-radius: 10px;
    white-space: normal;
  }
  .site-header[data-shared-layout="header"] .nav > a:not(.nav-cta):hover,
  .site-header[data-shared-layout="header"] .nav > a:not(.nav-cta):focus-visible { background: #eef9fc; }
  .site-header[data-shared-layout="header"] .nav-cta {
    margin-top: 8px;
    border-radius: 12px;
  }
  .footer[data-shared-layout="footer"] .footer-grid {
    width: min(100% - 40px,760px);
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .footer[data-shared-layout="footer"] .footer-links {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
  .footer[data-shared-layout="footer"] .footer-bottom {
    width: min(100% - 40px,760px);
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }
}

@media (max-width:640px) {
  .footer[data-shared-layout="footer"] { padding: 40px 0 22px; }
  .footer[data-shared-layout="footer"] .footer-grid {
    width: min(100% - 28px,560px);
  }
  .footer[data-shared-layout="footer"] .footer-links {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .footer[data-shared-layout="footer"] .footer-bottom {
    width: min(100% - 28px,560px);
    margin-top: 30px;
  }
  .footer[data-shared-layout="footer"] .footer-utility-links {
    gap: 10px 18px;
  }
}

/* 最終PCヘッダー規則：旧main-site-experience.cssの!important上書きを無効化 */
@media (min-width:981px) {
  body > .site-header[data-shared-layout="header"] > .header-inner,
  .site-header[data-shared-layout="header"] .header-inner {
    display: grid !important;
    grid-template-columns: 190px minmax(0,1fr) !important;
    width: min(1440px, calc(100% - 56px)) !important;
    min-height: 72px !important;
    column-gap: 32px !important;
  }

  .site-header[data-shared-layout="header"] .brand {
    grid-column: 1 !important;
    justify-self: start !important;
    width: 190px !important;
    height: 42px !important;
  }

  .site-header[data-shared-layout="header"] .nav {
    grid-column: 2 !important;
    justify-self: stretch !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: clamp(14px,1.35vw,24px) !important;
    margin-left: 0 !important;
    min-width: 0 !important;
    font-size: clamp(.78rem,.86vw,.92rem) !important;
  }

  .site-header[data-shared-layout="header"] .nav > a {
    display: inline-flex !important;
    flex: 0 0 auto !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 8px 0 !important;
    align-items: center !important;
    border: 0 !important;
    border-radius: 0 !important;
    line-height: 1.35 !important;
    white-space: nowrap !important;
  }

  .site-header[data-shared-layout="header"] .nav > .nav-cta {
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    min-height: 42px !important;
    margin: 0 !important;
    padding: 10px 18px !important;
    border-radius: 999px !important;
    color: #fff !important;
    background: #009ad2 !important;
    box-shadow: none !important;
  }
}