/*
Theme Name: 787UP
Theme URI: https://787up.com
Author: 787UP
Description: Mobile-first news, map and vertical video theme for 787UP.
Version: 0.1.8
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 8.0
Text Domain: 787up
*/

:root {
  --black: #030303;
  --gold: #ffc928;
  --gold-2: #f2aa12;
  --text: #ffffff;
  --muted: #c7c7c7;
  --panel: rgba(8, 8, 8, 0.74);
  --line: rgba(255, 201, 40, 0.24);
  --header-bg: rgba(0, 0, 0, 0.72);
  --brand-plate: linear-gradient(135deg, #ffffff 0%, #f2f2f2 48%, #ffc928 100%);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--black);
  color: var(--text);
  font-family: Inter, system-ui, sans-serif;
}

body.theme-day {
  --black: #f5f1e7;
  --text: #090909;
  --muted: #343434;
  --panel: rgba(255, 255, 255, 0.78);
  --line: rgba(8, 8, 8, 0.2);
  --header-bg: rgba(245, 241, 231, 0.72);
  --brand-plate: linear-gradient(135deg, #ffffff 0%, #f2f2f2 52%, #ffc928 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.noise {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  opacity: 0.2;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 100% 4px, 48px 100%;
  mix-blend-mode: screen;
}

.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: calc(10px + env(safe-area-inset-top)) 12px 10px;
  background: var(--header-bg);
  backdrop-filter: blur(18px);
}

.brand-plate {
  display: grid;
  width: 104px;
  height: 42px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: var(--brand-plate);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.36);
}

.brand img {
  display: block;
  width: 92px;
  height: 34px;
  object-fit: contain;
  object-position: center;
}

.pill-nav {
  display: flex;
  justify-content: flex-start;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.pill-nav::-webkit-scrollbar {
  display: none;
}

.pill-nav a,
.theme-toggle,
.skip-ad,
.start-scroll {
  min-height: 36px;
  border: 1px solid var(--line);
  padding: 0 10px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  font-size: 0.73rem;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.theme-toggle {
  color: #050505;
  background: var(--gold);
  border-color: var(--gold);
  cursor: pointer;
}

.map-gate {
  position: relative;
  display: grid;
  min-height: 100dvh;
  align-content: end;
  gap: 18px;
  overflow: hidden;
  padding: calc(88px + env(safe-area-inset-top)) 14px calc(22px + env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 72% 22%, rgba(255, 201, 40, 0.18), transparent 18rem),
    linear-gradient(180deg, #050505 0%, #0b0b0b 100%);
  isolation: isolate;
}

.map-gate::before {
  content: "787 / 939 / PUERTO RICO";
  position: absolute;
  top: 18%;
  left: -26px;
  z-index: -1;
  color: rgba(255, 201, 40, 0.08);
  font-size: clamp(3.8rem, 18vw, 9rem);
  font-weight: 900;
  line-height: 0.86;
  transform: rotate(-8deg);
  white-space: nowrap;
}

.map-copy {
  max-width: 680px;
}

.map-copy h1 {
  margin-bottom: 12px;
  color: #fff;
  font-size: clamp(4rem, 20vw, 8.8rem);
  line-height: 0.84;
  text-shadow: 0 4px 28px rgba(0, 0, 0, 0.92);
}

.map-copy p {
  margin-bottom: 0;
  color: #e8e8e8;
  font-size: clamp(0.98rem, 3.6vw, 1.2rem);
  font-weight: 700;
  line-height: 1.42;
}

.pr-map-card {
  position: relative;
  width: min(100%, 620px);
  min-height: 248px;
  margin-inline: auto;
  border: 1px solid var(--line);
  background:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px),
    rgba(255, 255, 255, 0.035);
  background-size: 32px 32px;
  box-shadow: inset 0 0 56px rgba(255, 201, 40, 0.08);
}

.pr-map {
  position: absolute;
  inset: 34px 6px 12px;
  width: calc(100% - 12px);
  height: calc(100% - 48px);
  overflow: visible;
}

.main-island,
.small-island,
.official-island {
  fill: rgba(255, 201, 40, 0.2);
  stroke: rgba(255, 201, 40, 0.76);
  stroke-width: 5;
  vector-effect: non-scaling-stroke;
}

.small-island,
.official-island:not(:first-child) {
  fill: rgba(255, 201, 40, 0.16);
  stroke-width: 3;
}

.map-ridge {
  fill: none;
  stroke: rgba(255, 255, 255, 0.24);
  stroke-linecap: round;
  stroke-width: 3;
}

.map-pin {
  position: absolute;
  display: grid;
  justify-items: center;
  gap: 4px;
  color: #fff;
  transform: translate(-50%, -50%);
}

.map-pin span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  color: #050505;
  background: var(--gold);
  font-size: 0.88rem;
  font-weight: 900;
  box-shadow: 0 0 0 8px rgba(255, 201, 40, 0.15), 0 12px 30px rgba(0, 0, 0, 0.5);
}

.map-pin.is-empty span {
  color: var(--gold);
  background: rgba(0, 0, 0, 0.82);
  box-shadow: 0 0 0 7px rgba(255, 201, 40, 0.11), 0 12px 30px rgba(0, 0, 0, 0.5);
}

.map-pin.is-empty strong {
  opacity: 0.82;
}

.map-pin.is-active span,
.map-pin:hover span {
  transform: scale(1.14);
  box-shadow: 0 0 0 11px rgba(255, 201, 40, 0.2), 0 16px 38px rgba(0, 0, 0, 0.62);
}

.map-pin strong {
  padding: 4px 7px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.55);
  font-size: 0.64rem;
  text-transform: uppercase;
  white-space: nowrap;
  backdrop-filter: blur(8px);
}

