/* ==========================================================================
   Gibralter Fence — modern brand overrides
   Industrial security aesthetic: deep slate + refined brass
   ========================================================================== */

:root {
  --gf-navy: #0b1220;
  --gf-navy-soft: #141e30;
  --gf-slate: #1c2a3a;
  --gf-steel: #5b6b7c;
  --gf-muted: #6b7c8f;
  --gf-surface: #f4f6f8;
  --gf-surface-alt: #e8edf2;
  --gf-white: #ffffff;
  --gf-brass: #c9a227;
  --gf-brass-hover: #b8911f;
  --gf-brass-soft: #e4c45a;
  --gf-text: #1a2332;
  --gf-text-light: #e8eef5;
  --gf-radius: 12px;
  --gf-radius-sm: 8px;
  --gf-shadow: 0 10px 30px rgba(11, 18, 32, 0.08);
  --gf-shadow-lg: 0 20px 50px rgba(11, 18, 32, 0.14);
  --gf-font: 'Inter', 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --gf-font-display: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ---------- Base ---------- */
body {
  overflow-x: hidden;
  font-family: var(--gf-font);
  color: var(--gf-text);
  background-color: var(--gf-white);
  padding-top: 70px;
  -webkit-font-smoothing: antialiased;
}

@media (min-width: 992px) {
  body {
    padding-top: 88px;
  }
}

p {
  line-height: 1.75;
  color: var(--gf-steel);
}

a {
  color: var(--gf-brass);
  transition: color 0.2s ease;
}

a:hover {
  color: var(--gf-brass-hover);
}

.text-primary {
  color: var(--gf-brass) !important;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  font-family: var(--gf-font-display);
  color: var(--gf-navy);
  letter-spacing: -0.02em;
}

::selection {
  background: var(--gf-brass);
  color: var(--gf-navy);
  text-shadow: none;
}

/* ---------- Sections ---------- */
section {
  padding: 80px 0;
}

section h2.section-heading {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  margin-top: 0;
  margin-bottom: 0.75rem;
  letter-spacing: 0.04em;
  position: relative;
  display: inline-block;
}

section .text-center h2.section-heading::after {
  content: '';
  display: block;
  width: 56px;
  height: 3px;
  background: linear-gradient(90deg, var(--gf-brass), var(--gf-brass-soft));
  margin: 14px auto 0;
  border-radius: 2px;
}

section h3.section-subheading {
  font-size: 1.05rem;
  font-weight: 400;
  font-style: normal;
  margin-bottom: 3.5rem;
  margin-top: 1rem;
  text-transform: none;
  font-family: var(--gf-font);
  color: var(--gf-muted) !important;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.7;
}

@media (min-width: 768px) {
  section {
    padding: 110px 0;
  }
}

/* ---------- Buttons ---------- */
.btn {
  font-family: var(--gf-font-display);
  font-weight: 600;
  letter-spacing: 0.04em;
  border-radius: 6px;
  transition: all 0.25s ease;
}

.btn-xl {
  font-size: 0.95rem;
  padding: 1rem 1.75rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gf-brass) 0%, #d4ad2e 100%);
  border-color: transparent;
  color: var(--gf-navy) !important;
  box-shadow: 0 4px 14px rgba(201, 162, 39, 0.35);
}

.btn-primary:active,
.btn-primary:focus,
.btn-primary:hover {
  background: linear-gradient(135deg, var(--gf-brass-hover) 0%, var(--gf-brass) 100%) !important;
  border-color: transparent !important;
  color: var(--gf-navy) !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(201, 162, 39, 0.45);
}

.btn-primary:active,
.btn-primary:focus {
  box-shadow: 0 0 0 0.2rem rgba(201, 162, 39, 0.4) !important;
}

.btn-outline-light {
  border: 2px solid rgba(255, 255, 255, 0.85);
  color: #fff !important;
  background: transparent;
}

.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: #fff;
  color: #fff !important;
}

