/* ======================
   Variables
   ====================== */
:root{
  --primary: #0f6fff;
  --dark: #2c3e50;
  --light: #f7f9fc;
  --text: #222;
  --accent: #ff6600;
  --service-icon-size: 80px;
  --service-icon-overhang: calc(var(--service-icon-size) / 2);
}

/* Opt out of auto–dark theming */
html{
  color-scheme: light;
  background-color: #fff;
}
@media (prefers-color-scheme: dark){
  html{ color-scheme: light; }
  body{
    background: #fff;
    color: #222;
  }
}

/* ======================
   Base
   ====================== */
*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin: 0;
  font-family: system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;
  color: var(--text);
  background: #fff;
}
.wrapper{
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.wrapper > *:first-child{ margin-top: 0; }

/* Protect logos/brand images from extension inversion */
.custom-logo, img.no-dark, .logo img{
  filter: none !important;
  mix-blend-mode: normal !important;
}

/* ======================
   Header / Nav
   ====================== */
header{
  position: sticky;
  top: 0;
  z-index: 10000;
  background: var(--dark) !important;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
body.admin-bar header{ top: 0 !important; }
@media (max-width:782px){
  body.admin-bar header{ top:0 !important; }
}
.navbar{
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1rem;
}

/* Logo + Title */
.logo{ display: flex; align-items: center; gap: .5rem; }
.custom-logo,.logo-icon{ height: 36px; width: auto; }
.site-title-link{
  display: flex;
  align-items: center;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.25rem;
}
.site-title-link .logo-highlight{
  color: var(--accent);
  font-weight: 800;
  margin-right: .25rem;
}
.site-title-link .logo-title{ color: #fff; }

/* Menu */
.nav-container{ display: flex; }
.nav-links{
  list-style: none;
  display: flex;
  gap: 1rem;
  margin: 0;
  padding: 0;
}
.nav-links > li > a,
.nav-links .menu-item > a{
  display: inline-block;
  padding: .5rem .75rem;
  border-radius: .5rem;
  text-decoration: none;
  color: #fff;
  transition: color .2s ease;
}
/* Text-only hover/active */
header .nav-links > li > a:hover,
header .nav-links > li > a:focus-visible{
  color: var(--accent) !important;
  background: transparent !important;
}
header .nav-links .current-menu-item > a,
header .nav-links .current_page_item > a,
header .nav-links .current-menu-ancestor > a,
header .nav-links .current_page_ancestor > a,
header .nav-links a[aria-current="page"],
header .nav-links a.active{
  color: var(--accent) !important;
  background: transparent !important;
  font-weight: 700;
}
/* Submenus (desktop) */
.nav-links .menu-item-has-children{ position: relative; }
.nav-links .sub-menu{
  position: absolute;
  left: 0;
  top: calc(100% + .4rem);
  list-style: none;
  margin: 0;
  padding: .4rem;
  min-width: 200px;
  background: #fff;
  border: 1px solid #eaeef3;
  border-radius: .75rem;
  box-shadow: 0 8px 24px rgba(0,0,0,.06);
  display: none;
  z-index: 60;
}
.nav-links .sub-menu li > a{
  display: block;
  padding: .5rem .6rem;
  border-radius: .5rem;
  color: #333;
  text-decoration: none;
}
.nav-links .sub-menu li > a:hover,
.nav-links .sub-menu li > a:focus-visible{
  background: var(--light);
  color: #000;
}
.nav-links .menu-item-has-children:hover > .sub-menu,
.nav-links .menu-item-has-children:focus-within > .sub-menu{
  display: block;
}
@media (prefers-reduced-motion:reduce){
  .nav-links > li > a{ transition:none; }
}

/* Mobile nav */
.nav-toggle{
  display: none;
  margin-left: auto;
  background: none;
  border: 0;
  cursor: pointer;
  padding: .35rem;
  border-radius: .5rem;
}
.nav-toggle:focus-visible{
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.nav-toggle-box{ display: inline-flex; flex-direction: column; gap: 4px; }
.nav-toggle-bar{ width: 22px; height: 2px; background: #fff; display: block; }
@media (max-width:768px){
  header{ position:relative; }
  .navbar{
    position: sticky;
    top: 0;
    z-index: 10000;
    background: var(--dark);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .logo{
    width: 100%;
    padding: .5rem 0;
    border-bottom: 1px solid rgba(255,255,255,.08);
  }
  .nav-toggle{ display: inline-flex; margin-left: auto; }
  .nav-container{ width: 100%; }
  .nav-links{
    display: none;
    flex-direction: column;
    gap: .25rem;
    padding: .5rem;
    background: var(--dark);
    border-radius: .75rem;
  }
  .nav-links.is-open{ display: flex; }
  .nav-links .menu-item-has-children{ position: static; }
  .nav-links .sub-menu{
    position: static;
    display: none;
    margin: .25rem 0 .25rem 1rem;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
  }
  .nav-links .menu-item-has-children.open > .sub-menu{ display: block; }
}

/* Block Navigation (Site Editor) */
.wp-block-navigation .wp-block-navigation-item__content{
  padding: .5rem .75rem;
  border-radius: .5rem;
  background: transparent !important;
}
.wp-block-navigation .wp-block-navigation-item__content:hover,
.wp-block-navigation .wp-block-navigation-item__content:focus-visible,
.wp-block-navigation .wp-block-navigation-item__content[aria-current="page"]{
  background: transparent !important;
  color: var(--accent) !important;
}

/* ======================
   Hero
   ====================== */
.hero{
  position: relative;
  display: grid;
  place-items: center;
  min-height: 60vh;
  background: linear-gradient(135deg, rgba(15,111,255,.15), rgba(14,27,44,.15)),
    var(--nlb-hero, url('assets/imgs/hero-placeholder.jpg')) center/cover no-repeat;
}
.hero-overlay{
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.35), rgba(0,0,0,.35));
}
.hero-content{
  position: relative;
  text-align: center;
  color: #fff;
  padding: 4rem 1rem;
  max-width: 900px;
}
.hero-content h1{
  font-size: clamp(2rem,5vw,3.2rem);
  margin: .25rem 0 0;
}
.hero-content p{
  font-size: clamp(1rem,3vw,1.25rem);
  opacity: .95;
  margin: .5rem 0 1.25rem;
}
.btn-primary{
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  padding: .8rem 1.1rem;
  border-radius: .75rem;
  display: inline-block;
  font-weight: 600;
}
.btn-primary:hover{ transform: translateY(-1px); }

/* Typing caret */
.typing::after{
  content: "|";
  margin-left: 2px;
  animation: blink 1s step-end infinite;
}
@keyframes blink{ 50%{ opacity:0; } }

/* ======================
   Services
   ====================== */
.services{
  background: #fff;
  padding: calc(3rem + var(--service-icon-overhang) + 8px) 1rem 3rem;
}
.services-container{
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(260px,1fr));
  gap: 1.25rem;
}
.service-item{
  position: relative;
  background: var(--light);
  border: 1px solid #eaeef3;
  border-radius: 1rem;
  padding-top: calc(var(--service-icon-overhang) + 1rem);
  padding-inline: 1.25rem;
  padding-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  overflow: visible;
}
.service-icon{
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
  height: var(--service-icon-size);
  width: var(--service-icon-size);
  object-fit: contain;
  display: block;
  z-index: 2;
}
.service-item h3{ margin: .25rem 0 .5rem; }
.service-item p{ line-height: 1.6; }

/* ======================
   Two-column content (Kitchens/Bathrooms/Contact)
   ====================== */
.flex-grid{
  max-width: 1200px;
  margin: clamp(1.5rem, 4vw, 3rem) auto;
  padding: 0 1rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
@media (min-width:900px){
  .flex-grid{ grid-template-columns: 1fr 1.2fr; align-items:start; column-gap:2rem; row-gap:2rem; }
}
.flex-item.text-block{
  background: var(--light);
  border: 1px solid #eaeef3;
  border-radius: 1rem;
  box-shadow: 0 8px 24px rgba(0,0,0,.06);
  padding: 1.25rem 1.5rem;
  justify-self: stretch;
  width: 100%;
  text-align: center;
}
.flex-item.text-block h2{ margin: .25rem 0 .5rem; }

/* ======================
   Gallery card
   ====================== */
.flex-item.gallery-block{ margin-top: 2rem; }
@media (min-width:900px){
  .flex-item.gallery-block{ margin-top:0; }
}
.gallery-block .gallery-card{
  background: var(--light);
  border: 1px solid #eaeef3;
  border-radius: 1rem;
  box-shadow: 0 8px 24px rgba(0,0,0,.06);
  padding: 1rem 1rem 1.25rem;
  overflow: hidden;
  margin-top: .25rem;
}
.gallery-block .gallery-card h2{
  text-align: center;
  margin: 0 0 .75rem;
}

/* Viewer */
.gallery-card .main-view{
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 320px;
  max-height: 70vh;
  background: #000;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: .75rem;
  overflow: hidden;
  margin-bottom: .75rem;
}
.gallery-card .main-view img{
  display: block;
  max-width: 100%;
  height: auto;
  max-height: 70vh;
  margin: 0 auto;
}
.gallery-card .main-view:empty{
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Viewer controls */
.viewer-btn{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,.45);
  color: #fff;
  border: 0;
  padding: .45rem .6rem;
  font-size: 1.6rem;
  line-height: 1;
  border-radius: .5rem;
  cursor: pointer;
}
.viewer-btn:hover{ background: rgba(0,0,0,.7); }
.viewer-prev{ left: .5rem; }
.viewer-next{ right: .5rem; }

/* Caption */
.gallery-card .main-caption{
  margin: .75rem auto 1rem;
  padding: .75rem 1rem;
  max-width: 900px;
  text-align: center;
  font-size: .95rem;
  color: #334155;
  background: #fff;
  border: 1px solid #eaeef3;
  border-radius: .75rem;
  box-shadow: 0 8px 24px rgba(0,0,0,.05);
}
.gallery-card .main-caption.is-empty{ display: none; }

/* Thumbs */
.gallery-card .thumb-strip{
  display: grid !important;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  gap: .5rem;
  z-index: 1;
}
.gallery-card .thumb-scroll{
  position: static !important;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: .5rem;
  background: rgba(0,0,0,.08);
  color: #333;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.gallery-card .thumb-scroll:hover{ background: rgba(0,0,0,.16); }
.gallery-card .thumb-track{
  position: relative;
  display: flex;
  flex-wrap: nowrap;
  gap: .5rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding: .25rem;
  scroll-behavior: smooth;
}
.gallery-card .thumb{
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: .5rem;
  cursor: pointer;
}
.gallery-card .thumb img{
  display: block;
  width: 110px;
  height: 70px;
  object-fit: cover;
  border-radius: .5rem;
  opacity: .95;
  background: #eee;
}
.gallery-card .thumb.is-active img{
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  opacity: 1;
}

/* Hide plugin/core gallery markup only when enhanced */
.gallery-card.nlb-enhanced .foogallery,
.gallery-card.nlb-enhanced .foogallery-container,
.gallery-card.nlb-enhanced .foogallery-gallery,
.gallery-card.nlb-enhanced .fg-gallery,
.gallery-card.nlb-enhanced .fg-grid,
.gallery-card.nlb-enhanced .fg-item,
.gallery-card.nlb-enhanced .gallery,
.gallery-card.nlb-enhanced .wp-block-gallery,
.gallery-card.nlb-enhanced figure.wp-block-gallery{
  display: none !important;
}

/* Lightbox safety */
.pswp__img{ max-width: 85vw !important; max-height: 85vh !important; }

/* ======================
   Footer
   ====================== */
footer{
  background: var(--dark);
  color: #fff;
  margin-top: auto;
}
.footer-container{
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: center;
  justify-content: space-between;
}
.footer-container a{
  color: #fff;
  text-decoration: none;
}
.footer-container a:hover{
  text-decoration: underline;
  color: var(--accent);
}

/* ======================
   Mobile tweaks
   ====================== */
@media (max-width: 768px){
  .flex-grid{ padding: 0 .75rem; gap: 1.25rem; }
  .flex-item.text-block{ padding: 1rem; }
  .gallery-block .gallery-card{ padding: .75rem; }
  .gallery-card .main-view{
    aspect-ratio: 4 / 3;
    min-height: clamp(180px, 52vw, 260px);
    max-height: 55vh;
    border-radius: .5rem;
  }
  .viewer-btn{ font-size: 1.2rem; padding: .35rem .5rem; }
  .viewer-prev{ left: .35rem; }
  .viewer-next{ right: .35rem; }
  .gallery-card .main-caption{
    margin: .5rem 0 .75rem;
    padding: .6rem .75rem;
    font-size: .9rem;
    border-radius: .5rem;
  }
  .gallery-card .thumb-strip{ grid-template-columns: 32px 1fr 32px; gap: .4rem; }
  .gallery-card .thumb-scroll{ width: 32px; height: 32px; }
  .gallery-card .thumb-track{ padding: .2rem; gap: .4rem; }
  .gallery-card .thumb img{ width: 88px; height: 56px; }
  html, body{ overflow-x: hidden; }
  .gallery-card, .gallery-inner{ max-width: 100%; }
}

/* ======================
   Contact page
   ====================== */
/* Hide hero CTA only on the Contact template */
.page-template-contact .hero .btn-primary{ display: none !important; }

/* Contact grid */
.contact-grid{ max-width: 1400px; }
/* Keep default split (used elsewhere), but Contact override below can collapse it */
@media (min-width:900px){
  .contact-grid{
    grid-template-columns: 1.7fr 1fr;
    column-gap: 2rem;
    padding-inline: 1rem;
    align-items: start;
  }
}

.contact-grid .text-block{
  width: 100%;
  justify-self: stretch;
  display: block;
  height: auto;
}

/* Contact details column */
.contact-grid .contact-side{ text-align: left; }
.contact-grid .contact-side h2{ text-align: center; }

/* Contact lines */
.text-block .contact-line{
  font-size: 1.05rem;
  margin: .5rem 0;
}
.text-block .contact-line a{ color: inherit; text-decoration: none; }
.text-block .contact-line a:hover{ color: var(--accent); text-decoration: underline; }

/* Areas heading outside the card */
.contact-side .areas-title{
  text-align: center;
  font-size: clamp(1.1rem, 2.2vw, 1.35rem);
  margin: 1rem 0 .5rem;
  color: #1f2937;
  font-weight: 700;
}

/* Areas white overlay card */
.areas-card{
  margin-top: .25rem;
  padding: .9rem 1rem;
  background: rgba(255,255,255,.95);
  border: 1px solid #eaeef3;
  border-radius: .75rem;
  box-shadow: 0 10px 24px rgba(0,0,0,.06);
  backdrop-filter: blur(2px);
}
.areas-card .areas-list{
  list-style: disc inside;
  margin: 0;
  text-align: left;
}
.areas-card .areas-list li{
  margin: .25rem 0;
  line-height: 1.5;
}
.areas-card .areas-list li::marker{ color: var(--accent); font-size: .9em; }

/* ======================
   Contact template overrides (scoped; won’t affect other pages)
   ====================== */

/* Center & widen the single card on the Contact template */
.page-template-contact .contact-grid .contact-side.full-width{
  grid-column: 1 / -1;
  justify-self: center;
  margin-inline: auto;
  max-width: 1000px; /* adjust as needed */
  width: 100%;
}

/* If Contact has only one card, collapse to one column so it doesn’t sit in a split grid */
@media (min-width: 900px){
  .page-template-contact .contact-grid{
    grid-template-columns: 1fr;
    justify-items: center;
  }
}
/* Contact: place Phone + Email on one line with spacing */
.page-template-contact .contact-side .contact-inline{
  display: flex;
  justify-content: space-between;   /* spacing between the two items */
  align-items: center;
  gap: 2rem;                        /* extra breathing room */
  flex-wrap: wrap;                  /* allow wrap on small screens */
}

.page-template-contact .contact-side .contact-inline .contact-line{
  display: flex;
  align-items: baseline;
  gap: .4rem;                       /* space between label and value */
  margin: .25rem 0;
  white-space: nowrap;              /* keep each pair on one line */
}

/* Optional: ensure they stay side-by-side on medium+ screens */
@media (min-width: 640px){
  .page-template-contact .contact-side .contact-inline .contact-line{
    flex: 1 1 0;
  }
}
.page-template-contact .contact-grid .flex-item.text-block{
  justify-self: center; /* overrides the global stretch */
}
/* Contact page: unique card layout */
.page-template-contact .contact-card{
  grid-column: 1 / -1;
  justify-self: center;
  margin-inline: auto;
  max-width: 1000px; /* adjust as needed */
  width: 100%;
}

/* Phone + Email on one line with spacing (wraps on small screens) */
.page-template-contact .contact-card .contact-inline{
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}
.page-template-contact .contact-card .contact-inline .contact-line{
  display: flex;
  align-items: baseline;
  gap: .4rem;
  margin: .25rem 0;
  white-space: nowrap;
}

/* Optional: if you want this page to be single-column */
@media (min-width: 900px){
  .page-template-contact .contact-grid{
    grid-template-columns: 1fr;
    justify-items: center;
  }
}
