/* =============================================================
   Entrycom Security Systems — Global Stylesheet
   Plain CSS, no frameworks. Brand palette derived from the
   real logo (steel-blue) and live-site button accent (navy).
   ============================================================= */

/* ---------- Design tokens (CSS custom properties) ---------- */
:root {
  /* Brand — navy / steel-blue (sampled from logo #38618c,
     live buttons #2a4a6c). Confirmed accurate: no teal exists. */
  --navy:        #2a4a6c;   /* primary accent (buttons, links)   */
  --navy-dark:   #1e3650;   /* hover / darker surfaces           */
  --steel:       #38618c;   /* logo blue, secondary accent       */
  --steel-light: #5b83ab;   /* lighter highlight                 */

  /* Neutrals */
  --ink:      #2d2d2d;      /* headings (Wix color_15)           */
  --body:     #4a4a4a;      /* body copy                         */
  --muted:    #6d6b6b;      /* secondary text (Wix color_14)     */
  --border:   #e3e3e3;      /* hairlines (Wix color_12)          */
  --bg:       #ffffff;      /* page background                   */
  --bg-alt:   #f4f6f9;      /* alternating section background     */
  --bg-deep:  #1b2c40;      /* footer / dark hero overlay        */

  /* Brand utility colours for the social icons */
  --whatsapp: #25d366;
  --insta:    #e1306c;
  --linkedin: #0a66c2;

  /* Typography */
  --font-sans: "Segoe UI", "Helvetica Neue", Arial, sans-serif;

  /* Layout */
  --maxw: 1180px;
  --radius: 8px;
  --radius-lg: 14px;
  --shadow-sm: 0 2px 8px rgba(27, 44, 64, 0.08);
  --shadow-md: 0 10px 30px rgba(27, 44, 64, 0.12);
  --header-h: 84px;
  --transition: 0.25s ease;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--body);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  color: var(--ink);
  line-height: 1.2;
  margin: 0 0 0.5em;
  font-weight: 700;
}
h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1.1em; }

a { color: var(--navy); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--steel); }

img { max-width: 100%; display: block; }

ul { margin: 0 0 1.1em; padding-left: 1.2em; }

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 20px;
}

.section { padding: clamp(48px, 8vw, 90px) 0; }
.section--alt { background: var(--bg-alt); }

.section-head { text-align: center; max-width: 760px; margin: 0 auto 48px; }
.section-head p { color: var(--muted); font-size: 1.05rem; }

.eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--steel);
  margin-bottom: 12px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-radius: var(--radius);
  border: 2px solid var(--navy);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn--primary { background: var(--navy); color: #fff; }
.btn--primary:hover { background: var(--navy-dark); border-color: var(--navy-dark); color: #fff; transform: translateY(-2px); }
.btn--outline { background: transparent; color: var(--navy); }
.btn--outline:hover { background: var(--navy); color: #fff; transform: translateY(-2px); }

.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  /* Keep the header (and logo) clear of the device status bar / notch on
     phones with a display cut-out. Needs viewport-fit=cover in the meta.
     The extra background sits in the inset area so it stays white. */
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: var(--header-h);
}
.brand img { height: 54px; width: auto; }

.header-right { display: flex; align-items: center; gap: 28px; }

.header-phone {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--navy);
  white-space: nowrap;
}
.header-phone svg { width: 18px; height: 18px; }
.header-phone:hover { color: var(--steel); }

/* ---------- Navigation ---------- */
.main-nav ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; }
.main-nav a {
  display: block;
  padding: 10px 14px;
  font-weight: 600;
  color: var(--ink);
  border-radius: var(--radius);
  transition: background var(--transition), color var(--transition);
}
.main-nav a:hover,
.main-nav .active > a { color: var(--navy); background: var(--bg-alt); }