.san-juan {
  left: 73.5%;
  top: 44%;
}

.bayamon {
  left: 66.5%;
  top: 47%;
}

.carolina {
  left: 78.5%;
  top: 46%;
}

.guaynabo {
  left: 69.5%;
  top: 54%;
}

.caguas {
  left: 72%;
  top: 62%;
}

.ponce {
  left: 48%;
  top: 75%;
}

.mayaguez {
  left: 18%;
  top: 64%;
}

.start-scroll {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  justify-content: center;
  color: #050505;
  background: var(--gold);
  border-color: var(--gold);
}

.map-live-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.live-card {
  display: grid;
  min-height: 86px;
  align-content: space-between;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 12px;
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
}

.live-card span {
  color: var(--gold);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.live-card strong {
  display: block;
  overflow-wrap: anywhere;
  color: #fff;
  font-size: clamp(1.25rem, 6vw, 2.2rem);
  line-height: 0.94;
}

.live-card small {
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.72rem;
  font-weight: 800;
}

.live-card-link {
  position: relative;
}

.live-card-link::after {
  content: "↗";
  position: absolute;
  top: 10px;
  right: 10px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 900;
}

.reels-feed {
  height: 100dvh;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  overscroll-behavior-y: contain;
  background: #000;
}

.clip {
  position: relative;
  display: flex;
  min-height: 100dvh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  overflow: hidden;
  padding: calc(86px + env(safe-area-inset-top)) 18px calc(34px + env(safe-area-inset-bottom));
  isolation: isolate;
}

.clip::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.24) 0%, transparent 32%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.35) 46%, transparent 78%);
}

.clip-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 80% 16%, rgba(255, 201, 40, 0.35), transparent 18rem),
    linear-gradient(140deg, #171717, #020202 58%);
}

.clip-hero .clip-bg {
  background:
    linear-gradient(120deg, rgba(255, 201, 40, 0.22), transparent 38%),
    radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.14), transparent 18rem),
    repeating-linear-gradient(90deg, #060606 0 10px, #0f0f0f 10px 11px);
}

.gold-glare {
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 201, 40, 0.75), transparent 13rem),
    linear-gradient(145deg, #2a2100, #050505 62%);
}

.embed-grid {
  background:
    linear-gradient(160deg, rgba(255, 201, 40, 0.46), transparent 30%),
    linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px),
    #060606;
  background-size: auto, 42px 42px, 42px 42px;
}

