/*
Theme Name: ДПБ Кърджали
Theme URI: https://www.dpb-kardjali.bg/
Author: ДПБ – Кърджали
Description: Блокова тема за сайта на Държавна психиатрична болница – Кърджали. Спокоен зелен дизайн, четим шрифт с кирилица, удобна за телефон и за хора с намалено зрение.
Version: 1.17.0
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: dpb-kardjali
*/

/* Most styling lives in theme.json. This file holds what theme.json can't express. */

html { scroll-behavior: smooth; }
html.dpb-text-lg { font-size: 112.5%; }
html.dpb-text-xl { font-size: 125%; }

:where(a):focus-visible,
:where(button):focus-visible,
:where(input, select, textarea):focus-visible {
	outline: 3px solid var(--wp--preset--color--accent);
	outline-offset: 2px;
	border-radius: 4px;
}

.dpb-skip-link {
	position: absolute; left: -9999px; top: 0; z-index: 1000;
	background: var(--wp--preset--color--ink); color: #fff; padding: 12px 18px;
}
.dpb-skip-link:focus { left: 12px; top: 12px; }

/* Utility bar */
.dpb-utility a { color: inherit; text-decoration: none; }
.dpb-utility a:hover { text-decoration: underline; }
.dpb-textsize {
	background: transparent; border: 1px solid #5B6B66; color: inherit; border-radius: 6px;
	padding: 4px 10px; font: inherit; cursor: pointer; min-height: 32px; min-width: 44px;
}

/* Header navigation */
.dpb-header .wp-block-navigation a { text-decoration: none; }
.dpb-header .wp-block-navigation a:hover { color: var(--wp--preset--color--primary); }
.dpb-header .wp-block-navigation .current-menu-item > a,
.dpb-header .wp-block-navigation a[aria-current="page"] {
	color: var(--wp--preset--color--primary);
	box-shadow: inset 0 -2px 0 currentColor;
}
.dpb-logo-mark {
	width: 52px; height: 52px; border-radius: 14px; flex: none;
	background: var(--wp--preset--color--primary); color: #fff;
	display: flex; align-items: center; justify-content: center;
	font-family: var(--wp--preset--font-family--serif); font-weight: 600; font-size: 18px;
}
.dpb-brand a { text-decoration: none; color: inherit; }

/* Cards */
.dpb-card { transition: border-color .15s ease, box-shadow .15s ease; }
.dpb-card:hover { border-color: var(--wp--preset--color--primary) !important; box-shadow: 0 2px 10px rgba(23,33,31,.06); }
.dpb-card a { text-decoration: none; color: inherit; }
.dpb-card a::after { content: ""; position: absolute; inset: 0; }
.dpb-card { position: relative; }
.dpb-card p a::after { display: none; }

.dpb-icon {
	width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
	background: var(--wp--preset--color--mint);
}
.dpb-icon svg { width: 22px; height: 22px; stroke: var(--wp--preset--color--primary); }
.dpb-icon.is-warm { background: var(--wp--preset--color--sand); }
.dpb-icon.is-warm svg { stroke: var(--wp--preset--color--clay); }

/* Department list */
.dpb-deplist { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.dpb-deplist a {
	display: flex; justify-content: space-between; align-items: center; gap: 16px;
	padding: 20px 24px; text-decoration: none; color: inherit; font-weight: 500;
	border-bottom: 1px solid var(--wp--preset--color--line-soft);
	border-right: 1px solid var(--wp--preset--color--line-soft);
}
.dpb-deplist a:hover { background: var(--wp--preset--color--mint); }
.dpb-deplist a span:last-child { color: var(--wp--preset--color--primary); }

/* Pills */
.dpb-pills a {
	display: inline-block; border: 1px solid var(--wp--preset--color--line); border-radius: 999px;
	padding: 10px 18px; text-decoration: none; color: inherit; font-weight: 500; margin: 0 6px 10px 0;
}
.dpb-pills a:hover { border-color: var(--wp--preset--color--primary); color: var(--wp--preset--color--primary); }

/* Side navigation on department pages */
.dpb-sidenav a { display: block; padding: 10px 24px; text-decoration: none; color: inherit; }
.dpb-sidenav a:hover { background: var(--wp--preset--color--mint); }

/* Post lists */
.dpb-postlist .wp-block-post { border-bottom: 1px solid var(--wp--preset--color--line-soft); padding: 18px 0; margin: 0; }
.dpb-postlist .wp-block-post-title a { text-decoration: none; }

/* Imported (classic) content: tame old inline styles and layouts */
.entry-content img { max-width: 100%; height: auto; }
.entry-content .alignleft { float: left; margin: 0 1.5em 1em 0; }
.entry-content .alignright { float: right; margin: 0 0 1em 1.5em; }
.entry-content .aligncenter { display: block; margin-left: auto; margin-right: auto; }
.entry-content table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; }
.entry-content td, .entry-content th { border: 1px solid var(--wp--preset--color--line); padding: 8px 10px; vertical-align: top; }
.entry-content [style*="color: #1772af"], .entry-content [style*="color:#1772af"] { color: var(--wp--preset--color--primary) !important; }
.entry-content hr { border: 0; border-top: 1px solid var(--wp--preset--color--line); }
.entry-content .gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.entry-content .gallery br { display: none; }
.entry-content .gallery-item { margin: 0; }
.entry-content .gallery-item img { width: 100%; height: 140px; object-fit: cover; border-radius: 8px; border: 0 !important; }
.entry-content .wp-caption { max-width: 100%; }
.entry-content::after { content: ""; display: table; clear: both; }

