/* ==========================================================================
   WordPress layer.

   Everything the static build did not need: core utility classes, editor
   output, states the PHP templates introduce (loading, errors, sticky header),
   and the small structural changes made for accessibility.

   Loads last, so it can adjust anything above it without !important.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CORE UTILITY CLASSES
   -------------------------------------------------------------------------- */

.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.screen-reader-text:focus {
  position: fixed !important;
  top: 16px;
  left: 16px;
  z-index: 1000;
  width: auto;
  height: auto;
  padding: 12px 20px;
  clip: auto;
  clip-path: none;
  background: var(--c-white);
  color: var(--c-title);
  border-radius: var(--r-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  font-size: 15px;
  font-weight: 600;
}

.skip-link:focus {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}

/* Editor alignment and caption classes. */
.alignleft   { float: left; margin: 0 24px 20px 0; }
.alignright  { float: right; margin: 0 0 20px 24px; }
.aligncenter { display: block; margin-inline: auto; }
.alignwide   { width: min(1200px, 100%); margin-inline: auto; }
.alignfull   { width: 100vw; max-width: 100vw; margin-left: 50%; transform: translateX(-50%); }

.wp-caption { max-width: 100%; }
.wp-caption img { display: block; }
.wp-caption-text,
.wp-element-caption,
figcaption {
  margin-top: 10px;
  font-size: var(--fs-p-sm);
  color: var(--c-text);
}

.sticky { position: relative; }

.page-links {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 32px;
  font-weight: 600;
}

.cc-placeholder {
  background-color: rgba(13, 13, 13, 0.04);
  object-fit: cover;
}

/* --------------------------------------------------------------------------
   2. STICKY HEADER
   The static build had no scrolled state; the sentinel is inserted by JS.
   -------------------------------------------------------------------------- */

.header-sentinel {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.has-sticky-header.is-scrolled .site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 90;
  background-color: rgba(15, 17, 46, 0.96);
  backdrop-filter: blur(8px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
  animation: cc-slide-down 0.3s ease;
}

.has-sticky-header.is-scrolled .site-header__inner { padding-block: 10px; }
.has-sticky-header.is-scrolled .site-logo svg,
.has-sticky-header.is-scrolled .site-logo img { transform: scale(0.86); transform-origin: left center; }

@keyframes cc-slide-down {
  from { transform: translateY(-100%); }
  to   { transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .has-sticky-header.is-scrolled .site-header { animation: none; }
}

/* Logo fallbacks: image or type, when no SVG symbol is supplied. */

.site-logo img,
.footer-brand__logo img { display: block; width: auto; max-width: 190px; height: auto; }
.site-logo img{
  max-width: 100px;
}
.site-logo__text { font-size: 22px; font-weight: 700; letter-spacing: 0.06em; color: var(--c-white); }

/* --------------------------------------------------------------------------
   3. ENQUIRE TAB — deferred reveal
   -------------------------------------------------------------------------- */

.enquire-tab--deferred {
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px) translateX(50%) rotate(-90deg);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

.enquire-tab--deferred.is-visible {
  opacity: 1;
  visibility: visible;
}

/* --------------------------------------------------------------------------
   4. AREAS SERVED — the panel is a div with a button trigger, so the
   "Learn More" link inside remains a real, focusable link. Reset the button
   and restore the collapse behaviour for a div child.
   -------------------------------------------------------------------------- */

.area-panel__label {
  appearance: none;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.area-panel__label:focus-visible {
  outline: 2px solid var(--c-white);
  outline-offset: 4px;
}

.area-panel__body > * { overflow: hidden; display: block; }
.area-panel__body a { display: inline-flex; }

/* Collapsed panels must not be reachable by keyboard. */
.area-panel:not(.is-open) .area-panel__body { visibility: hidden; }
.area-panel.is-open .area-panel__body { visibility: visible; }

/* --------------------------------------------------------------------------
   5. TESTIMONIALS & TIMELINE — every entry is in the DOM and toggled
   -------------------------------------------------------------------------- */

.testimonials__stage { position: relative; }
.testimonial[hidden] { display: none; }
.testimonial blockquote { margin: 0; }

.testimonials__count {
  font-size: var(--fs-p-sm);
  font-weight: 600;
  color: var(--c-text);
  margin-inline: 4px;
}

.testimonials__nav { display: flex; align-items: center; gap: 12px; }

.timeline__slide[hidden] { display: none; }

.timeline__slide {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 604px);
  gap: 40px;
  align-items: stretch;
}

.timeline__year {
  font-size: var(--fs-p-sm);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-primary);
  margin-bottom: 8px;
}

.timeline__nav { margin-top: 24px; }

.carousel-nav__btn[disabled] { opacity: 0.35; cursor: not-allowed; }

@media (max-width: 991.98px) {
  .timeline__slide { grid-template-columns: minmax(0, 1fr); gap: 24px; }
}

/* --------------------------------------------------------------------------
   6. FILTER TABS — now anchors rather than buttons
   -------------------------------------------------------------------------- */

.filter-tabs__btn {
  display: inline-block;
  text-decoration: none;
  appearance: none;
  border: 0;
  background: none;
  cursor: pointer;
}

.filter-tabs__btn:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 4px;
  border-radius: 4px;
}

.cc-results { position: relative; scroll-margin-top: 120px; }
.cc-results:focus { outline: none; }

.cc-results.is-loading { min-height: 240px; }
.cc-results.is-loading > * { opacity: 0.35; transition: opacity 0.2s ease; }

.cc-results.is-loading::after {
  content: '';
  position: absolute;
  top: 60px;
  left: 50%;
  width: 34px;
  height: 34px;
  margin-left: -17px;
  border: 3px solid rgba(231, 79, 27, 0.2);
  border-top-color: var(--c-primary);
  border-radius: 50%;
  animation: cc-spin 0.7s linear infinite;
}

@keyframes cc-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .cc-results.is-loading::after { animation-duration: 2s; }
}

