/* ═══════════════════════════════════════
   Шахматная школа 4 офицера — Летний лагерь
   Палитра: оранжевый #F8A520, красный #D44028
   Mobile-first (84% трафика — смартфоны)
═══════════════════════════════════════ */

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

:root {
  --orange: #F8A520;
  --red:    #D44028;
  --dark:   #1C1C1C;
  --light:  #FFF9F2;
  --white:  #FFFFFF;
  --gray:   #F4F4F4;
  --text:   #333333;
  --radius: 12px;
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--text);
  background: var(--white);
  font-size: 16px;
  line-height: 1.6;
}

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

/* ═══ HEADER ═══ */
.site-header {
  background: var(--white);
  padding: 12px 0;
  border-bottom: 2px solid var(--orange);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  flex-shrink: 0;
}

.header-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.header-school {
  font-size: 11px;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.header-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--red);
}

/* ═══ HERO ═══ */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: flex-end;
  padding-bottom: 52px;
  border-bottom: 4px solid var(--orange);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.1) 0%,
    rgba(0,0,0,0.28) 40%,
    rgba(0,0,0,0.72) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 1;
  color: var(--white);
  text-align: center;
}

.hero-title {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 12px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.hero-sub {
  font-size: 15px;
  opacity: 0.92;
  margin-bottom: 32px;
  line-height: 1.5;
}

/* ═══ CTA — КНОПКА + ДРОПДАУН ═══ */
.cta-center {
  display: flex;
  justify-content: center;
}

.cta-wrap {
  position: relative;
  display: inline-block;
}

.btn {
  display: inline-block;
  padding: 16px 32px;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: opacity 0.18s, transform 0.12s;
  -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--red);
  color: var(--white);
}
.btn-primary:hover { opacity: 0.88; }

.btn-accent-cta {
  background: var(--orange);
  color: var(--dark);
  font-weight: 700;
  border-radius: var(--radius);
  font-size: 16px;
  padding: 16px 32px;
  cursor: pointer;
  border: none;
  transition: opacity 0.18s, transform 0.12s;
}
.btn-accent-cta:hover { opacity: 0.88; }

.btn-final-cta {
  background: var(--white);
  color: var(--red);
  font-weight: 700;
  border-radius: var(--radius);
  font-size: 16px;
  padding: 16px 32px;
  cursor: pointer;
  border: none;
  transition: opacity 0.18s, transform 0.12s;
}
.btn-final-cta:hover { opacity: 0.88; }

.btn-lg { font-size: 17px; padding: 18px 40px; }

/* Messenger dropdown */
.msg-drop {
  display: none;
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--white);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  overflow: hidden;
  min-width: 220px;
  z-index: 200;
}

.msg-drop.open { display: block; }

.msg-drop__item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 20px;
  font-weight: 600;
  font-size: 15px;
  color: var(--dark);
  text-decoration: none;
  transition: background 0.15s;
  border-bottom: 1px solid #f0f0f0;
}
.msg-drop__item:last-child { border-bottom: none; }
.msg-drop__item:hover { background: #f5f5f5; }

.msg-drop__icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  flex-shrink: 0;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* Telegram: синий круг с самолётом */
.msg-tg-icon {
  background-color: #29A8EB;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0zm5.894 8.221l-1.97 9.28c-.145.658-.537.818-1.084.508l-3-2.21-1.447 1.394c-.16.16-.295.295-.605.295l.213-3.053 5.56-5.023c.242-.213-.054-.333-.373-.12l-6.871 4.326-2.962-.924c-.643-.204-.657-.643.136-.953l11.57-4.461c.537-.194 1.006.131.833.941z'/%3E%3C/svg%3E");
}

/* MAX: фиолетовый круг с буквой */
.msg-max-icon {
  background-color: #0077FF;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6l-2 2-1.41-1.41L12 7.17l4.41 4.42L15 13l-2-2v6z'/%3E%3C/svg%3E");
}

/* ═══ ACTIVITY BLOCKS ═══ */
.block { padding: 0; }

.block-photo {
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
}

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

.block-content {
  padding: 32px 20px 40px;
  text-align: center;
}

.block-content h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 12px;
  line-height: 1.3;
}

