/* ============================================================
   Правила сайта — /rules_site.

   Оформление общее с главной и поддержкой: карточка на --card-color,
   рамка в 7% белого, радиус 20px, заголовок Oswald в верхнем регистре
   (шрифт подключает modes-grid.css, он есть на всех страницах),
   приглушённый текст #8f8f9c, акцент var(--accent).

   Приставка rsite-. Прежние .rs-* жили в templates/meat74ru/css/
   rules-site.css и принадлежали старой странице; раздел «Правила серверов»
   занимает свои .rs-*, поэтому имена здесь другие.

   Пункты идут плотным списком с разделителями, а не плашками-аккордеоном:
   на прежней странице текст был спрятан за кликом, и 16 пустых строк
   занимали экран, не говоря ничего.
   ============================================================ */

/* ---------- страница ---------- */
.rsite-page {
    color: #fff;
    font-size: 14px;
}

.rsite-page [hidden] { display: none !important; }

.rsite-page .ic {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Сброс маркеров: ol/li темы и bootstrap ставят свои отступы и нумерацию */
.rsite-page ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

.rsite-page li {
    margin: 0;
    list-style: none;
}

/* ---------- шапка ---------- */
.rsite-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px 24px;
    margin-bottom: 20px;
}

.rsite-hero__main { min-width: 0; }

.rsite-hero__title {
    margin: 0 0 6px;
    font-family: Oswald, sans-serif;
    font-size: 28px;
    font-weight: 600;
    letter-spacing: .02em;
    text-transform: uppercase;
    color: #fff;
}

.rsite-hero__desc {
    max-width: 560px;
    line-height: 1.5;
    color: #8f8f9c;
}

.rsite-search {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 300px;
    max-width: 100%;
    height: 42px;
    margin: 0;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 12px;
    background: rgba(255, 255, 255, .03);
    color: #8f8f9c;
    transition: border-color 140ms ease;
}

.rsite-search:focus-within { border-color: rgba(95, 101, 220, .55); }

.rsite-search input {
    flex: 1;
    min-width: 0;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    outline: none;
}

.rsite-search input::placeholder { color: #6a6a76; }

/* ---------- раздел ---------- */
.rsite-card {
    margin-bottom: 20px;
    padding: 22px;
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 20px;
    background: var(--card-color);
}

.rsite-card__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
    margin-bottom: 6px;
}

.rsite-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--accent, #5f65dc);
    color: #fff;
    box-shadow: 0 2px 10px rgba(95, 101, 220, .35);
}

.rsite-card__title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.rsite-card__count {
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .05);
    color: #8f8f9c;
    font-size: 12px;
    white-space: nowrap;
}

/* ---------- пункт ---------- */
.rsite-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 0;
    border-top: 1px solid rgba(255, 255, 255, .06);
}

.rsite-list { margin-top: 10px; }
.rsite-list .rsite-item:first-child { border-top: 0; }

