/*
 * Mac's Electric Ltd — Cassiopeia site stylesheet
 * Version: 1.1.0
 * Joomla 6 / Cassiopeia
 *
 * CLEAN ACCEPTED BASELINE
 * Consolidated from the accepted v1.0.34 visual baseline.
 * Historical override layers have been removed.
 *
 * Accepted states preserved:
 *   - Home desktop
 *   - Interior desktop
 *   - Home mobile portrait
 *   - Interior mobile portrait
 *   - Interior phone landscape
 */

:root {
  --macs-header: #414b62;
  --macs-red: #d65a5a;
  --macs-red-dark: #a93636;
  --macs-page-width: 1510px;
}

/* ==================================================
   BASE HEADER / NAVIGATION
   ================================================== */
.container-header {
  position: relative;
  z-index: 10;
  padding: 0;
  background: var(--macs-header);
  background-image: none;
  border-bottom: 14px solid var(--macs-red);
  box-shadow: none;
}

.container-header .container-nav {
  display: block;
  width: 100%;
  max-width: var(--macs-page-width);
  margin: 0 auto;
  padding: 10px 12px 16px;
}

.macs-site-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 10px;
  margin: 0 0 18px;
  padding: 16px 12px 0;
  color: #fff;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 34px;
  font-weight: 300;
  line-height: 1.15;
}

.macs-site-title a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.macs-site-title a:hover,
.macs-site-title a:focus {
  color: #fff;
  text-decoration-thickness: 2px;
}

.container-header .navbar-brand {
  margin: 0;
  padding: 0;
  color: #fff;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 40px;
  font-weight: 300;
  line-height: 1.15;
}

.container-header .mod-menu {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 28px;
  margin: 0;
  padding: 0 0 0 12px;
}

.container-header .mod-menu > li {
  margin: 0;
  padding: 0;
}

.container-header .mod-menu > li > a {
  display: block;
  padding: 0 0 8px;
  color: #fff;
  border-bottom: 3px solid transparent;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  text-transform: uppercase;
}

.container-header .mod-menu > li > a:hover,
.container-header .mod-menu > li.active > a,
.container-header .mod-menu > li.current > a {
  color: #fff;
  border-bottom-color: #ef7777;
}

.container-header .container-search {
  margin-left: auto;
}

.container-header .container-search a,
.container-header .container-search button,
.container-header .container-search .icon-search {
  color: #fff;
}

.macs-menu-toggle {
  display: none;
}

/* ==================================================
   DESKTOP — 768px AND UP
   ================================================== */
@media (min-width: 768px) {

  /* ---------- HOME DESKTOP ---------- */
  .itemid-101 .container-header .container-topbar {
    display: flex;
    width: max-content;
    max-width: calc(100% - 40px);
    margin: 0 auto;
    padding: 16px 0 0;
  }

  .itemid-101 .macs-site-title {
    width: max-content;
    max-width: 100%;
    margin: 0;
    padding: 0;
  }

  .itemid-101 .container-header .container-nav {
    display: flex;
    width: max-content;
    max-width: calc(100% - 40px);
    margin: 18px auto 0;
    padding: 0 0 10px;
  }

  .itemid-101 .container-header .mod-menu {
    display: flex;
    width: 100%;
    justify-content: space-between;
    gap: clamp(28px, 4vw, 64px);
    margin: 0;
    padding: 0;
  }

  /* ---------- INTERIOR DESKTOP ---------- */
  body:not(.itemid-101) .container-header {
    position: relative;
    min-height: 160px;
    padding-left: 225px;
    overflow: visible;
    border-bottom: 0;
  }

  body:not(.itemid-101) .container-header::before {
    position: absolute;
    top: -52px; /* EDIT DESKTOP LOGO UP/DOWN HERE */
    left: max(10px, calc((100% - var(--macs-page-width)) / 2 + 10px));
    width: 214px; /* EDIT DESKTOP LOGO SIZE HERE */
    height: 214px;
    background: url("/images/macs/macslogotrans.gif") center / contain no-repeat;
    content: "";
    pointer-events: none;
    z-index: 30;
  }

  body:not(.itemid-101) .container-header::after {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 14px;
    background: var(--macs-red);
    content: "";
    pointer-events: none;
    z-index: 5;
  }

  body:not(.itemid-101) .container-header .container-topbar,
  body:not(.itemid-101) .container-header .container-nav {
    position: relative;
    left: -70px;
    box-sizing: border-box;
    width: max-content;
    max-width: calc(100% - 245px);
    margin-right: auto;
    margin-left: auto;
    padding-right: 0;
    padding-left: 0;
    z-index: 20;
  }

  body:not(.itemid-101) .container-header .container-topbar {
    display: flex;
    padding-top: 14px;
    transform: translateY(17px); /* EDIT DESKTOP CONTACT UP/DOWN HERE */
  }

  body:not(.itemid-101) .macs-site-title {
    width: max-content;
    max-width: 100%;
    margin: 0;
    padding: 0;
    font-size: 38px;
    text-align: center;
  }

  body:not(.itemid-101) .container-header .container-nav {
    display: flex;
    margin-top: 16px;
    padding-bottom: 10px;
    transform: translateY(20px); /* EDIT DESKTOP MENU UP/DOWN HERE */
  }

  body:not(.itemid-101) .container-header .mod-menu {
    display: flex;
    width: 100%;
    justify-content: space-between;
    gap: clamp(24px, 3vw, 54px);
    margin: 0;
    padding: 0;
  }
}

