/* style.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    /* min-height: 100vh; */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;

    min-height: 100vh;
    /* display: flex; */
    flex-direction: column;
    /* align-items: center; */
}

.container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px;
    max-width: 600px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
}

.language-switcher {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-bottom: 20px;
    z-index: 100;
}

.lang-btn {
    background: rgba(102, 126, 234, 0.1);
    border: 2px solid transparent;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    color: #667eea;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.lang-btn:hover {
    background: rgba(102, 126, 234, 0.2);
}

.lang-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
    pointer-events: none;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 10px;
    font-size: 2em;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 40px;
    font-size: 0.95em;
}

.sound-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.sound-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid transparent;
}

.sound-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.sound-card.playing {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.sound-icon {
    font-size: 3em;
    margin-bottom: 10px;
}

.sound-name {
    font-weight: 600;
    font-size: 1.1em;
}

.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap; /* Добавлено: позволяет элементам переноситься */
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    max-width: 300px;
    min-width: 200px; /* Добавлено: минимальная ширина */
}

.volume-icon {
    font-size: 1.5em;
}

input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 5px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
}

.stop-all-btn {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    white-space: nowrap; /* Добавлено: текст не переносится */
}

.stop-all-btn:hover {
    background: #ee5a52;
    transform: scale(1.05);
}

/* Медиа-запросы для мобильных устройств */
@media (max-width: 768px) {
    .language-switcher {
        margin-bottom: 15px;
    }
}

@media (max-width: 500px) {
    body {
        padding: 15px; /* Уменьшены отступы */
    }
    
    .container {
        padding: 25px 20px; /* Уменьшены боковые отступы */
        border-radius: 15px;
    }
    
    .language-switcher {
        gap: 8px;
        margin-bottom: 15px;
    }
    
    .lang-btn {
        padding: 6px 12px;
        font-size: 14px;
    }
    
    h1 {
        font-size: 1.5em;
        margin-bottom: 8px;
    }
    
    .subtitle {
        font-size: 0.9em;
        margin-bottom: 25px;
    }
    
    .sound-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        margin-bottom: 25px;
    }
    
    .sound-card {
        padding: 20px 15px;
    }
    
    .sound-icon {
        font-size: 2.5em;
        margin-bottom: 8px;
    }
    
    .sound-name {
        font-size: 0.95em;
    }
    
    .controls {
        flex-direction: column; /* Вертикальное расположение */
        gap: 15px;
        width: 100%;
    }
    
    .volume-control {
        width: 100%;
        max-width: 100%;
        min-width: auto;
    }
    
    .volume-icon {
        font-size: 1.3em;
    }
    
    .stop-all-btn {
        width: 100%; /* Кнопка на всю ширину */
        padding: 14px 25px;
    }
}

@media (max-width: 360px) {
    .container {
        padding: 20px 15px;
    }
    
    h1 {
        font-size: 1.3em;
    }
    
    .sound-card {
        padding: 15px 10px;
    }
    
    .sound-icon {
        font-size: 2em;
    }
    
    .sound-name {
        font-size: 0.85em;
    }
}


/* Accessible focus outline */
.sound-card:focus-visible,
.lang-btn:focus-visible,
.stop-all-btn:focus-visible,
#volumeSlider:focus-visible {
  outline: 3px solid #6aa9ff;
  outline-offset: 3px;
  border-radius: 10px;
}

/* Кнопка визуально как карточка */
.sound-card {
  /* appearance: none;
  border: none;
  background: var(--card-bg, #fff); */
  /* cursor: pointer; */
  display: flex;
  flex-direction: column;
  align-items: center;
  /* padding: 16px;
  border-radius: 12px; */
} 

/* Состояние включено (aria-pressed="true") */
.sound-card[aria-pressed="true"] {
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.35) inset;
}

/* Скрываем текст для глаз, но оставляем для скринридеров */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}


/* Footer */
.footer {
  margin-top: 30px;
  text-align: center;
  background: transparent;
  padding: 15px 0;
}

.footer-nav {
  display: flex;
  justify-content: center;
  gap: 28px;
  flex-wrap: wrap;
}

.footer-nav a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95em;
  position: relative;
  transition: color 0.3s ease, transform 0.2s ease;
}

/* при наведении */
.footer-nav a:hover {
  color: #ffffff;
  transform: translateY(-2px);
}

/* активная ссылка (текущая страница) */
.footer-nav a.active,
.footer-nav a[aria-current="page"] {
  color: #ffffff;
  font-weight: 600;
}

/* подчеркивание активной */
.footer-nav a.active::after,
.footer-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -4px;
  transform: translateX(-50%);
  width: 24px;
  height: 2px;
  background-color: #ffffff;
  border-radius: 2px;
}

/* мобильная адаптация */
@media (max-width: 500px) {
  .footer-nav {
    gap: 18px;
  }
  .footer-nav a {
    font-size: 0.9em;
  }
}

/* блог */
/* --- Blog cards --- */
.blog-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.blog-card {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  border-radius: 16px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.blog-link {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 18px 16px;
  text-decoration: none;
  color: inherit;
}

.blog-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 28px rgba(0,0,0,0.12);
}

.blog-emoji {
  font-size: 32px;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
}

.blog-title {
  margin: 0 0 6px 0;
  font-size: 1.1em;
  color: #333;
}

.blog-excerpt {
  margin: 0;
  color: rgba(0,0,0,0.70);
  font-size: 0.95em;
}

.blog-date {
  justify-self: end;
  color: rgba(0,0,0,0.55);
  font-size: 0.9em;
}

/* mobile */
@media (max-width: 600px) {
  .blog-link {
    grid-template-columns: 40px 1fr;
    grid-template-rows: auto auto;
    gap: 10px;
  }
  .blog-date {
    grid-column: 2 / -1;
    justify-self: start;
    margin-top: 4px;
  }
}