/*
Theme Name: Scribara
Theme URI: https://scribara.com/
Author: Scribara
Author URI: https://scribara.com/
Description: Тема для сайту Scribara — письменницького застосунку. Повторює вигляд лендінгу (палітра zinc + indigo, темна/світла тема), додає новини, FAQ, картки модулів і продаж ліцензійних ключів через WooCommerce.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
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: scribara
Tags: one-column, custom-menu, custom-logo, featured-images, blog, e-commerce, translation-ready
*/

/* ─────────────────────────────────────────────────────────────────────────
   Палітра — синхронна з UI застосунку (zinc + indigo)
   ───────────────────────────────────────────────────────────────────────── */

:root {
  --bg:        #0f0f12;
  --surface:   #18181b;
  --surface-2: #1f1f23;
  --border:    #27272a;
  --border-2:  #3f3f46;
  --text:      #e4e4e7;
  --text-2:    #a1a1aa;
  --muted:     #71717a;
  --brand:     #6366f1;
  --brand-2:   #818cf8;
  --brand-bg:  rgba(99, 102, 241, 0.12);
  --ok:        #34d399;
  --warn:      #fbbf24;
  --shadow:    0 10px 40px rgba(0, 0, 0, 0.45);
}

html[data-theme="light"] {
  --bg:        #f4f4f5;
  --surface:   #ffffff;
  --surface-2: #fafafa;
  --border:    #e4e4e7;
  --border-2:  #d4d4d8;
  --text:      #18181b;
  --text-2:    #52525b;
  --muted:     #71717a;
  --brand:     #4f52d9;
  --brand-2:   #4244ca;
  --brand-bg:  rgba(79, 82, 217, 0.10);
  --ok:        #0e9f6e;
  --warn:      #b45309;
  --shadow:    0 10px 40px rgba(0, 0, 0, 0.10);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.25s, color 0.25s;
}

img { max-width: 100%; height: auto; }

.container { max-width: 1060px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 760px; margin: 0 auto; padding: 0 24px; }

a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }

.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%); white-space: nowrap;
}
.skip-link:focus {
  position: fixed; left: 12px; top: 12px; z-index: 200; width: auto; height: auto;
  clip: auto; clip-path: none; background: var(--brand); color: #fff;
  padding: 10px 16px; border-radius: 10px;
}

/* ── Шапка ───────────────────────────────────────────────────────────── */
header.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; gap: 24px; height: 60px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; color: var(--text); }
.logo img { width: 30px; height: 30px; border-radius: 8px; }
.logo:hover { text-decoration: none; }