.btn-warning {
  background: linear-gradient(135deg, var(--gf-brass) 0%, #d4ad2e 100%);
  border-color: transparent;
  color: var(--gf-navy) !important;
  font-weight: 700;
  padding: 0.9rem 2rem;
  border-radius: 6px;
  box-shadow: 0 4px 14px rgba(201, 162, 39, 0.35);
}

.btn-warning:hover {
  background: linear-gradient(135deg, var(--gf-brass-hover) 0%, var(--gf-brass) 100%);
  border-color: transparent;
  color: var(--gf-navy) !important;
  transform: translateY(-1px);
}

/* ---------- Navbar ---------- */
#mainNav {
  background-color: rgba(11, 18, 32, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(201, 162, 39, 0.12);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.15);
  transition: padding 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
}

#mainNav .navbar-toggler {
  font-size: 12px;
  padding: 10px 14px;
  text-transform: uppercase;
  color: var(--gf-navy);
  border: 0;
  background: linear-gradient(135deg, var(--gf-brass), var(--gf-brass-soft));
  border-radius: 6px;
  font-family: var(--gf-font-display);
  font-weight: 700;
}

#mainNav .navbar-brand {
  color: var(--gf-brass-soft) !important;
  font-family: 'Anton', var(--gf-font-display), sans-serif;
  letter-spacing: 0.02em;
  font-weight: 400;
}

#mainNav .navbar-brand:hover,
#mainNav .navbar-brand:focus {
  color: #fff !important;
}

#mainNav .navbar-nav .nav-item .nav-link {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.75em 0;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.88);
  font-family: var(--gf-font-display);
  transition: color 0.2s ease;
}

#mainNav .navbar-nav .nav-item .nav-link.active,
#mainNav .navbar-nav .nav-item .nav-link:hover {
  color: var(--gf-brass-soft);
}

#mainNav .dropdown-menu {
  background: var(--gf-navy-soft);
  border: 1px solid rgba(201, 162, 39, 0.15);
  border-radius: var(--gf-radius-sm);
  box-shadow: var(--gf-shadow-lg);
  padding: 0.5rem 0;
}

#mainNav .dropdown-item {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.85rem;
  padding: 0.5rem 1.25rem;
  font-family: var(--gf-font);
}

#mainNav .dropdown-item:hover,
#mainNav .dropdown-item:focus {
  background: rgba(201, 162, 39, 0.15);
  color: var(--gf-brass-soft);
}

#mainNav .dropdown-divider {
  border-color: rgba(255, 255, 255, 0.1);
}

@media (min-width: 992px) {
  #mainNav {
    padding-top: 1.1rem;
    padding-bottom: 1.1rem;
    background-color: rgba(11, 18, 32, 0.88);
  }
  #mainNav .navbar-brand {
    font-size: 1.65em;
  }
  #mainNav .navbar-nav .nav-item .nav-link {
    padding: 1em 0.9em !important;
  }
  #mainNav.navbar-shrink {
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
    background-color: rgba(11, 18, 32, 0.97);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
  }
  #mainNav.navbar-shrink .navbar-brand {
    font-size: 1.2em;
    padding: 10px 0;
  }
}

/* ---------- Hero / Masthead ---------- */
/* Body has padding-top so non-hero pages clear the fixed navbar. Pull the
   full-bleed video up into that padding so there is no white gap under the bar. */
header.masthead {
  text-align: center;
  color: #fff;
  position: relative;
  margin-top: -70px;
  min-height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--gf-navy);
}

@media (min-width: 992px) {
  header.masthead {
    margin-top: -88px;
    min-height: 100vh;
  }
}

