/* Base Styles */

@font-face{
  font-family: 'Esqadero';
  src: url('fonts/Esqadero-Regular.otf') format('opentype'),
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Esqadero', sans-serif;
  background-color: #111;
  color: #fff;
  scroll-behavior: smooth;
}

#loader {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.4);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

#loader.hidden {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

#loader .spinner {
  border: 5px solid #fff;
  border-top: 5px solid transparent;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

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

.hero {
  position: relative;
  min-height: 100vh;
}

.hero-slides {
  position: relative;
  height: 100vh; 
  z-index: 3;
}

.slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

.slide.active {
  opacity: 1;
  z-index: 4;
}

.hero-slides .slide:first-child {
  opacity: 1;
}

.hero .slide.active::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-color: #000;
  z-index: 2;
  animation: fadeOut 1s ease forwards;
  pointer-events: none;
}

@keyframes fadeOut {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

.hero-content {
  position: absolute;
  top: 2rem;
  left: 1rem;
  z-index: 5;
}

.hero-content img {
  width: 425px;
  display: block;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.7));
}

.hero-content p {
  color: #fff;
  margin-left: 0.2rem;
  white-space: nowrap;
  text-transform: uppercase;
  text-shadow:
  0 1px 3px rgba(0, 0, 0, 1),
  0 3px 6px rgba(0, 0, 0, 0.9),
  0 5px 12px rgba(0, 0, 0, 0.7);
}

.hero-caption {
  position: absolute;
  bottom: 2rem;
  right: 1rem;
  z-index: 10;
  font-size: 0.9rem;
  color: #ccc;
  text-align: right;
  text-transform: uppercase;
  max-width: 90%;
  text-shadow:
  0 1px 3px rgba(0, 0, 0, 1),
  0 3px 6px rgba(0, 0, 0, 0.9),
  0 5px 12px rgba(0, 0, 0, 0.7);
}

.hero-description {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  z-index: 10;
  font-size: 0.9rem;
  color: #ccc;
  text-align: right;
  text-transform: uppercase;
  max-width: 90%;
  text-shadow:
  0 1px 3px rgba(0, 0, 0, 1),
  0 3px 6px rgba(0, 0, 0, 0.9),
  0 5px 12px rgba(0, 0, 0, 0.7);
}

nav.site-navigation {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10;
}

nav.site-navigation a {
  color: white;
  text-decoration: none;
  margin-left: 1.5rem;
  font-size: 1rem;
  text-transform: uppercase;
  text-shadow:
  0 1px 3px rgba(0, 0, 0, 1),
  0 3px 6px rgba(0, 0, 0, 0.9),
  0 5px 12px rgba(0, 0, 0, 0.7);
}

nav.site-navigation a:hover {
  opacity: 0.6;
}

/* Section Styles */
.section {
  padding: 4rem 2rem;
  background-color: #003058;
  transform: translateY(50px);
  opacity: 0;
  transition: transform 0.6s ease-out, opacity 0.6s ease-out;
}

.section.visible {
  transform: translateY(0);
  opacity: 1;
}

.section h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: white;
  font-family: 'Esqadero', sans-serif;
  text-transform: uppercase;
}

/* News and Work Grids */
.our-work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  justify-content: center;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin: 0 auto;
  justify-content: center;
}

.news-item {
  background-color: white;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  border-radius: 8px;
  overflow: hidden;
  color: #003058;
  font-family: 'Esqadero', sans-serif;
  text-transform: uppercase;
  transition: transform 0.3s ease;
  cursor: pointer;
}

.our-work-item {
  background-color: white;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  border-radius: 8px;
  overflow: hidden;
  color: #003058;
  font-family: 'Esqadero', sans-serif;
  text-transform: uppercase;
  transition: transform 0.3s ease;
  cursor: pointer;
}

.news-item:hover, .our-work-item:hover {
  transform: scale(1.01);
}