@media (max-width: 781px) {
	.dpb-hide-mobile { display: none !important; }
	.entry-content .alignleft, .entry-content .alignright { float: none; margin: 0 0 1em; }
}

@media print {
	.dpb-utility, .dpb-header nav, .dpb-footer, .dpb-sidebar { display: none !important; }
}

/* Logo mark keeps white text even though it is a link */
a.dpb-logo-mark, a.dpb-logo-mark:hover { color: #fff !important; text-decoration: none; }

/* Header search: quiet outline button */
.dpb-header .wp-block-search__button {
	background: #fff; color: var(--wp--preset--color--ink);
	border: 1px solid #D9DFDC; border-radius: 10px; padding: 10px; min-width: 44px; min-height: 44px;
}
.dpb-header .wp-block-search__button:hover { border-color: var(--wp--preset--color--primary); color: var(--wp--preset--color--primary); }
.dpb-header .wp-block-search__button svg { fill: currentColor; }

/* Feature news card: image block and text side by side on wider screens */
@media (min-width: 600px) { .dpb-feature { flex-wrap: nowrap !important; } }
.dpb-feature > .wp-block-group:first-child { flex: 0 0 200px; }
@media (max-width: 599px) { .dpb-feature > .wp-block-group:first-child { flex-basis: 100%; min-height: 110px !important; } }

/* Current page in side navigation */
.dpb-sidenav a[aria-current="page"] { color: var(--wp--preset--color--primary); font-weight: 600; background: var(--wp--preset--color--mint); }

@media (max-width: 600px) {
	.dpb-header > .alignwide { flex-wrap: nowrap !important; gap: 12px !important; }
	.dpb-brand { gap: 10px !important; }
	.dpb-brand p:first-child { font-size: 1rem !important; }
	.dpb-brand p:last-child { font-size: 0.8125rem !important; }
	.dpb-logo-mark { width: 44px; height: 44px; font-size: 15px; border-radius: 12px; }
	.dpb-header .wp-block-navigation__responsive-container-open { min-width: 44px; min-height: 44px; justify-content: center; }
}
.dpb-feature { overflow: hidden; }

/* Drop-down menus in the header */
.dpb-header .wp-block-navigation .wp-block-navigation__submenu-container {
	background: #fff; border: 1px solid #D9DFDC !important; border-radius: 12px;
	box-shadow: 0 10px 30px rgba(23,33,31,.12); padding: 8px 0; min-width: 260px !important; z-index: 50;
}
.dpb-header .wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	padding: 9px 18px; font-weight: 500; white-space: normal;
}
.dpb-header .wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover {
	background: var(--wp--preset--color--mint); color: var(--wp--preset--color--primary);
}
.dpb-header .wp-block-navigation .wp-block-navigation-submenu__toggle { margin-left: 2px; }
.dpb-header .wp-block-navigation .wp-block-navigation__submenu-icon svg { width: 12px; height: 12px; }
/* Mobile overlay: big, readable list with sub-items indented */
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content { padding-top: 24px; }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content { font-size: 1.125rem; }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container {
	border: 0 !important; box-shadow: none; padding: 4px 0 8px 16px !important; min-width: 0 !important;
}
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container .wp-block-navigation-item__content { font-size: 1rem; color: var(--wp--preset--color--muted); }

/* Front page top: 70-years picture + intro box as one block, info strip below */
.dpb-hero70 { overflow: hidden; }
.dpb-hero70 > .dpb-hero70-img { flex: 0 0 52%; margin: 0; align-self: center; }
.dpb-hero70 > .dpb-hero70-img img { display: block; width: 100%; height: auto; }
.dpb-hero70 > .dpb-hero70-text { flex: 1 1 0; min-width: 0; }
.dpb-hero70-text > * { margin: 0; }
.dpb-hero70-text h1 { font-size: clamp(1.7rem, 2.5vw, 2.2rem) !important; }
.dpb-hero70-text p.has-large-font-size { font-size: 1.0625rem !important; }
.dpb-info-row p { margin: 0; }
@media (max-width: 900px) {
	.dpb-hero70 { flex-wrap: wrap !important; }
	.dpb-hero70 > .dpb-hero70-img, .dpb-hero70 > .dpb-hero70-text { flex: 1 1 100%; }
}
@media (max-width: 600px) {
	.dpb-hero70 > .dpb-hero70-text { padding: 24px 22px !important; }
	.dpb-info-row { padding: 20px !important; }
}
.dpb-info-row .is-layout-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important; }

