/* ===== OceanX Categories – Clean, Consolidated, Safe-Responsive ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* Tunables */
:root{
  --tile-y-shift: 6%;
  --tile-text-nudge: 9px;           /* tiny downward nudge for text */
  /* Mobile-only tunables (used inside mobile media query) */
  --tile-row-overlap: 40px;         /* tightens rows on mobile */
  --tiles-downshift: 50px;          /* pushes grid downward on mobile */
  --slab-bleed: 28px;               /* grows mobile slab bg beyond content */
  --slab-bottom-extra: 36px;        /* extra safety at bottom */
  --tile-bg-scale-mobile: 92%;      /* mobile tile frame size (relative) */
  --tile-inner-maxw: 78%;           /* mobile inner text block width */
}

body{
  font-family: 'Jockey One', sans-serif;
  color: #fff;
  overflow-x: hidden;
  background: url('img/background.webp') center/cover no-repeat fixed;
  position: relative;
}

/* Subtle global overlay */
body::before{
  content:'';
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 0;
}

/* Hide stray site footers if present */
footer, .site-footer, #footer, .footer{ display: none !important; }

section, .hero-content{ position: relative; z-index: 1; }

/* ---------- Hero ---------- */
.hero-content{
  display: grid;
  place-items: center;
  text-align: center;
  padding: 2rem 1rem 0;
}
.hero-content img{
  max-width: min(1100px, 92vw);
  height: auto;
  display: block;
  margin-left: 15px;
}

