/* =========================
   Base / Document
   ========================= */

body {
  margin: 10px;
}

/* =========================
   Layout
   ========================= */

.container {
  width: 100%;
  margin: 0 auto;
  padding-top: 0px;
  box-sizing: border-box;
}

/* =========================
   Panel (shared)
   ========================= */

.panel {
  position: relative;
  padding: 22px 20px 22px 20px;
  box-sizing: border-box;
  border-radius: 15px 0px 15px 15px;
  background: #f0efed;
  margin: 0 15px;
  height: fit-content;
}

.panel__tab {
  position: absolute;
  right: 0;
  width: fit-content;
  height: 30px;
  top: -40px;
  border-radius: 15px 15px 0px 0px;
  background: #f0efed;
  z-index: -1;
  padding: 10px;
}

.panel__tab::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 0;
  width: 40px;
  height: 100%;
  background: #f0efed;
  transform: skewX(-15deg);
  transform-origin: top right;
  border-top-left-radius: 10px;
}

.panel__tab__header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 5px 10px 14px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #000016;
}

.panel__tab__header h3 {
  margin: 0;
  font-family: "Manrope";
  font-size: 16px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #000016;
}

.panel__body {
  display: flex;
  flex-direction: column;
}

.panel__content {
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  height: auto;
  min-height: 450px;
}

/* =========================
   Up Next
   ========================= */

.up_next .panel__media {
  width: 100%;
  border: solid 2px #000016;
  border-radius: 10px;
  overflow: hidden;
  background: #ddd;
  margin: 20px 0 0 0;
}

.up_next .panel__media img {
  width: 100%;
  object-fit: contain;
}

#round-num {
  font-family: "acumin-pro-wide";
  font-weight: 700;
  letter-spacing: 0.05em;
  font-size: 28px;
  margin: 0;
  text-transform: uppercase;
}

#round-location {
  font-family: "Manrope";
  font-weight: 600;
  letter-spacing: 0.1em;
  margin: 0;
  text-transform: uppercase;
}

.race-countdown {
  flex: 1; /* take remaining space */
  min-height: 0; /* important in flex layouts */
  display: flex;
  padding: 15px;
  margin: 0;
  background: #000016;
  color: #f1f1f1;
  font-family: "Manrope";
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.1em;
  flex-wrap: wrap;
  align-content: center;
  justify-content: center;
}

.cd {
  padding: 0 10px;
  text-align: center;
}

.cd__num {
  font-size: 30px;
}

.cd__label {
  font-size: 12px;
}

/* =========================
   Daily LEC
   ========================= */

.daily_lec .panel__media {
  width: 100%;
  height: 100%;
  min-height: inherit;
  border-radius: 10px;
  overflow: hidden;
  background: #ddd;
}

.daily_lec .panel__media img {
  width: 100%;
  min-height: inherit;
  display: block;
  object-fit: cover;
}

/* =========================
   Standings
   ========================= */

#stand-year {
  font-family: "acumin-pro-wide";
  font-weight: 700;
  letter-spacing: 0.05em;
  font-size: 28px;
  margin: 0 0 7px 0;
  text-transform: uppercase;
  line-height: 1.1em;
}

#stand-title {
  font-family: "Manrope";
  font-weight: 600;
  letter-spacing: 0.1em;
  margin: 0 0 7px 0;
  text-transform: uppercase;
}

table {
  border-collapse: separate;
  border-spacing: 0px 4px;
  width: 100%;
}

th,
td {
  padding: 10px 13px;
  font-family: "Manrope";
  font-weight: 500;
  font-size: 13px;
}

th {
  background-color: #000016;
  color: #fff;
  text-align: left;
  border-radius: 10px 0px 0px 10px;
}

td {
  background-color: #fff;
  text-align: center;
  border-radius: 0px 10px 10px 0px;
}

.separator {
  width: 100%;
  margin: 10px 0 15px 0;
  border-bottom: 2px solid #000016;
}

/* =========================
   The Latest (Instagram)
   ========================= */

@media (min-width: 641px) {
  .panel.latest_ig {
    transform: translateY(var(--stagger));
  }

  .panel.latest_ig .panel__media {
    max-height: 500px; /* match your visual baseline */
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    scrollbar-width: thin;
  }

  /* nice subtle scrollbar */
  .panel.latest_ig .panel__media::-webkit-scrollbar {
    width: 6px;
  }

  .panel.latest_ig .panel__media::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
  }
}

  .panel.latest_ig .panel__media::after {
    content: "Scroll for caption ↓";
    position: sticky;
    bottom: -1px;
    display: block;
    text-align: center;
    font-size: 11px;
    letter-spacing: 0.1em;
    font-family: "Manrope";
    text-transform: uppercase;
    padding: 12px 0 0;
    background: linear-gradient(to bottom, transparent, #f0efed 80%);
    color: rgba(0, 0, 0, 0.6);
    pointer-events: none;
  }


/* =========================
   SF News 
   ========================= */

#sfnews-title {
  font-family: "acumin-pro-wide";
  font-weight: 700;
  letter-spacing: 0.05em;
  font-size: 24px;
  margin: 0 0 7px 0;
  text-transform: uppercase;
  line-height: 1.3em;
}