/* Front page news list: same rounded white box as "Обяви" */
.dpb-recent {
	background: #fff; border: 1px solid #D9DFDC; border-radius: 16px; padding: 6px 22px;
}
.dpb-recent .wp-block-post-template { margin: 0; }
.dpb-recent .wp-block-post { padding: 16px 0; border-bottom: 1px solid #E6EAE8; }
.dpb-recent .wp-block-post:last-child { border-bottom: 0; }
.dpb-recent .wp-block-post-date { font-size: 0.8125rem; color: var(--wp--preset--color--muted); }
.dpb-recent .wp-block-query-no-results { padding: 16px 0; }
.dpb-recent .wp-block-query-no-results p { margin: 0; }
.dpb-recent .wp-block-post-template { gap: 0 !important; }
.dpb-recent .wp-block-post { margin: 0 !important; }
.dpb-recent .wp-block-post > * { margin-top: 0; margin-bottom: 0; }
.dpb-recent .wp-block-post > * + * { margin-top: 4px !important; }

/* Ministry of Health emblem in the footer */
.dpb-mz a { display: inline-block; opacity: .92; }
.dpb-mz a:hover { opacity: 1; }
.dpb-mz img { max-width: 100%; height: auto; }

/* Новини: full text of each news item on the list page */
.dpb-postlist .wp-block-post-title[id] { scroll-margin-top: 24px; }
.dpb-news-body { margin-top: 10px; }
.dpb-news-body > * + * { margin-top: 0.9em; }
.dpb-news-body .wp-block-image img { max-width: 100%; height: auto; }
.dpb-news-photo { max-width: 100%; }

/* Проекти */
.dpb-project { scroll-margin-top: 24px; }
.dpb-project + .dpb-project { margin-top: 28px; }
.dpb-logos { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; padding-bottom: 14px; margin-bottom: 6px; border-bottom: 1px solid #E6EAE8; }
.dpb-logos img { max-width: 100%; height: auto !important; }
.dpb-kv td:first-child { width: 34%; }
.dpb-photos { margin-bottom: 10px !important; }
.dpb-photos .wp-block-image { margin: 0; }
.dpb-photos .wp-block-image img { width: 100%; height: auto; border-radius: 10px; }
.dpb-photos:not(.dpb-photos-natural) .wp-block-image img { aspect-ratio: 1 / 1; object-fit: cover; }
.dpb-photos-natural { max-width: none; }
.dpb-photos figcaption { font-size: 0.8125rem; color: var(--wp--preset--color--muted); margin-top: 4px; }
.dpb-schedule td:first-child { white-space: nowrap; width: 1%; }

/* Новини: each news item in its own rounded card (like Проекти) */
.dpb-newslist .wp-block-post-template { gap: 0; }
.dpb-newslist .wp-block-post {
	background: #fff; border: 1px solid #C9D3CF !important; border-radius: 14px;
	padding: 22px 26px !important; margin: 0 0 22px !important;
}
.dpb-newslist .wp-block-post-date { font-size: 0.8125rem; color: var(--wp--preset--color--muted); }
@media (max-width: 600px) { .dpb-newslist .wp-block-post { padding: 18px 18px !important; } }

/* Често задавани въпроси: each question in its own white rounded card */
.entry-content .wp-block-details, .wp-block-post-content .wp-block-details {
	background: #fff; border: 1px solid #C9D3CF; border-radius: 14px; padding: 16px 22px; margin-top: 14px;
}
.wp-block-details summary { cursor: pointer; font-weight: 600; }
.wp-block-details[open] summary { margin-bottom: 8px; }
@media (max-width: 600px) {
	.wp-block-columns.is-not-stacked-on-mobile.dpb-photos-natural { flex-wrap: wrap !important; }
	.wp-block-columns.is-not-stacked-on-mobile.dpb-photos-natural > .wp-block-column { flex: 0 0 calc(50% - 5px) !important; }
	.wp-block-columns.is-not-stacked-on-mobile.dpb-photos-natural > .wp-block-column:empty { display: none; }
}

/* Sticky white header bar on desktop (the dark top bar scrolls away) */
@media (min-width: 782px) {
	.dpb-sticky {
		position: sticky; z-index: 100;
		top: calc(var(--wp-admin--admin-bar--height, 0px) - var(--dpb-util-h, 40px));
	}
	html { scroll-padding-top: calc(var(--dpb-head-h, 84px) + 16px); }
	.dpb-header { transition: padding .2s ease, box-shadow .2s ease; }
	.dpb-scrolled .dpb-header { padding-top: 8px !important; padding-bottom: 8px !important; box-shadow: 0 4px 16px rgba(23,33,31,.08); }
	.dpb-header .dpb-logo-mark { transition: width .2s ease, height .2s ease; }
	.dpb-scrolled .dpb-header .dpb-logo-mark { width: 42px; height: 42px; font-size: 15px; border-radius: 12px; }
}
