/* /css/header.css
   Starweb Prohost — Header/Nav stylesheet
   Scope: fixed nav bar, logo, desktop links, dropdown, hamburger, mobile menu
*/
:root {
  --nav-h: 96px;
  --muted: #c5cbd3;
}

/* ------------------------------
   1) Wrapper + container
------------------------------ */
.nav-wrapper{
  position:fixed;
  inset:0 0 auto 0;
  z-index:50;

  /* HOMEPAGE (transparent mode) */
  background:linear-gradient(180deg, rgba(10,26,51,.92), rgba(10,26,51,0));
  backdrop-filter:saturate(120%) blur(4px);
  transition:background .3s ease, backdrop-filter .3s ease;
}

/* SOLID MODE for light pages */
.nav-wrapper.solid-nav{
  background:var(--blue);
  backdrop-filter:none;
  box-shadow:0 2px 8px rgba(0,0,0,.15);
}

/* Grid layout: logo | links (centered) | right actions
   Lock lane height to --nav-h so the header height never changes */
.nav2-container{
  max-width:1440px;
  margin:0 auto;
  height:var(--nav-h);              /* fixed lane height */
  padding:0 20px;
  display:grid;
  grid-template-columns:auto 1fr auto;
  align-items:center;
  column-gap:56px;
  overflow:visible;
  position:relative;                /* allows logo to be absolutely positioned */
}

/* ------------------------------
   2) Branding (image-only logo)
------------------------------ */
.logo {
  position: relative;
  display: block;
  width: 190px;                    /* wider for the new horizontal logo */
  height: var(--nav-h);            /* keep full clickable height */
  overflow: visible;

  /* anti-flicker layer */
  transform: translateZ(0);
  backface-visibility: hidden;
}

.logo-img {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  height: auto;                    /* allow natural proportions */
  width: 100%;                     /* scale to the .logo width */
  max-height: 80px;                /* prevents overflow on tall screens */
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.45));
  z-index: 1;
  object-fit: contain;             /* maintain ratio within the width box */

  /* halo / border artifact fix */
  image-rendering: -webkit-optimize-contrast;
  outline: 1px solid transparent;
  -webkit-transform: translateY(-50%) translateZ(0);
  backface-visibility: hidden;
}

/* ------------------------------
   3) Desktop nav links (centered lane)
------------------------------ */
.nav-links{
  list-style:none; margin:0; padding:0;
  display:flex;
  justify-content:center;
  align-items:center;
  gap:32px;
}
.nav-links a{
  color:#fff;
  text-decoration:none;
  font-weight:600;
  font-size:15px;
  transition:color .2s ease, opacity .2s ease;
}
.nav-links a:hover{ color:var(--muted); opacity:.85; }

/* Active link */
.nav-links a.active{
  color:#fff;
  border-bottom:2px solid #fff;
  padding-bottom:4px;
}

/* ------------------------------
   4) Dropdown
------------------------------ */
.has-dropdown{ position:relative; }
.has-dropdown .dropdown{
  position:absolute;
  top:150%; left:0;
  background:var(--ink-2);
  border:1px solid rgba(255,255,255,.12);
  border-radius:10px;
  padding:10px;
  display:none;
  min-width:180px;
  box-shadow:var(--shadow-elev);
}
.has-dropdown:hover .dropdown{ display:block; }
.has-dropdown .dropdown a{
  display:block;
  padding:8px 12px;
  border-radius:8px;
  color:#fff;
  font-weight:500;
}
.has-dropdown .dropdown a:hover{
  background:rgba(255,255,255,.08);
  color:var(--muted);
}

/* ------------------------------
   5) Right side actions
------------------------------ */
.nav-right{
  display:flex;
  align-items:center;
  gap:16px;
}
.phone{
  color:#fff;
  font-weight:700;
  font-size:15px;
  text-decoration:none;
  transition:opacity .2s ease;
}
.phone:hover{ opacity:.8; }

/* ------------------------------
   6) Hamburger
------------------------------ */
.hamburger{
  display:none;
  width:40px; height:34px;
  background:transparent; border:0; position:relative;
}
.hamburger span{
  position:absolute; left:8px; right:8px;
  height:3px; background:#fff; border-radius:2px;
  transition:transform .3s ease, opacity .3s ease;
}
.hamburger span:nth-child(1){ top:8px; }
.hamburger span:nth-child(2){ top:16px; }
.hamburger span:nth-child(3){ top:24px; }
.hamburger.open span:nth-child(1){ transform:translateY(8px) rotate(45deg); }
.hamburger.open span:nth-child(2){ opacity:0; }
.hamburger.open span:nth-child(3){ transform:translateY(-8px) rotate(-45deg); }

