/*
Theme Name: BezFiltra
Theme URI: https://bezfiltra.com.ua/
Author: BezFiltra
Author URI: https://bezfiltra.com.ua/
Description: Лёгкая редакционная тема для блога BezFiltra о социальных сетях.
Version: 1.0.0
Requires at least: 6.4
Tested up to: 7.0
Requires PHP: 7.4
Text Domain: bezfiltra
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

:root {
  --bf-ink: #152a48;
  --bf-ink-soft: #536277;
  --bf-blue: #075fbd;
  --bf-blue-dark: #034b98;
  --bf-sky: #eaf4ff;
  --bf-yellow: #ffc928;
  --bf-red: #d9343a;
  --bf-paper: #fffdf8;
  --bf-white: #fff;
  --bf-line: #dce5ef;
  --bf-radius: 22px;
  --bf-shadow: 0 18px 55px rgba(21, 42, 72, .10);
  --bf-wrap: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bf-paper);
  color: var(--bf-ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}
body.menu-open { overflow: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--bf-blue); text-decoration-thickness: .08em; text-underline-offset: .18em; }
a:hover { color: var(--bf-red); }
button, input, textarea, select { font: inherit; }
button, [type="submit"] { cursor: pointer; }
::selection { background: var(--bf-yellow); color: var(--bf-ink); }

.bf-wrap { width: min(calc(100% - 40px), var(--bf-wrap)); margin-inline: auto; }
.bf-skip-link {
  position: fixed; top: 12px; left: 12px; z-index: 9999; transform: translateY(-150%);
  padding: 10px 16px; border-radius: 10px; background: var(--bf-ink); color: #fff;
}
.bf-skip-link:focus { transform: none; }
.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.screen-reader-text:focus { width: auto; height: auto; clip: auto; padding: 10px; margin: 0; }

/* Header */
.bf-site-header {
  position: sticky; top: 0; z-index: 100; border-bottom: 1px solid rgba(7,95,189,.10);
  background: rgba(255,253,248,.94); backdrop-filter: blur(14px);
}
.admin-bar .bf-site-header { top: 32px; }
.bf-header-row { min-height: 82px; display: flex; align-items: center; gap: 30px; }
.bf-brand { flex: 0 0 auto; line-height: 1; }
.bf-brand a { display: inline-flex; align-items: center; gap: 11px; color: var(--bf-ink); text-decoration: none; }
.bf-brand-icon { width: 48px; height: 48px; border-radius: 14px; }
.bf-brand-name { font-size: clamp(24px, 3vw, 33px); font-weight: 900; letter-spacing: -.055em; }
.bf-brand-name span { color: var(--bf-blue); }
.custom-logo { width: auto; max-width: 220px; max-height: 58px; object-fit: contain; }
.bf-nav { margin-left: auto; }
.bf-nav ul { display: flex; align-items: center; gap: 8px; margin: 0; padding: 0; list-style: none; }
.bf-nav a {
  display: block; padding: 10px 12px; color: var(--bf-ink); font-size: 15px; font-weight: 750;
  text-decoration: none; border-radius: 10px;
}
.bf-nav a:hover, .bf-nav .current-menu-item > a, .bf-nav .current_page_item > a { background: var(--bf-sky); color: var(--bf-blue); }
.bf-search-toggle, .bf-menu-toggle {
  width: 44px; height: 44px; flex: 0 0 44px; display: inline-grid; place-items: center;
  border: 1px solid var(--bf-line); border-radius: 13px; background: #fff; color: var(--bf-ink);
}
.bf-search-toggle:hover, .bf-menu-toggle:hover { border-color: var(--bf-blue); color: var(--bf-blue); }
.bf-menu-toggle { display: none; }
.bf-icon { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.bf-search-panel { display: none; padding: 0 0 18px; }
.bf-search-panel.is-open { display: block; }
.bf-search-form { position: relative; display: flex; gap: 10px; max-width: 720px; margin-inline: auto; }
.bf-search-field {
  min-width: 0; flex: 1; padding: 13px 17px; border: 1px solid var(--bf-line); border-radius: 13px;
  background: #fff; color: var(--bf-ink); outline: none;
}
.bf-search-field:focus { border-color: var(--bf-blue); box-shadow: 0 0 0 3px rgba(7,95,189,.12); }

/* Buttons and labels */
.bf-button, .wp-element-button, .wp-block-button__link, .comment-form .submit, .bf-search-submit {
  display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 11px 20px;
  border: 0; border-radius: 13px; background: var(--bf-blue); color: #fff; font-weight: 800;
  text-decoration: none; box-shadow: none; transition: transform .18s ease, background .18s ease;
}
.bf-button:hover, .wp-element-button:hover, .wp-block-button__link:hover, .comment-form .submit:hover, .bf-search-submit:hover {
  transform: translateY(-2px); background: var(--bf-blue-dark); color: #fff;
}
.bf-kicker { margin: 0 0 10px; color: var(--bf-blue); font-size: 13px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.bf-category {
  display: inline-flex; align-items: center; gap: 7px; color: var(--bf-blue); font-size: 12px;
  font-weight: 900; letter-spacing: .06em; text-decoration: none; text-transform: uppercase;
}
.bf-category::before { width: 8px; height: 8px; border-radius: 50%; background: var(--bf-yellow); content: ""; box-shadow: 0 0 0 3px rgba(255,201,40,.22); }
.bf-meta { display: flex; flex-wrap: wrap; gap: 7px 15px; color: var(--bf-ink-soft); font-size: 14px; }
.bf-meta span + span { position: relative; }
.bf-meta span + span::before { position: absolute; left: -9px; color: #a6b2c1; content: "·"; }

/* Homepage */
.bf-hero { position: relative; overflow: hidden; padding: 58px 0 66px; background: var(--bf-sky); }
.bf-hero::before, .bf-hero::after { position: absolute; border-radius: 50%; content: ""; opacity: .9; }
.bf-hero::before { width: 270px; height: 270px; top: -155px; right: 5%; background: var(--bf-yellow); }
.bf-hero::after { width: 160px; height: 160px; bottom: -110px; left: 6%; background: var(--bf-red); }
.bf-hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(360px, .92fr); align-items: center; gap: 54px; }
.bf-hero h1 { max-width: 720px; margin: 0 0 18px; font-size: clamp(42px, 6vw, 78px); line-height: .98; letter-spacing: -.065em; }
.bf-hero h1 em { color: var(--bf-blue); font-style: normal; }
.bf-hero-summary { max-width: 650px; margin: 0 0 25px; color: var(--bf-ink-soft); font-size: clamp(17px, 2vw, 20px); }
.bf-hero-card {
  position: relative; min-height: 430px; overflow: hidden; border-radius: 28px; background: var(--bf-ink); box-shadow: var(--bf-shadow);
}
.bf-hero-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bf-hero-card::after { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 20%, rgba(8,26,49,.92)); content: ""; }
.bf-hero-card-content { position: absolute; right: 0; bottom: 0; left: 0; z-index: 1; padding: 28px; }
.bf-hero-card .bf-category { color: #fff; }
.bf-hero-card h2 { margin: 10px 0 10px; color: #fff; font-size: clamp(27px, 3vw, 38px); line-height: 1.08; letter-spacing: -.035em; }
.bf-hero-card h2 a { color: inherit; text-decoration: none; }
.bf-hero-card .bf-meta { color: rgba(255,255,255,.78); }
.bf-hero-card--plain { display: grid; place-items: center; padding: 35px; background: linear-gradient(145deg, var(--bf-blue), var(--bf-ink)); }
.bf-hero-card--plain::after { display: none; }
.bf-hero-card--plain .bf-brand-icon { width: 150px; height: 150px; }

.bf-topic-strip { border-bottom: 1px solid var(--bf-line); background: #fff; }
.bf-topics { display: flex; gap: 10px; overflow-x: auto; padding: 16px 0; scrollbar-width: none; }
.bf-topics::-webkit-scrollbar { display: none; }
.bf-topics a { flex: 0 0 auto; padding: 8px 13px; border: 1px solid var(--bf-line); border-radius: 999px; color: var(--bf-ink); font-size: 14px; font-weight: 750; text-decoration: none; }
.bf-topics a:hover { border-color: var(--bf-blue); color: var(--bf-blue); }

.bf-section { padding: 64px 0 82px; }
.bf-section-head { display: flex; align-items: end; justify-content: space-between; gap: 25px; margin-bottom: 30px; }
.bf-section-head h2, .bf-archive-head h1 { margin: 0; font-size: clamp(32px, 4vw, 50px); line-height: 1; letter-spacing: -.045em; }
.bf-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.bf-card { min-width: 0; overflow: hidden; border: 1px solid var(--bf-line); border-radius: var(--bf-radius); background: #fff; transition: transform .2s ease, box-shadow .2s ease; }
.bf-card:hover { transform: translateY(-5px); box-shadow: var(--bf-shadow); }
.bf-card-media { display: block; overflow: hidden; aspect-ratio: 16/10; background: var(--bf-sky); }
.bf-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.bf-card:hover .bf-card-media img { transform: scale(1.025); }
.bf-card-placeholder { width: 100%; height: 100%; display: grid; place-items: center; background: linear-gradient(140deg, var(--bf-sky), #fff5cc); }
.bf-card-placeholder img { width: 82px; height: 82px; object-fit: contain; }
.bf-card-body { padding: 21px 22px 24px; }
.bf-card h2, .bf-card h3 { margin: 10px 0 12px; font-size: clamp(21px, 2.4vw, 27px); line-height: 1.14; letter-spacing: -.025em; }
.bf-card h2 a, .bf-card h3 a { color: var(--bf-ink); text-decoration: none; }
.bf-card h2 a:hover, .bf-card h3 a:hover { color: var(--bf-blue); }
.bf-card-excerpt { margin: 15px 0 0; color: var(--bf-ink-soft); font-size: 15px; line-height: 1.55; }

/* Archives, search and pagination */
.bf-page-main { min-height: 60vh; padding: 54px 0 80px; }
.bf-archive-head { max-width: 790px; margin-bottom: 36px; }
.bf-archive-head p { margin: 14px 0 0; color: var(--bf-ink-soft); }
.navigation.pagination { margin-top: 40px; }
.nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.page-numbers { min-width: 42px; min-height: 42px; display: inline-grid; place-items: center; padding: 8px 13px; border: 1px solid var(--bf-line); border-radius: 11px; background: #fff; color: var(--bf-ink); font-weight: 800; text-decoration: none; }
.page-numbers.current, .page-numbers:hover { border-color: var(--bf-blue); background: var(--bf-blue); color: #fff; }

/* Single article */
.bf-article { padding: 52px 0 86px; }
.bf-article-head { max-width: 900px; margin: 0 auto 34px; text-align: center; }
.bf-article-head h1 { margin: 14px 0 18px; font-size: clamp(38px, 6vw, 68px); line-height: 1.03; letter-spacing: -.055em; }
.bf-article-head .bf-meta { justify-content: center; }
.bf-article-cover { max-width: 1080px; margin: 0 auto 42px; overflow: hidden; border-radius: 28px; box-shadow: var(--bf-shadow); }
.bf-article-cover img { width: 100%; max-height: 680px; object-fit: cover; }
.bf-article-layout { display: grid; grid-template-columns: minmax(0, 750px) 280px; justify-content: center; gap: 56px; }
.bf-content { min-width: 0; font-family: Georgia, "Times New Roman", serif; font-size: 19px; line-height: 1.78; }
.bf-content > *:first-child { margin-top: 0; }
.bf-content h2, .bf-content h3, .bf-content h4 { margin: 1.5em 0 .55em; font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; line-height: 1.16; letter-spacing: -.03em; }
.bf-content h2 { font-size: clamp(29px, 4vw, 39px); }
.bf-content h3 { font-size: clamp(24px, 3vw, 31px); }
.bf-content p, .bf-content ul, .bf-content ol { margin: 0 0 1.3em; }
.bf-content a { overflow-wrap: anywhere; }
.bf-content blockquote { margin: 2em 0; padding: 22px 26px; border-left: 5px solid var(--bf-yellow); border-radius: 0 16px 16px 0; background: #fff8d9; font-size: 1.08em; }
.bf-content figure { max-width: 100%; margin: 2em 0; }
.bf-content figcaption { margin-top: 8px; color: var(--bf-ink-soft); font-size: 13px; text-align: center; }
.bf-content table { width: 100%; display: block; overflow-x: auto; border-collapse: collapse; }
.bf-content th, .bf-content td { padding: 10px 12px; border: 1px solid var(--bf-line); text-align: left; }
.bf-content pre { overflow-x: auto; padding: 18px; border-radius: 14px; background: var(--bf-ink); color: #fff; font-size: 14px; }
.alignwide { width: min(900px, calc(100vw - 40px)); max-width: none; margin-left: 50%; transform: translateX(-50%); }
.alignfull { width: 100vw; max-width: none; margin-left: 50%; transform: translateX(-50%); }
.bf-share { position: sticky; top: 120px; align-self: start; padding: 22px; border: 1px solid var(--bf-line); border-radius: 18px; background: #fff; }
.bf-share h2 { margin: 0 0 13px; font-size: 18px; }
.bf-share a { display: block; padding: 8px 0; border-bottom: 1px solid var(--bf-line); color: var(--bf-ink); font-size: 14px; font-weight: 750; text-decoration: none; }
.bf-share a:last-child { border: 0; }
.bf-post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 34px; }
.bf-post-tags a { padding: 7px 11px; border-radius: 999px; background: var(--bf-sky); font-family: Inter, sans-serif; font-size: 13px; font-weight: 800; text-decoration: none; }
.bf-author-box { display: flex; gap: 18px; margin-top: 42px; padding: 24px; border-radius: var(--bf-radius); background: var(--bf-sky); }
.bf-author-box img { width: 72px; height: 72px; flex: 0 0 72px; border-radius: 50%; }
.bf-author-box h2 { margin: 0 0 5px; font-size: 22px; }
.bf-author-box p { margin: 0; color: var(--bf-ink-soft); font-size: 15px; }

/* Pages, comments, utilities */
.bf-page-card { max-width: 820px; margin: 0 auto; }
.bf-page-card > article > h1 { margin: 0 0 30px; font-size: clamp(38px, 6vw, 62px); line-height: 1.05; letter-spacing: -.05em; }
.comments-area { max-width: 750px; margin: 55px auto 0; }
.comments-title { font-size: 28px; }
.comment-list { padding: 0; list-style: none; }
.comment-body { margin: 0 0 15px; padding: 20px; border: 1px solid var(--bf-line); border-radius: 16px; background: #fff; }
.comment-meta { font-size: 14px; }
.comment-form label { display: block; margin-bottom: 5px; font-weight: 800; }
.comment-form input:not([type="checkbox"]), .comment-form textarea { width: 100%; padding: 12px 14px; border: 1px solid var(--bf-line); border-radius: 12px; background: #fff; }
.comment-form input:focus, .comment-form textarea:focus { outline: 3px solid rgba(7,95,189,.12); border-color: var(--bf-blue); }
.bf-empty { max-width: 680px; padding: 45px; border-radius: 24px; background: var(--bf-sky); }
.bf-empty h1, .bf-empty h2 { margin-top: 0; }

/* Footer */
.bf-site-footer { position: relative; overflow: hidden; padding: 58px 0 24px; background: var(--bf-ink); color: rgba(255,255,255,.72); }
.bf-site-footer::after { position: absolute; width: 260px; height: 260px; right: -100px; bottom: -150px; border-radius: 50%; background: var(--bf-yellow); content: ""; }
.bf-footer-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.25fr .75fr; gap: 70px; padding-bottom: 42px; }
.bf-footer-brand { display: inline-flex; align-items: center; gap: 12px; color: #fff; font-size: 31px; font-weight: 900; letter-spacing: -.05em; }
.bf-footer-copy { max-width: 560px; margin: 17px 0 0; }
.bf-footer-nav ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 20px; margin: 0; padding: 0; list-style: none; }
.bf-footer-nav a { color: #fff; font-weight: 750; text-decoration: none; }
.bf-footer-nav a:hover { color: var(--bf-yellow); }
.bf-footer-bottom { position: relative; z-index: 1; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.14); font-size: 13px; }

@media (max-width: 960px) {
  .bf-menu-toggle { display: inline-grid; margin-left: auto; }
  .bf-nav {
    position: fixed; inset: 83px 0 auto; display: none; max-height: calc(100vh - 83px); overflow-y: auto;
    padding: 18px 20px 28px; border-bottom: 1px solid var(--bf-line); background: var(--bf-paper);
  }
  .bf-nav.is-open { display: block; }
  .bf-nav ul { display: block; }
  .bf-nav li { margin-bottom: 4px; }
  .bf-nav a { padding: 12px; font-size: 17px; }
  .bf-hero-grid { grid-template-columns: 1fr; }
  .bf-hero-copy { max-width: 720px; }
  .bf-hero-card { min-height: 390px; }
  .bf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bf-article-layout { grid-template-columns: minmax(0, 750px); }
  .bf-share { position: static; display: flex; flex-wrap: wrap; gap: 8px 20px; }
  .bf-share h2 { width: 100%; }
  .bf-share a { border: 0; }
}

@media (max-width: 782px) { .admin-bar .bf-site-header { top: 46px; } }
@media (max-width: 640px) {
  body { font-size: 16px; }
  .bf-wrap { width: min(calc(100% - 28px), var(--bf-wrap)); }
  .bf-header-row { min-height: 72px; gap: 9px; }
  .bf-brand-icon { width: 41px; height: 41px; }
  .bf-brand-name { font-size: 24px; }
  .bf-nav { top: 73px; }
  .bf-search-toggle, .bf-menu-toggle { width: 41px; height: 41px; flex-basis: 41px; }
  .bf-hero { padding: 42px 0 48px; }
  .bf-hero-grid { gap: 34px; }
  .bf-hero-card { min-height: 345px; }
  .bf-hero-card-content { padding: 22px; }
  .bf-section { padding: 48px 0 62px; }
  .bf-section-head { align-items: start; flex-direction: column; }
  .bf-grid { grid-template-columns: 1fr; }
  .bf-page-main, .bf-article { padding: 38px 0 60px; }
  .bf-article-head { text-align: left; }
  .bf-article-head .bf-meta { justify-content: flex-start; }
  .bf-article-cover { margin-bottom: 30px; border-radius: 18px; }
  .bf-content { font-size: 18px; }
  .bf-author-box { align-items: flex-start; flex-direction: column; }
  .bf-footer-grid { grid-template-columns: 1fr; gap: 35px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

@media print {
  .bf-site-header, .bf-topic-strip, .bf-share, .bf-site-footer, .comments-area { display: none !important; }
  body { background: #fff; color: #000; }
  .bf-article { padding: 0; }
  .bf-article-layout { display: block; }
  .bf-content { max-width: none; }
}