/* ---------- Categories (desktop baseline) ---------- */
.categories-section{
  position: relative;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 0 5rem; /* desktop spacing preserved */
  overflow: visible;
}
.categories-bg{
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  margin: 0 auto;
}
.categories-content{
  position: absolute; /* overlay on desktop */
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

/* ---------- Tiles Grid ---------- */
.tiles{
  width: min(1040px, 92vw);
  display: grid;
  grid-template-columns: repeat(2, minmax(300px, 1fr));
  gap: clamp(1.2rem, 3vw, 2.2rem);
  margin: 0 auto;
}
.tiles .span-2{
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
}

/* ---------- Tile ---------- */
.tile{
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1.4;   /* desktop preserved */
  min-height: 400px;   /* desktop preserved */
  overflow: hidden;
  text-align: center;
  cursor: pointer;
  transition: transform .25s ease, box-shadow .25s ease;
  will-change: transform, box-shadow;
}

/* Background art (desktop): keep containment, no idle/hover scale */
.tile::before{
  content:'';
  position: absolute;
  inset: 0;
  background: url('img/tilebackground.webp') center / contain no-repeat;
  pointer-events: none;
  z-index: 0;
}

/* Foreground content */
.tile .inner{
  position: absolute;
  inset: 0;
  padding: 1.8rem 1.6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 1;
  transform: translateY(calc(var(--tile-y-shift) + var(--tile-text-nudge)));
}

/* Typography */
.kicker{
  display: block;
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  letter-spacing: .15em;
  text-transform: uppercase;
}
.tile h3{
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  text-transform: uppercase;
  letter-spacing: .15em;
  line-height: 1.25;
  font-weight: 400;
}
.tile .meta{
  font-family: 'Lora', serif;
  font-weight: 300;
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  line-height: 1.55;
  letter-spacing: .06em;
  opacity: .9;
  margin-top: .85rem;
  white-space: pre-line;
}

/* Hover: lift only */
.tile:hover,
.tile:focus-visible{ transform: translateY(-8px); }
.tile:hover::before,
.tile:focus-visible::before{ transform: none; }

/* Centered single-wide tile */
.tiles .span-2 .tile{
  width: 100%;
  max-width: 480px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  .tile, .tile::before{ transition: none; }
}

/* ---------- Tablet polish (keeps desktop/mobile intact) ---------- */
@media (min-width: 861px) and (max-width: 1200px){
  .hero-content img{ max-width: 96vw; margin-left: 0px;}
  .tiles{ width: min(1040px, 94vw); gap: clamp(1rem, 2.5vw, 2rem); }
  /* Visuals remain the same; this only improves breathing on mid screens */
}

/* ---------- Tiny phones (ultra-compact) ---------- */
@media (max-width: 360px){
  .kicker{ font-size: .9rem; }
  .tile h3{ font-size: .9rem; }
  .tile .meta{ font-size: .9rem; margin-top: 0; }
  .tile{ min-height: 210px; }
}

/* ===================== Mobile (≤ 860px) ===================== */
@media (max-width: 860px){
  /* Hero */
  .hero-content{ padding: 1.5rem 1rem 0; }
  .hero-content img{ max-width: 94vw; margin-left: 0px;}

  /* Replace slab <img> with a bleed background tied to content height */
  .categories-bg{ display: none !important; }
  .categories-section::before{ content: none !important; } /* prevent double bgs */

  .categories-content{
    position: relative;
    background: none !important; /* moved to ::before for bleed */
    padding: calc(0.75rem + var(--tiles-downshift)) 1rem
             calc(1rem + var(--tile-row-overlap) + var(--slab-bottom-extra));
    z-index: 1;
  }
  .categories-content::before{
    content:"";
    position: absolute;
    inset: calc(var(--slab-bleed) * -1); /* outward bleed so bg fully covers */
    background: url('img/middlesectionbackground.webp') center / cover no-repeat;
    z-index: 0;
    pointer-events: none;
  }
  .categories-content > *{ position: relative; z-index: 1; }

  /* Single column, tight stack, hard-center */
  .tiles{
    grid-template-columns: 1fr;
    width: min(620px, 92vw);
    margin: 0 auto;
    gap: 0 !important; row-gap: 0 !important; column-gap: 0 !important;
  }
  .tiles > *{ margin: 0 !important; }

  /* Intentional vertical compression via overlap */
  .tiles > * + *{ margin-top: calc(var(--tile-row-overlap) * -1) !important; }
  .tiles .span-2{ margin-top: calc(var(--tile-row-overlap) * -1) !important; }

  /* Mobile tile proportions */
  .tile{
    aspect-ratio: 1;      /* square-ish to reduce height */
    min-height: 220px;
  }
  .tile .inner{
    padding: 1rem;
    /* keep previous 2.5% baseline plus tiny nudge */
    transform: translateY(calc(2.5% + var(--tile-text-nudge)));
    width: 100%;
    max-width: var(--tile-inner-maxw);
    margin: 0 auto;
  }

  /* Mobile tile background: smaller than tile, bigger than text */
  .tile::before{
    background-position: center;
    background-repeat: no-repeat;
    background-size: var(--tile-bg-scale-mobile) auto;
  }

  /* Slightly reduced type scales */
  .kicker{ font-size: clamp(.9rem, 3.6vw, 1rem); }
  .tile h3{ font-size: clamp(1.05rem, 4vw, 1.3rem); }
  .tile .meta{ font-size: clamp(.6rem, 3.6vw, 1.05rem); }
}


.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}
.modal-box {
  background: #111;
  color: white;
  max-width: 980px;
  width: 80%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 2rem;
  border-radius: 12px;
  position: relative;
  font-family: 'Lora', serif;
}
.modal-close {
  position: absolute;
  top: 12px; right: 12px;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: #fff;
  cursor: pointer;
}


/* Make modal forms match landing page look */
.modal-box form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-family: 'Lora', serif;
}

.modal-box label {
  font-size: 1rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
  color: #ddd;
}

.modal-box input {
  width: 100%;
  padding: 0.9rem 1rem;
  border: 2px solid #333;
  border-radius: 8px;
  background: #222;
  color: white;
  font-size: 1rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.modal-box input:focus {
  border-color: #a8a298;
  outline: none;
  box-shadow: 0 0 8px rgba(168, 162, 152, 0.5);
}

/* Big bold buttons like CTA */
.modal-box button[type="submit"] {
  background: #a8a298;
  color: #000;
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
  font-family: 'Jockey One', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  border: 2px solid #000;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  align-self: center;
  margin-top: 1rem;
  box-shadow: 0 6px 15px rgba(0,0,0,0.25);
}

.modal-box button[type="submit"]:hover {
  background: #918c86;
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.35);
}

/* Secondary links (register/forgot) */
.modal-box p {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.95rem;
}

.modal-box a {
  color: #a8a298;
  text-decoration: none;
  font-weight: 500;
  margin: 0 0.4rem;
  transition: color 0.3s;
}

