/*
Theme Name: Звуки тишины
Theme URI: https://zvukitishiny.ru/
Author: Звуки тишины
Description: Бесплатные инструменты для сна, отдыха и медитации прямо в браузере: звуки природы, генератор шума, частоты сольфеджио, бинауральные ритмы, таймер медитации, колокола и таймер дневного сна. Свои блоки Gutenberg, встроенный аудиодвижок, импорт страниц.
Version: 1.0.0
Requires at least: 6.4
Tested up to: 6.8
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: zvukitishiny
*/

/* Палитра «ночь + лаванда». Сайт осознанно только тёмный. */
:root {
	--hg-bg: #0A0F1F;
	--hg-surface: #161D38;
	--hg-sunk: #10162B;
	--hg-ink: #EDE9F6;
	--hg-muted: #A4A1B8;
	--hg-line: #262D4A;
	--hg-accent: #8B76FF;
	--hg-accent-2: #5B48B8;
	--hg-accent-text: #A28CFF;
	--hg-accent-ink: #FFFFFF;
	--hg-accent-soft: #221F4A;
	--hg-warm: #E8C9A0;
	--hg-warm-soft: #2A2433;
	--hg-glow: rgba(139, 118, 255, 0.15);
	--hg-display: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
	--hg-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
	--hg-mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
	--hg-radius: 12px;
	--hg-wide: 1080px;
	--hg-text: 70ch;
	color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: radial-gradient(900px 520px at 50% -8%, var(--hg-glow), transparent 62%) no-repeat, var(--hg-bg);
	color: var(--hg-ink);
	font-family: var(--hg-body);
	font-size: 17px;
	line-height: 1.65;
}
img, svg, video { max-width: 100%; height: auto; }
a { color: var(--hg-accent-text); text-underline-offset: 3px; }
a:hover { color: var(--hg-ink); }
:focus-visible { outline: 2px solid var(--hg-accent); outline-offset: 3px; }
h1, h2, h3, h4 { font-family: var(--hg-display); line-height: 1.15; text-wrap: balance; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 5.2vw, 3rem); font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.35rem, 3vw, 1.6rem); font-weight: 600; margin-top: 2em; }
h3 { font-size: 1.15rem; font-weight: 600; }
p { margin: 0 0 1em; }
code, .hg-mono { font-family: var(--hg-mono); font-variant-numeric: tabular-nums; }
.screen-reader-text { border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; word-wrap: normal !important; }
.screen-reader-text:focus { clip: auto; clip-path: none; height: auto; width: auto; z-index: 100; padding: 10px 16px; background: var(--hg-surface); color: var(--hg-ink); left: 8px; top: 8px; }

.hg-wrap { max-width: var(--hg-wide); margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

/* ---------- header ---------- */
.hg-header { border-bottom: 1px solid var(--hg-line); background: rgba(10, 15, 31, 0.85); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 20; }
.admin-bar .hg-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .hg-header { top: 46px; } }
.hg-header .hg-wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.hg-logo { display: inline-flex; align-items: center; gap: 10px; font-family: var(--hg-display); font-weight: 700; font-size: 1.2rem; color: var(--hg-ink); text-decoration: none; }
.hg-logo-mark { width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff 0%, #e3d0fa 18%, var(--hg-accent-text) 45%, var(--hg-accent) 75%, var(--hg-accent-2) 100%); flex: none; }
.custom-logo { max-height: 40px; width: auto; }
.hg-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 22px; }
.hg-nav a { color: var(--hg-muted); text-decoration: none; font-size: .95rem; }
.hg-nav a:hover, .hg-nav .current-menu-item > a, .hg-nav .current-menu-ancestor > a, .hg-nav .current_page_item > a, .hg-nav .current_page_ancestor > a { color: var(--hg-ink); }
.hg-nav .sub-menu { display: none; }
.hg-burger { display: none; background: none; border: 1px solid var(--hg-line); color: var(--hg-ink); border-radius: 8px; width: 44px; height: 40px; cursor: pointer; font-size: 1.2rem; }
@media (max-width: 860px) {
	.hg-burger { display: inline-grid; place-items: center; }
	.hg-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--hg-bg); border-bottom: 1px solid var(--hg-line); padding: 8px max(16px, env(safe-area-inset-left, 0px)) 16px; }
	.hg-nav.is-open { display: block; }
	.hg-nav ul { flex-direction: column; gap: 0; }
	.hg-nav a { display: block; padding: 12px 0; font-size: 1.05rem; border-bottom: 1px solid var(--hg-line); }
}