/* Dropdowns */
.has-dropdown { position: relative; }
.has-dropdown > a::after {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  margin-left: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform var(--transition);
}
.dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 210px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  /* hidden by default; revealed on hover (desktop) or .open (tap) */
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
}
/* Desktop: reveal on hover */
@media (min-width: 921px) {
  .has-dropdown:hover > .dropdown,
  .has-dropdown:focus-within > .dropdown {
    opacity: 1; visibility: visible; transform: translateY(0);
  }
  .has-dropdown:hover > a::after { transform: rotate(-135deg) translateY(1px); }
}
/* Tap-to-open state (set by JS on both desktop click & mobile) */
.has-dropdown.open > .dropdown {
  opacity: 1; visibility: visible; transform: translateY(0);
}

/* Hamburger toggle (hidden on desktop) */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px; height: 44px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 22px; height: 2px;
  background: var(--ink);
  margin-inline: auto;
  transition: transform var(--transition), opacity var(--transition);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 480px;
  display: flex;
  align-items: center;
  color: #fff;
  /* Solid navy colour block for now.
     TODO: restore the door-entry work photo when ready by swapping this
     back to: linear-gradient(rgba(19,30,45,.62), rgba(19,30,45,.72)),
     url("../assets/images/hero-door-entry.jpg") center/cover no-repeat; */
  background: var(--navy-dark);
}
.hero__inner { max-width: 720px; padding-block: 60px; }
.hero h1 { color: #fff; }
.hero p { font-size: 1.2rem; color: rgba(255, 255, 255, 0.9); }
.hero .btn-row { margin-top: 26px; }

/* Compact hero for interior pages */
.page-hero {
  background: linear-gradient(120deg, var(--navy-dark), var(--steel));
  color: #fff;
  padding: clamp(48px, 8vw, 80px) 0;
  text-align: center;
}
.page-hero h1 { color: #fff; }
.page-hero p { color: rgba(255, 255, 255, 0.88); max-width: 640px; margin-inline: auto; }
.breadcrumb { font-size: 0.85rem; color: rgba(255,255,255,0.75); margin-bottom: 10px; letter-spacing: 1px; }
.breadcrumb a { color: rgba(255,255,255,0.9); }

/* ---------- Service cards (3-up grid) ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 28px;
}
.service-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
}
.service-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.service-card__media { aspect-ratio: 7 / 6; overflow: hidden; }
.service-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.service-card:hover .service-card__media img { transform: scale(1.05); }
.service-card__body { padding: 22px 24px 26px; flex: 1; display: flex; flex-direction: column; }
.service-card__body h3 { margin-bottom: 8px; }
.service-card__body p { color: var(--muted); font-size: 0.95rem; }
.service-card__link {
  margin-top: auto;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.82rem;
  letter-spacing: 1px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.service-card__link::after { content: "→"; transition: transform var(--transition); }
.service-card:hover .service-card__link::after { transform: translateX(4px); }

/* ---------- Icon feature grid (services page) ---------- */
.icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 28px;
}
.icon-card {
  text-align: center;
  padding: 34px 24px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}
.icon-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.icon-card .icon-badge {
  width: 84px; height: 84px;
  margin: 0 auto 18px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--bg-alt);
  color: var(--navy);
  transition: background var(--transition), color var(--transition);
}
.icon-card:hover .icon-badge { background: var(--navy); color: #fff; }
.icon-card .icon-badge svg,
.icon-card .icon-badge img { width: 44px; height: 44px; }
.icon-card h3 { margin-bottom: 6px; }
.icon-card p { color: var(--muted); font-size: 0.92rem; margin-bottom: 0; }

/* ---------- Content / prose layout ---------- */
.prose { max-width: 820px; }
.prose h2 { margin-top: 1.4em; }
.prose ul { list-style: none; padding: 0; }
.prose ul li {
  position: relative;
  padding: 4px 0 12px 30px;
}
.prose ul li::before {
  content: "";
  position: absolute;
  left: 0; top: 12px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--navy);
  box-shadow: 0 0 0 4px rgba(42, 74, 108, 0.14);
}
.prose ul li strong { color: var(--ink); }