/* ==================================================
   SKYLINE / HERO
   ================================================== */
.container-banner {
  position: relative;
  z-index: 1;
  width: 100%;
  margin: -42px 0 -42px;
  padding: 0;
}

.container-banner > div,
.container-banner .moduletable,
.container-banner .mod-custom {
  width: 100%;
  margin: 0;
  padding: 0;
}

.macs-hero {
  position: relative;
  width: calc(100% - 120px);
  max-width: var(--macs-page-width);
  margin: 0 auto;
  overflow: hidden;
  background: #050507;
}

.macs-hero-background {
  display: block;
  width: 100%;
  height: auto;
  margin-top: -18px;
}

.macs-hero-logo {
  position: absolute;
  z-index: 2;
  top: calc(9% - 18px);
  left: 3.2%;
  width: 18%;
  min-width: 150px;
  max-width: 270px;
  height: auto;
}

/* ==================================================
   ANNIVERSARY BAND
   ================================================== */
.container-top-a {
  max-width: var(--macs-page-width);
  margin: 52px auto 30px;
  padding: 0;
}

.container-top-a > * {
  margin: 0;
}

.macs-celebrating {
  position: relative;
  padding: 32px 20px;
  background: #f1f1f1;
  color: #111;
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(28px, 2.4vw, 42px);
  font-weight: 400;
  line-height: 1.2;
  text-align: center;
}

.macs-celebrating::after {
  position: absolute;
  bottom: -28px;
  left: 34px;
  width: 0;
  height: 0;
  border-top: 28px solid #f1f1f1;
  border-right: 28px solid transparent;
  border-left: 28px solid transparent;
  content: "";
}

/* ==================================================
   BREADCRUMBS / LINKS / SERVICES
   ================================================== */
.container-breadcrumbs {
  margin-top: 0;
  margin-bottom: 20px;
}

a,
a:visited {
  color: var(--macs-red);
}

a:hover,
a:focus {
  color: var(--macs-red-dark);
}

.container-header a,
.container-header a:visited,
.container-header a:hover,
.container-header a:focus {
  color: #fff;
}

.container-sidebar-right a,
.sidebar-right a,
.card.services-menu a {
  color: var(--macs-red);
  text-decoration: none;
}

.container-sidebar-right a:hover,
.container-sidebar-right a:focus,
.sidebar-right a:hover,
.sidebar-right a:focus,
.card.services-menu a:hover,
.card.services-menu a:focus {
  color: var(--macs-red-dark);
  text-decoration: underline;
}

/* ==================================================
   ARTICLE INTRO IMAGES
   ================================================== */
.com-content-article .item-image,
.com-content-article__body .item-image {
  float: left;
  width: auto;
  max-width: 48%;
  margin: 0 20px 20px 0;
}

.com-content-article .item-image img,
.com-content-article__body .item-image img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 0;
}

.com-content-article__body > p:first-child img,
.com-content-article__body > img:first-child {
  float: left !important;
  width: auto !important;
  max-width: 48% !important;
  height: auto !important;
  margin: 0 20px 20px 0 !important;
}

.com-content-article__body::after {
  display: block;
  clear: both;
  content: "";
}

/* ==================================================
   JOOMGALLERY
   ================================================== */
.item_fields h3 {
  display: none !important;
}

/* ==================================================
   TABLET / NARROW DESKTOP SUPPORT
   ================================================== */
