/* Шрифт Tilda Sans (ParaType) — из папки темы, без внешних запросов. */
@font-face { font-family: "Tilda Sans"; src: url("../fonts/TildaSans-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Tilda Sans"; src: url("../fonts/TildaSans-Medium.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Tilda Sans"; src: url("../fonts/TildaSans-Semibold.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Tilda Sans"; src: url("../fonts/TildaSans-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Tilda Sans"; src: url("../fonts/TildaSans-ExtraBold.woff2") format("woff2"); font-weight: 800; font-style: normal; font-display: swap; }

/* ForkAgro — тема. Системные шрифты, без внешних запросов. */

:root {
  --ft-accent: #f5a524;
  --ft-on-accent: #14100a;
  --ft-width: 1200px;
  --ft-text-width: 760px;
  --ft-bg: #ffffff;
  --ft-bg-2: #f3f4f6;
  --ft-panel: #ffffff;
  --ft-line: #e3e6ea;
  --ft-text: #16191d;
  --ft-muted: #5f6873;
  --ft-link: #8a5600;
  --ft-radius: 12px;
  --ft-mono: "Tilda Sans", "Segoe UI", Roboto, system-ui, -apple-system, Arial, sans-serif;
  --ft-sans: "Tilda Sans", "Segoe UI", Roboto, system-ui, -apple-system, Arial, sans-serif;
  color-scheme: light;
}
/* Тёмная схема: по системе посетителя или принудительно из настроек. */
@media (prefers-color-scheme: dark) {
  :root:not([data-scheme="light"]) {
    --ft-bg: #0b0d10; --ft-bg-2: #12151a; --ft-panel: #12151a; --ft-line: #232831;
    --ft-text: #e6e8eb; --ft-muted: #8b929c; --ft-link: var(--ft-accent); color-scheme: dark;
  }
}
:root[data-scheme="dark"] {
  --ft-bg: #0b0d10; --ft-bg-2: #12151a; --ft-panel: #12151a; --ft-line: #232831;
  --ft-text: #e6e8eb; --ft-muted: #8b929c; --ft-link: var(--ft-accent); color-scheme: dark;
}

/* ---------- Основа ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ft-bg); color: var(--ft-text);
  font: 19px/1.6 var(--ft-sans); -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column; min-height: 100vh;
}
img, svg, video, iframe { max-width: 100%; height: auto; }
a { color: var(--ft-link); text-underline-offset: 3px; }
a:hover { color: var(--ft-text); }
:focus-visible { outline: 2px solid var(--ft-accent); outline-offset: 2px; }
h1, h2, h3, h4 { line-height: 1.2; margin: 1.6em 0 .6em; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--ft-line); margin: 2em 0; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
.ft-skip:focus { clip: auto; width: auto; height: auto; z-index: 100; top: 8px; left: 8px; background: var(--ft-panel); padding: 8px 12px; border-radius: 8px; }
.ft-muted { color: var(--ft-muted); }
.ft-wrap { width: min(var(--ft-width), 100% - 40px); margin-inline: auto; }
.ft-wrap--text { width: min(var(--ft-text-width), 100% - 40px); }
.ft-section { padding-block: 56px; }
.ft-main { flex: 1; }
.ft-eyebrow { font: 700 14px/1 var(--ft-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ft-accent); margin: 0 0 14px; }
.ft-link { font: 600 16px var(--ft-mono); text-decoration: none; }

/* ---------- Кнопки, поля ---------- */
.ft-btn, .wp-element-button, .wp-block-button__link {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 10px; border: 1px solid var(--ft-line);
  background: var(--ft-panel); color: var(--ft-text); font: 600 17px/1.2 var(--ft-sans);
  text-decoration: none; cursor: pointer; transition: border-color .15s, filter .15s; white-space: nowrap;
}
.ft-btn:hover { border-color: var(--ft-accent); color: var(--ft-text); }
.ft-btn--primary, .wp-block-button__link:not(.has-background) { background: var(--ft-accent); border-color: var(--ft-accent); color: var(--ft-on-accent); }
.ft-btn--primary:hover { filter: brightness(1.07); color: var(--ft-on-accent); }
.ft-btn--sm { padding: 8px 14px; font-size: 16px; }
.ft-btn--lg { padding: 14px 26px; font-size: 18px; }
.ft-input, input[type="text"], input[type="email"], input[type="url"], input[type="password"], input[type="search"], textarea, select {
  font: 18px var(--ft-sans); color: var(--ft-text); background: var(--ft-panel);
  border: 1px solid var(--ft-line); border-radius: 10px; padding: 10px 12px; max-width: 100%;
}
.ft-search { display: flex; gap: 8px; margin: 16px 0; max-width: 520px; }
.ft-search .ft-input { flex: 1; }

/* ---------- Шапка ---------- */
.ft-header { background: var(--ft-bg); border-bottom: 1px solid var(--ft-line); z-index: 50; }
.ft-sticky .ft-header { position: sticky; top: 0; backdrop-filter: saturate(1.4) blur(8px); background: color-mix(in srgb, var(--ft-bg) 88%, transparent); }
.ft-sticky .admin-bar .ft-header { top: 32px; }
@media (max-width: 782px) { .ft-sticky .admin-bar .ft-header { top: 46px; } }
@media (max-width: 600px) { .ft-sticky .admin-bar .ft-header { top: 0; } }
.ft-header__in { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.ft-brand { font: 800 17px/1 var(--ft-mono); letter-spacing: .26em; color: var(--ft-accent); text-decoration: none; white-space: nowrap; margin-right: auto; }
.ft-brand:hover { color: var(--ft-accent); }
.ft-brand--logo img { display: block; max-height: 40px; width: auto; }
.ft-nav-desktop { order: 2; }
.ft-nav { display: none; }
.ft-header__actions { order: 3; }
.ft-menu, .ft-menu ul { list-style: none; margin: 0; padding: 0; }
.ft-menu { display: flex; gap: 4px; }
.ft-menu > li { position: relative; }
.ft-menu a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--ft-text); text-decoration: none; font-size: 17px; }
.ft-menu a:hover { background: var(--ft-bg-2); }
.ft-menu .current-menu-item > a, .ft-menu .current-menu-ancestor > a { color: var(--ft-accent); }
.ft-menu .sub-menu {
  position: absolute; left: 0; top: 100%; min-width: 220px; padding: 6px; display: none;
  background: var(--ft-panel); border: 1px solid var(--ft-line); border-radius: 10px; box-shadow: 0 12px 30px rgba(0, 0, 0, .12);
}
.ft-menu li:hover > .sub-menu, .ft-menu li:focus-within > .sub-menu { display: block; }
/* Меню на телефоне — <details>, без JavaScript. Под 900px wp_nav_menu() внутри него раскрывается кнопкой. */
@media (max-width: 900px) {
  .ft-nav-desktop { display: none; }
  .ft-nav { display: block; order: 4; }
  .ft-nav__toggle { display: grid; gap: 5px; place-content: center; width: 42px; height: 42px; border: 1px solid var(--ft-line); border-radius: 10px; cursor: pointer; list-style: none; }
  .ft-nav__toggle::-webkit-details-marker { display: none; }
  .ft-nav__toggle span { display: block; width: 18px; height: 2px; background: var(--ft-text); border-radius: 2px; transition: transform .2s, opacity .2s; }
  .ft-nav[open] .ft-nav__toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .ft-nav[open] .ft-nav__toggle span:nth-child(2) { opacity: 0; }
  .ft-nav[open] .ft-nav__toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .ft-nav__panel {
    position: absolute; left: 0; right: 0; top: 100%; display: grid; gap: 16px; padding: 16px 20px 24px;
    background: var(--ft-bg); border-bottom: 1px solid var(--ft-line); box-shadow: 0 20px 30px rgba(0, 0, 0, .12);
  }
  .ft-header { position: relative; }
  .ft-sticky .ft-header { position: sticky; }
  .ft-menu { flex-direction: column; }
  .ft-menu a { padding: 12px; font-size: 17px; }
  .ft-menu .sub-menu { position: static; display: block; border: 0; box-shadow: none; padding: 0 0 0 12px; background: none; }
  .ft-nav__actions { display: block; }
  .ft-nav__actions .ft-btn { width: 100%; }
  .ft-header__actions { display: none; }
  .ft-nav:not([open]) ~ .ft-header__actions { display: block; }
}
@media (max-width: 420px) { .ft-nav:not([open]) ~ .ft-header__actions { display: none; } }

/* ---------- Главная ---------- */
.ft-hero { border-bottom: 1px solid var(--ft-line); background:
  radial-gradient(1200px 400px at 85% -10%, color-mix(in srgb, var(--ft-accent) 16%, transparent), transparent 70%),
  linear-gradient(180deg, var(--ft-bg-2), var(--ft-bg)); }
.ft-hero__in { padding-block: clamp(56px, 10vw, 120px); max-width: var(--ft-width); }
.ft-hero__title { font: 800 clamp(34px, 6vw, 64px)/1.05 var(--ft-sans); letter-spacing: -.025em; margin: 0 0 20px; max-width: 16ch; }
.ft-hero__text { font-size: clamp(17px, 2vw, 21px); color: var(--ft-muted); max-width: 46ch; margin-bottom: 32px; }
.ft-hero__actions { display: flex; gap: 12px; flex-wrap: wrap; }
.ft-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1px; background: var(--ft-line); border: 1px solid var(--ft-line); border-radius: var(--ft-radius); overflow: hidden; }
.ft-feature { background: var(--ft-panel); padding: 28px; }
.ft-feature__num { font: 700 14px var(--ft-mono); color: var(--ft-accent); letter-spacing: .14em; }
.ft-feature__title { font-size: 22px; margin: 10px 0 8px; }
.ft-feature p { margin: 0; font-size: 17px; }
.ft-section__head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 24px; }
.ft-section__title { margin: 0; font-size: 32px; }

/* ---------- Карточки записей ---------- */
.ft-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.ft-card { background: var(--ft-panel); border: 1px solid var(--ft-line); border-radius: var(--ft-radius); overflow: hidden; display: flex; flex-direction: column; transition: border-color .15s, transform .15s; }
.ft-card:hover { border-color: color-mix(in srgb, var(--ft-accent) 55%, var(--ft-line)); transform: translateY(-2px); }
.ft-card__media img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.ft-card__body { padding: 20px 22px 24px; }
.ft-card__title { font-size: 22px; margin: 6px 0 10px; }
.ft-card__title a { color: var(--ft-text); text-decoration: none; }
.ft-card__title a:hover { color: var(--ft-link); }
.ft-card__excerpt { color: var(--ft-muted); font-size: 17px; }
.ft-meta { font: 15px var(--ft-mono); color: var(--ft-muted); margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.ft-meta__cat { color: var(--ft-accent); text-decoration: none; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.ft-meta__sep { opacity: .5; }
.ft-archive__head { margin-bottom: 32px; }
.ft-archive__title { margin: 0 0 8px; font-size: clamp(30px, 4vw, 44px); }
.ft-pagination { margin-top: 40px; }
.ft-pagination .nav-links { display: flex; gap: 6px; flex-wrap: wrap; }
.ft-pagination .page-numbers { min-width: 42px; height: 42px; display: grid; place-items: center; padding: 0 12px; border: 1px solid var(--ft-line); border-radius: 10px; text-decoration: none; color: var(--ft-text); }
.ft-pagination .current { background: var(--ft-accent); border-color: var(--ft-accent); color: var(--ft-on-accent); }

/* ---------- Запись и страница ---------- */
.ft-entry__head { margin-bottom: 28px; }
.ft-entry__title { font-size: clamp(30px, 4.5vw, 48px); margin: 8px 0 0; letter-spacing: -.02em; }
.ft-entry__media { margin: 0 0 32px; }
.ft-entry__media img { border-radius: var(--ft-radius); display: block; width: 100%; }
.ft-content > *:first-child { margin-top: 0; }
.ft-content blockquote { margin: 1.5em 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--ft-accent); color: var(--ft-muted); }
.ft-content table { width: 100%; border-collapse: collapse; font-size: 17px; }
.ft-content th, .ft-content td { border-bottom: 1px solid var(--ft-line); padding: 10px 8px; text-align: left; }
.ft-content pre, .ft-content code { font-family: var(--ft-mono); font-size: .9em; background: var(--ft-bg-2); border-radius: 6px; }
.ft-content code { padding: 2px 6px; }
.ft-content pre { padding: 16px; overflow: auto; }
.ft-content figure { margin: 1.5em 0; }
.ft-content figcaption, .wp-element-caption { font-size: 16px; color: var(--ft-muted); margin-top: 8px; }
.ft-content img { border-radius: 8px; }
.alignwide { width: min(var(--ft-width), 100vw - 40px); margin-inline: calc(50% - min(var(--ft-width), 100vw - 40px) / 2); max-width: none; }
.alignfull { width: 100vw; margin-inline: calc(50% - 50vw); max-width: none; }
.ft-content--wide .alignwide { width: auto; margin-inline: 0; }
.alignleft { float: left; margin: .3em 1.5em 1em 0; }
.alignright { float: right; margin: .3em 0 1em 1.5em; }
.aligncenter { margin-inline: auto; display: block; }
.post-navigation { margin-top: 48px; border-top: 1px solid var(--ft-line); padding-top: 24px; }
.post-navigation .nav-links { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.post-navigation .nav-next { text-align: right; }
.post-navigation a { text-decoration: none; color: var(--ft-text); font-weight: 600; }
.ft-404 { text-align: center; }
.ft-404 .ft-search { margin-inline: auto; }
.ft-404__code { font: 800 96px/1 var(--ft-mono); color: var(--ft-accent); margin: 0; }
.ft-comments { margin-top: 48px; }
.ft-comments__list { padding-left: 0; list-style: none; }
.ft-comments .comment-body { border-bottom: 1px solid var(--ft-line); padding: 16px 0; }

/* ---------- Кабинет и приложения ---------- */
.ft-app-page { width: 100%; padding: 16px; }
.ft-app-page .ft-content { max-width: none; }
.ft-is-app .ft-footer { display: none; }
.ft-blank { min-height: 100vh; }
.ft-blank .ft-app-page { padding: 0; }

/* ---------- Подвал ---------- */
.ft-footer { border-top: 1px solid var(--ft-line); background: var(--ft-bg-2); font-size: 17px; margin-top: 40px; }
.ft-footer__in { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; padding-block: 40px 24px; }
.ft-footer__about .ft-brand { display: inline-block; margin-bottom: 14px; }
.ft-footer__menu { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ft-footer__menu a, .ft-contacts a { color: var(--ft-text); text-decoration: none; }
.ft-footer__menu a:hover, .ft-contacts a:hover { color: var(--ft-link); }
.ft-contacts { font-style: normal; display: grid; gap: 8px; align-content: start; }
.ft-social { display: flex; gap: 14px; }
.ft-footer__bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-block: 16px 28px; border-top: 1px solid var(--ft-line); color: var(--ft-muted); font: 15px var(--ft-mono); }
.ft-footer__bottom a { color: var(--ft-muted); }
@media (max-width: 760px) {
  .ft-footer__in { grid-template-columns: 1fr; }
  .ft-section { padding-block: 40px; }
  body { font-size: 18px; }
  .post-navigation .nav-links { grid-template-columns: 1fr; }
  .post-navigation .nav-next { text-align: left; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print { .ft-header, .ft-footer, .post-navigation, .ft-comments { display: none; } body { background: #fff; color: #000; } }
