/* ==========================================================================
   Ofis radio — stylesheet
   Mobile-first: base rules target small screens, media queries (min-width)
   layer on enhancements for tablet (600px) and desktop (960px+).
   ========================================================================== */

:root {
  --bg: #FAF6F0;
  --bg-alt: #F1E7D9;
  --ink: #2B241E;
  --ink-soft: #6E6255;
  --accent: #E2703A;
  --accent-dark: #C05A28;
  --accent-2: #2F6F68;
  --card: #2B241E;
  --card-ink: #FAF6F0;
  --radius-lg: 20px;
  --radius-md: 12px;
  --max-width: 1120px;
  --font-head: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

[hidden] { display: none !important; }

/* -------------------- language toggling -------------------- */
/* Toggled via the <html data-lang="…"> attribute rather than <body>,
   so it works whether the page ships its own <body> tag or, as in an
   Artifact preview, gets one added by the host. */
html:not([data-lang="sl"]) .sl { display: none; }
html[data-lang="sl"] .en { display: none; }

/* -------------------- utility -------------------- */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem; top: -3rem;
  background: var(--accent);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-md);
  z-index: 200;
  transition: top 0.2s ease;
  text-decoration: none;
  font-weight: 600;
}
.skip-link:focus { top: 1rem; }

a { color: var(--accent-dark); }
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--accent-2);
  outline-offset: 2px;
}

/* ==========================================================================
   Header / nav
   ========================================================================== */
.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 100;
  background: rgba(250, 246, 240, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(43, 36, 30, 0.08);
}

.header-inner {
  /* Same left edge as the hero and every section: the header's own side
     padding is added on top of the shared content width. */
  max-width: calc(var(--max-width) + 2.5rem);
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--ink);
}
.brand-mark {
  display: inline-flex;
  color: var(--accent);
}
.brand-word {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}
.brand-word em {
  font-style: normal;
  color: var(--accent-dark);
}
.brand-word.small { font-size: 1.3rem; }

.nav-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: 1px solid rgba(43,36,30,0.15);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.75rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--ink);
  cursor: pointer;
}
.nav-toggle-icon {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  width: 18px;
}
.nav-toggle-icon span {
  display: block;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-icon span:nth-child(1) {
  transform: translateY(5px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-icon span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-icon span:nth-child(3) {
  transform: translateY(-5px) rotate(-45deg);
}

.site-nav {
  position: fixed;
  inset: 64px 0 auto 0;
  background: var(--bg);
  border-bottom: 1px solid rgba(43,36,30,0.08);
  padding: 1rem 1.25rem 1.5rem;
  transform: translateY(-8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.site-nav.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.site-nav ul {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.nav-link {
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  font-size: 1.05rem;
}
.nav-link:hover { color: var(--accent-dark); }

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-alt);
  border: none;
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--ink-soft);
  cursor: pointer;
}
.lang-option[data-lang-btn="en"] { color: inherit; }
html[data-lang="en"] .lang-option[data-lang-btn="en"] { color: var(--accent-dark); }
html[data-lang="sl"] .lang-option[data-lang-btn="sl"] { color: var(--accent-dark); }
.lang-sep { opacity: 0.4; }

/* ==========================================================================
   Hero + mock player
   ========================================================================== */
.hero {
  padding: 2.5rem max(1.25rem, env(safe-area-inset-right, 0px)) 3rem max(1.25rem, env(safe-area-inset-left, 0px));
  position: relative;
  overflow: hidden;
}
.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-dark);
  margin: 0 0 0.75rem;
}

.hero h1 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(2rem, 8vw, 3.4rem);
  line-height: 1.08;
  margin: 0 0 1rem;
  max-width: 16ch;
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--ink-soft);
  max-width: 46ch;
  margin: 0 0 2rem;
}

.player-card {
  background: var(--card);
  color: var(--card-ink);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
  max-width: 560px;
  box-shadow: 0 18px 40px -18px rgba(43, 36, 30, 0.45);
}

.player-art {
  position: relative;
  overflow: hidden;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.player-art-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* Scrim so the equalizer stays legible over real album art */
.player-art:has(.player-art-img:not([hidden]))::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(20,16,12,0.6), transparent 65%);
}

.eq {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 22px;
}
.eq span {
  width: 3px;
  background: rgba(250,246,240,0.9);
  border-radius: 2px;
  height: 30%;
  animation: eq-bounce 1.1s ease-in-out infinite;
  animation-play-state: paused;
}
.eq span:nth-child(1) { animation-delay: 0s; }
.eq span:nth-child(2) { animation-delay: 0.12s; }
.eq span:nth-child(3) { animation-delay: 0.24s; }
.eq span:nth-child(4) { animation-delay: 0.36s; }
.eq span:nth-child(5) { animation-delay: 0.48s; }

.player-card.is-playing .eq span { animation-play-state: running; }

@keyframes eq-bounce {
  0%, 100% { height: 25%; }
  50% { height: 100%; }
}

