/* ============================================================
   RC South Theme — Радиокомплекс «Южный»
   Colors: Navy #000655, Orange #FD3E04, Dark #1E1D2D
   Fonts: Onest (headings), Inter (body)
   ============================================================ */

/* ---------- Google Fonts fallback ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Onest:wght@500;600;700;800&display=swap');

/* ---------- Base ---------- */
:root {
  --rc-navy: #000655;
  --rc-navy-light: #0A1A7A;
  --rc-orange: #FD3E04;
  --rc-orange-hover: #E03500;
  --rc-dark: #1E1D2D;
  --rc-grey: #3F444B;
  --rc-light-grey: #E6E6E6;
  --rc-bg: #F5F5F7;
  --rc-white: #FFFFFF;
  --font-heading: 'Onest', 'Inter', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
  font-family: var(--font-body);
  background: var(--rc-bg);
  color: var(--rc-dark);
  -webkit-font-smoothing: antialiased;
  /* blades.min.css sets hyphens:auto — syllable hyphenation looks sloppy
     in Russian; wrap whole words only (overflow-wrap still protects
     against unbreakable long words overflowing the layout). */
  hyphens: none;
  overflow-wrap: break-word;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--rc-navy);
}

a {
  color: var(--rc-orange);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover { color: var(--rc-orange-hover); }

/* ---------- Header — Dark Navy ---------- */
#header {
  background: var(--rc-navy) !important;
  border-bottom: 3px solid var(--rc-orange);
  box-shadow: 0 2px 12px rgba(0, 6, 85, 0.15);
}

#header .navbar {
  padding: 0.5rem 0;
}

#header .logo a {
  color: var(--rc-white) !important;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

/* Inline SVG logo (rc-logo-white.svg) — constrain to header height */
#header .navbar-brand svg,
.mobile-logo svg {
  display: block;
  height: 1.7rem;
  width: auto;
}

#header .logo a:hover {
  color: var(--rc-orange) !important;
}

/* Nav links */
#header .dropmenu a {
  color: rgba(255, 255, 255, 0.85) !important;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  transition: color 0.2s;
  padding: 0.5rem 1rem;
}

#header .dropmenu a:hover,
#header .dropmenu a.active {
  color: var(--rc-orange) !important;
}

/* Nav pills — theme.css .dropmenu paints active/hover with q2 gray vars
   (--q2-text / --q2-bg-muted) made for a light header; ours is always navy,
   so the pill read as a dirty gray button. Pin a white wash instead —
   subtle in both themes. Top level only; the dropdown panel keeps its
   own surface and gray hover. */
#header .dropmenu > ul > li > a:hover,
#header .dropmenu > ul > li > a.active,
#header .dropmenu > ul > li > a.active:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Theme switcher moved to the footer only (see .theme-slider below);
   the header toggle markup was removed, these rules are dead. */

/* Mobile hamburger */
/* Mobile hamburger — white pill over the always-navy header, both themes.
   Fixed colors on purpose: --rc-white turns dark in dark mode, and the
   header surface is navy in both themes. */
.mobile-menu .button_container {
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.mobile-menu .button_container:hover {
  background: #f2f2f5;
}

.mobile-menu .button_container span {
  background: var(--rc-navy);
}

/* Mobile overlay */
.mobile-container .overlay {
  background: var(--rc-navy);
}

.mobile-container .overlay-menu a {
  color: #ffffff !important;
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 600;
}

.mobile-container .overlay-menu a:hover,
.mobile-container .overlay-menu a.active {
  color: var(--rc-orange) !important;
}

/* ---------- Hero / Homepage ---------- */
.page-home-hero {
  background: linear-gradient(135deg, var(--rc-navy) 0%, var(--rc-navy-light) 50%, var(--rc-navy) 100%);
  color: var(--rc-white);
  padding: 4rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-home-hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--rc-orange);
}

/* ---------- Content ---------- */
#body-wrapper {
  background: var(--rc-white);
  padding: 2.5rem 0;
}

#body-wrapper .container {
  max-width: 1100px;
}