.modal-box a:hover {
  color: #fff;
  text-decoration: underline;
}

.modal-box textarea {
  width: 100%;
  min-height: 100px;
  padding: 0.8rem;
  border-radius: 8px;
  background: #222;
  color: #fff;
  border: 2px solid #333;
  resize: vertical;
}

/* Notification Modal */
#notificationContainer {
  position: fixed;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 20000;
}

.notification {
  background: #111;
  color: #fff;
  padding: 2rem 3rem;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
  font-family: 'Jockey One', sans-serif;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.4s ease;
}

.notification.show {
  opacity: 1;
  transform: scale(1);
}

.notification .icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  animation: pop 0.4s ease;
}

.notification.success .icon { color: #4CAF50; }
.notification.error .icon { color: #E74C3C; }

@keyframes pop {
  from { transform: scale(0.5); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* Make select look like input */
.modal-box select {
  width: 100%;
  padding: 0.9rem 1rem;
  border: 2px solid #333;
  border-radius: 8px;
  background: #222;
  color: white;
  font-size: 1rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  appearance: none; /* remove browser arrow */
  cursor: pointer;
}

.modal-box select:focus {
  border-color: #a8a298;
  outline: none;
  box-shadow: 0 0 8px rgba(168, 162, 152, 0.5);
}

/* Custom dropdown arrow */
.modal-box select {
  background-image: url("data:image/svg+xml;utf8,<svg fill='white' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1rem;
}

/* Dropdown option styling */
.modal-box select option {
  background: #111;
  color: #fff;
  padding: 0.8rem;
  font-size: 1rem;
}


 /* neutralize landing .hero-content width inside the races area only */
  .races-wrapper .hero-content {
    display: grid;
    place-items: center;
    text-align: center;
    padding: 2rem 1rem 0;
    max-width: none;
    width: auto;
  }

  /* ensure the races slab sits above any negative-margin overlaps from above */
  .races-wrapper { position: relative; z-index: 2; margin-top: 8rem; }
  @media (max-width: 768px) { .races-wrapper { margin-top: 0; } }


/* Desktop → fluid defaults */
.tile {
  /* Tunables */
  --badge-bottom: clamp(10px, 2.5vw, 20px);
  --badge-pad-y: clamp(4px, 0.8vw, 8px);
  --badge-pad-x: clamp(10px, 3vw, 20px);
  --badge-fs: clamp(0.95rem, 2.2vw, 1.5rem);
  --badge-ls: clamp(0.5px, 0.5vw, 3px);
}

.tile::after {
  content: "REGISTER NOW";
  position: absolute;
  left: 50%;
  bottom: var(--badge-bottom);
  transform: translateX(-50%);
  z-index: 2;                         /* keep above tile art */
  background-color: #A8A298;
  color: #000;
  font-weight: 300;
  padding: var(--badge-pad-y) var(--badge-pad-x);
  border-radius: 0;
  text-align: center;
  font-size: var(--badge-fs);
  letter-spacing: var(--badge-ls);
  line-height: 1;
  white-space: nowrap;
  max-width: 90%;
  pointer-events: none;               /* decorative only */
  transition: transform .3s ease, box-shadow .3s ease;
}

/* Hover nicety for non-touch */
@media (hover: hover) and (pointer: fine) {
  .tile:hover::after,
  .tile:focus-visible::after {
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,.25);
  }
}

/* Mobile: lift above the row-overlap zone, allow wrapping, tighten spacing */
@media (max-width: 860px) {
  .tile::after {
    /* move above the overlap so next tile doesn't cover it */
    bottom: calc(var(--tile-row-overlap, 70px) - 20px);
    max-width: calc(100% - 24px);
    white-space: normal;
    line-height: 1.1;
    letter-spacing: 0.5px;
    padding: 8px 12px;
    transform: translateX(-50%); /* no Y-lift on mobile */
    margin-bottom: 2rem;
  }
}

/* Ultra-small phones: smallest footprint */
@media (max-width: 360px) {
  .tile::after {
    font-size: .9rem;
    padding: 0px 10px;
    margin-bottom: 20px;
  }
}

/* Optional: reflect disabled tiles */
.tile.disabled::after {
  content: "COMING SOON";
  background: #333;
  color: #aaa;
  box-shadow: none;
}





