/* ===== Федерация фигурного катания Ставропольского края — общие стили ===== */
:root {
  --blue: #1f6fd6;
  --blue-dark: #155aa8;
  --ice: #eef5fc;
  --text: #1c2430;
  --muted: #66707d;
  --border: #e3e8ef;
  --radius: 12px;
  --shadow: 0 4px 18px rgba(20, 40, 70, 0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif;
  color: var(--text);
  background: #fff;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

main { flex: 1; }

/* ---------- Шапка ---------- */
.header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 0;
}

.header-logo {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.header-title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  max-width: 230px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.header-title:hover { text-decoration: none; color: var(--blue); }

.nav {
  margin-left: auto;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.nav a {
  padding: 7px 9px;
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.nav a:hover { background: var(--ice); text-decoration: none; color: var(--blue); }
.nav a.active { background: var(--blue); color: #fff; }

/* Кнопка входа в админ-панель */
.nav a.nav-admin {
  border: 1.5px solid var(--blue);
  color: var(--blue);
  font-weight: 700;
}
.nav a.nav-admin:hover { background: var(--blue); color: #fff; }
.nav a.nav-admin.active { background: var(--blue); color: #fff; }

.burger {
  display: none;
  margin-left: auto;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 20px;
  cursor: pointer;
}

/* ---------- Слайдер ---------- */
.slider {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
}

.slider-track { position: relative; width: 100%; height: 100%; }

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.9s ease;
}

.slide.active { opacity: 1; }

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.slide-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 22px 28px;
  background: linear-gradient(transparent, rgba(10, 25, 45, 0.75));
  color: #fff;
  font-size: 17px;
  font-weight: 600;
}

.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
  z-index: 5;
  transition: background 0.2s;
}

.slider-btn:hover { background: #fff; }
.slider-btn.prev { left: 14px; }
.slider-btn.next { right: 14px; }

.slider-dots {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 5;
}

.slider-dots button {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  padding: 0;
}

.slider-dots button.active { background: #fff; }

/* ---------- Главная ---------- */
.hero { position: relative; }
.hero .slider { height: 75vh; min-height: 520px; border-radius: 0; }

.hero-welcome {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 6;
  pointer-events: none;
  padding: 20px;
}

.hero-welcome h1 {
  color: #fff;
  font-size: clamp(24px, 4vw, 44px);
  font-weight: 800;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.55);
  max-width: 900px;
  line-height: 1.3;
}

.section { padding: 48px 0; }
.section-grey { background: var(--ice); }

.section-title {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 24px;
  position: relative;
  padding-bottom: 12px;
}

.section-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 56px;
  height: 4px;
  border-radius: 2px;
  background: var(--blue);
}

/* ---------- Карточки ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: 22px;
}

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
  min-width: 0;
}

/* Длинные неразрывные строки (пользовательский контент) не должны ломать вёрстку */
.card-body, .event-info, .event-meta, .member-card, .doc-item, .press-item, .footer, .page-header {
  overflow-wrap: anywhere;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 26px rgba(20, 40, 70, 0.14);
}

.card-img {
  height: 190px;
  object-fit: cover;
  width: 100%;
  background: var(--ice);
}

.card-body { padding: 18px 20px 22px; flex: 1; display: flex; flex-direction: column; }

.card-date {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.card-title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 8px;
}

.card-text {
  font-size: 14px;
  color: var(--muted);
  flex: 1;
}

/* ---------- Соревнования / события ---------- */
.event-list { display: flex; flex-direction: column; gap: 16px; }

.event {
  display: flex;
  gap: 20px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
}

.event-date {
  flex-shrink: 0;
  width: 86px;
  text-align: center;
  background: var(--ice);
  border-radius: 10px;
  padding: 12px 6px;
  align-self: flex-start;
}

.event-date .day { font-size: 26px; font-weight: 800; color: var(--blue); line-height: 1.1; }
.event-date .month { font-size: 13px; color: var(--muted); text-transform: uppercase; }

.event-info { min-width: 0; overflow-wrap: anywhere; }

.event-info h3 { font-size: 18px; margin-bottom: 4px; }

.event-meta {
  font-size: 13.5px;
  color: var(--muted);
  margin-bottom: 8px;
}

.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  margin-left: 8px;
  vertical-align: middle;
}

.badge-upcoming { background: #e2f5e9; color: #1a7f43; }
.badge-past { background: #eee; color: #777; }
.badge-type { background: var(--ice); color: var(--blue); }

/* ---------- Сборная ---------- */
.team-group-title {
  font-size: 20px;
  font-weight: 700;
  margin: 30px 0 16px;
}

.member-photo {
  min-height: 210px;
  background: var(--ice);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.member-photo .member-img { width: 100%; height: 210px; object-fit: cover; }
.member-photo .card-gallery { width: 100%; }
.member-photo:has(.card-gallery) { display: block; }

.member-photo .initials {
  font-size: 44px;
  font-weight: 800;
  color: var(--blue);
  opacity: 0.45;
}

/* ---------- Галерея-слайдер в карточке ---------- */
.card-gallery { position: relative; }

.gal-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: rgba(16, 35, 60, 0.55);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  padding: 0 0 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  z-index: 2;
  font-family: inherit;
}

.gal-btn:hover { background: rgba(16, 35, 60, 0.85); }
.gal-prev { left: 8px; }
.gal-next { right: 8px; }

.gal-counter {
  position: absolute;
  right: 10px;
  bottom: 8px;
  background: rgba(16, 35, 60, 0.55);
  color: #fff;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 10px;
  z-index: 2;
  pointer-events: none;
}

/* Фото в карточке события */
.event-photo {
  flex-shrink: 0;
  width: 150px;
  border-radius: 10px;
  overflow: hidden;
  align-self: flex-start;
}

.event-photo .card-gallery { width: 100%; }
.event-photo img { width: 100%; height: 100px; object-fit: cover; display: block; }

/* Стрелки компактнее в узком блоке события */
.event-photo .gal-btn { width: 26px; height: 26px; font-size: 16px; }
.event-photo .gal-prev { left: 4px; }
.event-photo .gal-next { right: 4px; }
.event-photo .gal-counter { font-size: 10px; right: 6px; bottom: 6px; padding: 1px 6px; }

/* Список изображений в админке */
.admin-images { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

.admin-image-chip {
  position: relative;
  width: 86px;
}

.admin-image-chip img {
  width: 86px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.admin-image-chip button {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: #d33;
  color: #fff;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

/* ---------- Прочее ---------- */
.page-head { padding: 40px 0 8px; }
.page-head h1 { font-size: 30px; font-weight: 800; }
.page-head p { color: var(--muted); margin-top: 6px; }

.text-block { max-width: 860px; }
.text-block p { margin-bottom: 14px; }
.text-block h2 { font-size: 20px; margin: 26px 0 10px; }

.info-table {
  width: 100%;
  max-width: 720px;
  border-collapse: collapse;
  margin-top: 10px;
}

.info-table td {
  padding: 10px 14px;
  border: 1px solid var(--border);
  font-size: 14.5px;
}

.info-table td:first-child {
  font-weight: 700;
  width: 220px;
  background: var(--ice);
}

.doc-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  background: #fff;
  box-shadow: var(--shadow);
}

.btn {
  display: inline-block;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.btn:hover { background: var(--blue-dark); text-decoration: none; }
.btn-outline {
  background: #fff;
  color: var(--blue);
  border: 1.5px solid var(--blue);
}
.btn-outline:hover { background: var(--ice); }
.btn-danger { background: #d33; }
.btn-small { padding: 6px 12px; font-size: 13px; }

.empty-note { color: var(--muted); font-style: italic; padding: 20px 0; }

.more-link { margin-top: 22px; display: inline-block; font-weight: 700; }

/* ---------- Футер ---------- */
.footer {
  background: #10233c;
  color: #cfd9e6;
  margin-top: 60px;
  padding: 40px 0 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 30px;
}

.footer h4 { color: #fff; font-size: 16px; margin-bottom: 12px; }
.footer p, .footer a { font-size: 14px; color: #cfd9e6; }
.footer a:hover { color: #fff; }

.footer-logo { width: 64px; height: 64px; border-radius: 50%; margin-bottom: 12px; object-fit: cover; }

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin-top: 28px;
  padding-top: 16px;
  font-size: 13px;
  color: #8fa0b5;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------- Админка ---------- */
.admin-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 20px 0; }
.admin-tabs button {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 8px;
  padding: 8px 16px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
}
.admin-tabs button.active { background: var(--blue); color: #fff; border-color: var(--blue); }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
  background: var(--ice);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
}

.form-grid .full { grid-column: 1 / -1; }

.field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 4px; }

.field input, .field textarea, .field select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
}

.field textarea { resize: vertical; min-height: 90px; }

.admin-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  background: #fff;
}

.admin-item-actions { display: flex; gap: 8px; flex-shrink: 0; }

.login-box {
  max-width: 380px;
  margin: 80px auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow);
}

.login-box h1 { font-size: 22px; margin-bottom: 18px; }

.alert {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 14px;
  display: none;
}
.alert-error { background: #fdecec; color: #b3261e; display: block; }
.alert-ok { background: #e2f5e9; color: #1a7f43; display: block; }

/* ---------- Кнопка «Сообщить о допинге» ---------- */
.btn-doping {
  background: #c62828;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 8px;
  white-space: nowrap;
  flex-shrink: 0;
}
.btn-doping:hover { background: #a31f1f; color: #fff; text-decoration: none; }
.nav a.nav-doping { display: none; color: #c62828; font-weight: 700; }
.footer-doping { color: #ff8a80 !important; font-weight: 700; }
.footer-doping:hover { color: #fff !important; }

/* ---------- Формы обратной связи (152-ФЗ) ---------- */
.form-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  max-width: 640px;
  margin: 0 auto;
}
.form-box .field { margin-bottom: 14px; }
.consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  color: var(--muted);
  margin: 16px 0;
  line-height: 1.45;
}
.consent input[type="checkbox"] { margin-top: 2px; flex-shrink: 0; width: 16px; height: 16px; }
.captcha-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.captcha-row .field { margin-bottom: 0; flex: 1; min-width: 140px; }
.captcha-question {
  font-weight: 800;
  font-size: 18px;
  background: var(--ice);
  border-radius: 8px;
  padding: 9px 16px;
  white-space: nowrap;
  user-select: none;
}
.captcha-refresh {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  cursor: pointer;
  font-size: 15px;
}
.captcha-refresh:hover { background: var(--ice); }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Вопрос-ответ ---------- */
.faq-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 14px;
}
.faq-q { font-weight: 700; margin-bottom: 6px; }
.faq-meta { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.faq-a {
  border-left: 3px solid var(--blue);
  padding: 8px 14px;
  background: var(--ice);
  border-radius: 0 8px 8px 0;
}

/* ---------- Реквизиты ---------- */
.req-table { width: 100%; max-width: 640px; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.req-table td { padding: 10px 16px; border-bottom: 1px solid var(--border); font-size: 14px; }
.req-table td:first-child { font-weight: 700; width: 220px; background: var(--ice); }
.req-table tr:last-child td { border-bottom: none; }

/* Админка: карточка вопроса */
.question-item { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 14px; }
.question-item .q-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.question-item .q-badge { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 20px; }
.q-badge.badge-new { background: #fff3e0; color: #b26a00; }
.q-badge.badge-pub { background: #e2f5e9; color: #1a7f43; }
.q-badge.badge-ans { background: #e3f0ff; color: var(--blue); }
.question-item textarea { width: 100%; min-height: 80px; margin: 10px 0; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; font: inherit; font-size: 14px; resize: vertical; }
.question-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.question-actions label { font-size: 13px; display: flex; gap: 6px; align-items: center; }

/* ---------- Адаптив ---------- */
@media (max-width: 480px) {
  .page-head h1 { font-size: 24px; overflow-wrap: anywhere; }
  .info-table, .info-table tbody, .info-table tr, .info-table td { display: block; width: 100%; }
  .info-table td:first-child { width: 100%; border-bottom: none; }
  .info-table td:first-child + td { border-top: none; }
  .info-table td { overflow-wrap: anywhere; }
  .form-grid { padding: 14px; }
  .admin-item { flex-direction: column; }
  .admin-item-actions { flex-wrap: wrap; }
}

@media (max-width: 900px) {
  .header-inner { flex-wrap: wrap; }
  .header-title { max-width: none; font-size: 13px; }
  .btn-doping { display: none; }
  .nav a.nav-doping { display: block; }
  .burger { display: block; }
  .nav {
    display: none;
    width: 100%;
    flex-direction: column;
    margin-left: 0;
    padding-bottom: 10px;
  }
  .nav.open { display: flex; }
  .hero .slider { height: 55vh; min-height: 380px; }
  .footer-grid { grid-template-columns: 1fr; }
  .event { flex-direction: column; }
  .event-photo { width: 100%; }
  .event-photo img { height: 170px; }
  .event-date { width: auto; display: flex; gap: 8px; align-items: baseline; }
  .form-grid { grid-template-columns: 1fr; }
}