@media (max-width: 991px) {
  .container-header {
    border-bottom-width: 12px;
  }

  .container-header .container-nav {
    padding-right: 12px;
    padding-bottom: 13px;
  }

  .macs-site-title,
  .container-header .navbar-brand {
    font-size: 28px;
  }

  .container-header .mod-menu {
    gap: 22px;
  }

  .container-header .mod-menu > li > a {
    font-size: 15px;
  }

  .macs-hero {
    width: 100%;
  }

  .macs-hero-logo {
    top: calc(7% - 18px);
    width: 23%;
  }
}

/* ==================================================
   MOBILE PORTRAIT / <= 767px
   ================================================== */
@media (max-width: 767px) {

  .container-header,
  .itemid-101 .container-header,
  body:not(.itemid-101) .container-header {
    position: relative;
    min-height: 0;
    margin: 0;
    padding: 12px 92px 12px 16px;
    overflow: visible;
    border-bottom: 12px solid var(--macs-red);
  }

  .container-header .container-topbar,
  body:not(.itemid-101) .container-header .container-topbar {
    display: flex;
    width: 100%;
    min-height: 88px;
    margin: 0;
    padding: 0;
    align-items: center;
    transform: none;
  }

  /* ---------- HOME MOBILE ---------- */
  .macs-site-title {
    display: grid;
    grid-template-columns: auto auto auto;
    grid-template-areas:
      "company company company"
      "phone separator email";
    width: max-content;
    max-width: 100%;
    min-height: 0;
    margin: 0;
    padding: 0;
    gap: 8px 6px;
    align-items: baseline;
    align-content: center;
    justify-content: start;
    font-size: 18px;
    line-height: 1;
    text-align: left;
  }

  .macs-site-title .macs-company {
    grid-area: company;
    display: block;
    font-size: clamp(30px, 5.1vw, 38px);
    line-height: 1;
    white-space: nowrap;
  }

  .macs-site-title .macs-phone {
    grid-area: phone;
  }

  .macs-site-title .macs-contact-separator {
    grid-area: separator;
    display: block;
  }

  .macs-site-title .macs-email {
    grid-area: email;
  }

  .macs-site-title .macs-phone,
  .macs-site-title .macs-contact-separator,
  .macs-site-title .macs-email {
    font-size: clamp(16px, 2.55vw, 19px);
    line-height: 1;
    white-space: nowrap;
  }

  .itemid-101 .container-header {
    padding-left: 16px;
  }

  .itemid-101 .container-banner {
    margin-top: -30px; /* EDIT HOME MOBILE HERO UP/DOWN HERE */
    margin-bottom: 10px;
  }

  .itemid-101 .macs-hero {
    width: 100%;
    margin: 0;
    overflow: hidden;
  }

  .itemid-101 .macs-hero-background {
    margin-top: 0;
  }

  .itemid-101 .macs-hero-logo {
    top: 6%;
    left: 3%;
    width: 27%;
    min-width: 115px;
    max-width: 165px;
  }

  /* ---------- INTERIOR MOBILE PORTRAIT ---------- */
  body:not(.itemid-101) .container-header {
    box-sizing: border-box;
    min-height: 122px;
    padding: 10px 72px 10px 108px;
  }

  body:not(.itemid-101) .container-header::before {
    content: "";
    display: block;
    position: absolute;
    top: 7px; /* EDIT PORTRAIT LOGO UP/DOWN HERE */
    left: 8px;
    width: 92px; /* EDIT PORTRAIT LOGO SIZE HERE */
    height: 108px;
    background: url("/images/macs/macslogotrans.gif") center / contain no-repeat;
    pointer-events: none;
    z-index: 30;
  }

  body:not(.itemid-101) .container-header .container-topbar {
    min-height: 102px;
  }

  body:not(.itemid-101) .macs-site-title {
    display: flex;
    width: auto;
    max-width: 100%;
    margin: 0;
    padding: 0;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 5px;
    color: #fff;
    line-height: 1.05;
    text-align: left;
    transform: translateX(25px); /* EDIT PORTRAIT TEXT POSITION HERE */
  }

  body:not(.itemid-101) .macs-site-title .macs-company {
    display: block;
    font-size: 32px; /* EDIT PORTRAIT COMPANY SIZE HERE */
    font-weight: 700;
    line-height: 1.05;
    white-space: nowrap;
  }

  body:not(.itemid-101) .macs-site-title .macs-phone,
  body:not(.itemid-101) .macs-site-title .macs-email {
    display: block;
    font-size: 17.6px;
    line-height: 1.05;
    white-space: nowrap;
  }

  body:not(.itemid-101) .macs-site-title .macs-contact-separator {
    display: none;
  }

  /* ---------- MOBILE HAMBURGER / DROPDOWN ---------- */
  .container-header .container-nav,
  .itemid-101 .container-header .container-nav,
  body:not(.itemid-101) .container-header .container-nav {
    position: absolute;
    top: 50%;
    right: 12px;
    left: auto;
    display: block;
    width: 48px;
    max-width: none;
    min-height: 0;
    margin: 0;
    padding: 0;
    transform: translateY(-50%);
    z-index: 50;
  }

  .macs-menu-toggle,
  body:not(.itemid-101) .macs-menu-toggle {
    display: inline-flex;
    width: 48px;
    height: 48px;
    margin: 0;
    padding: 0;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255,255,255,.72);
    border-radius: 4px;
    font-size: 27px;
    line-height: 1;
    cursor: pointer;
  }

  .macs-menu-toggle:hover,
  .macs-menu-toggle:focus {
    background: rgba(255,255,255,.10);
    color: #fff;
  }

  .container-header .container-nav .mod-menu,
  body:not(.itemid-101) .container-header .container-nav .mod-menu {
    position: absolute;
    top: calc(100% + 14px);
    right: -12px;
    display: none !important;
    width: min(320px, calc(100vw - 28px));
    margin: 0;
    padding: 8px 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--macs-header);
    box-shadow: 0 8px 18px rgba(0,0,0,.22);
    z-index: 100;
  }

  .container-header.macs-menu-open .container-nav .mod-menu,
  body:not(.itemid-101) .container-header.macs-menu-open .container-nav .mod-menu {
    display: flex !important;
  }

  .container-header .mod-menu > li {
    width: 100%;
  }

  .container-header .mod-menu > li > a {
    width: 100%;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255,255,255,.18);
    font-size: 15px;
  }

  .container-header .mod-menu > li > a:hover,
  .container-header .mod-menu > li.active > a,
  .container-header .mod-menu > li.current > a {
    background: rgba(255,255,255,.08);
    border-bottom-color: rgba(255,255,255,.18);
  }

  /* ---------- MOBILE CONTENT ---------- */
  .macs-hero-background {
    margin-top: 0;
  }

  .macs-hero-logo {
    top: 6%;
    left: 3%;
    width: 27%;
    min-width: 115px;
    max-width: 165px;
  }

  .container-top-a {
    margin: 52px auto 30px;
  }

  .macs-celebrating {
    padding: 24px 15px;
  }

  .macs-celebrating::after {
    bottom: -18px;
    left: 20px;
    border-top-width: 18px;
    border-right-width: 18px;
    border-left-width: 18px;
  }

  .com-content-article .item-image,
  .com-content-article__body .item-image,
  .com-content-article__body > p:first-child img,
  .com-content-article__body > img:first-child {
    float: none !important;
    width: auto !important;
    max-width: 100% !important;
    margin: 0 auto 20px !important;
  }
}

