/* Mazini Energy Mobile & Tablet child theme */
:root {
  --mz-mobile-bar-height: 70px;
  --mz-vh: 1vh;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--mz-header) + 18px);
}

body {
  overflow-wrap: anywhere;
}

a, button, input, select, textarea {
  touch-action: manipulation;
}

iframe, video, embed, object {
  max-width: 100%;
}

.wp-block-table,
.mz-content table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.site-nav-toggle {
  position: relative;
  z-index: 1003;
  border-radius: 50%;
  cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}

.site-nav-toggle:hover,
.site-nav-toggle:focus-visible {
  background: rgba(74, 139, 196, .12);
}

.site-nav-toggle:focus-visible,
.site-nav a:focus-visible,
.mz-button:focus-visible,
.mz-mobile-action-bar a:focus-visible,
.submenu-toggle:focus-visible {
  outline: 3px solid rgba(22, 121, 187, .42);
  outline-offset: 3px;
}

.site-nav-toggle span:not(.screen-reader-text) {
  transform-origin: center;
  transition: transform .2s ease, opacity .2s ease;
}

.site-nav-toggle[aria-expanded="true"] span:nth-of-type(1) {
  transform: translateY(7px) rotate(45deg);
}

.site-nav-toggle[aria-expanded="true"] span:nth-of-type(2) {
  opacity: 0;
}

