/* ===== RESET & BASE ===== */
* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
}

body {
  display: flex;
  flex-direction: column;
  font-size: 15px;
  font-family: Arial, sans-serif;
  background-color: #E6E7E7;
  color: #565656;
  min-height: 100vh;
}

/* ===== LAYOUT ===== */
.site_main {
  flex: 1 0 auto;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 16px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

/* Ensure content area fills space */
.block {
  width: 100%;
  flex: 1 0 auto;
}

.body_block {
  width: 100%;
  max-width: 1240px;
  margin: 50px auto 20px;
  padding: 0 16px;
  box-sizing: border-box;
}

/* ===== HEADER ===== */
.top_pad_div {
  position: sticky;
  top: 0;
  z-index: 9999;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background-color: rgba(230, 231, 231, 0.9);
  width: 100%;
}

.top_div {
  max-width: 1240px;
  margin: 0 auto;
  padding: 20px 16px; /* bigger header */
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
}

/* Navigation */
.div_chapter {
  display: flex;
  gap: 36px; /* bigger spacing */
  align-items: center;
  flex-wrap: wrap;
}

.top_menu {
  font-size: 19px; /* bigger nav */
  font-family: Arial;
  color: #565656;
  text-decoration: none;
  font-weight: bold;
}

.top_menu:hover {
  text-decoration: underline;
}

.site_brand {
  color: inherit;
  text-decoration: none;
  font-weight: bold;
  font-size: 22px; /* bigger brand */
}

.site_brand:hover {
  text-decoration: underline;
}



/* Back-compat: older headers use .div_name */
.div_name {
  font-weight: bold;
  font-size: 22px;
  color: inherit;
  white-space: nowrap;
}
.div_name strong { font-weight: 800; }
/* Header Actions (Search + Theme) */
.header_actions {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-left: 20px;
}

.header_search {
  position: relative;
}

.header_search_input {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 30px;
  padding: 10px 18px; /* bigger input */
  font-size: 16px;
  width: 240px;
  transition: all 0.2s ease;
}

.header_search_input:focus {
  outline: none;
  background: white;
  width: 320px; /* bigger expand */
  border-color: rgba(0, 0, 0, 0.2);
}

.header_search_btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 18px; /* bigger icon */
  cursor: pointer;
  opacity: 0.6;
  padding: 6px 10px;
}

.header_search_btn:hover {
  opacity: 1;
}

.theme_toggle {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 30px;
  padding: 10px 18px; /* bigger toggle */
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 48px;
  text-align: center;
}

.theme_toggle:hover {
  background: rgba(255, 255, 255, 0.8);
  transform: translateY(-1px);
}



/* Header responsive tweaks */
@media (max-width: 560px) {
  .div_chapter { gap: 18px; }
  .top_menu { font-size: 17px; }
  .header_search_input { width: 170px; }
  .header_search_input:focus { width: 220px; }
  .div_name { font-size: 20px; }
}
/* ===== FOOTER ===== */
.site_footer {
  margin-top: auto;
  width: 100%;
  padding: 40px 0 30px;
}

.site_footer_inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 15px;
}

.footer_left {
  white-space: nowrap;
  font-weight: bold;
}

.footer_center {
  display: flex;
  gap: 30px;
}

.footer_center a {
  font-weight: bold;
  text-decoration: none;
  color: inherit;
}

.footer_center a:hover {
  text-decoration: underline;
}

.footer_right {
  display: flex;
  gap: 30px;
}

.footer_right a {
  font-weight: bold;
  text-decoration: none;
  color: inherit;
}

.footer_right a:hover {
  text-decoration: underline;
}

/* Dark mode footer */
body.dark_mode .site_footer {
  opacity: 0.9;
}

/* Responsive */
@media (max-width: 900px) {
  .site_footer_inner {
    flex-direction: column;
    text-align: center;
    gap: 15px;
  }
  
  .footer_center, .footer_right {
    gap: 20px;
  }
}

@media (max-width: 600px) {
  .footer_center {
    flex-direction: column;
    gap: 10px;
  }
  
  .footer_right {
    flex-direction: column;
    gap: 10px;
  }
}

