/* =============================================
   PDR-Team Australia — Custom CSS
   Only styles that cannot be expressed as Tailwind utilities:
   pseudo-elements, keyframes, nth-child rules, complex selectors
   ============================================= */

/* ===== CONTACT STRIP ===== */
.contact-strip {
  position: relative;
  overflow: hidden;
}
.contact-strip > div {
  position: relative;
  z-index: 1;
}
/* White left half with skewed right edge */
.contact-strip::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -40px;
  right: min(50%, calc(50vw - 100px));
  background: #fff;
  transform: skewX(-20deg);
  z-index: 0;
  animation: stripSlideIn 0.6s ease-out backwards;
}
@keyframes stripSlideIn {
  from { right: 100%; }
}
.contact-strip a:hover svg { opacity: 1; }
.contact-strip .contact-strip-bars {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  display: flex;
  gap: 3px;
  align-items: center;
}
.contact-strip-bars span {
  display: block;
  width: 18px;
  height: 4px;
  transform: skewX(-20deg);
}
.contact-strip-bars span:nth-child(1) { background: #545454; animation: stripBarIn 0.4s 0.5s ease-out backwards; }
.contact-strip-bars span:nth-child(2) { background: #005291; animation: stripBarIn 0.4s 0.6s ease-out backwards; }
.contact-strip-bars span:nth-child(3) { background: #005291; opacity: 0.5; animation: stripBarIn 0.4s 0.7s ease-out backwards; }
@keyframes stripBarIn {
  from { opacity: 0; width: 0; transform: skewX(-20deg) translateX(-8px); }
}

/* ===== FOCUS INDICATORS ===== */
:focus-visible {
  outline: 3px solid #005291;
  outline-offset: 2px;
}
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none;
  border-color: #005291;
  box-shadow: 0 0 0 3px rgba(0, 82, 145, 0.15);
}

/* ===== SKIP TO CONTENT ===== */
.skip-to-content {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 200;
  background: #005291;
  color: #fff;
  padding: 12px 24px;
  border-radius: 0 0 4px 4px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: top 0.2s;
}
.skip-to-content:focus { top: 0; }

/* ===== HAMBURGER MENU ANIMATION ===== */
.nav-toggle-bar,
.nav-toggle-bar::before,
.nav-toggle-bar::after {
  display: block;
  width: 24px;
  height: 2px;
  background: #2d3740;
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
  position: absolute;
  left: 10px;
}
.nav-toggle-bar { top: 50%; transform: translateY(-50%); }
.nav-toggle-bar::before { content: ''; top: -7px; }
.nav-toggle-bar::after { content: ''; top: 7px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::before {
  top: 0; transform: rotate(45deg); background: #2d3740;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::after {
  top: 0; transform: rotate(-45deg); background: #2d3740;
}

/* ===== NAV CURRENT PAGE UNDERLINE ===== */
.main-nav a[aria-current="page"] { color: #005291; }
.main-nav a[aria-current="page"]::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 16px;
  right: 16px;
  height: 2px;
  background: #005291;
}

/* ===== HERO / CTA PARALLELOGRAM DECORATIONS ===== */
.hero::after {
  content: '';
  position: absolute;
  top: -20%;
  right: -5%;
  width: 400px;
  height: 600px;
  background: rgba(255, 255, 255, 0.03);
  transform: skewX(-12deg);
  z-index: 1;
}
.hero-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0, 26, 51, 0.88) 0%, rgba(0, 82, 145, 0.82) 50%, rgba(0, 61, 110, 0.85) 100%);
  z-index: 1;
}
.cta-banner::before {
  content: '';
  position: absolute;
  top: -40%;
  left: 60%;
  width: 300px;
  height: 400px;
  background: rgba(255, 255, 255, 0.03);
  transform: skewX(-12deg);
}

