/* ── Radio Masthead ────────────────────────────────── */
.radio-masthead {
  padding: 2rem 1rem 0;
  display: flex;
  justify-content: center;
}

/* ── Radio Body ───────────────────────────────────── */
.radio {
  display: grid;
  background: linear-gradient(180deg, var(--radio-light), var(--radio-dark));
  border: 3px solid #444;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 4px 24px rgba(0, 0, 0, 0.5),
    0 1px 0 #555;
  position: relative;
  overflow: visible;
}

/* ── Mobile: Portrait HT ─────────────────────────── */
.radio {
  grid-template-areas:
    "knob"
    "speaker"
    "display"
    "nav";
  grid-template-rows: auto auto auto 1fr;
  max-width: 280px;
  width: 100%;
  border-radius: 18px 18px 32px 32px;
  padding: 1rem;
  gap: 0.75rem;
}

/* ── PTT Button Bump (mobile only) ────────────────── */
.radio__ptt {
  display: block;
  position: absolute;
  left: -14px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 72px;
  background: linear-gradient(180deg, var(--radio-light), var(--radio-dark));
  border-radius: 6px 0 0 6px;
  border: 3px solid #444;
  border-right: none;
  box-shadow:
    inset 1px 0 0 rgba(255, 255, 255, 0.08),
    -2px 0 6px rgba(0, 0, 0, 0.4);
}

/* ── Speaker Grille ───────────────────────────────── */
.radio__speaker {
  grid-area: speaker;
  background: #1a1a1a;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6);
  height: 80px;
}

.radio__speaker svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* ── LCD Display ──────────────────────────────────── */
.radio__display {
  grid-area: display;
  background: var(--lcd-bg);
  border-radius: 8px;
  padding: 1rem;
  box-shadow:
    inset 0 2px 8px rgba(0, 0, 0, 0.5),
    0 1px 0 rgba(255, 255, 255, 0.05);
  position: relative;
  overflow: hidden;
  text-align: center;
}

/* Scan-line overlay */
.radio__display::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    180deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.12) 2px,
    rgba(0, 0, 0, 0.12) 4px
  );
  pointer-events: none;
}

.radio__lcd-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.radio__lcd {
  font-family: "VT323", monospace;
  font-size: 2rem;
  color: var(--lcd-text);
  text-shadow: 0 0 8px rgba(114, 216, 87, 0.6);
  letter-spacing: 0.05em;
  line-height: 1.2;
}

.radio__rssi {
  color: var(--lcd-text);
  opacity: 0.7;
  width: 22px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 0.2rem;
  filter: drop-shadow(0 0 3px rgba(114, 216, 87, 0.4));
}

.radio__rssi svg {
  width: 100%;
  height: 100%;
  display: block;
}

.radio__lcd-sub {
  font-family: "VT323", monospace;
  font-size: 1rem;
  color: var(--lcd-text);
  text-shadow: 0 0 6px rgba(114, 216, 87, 0.4);
  opacity: 0.8;
  margin-top: 0.25rem;
  min-height: 1.3em;
  letter-spacing: 0.08em;
}

/* ── Nav Buttons ──────────────────────────────────── */
.radio__nav {
  grid-area: nav;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.radio__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.4rem;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #ddd;
  text-decoration: none;
  background: linear-gradient(180deg, #484848, #383838);
  border: 1px solid #555;
  border-radius: 5px;
  box-shadow:
    0 3px 0 #222,
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: box-shadow 0.08s, transform 0.08s;
  user-select: none;
  text-align: center;
  line-height: 1.2;
}

.radio__btn:hover {
  text-decoration: none;
  background: linear-gradient(180deg, #525252, #424242);
  color: #fff;
}

.radio__btn:active {
  box-shadow:
    0 1px 0 #222,
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transform: translateY(2px);
}

.radio__btn:focus-visible {
  outline: 2px solid var(--focus-color);
  outline-offset: 2px;
}

.radio__btn--active {
  background: linear-gradient(180deg, #5a3a28, #4a2a1a);
  border-color: var(--brand-orange);
  color: var(--brand-gold);
  box-shadow:
    0 3px 0 #222,
    inset 0 1px 0 rgba(255, 90, 51, 0.2),
    0 0 8px rgba(255, 90, 51, 0.15);
}

/* ── Tuning Knob ──────────────────────────────────── */
.radio__knob {
  grid-area: knob;
  justify-self: end;
  width: 48px;
  height: 48px;
}

.radio__knob svg {
  width: 100%;
  height: 100%;
}

/* ══════════════════════════════════════════════════════
   Desktop: Landscape Mobile Rig (>= 768px)
   ══════════════════════════════════════════════════════ */
@media (min-width: 768px) {
  .radio-masthead {
    padding: 2.5rem 2rem 0;
  }

  .radio {
    grid-template-areas:
      "speaker display display knob"
      "speaker nav     nav     knob";
    grid-template-columns: 140px 1fr 1fr 64px;
    grid-template-rows: auto 1fr;
    max-width: 900px;
    border-radius: 16px;
    padding: 1.25rem;
    gap: 1rem;
  }

  /* Hide PTT bump on desktop */
  .radio__ptt {
    display: none;
  }

  /* Speaker: taller in landscape */
  .radio__speaker {
    height: auto;
    min-height: 120px;
    border-radius: 8px;
  }

  /* LCD: left-aligned in landscape */
  .radio__display {
    text-align: left;
    padding: 0.85rem 1.25rem;
  }

  .radio__lcd {
    font-size: 1.75rem;
  }

  /* Nav: 4 columns in landscape */
  .radio__nav {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    align-content: start;
  }

  .radio__btn {
    padding: 0.5rem 0.5rem;
    font-size: 0.7rem;
  }

  /* Knob: vertically centered */
  .radio__knob {
    align-self: center;
    justify-self: center;
    width: 56px;
    height: 56px;
  }
}