/* ===== DARK MODE - SOFTER GRAYS ===== */
body.dark_mode {
  background-color: #121212;
  color: #cccccc;  /* Softer gray for body text */
}

/* Headers and titles - slightly brighter but still soft */
body.dark_mode h1,
body.dark_mode h2,
body.dark_mode h3,
body.dark_mode .p_section_title,
body.dark_mode .featured_poem_title,
body.dark_mode .poem_title,
body.dark_mode .card_title,
body.dark_mode .dom_card_title {
  color: #e0e0e0;  /* Soft white for headers */
}

/* Header */
body.dark_mode .top_pad_div {
  background-color: rgba(18, 18, 18, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

body.dark_mode .top_menu,
body.dark_mode .site_brand {
  color: #cccccc;
}

body.dark_mode .top_menu:hover,
body.dark_mode .site_brand:hover {
  color: #e0e0e0;
}

/* Header search */
body.dark_mode .header_search_input {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
  color: #cccccc;
}

body.dark_mode .header_search_input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

body.dark_mode .header_search_input:focus {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

body.dark_mode .header_search_btn {
  color: #999999;
}

body.dark_mode .header_search_btn:hover {
  color: #cccccc;
}

body.dark_mode .theme_toggle {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
  color: #cccccc;
}

body.dark_mode .theme_toggle:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #e0e0e0;
}

/* Poetry Home Page */
body.dark_mode .p_hero {
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

body.dark_mode .p_hero_overlay {
  background: linear-gradient(to top, rgba(0,0,0,0.8), rgba(0,0,0,0.3) 70%);
}

body.dark_mode .p_hero_title {
  color: #f0f0f0;  /* Slightly brighter for hero */
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

body.dark_mode .chip {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
  color: #dddddd;
}

body.dark_mode .p_hero_actions .btn {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
  color: #dddddd !important;
}

body.dark_mode .p_hero_actions .btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff !important;
}

body.dark_mode .p_hero_actions .btn.btn_dark {
  background: rgba(0, 0, 0, 0.5);
  border-color: rgba(255, 255, 255, 0.15);
}

/* Section headers */
body.dark_mode .p_section_title {
  color: #e0e0e0;
  opacity: 0.9;
}

body.dark_mode .p_section_meta {
  color: #999999;
}

body.dark_mode .p_arrow {
  color: #888888;
}

body.dark_mode .p_arrow:hover {
  color: #cccccc;
}

/* Cards */
body.dark_mode .card {
  background: #1a1a1a;
  border-color: rgba(255, 255, 255, 0.05);
}

body.dark_mode .card:hover {
  background: #222222;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

body.dark_mode .card_title {
  color: #e0e0e0;
}

body.dark_mode .card_meta {
  color: #999999;
}

body.dark_mode .card_badge {
  background: rgba(0, 0, 0, 0.8);
  color: #dddddd;
  border-color: rgba(255, 255, 255, 0.1);
}

/* Novinki cards (text only) */
body.dark_mode .shelf_novinki .card {
  background: #1a1a1a;
}

body.dark_mode .shelf_novinki .card:hover {
  background: #222222;
}

/* Featured poem */
body.dark_mode .featured_poem {
  background: linear-gradient(135deg, #1a1a1a 0%, #222222 100%);
  border-color: rgba(255, 255, 255, 0.05);
}

body.dark_mode .featured_poem_label {
  color: #999999;
}

body.dark_mode .featured_poem_title {
  color: #e8e8e8;
}

body.dark_mode .featured_poem_excerpt {
  color: #bbbbbb;
}

body.dark_mode .featured_poem_btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  color: #dddddd;
}

body.dark_mode .featured_poem_btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #f0f0f0;
}

/* Aphorisms */
body.dark_mode .aph_quote {
  background: #1a1a1a;
  border-color: rgba(255, 255, 255, 0.05);
}

body.dark_mode .aph_quote:hover {
  background: #222222;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
}

body.dark_mode .aph_text {
  color: #cccccc;
}

body.dark_mode .aph_author {
  color: #999999;
}

body.dark_mode .aph_quote::before {
  color: rgba(255, 255, 255, 0.08);
}

body.dark_mode .aph_more_link {
  background: #1a1a1a;
  border-color: rgba(255, 255, 255, 0.08);
  color: #cccccc;
}

body.dark_mode .aph_more_link:hover {
  background: #252525;
  color: #e0e0e0;
}

/* Echo table */
body.dark_mode .echo_table {
  background: #1a1a1a;
  border-color: rgba(255, 255, 255, 0.05);
}

body.dark_mode .echo_table thead th {
  background: #222222;
  color: #e0e0e0;
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.dark_mode .echo_table tbody td {
  border-bottom-color: rgba(255, 255, 255, 0.03);
  color: #cccccc;
}

body.dark_mode .echo_table tbody tr:hover {
  background: #252525;
}

body.dark_mode .echo_table a {
  color: #dddddd;
}

body.dark_mode .echo_table a:hover {
  color: #ffffff;
}

/* Search block */
body.dark_mode .search_block {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}

body.dark_mode .search_input {
  color: #cccccc;
}

body.dark_mode .search_btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  color: #dddddd;
}

body.dark_mode .search_btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

body.dark_mode .search_advanced {
  color: #999999;
}

body.dark_mode .search_advanced:hover {
  color: #cccccc;
}

/* Poem page */
body.dark_mode .poem_text {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.05);
  color: #cccccc;
}

body.dark_mode .poem_meta {
  color: #999999;
}

body.dark_mode .poem_nav_link {
  background: #1a1a1a;
  border-color: rgba(255, 255, 255, 0.08);
}

body.dark_mode .poem_nav_link:hover {
  background: #252525;
}

body.dark_mode .poem_nav_dir {
  color: #999999;
}

body.dark_mode .poem_nav_title {
  color: #dddddd;
}

/* Kukolniy Dom */
body.dark_mode .dom_page_read {
  background: #121212;
  color: #cccccc;
}

body.dark_mode .dom_nav_link {
  background: #1a1a1a;
  border-color: rgba(255, 255, 255, 0.08);
  color: #cccccc;
}

body.dark_mode .dom_nav_link:hover {
  background: #252525;
  color: #e0e0e0;
}

body.dark_mode .dom_card {
  background: #1a1a1a;
  border-color: rgba(255, 255, 255, 0.05);
}

body.dark_mode .dom_card_title {
  color: #e0e0e0;
}

/* Footer - subtle grays */
body.dark_mode .site_footer {
  color: #888888;
}

body.dark_mode .site_footer a {
  color: #888888;
}

body.dark_mode .site_footer a:hover {
  color: #bbbbbb;
}

/* Utility classes for dark mode */
body.dark_mode .text-muted,
body.dark_mode .muted {
  color: #888888;
}

body.dark_mode .text-bright {
  color: #e8e8e8;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .top_div {
    flex-direction: column;
    gap: 15px;
  }
  
  .div_chapter {
    justify-content: center;
  }
  
  .header_actions {
    margin-left: 0;
    width: 100%;
    justify-content: center;
  }
  
  .header_search_input {
    width: 180px;
  }
  
  .header_search_input:focus {
    width: 200px;
  }
  
  .site_footer_inner {
    flex-direction: column;
    text-align: center;
  }
  
  .footer_left {
    flex-direction: column;
    gap: 15px;
  }
}

@media (max-width: 600px) {
  .div_chapter {
    gap: 15px;
  }
  
  .header_actions {
    flex-direction: column;
    align-items: stretch;
  }
  
  .header_search {
    width: 100%;
  }
  
  .header_search_input {
    width: 100%;
  }
  
  .header_search_input:focus {
    width: 100%;
  }
  
  .theme_toggle {
    width: 100%;
  }
}

/* === SONG PAGE: player karaoke note + actions after lyrics === */
.song_page .karaoke_player_note{
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.55);
  font-size: 14px;
  line-height: 1.35;
}