.player-body { min-width: 0; }

.player-status {
  display: inline-flex;
  white-space: nowrap;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 0.35rem;
}
.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.listener-count {
  font-weight: 500;
  letter-spacing: normal;
  color: rgba(250,246,240,0.5);
}
.listener-count::before {
  content: "· ";
}

.player-caption {
  margin: 0;
  font-size: 0.75rem;
  color: rgba(250,246,240,0.6);
}
.player-track {
  margin: 0.15rem 0 0;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.3;
  /* Up to two lines on narrow screens, then an ellipsis */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.player-artist {
  margin: 0.1rem 0 0;
  font-size: 0.85rem;
  line-height: 1.3;
  color: rgba(250,246,240,0.7);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.player-note {
  margin: 0.5rem 0 0;
  font-size: 0.7rem;
  font-style: italic;
  color: rgba(250,246,240,0.45);
}

.play-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, transform 0.15s ease;
}
.play-btn:hover { background: var(--accent-dark); transform: scale(1.04); }

/* ==========================================================================
   Content sections
   ========================================================================== */
.section {
  padding: 3.25rem 1.25rem;
}
.section-alt { background: var(--bg-alt); }

.section-inner {
  /* Shares the hero's content width so every section starts at the same
     left edge; running text keeps a comfortable reading measure. */
  max-width: var(--max-width);
  margin: 0 auto;
}
.section-inner > * { max-width: 68ch; }

.section-kicker {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-2);
  margin: 0 0 0.6rem;
}

.section h2 {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  margin: 0 0 1.1rem;
  line-height: 1.15;
}

.section p {
  margin: 0 0 1rem;
  color: var(--ink-soft);
}
.section p.lead {
  font-family: var(--font-head);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--ink);
  margin-bottom: 1.25rem;
}

.role-list {
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.role-list li {
  position: relative;
  padding-left: 1.4rem;
  color: var(--ink-soft);
}
.role-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--accent);
}

.btn {
  display: inline-block;
  text-decoration: none;
  font-weight: 700;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  font-size: 0.95rem;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-1px); }

.btn-outline {
  background: transparent;
  color: var(--ink);
  border: 2px solid var(--ink);
}
.btn-outline:hover {
  background: var(--ink);
  color: var(--bg);
  transform: translateY(-1px);
}

.fine-print {
  margin-top: 0.75rem;
  font-size: 0.78rem;
  color: var(--ink-soft);
  opacity: 0.75;
}

/* Player footer: "Last 10 songs" */
.player-footer {
  grid-column: 1 / -1;
  border-top: 1px solid rgba(250,246,240,0.12);
  padding-top: 0.6rem;
  margin-top: 0.1rem;
}
.player-footer:not(:has(button:not([hidden]))) { display: none; }
.history-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: none;
  border: none;
  padding: 0.35rem 0.25rem;
  color: rgba(250,246,240,0.75);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 8px;
}
.history-btn:hover { color: var(--card-ink); }

/* Song history overlay */
.history-dialog {
  width: min(620px, calc(100vw - 2rem));
  max-height: min(80vh, 640px);
  padding: 0;
  border: none;
  border-radius: var(--radius-lg);
  background: var(--card);
  color: var(--card-ink);
  box-shadow: 0 24px 60px -20px rgba(20,16,12,0.6);
  overflow: hidden;
}
.history-dialog[open] { display: flex; flex-direction: column; }
.history-dialog::backdrop { background: rgba(20,16,12,0.55); }
.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1rem 0.75rem 1.25rem;
  border-bottom: 1px solid rgba(250,246,240,0.12);
}
.history-head h2 {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.2rem;
}
.history-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(250,246,240,0.08);
  color: var(--card-ink);
  cursor: pointer;
}
.history-close:hover { background: rgba(250,246,240,0.16); }
.history-list {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
  overflow-y: auto;
}
.history-item {
  display: grid;
  grid-template-columns: 1.5rem 48px minmax(0, 1fr) auto;
  grid-template-areas: "num art text time";
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 1.25rem;
}
.history-item + .history-item { border-top: 1px solid rgba(250,246,240,0.06); }
.history-num {
  grid-area: num;
  text-align: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: rgba(250,246,240,0.55);
  font-variant-numeric: tabular-nums;
}
.history-art {
  grid-area: art;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.history-text { grid-area: text; min-width: 0; display: flex; flex-direction: column; gap: 0.1rem; }
.history-title {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.history-artist {
  font-size: 0.84rem;
  line-height: 1.35;
  color: rgba(250,246,240,0.65);
  overflow-wrap: anywhere;
}
.history-time {
  grid-area: time;
  font-size: 0.8rem;
  color: rgba(250,246,240,0.5);
  white-space: nowrap;
  text-align: right;
}
/* Phones: the time moves under the song text */
@media (max-width: 480px) {
  .history-item {
    grid-template-columns: 1.25rem 44px minmax(0, 1fr);
    grid-template-areas: "num art text" "num art time";
    row-gap: 0.15rem;
    column-gap: 0.75rem;
    padding: 0.6rem 1rem;
  }
  .history-art { width: 44px; height: 44px; }
  .history-time { text-align: left; align-self: start; }
}

/* ==========================================================================
   Listen elsewhere (under the player)
   ========================================================================== */
.listen-elsewhere {
  margin: 1rem 0 0;
  max-width: 560px;
  font-size: 0.82rem;
  color: var(--ink-soft);
}
.listen-elsewhere code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  background: var(--bg-alt);
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
  overflow-wrap: anywhere;
  user-select: all;
}

/* ==========================================================================
   Podcasts
   ========================================================================== */
.episode-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1.5rem 0 0;
}
.episode-list:empty { display: none; }

