/* css/layout.css */

/* Global Image Protection (Anti-Drag & Anti-Select) */
img {
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  user-drag: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none; /* Disables long-press download popups on iOS / Android */
}

/* Fluid Containers */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 clamp(1rem, 3.5vw, 2.5rem);
}

.container-whoweare {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 clamp(1rem, 3.5vw, 2.5rem);
}

/* Global Link Behavior */
a {
  transition: color var(--transition-fast), transform var(--transition-fast);
}

a:hover {
  color: var(--clr-accent);
}

/* 12 Column Fluid Grid System */
.row {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--grid-gap);
  width: 100%;
}

.col-1 { grid-column: span 1; }
.col-2 { grid-column: span 2; }
.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; }
.col-6 { grid-column: span 6; }
.col-7 { grid-column: span 7; }
.col-8 { grid-column: span 8; }
.col-9 { grid-column: span 9; }
.col-10 { grid-column: span 10; }
.col-11 { grid-column: span 11; }
.col-12 { grid-column: span 12; }

/* Sections */
section {
  padding: clamp(3.5rem, 8vw, 8rem) 0;
  position: relative;
  width: 100%;
}

.section-dark {
  background-color: var(--clr-bg-dark);
  color: var(--clr-white);
  margin-top: -60px;
}

/* Page Headers (Across About, Services, Projects, Gallery, Contact, Privacy, Terms) */
.page-header {
  padding: clamp(7.5rem, 16vh, 13.5rem) 1.5rem clamp(3rem, 6vh, 5.5rem);
  background-color: var(--clr-bg-dark);
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  position: relative;
  color: var(--clr-white);
  text-align: center;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-header .overlay-dark {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(5, 10, 31, 0.62) 0%, rgba(5, 10, 31, 0.82) 90%);
  backdrop-filter: blur(0px) brightness(0.75);
  -webkit-backdrop-filter: blur(5px) brightness(0.85);
  z-index: 1;
  pointer-events: none;
}

.page-header .container {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 860px;
  margin: 0 auto;
}

/* Header & Navigation Bar */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100000;
  padding: clamp(1rem, 2vh, 1.5rem) 0;
  transition: background var(--transition-normal), padding var(--transition-normal), border var(--transition-normal);
}