.song_page .song_actions_block{
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.55);
}

.song_page .song_actions_block .music_actions_row{
  display: flex;
  flex-wrap: wrap;
  gap: 12px 14px;
  align-items: center;
}

/* Dark mode */
body.dark_mode.song_page .karaoke_player_note,
body.dark_mode.song_page .song_actions_block{
  border-color: rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
}
/* ===== SONG PAGE: cover -> player -> lyrics layout ===== */
.song_page .song_cover_card{
  margin-top: 14px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.55);
}

.song_page .song_cover_card .song_cover{
  display: inline-block;
}

.song_page .song_player_card{
  margin-top: 14px;
  padding: 16px 18px;
  border-radius: 22px;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.55);
}

/* Audio control: make it look clean and wide */
.song_page .song_audio{
  width: 100%;
  display: block;
  border-radius: 999px;
}

/* Karaoke note under the player */
.song_page .karaoke_player_note{
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.55);
  font-size: 14px;
  line-height: 1.35;
}

/* Actions block (keeps your current good look) */
.song_page .song_actions_block{
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.55);
}

.song_page .song_actions_block .music_actions_row{
  display: flex;
  flex-wrap: wrap;
  gap: 12px 14px;
  align-items: center;
}

/* ===== Dark mode: cards + audio control + scrollbar ===== */
body.dark_mode.song_page .song_cover_card,
body.dark_mode.song_page .song_player_card,
body.dark_mode.song_page .song_actions_block{
  background: #1a1a1a;
  border-color: rgba(255,255,255,0.06);
}

