/* ============================================================
   Dsouza Enterprises — site layer
   Accessibility, focus, form and motion fixes applied on top of
   the design-system tokens. Loaded on every page.
   ============================================================ */

/* --- Contrast -------------------------------------------------
   The design system ships --text-faint at #8B90A8, which is
   3.16:1 on white — below the WCAG 2.2 AA minimum of 4.5:1 for
   body text. Darkened to #686D86 (5.10:1) in the light themes.
   ------------------------------------------------------------ */
:root,
[data-theme='light'],
[data-theme='dsouza'] {
  --text-faint: #686D86;
  --star: #966C06;
}
[data-theme='dark'] {
  --text-faint: #9BA1BC;
  --star: #FFC83D;
}

/* --- Skip link ------------------------------------------------ */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  padding: 12px 20px;
  background: #0A1240;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  border-radius: 0 0 12px 0;
  text-decoration: none;
}
.skip-link:focus {
  left: 0;
}

/* --- Focus visibility ----------------------------------------
   Every interactive element gets a clearly visible focus ring
   that works on both light and dark backgrounds.
   ------------------------------------------------------------ */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #6B3DC6;
  outline-offset: 2px;
  border-radius: 6px;
}
[data-theme='dark'] a:focus-visible,
[data-theme='dark'] button:focus-visible,
[data-theme='dark'] input:focus-visible,
[data-theme='dark'] textarea:focus-visible {
  outline-color: #00EABD;
}

/* --- Hover affordances (replaces the runtime style-hover attr) */
.nav-list a:hover { color: var(--purple); }
footer a:hover { color: var(--teal); }
article a:hover { text-decoration: underline; }
.tile img,
.gal-item img { transition: transform .4s ease; }
.tile:hover img,
.gal-item:hover img { transform: scale(1.05); }

/* --- Forms ---------------------------------------------------- */
.fld {
  width: 100%;
  padding: 13px 16px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  font-size: 14.5px;
  font-family: var(--font-sans);
  color: var(--navy);
  background: var(--canvas);
  outline: none;
}
.fld:focus {
  border-color: var(--purple);
  background: var(--surface);
}

.need-opt { display: inline-flex; }
.need-opt input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.need-opt span {
  display: inline-block;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-muted);
  transition: all .18s ease;
}
.need-opt input:checked + span {
  background: #0A1240;
  border-color: #0A1240;
  color: #fff;
}
.need-opt input:focus-visible + span {
  outline: 3px solid #6B3DC6;
  outline-offset: 2px;
}

/* --- Gallery filter ------------------------------------------- */
.gal-tab {
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-sans);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-muted);
  transition: all .2s ease;
}
.gal-tab.is-on {
  background: #0A1240;
  border-color: #0A1240;
  color: #fff;
}
.gal-item[hidden] { display: none; }

/* --- Decorative blobs ----------------------------------------- */
@keyframes blobFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-24px); }
}
.anim-float      { animation: blobFloat 9s ease-in-out infinite; }
.anim-float-slow { animation: blobFloat 11s ease-in-out infinite; }

/* --- Reduced motion -------------------------------------------
   WCAG 2.2 §2.3.3 — honour the user's OS-level preference.
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .anim-float,
  .anim-float-slow { animation: none !important; }
}

/* --- Print ----------------------------------------------------- */
@media print {
  header, footer nav, .gal-tab, .skip-link { display: none; }
  a[href^='http']::after { content: ' (' attr(href) ')'; font-size: 11px; }
}
