/*
Theme Name: DagDiaspora
Theme URI: https://dagdiaspora.com
Author: DagDiaspora
Description: Тема для сообщества дагестанцев в США. Выбор города в шапке, каталог на Directorist, новости «мой город» / «для всех земляков», вакансии, события, гайд «Первые 90 дней».
Version: 1.2.1
Requires at least: 6.3
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: dagdiaspora
*/

:root {
	--dd-green: #1F5E4B;
	--dd-green-dark: #143F32;
	--dd-gold: #B8741F;
	--dd-gold-light: #F2C98A;
	--dd-ink: #1C2321;
	--dd-muted: #5B6461;
	--dd-faint: #6B716E;
	--dd-bg: #F6F4EF;
	--dd-line: #E3DED3;
	--dd-card: #FFFFFF;
	--dd-mint: #EAF2EE;
	--dd-sand: #F3EADC;
	--dd-radius: 14px;
	--dd-head: "Unbounded", sans-serif;
	--dd-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--dd-bg); color: var(--dd-ink); font-family: var(--dd-body); font-size: 16px; line-height: 1.55; }
img { max-width: 100%; height: auto; }
a { color: var(--dd-green); }
a:hover { color: var(--dd-green-dark); }
h1, h2, h3 { line-height: 1.2; }
h1, h2 { font-family: var(--dd-head); font-weight: 500; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 1000; width: auto; height: auto; clip: auto; background: #fff; padding: 12px 16px; border-radius: 8px; }
:focus-visible { outline: 3px solid var(--dd-gold); outline-offset: 2px; }

.dd-wrap { max-width: 1200px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }

/* Buttons */
.dd-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 12px 20px; border-radius: 10px; border: none; font: inherit; font-weight: 700; font-size: 15px; text-decoration: none; cursor: pointer; background: var(--dd-green); color: #fff; }
.dd-btn:hover { background: var(--dd-green-dark); color: #fff; }
.dd-btn--gold { background: var(--dd-gold); }
.dd-btn--gold:hover { background: #9A5F16; }
.dd-link-more { font-weight: 700; font-size: 15px; }
.dd-links { display: inline-flex; flex-wrap: wrap; gap: 8px 24px; }

/* Header */
.dd-header { background: #fff; border-bottom: 1px solid var(--dd-line); }
.dd-header__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-top: 16px; padding-bottom: 16px; }
.dd-logo { font-family: var(--dd-head); font-weight: 700; font-size: 20px; color: var(--dd-green); text-decoration: none; }
.dd-logo span { color: var(--dd-gold); }
.dd-city { display: flex; align-items: center; gap: 8px; background: var(--dd-bg); border: 1px solid var(--dd-line); border-radius: 10px; padding: 0 12px; min-height: 44px; font-weight: 600; font-size: 15px; }
.dd-city select { border: none; background: transparent; font: inherit; color: var(--dd-ink); cursor: pointer; min-height: 40px; max-width: 190px; text-overflow: ellipsis; }
.dd-header .dd-wrap { max-width: 1320px; }
.dd-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; font-weight: 600; font-size: 15px; }
.dd-nav a { color: var(--dd-ink); text-decoration: none; display: inline-block; padding: 10px 0; }
.dd-nav a:hover, .dd-nav .current-menu-item > a { color: var(--dd-green); }
.dd-menu-toggle { display: none; }
.dd-lang { display: flex; align-items: center; gap: 2px; font-weight: 700; font-size: 14px; border: 1px solid var(--dd-line); border-radius: 10px; padding: 2px; }
.dd-lang a, .dd-lang span { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; min-height: 38px; border-radius: 8px; text-decoration: none; }
.dd-lang a { color: var(--dd-muted); }
.dd-lang a:hover { color: var(--dd-green); background: var(--dd-bg); }
.dd-lang span { background: var(--dd-green); color: #fff; }
/* The full menu fits in one row from 1320px; narrower screens get the Menu button. */
@media (max-width: 1320px) {
	.dd-menu-toggle { display: inline-flex; background: var(--dd-bg); color: var(--dd-ink); border: 1px solid var(--dd-line); }
	.dd-nav { display: none; width: 100%; order: 10; }
	.dd-nav.is-open { display: block; }
	.dd-nav ul { flex-direction: column; gap: 0; }
}
@media (max-width: 860px) {
	.dd-nav { order: 0; }
	.dd-header__cta { width: 100%; }
}

/* Hero */
.dd-hero { background: var(--dd-green); color: #fff; }
.dd-hero__inner { padding-top: 80px; padding-bottom: 72px; display: flex; flex-direction: column; gap: 24px; }
.dd-eyebrow { margin: 0; font-weight: 600; font-size: 15px; color: var(--dd-gold-light); letter-spacing: .04em; text-transform: uppercase; }
.dd-hero h1 { margin: 0; font-weight: 700; font-size: clamp(32px, 5vw, 52px); line-height: 1.1; max-width: 820px; }
.dd-hero__lead { margin: 0; font-size: 19px; max-width: 640px; color: #D6E6DF; }
.dd-search { display: flex; flex-wrap: wrap; gap: 12px; background: #fff; padding: 12px; border-radius: var(--dd-radius); max-width: 820px; }
.dd-search label, .dd-search .dd-search__where { flex: 2 1 260px; display: flex; flex-direction: column; gap: 4px; padding: 6px 10px; color: var(--dd-muted); font-size: 13px; font-weight: 600; }
.dd-search .dd-search__where { flex: 1 1 180px; border-left: 1px solid var(--dd-line); }
.dd-search .dd-search__where strong { font-size: 16px; color: var(--dd-ink); padding: 4px 0; }
.dd-search input[type=text] { border: none; outline: none; font: inherit; font-size: 16px; font-weight: 500; color: var(--dd-ink); padding: 4px 0; background: transparent; }
.dd-search button { min-height: 52px; padding: 0 28px; font-size: 16px; }
@media (max-width: 560px) { .dd-search .dd-search__where { border-left: none; border-top: 1px solid var(--dd-line); } .dd-search button { width: 100%; } }

/* Sections */
.dd-section { padding-top: 56px; padding-bottom: 8px; display: flex; flex-direction: column; gap: 20px; }
.dd-section__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; }
.dd-section h2 { margin: 0; font-size: clamp(24px, 3vw, 30px); }
.dd-section__sub { margin: 0; color: var(--dd-muted); }
.dd-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.dd-grid--wide { grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); }
.dd-grid--cats { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.dd-card { background: var(--dd-card); border: 1px solid var(--dd-line); border-radius: var(--dd-radius); padding: 20px; color: var(--dd-ink); text-decoration: none; display: flex; flex-direction: column; gap: 8px; }
a.dd-card:hover { border-color: var(--dd-green); color: var(--dd-ink); }
.dd-card h3 { margin: 0; font-size: 18px; font-weight: 700; }
.dd-card p { margin: 0; font-size: 15px; color: var(--dd-muted); }
.dd-card__meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 12px; font-weight: 700; }
.dd-card__topic { color: var(--dd-green); text-transform: uppercase; letter-spacing: .04em; }
.dd-card__date { color: var(--dd-faint); }
.dd-card__title { font-weight: 700; font-size: 17px; line-height: 1.35; }
.dd-card__count { margin-top: 6px; font-size: 14px; font-weight: 700; color: var(--dd-green); }
.dd-card__count--empty { color: #8A5A1E; }
.dd-pill { align-self: flex-start; display: inline-block; background: var(--dd-mint); color: var(--dd-green); font-weight: 700; font-size: 12px; padding: 4px 10px; border-radius: 999px; }
.dd-pill--sand { background: var(--dd-sand); color: #7A4A12; }
.dd-rating { font-weight: 700; font-size: 15px; color: var(--dd-ink) !important; }
.dd-rating span { color: var(--dd-gold); }
.dd-empty { background: #fff; border: 1px dashed var(--dd-line); border-radius: var(--dd-radius); padding: 24px; color: var(--dd-muted); }
.dd-note { margin: 0; font-size: 13px; color: var(--dd-faint); }

/* Tabs */
.dd-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.dd-tab { min-height: 44px; padding: 0 18px; border-radius: 999px; font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; border: 1px solid var(--dd-green); background: #fff; color: var(--dd-green); }
.dd-tab[aria-selected="true"] { background: var(--dd-green); color: #fff; }
.dd-tabpanel[hidden] { display: none; }

/* Guide */
.dd-guide { background: #fff; border: 1px solid var(--dd-line); border-radius: 20px; padding: clamp(24px, 4vw, 40px); display: flex; flex-wrap: wrap; gap: 40px; }
.dd-guide__intro { flex: 1 1 300px; display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.dd-guide__intro p { margin: 0; color: var(--dd-muted); font-size: 17px; }
.dd-steps { flex: 2 1 460px; margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.dd-steps li { background: var(--dd-bg); border-radius: 12px; padding: 16px; display: flex; gap: 12px; align-items: flex-start; }
.dd-steps__n { flex: 0 0 32px; height: 32px; border-radius: 50%; background: var(--dd-gold); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.dd-steps strong { display: block; font-size: 16px; }
.dd-steps small { font-size: 14px; color: var(--dd-muted); }

/* Events */
.dd-event { flex-direction: row; gap: 16px; }
.dd-event__date { flex: 0 0 64px; height: 64px; border-radius: 12px; background: var(--dd-green); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; text-align: center; line-height: 1.1; }
.dd-event__date b { font-size: 22px; }

/* Business CTA */
.dd-cta { background: var(--dd-ink); color: #fff; margin-top: 56px; }
.dd-cta__inner { padding-top: 64px; padding-bottom: 64px; display: flex; flex-direction: column; gap: 28px; align-items: flex-start; }
.dd-cta h2 { margin: 0; font-size: clamp(24px, 3vw, 32px); }
.dd-cta p { margin: 0; color: #C9CFCC; font-size: 17px; max-width: 680px; }
.dd-plans { width: 100%; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 16px; }
.dd-plan { border: 1px solid #3A4441; border-radius: 16px; padding: 28px; display: flex; flex-direction: column; gap: 12px; }
.dd-plan--premium { border: 2px solid #E2A65A; }
.dd-plan__name { font-weight: 700; font-size: 18px; }
.dd-plan--premium .dd-plan__name { color: var(--dd-gold-light); }
.dd-plan__price { font-family: var(--dd-head); font-size: 28px; }
.dd-plan ul { margin: 0; padding-left: 18px; color: #C9CFCC; font-size: 15px; }

/* Footer */
.dd-footer { padding-top: 32px; padding-bottom: 32px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; font-size: 14px; color: var(--dd-muted); }
.dd-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; }

/* Inner pages */
.dd-main { padding-top: 40px; padding-bottom: 56px; }
.dd-content { background: #fff; border: 1px solid var(--dd-line); border-radius: 20px; padding: clamp(20px, 4vw, 48px); }
.dd-content--wide { background: transparent; border: none; padding: 0; }
.dd-content h1 { margin-top: 0; font-size: clamp(28px, 4vw, 40px); }
.dd-content h2 { font-size: 24px; margin-top: 1.6em; }
.dd-content .wp-block-image, .dd-content figure { margin: 1.5em 0; }
.dd-postlist { display: grid; gap: 16px; }
.dd-pagination { margin-top: 24px; display: flex; gap: 8px; flex-wrap: wrap; }
.dd-pagination .page-numbers { padding: 10px 14px; background: #fff; border: 1px solid var(--dd-line); border-radius: 10px; text-decoration: none; }
.dd-pagination .current { background: var(--dd-green); color: #fff; border-color: var(--dd-green); }

/* Directorist: match colours */
.directorist-btn.directorist-btn-primary, .directorist-btn-primary { background-color: var(--dd-green) !important; border-color: var(--dd-green) !important; }
.directorist-btn.directorist-btn-primary:hover { background-color: var(--dd-green-dark) !important; }

/* Directorist AI upsell buttons (shown to admins) */
.directorist-ai-admin-action { display: none !important; }

/* Russian: "Найдено: 0" (Directorist prints the number before the words). */
html[lang^="ru"] .directorist-header-found-title { display: inline-flex; flex-direction: row-reverse; gap: .3em; }