body.dark_mode.song_page .karaoke_player_note{
  background: #1a1a1a;
  border-color: rgba(255,255,255,0.08);
}

/* Make native audio controls dark-ish (Chrome/Edge/Safari) */


body.dark_mode.song_page .song_audio::-webkit-media-controls-enclosure{
  border-radius: 999px;
}

body.dark_mode.song_page .song_audio::-webkit-media-controls-panel{
  background-color: #1a1a1a;
}

/* Karaoke scroll area: dark scrollbar (Chrome/Edge + Firefox) */
.song_page .karaoke_wrap{
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.32) rgba(0,0,0,0.08);
}

body.dark_mode.song_page .karaoke_wrap{
  scrollbar-color: rgba(255,255,255,0.22) rgba(255,255,255,0.06);
}

.song_page .karaoke_wrap::-webkit-scrollbar{
  width: 10px;
  height: 10px;
}

.song_page .karaoke_wrap::-webkit-scrollbar-track{
  background: rgba(0,0,0,0.08);
  border-radius: 10px;
}

.song_page .karaoke_wrap::-webkit-scrollbar-thumb{
  background: rgba(0,0,0,0.32);
  border-radius: 10px;
  border: 2px solid rgba(0,0,0,0.08);
}

body.dark_mode.song_page .karaoke_wrap::-webkit-scrollbar-track{
  background: rgba(255,255,255,0.06);
}

body.dark_mode.song_page .karaoke_wrap::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,0.20);
  border: 2px solid rgba(255,255,255,0.06);
}
/* --- SONG cover: make it ~1/3 smaller and not full-width --- */
.song_page .song_cover_card{
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Controls the cover size */
.song_page .song_cover_card .song_cover{
  width: clamp(260px, 45vw, 560px);  /* <- main size control */
}

/* Image fills that box */
.song_page .song_cover_card .song_cover img{
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  border-radius: 18px;
}
/* --- Dark mode: make native audio controls render in dark style --- */
body.dark_mode.song_page{
  color-scheme: dark; /* tells browser to use dark UI controls on this page */
}

body.dark_mode.song_page .song_audio{
  filter: none !important;
  opacity: 1;
  color-scheme: dark;
  background: #121212;
  border-radius: 999px;
}

/* Chromium/WebKit panel background */
body.dark_mode.song_page .song_audio::-webkit-media-controls-enclosure{
  border-radius: 999px;
  background: #121212;
}

body.dark_mode.song_page .song_audio::-webkit-media-controls-panel{
  background-color: #121212;
}