.ad-lines {
  background:
    linear-gradient(180deg, rgba(255, 201, 40, 0.12), transparent),
    repeating-linear-gradient(-45deg, #111 0 14px, #1d1d1d 14px 28px);
}

.clip-watermark {
  position: absolute;
  top: 22%;
  left: -12px;
  color: rgba(255, 201, 40, 0.11);
  font-size: 4.6rem;
  font-weight: 900;
  line-height: 0.86;
  transform: rotate(-9deg);
  text-transform: uppercase;
}

.clip-copy {
  align-self: flex-end;
  width: min(100%, 680px);
  padding-right: 56px;
}

.kicker,
.story-card span {
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2 {
  font-family: Anton, Impact, sans-serif;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: uppercase;
}

.clip h1,
.clip h2 {
  color: #fff;
  text-shadow: 0 4px 28px rgba(0, 0, 0, 0.92);
}

h1 {
  margin-bottom: 14px;
  font-size: clamp(4.4rem, 22vw, 8.8rem);
  line-height: 0.84;
}

h2 {
  margin-bottom: 14px;
  font-size: clamp(3.4rem, 17vw, 7rem);
  line-height: 0.86;
}

.clip-copy p {
  margin-bottom: 0;
  color: #f0f0f0;
  font-size: clamp(1rem, 4vw, 1.3rem);
  font-weight: 700;
  line-height: 1.38;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.9);
}

.clip-actions {
  position: absolute;
  right: 12px;
  bottom: calc(92px + env(safe-area-inset-bottom));
  display: grid;
  gap: 12px;
}

.clip-actions button {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 0, 0, 0.34);
  font-size: 1.12rem;
  font-weight: 900;
  backdrop-filter: blur(10px);
}

.skip-ad {
  width: fit-content;
  margin-top: 18px;
  color: #050505;
  background: var(--gold);
}

.swipe-hint {
  position: absolute;
  left: 18px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.news-dock,
.manifesto {
  padding: 26px 14px;
  background: var(--black);
}

.dock-head h2,
.manifesto h2 {
  margin-bottom: 18px;
  color: var(--text);
  font-size: clamp(3.4rem, 16vw, 7rem);
  line-height: 0.86;
}

.story-card,
.manifesto {
  border: 1px solid var(--line);
  background: var(--panel);
}

.story-card {
  min-height: 138px;
  margin-bottom: 10px;
  padding: 16px;
}

.story-card h3 {
  margin-bottom: 8px;
  color: var(--text);
  font-size: 1.18rem;
  line-height: 1.08;
}

.story-card p,
.manifesto p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.primary-story {
  min-height: 220px;
  background:
    linear-gradient(145deg, rgba(255, 201, 40, 0.22), transparent 52%),
    var(--panel);
}

.manifesto {
  margin: 0;
  padding: 28px 14px 42px;
}

@media (min-width: 800px) {
  .app-header {
    padding-inline: 28px;
  }

  .brand-plate {
    width: 132px;
    height: 52px;
  }

  .brand img {
    width: 116px;
    height: 42px;
  }

  .clip {
    padding-inline: clamp(46px, 7vw, 120px);
  }

  .map-gate {
    grid-template-columns: minmax(320px, 0.72fr) minmax(420px, 1fr);
    align-items: end;
    padding-inline: clamp(46px, 7vw, 120px);
  }

  .map-copy,
  .map-live-panel,
  .start-scroll {
    grid-column: 1;
  }

  .pr-map-card {
    grid-column: 2;
    grid-row: 1 / span 4;
    min-height: 460px;
  }

  .clip-copy {
    padding-right: 86px;
  }

  .clip-actions {
    right: clamp(24px, 4vw, 72px);
  }

  .news-dock {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    padding: 64px clamp(46px, 7vw, 120px);
  }

  .dock-head {
    grid-column: 1 / -1;
  }

  .primary-story {
    grid-row: span 2;
  }

  .story-card {
    margin-bottom: 0;
  }

  .manifesto {
    padding: 58px clamp(46px, 7vw, 120px);
  }
}

@media (max-width: 390px) {
  .pill-nav a {
    padding-inline: 7px;
  }

  .brand-plate {
    width: 94px;
  }

  .brand img {
    width: 84px;
  }

  .clip-copy {
    padding-right: 50px;
  }
}