/* ===== SKEW BAR (hero accent) ===== */
.skew-bar span {
  display: block;
  width: 40px;
  height: 6px;
  background: #fff;
  transform: skewX(-20deg);
  transition: width 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.3s ease,
              transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
/* Resting opacities (also the animation end-state) */
.skew-bar span:nth-child(1) { opacity: 0.3; animation: skewIn 0.5s 0.1s ease-out backwards; }
.skew-bar span:nth-child(2) { opacity: 0.5; animation: skewIn 0.5s 0.25s ease-out backwards; }
.skew-bar span:nth-child(3) { opacity: 0.8; animation: skewIn 0.5s 0.4s ease-out backwards; }
/* backwards = hidden during delay, then animates to element's own styles, then releases for transitions */
@keyframes skewIn {
  from { opacity: 0; width: 0; transform: skewX(-20deg) translateX(-12px); }
}

/* ===== SKEW DIVIDER (section accent) ===== */
.skew-divider span {
  display: block;
  width: 32px;
  height: 4px;
  transform: skewX(-20deg);
  transition: width 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.3s ease,
              transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.skew-divider span:nth-child(1) { background: #545454; animation: dividerIn 0.5s 0.1s ease-out backwards; }
.skew-divider span:nth-child(2) { background: #005291; animation: dividerIn 0.5s 0.25s ease-out backwards; }
.skew-divider span:nth-child(3) { background: #005291; opacity: 0.5; animation: dividerIn 0.5s 0.4s ease-out backwards; }
@keyframes dividerIn {
  from { opacity: 0; width: 0; transform: skewX(-20deg) translateX(-10px); }
}

/* ===== IMAGE PLACEHOLDER STRIPES ===== */
.img-placeholder::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(255, 255, 255, 0.15) 10px, rgba(255, 255, 255, 0.15) 20px);
}

/* ===== FOOTER LOGO SKEWED BARS ===== */
.footer-logo-bars span {
  display: block;
  width: 12px;
  height: 14px;
  transform: skewX(-15deg);
}
.footer-logo-bars span:nth-child(1) { background: #545454; }
.footer-logo-bars span:nth-child(2) { background: #005291; }
.footer-logo-bars span:nth-child(3) { background: #005291; opacity: 0.7; }

/* ===== BUTTON ARROW ===== */
.btn-arrow::after { content: ' \2192'; }

/* ===== FORM ERROR STATES ===== */
.form-group input.error,
.form-group textarea.error,
.form-group select.error,
input.error,
textarea.error,
select.error {
  border-color: #c0392b !important;
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.1) !important;
}
.form-error {
  font-size: 13px;
  color: #c0392b;
  margin-top: 4px;
  display: none;
}
.form-error.visible { display: block; }

/* ===== FORM MESSAGES ===== */
.form-message {
  padding: 16px 20px;
  border-radius: 4px;
  font-size: 14px;
  margin-bottom: 20px;
  display: none;
}
.form-message.success {
  display: block;
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #a5d6a7;
}
.form-message.error {
  display: block;
  background: #fce4ec;
  color: #c0392b;
  border: 1px solid #ef9a9a;
}

/* ===== HONEYPOT ===== */
.form-hp { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }

/* ===== SCROLL ANIMATIONS ===== */
@media (prefers-reduced-motion: no-preference) {
  @keyframes fadeInUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
  }
  @keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }
  @keyframes fadeInLeft {
    from { opacity: 0; transform: translateX(-24px); }
    to { opacity: 1; transform: translateX(0); }
  }
  @keyframes fadeInRight {
    from { opacity: 0; transform: translateX(24px); }
    to { opacity: 1; transform: translateX(0); }
  }

  [data-animate] {
    opacity: 0;
  }
  [data-animate].animate-visible {
    animation-fill-mode: forwards;
    animation-duration: 0.6s;
    animation-timing-function: ease-out;
  }
  [data-animate="fade-up"].animate-visible { animation-name: fadeInUp; }
  [data-animate="fade-in"].animate-visible { animation-name: fadeIn; }
  [data-animate="fade-left"].animate-visible { animation-name: fadeInLeft; }
  [data-animate="fade-right"].animate-visible { animation-name: fadeInRight; }
}
@media (prefers-reduced-motion: reduce) {
  [data-animate] { opacity: 1; }
}

/* ===== CONTACT STRIP: MOBILE ===== */
@media (max-width: 900px) {
  .contact-strip .contact-email-text { display: none; }
  .contact-strip-bars { display: none; }
  .contact-strip::before { display: none; }
}

/* ===== VALUE STRIP DIVIDER: MOBILE ===== */
@media (max-width: 639px) {
  .value-strip-item::after { display: none; }
}

/* ===== LEAFLET MAP: MOBILE ===== */
@media (max-width: 900px) {
  .leaflet-map { height: 320px; }
  .leaflet-map-contact { height: 280px; }
}

/* ===== FOOTER: IMPROVED TOUCH TARGETS ===== */
.footer-col a {
  min-height: 44px;
  display: flex;
  align-items: center;
}

/* ===== MOBILE NAV STATES (toggled by JS) ===== */
@media (max-width: 900px) {
  .main-nav {
    display: none !important;
    position: absolute;
    top: 80px;
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    padding: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    border-top: 1px solid #dde3ea;
  }
  .main-nav.open { display: flex !important; }
  .main-nav a {
    padding: 12px 16px;
    width: 100%;
    border-radius: 4px;
  }
  .main-nav a:hover { background: #f4f6f8; }
  .main-nav a[aria-current="page"]::after { display: none; }
  /* Fix CTA button alignment in mobile dropdown */
  .main-nav .nav-cta {
    margin-left: 0 !important;
    margin-top: 8px;
    text-align: center;
    justify-content: center;
  }
  /* Body scroll lock when nav is open */
  body.nav-open {
    overflow: hidden;
  }
}
