/* ============================================================
   FischRadio — layout.css
   Header/player chrome, main grid, home sections and footer.
   ============================================================ */

/* ---- Header / player --------------------------------------- */
#songCoverPlayer {
  height: var(--f-header-h);
  border-radius: 0 0 24px 24px;
  border-bottom: 0;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
}
#songCoverPlayer > div { border-radius: inherit; }
#songCoverPlayer > div > div:first-child {
  height: 70px;
  max-width: 1440px;
  margin: auto;
  padding-left: 80px;
  padding-right: 80px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.v2-menu-trigger {
  font-size: 14px;
  font-weight: 500;
  background: transparent;
  border: 0;
  min-height: 40px;
  padding: 0;
  color: #fff;
}
.v2-menu-trigger:hover { color: var(--f-accent); }

#centerLogo { min-width: 80px; min-height: 44px; justify-content: center; }

/* NOTE: .player-container must NOT be positioned — the waveform and the
   control bar anchor to the fixed header so `bottom-0` = header bottom. */
.player-container > .flex:first-child {
  max-width: var(--f-page-max);
  margin: 17px auto 0;
  align-items: center;
  padding: 0 80px;
  gap: 16px;
}
/* Let the two halves shrink instead of forcing the page wider. */
.player-container > .flex:first-child > div { min-width: 0; }
.player-container > .flex:first-child > div:first-child { flex: 1 1 auto; }
.player-container > .flex:first-child > div:last-child { flex: 0 0 auto; }
.player-container .marquee { max-width: min(46vw, 520px); }
#songCover, #djAvatar { width: 64px; height: 64px; object-fit: cover; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.12); background: #222; }
#songTitle { font-size: 25px; font-weight: 700; letter-spacing: -0.4px; line-height: 1.3; }
#songArtist { font-size: 14px; color: rgba(255, 255, 255, 0.78); line-height: 1.6; }
#djName { font-size: 23px; font-weight: 500; letter-spacing: -0.4px; }

.player-bar {
  height: var(--f-player-bar);
  background: rgba(255, 255, 255, 0.07);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 0 0 24px 24px;
}
#waveform { bottom: var(--f-player-bar); left: 0; width: 100%; height: 100px; pointer-events: none; }
#waveform canvas { border-radius: 4px; }