.episode {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
  padding: 1rem;
  background: #fff;
  border: 1px solid rgba(43,36,30,0.08);
  border-radius: var(--radius-lg);
}
.episode-art {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-md);
  object-fit: cover;
  background: var(--bg-alt);
}
.episode-body { min-width: 0; }
.section .episode-meta {
  margin: 0 0 0.2rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent-2);
  font-variant-numeric: tabular-nums;
}
.episode-title {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.15rem;
  line-height: 1.25;
  margin: 0 0 0.4rem;
  color: var(--ink);
  text-wrap: balance;
}
.section .episode-desc {
  margin: 0 0 0.75rem;
  font-size: 0.92rem;
  white-space: pre-line;
}
.episode-audio {
  display: block;
  width: 100%;
  height: 40px;
}

.section .episodes-empty {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  border: 1px dashed rgba(43,36,30,0.25);
  border-radius: var(--radius-md);
  font-style: italic;
}

.podcast-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin: 1.25rem 0 0;
}
.podcast-links a {
  font-weight: 600;
  text-decoration: none;
}
.podcast-links a:hover { text-decoration: underline; }

/* ==========================================================================
   Contact
   ========================================================================== */
.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
}
.cta-email {
  font-weight: 600;
  color: var(--ink);
  user-select: all;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: var(--ink);
  color: rgba(250,246,240,0.75);
  padding: 2.5rem 1.25rem;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
}
.footer-inner .brand-word { color: var(--bg); }
.footer-inner .brand-word em { color: var(--accent); }
.footer-tag {
  margin: 0.75rem 0 1.25rem;
  font-size: 0.95rem;
}
.footer-links {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.5rem;
  font-size: 0.9rem;
}
.footer-links a {
  color: var(--bg);
  text-decoration: none;
  border-bottom: 1px solid rgba(250,246,240,0.3);
}
.footer-links a:hover { border-bottom-color: var(--accent); }
.footer-copy {
  margin: 0;
  font-size: 0.78rem;
  opacity: 0.6;
}

/* ==========================================================================
   Tablet and up
   ========================================================================== */
@media (max-width: 420px) {
  .player-art { width: 48px; height: 48px; }
  .play-btn { width: 42px; height: 42px; }
}

@media (min-width: 600px) {
  .player-card { gap: 1rem; }
  .header-inner { padding-left: 1.5rem; padding-right: 1.5rem; max-width: calc(var(--max-width) + 3rem); }
  .player-card { padding: 1.5rem; }
  .episode { padding: 1.25rem; gap: 1.25rem; }
  .episode.has-art { grid-template-columns: 96px 1fr; }
  .episode-art { width: 96px; height: 96px; }
  .hero { padding: 3.5rem 1.5rem 4rem; }
  .section { padding: 4.5rem 1.5rem; }
}

/* ==========================================================================
   Desktop and up — nav becomes inline, hamburger hides
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .eq span, .live-dot { animation: none; }
}

@media (min-width: 860px) {
  .header-inner { padding: 1rem 2rem; max-width: calc(var(--max-width) + 4rem); }

  .nav-toggle { display: none; }

  .site-nav {
    position: static;
    inset: auto;
    background: none;
    border: none;
    padding: 0;
    opacity: 1;
    transform: none;
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 1.75rem;
  }
  .site-nav ul {
    flex-direction: row;
    margin: 0;
    gap: 1.75rem;
  }
  .nav-link { font-size: 0.95rem; }

  .hero { padding: 5rem 2rem 5.5rem; }
  .hero-inner { display: block; }

  .hero::before,
  .hero::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.35;
    z-index: 0;
  }
  .hero::before {
    width: 420px;
    height: 420px;
    right: -120px;
    top: -80px;
    background: var(--accent);
  }
  .hero::after {
    width: 320px;
    height: 320px;
    right: 120px;
    top: 220px;
    background: var(--accent-2);
    opacity: 0.25;
  }

  .hero-sub { max-width: 52ch; }

  .section { padding: 6rem 2rem; }
  .section-inner > * { max-width: 72ch; }
}