.site-nav-toggle[aria-expanded="true"] span:nth-of-type(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.submenu-toggle {
  display: none;
}

.mz-mobile-action-bar {
  display: none;
}

/* Landscape tablets and compact laptops */
@media (max-width: 1500px) {
  :root { --mz-header: 76px; }

  body.nav-open::before {
    content: '';
    position: fixed;
    z-index: 998;
    inset: var(--mz-header) 0 0;
    background: rgba(7, 29, 52, .58);
    backdrop-filter: blur(3px);
  }

  .site-header {
    height: var(--mz-header);
  }

  .site-header__inner {
    gap: 14px;
  }

  .site-header__inner {
    flex-direction: row;
    justify-content: center;
    position: relative;
    padding: 0;
  }

  .site-brand {
    width: auto;
    height: 54px;
  }

  .site-brand img { height: 100%; width: auto; max-width: 250px; }

  .site-nav-toggle {
    display: block;
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
    flex: 0 0 48px;
  }

  .site-nav {
    position: fixed;
    z-index: 1002;
    inset: var(--mz-header) 0 0 auto;
    display: block;
    width: min(430px, 92vw);
    height: calc(var(--mz-vh, 1vh) * 100 - var(--mz-header));
    padding: 26px 28px calc(36px + env(safe-area-inset-bottom));
    overflow-y: auto;
    overscroll-behavior: contain;
    background: rgba(255, 255, 255, .99);
    box-shadow: -24px 30px 70px rgba(7, 29, 52, .22);
    opacity: 0;
    visibility: hidden;
    transform: translateX(104%);
    transition: transform .26s ease, opacity .2s ease, visibility .2s ease;
  }

  .site-nav.is-open {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
  }

  .site-nav__list,
  .site-nav ul {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .site-nav li {
    position: relative;
    width: 100%;
    border-bottom: 1px solid var(--mz-soft);
  }

  .site-nav a {
    display: flex;
    min-height: 54px;
    align-items: center;
    padding: 12px 44px 12px 2px;
    font-size: 1rem;
  }

  .site-nav .current-menu-item > a,
  .site-nav .current_page_item > a {
    color: var(--mz-bright);
  }

  .site-nav .sub-menu {
    display: none;
    padding: 0 0 12px 16px;
    background: var(--mz-offwhite);
  }

  .site-nav .submenu-open > .sub-menu {
    display: block;
  }

  .site-nav .sub-menu li:last-child {
    border-bottom: 0;
  }

  .site-nav .sub-menu a {
    min-height: 48px;
    font-size: .94rem;
  }

  .submenu-toggle {
    position: absolute;
    z-index: 2;
    top: 6px;
    right: 0;
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border: 0;
    border-radius: 50%;
    color: var(--mz-deep);
    background: transparent;
    font-size: 1.35rem;
  }

  .mz-hero {
    min-height: 720px;
    padding-top: calc(var(--mz-header) + 68px);
    padding-bottom: 86px;
  }

  .mz-hero h1 {
    max-width: 780px;
    font-size: clamp(3.5rem, 7.4vw, 5.8rem);
  }

  .mz-hero__lead {
    max-width: 680px;
  }

  .mz-section {
    padding: clamp(84px, 9vw, 118px) 0;
  }

  .mz-project-layout,
  .mz-contact-layout {
    gap: 52px;
  }
}

/* Tablets: portrait and smaller landscape */
@media (max-width: 1024px) {
  .mz-container {
    width: min(calc(100% - 48px), var(--mz-container));
  }

  h1 { font-size: clamp(3rem, 7.8vw, 5.2rem); }
  h2 { font-size: clamp(2.25rem, 5.4vw, 3.8rem); }

  .mz-grid--4,
  .mz-grid--3,
  .mz-post-grid--three,
  .mz-people-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mz-sector-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mz-partner-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mz-card--service {
    min-height: 290px;
  }

  .mz-card__icon {
    margin-bottom: 42px;
  }

  .mz-hero__art {
    opacity: .5;
    background-position: 80% center;
  }

  .site-footer__grid {
    gap: 46px;
  }
}

@media (max-width: 900px) {
  .mz-two-col,
  .mz-project-layout,
  .mz-contact-layout {
    grid-template-columns: 1fr;
  }

  .mz-hero {
    min-height: 700px;
    align-items: flex-end;
  }

  .mz-hero__art {
    opacity: .36;
    background-position: 68% center;
  }

  .mz-hero::after {
    mask-image: linear-gradient(to bottom, transparent, black 48%);
  }

  .mz-hero h1 {
    max-width: 680px;
  }

  .mz-section-heading {
    margin-bottom: 44px;
  }

  .mz-timeline {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    margin-top: 46px;
  }

  .mz-timeline::before {
    display: block;
    top: 16px;
    bottom: 16px;
    left: 29px;
    width: 2px;
    height: auto;
    background: linear-gradient(#8ec7f1, #4a8bc4);
  }

  .mz-timeline__item {
    display: grid;
    grid-template-columns: 60px minmax(0, 1fr);
    gap: 18px;
    min-height: 82px;
    align-items: center;
    padding: 9px 0;
    text-align: left;
  }

  .mz-timeline__item > span {
    width: 58px;
    height: 58px;
    margin: 0;
  }

  .mz-timeline__item h3 {
    margin: 0;
    font-size: 1.08rem;
  }

  .mz-project-facts {
    position: static;
  }

  .site-footer__grid {
    grid-template-columns: 1fr 1fr;
  }

  .site-footer__brand {
    grid-column: 1 / -1;
    max-width: 560px;
  }

  .site-footer__bottom {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}

/* Phones and compact tablets */
@media (max-width: 620px) {
  :root {
    --mz-header: 66px;
    --mz-radius: 14px;
  }

  body {
    font-size: 16px;
  }

  body.has-mz-mobile-action-bar {
    padding-bottom: calc(var(--mz-mobile-bar-height) + env(safe-area-inset-bottom));
  }

  .mz-container {
    width: min(calc(100% - 28px), var(--mz-container));
  }

  .site-header__inner {
    gap: 8px;
  }

  .site-brand {
    width: auto;
    height: 46px;
  }

  .site-brand img { max-width: 200px; }

  .site-nav-toggle {
    right: 2px;
    width: 46px;
    height: 46px;
  }

  .site-nav {
    inset: var(--mz-header) 0 0;
    width: 100%;
    height: calc(var(--mz-vh, 1vh) * 100 - var(--mz-header));
    padding: 18px 20px calc(96px + env(safe-area-inset-bottom));
    box-shadow: none;
  }

  .site-nav a {
    min-height: 56px;
    font-size: 1.02rem;
  }

  h1 { font-size: clamp(2.55rem, 12vw, 3.5rem); }
  h2 { font-size: clamp(2rem, 9vw, 2.85rem); }
  h3 { font-size: 1.28rem; }

  .mz-section {
    padding: 70px 0;
  }

  .mz-section-heading {
    margin-bottom: 34px;
  }

  .mz-section-heading > p:last-child,
  .mz-copy-large {
    font-size: 1.08rem;
  }

  .mz-eyebrow {
    margin-bottom: 16px;
    font-size: .7rem;
    letter-spacing: .13em;
  }

  .mz-grid--4,
  .mz-grid--3,
  .mz-sector-grid,
  .mz-post-grid,
  .mz-post-grid--three,
  .mz-people-grid,
  .mz-partner-grid,
  .mz-form-grid {
    grid-template-columns: 1fr;
  }

  .mz-grid {
    gap: 16px;
  }

  .mz-card {
    padding: 25px;
  }

  .mz-card--numbered > span {
    margin-bottom: 28px;
  }

  .mz-card--service {
    min-height: 0;
  }

  .mz-card__icon {
    margin-bottom: 30px;
  }

  .mz-hero {
    min-height: 650px;
    padding: calc(var(--mz-header) + 52px) 0 68px;
  }

  .mz-hero__art {
    opacity: .26;
    background-position: 62% center;
    background-size: auto 80%;
  }

  .mz-hero__lead {
    margin-bottom: 28px;
    font-size: 1.07rem;
    line-height: 1.55;
  }

  .mz-button-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .mz-button,
  .mz-inline-button {
    width: 100% !important;
    min-height: 52px;
    padding: 13px 18px;
  }

  .mz-sector-grid {
    border: 0;
    gap: 12px;
  }

  .mz-sector {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 16px;
    min-height: 0;
    align-items: center;
    padding: 22px;
    border: 1px solid var(--mz-soft);
    border-radius: var(--mz-radius);
    background: white;
  }

  .mz-sector span {
    width: 34px;
    margin: 0;
  }

  .mz-sector h3 {
    margin: 0;
    font-size: 1.05rem;
  }

  .mz-check-list {
    grid-template-columns: 1fr;
  }

  .mz-ownership::after,
  .mz-intro::after {
    opacity: .045;
  }

  .mz-page-hero {
    padding: calc(var(--mz-header) + 54px) 0 58px;
  }

  .mz-page-hero h1 {
    font-size: clamp(2.45rem, 12vw, 3.4rem);
  }

  .mz-page-hero__lead {
    font-size: 1.08rem;
  }

  .mz-content,
  .mz-post-grid,
  .mz-project-layout,
  .mz-contact-layout {
    padding-top: 54px;
    padding-bottom: 72px;
  }

  .mz-featured-image {
    margin-bottom: 34px;
  }

  .mz-post-card__image {
    height: 210px;
  }

  .mz-post-card__body,
  .mz-person-card__body,
  .mz-contact-panel,
  .mz-project-facts {
    padding: 24px;
  }

  .mz-contact-form input[type="text"],
  .mz-contact-form input[type="email"],
  .mz-contact-form input[type="tel"],
  .mz-contact-form select,
  .mz-contact-form textarea {
    min-height: 48px;
    font-size: 16px;
  }

  .site-footer {
    padding: 70px 0 28px;
  }

  .site-footer__grid,
  .site-footer__bottom {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .site-footer__brand {
    grid-column: auto;
  }

  .site-footer__bottom {
    margin-top: 48px;
  }

  .mz-mobile-action-bar {
    position: fixed;
    z-index: 1200;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    min-height: var(--mz-mobile-bar-height);
    padding: 8px max(10px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
    gap: 8px;
    border-top: 1px solid rgba(15, 47, 81, .12);
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 -12px 36px rgba(7, 29, 52, .14);
    backdrop-filter: blur(16px);
    transition: transform .2s ease, opacity .2s ease;
  }

  .mz-mobile-action-bar.is-keyboard-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(110%);
  }

  .mz-mobile-action-bar a {
    display: flex;
    min-height: 50px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 6px;
    font-size: .84rem;
    font-weight: 800;
    text-decoration: none;
  }

  .mz-mobile-action-bar__call {
    flex: 0 0 34%;
    border: 1px solid var(--mz-soft);
    color: var(--mz-midnight);
    background: var(--mz-offwhite);
  }

  .mz-mobile-action-bar__project {
    flex: 1 1 auto;
    color: white;
    background: var(--mz-gradient);
  }
}

@media (max-width: 390px) {
  .mz-container {
    width: min(calc(100% - 22px), var(--mz-container));
  }

  .site-brand {
    width: 142px;
  }

  .mz-hero {
    min-height: 620px;
  }

  .mz-hero h1,
  .mz-page-hero h1 {
    font-size: 2.35rem;
  }

  .mz-card,
  .mz-sector,
  .mz-post-card__body,
  .mz-contact-panel,
  .mz-project-facts {
    padding: 21px;
  }

  .mz-mobile-action-bar a {
    font-size: .78rem;
  }
}

/* Short landscape phone layouts */
@media (max-width: 900px) and (max-height: 540px) and (orientation: landscape) {
  .site-nav {
    padding-top: 10px;
  }

  .site-nav a {
    min-height: 46px;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .mz-hero {
    min-height: 560px;
    padding-top: calc(var(--mz-header) + 38px);
  }

  .mz-mobile-action-bar {
    display: none;
  }

  body.has-mz-mobile-action-bar {
    padding-bottom: 0;
  }
}

/* WordPress admin bar offsets */
@media (max-width: 782px) {
  .admin-bar .site-header { top: 46px; }
  .admin-bar .site-nav { top: calc(var(--mz-header) + 46px); }
  .admin-bar.nav-open::before { top: calc(var(--mz-header) + 46px); }
}

@media (min-width: 783px) and (max-width: 1500px) {
  .admin-bar .site-header { top: 32px; }
  .admin-bar .site-nav { top: calc(var(--mz-header) + 32px); }
}

@media (prefers-reduced-motion: reduce) {
  .site-nav,
  .site-nav-toggle span,
  .mz-mobile-action-bar {
    transition: none !important;
  }
}
