:root {
  /* Brand palette — softened toward Petra's brighter pastel system.
     Primary is now Petra's periwinkle (#5179d6); navy is reserved for
     deep text/structure. Keep these in sync with tailwind.config.js. */
  --pcu-red: #e56767;
  --pcu-orange: #e5ae67;
  --pcu-sky-blue: #4cb6c7;
  --pcu-sky: #4cb6c7;
  --pcu-purple: #8451d6;
  --pcu-yellow: #fdd600;
  --pcu-navy: #1d446e;
  --pcu-green: #30c78d;
  --pcu-magenta: #ff6c9d;
  --pcu-white: #f8f9fa;
  --pcu-primary: #5179d6;
  --pcu-blue: #5179d6;
  --pcu-gold: #fdd600;
  --pcu-dark-blue-gradient: linear-gradient(to right, #5179d6, #1d446e);
  --pcu-teal-gradient: linear-gradient(to right, #4cb6c7, #5179d6);
  --pcu-red-to-yellow-gradient: linear-gradient(to right, #ff6c9d, #e5ae67);
  --pcu-purplish-gradient: linear-gradient(to right, #8451d6, #5179d6);

  /* Page-accent system — set by JS per page (see Phase 3 theming).
     Defaults to the periwinkle primary so anything unthemed looks intentional. */
  --page-accent: #5179d6;
  --page-accent-soft: rgba(81, 121, 214, 0.08);
  --page-accent-border: rgba(81, 121, 214, 0.18);
  --page-accent-shadow: rgba(81, 121, 214, 0.15);
}

html, body { height: 100%; margin: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.011em; /* Inter reads cleaner with a hair of negative tracking */
  overflow-x: hidden;
  /* Very subtle dotted texture over a clean Petra-style light background.
     Dialed down (was rgba(29,68,110,.08)) so the page reads bright + airy. */
  background-image: radial-gradient(circle, rgba(81, 121, 214, 0.045) 1px, transparent 1px);
  background-size: 34px 34px;
  background-color: #f8f9fa;
}

/* Skip-to-content link — visually hidden until focused by keyboard users */
.skip-link {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 100;
  padding: 0.625rem 1.25rem;
  background: var(--pcu-navy);
  color: #fff;
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: 0 0 0.75rem 0.75rem;
  transition: transform 0.2s ease;
  transform: translateX(-50%) translateY(-120%);
}
.skip-link:focus {
  transform: translateX(-50%) translateY(0);
  outline: 2px solid var(--pcu-sky);
  outline-offset: 2px;
}

/* Lock body scroll when mobile menu is open (set/cleared by toggleMobileMenu) */
body.menu-open { overflow: hidden; }
/* Smooth scroll */
html { scroll-behavior: smooth; }

/* Hero carousel */
.hero-slide { opacity: 0; transition: opacity 1s ease; position: absolute; inset: 0; overflow: hidden; }
.hero-slide.active { opacity: 1; }
.hero-slide .slide-bg { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0.4; filter: saturate(1.1); pointer-events: none; }
.carousel-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.35); background: rgba(29,68,110,0.35); color: white; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: transform 0.2s ease, background 0.2s ease; z-index: 20; }
.carousel-nav:hover { background: rgba(29,68,110,0.6); transform: translateY(-50%) scale(1.05); }
.carousel-nav.left { left: 20px; }
.carousel-nav.right { right: 20px; }

/* Animate on scroll */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* Counter animation */
.counter { font-variant-numeric: tabular-nums; }

/* Card hover */
.program-card { transition: transform 0.3s ease, box-shadow 0.3s ease; }
.program-card:hover { transform: translateY(-6px); box-shadow: 0 18px 38px rgba(81,121,214,0.14); }

/* Nav dropdown
 * --------------
 * The ::after pseudo-element is the "hover bridge": an invisible 20px strip
 * between the trigger and the dropdown that keeps the menu open while the
 * cursor moves diagonally from button → menu. Without it, the menu closes
 * the moment the cursor leaves the button (because the dropdown sits below
 * with margin-top). DO NOT REMOVE — it is load-bearing for the hover UX.
 *
 * Keyboard / click open is handled by JS, which adds the `.is-open` class.
 * focus-within also keeps the menu open when tabbing through items.
 */
.nav-item { position: relative; }
.nav-item::after { content: ''; position: absolute; top: 100%; left: 0; right: 0; height: 20px; }
.nav-dropdown { opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity 0.2s ease, transform 0.2s ease; }
.nav-item:hover .nav-dropdown,
.nav-item:hover::after,
.nav-item:focus-within .nav-dropdown,
.nav-item.is-open .nav-dropdown,
.nav-dropdown:hover { opacity: 1; pointer-events: auto; transform: translateY(0); }
.nav-item .nav-dropdown:hover { opacity: 1; pointer-events: auto; transform: translateY(0); }

/* Sticky nav shadow */
.nav-scrolled { box-shadow: 0 2px 20px rgba(0,0,0,0.08); }

/* Page transitions */
.page { display: none; }
.page.active { display: block; animation: fadeIn 0.4s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Carousel dots — interactive buttons (created in JS) */
.dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: rgba(255,255,255,0.5);
  transition: background 0.3s, width 0.3s, border-radius 0.3s;
  cursor: pointer;
  border: 0; padding: 0;
}
.dot:hover { background: rgba(255,255,255,0.75); }
.dot:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.dot.active { background: #fff; width: 28px; border-radius: 5px; }
.dot[aria-current="true"] { background: #fff; width: 28px; border-radius: 5px; }

/* Floating animations for background decorations */
@keyframes float1 {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(30px, -30px) rotate(120deg); }
  66% { transform: translate(-20px, 40px) rotate(240deg); }
}

@keyframes float2 {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(-40px, 20px) rotate(120deg); }
  66% { transform: translate(50px, -30px) rotate(240deg); }
}

@keyframes float3 {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(20px, 40px) rotate(120deg); }
  66% { transform: translate(-30px, -20px) rotate(240deg); }
}

@keyframes float4 {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(-30px, -40px) rotate(120deg); }
  66% { transform: translate(40px, 30px) rotate(240deg); }
}