.video-background {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.video-background video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.video-background video.is-ready {
  opacity: 1;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(160deg, rgba(11, 18, 32, 0.82) 0%, rgba(11, 18, 32, 0.55) 45%, rgba(11, 18, 32, 0.72) 100%),
    linear-gradient(0deg, rgba(11, 18, 32, 0.55) 0%, transparent 40%);
  pointer-events: none;
}

/* neutralize legacy global video rules from agency.css */
.video-background video,
header.masthead video {
  position: absolute;
  min-width: 100%;
  min-height: 100%;
  margin: 0;
}

header.masthead .intro-text {
  z-index: 2;
  position: relative;
  padding: 4rem 1.25rem 5rem;
  max-width: 900px;
  margin: 0 auto;
}

header.masthead .intro-text .intro-lead-in {
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  font-style: normal;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 1rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gf-brass-soft);
  font-family: var(--gf-font);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

header.masthead .intro-text .intro-heading {
  font-size: clamp(2rem, 5.5vw, 3.75rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1.25rem;
  color: #fff;
  font-family: var(--gf-font-display);
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
  letter-spacing: -0.02em;
}

header.masthead .intro-tagline {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 2rem;
  font-weight: 400;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  justify-content: center;
  align-items: center;
}

@media (min-width: 768px) {
  header.masthead .intro-text {
    padding-top: 5rem;
    padding-bottom: 6rem;
  }
}

/* ---------- Services ---------- */
#services {
  background: var(--gf-white);
}

#services .row.text-center > [class*="col-"] {
  padding: 1.25rem;
}

#services .fa-stack {
  margin-bottom: 0.5rem;
  transition: transform 0.3s ease;
}

#services [class*="col-"]:hover .fa-stack {
  transform: translateY(-4px);
}

#services .fa-stack .fa-circle {
  color: var(--gf-navy) !important;
}

/* Service cards */
#services .row.text-center > [class*="col-"] {
  margin-bottom: 0.5rem;
}

.service-heading {
  margin: 1rem 0 0.75rem;
  text-transform: none;
  font-size: 1.25rem;
  color: var(--gf-navy);
}

#services .text-muted {
  color: var(--gf-steel) !important;
  font-size: 0.98rem;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

/* Card treatment for service columns */
#services .row.text-center > [class*="col-"] {
  position: relative;
}

#services .row.text-center > [class*="col-"] > * {
  position: relative;
  z-index: 1;
}

@media (min-width: 768px) {
  #services .row.text-center > [class*="col-"]::before {
    content: '';
    position: absolute;
    inset: 0.5rem;
    background: var(--gf-surface);
    border-radius: var(--gf-radius);
    border: 1px solid rgba(11, 18, 32, 0.06);
    box-shadow: var(--gf-shadow);
    transition: box-shadow 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
    z-index: 0;
  }
  #services .row.text-center > [class*="col-"]:hover::before {
    box-shadow: var(--gf-shadow-lg);
    border-color: rgba(201, 162, 39, 0.35);
    transform: translateY(-3px);
  }
  #services .row.text-center > [class*="col-"] {
    padding: 2.5rem 1.5rem;
  }
}

/* ---------- Portfolio ---------- */
#portfolio.bg-light,
section#portfolio {
  background: var(--gf-surface) !important;
}

#portfolio .portfolio-item {
  right: 0;
  margin: 0 0 1.5rem;
}

#portfolio .portfolio-item .portfolio-link {
  position: relative;
  display: block;
  max-width: 400px;
  margin: 0 auto;
  cursor: pointer;
  border-radius: var(--gf-radius) var(--gf-radius) 0 0;
  overflow: hidden;
}

#portfolio .portfolio-item .portfolio-link img {
  width: 100%;
  transition: transform 0.45s ease;
}

#portfolio .portfolio-item:hover .portfolio-link img {
  transform: scale(1.05);
}

#portfolio .portfolio-item .portfolio-link .portfolio-hover {
  position: absolute;
  inset: 0;
  transition: all ease 0.35s;
  opacity: 0;
  background: linear-gradient(160deg, rgba(11, 18, 32, 0.75), rgba(201, 162, 39, 0.75));
  border-radius: var(--gf-radius) var(--gf-radius) 0 0;
}

#portfolio .portfolio-item .portfolio-link .portfolio-hover:hover,
#portfolio .portfolio-item:hover .portfolio-hover {
  opacity: 1;
}

#portfolio .portfolio-item .portfolio-link .portfolio-hover .portfolio-hover-content {
  font-size: 20px;
  position: absolute;
  top: 50%;
  width: 100%;
  height: 20px;
  margin-top: -12px;
  text-align: center;
  color: white;
}