/* ------------------------------
   7) Mobile menu
------------------------------ */
.mobile-menu{
  display:none;
  position:fixed;
  inset:var(--nav-h) 0 auto 0;
  background:rgba(10,26,51,.98);
  z-index:49;
  padding:16px;
  border-top:1px solid rgba(255,255,255,.12);
  backdrop-filter:blur(8px);
}
.mobile-menu a{
  display:block;
  color:#fff;
  text-decoration:none;
  padding:12px;
  font-weight:600;
  transition:color .2s ease, background .2s ease;
}
.mobile-menu a:hover{
  background:rgba(255,255,255,.08);
  color:var(--muted);
}
.mobile-menu.open{ display:block; }

/* ------------------------------
   8) Breakpoints (mobile updates kept at bottom)
------------------------------ */
@media (max-width:1280px){
  .logo{ width: 136px; }             /* pairs with height: 120px */
  .logo-img{ height: 120px; }
}

@media (max-width:1080px){
  /* Balance: logo left | spacer | actions right */
  .nav2-container{
    column-gap:16px;                          /* tighter than desktop */
    grid-template-columns:auto 1fr auto;      /* logo | spacer | actions */
  }

  .nav-links{ display:none; }

  .hamburger{ 
    display:block; 
    width:40px; 
    height:40px; 
  }

  /* Make the logo noticeably bigger on tablet-ish widths */
  .logo{ width: 150px; }
  .logo-img{ height: 130px; }

  .nav-right{
    justify-self:end;
    display:flex;
    align-items:center;
    gap:12px;
  }

  .phone{
    font-size:14px;
    font-weight:700;
    white-space:nowrap;
    opacity:.95;
  }
}

/* Phones */
@media (max-width:860px){
  /* Go big on phones — let it visually overflow */
  .logo{ width: 172px; }             /* reserves space so links don’t shift */
  .logo-img{ height: 148px; }        /* large, but still below thumb-intrusion */

  .nav-right{ gap:10px; }
  .phone{ font-size:13px; opacity:.9; }
}

/* Small phones */
@media (max-width:560px){
  /* Max out the logo a bit more; keep header clean */
  .logo{ width: 184px; }
  .logo-img{ height: 156px; }        /* “huge” look while nav stays fixed */

  .phone{ display:none; }
  .nav-right{ gap:0; }
}




































/* ================================
   Services Mega Menu (seamless + white text)
   ================================ */
#megaMenuServices {
  position: fixed;
  top: calc(var(--nav-h) - 6px); /* 👈 adds ~6px overlap zone */
  pointer-events: auto;          /* ensures hover detection */
  left: 0;
  right: 0;
  z-index: 49;
  display: none;
  height: clamp(266px, 34vh, 400px); /* +6px height to compensate */
  
  background: linear-gradient(
    180deg,
    rgba(10,26,51,0.00) 0%,
    rgba(10,26,51,0.18) 15%,
    rgba(10,26,51,0.65) 55%,
    rgba(10,26,51,0.88) 100%
  );
  backdrop-filter: saturate(120%) blur(4px);
  -webkit-backdrop-filter: saturate(120%) blur(4px);
  border-bottom: 1px solid rgba(255,255,255,.06);
  box-shadow: 0 10px 28px rgba(0,0,0,.25);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .25s ease, transform .25s ease;
}


#megaMenuServices.show{
  display: block;
  opacity: 1;
  transform: translateY(0);
}

#megaMenuServices .mm-services-inner{
  max-width: 1440px;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 48px) 24px;
}

#megaMenuServices .mm-row{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(16px, 2.5vw, 32px);
}

/* --- Cards (with your images) --- */
#megaMenuServices .mm-card{
  position: relative;
  display: block;
  min-height: 190px;
  border-radius: 18px;
  text-decoration: none;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: 0 10px 26px rgba(0,0,0,.25);
  transition: transform .18s ease, box-shadow .18s ease;
}
#megaMenuServices .mm-card:nth-child(1){ background-image: url('/images/services-row-01.webp'); }
#megaMenuServices .mm-card:nth-child(2){ background-image: url('/images/services-row-02.webp'); }
#megaMenuServices .mm-card:nth-child(3){ background-image: url('/images/services-row-03.webp'); }
#megaMenuServices .mm-card:nth-child(4){ background-image: url('/images/services-row-04a.webp'); }

/* Bottom legibility wash */
#megaMenuServices .mm-card::after{
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(8,18,33,0) 40%, rgba(8,18,33,.90) 100%);
  pointer-events: none;
}

#megaMenuServices .mm-card:hover{
  transform: translateY(-3px);
  box-shadow: 0 16px 36px rgba(0,0,0,.34);
}