.nav-links { display: flex; gap: 20px; margin-left: auto; list-style: none; align-items: center; }
.nav-links li { position: relative; }
.nav-links a { color: var(--text-2); font-size: 14px; font-weight: 500; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-links .current-menu-item > a,
.nav-links .current_page_item > a { color: var(--text); }

/* випадаючі підменю */
.nav-links ul.sub-menu {
  display: none; position: absolute; top: 100%; left: 0; min-width: 190px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 8px; list-style: none; box-shadow: var(--shadow);
}
.nav-links li:hover > ul.sub-menu,
.nav-links li:focus-within > ul.sub-menu { display: block; }
.nav-links ul.sub-menu a { display: block; padding: 7px 10px; border-radius: 8px; }
.nav-links ul.sub-menu a:hover { background: var(--surface-2); }

.nav-controls { display: flex; align-items: center; gap: 10px; }
.lang-switch { display: flex; border: 1px solid var(--border-2); border-radius: 8px; overflow: hidden; }
.lang-switch a { padding: 4px 10px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.lang-switch a.active,
.lang-switch .current-lang > a { background: var(--brand-bg); color: var(--brand-2); }
.lang-switch a:hover { text-decoration: none; color: var(--text); }
.lang-switch ul { display: flex; list-style: none; }

.theme-btn, .menu-toggle, .cart-btn {
  height: 30px; border: 1px solid var(--border-2); border-radius: 8px;
  background: transparent; color: var(--text-2); cursor: pointer; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center; padding: 0 9px;
}
.theme-btn { width: 34px; padding: 0; }
.theme-btn:hover, .menu-toggle:hover, .cart-btn:hover { color: var(--text); border-color: var(--muted); text-decoration: none; }
.cart-btn .cart-count {
  margin-left: 6px; background: var(--brand); color: #fff; border-radius: 999px;
  font-size: 10px; font-weight: 700; padding: 1px 6px; line-height: 1.5;
}
.menu-toggle { display: none; }

/* ── Hero ────────────────────────────────────────────────────────────── */
.hero { padding: 88px 0 64px; text-align: center; }
.badge {
  display: inline-block; padding: 5px 14px; border-radius: 999px;
  background: var(--brand-bg); color: var(--brand-2);
  font-size: 12.5px; font-weight: 600; letter-spacing: 0.04em; margin-bottom: 22px;
}
.hero h1 {
  font-size: clamp(34px, 5.5vw, 56px);
  line-height: 1.12; letter-spacing: -0.02em; font-weight: 800;
  max-width: 780px; margin: 0 auto 20px;
}
.hero h1 em { font-style: normal; color: var(--brand-2); }
.hero p.sub { font-size: 18px; color: var(--text-2); max-width: 640px; margin: 0 auto 34px; }
.cta-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 26px; border-radius: 12px; font-size: 15px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; transition: all 0.15s;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-2); transform: translateY(-1px); color: #fff; }
.btn-ghost { border-color: var(--border-2); color: var(--text-2); background: transparent; }
.btn-ghost:hover { color: var(--text); border-color: var(--muted); }
.btn-sm { padding: 9px 16px; font-size: 13.5px; border-radius: 10px; }
.hero .note { margin-top: 14px; font-size: 12.5px; color: var(--muted); }

/* ── Мокап вікна застосунку (CSS) ───────────────────────────────────── */
.mockup-wrap { margin: 60px auto 0; max-width: 860px; }
.mockup-wrap img.hero-shot { width: 100%; border-radius: 14px; box-shadow: var(--shadow); border: 1px solid var(--border); }
.mockup {
  background: #0f0f12; border: 1px solid #27272a; border-radius: 14px;
  box-shadow: var(--shadow); overflow: hidden; text-align: left;
  font-size: 11px; color: #a1a1aa;
}
html[data-theme="light"] .mockup { border-color: #d4d4d8; }
.mockup .mtitle {
  display: flex; align-items: center; height: 30px; padding: 0 12px;
  background: #0a0a0c; border-bottom: 1px solid #1f1f23;
  color: #71717a; font-size: 10px; letter-spacing: 0.2em; font-weight: 600;
}
.mockup .mdots { margin-left: auto; display: flex; gap: 5px; }
.mockup .mdots i { width: 9px; height: 9px; border-radius: 50%; background: #3f3f46; }
.mockup .mbody { display: flex; min-height: 320px; }
.mockup .mside {
  width: 46px; background: #0a0a0c; border-right: 1px solid #1f1f23;
  display: flex; flex-direction: column; align-items: center; gap: 14px; padding-top: 16px;
  font-size: 14px; color: #52525b;
}
.mockup .mside span.on { color: #818cf8; }
.mockup .mmain { flex: 1; padding: 26px 34px; }
.mockup .mline { height: 9px; border-radius: 4px; background: #27272a; margin-bottom: 11px; }
.mockup .mline.w60 { width: 60%; } .mockup .mline.w85 { width: 85%; }
.mockup .mline.w75 { width: 75%; } .mockup .mline.w40 { width: 40%; }
.mockup .mline.title { height: 15px; width: 45%; background: #3f3f46; margin-bottom: 20px; }
.mockup .mpanel { width: 200px; border-left: 1px solid #1f1f23; background: #131316; padding: 16px 14px; }
.mockup .mtag {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  background: rgba(99,102,241,0.15); color: #818cf8; font-size: 9px; font-weight: 600; margin-bottom: 12px;
}
.mockup .mpline { height: 7px; border-radius: 4px; background: #232327; margin-bottom: 9px; }
.mockup .mpline.w70 { width: 70%; } .mockup .mpline.w50 { width: 50%; }
.mockup .mbtn { margin-top: 14px; height: 24px; border-radius: 8px; background: #6366f1; opacity: 0.9; }

/* ── Секції ──────────────────────────────────────────────────────────── */
section { padding: 72px 0; }
section.alt { background: var(--surface-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.sec-head { text-align: center; max-width: 620px; margin: 0 auto 48px; }
.sec-head h2 { font-size: clamp(26px, 3.5vw, 36px); letter-spacing: -0.01em; margin-bottom: 12px; }
.sec-head p { color: var(--text-2); font-size: 16px; }
.sec-more { text-align: center; margin-top: 34px; }

/* Можливості */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 22px; }
.card .icon {
  width: 40px; height: 40px; border-radius: 11px; background: var(--brand-bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: var(--brand-2); margin-bottom: 14px;
}
.card h3 { font-size: 16px; margin-bottom: 7px; }
.card p { font-size: 13.5px; color: var(--text-2); }

/* Приватність */
.privacy { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 28px; text-align: center; }
.privacy .item h3 { font-size: 16px; margin: 10px 0 6px; }
.privacy .item p { font-size: 13.5px; color: var(--text-2); }
.privacy .big { font-size: 26px; }

/* Модулі */
.mod-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.mod {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 22px;
  display: flex; flex-direction: column;
}
.mod .top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.mod .top .icon {
  width: 36px; height: 36px; border-radius: 10px; background: var(--brand-bg);
  display: flex; align-items: center; justify-content: center; color: var(--brand-2);
  font-size: 16px; flex: none;
}
.mod h3 { font-size: 15.5px; }
.mod h3 a { color: inherit; }
.mod p { font-size: 13px; color: var(--text-2); flex: 1; }
.mod .price { margin-top: 14px; font-weight: 700; font-size: 15px; color: var(--brand-2); }
.mod .price small { color: var(--muted); font-weight: 500; }
.mod .price del { color: var(--muted); font-weight: 500; font-size: 13px; margin-right: 6px; }
.mod .buy-row { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.mod.bundle { border-color: var(--brand); background: var(--brand-bg); }
.mod-flag {
  display: inline-block; margin-left: auto; font-size: 10.5px; font-weight: 700; letter-spacing: .04em;
  padding: 3px 8px; border-radius: 999px; background: var(--brand-bg); color: var(--brand-2);
}

/* Завантаження */
.dl-box {
  max-width: 560px; margin: 0 auto; text-align: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 40px 30px;
}
.dl-box img { width: 68px; height: 68px; border-radius: 16px; margin-bottom: 16px; }
.dl-box h3 { font-size: 22px; margin-bottom: 6px; }
.dl-box .ver { color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.dl-meta { margin-top: 14px; font-size: 12.5px; color: var(--muted); }
.dl-soon { margin-top: 18px; font-size: 13px; color: var(--text-2); }
.dl-warning {
  margin-top: 22px; padding: 12px 16px; border-radius: 12px; text-align: left;
  background: var(--brand-bg); font-size: 12.5px; color: var(--text-2);
}

/* FAQ */
.faq { max-width: 720px; margin: 0 auto; }
.faq details {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px 20px; margin-bottom: 10px;
}
.faq summary { cursor: pointer; font-weight: 600; font-size: 15px; list-style: none; display: flex; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; margin-left: auto; color: var(--muted); font-size: 18px; }
.faq details[open] summary::after { content: "–"; }
.faq details .answer { margin-top: 10px; font-size: 14px; color: var(--text-2); }
.faq details .answer p + p { margin-top: 10px; }

/* ── Новини / блог ───────────────────────────────────────────────────── */
.page-head { padding: 64px 0 8px; text-align: center; }
.page-head h1 { font-size: clamp(30px, 4.5vw, 44px); letter-spacing: -0.02em; margin-bottom: 12px; }
.page-head p.lead { color: var(--text-2); font-size: 16px; max-width: 620px; margin: 0 auto; }

.post-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.post-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  overflow: hidden; display: flex; flex-direction: column;
}
.post-card .thumb { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-2); }
.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-card .body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }
.post-meta { font-size: 12px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.post-meta a { color: var(--muted); }
.post-card h3 { font-size: 17px; margin: 8px 0 8px; line-height: 1.35; }
.post-card h3 a { color: var(--text); }
.post-card p { font-size: 13.5px; color: var(--text-2); flex: 1; }
.post-card .more { margin-top: 14px; font-size: 13.5px; font-weight: 600; }

.entry { max-width: 760px; margin: 0 auto; padding: 56px 24px 24px; }
.entry .entry-head { margin-bottom: 26px; }
.entry h1.entry-title { font-size: clamp(28px, 4vw, 40px); line-height: 1.2; letter-spacing: -0.02em; margin: 10px 0 12px; }
.entry .entry-thumb { border-radius: 16px; overflow: hidden; margin-bottom: 26px; border: 1px solid var(--border); }
.entry-content { font-size: 16.5px; color: var(--text); }
.entry-content > * + * { margin-top: 18px; }
.entry-content h2 { font-size: 25px; margin-top: 34px; letter-spacing: -0.01em; }
.entry-content h3 { font-size: 20px; margin-top: 26px; }
.entry-content p { color: var(--text-2); }
.entry-content ul, .entry-content ol { padding-left: 22px; color: var(--text-2); }
.entry-content li + li { margin-top: 6px; }
.entry-content img, .entry-content .wp-block-image img { border-radius: 14px; }
.entry-content blockquote {
  border-left: 3px solid var(--brand); background: var(--surface); border-radius: 0 12px 12px 0;
  padding: 14px 18px; color: var(--text-2);
}
.entry-content code {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px;
  padding: 1px 6px; font-size: 0.9em;
}
.entry-content pre {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px 18px; overflow-x: auto;
}
.entry-content pre code { background: none; border: none; padding: 0; }
.entry-content table { width: 100%; border-collapse: collapse; font-size: 14px; }
.entry-content th, .entry-content td { border: 1px solid var(--border); padding: 9px 12px; text-align: left; }
.entry-content th { background: var(--surface-2); }
.entry-content hr { border: none; border-top: 1px solid var(--border); }
.entry-footer { margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--border); }
.tag-list { display: flex; gap: 8px; flex-wrap: wrap; }
.tag-list a {
  font-size: 12px; color: var(--text-2); background: var(--surface); border: 1px solid var(--border);
  padding: 4px 11px; border-radius: 999px;
}
.tag-list a:hover { text-decoration: none; border-color: var(--border-2); color: var(--text); }

.post-nav { display: flex; gap: 14px; justify-content: space-between; margin-top: 26px; flex-wrap: wrap; }
.post-nav a {
  flex: 1 1 240px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 14px 18px; color: var(--text); font-size: 14px;
}
.post-nav a:hover { text-decoration: none; border-color: var(--border-2); }
.post-nav span { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 4px; }

.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 40px; flex-wrap: wrap; }
.pagination .page-numbers {
  min-width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center;
  padding: 0 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text-2); font-size: 14px; font-weight: 600;
}
.pagination .page-numbers:hover { text-decoration: none; color: var(--text); border-color: var(--border-2); }
.pagination .page-numbers.current { background: var(--brand); border-color: var(--brand); color: #fff; }

/* Коментарі */
.comments-area { max-width: 760px; margin: 48px auto 0; padding: 0 24px 24px; }
.comments-area h2 { font-size: 20px; margin-bottom: 20px; }
.comment-list { list-style: none; }
.comment-list li { margin-bottom: 14px; }
.comment-list .comment-body {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px;
}
.comment-list .children { list-style: none; margin-left: 26px; margin-top: 14px; }
.comment-meta { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.comment-content { font-size: 14px; color: var(--text-2); }
.comment-content p + p { margin-top: 8px; }
.comment-respond { margin-top: 26px; }
.comment-form label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.comment-form p { margin-bottom: 14px; }

/* Поля форм */
input[type="text"], input[type="email"], input[type="url"], input[type="search"],
input[type="password"], input[type="tel"], input[type="number"], textarea, select {
  width: 100%; background: var(--surface); border: 1px solid var(--border-2); border-radius: 10px;
  padding: 10px 13px; color: var(--text); font: inherit; font-size: 14px;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand); }
input[type="submit"], button[type="submit"], .wp-block-search__button {
  background: var(--brand); color: #fff; border: none; border-radius: 10px;
  padding: 11px 20px; font-weight: 600; font-size: 14px; cursor: pointer; width: auto;
}
input[type="submit"]:hover, button[type="submit"]:hover { background: var(--brand-2); }

.searchform { display: flex; gap: 8px; max-width: 460px; margin: 0 auto; }
.searchform input[type="search"] { flex: 1; }

/* Сторінка 404 / порожній результат */
.empty-state { text-align: center; max-width: 520px; margin: 0 auto; padding: 40px 0 20px; }
.empty-state .big { font-size: 46px; color: var(--brand-2); margin-bottom: 14px; }
.empty-state p { color: var(--text-2); margin-bottom: 22px; }

/* Смуга-CTA */
.cta-strip {
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  padding: 34px 30px; text-align: center;
}
.cta-strip h2 { font-size: clamp(22px, 3vw, 30px); margin-bottom: 10px; }
.cta-strip p { color: var(--text-2); margin-bottom: 22px; }

/* Кроки активації ключа */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 22px; }
.step .num {
  width: 30px; height: 30px; border-radius: 9px; background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; margin-bottom: 12px;
}
.step h3 { font-size: 15.5px; margin-bottom: 6px; }
.step p { font-size: 13.5px; color: var(--text-2); }

/* Підвал */
footer.site-footer { border-top: 1px solid var(--border); padding: 34px 0; }
.foot { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.foot .right { margin-left: auto; display: flex; gap: 18px; flex-wrap: wrap; list-style: none; }
.foot a { color: var(--text-2); }

/* Адмінбар WordPress не має ламати липку шапку */
body.admin-bar header.site-header { top: 32px; }
@media screen and (max-width: 782px) { body.admin-bar header.site-header { top: 46px; } }

@media (max-width: 860px) {
  .menu-toggle { display: inline-flex; }
  .nav-links {
    display: none; position: absolute; top: 60px; left: 0; right: 0;
    flex-direction: column; gap: 0; padding: 10px 24px 16px;
    background: var(--bg); border-bottom: 1px solid var(--border);
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; padding: 11px 0; font-size: 15px; }
  .nav-links ul.sub-menu { position: static; display: block; border: none; box-shadow: none; padding: 0 0 0 14px; background: none; }
}

@media (max-width: 720px) {
  .mockup .mpanel { display: none; }
  section { padding: 52px 0; }
  .hero { padding: 56px 0 44px; }
  .mockup-wrap { margin-top: 40px; }
}