/* ---------- page ---------- */
.hg-main { padding-block: 24px 64px; }
.hg-crumbs { font-size: .85rem; color: var(--hg-muted); margin-bottom: 18px; }
.hg-crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.hg-crumbs li + li::before { content: '›'; margin-right: 6px; color: var(--hg-muted); }
.hg-crumbs a { color: var(--hg-muted); }
.hg-page-title { max-width: 760px; }
.hg-content > * { max-width: var(--hg-text); }
.hg-content > .hg-player, .hg-content > .hg-cards, .hg-content > .wp-block-table, .hg-content > .hg-children, .hg-content > .alignwide, .hg-content > .hg-faq, .hg-content > .hg-home-hero { max-width: none; }
.hg-content .is-style-lead, .hg-lead { font-size: 1.15rem; color: var(--hg-muted); max-width: 720px; }
.hg-content ul, .hg-content ol { padding-left: 1.3em; }
.hg-content li { margin-bottom: .4em; }
.is-style-disclaimer, .hg-disclaimer { font-size: .9rem; color: var(--hg-muted); border-left: 3px solid var(--hg-warm); padding: 8px 14px; background: var(--hg-warm-soft); border-radius: 0 8px 8px 0; }
.hg-updated { font-size: .82rem; color: var(--hg-muted); margin-top: 32px; }

/* таблицы */
.wp-block-table { margin: 0 0 1.5em; overflow-x: auto; border: 1px solid var(--hg-line); border-radius: 10px; }
.wp-block-table table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: .92rem; }
.wp-block-table th, .wp-block-table td { text-align: left; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--hg-line); vertical-align: top; }
.wp-block-table thead th, .wp-block-table thead td { background: var(--hg-sunk); font-size: .82rem; font-weight: 600; }
.wp-block-table tbody tr:last-child td { border-bottom: 0; }
.wp-block-table td strong { color: var(--hg-accent-text); }

/* pills */
.hg-pills { list-style: none; padding: 0 !important; margin: 0 0 22px; display: flex; flex-wrap: wrap; gap: 6px; }
.hg-pills li { font-size: .8rem; padding: 3px 12px; border-radius: 99px; background: var(--hg-accent-soft); color: var(--hg-accent-text); font-weight: 500; margin: 0; }

/* cards */
.hg-cards { margin: 8px 0 28px; }
.hg-cards h2 { font-size: 1.15rem; margin-top: 1.2em; }
.hg-cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.hg-card { display: grid; gap: 2px; padding: 14px 16px; border: 1px solid var(--hg-line); border-radius: 10px; background: var(--hg-surface); text-decoration: none; color: var(--hg-ink); transition: border-color .15s; }
.hg-card:hover { border-color: var(--hg-accent); color: var(--hg-ink); }
.hg-card b { font-family: var(--hg-display); font-weight: 600; }
.hg-card span { font-size: .85rem; color: var(--hg-muted); }
.hg-children .hg-cards-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.hg-sitemap ul { list-style: none; padding-left: 0; }
.hg-sitemap ul ul { padding-left: 18px; border-left: 1px solid var(--hg-line); margin: 4px 0 10px; }

/* faq */
.hg-faq { margin-top: 8px; }
.hg-faq details { border-bottom: 1px solid var(--hg-line); padding-block: 12px; max-width: var(--hg-text); }
.hg-faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.hg-faq summary::-webkit-details-marker { display: none; }
.hg-faq summary::after { content: '+'; font-family: var(--hg-mono); color: var(--hg-muted); }
.hg-faq details[open] summary::after { content: '–'; }
.hg-faq .hg-faq-a { margin-top: 8px; color: var(--hg-muted); }
.hg-faq .hg-faq-a p:last-child { margin-bottom: 0; }

/* home */
.hg-home-hero { padding-block: 24px 8px; }
.hg-home-hero h1 { font-size: clamp(2.2rem, 6vw, 3.4rem); max-width: 820px; }

