/* ==========================================================================
   СДПК — основные стили. Цвета вынесены в переменные (можно менять тут).
   ========================================================================== */
:root {
  --red:        #a01c1c;
  --red-dark:   #7c1414;
  --red-bright: #c62828;
  --gold:       #d8a531;
  --gold-dark:  #b6871f;
  --bg:         #f0efed;
  --card:       #f7f6f4;
  --card-border:#e4e0da;
  --text:       #2b2b2b;
  --muted:      #6d6d6d;
  --white:      #ffffff;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'PT Sans', 'Segoe UI', Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
}

img { max-width: 100%; display: block; }
a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4, .display {
  font-family: 'Oswald', 'PT Sans Narrow', Impact, sans-serif;
  font-weight: 700;
  letter-spacing: .3px;
  margin: 0 0 .4em;
}

.container { max-width: 1360px; margin: 0 auto; padding: 0 28px; }

/* ---------- ВЕРХНЯЯ ШАПКА (белая) --------------------------------------- */
.topbar { background: var(--white); }
.topbar__inner {
  display: flex; align-items: center; gap: 28px;
  padding: 18px 0;
}
.brand { display: flex; align-items: center; gap: 18px; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand__logo { width: 92px; height: 92px; flex: 0 0 auto; }
.brand__text .brand__line1 {
  font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 20px;
  color: var(--red-dark); letter-spacing: .5px; line-height: 1;
}
.brand__text .brand__line2 {
  font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 52px;
  color: var(--red); letter-spacing: 1px; line-height: .95; margin: 2px 0;
}
.brand__slogan {
  font-family: 'Oswald', sans-serif; font-weight: 500; font-size: 13px;
  color: var(--red); letter-spacing: .5px; margin-top: 4px;
}

.topbar__contacts { font-size: 15px; color: #333; line-height: 1.6; }
.topbar__contacts .row { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 6px; }
.topbar__contacts .ic {
  width: 30px; height: 30px; border-radius: 50%; flex: 0 0 auto;
  background: var(--red); color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 15px;
}
.topbar__contacts a { color: #333; }

.topbar__right { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 16px; }
.socials { display: flex; gap: 12px; }
.socials a {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--red); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; transition: background .15s;
}
.socials a:hover { background: var(--red-dark); text-decoration: none; }
.btn-join {
  background: var(--red); color: #fff; font-family: 'Oswald', sans-serif;
  font-weight: 600; letter-spacing: .5px; font-size: 17px;
  padding: 13px 30px; border-radius: 4px; display: inline-block;
  transition: background .15s;
}
.btn-join:hover { background: var(--red-dark); color: #fff; text-decoration: none; }

/* ---------- НАВИГАЦИЯ (тёмно-красная) ----------------------------------- */
.nav { background: var(--red); }
.nav__inner { display: flex; }
.nav a {
  color: #fff; font-family: 'Oswald', sans-serif; font-weight: 500;
  font-size: 17px; letter-spacing: .6px; text-transform: uppercase;
  padding: 18px 26px; display: inline-flex; align-items: center; gap: 6px;
  position: relative; transition: background .15s;
}
.nav a:hover { background: var(--red-dark); text-decoration: none; }
.nav a.active { color: #fff; }
.nav a.active::after {
  content: ''; position: absolute; left: 26px; right: 26px; bottom: 10px;
  height: 3px; background: var(--gold);
}
.nav__item { position: relative; }
.nav__item:hover .nav__drop { display: block; }
.nav__drop {
  display: none; position: absolute; top: 100%; left: 0; min-width: 220px;
  background: var(--white); box-shadow: 0 8px 24px rgba(0,0,0,.18); z-index: 50;
  border-top: 3px solid var(--gold);
}
.nav__drop a {
  color: var(--text); text-transform: none; font-family: 'PT Sans', sans-serif;
  font-weight: 400; font-size: 15px; padding: 12px 18px; display: block;
}
.nav__drop a:hover { background: #f2eeea; }

/* ---------- ГЕРОЙ-БАННЕР ------------------------------------------------- */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(100deg, var(--red-dark) 0%, var(--red) 42%, var(--red-bright) 55%, #8b1616 100%);
  min-height: 330px; display: flex; align-items: center;
}
.hero__photo {
  position: absolute; top: 0; right: 0; height: 100%; width: 55%;
  background-size: cover; background-position: center;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 22%);
          mask-image: linear-gradient(90deg, transparent 0%, #000 22%);
}
.hero__inner { position: relative; z-index: 2; padding: 46px 0; max-width: 640px; }
.hero h1 {
  color: #fff; font-size: 52px; line-height: 1.02; text-transform: uppercase;
  text-shadow: 0 2px 12px rgba(0,0,0,.35);
}
.hero__divider { display: flex; align-items: center; gap: 14px; margin: 18px 0; color: var(--gold); max-width: 340px; }
.hero__divider .line { height: 2px; background: rgba(255,255,255,.55); flex: 1; }
.hero__sub {
  color: #fff; font-family: 'Oswald', sans-serif; font-weight: 500;
  letter-spacing: 1px; text-transform: uppercase; font-size: 18px;
}

/* ---------- ОСНОВНОЙ БЛОК: 3 колонки ------------------------------------ */
.home-grid {
  display: grid; grid-template-columns: 1.35fr 1fr 1fr; gap: 26px;
  padding: 40px 0 56px;
}
.panel {
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: 6px; padding: 26px;
}
.panel__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.panel__head h2 { color: var(--red); font-size: 26px; margin: 0; }
.link-all { font-family: 'Oswald', sans-serif; font-size: 13px; letter-spacing: .5px; color: var(--red); text-transform: uppercase; }

/* Новости на главной */
.news-feature { display: grid; grid-template-columns: 200px 1fr; gap: 18px; margin-bottom: 22px; }
.news-feature img { width: 200px; height: 130px; object-fit: cover; border-radius: 4px; }
.news-feature h3 { color: var(--red-dark); font-size: 19px; margin: 0 0 6px; text-transform: uppercase; }
.news-date { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.news-mini { display: grid; grid-template-columns: 70px 1fr; gap: 14px; padding: 12px 0; border-top: 1px solid var(--card-border); }
.news-mini img { width: 70px; height: 52px; object-fit: cover; border-radius: 3px; }
.news-mini h4 { font-size: 15px; margin: 0 0 3px; color: var(--red-dark); font-family: 'PT Sans', sans-serif; font-weight: 700; text-transform: none; }
.news-empty { color: var(--muted); font-style: italic; }

/* О партии */
.about { text-align: center; }
.about h2 { color: var(--red); font-size: 26px; }
.about__emblem { width: 130px; margin: 8px auto 18px; }
.about p { text-align: left; font-size: 15px; color: #3a3a3a; }
.btn-outline {
  display: inline-block; margin-top: 16px; border: 2px solid var(--red);
  color: var(--red); font-family: 'Oswald', sans-serif; font-weight: 600;
  padding: 11px 26px; border-radius: 4px; text-transform: uppercase; font-size: 15px;
  transition: all .15s;
}
.btn-outline:hover { background: var(--red); color: #fff; text-decoration: none; }

/* Правая колонка — карточки */
.cards { display: flex; flex-direction: column; gap: 18px; }
.info-card {
  background: var(--card); border: 1px solid var(--card-border); border-radius: 6px;
  padding: 22px 24px; display: flex; align-items: center; gap: 18px;
  transition: box-shadow .15s, transform .15s;
}
.info-card:hover { box-shadow: 0 8px 22px rgba(0,0,0,.08); transform: translateY(-2px); text-decoration: none; }
.info-card__icon { color: var(--red); font-size: 34px; flex: 0 0 54px; text-align: center; }
.info-card h3 { color: var(--red-dark); font-size: 20px; margin: 0 0 4px; text-transform: uppercase; }
.info-card p { margin: 0; color: var(--muted); font-size: 14px; }
.info-card__arrow { margin-left: auto; color: var(--red); font-size: 22px; }

/* ---------- ОБЩИЕ СТРАНИЦЫ ---------------------------------------------- */
.page { padding: 40px 0 60px; }
.page h1 { color: var(--red); font-size: 38px; text-transform: uppercase; margin-bottom: 8px; }
.page .lead { color: var(--muted); margin-bottom: 26px; }
.content-box {
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: 6px; padding: 30px; white-space: pre-wrap; font-size: 16px;
}
.breadcrumb { color: var(--muted); font-size: 14px; margin-bottom: 14px; }
.breadcrumb a { color: var(--muted); }

/* Список новостей */
.news-list { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.news-card {
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: 6px; overflow: hidden; display: flex; flex-direction: column;
}
.news-card img { width: 100%; height: 190px; object-fit: cover; }
.news-card__body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.news-card h3 { color: var(--red-dark); text-transform: uppercase; font-size: 20px; }
.news-card .meta { color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.news-card .excerpt { color: #444; font-size: 15px; flex: 1; }
.news-card .more { margin-top: 12px; align-self: flex-start; }

.article img.cover { width: 100%; max-height: 420px; object-fit: cover; border-radius: 6px; margin-bottom: 20px; }
.article .meta { color: var(--muted); margin-bottom: 18px; }
.article .body { white-space: pre-wrap; font-size: 17px; line-height: 1.7; }

/* Сетка «плиток» документов / людей */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.tile {
  background: var(--card); border: 1px solid var(--card-border); border-radius: 6px;
  padding: 26px; transition: box-shadow .15s, transform .15s; display: block;
}
.tile:hover { box-shadow: 0 8px 22px rgba(0,0,0,.08); transform: translateY(-2px); text-decoration: none; }
.tile__icon { font-size: 34px; color: var(--red); margin-bottom: 12px; }
.tile h3 { color: var(--red-dark); text-transform: uppercase; font-size: 20px; }
.tile p { color: var(--muted); font-size: 14px; margin: 0; }

.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.gallery a img { width: 100%; height: 190px; object-fit: cover; border-radius: 6px; border: 1px solid var(--card-border); }

.people-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.person { background: var(--card); border: 1px solid var(--card-border); border-radius: 6px; overflow: hidden; text-align: center; }
.person img { width: 100%; height: 260px; object-fit: cover; }
.person__body { padding: 20px; }
.person h3 { color: var(--red-dark); font-size: 20px; margin: 0 0 4px; }
.person .pos { color: var(--red); font-family: 'Oswald', sans-serif; font-size: 14px; text-transform: uppercase; margin-bottom: 8px; }
.person .bio { color: #555; font-size: 14px; }

.file-list { list-style: none; padding: 0; margin: 0; }
.file-list li {
  background: var(--card); border: 1px solid var(--card-border); border-radius: 6px;
  padding: 16px 20px; margin-bottom: 12px; display: flex; align-items: center; gap: 14px;
}
.file-list .fic { color: var(--red); font-size: 22px; }
.file-list .fname { font-weight: 700; }
.file-list .fmeta { color: var(--muted); font-size: 13px; }
.file-list .dl { margin-left: auto; }

/* Парткасса — лента сообщений */
.kassa-entry { background: var(--card); border: 1px solid var(--card-border); border-radius: 6px; padding: 18px 22px; margin-bottom: 16px; }
.kassa-entry .who { font-weight: 700; color: var(--red-dark); }
.kassa-entry .when { color: var(--muted); font-size: 13px; }
.kassa-entry .msg { margin: 8px 0; white-space: pre-wrap; }
.kassa-entry img { max-width: 320px; border-radius: 6px; border: 1px solid var(--card-border); margin-top: 8px; }

/* ---------- ФОРМЫ -------------------------------------------------------- */
.form-box { background: var(--card); border: 1px solid var(--card-border); border-radius: 6px; padding: 26px; max-width: 640px; }
label { display: block; font-weight: 700; margin: 14px 0 6px; font-size: 14px; }
input[type=text], input[type=password], input[type=date], input[type=number], input[type=email], textarea, select {
  width: 100%; padding: 11px 13px; border: 1px solid #cfc9c1; border-radius: 5px;
  font-size: 15px; font-family: inherit; background: #fff;
}
textarea { min-height: 140px; resize: vertical; }
.btn {
  display: inline-block; background: var(--red); color: #fff; border: none;
  font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 15px; letter-spacing: .4px;
  padding: 12px 26px; border-radius: 5px; cursor: pointer; text-transform: uppercase; transition: background .15s;
}
.btn:hover { background: var(--red-dark); text-decoration: none; color:#fff; }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-gray { background: #6b6b6b; } .btn-gray:hover { background: #555; }
.btn-danger { background: #8a2020; } .btn-danger:hover { background: #6d1717; }

.flash { padding: 13px 18px; border-radius: 6px; margin-bottom: 20px; font-size: 15px; }
.flash.success { background: #e4f3e4; color: #1e5620; border: 1px solid #bfe0bf; }
.flash.error   { background: #f8e3e3; color: #7a1c1c; border: 1px solid #e6bcbc; }
.flash.info    { background: #e6eef6; color: #234a6b; border: 1px solid #c3d6e8; }
.form-error { color: #a01c1c; font-weight: 700; margin-bottom: 14px; }

/* ---------- АДМИНКА ------------------------------------------------------ */
.admin-wrap { display: grid; grid-template-columns: 230px 1fr; gap: 28px; padding: 30px 0 60px; }
.admin-side { background: var(--red); border-radius: 6px; padding: 10px; align-self: start; }
.admin-side a { display: block; color: #fff; padding: 12px 16px; border-radius: 4px; font-family: 'Oswald', sans-serif; letter-spacing: .4px; }
.admin-side a:hover, .admin-side a.active { background: var(--red-dark); text-decoration: none; }
.admin-main h1 { color: var(--red); font-size: 30px; text-transform: uppercase; }
.admin-cards { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; margin-bottom: 26px; }
.stat { background: var(--card); border: 1px solid var(--card-border); border-radius: 6px; padding: 22px; text-align: center; }
.stat .num { font-family: 'Oswald', sans-serif; font-size: 40px; color: var(--red); font-weight: 700; }
.stat .lbl { color: var(--muted); text-transform: uppercase; font-size: 13px; }

table.tbl { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--card-border); border-radius: 6px; overflow: hidden; }
table.tbl th, table.tbl td { padding: 12px 14px; text-align: left; border-bottom: 1px solid #eee; font-size: 14px; vertical-align: middle; }
table.tbl th { background: #f2eeea; font-family: 'Oswald', sans-serif; text-transform: uppercase; font-size: 13px; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.badge.admin { background: #a01c1c; color: #fff; } .badge.member { background: #ddd; color: #444; }
.inline-form { display: inline; }
details.card { background: var(--card); border: 1px solid var(--card-border); border-radius: 6px; padding: 16px 20px; margin-bottom: 18px; }
details.card summary { font-family: 'Oswald', sans-serif; font-size: 18px; color: var(--red); cursor: pointer; }

/* ---------- ПОДВАЛ ------------------------------------------------------- */
.footer { background: var(--red); color: #fff; margin-top: 20px; }
.footer__inner { display: flex; align-items: center; gap: 20px; padding: 22px 0; flex-wrap: wrap; }
.footer__star { color: var(--gold); font-size: 22px; }
.footer__copy { font-size: 14px; }
.footer__links { margin-left: auto; display: flex; gap: 34px; }
.footer__links a { color: #fff; font-family: 'Oswald', sans-serif; font-size: 14px; letter-spacing: .4px; text-transform: uppercase; }
.footer__links a:hover { color: var(--gold); text-decoration: none; }

/* ---------- Партбилет (шаблон) ------------------------------------------ */
.partbilet {
  width: 540px; margin: 20px auto; border: 3px solid var(--red); border-radius: 8px;
  background: linear-gradient(160deg,#fff, #fbf3f3); padding: 26px 30px; position: relative;
}
.partbilet h2 { color: var(--red); text-align: center; text-transform: uppercase; }
.partbilet .row { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px dashed #d9b9b9; }
.partbilet .row b { color: var(--red-dark); }
@media print { .noprint { display: none !important; } body { background: #fff; } }

/* ---------- Адаптив ------------------------------------------------------ */
@media (max-width: 1080px) {
  .home-grid { grid-template-columns: 1fr 1fr; }
  .cards { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
  .info-card { flex: 1 1 300px; }
  .tiles, .people-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px) {
  .topbar__inner { flex-wrap: wrap; }
  .topbar__right { margin-left: 0; align-items: flex-start; width: 100%; }
  .nav__inner { flex-wrap: wrap; }
  .nav a { padding: 14px 16px; font-size: 15px; }
  .home-grid { grid-template-columns: 1fr; }
  .news-list, .tiles, .people-grid { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .hero__photo { display: none; }
  .hero h1 { font-size: 34px; }
  .brand__text .brand__line2 { font-size: 38px; }
  .admin-wrap { grid-template-columns: 1fr; }
  .footer__inner { flex-direction: column; align-items: flex-start; }
  .footer__links { margin-left: 0; flex-wrap: wrap; gap: 16px; }
}