/* Tables styling */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 1.5rem 0;
  font-size: 0.95rem;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

table thead th {
  background: var(--rc-navy);
  color: var(--rc-white);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.85rem 1rem;
  text-align: left;
}

table tbody td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--rc-light-grey);
  background: var(--rc-white);
}

table tbody tr:last-child td {
  border-bottom: none;
}

table tbody tr:hover td {
  background: rgba(253, 62, 4, 0.03);
}

table tbody td a {
  font-weight: 600;
}

/* Cards / sections */
hr {
  border: none;
  border-top: 2px solid var(--rc-light-grey);
  margin: 2rem 0;
}

/* ---------- Shop card (individual shop page) ---------- */
.shop-header {
  background: linear-gradient(135deg, var(--rc-navy), var(--rc-navy-light));
  color: var(--rc-white);
  padding: 2rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  border-left: 4px solid var(--rc-orange);
}

.shop-header h1 {
  color: var(--rc-white);
  margin: 0 0 0.5rem 0;
}

.shop-header .shop-meta {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

.shop-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.shop-info-card {
  background: var(--rc-white);
  border: 1px solid var(--rc-light-grey);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.shop-info-card .label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--rc-grey);
  margin-bottom: 0.25rem;
}

.shop-info-card .value {
  font-weight: 600;
  color: var(--rc-dark);
}

/* ---------- Footer ----------
   The footer is always a dark band (navy in light theme, #0A0A15 in dark),
   so its text palette is pinned to fixed light colors — NOT theme vars:
   --rc-white turns dark in dark mode (h4 would vanish), and blades sets
   p { color: var(--pico-color) } which is near-black in light mode. */
#footer {
  background: var(--rc-dark);
  color: rgba(255, 255, 255, 0.75);
  padding: 3rem 0 1.5rem;
}

#footer h4 {
  color: #ffffff;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

#footer p {
  color: rgba(255, 255, 255, 0.75);
}

#footer a {
  color: rgba(255, 255, 255, 0.6);
}
#footer a:hover {
  color: var(--rc-orange);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  text-align: center;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.4);
}

.footer-bottom p {
  margin: 0;
}

/* ---------- Theme slider (footer) ----------
   Small pill switch; thumb slides light/auto/dark, symbol inside swaps.
   Icon visibility follows the root data-theme-preference, same as the
   header toggle. */
.theme-slider {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 22px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--q2-radius-pill);
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
  line-height: 0;
  font-size: 0;
  box-shadow: none;
  transition: background 0.2s ease;
}

.theme-slider:hover {
  background: rgba(255, 255, 255, 0.22);
}

.theme-slider:focus-visible {
  outline: 2px solid var(--q2-focus-ring);
  outline-offset: 2px;
}

.theme-slider__track {
  position: relative;
  width: 100%;
  height: 100%;
}

.theme-slider__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-slider .icon {
  display: none;
  font-size: 9px;
  line-height: 1;
  color: var(--rc-navy);
}

:root[data-theme-preference='light'] .theme-slider__thumb {
  transform: translateX(0);
}
:root[data-theme-preference='auto'] .theme-slider__thumb {
  transform: translateX(9px);
}
:root[data-theme-preference='dark'] .theme-slider__thumb {
  transform: translateX(18px);
}

:root[data-theme-preference='light'] .theme-slider .icon-sun {
  display: block;
}
:root[data-theme-preference='auto'] .theme-slider .icon-auto {
  display: block;
}
:root[data-theme-preference='dark'] .theme-slider .icon-moon {
  display: block;
}

/* ---------- Buttons & accents ---------- */
.button, .btn, button[type="submit"], .contrast {
  background: var(--rc-orange) !important;
  color: var(--rc-white) !important;
  border: none !important;
  border-radius: 6px;
  padding: 0.65rem 1.5rem;
  font-family: var(--font-heading);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.button:hover, .btn:hover, button[type="submit"]:hover, .contrast:hover {
  background: var(--rc-orange-hover) !important;
  transform: translateY(-1px);
}

/* ---------- Breadcrumbs / Back link ---------- */
.back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
  color: var(--rc-grey);
  font-size: 0.9rem;
}
.back-link:hover {
  color: var(--rc-orange);
}