.block-content p {
  font-size: 15px;
  color: var(--text);
  margin-bottom: 24px;
  line-height: 1.6;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.block-light { background: var(--white); }
.block-dark-text { background: var(--light); }

/* ═══ ПАРАМЕТРЫ СМЕНЫ ═══ */
.block-accent {
  background: var(--dark);
  color: var(--white);
}

.block-accent .block-content {
  text-align: left;
}

.block-accent .block-content h2 {
  color: var(--white);
  text-align: left;
}

.block-accent .block-content p {
  color: rgba(255,255,255,0.8);
  text-align: left;
  margin-left: 0;
}

.shifts-table {
  margin: 20px 0;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  overflow: hidden;
}

.shift-row {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 0 12px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.06);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.shift-row:last-child { border-bottom: none; }
.shift-row:nth-child(odd) { background: rgba(255,255,255,0.1); }

.shift-num {
  font-size: 13px;
  color: var(--orange);
  font-weight: 700;
  white-space: nowrap;
  grid-row: 1;
  grid-column: 1;
}

.shift-dates {
  font-size: 15px;
  font-weight: 700;
  color: var(--white);
  grid-row: 1;
  grid-column: 2;
}

.shift-theme {
  font-size: 13px;
  color: rgba(255,255,255,0.65);
  grid-row: 2;
  grid-column: 2;
  margin-top: 2px;
}

.params-list {
  margin: 20px 0 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.param-item {
  font-size: 14px;
  color: rgba(255,255,255,0.8);
}

.param-item strong { color: var(--white); }

/* Dropdown в тёмном блоке открывается вверх — уже работает */

/* ═══ ФИНАЛЬНЫЙ CTA ═══ */
.block-final {
  background: linear-gradient(135deg, var(--orange) 0%, var(--red) 100%);
  padding: 56px 0;
}

.block-final-content {
  text-align: center;
  padding: 0 20px;
}

.block-final-content h2 {
  color: var(--white);
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 8px;
}

.block-final-content p {
  color: rgba(255,255,255,0.9);
  font-size: 16px;
  margin-bottom: 28px;
}

/* ═══ FOOTER ═══ */
.site-footer {
  background: #111;
  color: rgba(255,255,255,0.5);
  text-align: center;
  padding: 24px 20px;
  font-size: 13px;
  line-height: 1.8;
}

.site-footer a {
  color: var(--orange);
  text-decoration: none;
}

/* ═══ TABLET 600px ═══ */
@media (min-width: 600px) {
  .hero-title { font-size: 36px; }
  .hero-sub   { font-size: 17px; }
  .block-photo { aspect-ratio: 16/7; }
  .block-content h2 { font-size: 26px; }
}

/* ═══ DESKTOP 960px — полноценный двухколоночный вид ═══ */
@media (min-width: 960px) {
  .hero-title { font-size: 52px; }
  .hero-sub   { font-size: 20px; }

  /* Каждый блок-активность: сетка фото+текст на всю ширину */
  .block:not(.block-accent):not(.block-final) {
    display: grid;
    grid-template-columns: 58% 42%;
    min-height: 460px;
  }

  /* Фото заполняет ячейку без фиксированного aspect-ratio */
  .block:not(.block-accent):not(.block-final) .block-photo {
    aspect-ratio: unset;
    height: 100%;
    min-height: 460px;
  }

  /* Текстовая колонка: вертикальный центр, широкие отступы */
  .block:not(.block-accent):not(.block-final) .container.block-content {
    max-width: none;
    margin: 0;
    padding: 60px 72px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: left;
  }

  .block:not(.block-accent):not(.block-final) .block-content h2 {
    font-size: 34px;
    margin-bottom: 16px;
  }

  .block:not(.block-accent):not(.block-final) .block-content p {
    font-size: 17px;
    line-height: 1.7;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 28px;
  }

  /* Кнопка выравнена влево в десктопном блоке */
  .block:not(.block-accent):not(.block-final) .block-content .cta-wrap {
    align-self: flex-start;
  }

  /* Чередование: чётные блоки — фото справа */
  .block-flip .block-photo { order: 2; }
  .block-flip .container.block-content { order: 1; }

  /* Тёмный блок со сменами */
  .block-accent .block-content {
    max-width: 860px;
    margin: 0 auto;
    padding: 56px 40px;
  }

  /* Финальный CTA */
  .block-final-content h2 { font-size: 34px; }
  .block-final-content p  { font-size: 17px; }
}