/* ---------- player ---------- */
.hg-player { margin: 8px 0 32px; background: radial-gradient(600px 300px at 0% 0%, var(--hg-glow), transparent 70%), var(--hg-surface); border: 1px solid var(--hg-line); border-radius: 18px; padding: 24px; }
.hg-player-inner { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 24px; align-items: center; }
@media (max-width: 640px) { .hg-player { padding: 18px; } .hg-player-inner { grid-template-columns: 1fr; justify-items: stretch; } .hg-play { justify-self: start; } }
.hg-play { width: 104px; height: 104px; border-radius: 50%; border: 0; background: linear-gradient(135deg, var(--hg-accent), var(--hg-accent-2)); color: #fff; display: grid; place-items: center; font-size: 2rem; cursor: pointer; box-shadow: 0 0 0 8px rgba(139, 118, 255, .18); transition: box-shadow .3s; }
.hg-play[aria-pressed="true"] { box-shadow: 0 0 0 14px rgba(139, 118, 255, .12); }
.hg-play svg { width: 34px; height: 34px; fill: currentColor; }
.hg-ctl { display: grid; gap: 16px; min-width: 0; }
.hg-now { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px; }
.hg-now b { font-family: var(--hg-display); font-size: 1.25rem; }
.hg-now span { font-family: var(--hg-mono); font-size: .78rem; color: var(--hg-muted); }
.hg-sliders { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px 22px; }
.hg-sl { display: grid; gap: 2px; font-size: .86rem; }
.hg-sl label { display: flex; justify-content: space-between; color: var(--hg-muted); }
.hg-sl output { font-family: var(--hg-mono); font-size: .78rem; }
.hg-player input[type=range] { width: 100%; accent-color: var(--hg-accent); min-height: 28px; }
.hg-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.hg-row > .hg-lbl { font-size: .78rem; color: var(--hg-muted); margin-right: 4px; }
.hg-chip { border: 1px solid var(--hg-line); background: transparent; color: var(--hg-ink); border-radius: 99px; padding: 6px 14px; font-size: .85rem; cursor: pointer; text-decoration: none; line-height: 1.3; font-family: inherit; min-height: 34px; }
.hg-chip:hover { border-color: var(--hg-accent); color: var(--hg-ink); }
.hg-chip[aria-pressed="true"] { background: var(--hg-ink); color: var(--hg-bg); border-color: var(--hg-ink); }
.hg-chip.is-primary { background: linear-gradient(135deg, var(--hg-accent), var(--hg-accent-2)); border-color: transparent; color: #fff; }
.hg-field { display: grid; gap: 4px; font-size: .8rem; color: var(--hg-muted); }
.hg-player input[type=number], .hg-player select { font: inherit; font-size: .95rem; background: var(--hg-sunk); color: var(--hg-ink); border: 1px solid var(--hg-line); border-radius: 8px; padding: 6px 10px; min-height: 36px; }
.hg-fields { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.hg-readout { font-family: var(--hg-mono); font-size: .85rem; color: var(--hg-muted); }
.hg-clock { font-family: var(--hg-mono); font-variant-numeric: tabular-nums; font-size: clamp(2.4rem, 8vw, 3.4rem); font-weight: 500; line-height: 1; letter-spacing: -0.02em; }
.hg-bar { height: 4px; background: var(--hg-sunk); border-radius: 2px; overflow: hidden; }
.hg-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--hg-accent), var(--hg-accent-text)); transition: width .3s linear; }
.hg-note { font-size: .82rem; color: var(--hg-muted); }
.hg-bells { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.hg-bell { border: 1px solid var(--hg-line); background: var(--hg-warm-soft); color: var(--hg-ink); border-radius: 12px; padding: 16px 8px; display: grid; gap: 2px; justify-items: center; cursor: pointer; font-family: inherit; }
.hg-bell:hover, .hg-bell.is-ringing { border-color: var(--hg-warm); }
.hg-bell b { font-family: var(--hg-display); font-size: 1rem; }
.hg-bell span { font-family: var(--hg-mono); font-size: .72rem; color: var(--hg-muted); }
.hg-blackout { position: fixed; inset: 0; background: #000; color: #555; z-index: 9999; display: grid; place-items: center; font: .85rem var(--hg-mono); cursor: pointer; text-align: center; padding: 24px; }
.hg-blackout[hidden] { display: none; }
.hg-noscript { color: var(--hg-muted); }

/* ---------- footer ---------- */
.hg-footer { border-top: 1px solid var(--hg-line); background: var(--hg-sunk); font-size: .88rem; color: var(--hg-muted); }
.hg-footer .hg-wrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 24px; padding-block: 32px; }
.hg-footer h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--hg-ink); margin: 0 0 10px; }
.hg-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.hg-footer a { color: var(--hg-muted); text-decoration: none; }
.hg-footer a:hover { color: var(--hg-ink); }
.hg-footer-bottom { border-top: 1px solid var(--hg-line); }
.hg-footer-bottom .hg-wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding-block: 16px; }

/* 404 / search */
.hg-404 { padding-block: 48px; max-width: 640px; }
.search-form { display: flex; gap: 8px; margin-top: 16px; }
.search-form input[type=search] { flex: 1; min-width: 0; font: inherit; background: var(--hg-surface); color: var(--hg-ink); border: 1px solid var(--hg-line); border-radius: 8px; padding: 8px 12px; }
.search-form button, .search-submit { font: inherit; background: var(--hg-accent); color: #fff; border: 0; border-radius: 8px; padding: 8px 16px; cursor: pointer; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
