/* ═══════════════════════════════════════════════════════════════
   Каталожные страницы: Отделения / Врачи / Блог (новости)
   Все классы с префиксом sma- — не пересекаются с остальной темой.
   Подключается из archive-department.php / archive-doctor.php /
   archive-blog.php через template_parts/ad-helpers.php.
═══════════════════════════════════════════════════════════════ */
.sma-page {
    --ad-ink: #153c53;
    --ad-navy: #003366;
    --ad-red: #cd163f;
    --ad-red-d: #a01232;
    --ad-muted: #526578;
    --ad-faint: #7b93a3;
    --ad-line: #e3ecf2;
    --ad-soft: #f4f7f9;
    --ad-tint: #e6f0fa;
    --ad-shadow: 0 18px 50px rgba(33, 76, 101, 0.11), 0 2px 7px rgba(33, 76, 101, 0.04);
    --ad-shadow-s: 0 6px 22px rgba(0, 51, 102, 0.08);
    font-family: 'Roboto', system-ui, sans-serif;
    color: var(--ad-ink);
    background: #fff;
}
.sma-page *,
.sma-page *::before,
.sma-page *::after { box-sizing: border-box; }
.sma-page a { text-decoration: none; }
.sma-page :focus-visible { outline: 3px solid #0086bf; outline-offset: 3px; }
.sma-page [hidden] { display: none !important; }

/* ── hero каталога ─────────────────────────────── */
.sma-hero {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    padding: 34px 0 38px;
    background: linear-gradient(180deg, #e8f2f8 0%, #f5f9fc 100%);
    border-bottom: 1px solid var(--ad-line);
}
.sma-hero::before {
    content: "";
    position: absolute;
    right: -60px;
    top: -70px;
    width: 420px;
    height: 420px;
    z-index: -1;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 134, 191, 0.16), transparent 68%);
}
.sma-hero::after {
    content: "";
    position: absolute;
    right: 6%;
    bottom: -34px;
    width: 230px;
    height: 230px;
    z-index: -1;
    opacity: 0.55;
    border-radius: 20px;
    background:
        linear-gradient(var(--ad-tint), var(--ad-tint)) center / 22% 100% no-repeat,
        linear-gradient(var(--ad-tint), var(--ad-tint)) center / 100% 22% no-repeat;
}
.sma-h1 {
    margin: 0 0 12px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: clamp(1.9rem, 3.4vw, 2.7rem);
    line-height: 1.12;
    color: var(--ad-ink);
}
.sma-sub {
    max-width: 700px;
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.6;
    color: #3d5668;
}
.sma-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.sma-stat {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 8px 16px 8px 10px;
    background: #fff;
    border: 1px solid var(--ad-line);
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(0, 51, 102, 0.06);
    font-size: 13px;
    font-weight: 700;
    color: var(--ad-ink);
}
.sma-stat i {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--ad-tint);
    color: var(--ad-navy);
    font-size: 12px;
}
.sma-stat b { font-family: 'Montserrat', sans-serif; font-weight: 800; }
.sma-section { padding: 34px 0 70px; background: #fff; }
.sma-empty {
    padding: 40px 24px;
    text-align: center;
    border: 1px dashed #cfdce7;
    border-radius: 16px;
    color: var(--ad-muted);
}

/* ── ОТДЕЛЕНИЯ: фото-плитки ───────────────────── */
.sma-dept-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.sma-dept {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    isolation: isolate;
    border-radius: 20px;
    background: linear-gradient(150deg, #0b5a9e, #003366);
    color: #fff;
    box-shadow: var(--ad-shadow-s);
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.sma-dept:hover { transform: translateY(-6px); box-shadow: var(--ad-shadow); color: #fff; }
.sma-dept img {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s ease;
}
.sma-dept:hover img { transform: scale(1.07); }
.sma-dept::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, rgba(0, 26, 52, 0) 38%, rgba(0, 26, 52, 0.55) 66%, rgba(0, 22, 46, 0.92) 100%);
}
.sma-dept-no {
    position: absolute;
    left: 16px;
    top: 16px;
    padding: 5px 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--ad-navy);
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 12px;
    letter-spacing: 0.08em;
}
.sma-dept-body {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    padding: 22px 22px 20px;
}
.sma-dept-title {
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1.18rem;
    line-height: 1.28;
    color: #fff;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.35);
}
.sma-dept-meta { display: block; margin-top: 6px; font-size: 13px; font-weight: 500; color: rgba(255, 255, 255, 0.82); }
.sma-dept-go {
    display: grid;
    place-items: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #fff;
    color: var(--ad-navy);
    font-size: 14px;
    transition: 0.3s;
}
.sma-dept:hover .sma-dept-go { background: var(--ad-red); color: #fff; transform: translateX(3px); }

/* ── ВРАЧИ: поиск, фильтры, карточки ──────────── */
.sma-bar { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 14px; margin-bottom: 18px; }
.sma-field { position: relative; display: block; }
.sma-field i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ad-faint);
    font-size: 15px;
    pointer-events: none;
}
.sma-input,
.sma-select {
    width: 100%;
    height: 52px;
    padding: 0 16px 0 44px;
    border: 1px solid #cfdce7;
    border-radius: 14px;
    background: #fff;
    color: var(--ad-ink);
    font: inherit;
    font-size: 15px;
    transition: 0.2s;
}
.sma-select {
    padding-left: 16px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23003366' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}
.sma-input:focus,
.sma-select:focus { outline: 0; border-color: var(--ad-navy); box-shadow: 0 0 0 4px rgba(0, 51, 102, 0.1); }
.sma-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.sma-chip {
    padding: 8px 14px;
    border: 1px solid var(--ad-line);
    border-radius: 999px;
    background: var(--ad-soft);
    color: var(--ad-ink);
    font: 600 13px 'Roboto', sans-serif;
    cursor: pointer;
    transition: 0.2s;
}
.sma-chip:hover { border-color: #b8c9d8; background: #fff; }
.sma-chip[aria-pressed="true"] { background: var(--ad-navy); border-color: var(--ad-navy); color: #fff; }
.sma-chip small { margin-left: 4px; font-weight: 700; opacity: 0.65; }
.sma-count { display: flex; align-items: center; justify-content: space-between; margin: 14px 2px 20px; font-size: 14px; color: var(--ad-muted); }
.sma-count b { color: var(--ad-ink); }
.sma-reset { border: 0; background: none; color: var(--ad-red); font: 700 13px 'Roboto', sans-serif; cursor: pointer; }
.sma-doc-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.sma-doc {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--ad-line);
    border-radius: 20px;
    color: var(--ad-ink);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.sma-doc:hover { transform: translateY(-5px); box-shadow: var(--ad-shadow); border-color: #cfdce7; color: var(--ad-ink); }
.sma-doc-photo { position: relative; aspect-ratio: 4 / 4.6; overflow: hidden; background: linear-gradient(165deg, #eaf3f9, #d6e6f1); }
.sma-doc-photo img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 12%; transition: transform 0.6s ease; }
.sma-doc:hover .sma-doc-photo img { transform: scale(1.05); }
.sma-mono {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 3.2rem;
    letter-spacing: 0.02em;
    color: #fff;
}
.sma-mono::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.14;
    background:
        linear-gradient(#fff, #fff) center / 14% 52% no-repeat,
        linear-gradient(#fff, #fff) center / 52% 14% no-repeat;
}
.sma-mono span { position: relative; }
.sma-mono--0 { background: linear-gradient(150deg, #0b5a9e, #003366); }
.sma-mono--1 { background: linear-gradient(150deg, #0a8aa8, #005a78); }
.sma-mono--2 { background: linear-gradient(150deg, #d4294f, #8f0f2b); }
.sma-mono--3 { background: linear-gradient(150deg, #4b6cb7, #1d3a73); }
.sma-doc-body { display: flex; flex: 1; flex-direction: column; gap: 10px; padding: 16px 18px 18px; }
.sma-doc-name {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1.02rem;
    line-height: 1.32;
    color: var(--ad-ink);
}
.sma-specs { display: flex; flex-wrap: wrap; gap: 6px; }
.sma-spec { padding: 4px 10px; border-radius: 999px; background: var(--ad-tint); color: var(--ad-navy); font-size: 12px; font-weight: 700; }
.sma-doc-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--ad-line);
    font-size: 13px;
    font-weight: 700;
    color: var(--ad-red);
}
.sma-doc-foot i { transition: transform 0.25s; }
.sma-doc:hover .sma-doc-foot i { transform: translateX(4px); }

/* ── БЛОГ: вкладки по blog_type и лента ────────── */
.sma-tabs {
    display: inline-flex;
    max-width: 100%;
    gap: 4px;
    margin-bottom: 26px;
    padding: 5px;
    overflow-x: auto;
    background: var(--ad-soft);
    border: 1px solid var(--ad-line);
    border-radius: 999px;
    scrollbar-width: none;
}
.sma-tabs::-webkit-scrollbar { display: none; }
.sma-tab {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 999px;
    color: var(--ad-muted);
    font: 700 14px 'Montserrat', sans-serif;
    white-space: nowrap;
    transition: 0.2s;
}
.sma-tab:hover { color: var(--ad-ink); }
.sma-tab[aria-current="true"] { background: var(--ad-navy); color: #fff; box-shadow: 0 6px 16px rgba(0, 51, 102, 0.25); }
.sma-tab .n { padding: 2px 8px; border-radius: 999px; background: rgba(0, 51, 102, 0.1); color: var(--ad-navy); font: 800 11px 'Montserrat', sans-serif; }
.sma-tab[aria-current="true"] .n { background: rgba(255, 255, 255, 0.22); color: #fff; }

.sma-feed { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.sma-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 999px;
    background: #e6f0fa;
    color: #003366;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.sma-badge[data-t="announcment"] { background: #fbedf1; color: #a31135; }
.sma-badge[data-t="memorandum"] { background: #e3f5f1; color: #0b6b5c; }
.sma-time { font-size: 13px; color: var(--ad-faint); }
.sma-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--ad-line);
    border-radius: 20px;
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
}
.sma-card:hover { transform: translateY(-5px); box-shadow: var(--ad-shadow); border-color: #cfdce7; }
.sma-card-link { display: flex; flex: 1; flex-direction: column; color: var(--ad-ink); }
.sma-card-link:hover { color: var(--ad-ink); }
.sma-card-img { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: linear-gradient(135deg, #e6f0fa, #d0e3f7); }
.sma-card-img img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 22%; transition: transform 0.6s; }
.sma-card:hover .sma-card-img img { transform: scale(1.05); }
.sma-card-img .sma-badge { position: absolute; left: 14px; top: 14px; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15); }
.sma-card-ph { position: absolute; inset: 0; display: grid; place-items: center; color: #8fb0cc; font-size: 2.2rem; }
.sma-card-body { display: flex; flex: 1; flex-direction: column; gap: 10px; padding: 20px 22px 22px; }
.sma-card h3 {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1.06rem;
    line-height: 1.38;
    color: var(--ad-ink);
}
.sma-ex {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-size: 0.92rem;
    line-height: 1.65;
    color: var(--ad-muted);
}
.sma-link { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 12px; font-size: 13px; font-weight: 700; color: var(--ad-red); }
.sma-link i { transition: transform 0.25s; }
.sma-card:hover .sma-link i { transform: translateX(4px); }

/* первая запись ленты — крупная */
.sma-card.is-feature { grid-column: 1 / -1; border-radius: 24px; box-shadow: var(--ad-shadow-s); }
.sma-card.is-feature .sma-card-link { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.sma-card.is-feature .sma-card-img { aspect-ratio: auto; min-height: 320px; }
.sma-card.is-feature .sma-card-img img { position: absolute; inset: 0; height: 100%; }
.sma-card.is-feature .sma-card-body { justify-content: center; gap: 14px; padding: 34px 38px; }
.sma-card.is-feature h3 { font-weight: 800; font-size: 1.6rem; line-height: 1.3; -webkit-line-clamp: 4; }
.sma-card.is-feature .sma-ex { font-size: 1rem; -webkit-line-clamp: 3; }
.sma-card.is-feature .sma-link {
    align-self: flex-start;
    margin-top: 6px;
    padding: 13px 22px;
    border-radius: 10px;
    background: var(--ad-red);
    color: #fff;
    font: 700 13px 'Montserrat', sans-serif;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: background 0.25s;
}
.sma-card.is-feature:hover .sma-link { background: var(--ad-red-d); }

@media (max-width: 1100px) {
    .sma-doc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .sma-feed { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sma-card.is-feature .sma-card-link { grid-template-columns: 1fr; }
    .sma-card.is-feature .sma-card-img { aspect-ratio: 16 / 9; min-height: 0; }
}
@media (max-width: 900px) {
    .sma-dept-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sma-doc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
}
@media (max-width: 640px) {
    .sma-hero { padding: 24px 0 28px; }
    .sma-hero::after { display: none; }
    .sma-section { padding: 24px 0 54px; }
    .sma-dept-grid { grid-template-columns: 1fr; gap: 14px; }
    .sma-dept { aspect-ratio: 16 / 10; }
    .sma-bar { grid-template-columns: 1fr; }
    .sma-chips { flex-wrap: nowrap; margin-inline: -12px; padding: 0 12px 6px; overflow-x: auto; scrollbar-width: none; }
    .sma-chips::-webkit-scrollbar { display: none; }
    .sma-chip { flex: 0 0 auto; }
    .sma-doc-body { padding: 12px 13px 14px; gap: 8px; }
    .sma-doc-name { font-size: 0.9rem; }
    .sma-spec { font-size: 11px; }
    .sma-mono { font-size: 2.4rem; }
    .sma-feed { grid-template-columns: 1fr; }
    .sma-card.is-feature .sma-card-body { padding: 22px; }
    .sma-card.is-feature h3 { font-size: 1.25rem; }
    .sma-tabs { display: flex; border-radius: 16px; }
}
@media (prefers-reduced-motion: reduce) {
    .sma-page *,
    .sma-page *::before,
    .sma-page *::after { transition: none !important; animation: none !important; }
}