.content-split {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 48px;
  align-items: center;
}
.content-split img { border-radius: var(--radius-lg); box-shadow: var(--shadow-md); width: 100%; }

/* ---------- CTA / contact action area ---------- */
.cta-panel {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px 32px;
  margin-top: 44px;
}
.cta-panel h3 { margin-bottom: 6px; }
.cta-panel p { color: var(--muted); margin-bottom: 18px; }

/* Round social/contact links used in CTA areas */
.social-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 18px; }
.social-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 18px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
  transition: transform var(--transition), filter var(--transition);
}
.social-btn:hover { transform: translateY(-2px); filter: brightness(1.05); color: #fff; }
.social-btn svg { width: 20px; height: 20px; }
.social-btn--whatsapp { background: var(--whatsapp); }
.social-btn--instagram { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }

/* ---------- Gallery ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}
.gallery-grid a {
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  aspect-ratio: 1 / 1;
}
.gallery-grid img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--transition); }
.gallery-grid a:hover img { transform: scale(1.06); }

/* ---------- Contact form ---------- */
.contact-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.contact-form { display: grid; gap: 16px; }
.contact-form label { font-weight: 600; font-size: 0.9rem; color: var(--ink); display: block; margin-bottom: 6px; }
.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font: inherit;
  color: var(--ink);
  background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--steel);
  box-shadow: 0 0 0 3px rgba(56, 97, 140, 0.15);
}
.contact-form textarea { resize: vertical; min-height: 130px; }
.form-note { font-size: 0.82rem; color: var(--muted); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--bg-deep);
  color: rgba(255, 255, 255, 0.82);
  padding: 46px 0 28px;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.site-footer .brand-mark { display: flex; align-items: center; gap: 14px; }
.site-footer .brand-mark img { height: 46px; background: #fff; padding: 6px 10px; border-radius: var(--radius); }
.footer-socials { display: flex; gap: 12px; }
.footer-socials a {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  transition: background var(--transition), transform var(--transition);
}
.footer-socials a:hover { background: var(--steel); transform: translateY(-3px); color: #fff; }
.footer-socials svg { width: 20px; height: 20px; }
.footer-bottom {
  text-align: center;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}

/* ---------- Scroll reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Responsive: tablet & mobile ---------- */
@media (max-width: 920px) {
  .nav-toggle { display: flex; }

  /* Guaranteed vertical breathing room on mobile so the logo is never
     flush against the top edge (belt-and-braces alongside the safe-area
     inset above). */
  .header-inner { padding-block: 10px; }

  .main-nav {
    position: fixed;
    /* Pin the open menu to the BOTTOM of the header, including the
       safe-area inset — otherwise it slides up over the logo and the
       phone/hamburger buttons on notched phones. */
    top: calc(var(--header-h) + env(safe-area-inset-top, 0px));
    left: 0;
    right: 0;
    bottom: auto;
    background: #fff;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    max-height: calc(100vh - var(--header-h) - env(safe-area-inset-top, 0px));
    overflow-y: auto;
    transform: translateY(-120%);
    transition: transform 0.3s ease;
    padding: 12px 16px 24px;
  }
  .main-nav.open { transform: translateY(0); }
  .main-nav ul { flex-direction: column; gap: 2px; }
  .main-nav a { padding: 14px 12px; border-radius: var(--radius); }

  /* Mobile dropdowns: accordion, in-flow */
  .dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    border-left: 2px solid var(--border);
    border-radius: 0;
    margin: 2px 0 6px 14px;
    padding: 0 0 0 8px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  .has-dropdown.open > .dropdown { max-height: 320px; }
  .has-dropdown > a::after { float: right; margin-top: 6px; }
  .has-dropdown.open > a::after { transform: rotate(-135deg); }

  .header-right { gap: 14px; }
  .content-split { grid-template-columns: 1fr; }
  .contact-layout { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .header-phone span { display: none; } /* keep icon only, save space */
  .brand img { height: 44px; }
  .btn-row { flex-direction: column; align-items: stretch; }
  .btn { justify-content: center; }
}