/* White type, locked */
#megaMenuServices .mm-card-content{
  position: absolute;
  inset: auto 18px 18px 18px;
  color: #fff;
  z-index: 2;
}
#megaMenuServices .mm-card-content h3{
  margin: 0 0 6px 0;
  font-size: clamp(18px, 1.6vw, 22px);
  line-height: 1.2;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 6px rgba(0,0,0,.45);
}
#megaMenuServices .mm-card-content p{
  margin: 0;
  font-size: clamp(13px, 1.2vw, 15px);
  color: rgba(255,255,255,.92);
}

/* Hide tiny dropdown when mega is in play */
.nav-links .has-dropdown > a[href="/services.php"] + .dropdown{
  display: none !important;
}

/* Responsive */
@media (max-width: 1080px){
  #megaMenuServices .mm-row{ grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px){
  #megaMenuServices{ height: auto; padding-bottom: 24px; }
  #megaMenuServices .mm-row{ grid-template-columns: 1fr; }
}












/* ==========================
   Mega Menu — White glow pop
   ========================== */

/* Base: add a subtle white ring + gentle glow */
#megaMenuServices .mm-card{
  box-shadow:
    0 0 0 1px rgba(255,255,255,.18),   /* thin white ring */
    0 8px 26px rgba(0,0,0,.25),        /* your existing depth */
    0 0 14px rgba(255,255,255,.08);    /* soft outer glow */
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

/* Hover: lift + brighter white aura */
#megaMenuServices .mm-card:hover{
  transform: translateY(-3px);
  box-shadow:
    0 0 0 1px rgba(255,255,255,.28),   /* brighter ring */
    0 14px 36px rgba(0,0,0,.34),       /* deeper drop shadow */
    0 0 22px rgba(255,255,255,.18),    /* stronger white glow */
    0 0 44px rgba(255,255,255,.10);    /* extended halo */
}

/* Keyboard focus: crisp accessible ring */
#megaMenuServices .mm-card:focus-visible{
  outline: 0;
  box-shadow:
    0 0 0 2px rgba(255,255,255,.38),   /* clear focus ring */
    0 12px 32px rgba(0,0,0,.30),
    0 0 24px rgba(255,255,255,.16);
  border-radius: 18px;
}

/* (Optional) Stronger “promo” pop — comment out the hover above and use this if you want more punch */
/*
#megaMenuServices .mm-card:hover{
  transform: translateY(-4px);
  box-shadow:
    0 0 0 1px rgba(255,255,255,.34),
    0 18px 44px rgba(0,0,0,.38),
    0 0 28px rgba(255,255,255,.22),
    0 0 56px rgba(255,255,255,.14);
}
*/






/* =========================================================
   PORTFOLIO GRID — INFINITE TICKER (UNIFORM 1×1 VERSION)
   ========================================================= */
#megaMenuPortfolio {
  position: fixed;
  top: calc(var(--nav-h) - 6px);
  left: 0; right: 0;
  z-index: 49;
  display: none;
  height: clamp(266px, 34vh, 400px); /* match Services dropdown height */
  background: linear-gradient(
    180deg,
    rgba(10,26,51,0.00) 0%,
    rgba(10,26,51,0.18) 15%,
    rgba(10,26,51,0.65) 55%,
    rgba(10,26,51,0.88) 100%
  );
  backdrop-filter: saturate(120%) blur(4px);
  border-bottom: 1px solid rgba(255,255,255,.06);
  box-shadow: 0 10px 28px rgba(0,0,0,.25);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .25s ease, transform .25s ease;
}
#megaMenuPortfolio.show { display: block; opacity: 1; transform: translateY(0); }

#megaMenuPortfolio .mm-portfolio-inner {
  max-width: var(--section-max);
  margin: 0 auto;
  padding: clamp(22px, 4vw, 38px) 24px;
  position: relative;
  z-index: 2;
}

/* Header */
#megaMenuPortfolio .mm-header { text-align: left; margin-bottom: clamp(18px, 2vw, 28px); }
#megaMenuPortfolio .mm-header h2 {
  color: #f3f6f9; font-weight: 800;
  font-size: clamp(1.6rem, 2.6vw, 2.05rem);
  margin: 0 0 6px; line-height: 1.1;
  text-shadow: 0 2px 6px rgba(0,0,0,.35);
}
#megaMenuPortfolio .mm-header p {
  color: rgba(255,255,255,.72); font-weight: 500; margin: 0;
  font-size: .92rem; line-height: 1.4; text-shadow: 0 1px 4px rgba(0,0,0,.25);
}

/* =========================================================
   VIEWPORT (fades) + TRACK (moves)
   ========================================================= */