@keyframes float5 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(25px, -25px) scale(1.05); }
}

@keyframes float6 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-25px, 25px) scale(1.05); }
}

/* Background decoration container
 * Reduced opacity + fewer elements to lower visual clutter. The dotted-grid
 * body background is the primary decorative layer; floating SVGs are now
 * a quiet accent rather than a competing pattern. */
.bg-decorations {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bg-decoration {
  position: absolute;
  opacity: 0.03;
}
/* Hide decorative floats on smaller screens where they crowd content */
@media (max-width: 768px) {
  .bg-decorations { display: none; }
}

.decoration-linework {
  width: 500px;
  height: 500px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  background-image: url('Assets/Graphics/Petra Graphic Asset/Graphic Eleemnt Linework-04.svg');
}

/* Mobile menu — visually hidden offscreen and isolated from a11y tree when closed */
.mobile-menu {
  transform: translateX(100%);
  transition: transform 0.35s ease;
  visibility: hidden;
}
.mobile-menu.open {
  transform: translateX(0);
  visibility: visible;
}

/* News card image placeholder — themed via --page-accent so each section
 * (Inbound = sky, Outbound = orange, Partnership = purple, etc.) gets a
 * placeholder gradient that matches its accent rather than always sky→navy. */
.news-img {
  background: linear-gradient(135deg, var(--page-accent, var(--pcu-sky-blue)) 0%, var(--pcu-navy) 100%);
}

/* News carousel styles */
#newsCarouselContainer { animation: fadeIn 0.6s ease; }
#newsCarouselContainer > div { height: 100%; width: 100%; }
#newsCarouselContainer .absolute.inset-0 { background-size: cover; background-position: center; }

/* Scrollbar — thicker + visible track for better grab affordance */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: rgba(29, 68, 110, 0.06); }
::-webkit-scrollbar-thumb {
  background: var(--pcu-sky-blue);
  border-radius: 6px;
  border: 3px solid var(--pcu-white);
}
::-webkit-scrollbar-thumb:hover { background: var(--pcu-navy); }
/* Firefox */
* { scrollbar-width: thin; scrollbar-color: var(--pcu-sky-blue) rgba(29, 68, 110, 0.06); }