/* ==================================================
   VERY NARROW PORTRAIT PHONES — <= 420px
   Accepted portrait tuning.
   ================================================== */
@media (max-width: 420px) {

  body:not(.itemid-101) .container-header {
    padding-left: 98px;
    padding-right: 64px;
  }

  body:not(.itemid-101) .container-header::before {
    left: 6px;
    width: 96px; /* EDIT NARROW PORTRAIT LOGO SIZE HERE */
  }

  body:not(.itemid-101) .macs-site-title .macs-company {
    font-size: 26px; /* EDIT NARROW PORTRAIT COMPANY SIZE HERE */
  }

  body:not(.itemid-101) .macs-site-title .macs-phone {
    font-size: 32px; /* EDIT NARROW PORTRAIT PHONE SIZE HERE */
  }

  body:not(.itemid-101) .macs-site-title .macs-email {
    font-size: 20px; /* EDIT NARROW PORTRAIT EMAIL SIZE HERE */
  }

  body:not(.itemid-101) .container-header .container-nav {
    right: 9px; /* EDIT NARROW PORTRAIT HAMBURGER POSITION HERE */
    width: 46px;
  }

  body:not(.itemid-101) .macs-menu-toggle {
    width: 46px;
    height: 46px;
  }
}

/* ==================================================
   PHONE LANDSCAPE
   Accepted v1.0.34 visual geometry.
   Portrait rules above remain untouched.

   Target:
      [logo]   Macs Electric Ltd | 604 512 4178   [menu]
               info@macselectric.ca
   ================================================== */