.v2-primary-play {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0;
  background: transparent; color: #fff; border: 0; border-radius: 8px;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.v2-primary-play:hover { opacity: 0.8; transform: scale(1.04); }
.v2-primary-play:active { transform: scale(0.97); }
.v2-primary-play iconify-icon { font-size: 24px; }

/* Collapsed header on scroll */
.header-collapsed { height: var(--f-header-collapsed) !important; }
.header-collapsed > div > div:first-child { height: var(--f-header-collapsed) !important; border-bottom: 0 !important; }
#songCoverPlayer.header-collapsed .player-container { pointer-events: none; opacity: 0; }

/* ---- Main -------------------------------------------------- */
.page {
  width: calc(100% - 160px) !important;
  max-width: var(--f-page-max) !important;
  margin-top: 279px !important;
  padding-bottom: 4rem;
}

/* ---- Section headings -------------------------------------- */
.v2-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 17px; }
.v2-section-heading h2 { display: flex; align-items: center; gap: 9px; font-size: 20px; font-weight: 700; letter-spacing: -0.35px; margin: 0; }
.v2-section-heading h2 > iconify-icon { font-size: 21px; }
.v2-section-actions { display: flex; align-items: center; gap: 7px; }
.v2-section-actions > a { font-size: 12px; color: rgba(255, 255, 255, 0.7); display: inline-flex; align-items: center; gap: 7px; }
.v2-section-actions > a:hover { color: #fff; }

/* ---- Home -------------------------------------------------- */
.v2-home { display: flex; flex-direction: column; gap: 32px; }
.v2-home-columns { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(320px, 1fr); gap: 32px; }
.v2-whats-new, .v2-recent { min-width: 0; }

.v2-banner-container {
  position: relative; height: 468px; overflow: hidden;
  border-radius: var(--f-radius-lg);
  background: radial-gradient(1200px 400px at 0% 0%, rgba(232, 227, 216, 0.08), transparent), #0003;
  border: 1px solid var(--f-border);
}
.v2-banner {
  height: 100%; padding: 36px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 24px; text-align: center;
}
.v2-banner-copy h3 { font-size: 33px; max-width: 420px; line-height: 1.22; letter-spacing: -0.8px; font-weight: 500; margin: 0 auto 13px; }
.v2-banner-copy p { font-size: 15px; color: rgba(255, 255, 255, 0.65); line-height: 1.6; margin: 0; }
.v2-banner-button {
  display: inline-flex; align-items: center; gap: 18px;
  background: var(--f-accent); color: #171717;
  padding: 11px 17px; border-radius: var(--f-radius-md);
  font-size: 13px; font-weight: 500; margin-top: 24px;
}
.v2-banner-button:hover { background: #fff; }

.v2-recent-list { height: 468px; overflow-y: auto; scrollbar-width: thin; padding: 0 0 0 2px; }
.recently-played-item > div {
  display: flex; align-items: center; gap: 12px;
  height: 66px; padding: 8px 5px; border-radius: 8px;
  transition: background 0.15s ease;
}
.recently-played-item > div:hover { background: rgba(255, 255, 255, 0.03); }
.v2-recent-list img { width: 47px; height: 47px; object-fit: cover; border-radius: 8px; flex-shrink: 0; background: #222; }
.v2-recent-list .rp-title { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v2-recent-list .rp-sub { font-size: 12px; line-height: 1.5; margin-top: 3px; color: var(--f-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.v2-social-links { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.v2-social-links > a { display: flex; align-items: center; gap: 18px; padding: 22px 25px; border: 1px solid var(--f-border); border-radius: 12px; }
.v2-social-links > a > div { flex: 1; min-width: 0; }
.v2-discord-link { background: #5865f2; }
.v2-discord-link:hover { background: #4e5be0; }
.v2-x-link { background: #000; }
.v2-x-link:hover { background: #080808; }
.v2-social-icon { display: flex; align-items: center; justify-content: center; width: 39px; flex-shrink: 0; }
.v2-social-icon iconify-icon { font-size: 30px; }
.v2-social-links h3 { font-size: 16px; font-weight: 500; margin: 0 0 3px; }
.v2-social-links p { font-size: 13px; color: rgba(255, 255, 255, 0.75); margin: 0; }

/* ---- Generic card grid ------------------------------------- */
.card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (min-width: 640px) { .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .card-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.f-card { background: var(--f-surface); border: 1px solid var(--f-border); border-radius: 12px; overflow: hidden; transition: transform 0.2s ease, border-color 0.2s ease; }
.f-card:hover { transform: translateY(-3px); border-color: rgba(255, 255, 255, 0.2); }
.f-card-art { aspect-ratio: 1/1; width: 100%; object-fit: cover; background: #1d1d1d; }
.f-card-body { padding: 14px 16px 16px; }
.f-card-title { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.f-card-sub { font-size: 13px; color: var(--f-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 3px; }

/* ---- Timetable --------------------------------------------- */
.tt-grid { display: grid; grid-template-columns: 90px 1fr; gap: 1px; background: var(--f-border); border: 1px solid var(--f-border); border-radius: 12px; overflow: hidden; }
.tt-cell { background: var(--f-surface); padding: 12px 14px; font-size: 13px; }
.tt-time { color: var(--f-muted); font-variant-numeric: tabular-nums; }
.tt-show { font-weight: 500; }
.tt-dj { color: var(--f-muted); font-size: 12px; }

/* ---- Modal ------------------------------------------------- */
.modal-container { display: flex; }
.modal-container.hidden { display: none; }
.modal-container.open .modal-content { opacity: 1; transform: scale(1); }
.modal-content { opacity: 0; transform: scale(0.96); transition: opacity 0.2s ease, transform 0.2s ease; }
.modal-inner {
  width: min(92vw, 440px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  background: #111;
  border: 1px solid var(--f-border);
  border-radius: var(--f-radius-lg);
  padding: 24px;
}
.modal-inner h2 { font-size: 22px; font-weight: 700; margin: 0 0 16px; }
.modal-close { position: absolute; top: 12px; right: 12px; }

/* ---- Footer ------------------------------------------------ */
.v2-site-footer { border-top: 1px solid var(--f-border); background: #101010; padding: 2.5rem 1rem 2rem; margin-top: auto; }
.v2-footer-inner { max-width: 80rem; margin: 0 auto; }
.v2-footer-main { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 768px) { .v2-footer-main { grid-template-columns: 1fr 2fr 1fr; align-items: start; } }
.v2-footer-navigation { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.v2-footer-navigation a { display: block; color: var(--f-muted); padding: 0.25rem 0; text-decoration: none; }
.v2-footer-navigation a:hover { color: #fff; }
.v2-footer-social a { display: flex; align-items: center; gap: 0.5rem; color: var(--f-muted); text-decoration: none; padding: 0.25rem 0; }
.v2-footer-social a:hover { color: #fff; }
.v2-footer-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid rgba(255, 255, 255, 0.05); color: var(--f-muted); font-size: 0.85rem; }
.v2-footer-top { background: transparent; border: 0; color: var(--f-muted); cursor: pointer; display: inline-flex; gap: 0.35rem; align-items: center; }
.v2-footer-top:hover { color: #fff; }

.v2-skip { position: fixed; top: -100px; left: 16px; background: var(--f-accent); color: #171717; padding: 13px 20px; border-radius: 7px; z-index: 200; font-size: 14px; }
.v2-skip:focus { top: 12px; }

/* ---- Responsive -------------------------------------------- */
@media (max-width: 1440px) { .player-container > .flex:first-child { padding: 0 80px; } }
@media (max-width: 1100px) {
  #songCoverPlayer > div > div:first-child { padding-left: 36px; padding-right: 36px; }
  .player-container > .flex:first-child { padding: 0 36px; }
  .page { width: calc(100% - 72px) !important; }
  .v2-home-columns { grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr); gap: 24px; }
}
@media (max-width: 900px) {
  .v2-home-columns { grid-template-columns: 1fr; gap: 20px; }
  .v2-banner-container { height: 380px; }
}
@media (max-width: 767px) {
  #songCoverPlayer { height: 241px; border-radius: 0 0 20px 20px; }
  #songCoverPlayer > div > div:first-child { padding: 12px 20px; height: 67px; }
  .player-container > .flex:first-child { padding: 0 20px; margin-top: 19px; gap: 12px; }
  .player-container .marquee { max-width: min(43vw, 240px); }
  .player-container > .flex:first-child > div:first-child { flex: 1 1 auto; }
  .player-container > .flex:first-child > div:last-child { flex: 0 0 auto; }
  #songCover, #djAvatar { width: 49px; height: 49px; border-radius: 10px; }
  #songTitle { font-size: 18px; }
  #songArtist { font-size: 12px; }
  #djName { font-size: 15px; }
  .page { width: calc(100% - 40px) !important; margin-top: 268px !important; }
  .v2-home { gap: 27px; }
  .v2-banner-container { height: 360px; }
  .v2-banner-copy h3 { font-size: 27px; max-width: 290px; }
  .v2-recent-list { height: auto; max-height: 476px; }
  .v2-social-links { grid-template-columns: 1fr; gap: 14px; }
}
@media (max-width: 380px) { #djAvatar { display: none; } }