#portfolio .portfolio-item .portfolio-caption {
  max-width: 400px;
  margin: 0 auto;
  padding: 1.35rem 1.25rem 1.5rem;
  text-align: center;
  background-color: var(--gf-white);
  border-radius: 0 0 var(--gf-radius) var(--gf-radius);
  box-shadow: var(--gf-shadow);
  border: 1px solid rgba(11, 18, 32, 0.05);
  border-top: none;
}

#portfolio .portfolio-item .portfolio-caption h4 {
  margin: 0;
  text-transform: none;
  font-size: 1.15rem;
  color: var(--gf-navy);
}

#portfolio .portfolio-item .portfolio-caption p {
  font-size: 0.95rem;
  font-style: normal;
  margin: 0.35rem 0 0;
  font-family: var(--gf-font);
  color: var(--gf-muted);
}

/* Group image + caption as a card */
#portfolio .portfolio-item {
  transition: transform 0.3s ease;
}

/* ---------- About / Timeline ---------- */
#about {
  background: var(--gf-white);
}

.timeline:before {
  background-color: var(--gf-surface-alt);
  width: 3px;
}

.timeline > li .timeline-image {
  border: 6px solid var(--gf-surface-alt);
  background-color: var(--gf-navy);
  box-shadow: 0 4px 16px rgba(11, 18, 32, 0.15);
  overflow: hidden;
}

.timeline > li .timeline-image img {
  object-fit: cover;
  width: 100%;
  height: 100%;
}

.timeline .timeline-heading h4 {
  color: var(--gf-brass);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}

.timeline .timeline-heading h4.subheading {
  text-transform: none;
  color: var(--gf-navy);
  font-size: 1.2rem;
  letter-spacing: -0.01em;
  margin-top: 0.25rem;
}

.timeline .timeline-body .text-muted {
  color: var(--gf-steel) !important;
}

/* ---------- Contact ---------- */
section#contact {
  background-color: var(--gf-navy);
  background-image:
    linear-gradient(160deg, rgba(11, 18, 32, 0.94), rgba(20, 30, 48, 0.92)),
    url("../img/map-image.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  padding: 90px 0;
  position: relative;
}

section#contact .section-heading {
  color: #fff;
  margin-bottom: 1.5rem;
}

section#contact .section-heading::after {
  background: linear-gradient(90deg, var(--gf-brass), var(--gf-brass-soft));
}

section#contact .btn-lg,
section#contact .btn-warning {
  font-size: 1.1rem;
  padding: 1rem 2.25rem;
}

section#contact .form-control:focus {
  border-color: var(--gf-brass);
  box-shadow: none;
}

/* ---------- Footer ---------- */
footer {
  padding: 2rem 0;
  text-align: center;
  background: var(--gf-navy-soft);
  color: rgba(255, 255, 255, 0.7);
  border-top: 1px solid rgba(201, 162, 39, 0.15);
}

footer span.copyright {
  font-size: 0.85rem;
  line-height: 40px;
  text-transform: none;
  font-family: var(--gf-font);
  color: rgba(255, 255, 255, 0.65);
}

footer ul.quicklinks {
  font-size: 0.85rem;
  line-height: 40px;
  margin-bottom: 0;
  text-transform: none;
  font-family: var(--gf-font);
}

footer ul.quicklinks a {
  color: rgba(255, 255, 255, 0.65);
}

footer ul.quicklinks a:hover {
  color: var(--gf-brass-soft);
}

ul.social-buttons {
  margin-bottom: 0;
}

ul.social-buttons li a {
  font-size: 18px;
  line-height: 44px;
  display: block;
  width: 44px;
  height: 44px;
  transition: all 0.25s ease;
  color: var(--gf-navy);
  border-radius: 100%;
  outline: none;
  background: linear-gradient(135deg, var(--gf-brass), var(--gf-brass-soft));
}

ul.social-buttons li a:active,
ul.social-buttons li a:focus,
ul.social-buttons li a:hover {
  background: #fff;
  color: var(--gf-navy);
  transform: translateY(-2px);
}

/* ---------- Portfolio modals ---------- */
.portfolio-modal .modal-content {
  border-radius: var(--gf-radius);
}