@media (orientation: landscape) and (max-height: 600px) {

  body:not(.itemid-101) .container-header {
    position: relative;
    box-sizing: border-box;
    min-height: 122px; /* EDIT LANDSCAPE HEADER HEIGHT HERE */
    margin: 0;
    padding: 10px 78px 10px 128px;
    overflow: visible;
    border-bottom: 12px solid var(--macs-red);
  }

  body:not(.itemid-101) .container-header::before {
    content: "";
    display: block;
    position: absolute;
    top: -28px; /* EDIT LANDSCAPE LOGO UP/DOWN HERE */
    left: 10px; /* EDIT LANDSCAPE LOGO LEFT/RIGHT HERE */
    width: 152px; /* EDIT LANDSCAPE LOGO SIZE HERE */
    height: 148px; /* EDIT LANDSCAPE LOGO HEIGHT HERE */
    background: url("/images/macs/macslogotrans.gif") center / contain no-repeat;
    pointer-events: none;
    z-index: 30;
  }

  body:not(.itemid-101) .container-header::after {
    display: none;
  }

  body:not(.itemid-101) .container-header .container-topbar {
    position: relative;
    left: auto;
    display: flex;
    width: 100%;
    max-width: none;
    min-height: 102px;
    margin: 0;
    padding: 0;
    align-items: center;
    justify-content: center;
    transform: none;
    z-index: 20;
  }

  body:not(.itemid-101) .macs-site-title {
    display: grid;
    width: max-content;
    max-width: 100%;
    margin: 0;
    padding: 0;
    grid-template-columns: auto auto auto;
    grid-template-areas:
      "company separator phone"
      "email email email";
    column-gap: 12px; /* EDIT LANDSCAPE TOP-LINE SPACING HERE */
    row-gap: 8px; /* EDIT LANDSCAPE LINE SPACING HERE */
    align-items: baseline;
    justify-content: center;
    color: #fff;
    line-height: 1;
    text-align: center;
    transform: none;
  }

  body:not(.itemid-101) .macs-site-title .macs-company {
    grid-area: company;
    display: block;
    font-size: 27px; /* EDIT LANDSCAPE COMPANY SIZE HERE */
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
  }

  body:not(.itemid-101) .macs-site-title .macs-contact-separator {
    display: none;
  }

  body:not(.itemid-101) .macs-site-title .macs-contact-separator:first-of-type {
    grid-area: separator;
    display: block;
    font-size: 27px; /* EDIT LANDSCAPE SEPARATOR SIZE HERE */
    line-height: 1;
    white-space: nowrap;
  }

  body:not(.itemid-101) .macs-site-title .macs-phone {
    grid-area: phone;
    display: block;
    font-size: 27px; /* EDIT LANDSCAPE PHONE SIZE HERE */
    line-height: 1;
    white-space: nowrap;
  }

  body:not(.itemid-101) .macs-site-title .macs-email {
    grid-area: email;
    display: block;
    width: 100%;
    font-size: 36px; /* EDIT LANDSCAPE EMAIL SIZE HERE */
    line-height: 1;
    white-space: nowrap;
    text-align: center;
  }

  body:not(.itemid-101) .container-header .container-nav {
    position: absolute;
    top: 50%;
    right: 14px; /* EDIT LANDSCAPE HAMBURGER POSITION HERE */
    left: auto;
    display: block;
    width: 46px;
    max-width: none;
    min-height: 0;
    margin: 0;
    padding: 0;
    transform: translateY(-50%);
    z-index: 50;
  }

  body:not(.itemid-101) .macs-menu-toggle {
    display: inline-flex;
    width: 46px; /* EDIT LANDSCAPE HAMBURGER SIZE HERE */
    height: 46px;
    margin: 0;
    padding: 0;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255,255,255,.72);
    border-radius: 4px;
    font-size: 27px;
    line-height: 1;
    cursor: pointer;
  }

  body:not(.itemid-101) .container-header .container-nav .mod-menu {
    position: absolute;
    top: calc(100% + 14px);
    right: -14px;
    display: none !important;
    width: min(320px, calc(100vw - 28px));
    margin: 0;
    padding: 8px 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--macs-header);
    box-shadow: 0 8px 18px rgba(0,0,0,.22);
    z-index: 100;
  }

  body:not(.itemid-101) .container-header.macs-menu-open .container-nav .mod-menu {
    display: flex !important;
  }

  body:not(.itemid-101) .container-header .mod-menu > li {
    width: 100%;
  }

  body:not(.itemid-101) .container-header .mod-menu > li > a {
    width: 100%;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255,255,255,.18);
    font-size: 15px;
  }
}