.news-item img, .our-work-item img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

.our-work-item img {
  object-fit: contain;
  background-color: #000;
}

.news-item h3 {
  margin: 1rem;
  font-size: 1.1rem;
}

.news-item a {
  color: #003058;
  text-decoration: none;
}

.news-item a:hover {
  text-decoration: underline;
}

/* Drawer */
.drawer-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.95);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  overflow: hidden;
}

.drawer-overlay.open {
  display: flex;
}

.drawer-content {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100vw;
  height: 100vh;
}

.drawer-content img {
  display: none;
  max-width: 95vw;
  max-height: 90vh;
  object-fit: contain;
}

.drawer-content img.active {
  display: block;
}

.drawer-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 2rem;
  color: white;
  cursor: pointer;
  z-index: 10000;
}

.drawer-nav {
  position: absolute;
  top: 50%;
  left: 1rem;
  right: 1rem;
  display: flex;
  justify-content: space-between;
  transform: translateY(-50%);
  pointer-events: none;
}

.drawer-nav button {
  pointer-events: all;
  background: rgba(255,255,255,0.2);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 1rem;
}

/* Contact Section */
.contact-section {
  background-color: #fff;
  color: #003058;
  margin-top: 0;
  padding: 0rem 2rem;
}

#contact.section {
  padding-top: 0rem;
}


.contact-section a {
  text-decoration: none;
  color: #003058;
}

.contact-section a:hover {
  text-decoration: underline; /* optional for hover effect */
  opacity: 0.7; /* optional */
}


.contact-section h2 {
  font-size: 2rem;
  margin-top: 0;
  margin-bottom: 1rem;
  text-transform: uppercase;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: end;
  gap: 2rem;
}

.contact-left {
  text-align: left;
  align-self: start;
}

.contact-centre {
  text-align: center;
}

.contact-right {
  text-align: right;
}

.social-icons {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

.social-icons svg {
  fill: #003058;
  width: 40px;
  height: 40px;
  transition: opacity 0.3s ease;
}

.social-icons svg:hover {
  opacity: 0.6;
}

/* Desktop */
@media (min-width: 1200px) {
  .news-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Mobile Styles */
@media (max-width: 767px) and (orientation: portrait) {
 nav.site-navigation {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      background-color: rgba(0, 0, 0, 0.85);
      display: flex;
      justify-content: center; /* this ensures center alignment */
      flex-wrap: wrap;
      gap: 1rem;
      padding: 0.5rem 1rem;
      z-index: 100;
      box-sizing: border-box;
    }

    nav.site-navigation a {
      margin: 0.25rem 0.5rem;
      font-size: 0.7rem;
      text-align: center;
    }

    .hero-content {
      top: 2.5rem !important;
      left: 1rem;
      transform: none;
      text-align: left;
    }

    .hero-content img {
      width: 85%;
      max-width: 400px;
      height: auto;
      filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.7));
    }

    .hero-content p {
      margin-top: 0.5rem;
      margin-left: 0.1rem;
      white-space: normal;
      font-size: 0.7rem;
      padding-left: 0;
      margin-top: 0.5rem;
      line-height: 1.4;
      text-align: left;
      text-shadow:
      0 1px 3px rgba(0, 0, 0, 1),
      0 3px 6px rgba(0, 0, 0, 0.9),
      0 5px 12px rgba(0, 0, 0, 0.7);
    }
    
    .hero-caption, .hero-description {
      font-size: 0.6rem;
      text-transform: uppercase;
    }

  .section {
    scroll-margin-top: 1rem;
    padding: 2rem 1rem;
  }

  #contact {
    padding: 2rem 1rem;
    text-align: center;
  }

  .contact-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }

  .contact-left,
  .contact-centre,
  .contact-right {
    text-align: center;
    margin-bottom: 1rem;
    width: 100%;
  }

  .social-icons {
    justify-content: center;
  }

  .drawer-nav {
    top: auto;
    bottom: 10rem;
    left: 0;
    right: 0;
    transform: none;
    justify-content: center;
    gap: 1rem;
  }
}