#sfnews-date {
  font-family: "Manrope";
  font-weight: 600;
  letter-spacing: 0.1em;
  margin: 0 0 7px 0;
  text-transform: uppercase;
}

.latest_news .panel__media {
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  background: #ddd;
}

.latest_news .panel__media img {
  width: 100%;
  display: block;
  object-fit: cover;
  aspect-ratio: 130 / 73;
}

/* =========================
   Pager (shared)
   ========================= */

.pager__btn {
  width: 110px;
  height: 70px;
  border-radius: 12px;
  border: 2px solid #000016;
  background: transparent;
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  transform: skewX(-12deg);
  margin-top: 40px;
}

.pager__icon {
  font-size: 38px;
  color: #000016;
  margin-bottom: 5px;
  transform: skewX(12deg);
}

.pager__btn:active {
  transform: skewX(-12deg) scale(0.98);
}

.pager__btn:focus-visible {
  outline: 3px solid rgba(0, 0, 22, 0.25);
  outline-offset: 3px;
}

/* =========================
   Responsive: Mid-range tweaks
   ========================= */

@media only screen and (max-width: 1180px) and (min-width: 650px) {
  
  .panel {
    flex: 0 0 320px !important;
  }

  .panel__content {
    min-height: 360px;
  }

  .panel.latest_ig .panel__media {
    max-height: 360px;
  }
  
  #round-num {
    font-size: 26px;
  }

  .cd__num {
    font-size: 26px;
  }

  .cd__label {
    font-size: 11px;
  }

  #stand-year {
    font-size: 26px;
  }

  #sfnews-title {
    font-size: 22px;
  }
}

/* =========================
   Responsive: Mobile (keep as-is)
   ========================= */

@media (max-width: 640px) {
  body {
    margin: 0;
  }

  .panel {
    display: none;
    margin: 50px 5px 0 5px;
  }

  /* Make the container follow the real viewport height (better on iOS) */
  .container {
    height: 100svh;
  }

  /* Fixed “card” height so every panel is identical */
  .panel.is-active {
    height: calc(100svh - 230px); /* tweak this number to taste */
    padding: 35px 30px 35px 30px;
    display: block;
  }

  /* Let the inner layout fill the fixed height */
  .panel.is-active .panel__body {
    height: 100%;
    display: flex;
    flex-direction: column;
  }

  /* Content fills remaining space; prevents flex overflow issues */
  .panel.is-active .panel__content {
    flex: 1 1 auto;
    min-height: 0;  /* IMPORTANT: allows inner scrolling */
  }

  /* Default: no inner scroll for most panels */
  .panel.is-active .panel__content {
    overflow: hidden;
  }

  /* IG panel: allow scrolling inside the panel */
  .panel.latest_ig.is-active .panel__content {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .pager {
    display: flex;
    gap: 14px;
  }

  .pager--desktop {
    display: none;
  }

  .panel.daily_lec {
    top: 0;
  }

  .daily_lec .panel__media img {
    height: inherit;
  }

  .up_next .panel__media {
    width: unset;
  }
}

/* =========================
   Responsive: Desktop
   ========================= */

@media (min-width: 641px) {
  :root {
    --stagger: 80px;
  }

  .pager {
    display: none;
  }

  .container {
    width: min(1600px, 100%);
    margin: 0 auto;
    box-sizing: border-box;
    display: block;
  }

  /* show desktop pager, hide per-panel pagers */
  .pager--desktop {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin: 0 0 18px 0;
  }

  .pager--desktop .pager__btn {
    margin-top: 0;
    width: 75px;
    height: 52px;
  }

  .pager--desktop .pager__icon {
    font-size: 26px;
  }

  .panel .pager {
    display: none;
  }

  .slider {
    display: flex;
    gap: 30px;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;

    scroll-snap-type: x mandatory;
    padding: 60px 30px 10px 30px;
    padding-bottom: calc(10px + var(--stagger));
  }

  /* hide scrollbar */
  .slider::-webkit-scrollbar {
    display: none;
  }

  .slider {
    scrollbar-width: none;
  }

  .panel {
    margin: 0;
    flex: 0 0 420px; 
    scroll-snap-align: start;
    min-width: 0;
  }

  .panel.daily_lec {
    transform: translateY(var(--stagger));
  }

  /* row 1 panels in your layout */
  .panel.up_next,
  .panel.daily_lec,
  .panel.standings {
    margin-bottom: calc(var(--stagger) + 50px);
  }
}
