/* ============================================================
   ADDITIONAL / OVERRIDE STYLES
   Loaded last per PROJECT-GUIDELINES.md so rules here always
   take priority over signstar.css, theme.css, forms.css.
   ============================================================ */


/* ---- Nav Dropdown — Centred Under Parent + Balanced Columns ----
   All dropdowns (1, 2, 3 col) sit centred horizontally beneath their
   parent link. Multi-column variants use CSS columns so items
   distribute evenly across the columns instead of filling top-down.
   Mobile (<=1024px) reverts to single column, full width, no centre.
   ============================================================ */

/* Centre every dropdown under its parent link. */
.has-dropdown:hover .dropdown-menu {
    left: 50%;
    transform: translateX(-50%);
}

/* 2- and 3-column variants — naturally balanced via CSS columns. */
.dropdown-menu--2col,
.dropdown-menu--3col {
    column-gap: 1rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}
.dropdown-menu--2col {
    column-count: 2;
    min-width: 460px;
}
.dropdown-menu--3col {
    column-count: 3;
    min-width: 680px;
}
/* Keep menu items intact within a column (no mid-item breaks). */
.dropdown-menu--2col li,
.dropdown-menu--3col li {
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;
}

/* Mobile — single column, full width, no centring transform. */
@media (max-width: 1024px) {
    .has-dropdown:hover .dropdown-menu,
    .has-dropdown:hover .dropdown-menu--2col,
    .has-dropdown:hover .dropdown-menu--3col {
        left: auto;
        transform: none;
    }
    .dropdown-menu--2col,
    .dropdown-menu--3col {
        column-count: 1;
        min-width: 0;
        padding-left: 0;
        padding-right: 0;
    }
}


/* ---- Gallery Image Caption Bar ----
   Always-visible translucent bar across the bottom of gallery
   tiles. Reads from the WP attachment Caption field.
   Used on cs-gallery-item (case study) and svc-gallery-item (service).
   ============================================================ */
.cs-gallery-item,
.svc-gallery-item {
    position: relative;       /* ensure caption is anchored to item */
}
.gallery-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0.6rem 0.9rem;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 0.85rem;
    line-height: 1.35;
    font-weight: 500;
    pointer-events: none;
    z-index: 2;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
@media (max-width: 600px) {
    .gallery-caption {
        font-size: 0.78rem;
        padding: 0.5rem 0.7rem;
    }
}


/* ---- Logo Invert ----
   Per-logo ACF toggle (invert_logo) adds .logo-strip__img--invert
   to a logo when it's dark-on-dark and needs to be made white.
   ============================================================ */
.logo-strip__img--invert {
    filter: brightness(0) invert(1);
}


/* ---- Mobile Nav (≤1024px) ----
   Overrides the existing 768px rules in signstar.css/theme.css so
   the drawer behaviour kicks in earlier. Drawer is scrollable.
   Parent-with-children items keep their child links hidden until
   the user taps the chevron toggle.
   ============================================================ */

/* Chevron toggle button is desktop-hidden by default. */
.dropdown-toggle {
    display: none;
    background: transparent;
    border: 0;
    padding: 0;
    margin-left: 0.35rem;
    color: inherit;
    cursor: pointer;
    line-height: 0;
    transition: transform 0.25s ease;
}
.dropdown-toggle svg { display: block; }

@media (max-width: 1024px) {

    /* Show mobile menu toggle */
    .mobile-menu-toggle {
        display: flex !important;
        z-index: 201;
    }

    /* Header positioned for absolute drawer */
    .header-nav { position: relative; }

    /* Drawer hidden by default, shown when .active */
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--surface-dark);
        border-top: 1px solid var(--border-subtle);
        border-bottom: 1px solid var(--border-subtle);
        flex-direction: column;
        padding: 12px 20px 20px;
        z-index: 200;
        /* SCROLLABLE: cap at viewport minus header, scroll overflow */
        max-height: calc(100vh - 70px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
    .nav-links.active { display: flex; }

    .nav-links li {
        list-style: none;
        width: 100%;
    }

    .nav-links a {
        font-size: 1rem;
        display: block;
        padding: 10px 12px;
        border-radius: 6px;
    }

    /* Parent item with children: align link + chevron in a row */
    .has-dropdown {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
    }
    .has-dropdown > a {
        flex: 1 1 auto;
    }
    .dropdown-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 38px;
        flex-shrink: 0;
        border-radius: 6px;
    }
    .dropdown-toggle:hover,
    .dropdown-toggle:focus-visible {
        background: rgba(255, 255, 255, 0.06);
    }
    .has-dropdown.is-expanded > .dropdown-toggle {
        transform: rotate(180deg);
    }

    /* Submenu hidden by default; shown when parent has .is-expanded */
    .has-dropdown .dropdown-menu,
    .has-dropdown .dropdown-menu--2col,
    .has-dropdown .dropdown-menu--3col {
        display: none !important;
        position: static;
        background: transparent;
        border: none;
        box-shadow: none;
        padding: 0 0 0 1rem;
        min-width: 0;
        column-count: 1;
        flex-basis: 100%;
        transform: none;
        left: auto;
    }
    .has-dropdown.is-expanded .dropdown-menu,
    .has-dropdown.is-expanded .dropdown-menu--2col,
    .has-dropdown.is-expanded .dropdown-menu--3col {
        display: block !important;
    }

    .nav-cta {
        display: inline-block !important;
        width: auto !important;
        margin-top: 12px;
        text-align: center;
    }

    .header-tagline { display: none; }
}