@media (max-width: 767px) {
  @supports (height: 100svh) {
    .hero,
    .hero-slides {
      min-height: 100svh;
      height: 100svh;
    }
  }
}

/* Tablet Styles */
@media (min-width: 768px) and (orientation: portrait) {
  nav.site-navigation {
    justify-content: flex-end;
    padding: 0.5rem 1rem;
    flex-wrap: nowrap;
  }

  .hero-content {
    top: 2.5rem;
    left: 1.5rem;
  }

  .hero-content img {
    max-width: 280px;
  }

  .hero-content p {
    font-size: 1rem;
    line-height: 1.4;
    white-space: normal;
  }

  .drawer-nav {
    bottom: 8rem;
  }

  .contact-section {
    padding: 3rem 2rem;
  }

  .contact-grid {
    grid-template-columns: 1fr 1fr;
    text-align: left;
    gap: 2rem;
  }

  .contact-right {
    grid-column: span 2;
    justify-content: center;
    text-align: center;
  }

  .social-icons {
    justify-content: center;
  }
}

/* === Single Post Layout === */

.single-hero { position:relative; min-height: 50vh; display:flex; align-items:flex-end; padding: clamp(2rem, 6vw, 4rem) 2rem; background:#000; overflow:hidden; }
.single-hero.has-image { background-size: cover; background-position: center; }
.single-hero::after { content:""; position:absolute; inset:0; background: linear-gradient(to top, rgba(0,0,0,.68), rgba(0,0,0,.15)); }
.single-hero .inner { position:relative; z-index:1; max-width: 1100px; }
.single-meta { opacity:.85; text-transform:uppercase; letter-spacing:.04em; font-size:.85rem; display:flex; flex-wrap:wrap; gap:.35rem .5rem; align-items:center; }
.single-cats { background:#003058; color:#fff; padding:.15rem .5rem; border-radius:.35rem; }

.single-main { max-width: 1100px; margin: 0 auto; padding: 2rem; }


/* Typography inside posts */
.typography h2, .typography h3, .typography h4 { font-family:'Esqadero', sans-serif; text-transform:uppercase; margin: 2rem 0 1rem; line-height:1.2; }
.typography p { margin: 0 0 1.1rem; }
.typography ul, .typography ol { margin: 0 0 1.2rem 1.1rem; }
.typography blockquote { margin: 1.5rem 0; padding: .5rem 1rem; border-left: 4px solid #003058; color:#ddd; }
.typography img, .typography figure, .typography iframe { max-width:100%; height:auto; }
.typography figure { margin: 1.2rem 0; }
.typography figcaption { font-size:.9rem; opacity:.8; }


/* Related posts */
.related-posts { padding: 2rem; }
.related-inner { max-width:1100px; margin:0 auto; }
.related-title { font-family:'Esqadero', sans-serif; text-transform:uppercase; font-size: clamp(1.2rem, 2.4vw, 1.6rem); margin: 2.5rem 0 1rem; }
.related-grid { display:grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap:1.25rem; }
.related-card { background:#161616; border-radius:.8rem; overflow:hidden; border:1px solid rgba(255,255,255,.06); }
.related-thumb { display:block; aspect-ratio: 16/9; overflow:hidden; }
.related-thumb img { width:100%; height:100%; object-fit:cover; display:block; }
.thumb-placeholder { width:100%; height:100%; background:#222; }
.related-card-title { margin: .85rem 1rem 1rem; font-size:1rem; line-height:1.25; font-family:'Esqadero', sans-serif; text-transform:uppercase; }
.related-card-title a { color:#fff; text-decoration:none; }
.related-card-title a:hover { text-decoration:underline; text-underline-offset:2px; }
.related-empty { opacity:.8; }


/* Post pager */
.post-pager { display:flex; justify-content:space-between; gap:1rem; max-width:1100px; margin: 1.5rem auto 3rem; padding: 0 2rem; }
.post-pager a { display:inline-block; background:#003058; color:#fff; padding:.75rem 1rem; border-radius:.7rem; text-decoration:none; text-transform:uppercase; letter-spacing:.04em; }
.post-pager a:hover { opacity:.92; }


/* Keep clear of fixed mobile nav */
@media (max-width: 767px) and (orientation: portrait) {
body.single .single-hero { padding-top: 5.5rem; /* clears your fixed .site-navigation */ }
}


/* Mobile layout: stack related cards */
@media (max-width: 767px) {
.related-grid { grid-template-columns: 1fr; }
}

/* === Single Post: bring it inline with homepage look === */

body.single { background:#003058; }

/* Title: same vibe as hero text (subtle shadow for readability) */
.single-title {
  font-family: 'Esqadero', sans-serif; 
  text-transform: uppercase;
  text-shadow:
    0 1px 3px rgba(0,0,0,1),
    0 3px 6px rgba(0,0,0,.9),
    0 5px 12px rgba(0,0,0,.7);
}

/* Meta chips match site style */
.single-meta { gap:.35rem .5rem; }
.single-meta .read-time { background:#1a1a1a; border-radius:.35rem; padding:.15rem .5rem; }

/* Links match homepage (white + underline on hover) */
.typography a {
  color:#fff;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,.35);
  padding-bottom: 1px;
}
.typography a:hover { opacity:.9; }

.entry-content .wp-block-button__link:hover,
.typography .wp-element-button:hover { opacity:.92; }

.typography figure { margin:1.2rem 0; }

/* Tables & separators */
.typography table {
  width:100%;
  border-collapse: collapse;
  background:#161616;
  border:1px solid rgba(255,255,255,.06);
  border-radius:.6rem;
  overflow:hidden;
}
.typography th,
.typography td {
  padding:.6rem .8rem;
  border-bottom:1px solid rgba(255,255,255,.06);
}
.typography .wp-block-separator {
  border:none;
  height:1px;
  background:rgba(255,255,255,.15);
  margin:2rem 0;
}

/* Core block widths to match your 1100px content frame */
.single-main { max-width:1100px; margin:0 auto; padding:2rem; }

/* Embeds and iframes (YouTube, etc.) */
.entry-content iframe,
.entry-content .wp-block-embed__wrapper iframe {
  width:100%;
  max-width:100%;
  aspect-ratio:16/9;
  height:auto;
  border:0;
  border-radius:.6rem;
  box-shadow: 0 4px 12px rgba(0,0,0,.35);
}

/* Galleries */
.entry-content .wp-block-gallery { gap: .75rem; }
.entry-content .wp-block-gallery .wp-block-image img {
  border-radius:.5rem;
  box-shadow: 0 4px 12px rgba(0,0,0,.35);
}

/* Justify body copy on single posts */
body.single .entry-content p,
body.single .typography p {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, "Noto Sans", "Liberation Sans", sans-serif;
  text-transform: none;          /* ensure paragraphs aren’t forced uppercase */
  letter-spacing: normal;
  text-align: justify;
  text-justify: inter-word;        /* nicer spacing where supported */
  hyphens: auto;                   /* use dictionary hyphenation */
  -webkit-hyphens: auto;
  -ms-hyphens: auto;
  overflow-wrap: anywhere;         /* avoid overflow on long strings/URLs */
}

/* Keep headings, captions and buttons NOT justified */
body.single .entry-content h1,
body.single .entry-content h2,
body.single .entry-content h3,
body.single .entry-content h4,
body.single .entry-content figcaption,
body.single .entry-content .wp-block-button__link {
  text-align: left;
}

/* Optional: on very narrow phones, revert to left for readability */
@media (max-width: 360px) {
  body.single .entry-content p,
  body.single .typography p { text-align: left; }
}

/* === Fullscreen single-post hero (match homepage) === */

/* Make the hero truly fullscreen */
body.single .single-hero {
  /* use modern viewport unit for mobile address bars */
  height: 100vh;
  height: 100svh;
  min-height: 100svh;

  display: flex;
  align-items: flex-end;          /* title + meta sit at the bottom like home */
  justify-content: flex-start;
  padding: clamp(2rem, 6vw, 4rem) 2rem;

  position: relative;
  overflow: hidden;
  background: #003058;            /* fallback colour if no featured image */
}

/* Keep featured image behaviour identical to home hero */
body.single .single-hero.has-image {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Soft gradient for readability (correct alpha values) */
body.single .single-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0,0,0,.68),
    rgba(0,0,0,.15)
  );
  pointer-events: none;
}

/* Keep content above overlay */
body.single .single-hero .inner {
  position: relative;
  z-index: 1;
  max-width: 1100px;
}

/* Title + meta: large, uppercase, with subtle glow like home */
body.single .single-title {
  font-family: 'Esqadero', sans-serif;
  text-transform: uppercase;
  font-size: clamp(2rem, 6vw, 4.5rem);
  line-height: 1.05;
  margin: 0 0 .6rem;
  text-shadow:
    0 1px 3px rgba(0,0,0,1),
    0 3px 6px rgba(0,0,0,.9),
    0 6px 18px rgba(0,0,0,.7);
}

body.single .single-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .5rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-size: .9rem;
  opacity: .9;
}

body.single .single-cats {
  background: #003058;
  color: #fff;
  padding: .15rem .5rem;
  border-radius: .35rem;
}

body.single .single-meta .read-time {
  background: #1a1a1a;
  padding: .15rem .5rem;
  border-radius: .35rem;
}

/* Remove any earlier offset that pushed the hero down on mobile */
@media (max-width: 767px) and (orientation: portrait) {
  body.single .single-hero {
    /* allow for notches / iOS bars without shrinking the hero */
    padding-top: max(1rem, calc(env(safe-area-inset-top) + 3.5rem));
    padding-bottom: max(2rem, env(safe-area-inset-bottom));
  }
}

/* If WP admin bar is showing, keep content clear of it */
body.admin-bar.single .single-hero {
  padding-top: calc(clamp(2rem, 6vw, 4rem) + 32px);
}

/* Main content begins right after the fullscreen hero */
body.single .single-main { margin-top: 0; }

body.single .hero-scroll {
  display:inline-block;
  margin-top: 1rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,.4);
  padding-bottom: 2px;
  opacity: .9;
}
body.single .hero-scroll:hover { opacity: 1; }



/* === FIX: keep single hero fully on-screen === */
body.single .single-hero {
  /* include padding inside the viewport height */
  box-sizing: border-box;

  /* let padding fit inside the viewport */
  height: auto;            /* override any previous height */
  min-height: 100svh;      /* modern viewport unit; respects mobile bars */

  /* tighter, consistent padding */
  padding: clamp(1.5rem, 5vw, 3rem) 2rem clamp(1.75rem, 4vw, 3rem);

  /* keep previous intent */
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  overflow: hidden;
}

/* Mobile: avoid double-padding – only account for safe areas */
@media (max-width: 767px) {
  body.single .single-hero {
    padding-top: max(1rem, env(safe-area-inset-top));
    padding-bottom: max(1.25rem, env(safe-area-inset-bottom));
  }
}

/* If admin bar is visible, add a *small* top cushion without overgrowing */
body.admin-bar.single .single-hero {
  padding-top: calc(max(1rem, env(safe-area-inset-top)) + 24px);
}

/* Slightly tighten title on smaller screens so meta stays visible */
@media (max-width: 480px) {
  body.single .single-title {
    font-size: clamp(1.8rem, 7vw, 3rem);
  }
}
