/* ============ SAVE WRESTLING — design system ============ */
:root {
  --ink: #0f1c2e;          /* dark navy (header/footer) */
  --ink-2: #16283f;
  --paper: #f6f4ef;        /* warm page background */
  --card: #ffffff;
  --text: #212a3a;
  --muted: #687183;
  --line: #e4e0d6;
  --accent: #b9862c;       /* gold */
  --accent-dark: #976c1e;
  --danger: #a83232;
  --ok: #2f8f4e;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 28, 46, .06), 0 10px 30px -18px rgba(16, 28, 46, .25);
  --font-serif: "PT Serif", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-serif); color: var(--ink); line-height: 1.25; margin: 0 0 .5em; }
a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
.site-header {
  background: var(--ink);
  color: #fff;
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 2px 14px rgba(0,0,0,.25);
}
.site-header .container {
  display: flex; align-items: center; gap: 28px;
  min-height: 64px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px;
}
.brand { display: flex; flex-direction: column; line-height: 1.1; text-decoration: none !important; }
.brand-title { font-family: var(--font-serif); font-weight: 700; font-size: 22px; letter-spacing: .06em; color: #fff; }
.brand-title .gold { color: var(--accent); }
.brand-sub { font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: #93a0b4; }
.main-nav { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; align-items: center; }
.main-nav a {
  color: #cdd6e2; padding: 8px 13px; border-radius: 8px;
  font-size: 14.5px; font-weight: 500; text-decoration: none !important;
}
.main-nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.main-nav a.active { color: var(--accent); }
.main-nav a.nav-cta {
  background: var(--accent); color: var(--ink); font-weight: 600;
}
.main-nav a.nav-cta:hover { background: #cf9a37; }
.search-form { display: flex; }
.search-form input {
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18);
  color: #fff; border-radius: 8px; padding: 7px 12px; font-size: 14px; width: 170px;
  font-family: var(--font-sans);
}
.search-form input::placeholder { color: #8d99ac; }
.search-form input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(1000px 420px at 78% -10%, rgba(185,134,44,.28), transparent 60%),
    linear-gradient(160deg, var(--ink) 0%, var(--ink-2) 100%);
  color: #e8ecf2; padding: 72px 0 78px;
}
.hero h1 { color: #fff; font-size: clamp(30px, 4.6vw, 50px); max-width: 780px; margin-bottom: 18px; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p.lead { font-size: 18.5px; max-width: 640px; color: #b9c4d4; margin: 0 0 30px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; background: var(--accent); color: var(--ink);
  border: none; border-radius: 10px; padding: 11px 22px;
  font-weight: 600; font-size: 15px; font-family: var(--font-sans);
  cursor: pointer; text-decoration: none !important; transition: background .15s, transform .1s;
}
.btn:hover { background: #cf9a37; }
.btn:active { transform: translateY(1px); }
.btn-outline { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,.4); }
.btn-outline:hover { background: rgba(255,255,255,.08); border-color: #fff; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--ink-2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #8f2626; }
.btn-sm { padding: 6px 13px; font-size: 13.5px; border-radius: 8px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- Sections ---------- */
.section { padding: 52px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.section-head h2 { font-size: 27px; margin: 0; position: relative; padding-left: 16px; }
.section-head h2::before {
  content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 4px;
  background: var(--accent); border-radius: 2px;
}
.section-head a.more { font-size: 14.5px; font-weight: 500; white-space: nowrap; }

/* ---------- Article cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 22px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 22px 20px; box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  transition: transform .16s, box-shadow .16s;
}
a.card { text-decoration: none !important; color: inherit; }
a.card:hover { transform: translateY(-3px); box-shadow: 0 4px 6px rgba(16,28,46,.07), 0 18px 40px -16px rgba(16,28,46,.3); }
.card .meta { display: flex; gap: 10px; align-items: center; font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
.tag {
  background: #f3ead6; color: var(--accent-dark); font-weight: 600;
  font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 20px;
}
.card h3 { font-size: 19.5px; margin: 0 0 8px; overflow-wrap: anywhere; }
.card p.summary { color: var(--muted); font-size: 14.5px; margin: 0; flex: 1; overflow-wrap: anywhere; }

/* ---------- Article ---------- */
.article-page { max-width: 760px; margin: 0 auto; }
.article-page .meta { color: var(--muted); font-size: 14px; margin-bottom: 6px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.article-page h1 { font-size: clamp(28px, 4vw, 40px); overflow-wrap: anywhere; }
.article-body { font-size: 17.5px; overflow-wrap: anywhere; }
.article-body p { margin: 0 0 1.2em; }

/* ---------- Documents ---------- */
.doc-list { display: flex; flex-direction: column; gap: 14px; }
.doc-row {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; display: flex; align-items: center; gap: 18px; box-shadow: var(--shadow);
}
.doc-badge {
  flex: 0 0 auto; width: 52px; height: 58px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 12.5px; letter-spacing: .04em;
  background: var(--muted);
  position: relative;
}
.doc-badge.pdf { background: #b3372f; }
.doc-badge.docx { background: #2f5bb3; }
.doc-badge.xlsx { background: #2f8f4e; }
.doc-info { flex: 1; min-width: 0; }
/* Имена файлов и хеши — длинные строки без пробелов. Без переноса они
   вылезают за край и заставляют страницу скроллиться вбок на телефоне. */
.doc-info h3 { font-size: 17.5px; margin: 0 0 3px; overflow-wrap: anywhere; }
.doc-info .sub { color: var(--muted); font-size: 13.5px; overflow-wrap: anywhere; }

/* ---------- Forms ---------- */
.form-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px; box-shadow: var(--shadow);
}
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; color: var(--ink); }
.field .hint { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.field input[type=text], .field input[type=email], .field input[type=password],
.field textarea, .field select {
  width: 100%; border: 1.5px solid var(--line); border-radius: 10px;
  background: #fdfcfa; padding: 11px 13px; font-size: 15px; font-family: var(--font-sans);
  color: var(--text);
}
.field textarea { min-height: 150px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(185,134,44,.18);
}

/* confidentiality mode cards */
.mode-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.mode-card { position: relative; }
.mode-card input { position: absolute; opacity: 0; }
.mode-card label {
  display: block; height: 100%; border: 1.5px solid var(--line); border-radius: 12px;
  background: #fdfcfa; padding: 14px 16px; cursor: pointer; transition: border-color .12s, background .12s;
}
.mode-card label b { display: block; font-size: 14.5px; color: var(--ink); margin-bottom: 4px; }
.mode-card label span { font-size: 12.8px; color: var(--muted); line-height: 1.45; display: block; }
.mode-card input:checked + label { border-color: var(--accent); background: #fbf5e8; box-shadow: 0 0 0 3px rgba(185,134,44,.15); }

/* ---------- Notices / statuses ---------- */
.notice { border-radius: 12px; padding: 14px 18px; font-size: 14.5px; margin: 14px 0; }
.notice.ok { background: #e8f4ec; color: #1e6238; border: 1px solid #bfe0cb; }
.notice.err { background: #f9e9e9; color: #7c2020; border: 1px solid #e7c4c4; }
.notice.info { background: #edf2fa; color: #2b4a7a; border: 1px solid #ccdbf0; }
.ref-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 22px; font-weight: 700; letter-spacing: .08em; color: var(--ink);
  background: #fbf5e8; border: 1.5px dashed var(--accent); border-radius: 10px;
  padding: 10px 18px; display: inline-block; margin: 6px 0;
}
.status-pill { display: inline-block; padding: 3px 11px; border-radius: 20px; font-size: 12.5px; font-weight: 600; }
.status-New       { background: #edf2fa; color: #2b4a7a; }
.status-InReview  { background: #fbf3e0; color: #8a6414; }
.status-Resolved  { background: #e8f4ec; color: #1e6238; }
.status-Closed    { background: #eceef1; color: #5a6270; }
.status-Draft     { background: #eceef1; color: #5a6270; }
.status-Published { background: #e8f4ec; color: #1e6238; }
.status-Clean     { background: #e8f4ec; color: #1e6238; }
.status-Pending   { background: #fbf3e0; color: #8a6414; }
.status-Infected  { background: #f9e9e9; color: #7c2020; }
.status-Approved  { background: #e8f4ec; color: #1e6238; }
.status-Rejected  { background: #f9e9e9; color: #7c2020; }

/* ---------- Pagination ---------- */
.pager { display: flex; gap: 8px; justify-content: center; margin-top: 30px; }
.pager button {
  border: 1.5px solid var(--line); background: var(--card); color: var(--text);
  border-radius: 9px; padding: 7px 14px; cursor: pointer; font-size: 14px; font-family: var(--font-sans);
}
.pager button:hover { border-color: var(--accent); }
.pager button.cur { background: var(--ink); border-color: var(--ink); color: #fff; }
.pager button[disabled] { opacity: .4; cursor: default; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #93a0b4; margin-top: 60px; padding: 40px 0 34px; font-size: 14px; }
.site-footer .container { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.site-footer a { color: #cdd6e2; }
.site-footer .fbrand { font-family: var(--font-serif); font-size: 18px; color: #fff; letter-spacing: .05em; }
.site-footer .fbrand .gold { color: var(--accent); }

/* ---------- Admin ---------- */
.admin-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 24px; }
.admin-tabs button {
  border: 1.5px solid var(--line); background: var(--card); color: var(--text);
  padding: 8px 18px; border-radius: 10px; font-size: 14.5px; font-weight: 500; cursor: pointer;
  font-family: var(--font-sans);
}
.admin-tabs button.cur { background: var(--ink); color: #fff; border-color: var(--ink); }
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
table.table th, table.table td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.table th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: #faf9f5; }
table.table tr:last-child td { border-bottom: none; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.muted { color: var(--muted); }
.mt0 { margin-top: 0; } .mt2 { margin-top: 20px; } .mb2 { margin-bottom: 20px; }

@media (max-width: 720px) {
  .site-header .container { gap: 12px; }
  .main-nav { margin-left: 0; }
  .hero { padding: 48px 0 54px; }
  .section { padding: 36px 0; }
  .doc-row { flex-wrap: wrap; }
}

/* Телефон: строка документа перестраивается — значок и название сверху,
   кнопка скачивания отдельной строкой во всю ширину. */
@media (max-width: 560px) {
  .doc-row { align-items: flex-start; gap: 14px; padding: 16px; }
  .doc-info { flex: 1 1 100%; order: 2; }
  .doc-badge { order: 1; }
  .doc-row .btn { order: 3; flex: 1 1 100%; text-align: center; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 8px; }
}