/* ============================================================
   Block: Offices
   ============================================================ */

.offices-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  max-width: 1140px;   /* was 980px */
  margin: var(--space-xl) auto 0;
}

.office-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.35s var(--ease-out), border-color 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out);
}

.office-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--deep-sky-blue);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease-out);
  z-index: 2;
}

.office-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-accent);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
}

.office-card:hover::before { transform: scaleX(1); }

.office-card-map {
  position: relative;
  width: 100%;
  height: 240px;
  background: var(--surface-card-hover);
  line-height: 0;
}

.office-card-map iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.office-card-body { padding: var(--space-md); }

.office-card-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white);
  margin: 0 0 var(--space-sm);
}

.office-card-details {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md) var(--space-lg);
  align-items: flex-start;
}

.office-address {
  flex: 1 1 200px;
  font-style: normal;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
}

.office-meta {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-sm);
}

.office-meta li {
  display: flex;
  align-items: baseline;
  gap: var(--space-md);
}

.office-meta-label {
  flex: 0 0 56px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.office-meta a {
  color: var(--deep-sky-blue);
  text-decoration: none;
  transition: color 0.25s var(--ease-out);
}

.office-meta a:hover { text-decoration: underline; }

@media (max-width: 767px) {
  .offices-grid { grid-template-columns: 1fr; }
}

/* Footer addresses */
.footer-addresses {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: var(--space-md);
}
.footer-address {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-style: normal;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-secondary);
  max-width: 320px;
  padding: 0.8rem 0.95rem;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  transition: border-color 0.25s var(--ease-out), transform 0.25s var(--ease-out);
}
.footer-address:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
}
.footer-address-icon {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--glow-blue);
  display: grid;
  place-items: center;
}
.footer-address-icon::before {
  content: '';
  width: 18px;
  height: 18px;
  background-color: var(--deep-sky-blue);
  -webkit-mask: url('https://signstar.co.uk/wp-content/uploads/map-pin-thin-full.svg') no-repeat center / contain;
          mask: url('https://signstar.co.uk/wp-content/uploads/map-pin-thin-full.svg') no-repeat center / contain;
}
.footer-address-label {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--white);
  margin-bottom: 1px;
}

/* ============================================================
   Block: Team
   ============================================================ */
.team-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  align-items: start;
  margin: var(--space-xl) 0 0;
}

.team-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.35s var(--ease-out), border-color 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out);
}

.team-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-accent);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
}

.team-card-photo {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--surface-card-hover);
  overflow: hidden;
}

.team-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.team-card-body {
  padding: var(--space-sm);
}

.team-card-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--white);
  margin: 0 0 0.15rem;
}

.team-card-role {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--deep-sky-blue);
  margin: 0 0 0.5rem;
}

.team-card-bio {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.team-card-bio p { margin: 0; }

.team-card-linkedin {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: var(--space-sm);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--deep-sky-blue);
  text-decoration: none;
  transition: color 0.25s var(--ease-out);
}

.team-card-linkedin svg { flex: 0 0 16px; }

.team-card-linkedin:hover { color: var(--white); }

/* WYSIWYG intro text spacing (scoped to this block) */
.team .section-subtitle p { margin: 0 0 0.75em; }
.team .section-subtitle p:last-child { margin-bottom: 0; }

@media (max-width: 1200px) {
  .team-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 991px) {
  .team-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 479px) {
  .team-grid { grid-template-columns: 1fr; }
}