/* --------------------------------------------------------------------------
   7. CONFIGURABLE GRID COLUMNS
   The section templates expose a --cols custom property so column counts are
   editable in the admin rather than hard-coded per page.
   -------------------------------------------------------------------------- */

.post-grid__grid    { grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); }
.gallery__grid      { grid-template-columns: repeat(var(--cols, 5), minmax(0, 1fr)); }
.metrics__grid      { grid-template-columns: repeat(var(--cols, 5), minmax(0, 1fr)); }
.numbered-cards__grid { grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); }
.stats__grid        { grid-template-columns: repeat(var(--stat-cols, 4), minmax(0, 1fr)); }

@media (max-width: 991.98px) {
  .post-grid__grid,
  .numbered-cards__grid { grid-template-columns: minmax(0, 1fr); }
  .gallery__grid,
  .metrics__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Spacing modifiers exposed by every section's Settings tab. */
.section--space-tight { padding-block: 48px; }
.section--space-loose { padding-block: 140px; }
.section--space-none  { padding-block: 0; }

@media (max-width: 991.98px) {
  .section--space-tight { padding-block: 32px; }
  .section--space-loose { padding-block: 64px; }
}

/* Banner overlay strength is set per page from the section's Settings tab.
   It feeds the existing --c-banner-overlay token rather than adding a second
   overlay layer on top of it. */
.banner[style*="--banner-overlay"] {
  --c-banner-overlay: rgba(25, 28, 79, var(--banner-overlay, 0.5));
}

/* --------------------------------------------------------------------------
   8. CARDS — small additions for WordPress data
   -------------------------------------------------------------------------- */

.project-card__title a,
.post-card__title a,
.service-row__title a,
.figure-card__title a,
.capability-card__title a {
  color: inherit;
  text-decoration: none;
}

.project-card__title a:hover,
.post-card__title a:hover,
.service-row__title a:hover,
.figure-card__title a:hover,
.capability-card__title a:hover { color: var(--c-primary); }

.project-card__client--logo img { display: block; max-height: 26px; width: auto; }

.post-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--c-text);
}

.post-card__dot { opacity: 0.5; }

.team-card { position: relative; }

.team-card__social {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--c-white);
  color: var(--c-secondary);
  opacity: 0;
  transition: opacity var(--t-base);
}

.team-card:hover .team-card__social,
.team-card__social:focus-visible { opacity: 1; }

.testimonial-card__rating { display: flex; gap: 3px; color: var(--c-primary); margin-bottom: 12px; }
.testimonial-card__body { margin: 0; border: 0; padding: 0; }

.compare-card__title { margin-bottom: 6px; }