.portfolio-modal .modal-content h2 {
  color: var(--gf-navy);
}

.portfolio-modal .close-modal .lr,
.portfolio-modal .close-modal .lr .rl {
  background-color: var(--gf-navy);
}

/* ---------- Portfolio category pages ---------- */
.portfolio-page__hero {
  padding-top: 2.5rem;
  padding-bottom: 3rem;
}

.portfolio-page__eyebrow {
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gf-brass);
  margin-bottom: 0.5rem;
}

.portfolio-page__intro {
  max-width: 42rem;
  color: var(--gf-steel);
}

.portfolio-page__body {
  max-width: 48rem;
  color: var(--gf-steel);
}

.portfolio-gallery__item {
  background: var(--gf-white);
  border-radius: var(--gf-radius);
  overflow: hidden;
  box-shadow: var(--gf-shadow);
  border: 1px solid rgba(11, 18, 32, 0.05);
  height: 100%;
}

.portfolio-gallery__link {
  position: relative;
  display: block;
  overflow: hidden;
  cursor: pointer;
}

.portfolio-gallery__link img {
  width: 100%;
  display: block;
  transition: transform 0.45s ease;
}

.portfolio-gallery__item:hover .portfolio-gallery__link img {
  transform: scale(1.05);
}

.portfolio-gallery__hover {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.5rem;
  opacity: 0;
  transition: opacity 0.3s ease;
  background: linear-gradient(160deg, rgba(11, 18, 32, 0.7), rgba(201, 162, 39, 0.7));
}

.portfolio-gallery__item:hover .portfolio-gallery__hover {
  opacity: 1;
}

.portfolio-gallery__caption {
  padding: 0.65rem 0.85rem 0.85rem;
  font-size: 0.9rem;
  color: var(--gf-navy);
  margin: 0;
}

.portfolio-lightbox .modal-content {
  background: rgba(11, 18, 32, 0.96);
}

.portfolio-page__siblings {
  border-top: 1px solid rgba(11, 18, 32, 0.08);
}

/* ---------- Misc template leftovers ---------- */
.swing-gate-cat {
  background-color: var(--gf-surface);
  padding-top: 10px;
}

/* Smooth scroll for in-page anchors */
html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .video-background video,
  #portfolio .portfolio-item .portfolio-link img,
  #services .fa-stack {
    transition: none !important;
  }
}

/* ---------- Staff ops corner (fixed, like Wagtail userbar) ---------- */
/* Wagtail bird (wagtalk) sits bottom-left; staff tools sit bottom-right so they never cover it. */
.staff-ops-corner {
  position: fixed;
  z-index: 9999;
  left: 12px;
  bottom: 12px;
  right: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  width: auto;
  max-width: none;
  pointer-events: none; /* container doesn't steal clicks; children re-enable */
}

.staff-ops-corner__btn {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: auto;
  min-width: 3.25rem;
  max-width: none;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none !important;
  text-transform: uppercase;
  white-space: nowrap;
  color: #fff !important;
  background: rgba(11, 18, 32, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(6px);
  transition: transform 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}

.staff-ops-corner__btn:hover,
.staff-ops-corner__btn:focus {
  background: rgba(20, 30, 48, 0.98);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  color: #fff !important;
}

.staff-ops-corner__btn--primary {
  background: var(--gf-brass, #c9a227);
  color: #0b1220 !important;
  border-color: rgba(0, 0, 0, 0.08);
}

.staff-ops-corner__btn--primary:hover,
.staff-ops-corner__btn--primary:focus {
  background: var(--gf-brass-hover, #b8911f);
  color: #0b1220 !important;
}

/* Keep pill-sized on narrow viewports — never stretch across the bottom over wagtalk */
@media (max-width: 575.98px) {
  .staff-ops-corner {
    left: 12px;
    right: auto;
    bottom: 30px;
    gap: 20px;
    align-items: flex-end;
  }
  .staff-ops-corner__btn {
    flex: 0 0 auto;
    width: auto;
    min-width: 2.85rem;
    padding: 0.35rem 0.55rem;
    font-size: 0.75rem;
  }
}