/* ---------- Highlight boxes ---------- */
.callout {
  background: rgba(253, 62, 4, 0.06);
  border-left: 4px solid var(--rc-orange);
  padding: 1.25rem 1.5rem;
  border-radius: 0 8px 8px 0;
  margin: 1.5rem 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  #header .logo a {
    font-size: 1rem;
  }

  /* Inline SVG logo — shrink so it doesn't swallow the mobile navbar */
  #header .navbar-brand svg,
  .mobile-logo svg {
    height: 1.4rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-bottom {
    flex-direction: column;
  }

  table {
    font-size: 0.85rem;
  }
  table thead th,
  table tbody td {
    padding: 0.5rem 0.6rem;
  }

  .shop-header {
    padding: 1.25rem;
  }
}

/* ---------- Dark mode overrides ---------- */
:root[data-theme='dark'] {
  --rc-bg: #0D0D1A;
  --rc-white: #1A1A2E;
  --rc-light-grey: #2A2A3E;
  --rc-dark: #E0E0E0;
  --rc-navy: #000440;
}

:root[data-theme='dark'] body {
  background: var(--rc-bg);
  color: #D0D0D0;
}

:root[data-theme='dark'] #body-wrapper {
  background: #12122A;
}

:root[data-theme='dark'] #header {
  background: #000440 !important;
}

:root[data-theme='dark'] h1,
:root[data-theme='dark'] h2,
:root[data-theme='dark'] h3,
:root[data-theme='dark'] h4,
:root[data-theme='dark'] h5,
:root[data-theme='dark'] h6 {
  color: #E0E0E0;
}

:root[data-theme='dark'] table thead th {
  background: #000440;
}

:root[data-theme='dark'] table tbody td {
  background: var(--rc-white);
  border-color: var(--rc-light-grey);
}

:root[data-theme='dark'] .shop-info-card {
  background: var(--rc-white);
  border-color: var(--rc-light-grey);
}

:root[data-theme='dark'] .shop-header {
  background: linear-gradient(135deg, #000440, #0A1A7A);
}

:root[data-theme='dark'] #footer {
  background: #0A0A15;
}

/* ---------- Credentials popup (/contacts) ----------
   Opened from the Администрация block via [data-credentials-open].
   Modal over the navy-adjacent page; panel surface follows the theme
   (var(--rc-white) is dark in dark mode, which is what we want here). */
.btn-credentials {
  display: inline-block;
  margin: 0.5rem 0 0;
  padding: 0.55rem 1.25rem;
  border: 0;
  border-radius: var(--q2-radius-md);
  background: linear-gradient(135deg, var(--rc-orange), var(--rc-orange-hover));
  color: #ffffff;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-credentials:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(253, 62, 4, 0.35);
}

.credentials-popup[hidden] {
  display: none;
}
.credentials-popup {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.credentials-popup__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}
.credentials-popup__panel {
  position: relative;
  width: 100%;
  max-width: 660px;
  max-height: 85vh;
  overflow-y: auto;
  background: var(--rc-white);
  border-radius: var(--q2-radius-lg);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
}
.credentials-popup__head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--rc-light-grey);
  background: var(--rc-white);
}
.credentials-popup__head h2 {
  margin: 0;
  font-size: 1.15rem;
}
.credentials-popup__close {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--q2-radius-sm);
  background: transparent;
  color: var(--rc-dark);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}
.credentials-popup__close:hover {
  background: var(--rc-light-grey);
}
.credentials-popup__body {
  padding: 1.25rem 1.5rem 1.5rem;
}
.credentials-popup__body h3 {
  font-size: 1rem;
  margin: 1.25rem 0 0.5rem;
}
.credentials-popup__body table {
  margin: 0 0 0.5rem;
}
body.popup-open {
  overflow: hidden;
}

/* ---------- Print ---------- */
@media print {
  #header, #footer, .mobile-menu, .mobile-container { display: none; }
}
