/* Techisland Smarthome — Shared Header, Navigation & Footer Components */
@import "./tokens.css";
@import "./lead-modal.css";

html {
  scroll-padding-top: 110px;
}

/* Skip link & Accessibility */
.skip-link {
  position: fixed;
  top: -80px;
  left: 20px;
  z-index: 1000;
  background: var(--lime);
  color: var(--forest);
  padding: 12px 24px;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius);
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 14px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.inline-button {
  display: inline;
  background: transparent;
  padding: 0;
  color: inherit;
  font-size: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.small-note {
  font-size: 11px;
  line-height: 1.75;
  color: var(--muted);
}

/* Header & Primary Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 252, 0.97);
  border-bottom: 1px solid #e8ebe4;
  transition: box-shadow 0.2s;
  backdrop-filter: blur(16px);
}

.site-header.scrolled {
  box-shadow: 0 5px 22px rgba(20, 45, 32, 0.06);
}

.nav-shell {
  width: min(1390px, calc(100% - 72px));
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 22px;
  flex: 0 0 auto;
}

.brand img {
  width: 86px;
  height: 70px;
  object-fit: contain;
}

.brand-descriptor {
  font-size: 8px;
  line-height: 1.9;
  letter-spacing: 0.19em;
  color: #687667;
  padding-left: 21px;
  border-left: 1px solid #dce3d6;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 29px;
}

.main-nav > a {
  font-size: 12px;
  font-weight: 500;
  position: relative;
  padding: 12px 0;
}

.main-nav > a:after {
  content: "";
  position: absolute;
  bottom: 6px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--green);
  transition: width 0.2s;
}

.main-nav > a:hover:after {
  width: 100%;
}
.main-nav > a.active:after {
  width: 100%;
}

.site-header .button,
.site-header .nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 43px;
  padding: 10px 19px;
  font-size: 11px;
  font-weight: 550;
  line-height: 1.5;
  gap: 23px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--forest);
  color: var(--white);
  text-decoration: none;
  transition:
    background 0.2s,
    transform 0.2s,
    color 0.2s;
}

.site-header .button:hover,
.site-header .nav-cta:hover {
  background: #285541;
  transform: translateY(-2px);
}

.site-header .button .icon,
.site-header .nav-cta .icon {
  width: 18px;
  height: 18px;
}
.site-header .icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.45;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  background: none;
}

.main-nav .nav-mobile-cta {
  display: none;
}

/* Responsive Navigation */
@media (max-width: 1280px) {
  .nav-shell {
    width: calc(100% - 48px);
  }
  .brand-descriptor {
    display: none;
  }
  .main-nav {
    gap: 24px;
  }
  .site-header .button,
  .site-header .nav-cta,
  .nav-cta {
    font-size: 10px;
    gap: 14px;
  }
}

@media (max-width: 920px) {
  .nav-shell {
    height: 86px;
  }
  .brand img {
    width: 74px;
    height: 62px;
  }
  .main-nav {
    gap: 18px;
  }
  .main-nav > a {
    font-size: 10px;
  }
}

@media (max-width: 900px) {
  .nav-shell {
    width: calc(100% - 36px);
    height: 80px;
    gap: 14px;
  }
  .brand {
    gap: 13px;
  }
  .brand img {
    width: 65px;
    height: 54px;
  }
  .brand-descriptor {
    display: block;
    font-size: 6px;
    letter-spacing: 0.15em;
    padding-left: 13px;
  }
  .site-header .button,
  .site-header .nav-cta,
  .nav-cta {
    margin-left: auto;
    font-size: 9px;
    padding: 9px 11px;
    min-height: 36px;
    gap: 11px;
  }
  .site-header .button .icon,
  .site-header .nav-cta .icon,
  .nav-cta .icon {
    height: 14px;
    width: 14px;
  }
  .menu-toggle {
    display: grid;
    place-items: center;
    width: 31px;
    height: 39px;
    padding: 0;
  }
  .menu-toggle .icon {
    width: 22px;
    height: 22px;
  }
  .main-nav {
    display: none;
    position: absolute;
    top: 80px;
    left: 0;
    right: 0;
    background: #f8faf2;
    box-shadow: 0 16px 30px rgba(23, 44, 32, 0.15);
    padding: 16px 24px 25px;
    z-index: 51;
    gap: 0;
    align-items: stretch;
  }
  .main-nav.is-open {
    display: flex;
    flex-direction: column;
  }
  .main-nav > a {
    font-size: 13px;
    padding: 14px 0;
    border-bottom: 1px solid #dce5cf;
  }
  .main-nav > a:after {
    display: none;
  }
  .main-nav .nav-mobile-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #385d34;
    margin-top: 8px;
  }
}

@media (max-width: 720px) {
  .menu-toggle {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
  }
  .nav-shell {
    gap: 10px;
  }
  .brand-descriptor {
    font-size: 5.8px;
  }
}

@media (max-width: 520px) {
  .brand-descriptor {
    display: none;
  }
  .main-nav > a {
    font-size: 12px;
  }
}

/* Site Footer */
.site-footer {
  background: #0a2922;
  padding: 32px 0 20px;
  color: #c8e6d4;
}

.footer-top {
  display: flex;
  align-items: center;
  gap: 45px;
  padding-top: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #1e4a3a;
}

.footer-brand img {
  width: 88px;
  height: 72px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.footer-top > p {
  font-size: 11px;
  color: #8ab89e;
  line-height: 1.9;
  margin: 0;
  padding-left: 33px;
  border-left: 1px solid #1e4a3a;
}

.footer-top em {
  font-size: 20px;
  color: #c8e6d4;
  letter-spacing: -0.02em;
}

.back-top {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 8px;
  letter-spacing: 0.13em;
  color: #6aab85;
}

.back-top .icon {
  height: 17px;
  width: 17px;
  stroke: currentColor;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  color: #7aab8e;
  font-size: 12px;
  padding-top: 22px;
}

.footer-bottom > div {
  display: flex;
  gap: 25px;
}

.footer-bottom .inline-button {
  text-decoration: none;
  color: inherit;
}

.footer-bottom a {
  color: inherit;
}

.footer-bottom a:hover,
.footer-bottom .inline-button:hover {
  text-decoration: underline;
}

.footer-disclaimer {
  font-size: 11px;
  color: #4e7a62;
  line-height: 1.9;
  margin: 18px 0 0;
  max-width: 1060px;
}

@media (max-width: 900px) {
  .site-footer {
    padding: 24px 0 18px;
  }
  .footer-top {
    gap: 20px;
    padding-bottom: 18px;
    flex-wrap: wrap;
  }
  .footer-brand img {
    width: 73px;
    height: 60px;
  }
  .footer-top > p {
    padding-left: 20px;
    font-size: 9px;
  }
  .footer-top em {
    font-size: 18px;
  }
  .back-top {
    font-size: 7px;
    margin-left: 0;
    width: 100%;
    margin-top: 9px;
    justify-content: flex-end;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 16px;
  }
  .footer-bottom > div {
    flex-wrap: wrap;
    gap: 16px;
  }
}

@media print {
  .site-header,
  .site-footer button {
    display: none !important;
  }
  .site-footer {
    padding: 24px 0;
  }
}