#megaMenuPortfolio .masonry-viewport {
  position: relative;
  overflow: hidden;
  --fade-size: 120px;
}
#megaMenuPortfolio .masonry-viewport::before,
#megaMenuPortfolio .masonry-viewport::after {
  content: "";
  position: absolute; top: 0; bottom: 0; width: var(--fade-size);
  pointer-events: none; z-index: 3;
}
#megaMenuPortfolio .masonry-viewport::before {
  left: 0;
  background: linear-gradient(to right, rgba(10,26,51,.90), rgba(10,26,51,0));
}
#megaMenuPortfolio .masonry-viewport::after {
  right: 0;
  background: linear-gradient(to left, rgba(10,26,51,.90), rgba(10,26,51,0));
}

/* Moving track */
#megaMenuPortfolio .masonry-track {
  display: flex;
  flex-wrap: nowrap;
  gap: 40px;
  will-change: transform;
  animation: var(--ticker-anim, portfolioTicker) var(--ticker-duration, 30s) linear infinite;
}

/* =========================================================
   GRID — UNIFORM 1×1 LAYOUT
   ========================================================= */
#megaMenuPortfolio .masonry-grid {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-auto-rows: 200px;
  gap: 18px 22px;
  align-items: stretch;
}

/* =========================================================
   CARD BASE
   ========================================================= */
#megaMenuPortfolio .masonry-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: #fff;
  border: 1px solid rgba(0,0,0,.05);
  box-shadow: 0 8px 22px rgba(0,0,0,.25);
  transition: transform .35s ease, box-shadow .35s ease, filter .35s ease;
  height: 100%;
}
#megaMenuPortfolio .masonry-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 34px rgba(0,0,0,.28);
  filter: brightness(1.05);
}

/* Media */
#megaMenuPortfolio .masonry-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .6s cubic-bezier(.25, .1, .25, 1);
}
#megaMenuPortfolio .masonry-item:hover .masonry-media { transform: scale(1.03); }

/* =========================================================
   CAPTION — STARWEB GOLD TITLE + WHITE SUBLINE
   (taller overlay fade for better readability)
   ========================================================= */
#megaMenuPortfolio .masonry-caption{
  position: absolute;
  left: 0; bottom: 0; width: 100%;
  padding: 1rem 1.1rem 1rem;

  /* Taller and smoother gradient fade */
  background: linear-gradient(
    to top,
    rgba(10, 26, 51, 0.94) 0%,
    rgba(10, 26, 51, 0.82) 40%,
    rgba(10, 26, 51, 0.55) 70%,
    rgba(10, 26, 51, 0.00) 100%
  );

  backdrop-filter: saturate(115%) blur(2px);
  -webkit-backdrop-filter: saturate(115%) blur(2px);

  color: var(--gold, #D4AF37);
  font-size: .9rem;
  font-weight: 800;
  line-height: 1.3;

  text-shadow:
    0 2px 6px rgba(0,0,0,.55),
    0 0 12px rgba(10,26,51,.55);

  opacity: 0;
  transform: translateY(20%);
  transition: opacity .3s ease, transform .3s ease;
}
#megaMenuPortfolio .masonry-item:hover .masonry-caption{
  opacity: 1;
  transform: translateY(0);
}
/* Subline stays near-white */
#megaMenuPortfolio .masonry-caption small{
  display: block;
  margin-top: 2px;
  color: rgba(255,255,255,.96);
  font-weight: 600;
  font-size: .85rem;
  text-shadow:
    0 1px 4px rgba(0,0,0,.45),
    0 0 10px rgba(10,26,51,.45);
}

/* =========================================================
   ANIMATIONS — TRUE LOOP + DRIFT VARIANT
   ========================================================= */
@keyframes portfolioTicker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
@keyframes portfolioTickerDrift {
  0% {
    transform: translateX(0);
    animation-timing-function: cubic-bezier(.25,.1,.25,1);
  }
  50% {
    transform: translateX(-25%);
    animation-timing-function: cubic-bezier(.25,.1,.25,1);
  }
  100% { transform: translateX(-50%); }
}
#megaMenuPortfolio.drift {
  --ticker-anim: portfolioTickerDrift;
  --ticker-duration: 34s;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width:1080px) {
  #megaMenuPortfolio .masonry-grid {
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 180px;
    gap: 16px;
  }
}
@media (max-width:700px) {
  #megaMenuPortfolio .mm-header { text-align: center; }
  #megaMenuPortfolio .masonry-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 160px;
    gap: 14px;
  }
}

/* =========================================================
   PAUSE LOGIC — CARD HOVER / JS FALLBACK
   ========================================================= */
#megaMenuPortfolio .masonry-viewport:has(.masonry-item:hover) .masonry-track {
  animation-play-state: paused !important;
}
#megaMenuPortfolio .masonry-viewport[data-paused="1"] .masonry-track {
  animation-play-state: paused !important;
}
#megaMenuPortfolio .masonry-viewport:has(.masonry-item:focus-visible) .masonry-track {
  animation-play-state: paused !important;
}