.accreditations__grid { list-style: none; margin: 0; padding: 0; }
.accreditations__plain { padding-block: 8px; }
.accreditation img { max-width: 100%; height: auto; }

/* --------------------------------------------------------------------------
   9. FORMS
   -------------------------------------------------------------------------- */

.field-wrap { position: relative; display: flex; flex-direction: column; }

.field.has-error {
  border-color: #C62828;
  background-color: rgba(198, 40, 40, 0.03);
}

.field-error {
  margin-top: 6px;
  font-size: 13px;
  color: #C62828;
}

.cc-hp {
  position: absolute !important;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.cc-form__status {
  margin-block: 16px 0;
  font-size: var(--fs-p-sm);
  font-weight: 500;
}

.cc-form__status:empty { display: none; }
.cc-form__status.is-success { color: #1B7F3B; }
.cc-form__status.is-error { color: #C62828; }

.cc-form__privacy {
  margin-top: 14px;
  font-size: 12px;
  color: var(--c-text);
}

.cc-form__privacy a { color: var(--c-primary); }

.form-panel[hidden] { display: none; }

.cc-flash {
  padding-block: 14px;
  font-weight: 600;
  color: var(--c-white);
  scroll-margin-top: 120px;
}

.cc-flash:focus { outline: none; }
.cc-flash--success { background-color: #1B7F3B; }
.cc-flash--error { background-color: #C62828; }

.sort-control { display: flex; align-items: center; gap: 10px; }

/* --------------------------------------------------------------------------
   10. SEARCH
   -------------------------------------------------------------------------- */

.search-form { display: flex; gap: 10px; max-width: 520px; }
.search-form__field { flex: 1 1 auto; }
.search-form__submit { flex: none; }
.search-form-wrap { margin-bottom: 48px; }

.search-results { display: grid; gap: 28px; }

.search-result {
  padding: 26px 28px;
  background-color: var(--c-white);
  border: 1px solid rgba(13, 13, 13, 0.08);
  border-radius: var(--r-sm);
  transition: border-color var(--t-base), transform var(--t-base);
}

.search-result:hover { border-color: var(--c-primary); transform: translateY(-2px); }

.search-result__type {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-primary);
  margin-bottom: 8px;
}

.search-result__title { font-size: var(--fs-h5); margin-bottom: 10px; }
.search-result__title a { color: var(--c-title); text-decoration: none; }
.search-result__title a:hover { color: var(--c-primary); }
.search-result__excerpt { margin-bottom: 16px; }

.no-results {
  padding: 64px 32px;
  text-align: center;
  background-color: var(--c-bg-light);
  border-radius: var(--r-md);
}

.no-results__title { font-size: var(--fs-h4); margin-bottom: 12px; }
.no-results__text { max-width: 520px; margin-inline: auto; margin-bottom: 24px; }
.no-results .search-form { margin-inline: auto; }

/* --------------------------------------------------------------------------
   11. LIGHTBOX ADDITIONS
   -------------------------------------------------------------------------- */

.lightbox[hidden] { display: none; }
.lightbox__figure { margin: 0; display: grid; place-items: center; gap: 14px; }

.lightbox__caption {
  max-width: 60ch;
  text-align: center;
  font-size: var(--fs-p-sm);
  color: rgba(255, 255, 255, 0.82);
}

.lightbox__caption:empty { display: none; }

.lightbox__count {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
}

.lightbox__btn[hidden] { display: none; }

/* --------------------------------------------------------------------------
   12. MAP — click to load
   -------------------------------------------------------------------------- */

.map { position: relative; }
.map__inner { position: relative; height: var(--map-height, 540px); overflow: hidden; }
.map__preview { position: relative; height: 100%; display: grid; place-items: center; }
.map__image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.map__preview::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(15, 17, 46, 0.45);
}

.map__load { position: relative; z-index: 1; }

.map__note {
  position: relative;
  z-index: 1;
  margin-top: 12px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
}

.map__inner.is-loaded { display: block; }
.map__inner iframe { display: block; width: 100%; height: 100%; border: 0; }

/* --------------------------------------------------------------------------
   13. ARTICLE, BREADCRUMB & MISC ADDITIONS
   -------------------------------------------------------------------------- */

.banner__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  font-size: var(--fs-p-sm);
  color: rgba(255, 255, 255, 0.82);
}

.banner__meta a { color: var(--c-white); text-decoration: underline; text-underline-offset: 3px; }
.banner--compact { min-height: 420px; }

.article__inner--narrow { max-width: 760px; }
.article__updated { font-size: 13px; color: var(--c-text); margin-bottom: 24px; }
.article__tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 32px; font-size: var(--fs-p-sm); }
.article__tags a { color: var(--c-primary); }

.project-intro__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  margin-block: 24px;
}