.rsite-item__num {
    flex: 0 0 auto;
    min-width: 48px;
    padding: 4px 10px;
    border-radius: 8px;
    background: rgba(95, 101, 220, .14);
    color: #a9acff;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}

.rsite-item__body {
    flex: 1;
    min-width: 0;
}

.rsite-item__text {
    line-height: 1.55;
    color: #ececf3;
    overflow-wrap: anywhere;
}

.rsite-item__pen {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 8px;
    line-height: 1.45;
    color: #e8b46a;
    font-size: 13px;
}

.rsite-item__pen .ic {
    width: 15px;
    height: 15px;
    margin-top: 2px;
}

/* найденное при поиске / скрытое им */
.rsite-item.is-hit .rsite-item__num { background: var(--accent, #5f65dc); color: #fff; }

/* ---------- кнопки правки (только админам) ---------- */
.rsite-tools {
    display: inline-flex;
    flex: 0 0 auto;
    gap: 4px;
    margin-left: auto;
}

.rsite-tool {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 9px;
    background: rgba(255, 255, 255, .03);
    color: #8f8f9c;
    cursor: pointer;
    transition: color 140ms ease, border-color 140ms ease, background 140ms ease;
}

.rsite-tool .ic { width: 15px; height: 15px; }

.rsite-tool:hover:not(:disabled) {
    border-color: rgba(255, 255, 255, .18);
    background: rgba(255, 255, 255, .07);
    color: #fff;
}

.rsite-tool--danger:hover:not(:disabled) {
    border-color: rgba(235, 87, 87, .5);
    background: rgba(235, 87, 87, .12);
    color: #ff7b7b;
}

.rsite-tool:disabled { opacity: .3; cursor: default; }

.rsite-add {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    padding: 9px 14px;
    border: 1px dashed rgba(255, 255, 255, .14);
    border-radius: 12px;
    background: transparent;
    color: #8f8f9c;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: color 140ms ease, border-color 140ms ease;
}

.rsite-add .ic { width: 15px; height: 15px; }
.rsite-add:hover { border-color: rgba(95, 101, 220, .6); color: #fff; }

.rsite-add--section {
    width: 100%;
    justify-content: center;
    margin: 0 0 20px;
    padding: 14px;
    border-radius: 16px;
}

.rsite-empty,
.rsite-nothing {
    margin-bottom: 20px;
    padding: 28px;
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 20px;
    background: var(--card-color);
    color: #8f8f9c;
    text-align: center;
}

/* ---------- документы ---------- */
.rsite-docs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.rsite-doc {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    padding: 16px 18px;
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 20px;
    background: var(--card-color);
    color: #fff;
    text-decoration: none;
    transition: border-color 140ms ease, background 140ms ease;
}

.rsite-doc:hover {
    border-color: rgba(95, 101, 220, .5);
    color: #fff;
    text-decoration: none;
}

.rsite-doc__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(95, 101, 220, .14);
    color: #a9acff;
}

.rsite-doc__text {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.rsite-doc__title { font-size: 14px; font-weight: 600; }

.rsite-doc__url {
    color: #8f8f9c;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rsite-doc__go { color: #6a6a76; }

.rsite-foot {
    margin-bottom: 20px;
    padding: 16px 20px;
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 20px;
    color: #8f8f9c;
    text-align: center;
    line-height: 1.5;
}

/* Ссылка среди текста должна отличаться не только цветом: по контрасту с
   окружающим текстом (1.52:1 при нужных 3:1) аудит Lighthouse её не пускает */
.rsite-foot a {
    color: #a9acff;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ---------- окна и поля ---------- */
.rsite-modal {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(8, 8, 12, .72);
}

.rsite-modal__box {
    width: 100%;
    max-width: 480px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 22px;
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 20px;
    background: var(--card-color);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
    animation: rsite-pop 140ms ease-out;
}

.rsite-modal__box--wide { max-width: 640px; }

@keyframes rsite-pop {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

.rsite-modal__head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.rsite-modal__title {
    margin: 0;
    font-family: Oswald, sans-serif;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: .02em;
    text-transform: uppercase;
    color: #fff;
}

.rsite-modal__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin-left: auto;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 10px;
    background: rgba(255, 255, 255, .03);
    color: #8f8f9c;
    cursor: pointer;
    transition: color 140ms ease, border-color 140ms ease;
}

.rsite-modal__close:hover { border-color: rgba(255, 255, 255, .18); color: #fff; }

.rsite-modal__foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.rsite-field { display: block; margin-bottom: 16px; }

.rsite-label {
    display: block;
    margin-bottom: 6px;
    color: #c9c9d4;
    font-size: 13px;
    font-weight: 600;
}

.rsite-label span {
    margin-left: 6px;
    color: #6a6a76;
    font-weight: 400;
}

.rsite-input {
    width: 100%;
    height: 42px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 12px;
    background: rgba(255, 255, 255, .03);
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color 140ms ease;
}

.rsite-input:focus { border-color: rgba(95, 101, 220, .55); }
.rsite-input::placeholder { color: #6a6a76; }

.rsite-textarea {
    height: auto;
    min-height: 84px;
    padding: 12px 14px;
    line-height: 1.5;
    resize: vertical;
}

.rsite-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 18px;
    border: 0;
    border-radius: 14px;
    background: var(--accent, #5f65dc);
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: filter 140ms ease, background 140ms ease;
}

.rsite-btn:hover { filter: brightness(1.12); color: #fff; }
.rsite-btn:disabled { opacity: .6; cursor: default; }

.rsite-btn--ghost {
    border: 1px solid rgba(255, 255, 255, .1);
    background: rgba(255, 255, 255, .05);
}

.rsite-btn--ghost:hover { background: rgba(255, 255, 255, .09); }

/* выбор значка раздела */
.rsite-icons {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}

.rsite-icons__opt { position: relative; margin: 0; cursor: pointer; }

.rsite-icons__opt input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.rsite-icons__opt span {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 10px;
    background: rgba(255, 255, 255, .03);
    color: #8f8f9c;
    transition: color 140ms ease, border-color 140ms ease, background 140ms ease;
}

.rsite-icons__opt:hover span { color: #fff; }

.rsite-icons__opt input:checked + span {
    border-color: var(--accent, #5f65dc);
    background: var(--accent, #5f65dc);
    color: #fff;
}

.rsite-icons__opt input:focus-visible + span { outline: 2px solid rgba(95, 101, 220, .7); outline-offset: 2px; }

/* ---------- узкие экраны ---------- */
@media (max-width: 900px) {
    .rsite-docs { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    /* В мобильной теме у колонки нет бокового отступа (в meat74ru он есть
       от bootstrap), и без своего карточки липнут к краям экрана. Страницы
       мобильной темы задают его сами — .faq-wrapper, например, 20px */
    .rsite-page { padding: 0 12px; }

    .rsite-hero__title { font-size: 24px; }
    .rsite-search { width: 100%; }
    .rsite-card { padding: 16px; border-radius: 16px; }

    /* номер над текстом, а не сбоку: на 360px сбоку остаётся полтора слова */
    .rsite-item { flex-wrap: wrap; gap: 8px 12px; }
    .rsite-item__body { flex-basis: 100%; order: 3; }
    .rsite-item .rsite-tools { order: 2; }
}
