/*
Theme Name: КГБУЗ ГП11 Modern
Description: Современная адаптивная тема для сайта поликлиники. Светлая шапка с контактами, большой первый экран, карточки, синий подвал, версия для слабовидящих. Всё содержимое (страницы, записи, меню) берётся из WordPress без изменений.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: kgb11
*/

:root {
	--blue: #2f4a9e;
	--blue-d: #243a80;
	--cyan: #00b8d9;
	--cyan-d: #0097b5;
	--foot: #4a76cf;
	--bg: #f1f6f9;
	--text: #4b5563;
	--muted: #6b7280;
	--line: #dde6ee;
	--white: #fff;
	--radius: 10px;
	--wrap: 1160px;
	--shadow: 0 6px 24px rgba(36, 58, 128, .10);
	--font: "Times New Roman", Times, "Liberation Serif", "Nimbus Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 1.1875rem; line-height: 1.6; color: var(--text); background: var(--white); }
button, input, select, textarea { font-family: inherit; }
img, video, iframe { max-width: 100%; }
img { height: auto; }
a { color: var(--cyan-d); text-decoration: none; transition: color .15s; }
a:hover, a:focus { color: var(--blue); text-decoration: underline; }
h1, h2, h3, h4, h5, h6 { color: var(--blue); line-height: 1.25; font-weight: 800; margin: 1.6em 0 .6em; }
h1 { font-size: 2.25rem; } h2 { font-size: 1.75rem; } h3 { font-size: 1.4rem; } h4 { font-size: 1.2rem; }
p { margin: 0 0 1.1em; }
.container { width: 100%; max-width: calc(var(--wrap) + 2rem); margin: 0 auto; padding: 0 1rem; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link:focus { position: fixed; left: 1rem; top: 1rem; width: auto; height: auto; clip: auto; background: #fff; padding: .6rem 1rem; z-index: 9999; border-radius: 6px; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }

/* ---------- Верхнее меню ---------- */
.nav-bar { position: sticky; top: 0; z-index: 100; background: var(--white); border-bottom: 1px solid var(--line); box-shadow: 0 2px 10px rgba(0, 0, 0, .04); }
.admin-bar .nav-bar { top: 32px; }
.nav-inner { display: flex; align-items: center; justify-content: center; min-height: 3.4rem; }
.nav-toggle { display: none; }
.main-nav .menu, .main-nav .sub-menu { list-style: none; margin: 0; padding: 0; }
.main-nav > ul, .main-nav > div > ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 .35rem; }
.main-nav li { position: relative; }
.main-nav a { display: block; padding: .8rem .7rem; color: #2b3445; font-size: .95rem; font-weight: 600; line-height: 1.3; }
.main-nav a:hover, .main-nav a:focus { color: var(--cyan-d); text-decoration: none; }
.main-nav .current-menu-item > a, .main-nav .current-menu-ancestor > a, .main-nav .current_page_item > a { color: var(--cyan-d); }
.main-nav .menu-item-has-children > a { padding-right: 1.5rem; }
.sub-toggle { position: absolute; top: 0; right: 0; width: 1.5rem; height: 2.9rem; padding: 0; border: 0; background: none; cursor: pointer; }
.sub-toggle span { display: block; width: .45rem; height: .45rem; margin: 0 auto; border-right: 2px solid #6b7280; border-bottom: 2px solid #6b7280; transform: rotate(45deg) translateY(-2px); }
.main-nav .sub-menu { position: absolute; left: 0; top: 100%; z-index: 50; min-width: 300px; max-width: 420px; background: var(--white); border: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); box-shadow: var(--shadow); padding: .4rem 0; display: none; }
.main-nav .sub-menu a { padding: .5rem 1rem; font-weight: 500; font-size: .92rem; }
.main-nav .sub-menu a:hover { background: var(--bg); }
.main-nav .sub-menu .sub-menu { left: 100%; top: -.4rem; border-radius: var(--radius); }
.main-nav .sub-menu .sub-toggle { top: .25rem; height: 2rem; }
.main-nav .sub-menu .sub-toggle span { transform: rotate(-45deg); }
.main-nav li:hover > .sub-menu, .main-nav li:focus-within > .sub-menu, .main-nav li.is-open > .sub-menu { display: block; }
.main-nav > ul > li:nth-last-child(-n+3) > .sub-menu, .main-nav > div > ul > li:nth-last-child(-n+3) > .sub-menu { left: auto; right: 0; }
.main-nav > ul > li:nth-last-child(-n+3) .sub-menu .sub-menu, .main-nav > div > ul > li:nth-last-child(-n+3) .sub-menu .sub-menu { left: auto; right: 100%; }

/* ---------- Шапка с брендом ---------- */
.brand-bar { background: var(--white); border-bottom: 1px solid var(--line); }
.brand-inner { display: flex; align-items: center; gap: 1.5rem; padding-top: 1rem; padding-bottom: 1rem; }
.brand { display: flex; align-items: center; gap: .9rem; flex: 0 1 340px; color: var(--blue); }
.brand:hover { text-decoration: none; color: var(--blue-d); }
.brand img, .brand .custom-logo { max-height: 64px; width: auto; }
.brand-mark { flex: none; width: 56px; height: 56px; border-radius: 50%; background: var(--blue); display: grid; place-items: center; }
.brand-text { display: block; font-weight: 800; font-size: .95rem; line-height: 1.3; letter-spacing: .02em; }
.brand-text small { display: block; margin-top: .2rem; font-weight: 600; font-size: .72rem; color: var(--muted); letter-spacing: 0; }
.head-contacts { flex: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .15rem 1.25rem; font-size: .78rem; line-height: 1.5; }
.head-contacts a, .head-contacts span { color: var(--muted); }
.head-contacts a:hover { color: var(--blue); }
.head-contacts strong { color: var(--text); font-weight: 700; }
.head-address { grid-column: 1 / -1; }
.head-tools { display: flex; gap: .5rem; flex: none; }
.tool-btn { display: inline-flex; align-items: center; gap: .4rem; padding: .5rem .8rem; border: 1px solid var(--line); background: var(--white); border-radius: 999px; font: inherit; font-size: .82rem; font-weight: 700; color: var(--blue); cursor: pointer; }
.tool-btn:hover { background: var(--bg); border-color: var(--cyan); }
.tool-btn svg { width: 1.1rem; height: 1.1rem; }
.search-panel { background: var(--bg); border-bottom: 1px solid var(--line); padding: .9rem 0; }
.search-form { display: flex; gap: .5rem; max-width: 640px; margin: 0 auto; }
.search-form input[type="search"] { flex: 1; padding: .7rem 1rem; border: 1px solid var(--line); border-radius: 999px; font: inherit; }
.btn, .search-form button, .comment-form input[type="submit"] { display: inline-block; padding: .75rem 1.6rem; border: 0; border-radius: 999px; background: var(--cyan); color: #fff; font: inherit; font-weight: 800; cursor: pointer; transition: background .15s, transform .15s; }
.btn:hover, .search-form button:hover, .comment-form input[type="submit"]:hover { background: var(--cyan-d); color: #fff; text-decoration: none; transform: translateY(-1px); }
.btn-ghost { background: transparent; border: 2px solid rgba(255, 255, 255, .85); padding: calc(.75rem - 2px) calc(1.6rem - 2px); }
.btn-ghost:hover { background: rgba(255, 255, 255, .15); }

/* ---------- Панель для слабовидящих ---------- */
.lv-panel { background: #111; color: #fff; padding: .5rem 0; }
.lv-panel[hidden] { display: none; }
.lv-panel .container { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.lv-panel button { padding: .35rem .8rem; border: 1px solid #fff; background: transparent; color: #fff; border-radius: 6px; font: inherit; font-size: .9rem; cursor: pointer; }
.lv-panel button:hover { background: #fff; color: #111; }
.lv-panel .lv-title { font-weight: 800; margin-right: .5rem; }

/* ---------- Первый экран ---------- */
.hero { position: relative; color: #fff; background: linear-gradient(135deg, #1b3480 0%, #2f5fc4 55%, #00a6c8 100%) center / cover no-repeat; min-height: 620px; display: flex; flex-direction: column; }
.hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10, 24, 62, .78) 0%, rgba(10, 24, 62, .45) 60%, rgba(10, 24, 62, .25) 100%); }
.hero > * { position: relative; }
.hero-main { flex: 1; display: flex; align-items: center; padding: 4rem 0 2rem; }
.hero h1 { color: #fff; font-size: clamp(2rem, 5vw, 3.4rem); margin: 0 0 1rem; max-width: 18ch; }
.hero-lead { max-width: 46rem; font-size: 1.2rem; line-height: 1.6; min-height: 5.8em; }
.hero-lead p { margin: 0; }
.js .hero-slide { display: none; }
.js .hero-slide.is-active { display: block; animation: fadeIn .6s; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.hero-dots { display: flex; gap: .5rem; margin: .4rem 0 1.5rem; }
.hero-dots button { width: .7rem; height: .7rem; padding: 0; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .45); cursor: pointer; }
.hero-dots button.is-active { background: var(--cyan); transform: scale(1.25); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.hero-features { padding: 1.5rem 0 2.5rem; border-top: 1px solid rgba(255, 255, 255, .2); }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem 2rem; }
.feature { display: grid; grid-template-columns: 2.4rem 1fr; gap: .2rem .8rem; align-items: center; color: #fff; }
.feature svg { width: 2.4rem; height: 2.4rem; stroke: #fff; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.feature strong { font-size: 1.15rem; font-weight: 800; }
.feature a, .feature span.val { grid-column: 2; color: #fff; opacity: .92; }
.feature a:hover { color: #fff; text-decoration: underline; }

/* ---------- Блоки главной ---------- */
.section { padding: 4rem 0; }
.section-alt { background: var(--bg); }
.section-title { text-align: center; margin: 0 0 2.2rem; font-size: 2.1rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 1.5rem; }
.card { display: flex; background: var(--bg); border-radius: var(--radius); overflow: hidden; min-height: 125px; transition: box-shadow .2s, transform .2s; }
.section-alt .card { background: var(--white); }
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card-img { flex: 0 0 135px; background: linear-gradient(135deg, #dbe8f5, #c3d7ee); display: grid; place-items: center; }
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-img svg { width: 2.6rem; height: 2.6rem; stroke: var(--blue); fill: none; stroke-width: 1.5; opacity: .7; }
.card-body { padding: 1.1rem 1.4rem; display: flex; flex-direction: column; justify-content: center; gap: .35rem; }
.card-title { margin: 0; font-size: 1.15rem; font-weight: 800; color: var(--blue); line-height: 1.3; }
.card-title a { color: inherit; }
.card-title a:hover { text-decoration: none; }
.card-more { font-size: .9rem; font-weight: 700; color: var(--cyan-d); }
.card-meta { font-size: .82rem; color: var(--muted); }
.card-excerpt { font-size: .95rem; margin: 0; color: var(--muted); }
.home-content .entry-content { max-width: 100%; }

/* ---------- Внутренние страницы ---------- */
.page-head { background: var(--bg); padding: 1.6rem 0 1.4rem; border-bottom: 1px solid var(--line); }
.page-title { margin: .4rem 0 0; font-size: 2.1rem; }
.breadcrumbs { font-size: .85rem; color: var(--muted); }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--blue); }
.breadcrumbs .sep { margin: 0 .4rem; opacity: .6; }
.site-main { padding: 2.5rem 0 4rem; min-height: 40vh; }
.entry-meta { font-size: .88rem; color: var(--muted); margin-bottom: 1.5rem; }
.entry-content::after { content: ""; display: table; clear: both; }
.entry-content > :first-child { margin-top: 0; }
.entry-content img { border-radius: 6px; }
.entry-content a { text-decoration: underline; text-underline-offset: 2px; }
.entry-content ul, .entry-content ol { padding-left: 1.4rem; }
.entry-content li { margin-bottom: .35em; }
.entry-content blockquote { margin: 1.5rem 0; padding: 1rem 1.4rem; border-left: 4px solid var(--cyan); background: var(--bg); border-radius: 0 var(--radius) var(--radius) 0; }
.table-wrap { overflow-x: auto; margin: 0 0 1.5rem; -webkit-overflow-scrolling: touch; }
.entry-content table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.entry-content th, .entry-content td { padding: .6rem .8rem; border: 1px solid var(--line); vertical-align: top; }
.entry-content th { background: var(--bg); color: var(--blue); text-align: left; }
.entry-content tr:nth-child(even) td { background: #fafcfd; }
.alignleft { float: left; margin: .3rem 1.5rem 1rem 0; } .alignright { float: right; margin: .3rem 0 1rem 1.5rem; } .aligncenter { display: block; margin: 1rem auto; }
.wp-caption { max-width: 100%; } .wp-caption-text, figcaption { font-size: .85rem; color: var(--muted); }
.pagination, .nav-links { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; margin-top: 2.5rem; }
.page-numbers { padding: .45rem .9rem; border: 1px solid var(--line); border-radius: 999px; font-weight: 700; }
.page-numbers.current, .page-numbers:hover { background: var(--blue); color: #fff; border-color: var(--blue); text-decoration: none; }
.comments-area { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.comment-list { list-style: none; padding: 0; }
.comment-body { background: var(--bg); padding: 1rem 1.2rem; border-radius: var(--radius); margin-bottom: 1rem; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea { width: 100%; padding: .7rem 1rem; border: 1px solid var(--line); border-radius: var(--radius); font: inherit; }

/* ---------- Боковая панель ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 2.5rem; align-items: start; }
.layout-main { min-width: 0; }
.sidebar { display: grid; gap: 1.25rem; align-content: start; }
.section-alt .sidebar .widget { background: var(--white); }
.sidebar .widget { background: var(--bg); border-radius: var(--radius); padding: 1.25rem 1.3rem; }
.sidebar .widget-title { margin: 0 0 .8rem; font-size: 1.1rem; color: var(--blue); }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li { border-top: 1px solid var(--line); }
.sidebar li:first-child { border-top: 0; }
.sidebar li a { display: block; padding: .5rem 0; color: var(--text); font-size: .93rem; line-height: 1.4; }
.sidebar li a:hover { color: var(--cyan-d); text-decoration: none; }
.sidebar .current_page_item > a, .sidebar .current-menu-item > a { color: var(--cyan-d); font-weight: 800; }
.sidebar ul ul { padding-left: .9rem; border-left: 2px solid var(--line); margin-bottom: .3rem; }
.sidebar ul ul li a { font-size: .88rem; }
.widget-cta { background: var(--blue) !important; }
.widget-cta .widget-title { color: #fff; }
.widget-cta .btn { display: block; width: 100%; margin-bottom: .6rem; text-align: center; padding: .7rem 1rem; font-size: .93rem; }
.widget-cta .btn:last-child { margin-bottom: 0; }
.widget-cta .btn-outline { background: transparent; border: 2px solid rgba(255, 255, 255, .8); padding: calc(.7rem - 2px) 1rem; }
.widget-cta .btn-outline:hover { background: rgba(255, 255, 255, .15); }
.widget-phones li { display: flex; flex-direction: column; padding: .5rem 0; }
.widget-phones li span { font-size: .8rem; color: var(--muted); }
.widget-phones li a, .widget-phones li b { font-weight: 800; color: var(--blue); font-size: 1.02rem; }

.sidebar .btn { display: block; width: 100%; text-align: center; font-size: .93rem; padding: .75rem 1rem; }
.sidebar .btn-outline { background: transparent; border: 2px solid var(--cyan); color: var(--cyan-d); padding: calc(.75rem - 2px) 1rem; }
.sidebar .btn-outline:hover { background: var(--cyan); color: #fff; }
.widget-cta .btn-outline { border-color: rgba(255, 255, 255, .8); color: #fff; }
.widget-cta .btn-outline:hover { background: rgba(255, 255, 255, .15); }
.widget-gos { text-align: center; }
.widget-gos .gos-logo { max-width: 100%; height: 44px; margin: 0 auto .8rem; display: block; }
.widget-gos .gos-title { font-weight: 800; color: var(--blue); font-size: 1.05rem; margin: 0 0 .9rem; }
.sidebar .banner { display: block; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: box-shadow .2s, transform .2s; }
.sidebar a.banner:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.sidebar .banner img { display: block; width: 100%; height: auto; border-radius: 0; }
.widget-link-btn { display: block; padding: .8rem 1rem; margin-bottom: .6rem; background: var(--white); border: 1px solid var(--line); border-left: 4px solid var(--cyan); border-radius: 8px; font-size: .9rem; font-weight: 700; line-height: 1.4; color: var(--blue); }
.widget-link-btn:last-child { margin-bottom: 0; }
.widget-link-btn:hover { background: var(--blue); color: #fff; text-decoration: none; }
@media (max-width: 980px) {
	.layout { grid-template-columns: 1fr; }
	.sidebar { position: static; margin-top: 2rem; }
}

/* ---------- Подвал ---------- */
.site-footer { background: var(--foot); color: #fff; padding: 3.5rem 0 0; margin-top: 0; }
.site-footer a { color: #fff; }
.site-footer a:hover { text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1.1fr 1fr 1fr 1fr; gap: 2rem; padding-bottom: 2.5rem; }
.site-footer h2, .site-footer .widget-title { color: #fff; font-size: 1.15rem; margin: 0 0 .9rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: .35rem; font-size: .95rem; }
.footer-brand img, .footer-brand .custom-logo { max-height: 90px; width: auto; filter: brightness(0) invert(1); margin-bottom: 1rem; }
.footer-brand p { font-size: .9rem; opacity: .92; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .25); padding: 1.1rem 0; font-size: .85rem; opacity: .95; }
.to-top { position: fixed; right: 1.2rem; bottom: 5rem; width: 3rem; height: 3rem; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--blue); box-shadow: var(--shadow); cursor: pointer; display: none; place-items: center; z-index: 90; }
.to-top.is-visible { display: grid; }
.to-top svg { width: 1.3rem; height: 1.3rem; }

/* ---------- Адаптив ---------- */
@media (max-width: 1100px) {
	.head-contacts { grid-template-columns: 1fr; }
	.footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 980px) {
	.nav-inner { justify-content: space-between; }
	.nav-toggle { display: inline-flex; align-items: center; gap: .6rem; padding: .6rem .2rem; background: none; border: 0; font: inherit; font-weight: 800; color: var(--blue); cursor: pointer; }
	.nav-toggle .bars, .nav-toggle .bars::before, .nav-toggle .bars::after { display: block; width: 1.4rem; height: 2px; background: var(--blue); position: relative; content: ""; }
	.nav-toggle .bars::before { position: absolute; top: -6px; } .nav-toggle .bars::after { position: absolute; top: 6px; }
	.js .main-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-bottom: 1px solid var(--line); max-height: calc(100vh - 3.4rem); overflow-y: auto; box-shadow: var(--shadow); }
	.js .main-nav.is-open { display: block; }
	.main-nav > ul, .main-nav > div > ul { display: block; padding: .4rem 1rem 1rem; }
	.main-nav a { padding: .7rem .2rem; }
	.main-nav .sub-menu, .main-nav .sub-menu .sub-menu { position: static; display: none; min-width: 0; max-width: none; border: 0; box-shadow: none; padding: 0 0 0 1rem; border-left: 2px solid var(--line); border-radius: 0; }
	.main-nav li:hover > .sub-menu, .main-nav li:focus-within > .sub-menu { display: none; }
	.main-nav li.is-open > .sub-menu { display: block !important; }
	.sub-toggle { height: 2.7rem; width: 2.7rem; }
	.sub-toggle span { transform: rotate(45deg); }
	.main-nav li.is-open > .sub-toggle span { transform: rotate(-135deg); }
	.brand-inner { flex-wrap: wrap; }
	.brand { flex: 1 1 auto; }
	.head-contacts { order: 3; flex-basis: 100%; }
	.admin-bar .nav-bar { top: 46px; }
}
@media (max-width: 640px) {
	body { font-size: 1rem; }
	h1, .page-title { font-size: 1.7rem; } h2, .section-title { font-size: 1.5rem; }
	.section { padding: 2.5rem 0; }
	.cards { grid-template-columns: 1fr; }
	.card-img { flex-basis: 105px; }
	.hero { min-height: 0; } .hero-main { padding: 2.5rem 0 1rem; } .hero-lead { font-size: 1.05rem; }
	.footer-grid { grid-template-columns: 1fr; }
	.tool-btn .lbl { display: none; }
	.alignleft, .alignright { float: none; display: block; margin: 1rem auto; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
@media print { .nav-bar, .brand-bar, .site-footer, .to-top, .hero-actions, .lv-panel { display: none !important; } }

/* ---------- Версия для слабовидящих ---------- */
html.lv-on[data-lv-size="1"] { font-size: 118%; }
html.lv-on[data-lv-size="2"] { font-size: 137%; }
html.lv-on[data-lv-size="3"] { font-size: 160%; }
html.lv-on, html.lv-on body { letter-spacing: .02em; }
html.lv-on a { text-decoration: underline; }
html.lv-on .hero::before { background: none; }
html.lv-on[data-lv-scheme="bw"] body, html.lv-on[data-lv-scheme="bw"] body * { background-image: none !important; background-color: #fff !important; color: #000 !important; border-color: #000 !important; box-shadow: none !important; text-shadow: none !important; }
html.lv-on[data-lv-scheme="bw"] a { color: #0000cc !important; }
html.lv-on[data-lv-scheme="wb"] body, html.lv-on[data-lv-scheme="wb"] body * { background-image: none !important; background-color: #000 !important; color: #fff !important; border-color: #fff !important; box-shadow: none !important; text-shadow: none !important; }
html.lv-on[data-lv-scheme="wb"] a { color: #ffe600 !important; }
html.lv-on .card, html.lv-on .tool-btn, html.lv-on .btn { border: 2px solid currentColor !important; }
html.lv-on svg { stroke: currentColor !important; }
html.lv-noimg img { display: none !important; }