.project-intro__meta dt {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-primary);
  margin-bottom: 4px;
}

.project-intro__meta dd { margin: 0; font-weight: 500; color: var(--c-title); }

.contact-detail__value { display: block; }
.footer-contact__item--static { cursor: default; }

.sidebar-nav__count {
  margin-left: auto;
  font-size: 12px;
  opacity: 0.6;
}

.sidebar-nav__link { display: flex; align-items: center; gap: 10px; width: 100%; }

.faqs__grid--single { grid-template-columns: minmax(0, 1fr); }
.faq-item__heading { margin: 0; font-size: inherit; font-weight: inherit; }
.process-item__heading { margin: 0; font-size: inherit; font-weight: inherit; }

.error__search { max-width: 480px; margin-block: 28px; }
.error__links { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 28px; list-style: none; padding: 0; }
.error__link { color: var(--c-white); text-decoration: underline; text-underline-offset: 4px; }
.error__link:hover { color: var(--c-primary); }

.embed-section__inner > *:last-child { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   14. COMMENTS
   -------------------------------------------------------------------------- */

.comments-section { padding-block: 60px 100px; }
.comments-title { font-size: var(--fs-h4); margin-bottom: 32px; }
.comment-list { list-style: none; padding: 0; margin: 0 0 40px; display: grid; gap: 28px; }
.comment-list .children { list-style: none; padding-left: 32px; margin-top: 24px; display: grid; gap: 24px; }

.comment-body {
  padding: 24px;
  background-color: var(--c-bg-light);
  border-radius: var(--r-sm);
}

.comment-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.comment-author img { border-radius: 50%; }
.comment-form { display: grid; gap: 16px; }
.comment-form label { font-size: var(--fs-p-sm); font-weight: 500; margin-bottom: 6px; display: block; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea { width: 100%; }

/* --------------------------------------------------------------------------
   15. WIDGETS / SIDEBAR
   -------------------------------------------------------------------------- */

.sidebar-layout--right { grid-template-columns: minmax(0, 1fr) 320px; }

.widget { margin-bottom: 36px; }
.widget-title { font-size: var(--fs-h6); margin-bottom: 16px; }
.widget ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.widget a { color: var(--c-title); }
.widget a:hover { color: var(--c-primary); }

@media (max-width: 991.98px) {
  .sidebar-layout--right { grid-template-columns: minmax(0, 1fr); }
}

/* --------------------------------------------------------------------------
   16. ADMIN BAR OFFSET
   -------------------------------------------------------------------------- */

.admin-bar.has-sticky-header.is-scrolled .site-header { top: 32px; }

@media (max-width: 782px) {
  .admin-bar.has-sticky-header.is-scrolled .site-header { top: 46px; }
}

/* --------------------------------------------------------------------------
   17. PRINT
   -------------------------------------------------------------------------- */

@media print {
  .topbar,
  .site-header,
  .mobile-menu,
  .enquire-tab,
  .site-footer,
  .cta-banner,
  .filter-tabs,
  .pagination,
  .lightbox,
  .map { display: none !important; }

  .banner { min-height: 0; padding-block: 24px; }
  .banner__media { display: none; }
  .banner__title, .banner__text { color: #000; }
  body { background: #fff; color: #000; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 11px; }
}

/* --------------------------------------------------------------------------
   18. SMALL ADDITIONS FOR TEMPLATE ELEMENTS NOT IN THE STATIC BUILD
   -------------------------------------------------------------------------- */

.metrics__title {
  font-size: var(--fs-h3);
  color: var(--c-white);
  margin-bottom: 44px;
  max-width: 20ch;
}

.section--light .metrics__title,
.section--white .metrics__title { color: var(--c-title); }

.banner__cats a { color: var(--c-primary); }

.process__intro { display: flex; flex-direction: column; }

.cc-form { display: block; }

@media (max-width: 991.98px) {
  .metrics__title { font-size: var(--fs-h4); margin-bottom: 28px; }
}