.header.scrolled {
  background: rgba(5, 10, 31, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.logo {
  font-family: var(--font-heading);
  font-size: clamp(1.3rem, 2.2vw, 2.1rem);
  font-weight: 800;
  color: var(--clr-white);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  letter-spacing: -0.5px;
  text-decoration: none;
  flex-shrink: 0;
}

.logo img {
  width: clamp(34px, 4vw, 48px);
  height: auto;
  display: block;
}

.logo span {
  color: var(--clr-white);
  opacity: 0.7;
  font-weight: 300;
  font-size: clamp(1.1rem, 1.8vw, 1.8rem);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.logo i {
  color: var(--clr-accent);
  font-size: 2.2rem;
}

/* Desktop Nav Links */
.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(1.2rem, 2vw, 2.2rem);
}

.nav-link {
  color: var(--clr-white);
  font-weight: 500;
  font-size: clamp(0.9rem, 1.1vw, 1.02rem);
  position: relative;
  padding: 0.3rem 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--clr-accent);
  transition: width var(--transition-normal);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* Desktop Dropdown Menu */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: rgba(5, 10, 31, 0.98);
  min-width: 190px;
  box-shadow: var(--shadow-glass);
  z-index: 100;
  border: 1px solid var(--clr-glass-border);
  border-radius: 6px;
  flex-direction: column;
  padding: 0.5rem 0;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.dropdown-content a {
  color: var(--clr-white);
  padding: 10px 20px;
  text-decoration: none;
  display: block;
  font-family: var(--font-body);
  font-size: 0.92rem;
  transition: background 0.3s, color 0.3s, padding-left 0.3s;
}

.dropdown-content a:hover {
  background-color: rgba(212, 175, 55, 0.1);
  color: var(--clr-accent);
  padding-left: 24px;
}

/* Desktop Hover */
@media (min-width: 1025px) {
  .dropdown:hover .dropdown-content {
    display: flex;
    animation: fadeInMenu 0.25s ease forwards;
  }
}

@keyframes fadeInMenu {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile Menu Button */
.menu-btn {
  display: none;
  color: var(--clr-white);
  font-size: 1.4rem;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  border: 1px solid rgba(212, 175, 55, 0.4);
  background: rgba(5, 10, 31, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  z-index: 100002;
  transition: all 0.3s ease;
}

.menu-btn:hover {
  background: var(--clr-accent);
  color: var(--clr-primary);
  border-color: var(--clr-accent);
}

/* Mobile Nav Overlay (Backdrop behind header & drawer) */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 4, 12, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 99990;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.nav-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Footer Section */
.footer {
  background-color: var(--clr-primary);
  color: var(--clr-white);
  padding: clamp(4rem, 8vw, 6.5rem) 0 2rem;
  border-top: 1px solid rgba(212, 175, 55, 0.15);
  position: relative;
  z-index: 5;
}

.footer-top {
  padding-bottom: 3.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 2rem;
}

.footer-widget h4 {
  color: var(--clr-white);
  font-size: clamp(1.1rem, 1.4vw, 1.25rem);
  margin-bottom: 1.5rem;
  position: relative;
  display: inline-block;
  font-family: var(--font-heading);
}

.footer-widget h4::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 36px;
  height: 2px;
  background-color: var(--clr-accent);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.footer-links li {
  display: flex;
  align-items: flex-start;
  word-break: break-word;
  font-size: 0.92rem;
  color: #bbb;
  line-height: 1.6;
}

.footer-links a {
  color: #bbb;
  display: inline-flex;
  align-items: flex-start;
  word-break: break-word;
  transition: color 0.3s, transform 0.3s;
}

.footer-links a:hover {
  color: var(--clr-accent);
  transform: translateX(4px);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  color: #888;
  font-size: 0.88rem;
}

.project-footer {
  background-color: var(--clr-primary);
  color: var(--clr-white);
  padding: 1.5rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS: Mobile, Tablet, Laptop, Desktop, 4K & TVs
   ========================================================================== */

/* 1. Large Displays, 4K & Smart TVs (>= 2000px) */
@media (min-width: 2000px) {
  section {
    padding: 9rem 0;
  }

  .page-header {
    padding: 15rem 2rem 7rem;
  }

  .nav-link {
    font-size: 1.15rem;
  }

  .footer {
    padding: 8rem 0 3rem;
  }
}

/* 2. Standard Laptops & Large Tablets in Landscape (1025px to 1280px) */
@media (max-width: 1280px) {
  .nav-links {
    gap: 1.4rem;
  }
}

/* 3. Tablets and Mobile Devices (<= 1024px) */
@media (max-width: 1024px) {
  /* Hide Desktop Nav and Show Mobile Hamburger */
  .menu-btn {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: min(340px, 86vw);
    height: 100vh;
    height: 100dvh;
    background: #050a1f;
    background: linear-gradient(180deg, #070e2a 0%, #030614 100%);
    padding: 5.5rem 2rem 3rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
    box-shadow: -15px 0 50px rgba(0, 0, 0, 0.95);
    border-left: 1px solid rgba(212, 175, 55, 0.4);
    transition: right 0.38s cubic-bezier(0.25, 1, 0.5, 1);
    z-index: 100001;
    overflow-y: auto;
  }

  .nav-links.nav-active {
    right: 0;
  }

  .nav-link {
    font-size: 1.12rem;
    width: 100%;
    padding: 0.7rem 0;
    color: #ffffff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
    transition: color 0.25s ease, padding-left 0.25s ease;
  }

  .nav-link:hover,
  .nav-link.active {
    color: var(--clr-accent);
    padding-left: 6px;
    border-bottom-color: rgba(212, 175, 55, 0.4);
  }

  /* Mobile Dropdown Accordion */
  .dropdown {
    width: 100%;
  }

  .dropdown > .nav-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    cursor: pointer;
  }

  .dropdown > .nav-link i {
    transition: transform 0.3s ease;
    color: var(--clr-accent);
  }

  .dropdown.open > .nav-link i {
    transform: rotate(180deg);
  }

  .dropdown-content {
    position: static;
    display: none;
    box-shadow: none;
    border: none;
    background: rgba(212, 175, 55, 0.06);
    border-left: 2px solid var(--clr-accent);
    margin-top: 0.3rem;
    margin-bottom: 0.4rem;
    padding: 0.4rem 0 0.4rem 0.8rem;
    border-radius: 4px;
    width: 100%;
    min-width: 100%;
  }

  .dropdown.open .dropdown-content {
    display: flex;
    flex-direction: column;
  }

  .dropdown-content a {
    padding: 0.65rem 0.8rem;
    font-size: 0.98rem;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.25s ease;
  }

  .dropdown-content a:hover,
  .dropdown-content a.active {
    color: var(--clr-accent);
    background-color: rgba(212, 175, 55, 0.15);
    padding-left: 1.1rem;
  }

  /* Tablet Grid Adaptations */
  .col-1,
  .col-2,
  .col-3,
  .col-4 {
    grid-column: span 6;
  }

  .col-5,
  .col-6,
  .col-7,
  .col-8,
  .col-9,
  .col-10,
  .col-11,
  .col-12 {
    grid-column: span 12;
  }

  /* Hero row spacing */
  .hero-content .row {
    row-gap: 2.5rem;
  }
}

/* 4. Standard Mobile Phones & Small Tablets (<= 768px) */
@media (max-width: 768px) {
  /* Complete Grid Stacking */
  .col-1,
  .col-2,
  .col-3,
  .col-4,
  .col-5,
  .col-6,
  .col-7,
  .col-8,
  .col-9,
  .col-10,
  .col-11,
  .col-12 {
    grid-column: span 12;
  }

  section {
    padding: 4rem 0;
  }

  .section-dark {
    margin-top: 0;
  }

  .header {
    background: rgba(5, 10, 31, 0.98);
    padding: 0.85rem 0;
  }

  .logo {
    font-size: 1.3rem;
    max-width: calc(100vw - 80px);
  }

  .logo img {
    width: 38px !important;
  }

  /* Fix nested sub-rows */
  .row .row {
    grid-template-columns: 1fr;
    row-gap: 1.25rem;
  }

  /* Reset harmful negative margins on mobile */
  .overlap-section,
  [style*="margin-top: -100px"],
  [style*="margin-top:-100px"] {
    margin-top: 0 !important;
  }

  /* Reset image offsets */
  [style*="margin-top: 2rem"] img,
  .col-6 img[style*="margin-top"] {
    margin-top: 0 !important;
  }

  /* Footer Mobile */
  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 1.2rem;
  }

  .footer-bottom div {
    justify-content: center;
  }

  .footer-widget {
    margin-bottom: 1.5rem;
  }

  /* Inline grid resets */
  [style*="grid-template-columns: 1fr 1fr"],
  [style*="grid-template-columns: repeat(4, 1fr)"],
  [style*="grid-template-columns: repeat(3, 1fr)"] {
    grid-template-columns: 1fr !important;
  }

  /* Inline padding resets */
  [style*="padding-left: 4rem"] {
    padding-left: 0 !important;
  }
}

/* 5. Responsive Page-Header & Logo tweaks for smaller devices */
@media (max-width: 1024px) {
  .page-header {
    padding: clamp(7.5rem, 12vh, 9rem) 1.25rem clamp(2.8rem, 5vh, 4rem) !important;
    background-size: 100% 100% !important;
    background-position: center center !important;
  }
}

@media (max-width: 768px) {
  .page-header {
    padding: clamp(5.8rem, 10vh, 7rem) 1rem clamp(2.2rem, 4vh, 3rem) !important;
    background-size: 100% 100% !important;
    background-position: center center !important;
  }
  .page-title,
  .page-header h1 {
    font-size: clamp(1.7rem, 5.5vw, 2.15rem) !important;
    margin-bottom: 0.75rem !important;
  }
  .page-subtitle,
  .page-header p {
    font-size: clamp(0.85rem, 2.8vw, 0.95rem) !important;
    line-height: 1.55 !important;
    max-width: 100% !important;
  }
  .page-badge {
    padding: 0.3rem 0.9rem !important;
    font-size: 0.7rem !important;
    margin-bottom: 0.8rem !important;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }

  .logo {
    font-size: 1.15rem;
    gap: 0.5rem;
  }

  .logo img {
    width: 32px !important;
  }

  .menu-btn {
    width: 38px;
    height: 38px;
    font-size: 1.2rem;
  }

  .footer-top {
    padding-bottom: 2.5rem;
  }
}