/* Map popup */
#mapPopup {
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
  animation: popupFadeIn 0.2s ease;
}

#mapTooltip {
  pointer-events: none;
  animation: popupFadeIn 0.2s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

@keyframes popupFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Flip card styles */
.flip-card {
  background-color: transparent;
  perspective: 1000px;
  -webkit-perspective: 1000px;
  cursor: pointer;
  position: relative;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  min-height: 220px;
  text-align: center;
  transition: transform 0.6s;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner,
.flip-card:focus-within .flip-card-inner,
.flip-card.flipped .flip-card-inner {
  transform: rotateY(180deg);
  -webkit-transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: 1rem;
}

.flip-card-front {
  z-index: 2;
}

.flip-card-back {
  z-index: 1;
  transform: rotateY(180deg);
  -webkit-transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
  /* Background is supplied per-card by a brand-color utility class
     (e.g. .bg-pcu-blue) so the white text on the back stays readable.
     Previously a hard-coded light #f8fafc here overrode those utilities
     and rendered white-on-near-white text invisible. */
  background: var(--pcu-navy);
}

/* Program card slide animations */
#jointCard.slide-out {
  transform: translateX(-100vw);
  opacity: 0;
  transition: transform 0.6s ease, opacity 0.6s ease;
}

#doubleCard.slide-out {
  transform: translateX(100vw);
  opacity: 0;
  transition: transform 0.6s ease, opacity 0.6s ease;
}

#programContent.slide-in {
  animation: slideInUp 0.6s ease;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(200px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#programContent.slide-out {
  animation: slideOutDown 0.6s ease;
}

@keyframes slideOutDown {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(200px);
  }
}




body { box-sizing: border-box; }

/* Domestic partnership logo carousel */
@keyframes dp-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.dp-carousel-wrapper {
  overflow: hidden;
  position: relative;
  mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
}

.dp-carousel-track {
  display: flex;
  gap: 20px;
  width: max-content;
  animation: dp-scroll 90s linear infinite;
}

.dp-carousel-track:hover {
  animation-play-state: paused;
}

/* ==============================================
   PAGE COLOR THEMES — variable-driven
   ----------------------------------------------
   Each themed page sets body[data-section="..."]
   via setPageAccent() in JS/main.js. The custom
   properties --page-accent / --page-accent-soft /
   --page-accent-border / --page-accent-shadow are
   then applied to common Tailwind utility classes
   so the same component (e.g. a .program-card)
   automatically picks up the current section's
   accent without per-page selector blocks.
   ============================================== */

body[data-section] .bg-pcu-light,
body[data-section] .bg-pcu-light\/50,
body[data-section] .bg-pcu-blue\/10 {
  background-color: var(--page-accent-soft);
}

body[data-section] .text-pcu-blue,
body[data-section] .text-pcu-sky {
  color: var(--page-accent);
}

body[data-section] .border-pcu-blue {
  border-color: var(--page-accent);
}

body[data-section] .border-pcu-blue\/10,
body[data-section] .rounded-3xl.border.border-gray-100,
body[data-section] .rounded-2xl.border.border-gray-100 {
  border-color: var(--page-accent-border);
}

body[data-section] .program-card:hover {
  box-shadow: 0 20px 40px var(--page-accent-shadow);
}

/* ==============================================
   Reduced-motion support — respects user OS setting.
   Disables decorative floats, marquees, fade-in
   transitions, hover lifts, and slide animations.
   Functional transitions (focus rings, color) stay.
   ============================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .bg-decoration,
  .dp-carousel-track { animation: none !important; }
  .program-card:hover { transform: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .page.active { animation: none !important; }
  .hero-slide { transition: opacity 0.001ms !important; }
}

/* ==============================================
   LANGUAGE TOGGLE CONTROL (EN / ID)
   ============================================== */
.lang-toggle {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  border: 1px solid rgba(81, 121, 214, 0.25);
  overflow: hidden;
  background: rgba(81, 121, 214, 0.06);
}
.lang-toggle button {
  padding: 0.25rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #5179d6;
  transition: background 0.2s ease, color 0.2s ease;
}
.lang-toggle button[aria-pressed="true"] {
  background: #5179d6;
  color: #fff;
}