/* Fabiris — editorial redesign (loads after the base theme) */

:root {
  --tif-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --tif-ink: #111111;
  --tif-bg: #f8f8f8;
  --tif-line: #e6e6e6;
  --tif-muted: #6b7280;
  --tif-soft: #9ca3af;
  --tif-chip: #ececec;
  --tif-dark: #0e0e0f;
  /* Перебиваем акценты старых тем (синий FP / красный batfang) */
  --fp-blue: var(--tif-ink);
  --fp-blue-dark: #000;
  --fp-blue-soft: #ececec;
  --red: var(--tif-ink);
  --red-h: #333;
  --cta: var(--tif-ink);
  --cta-h: #333;
}

body {
  background: var(--tif-bg);
  color: var(--tif-ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.container {
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
  width: 100%;
  box-sizing: border-box;
}
body .site-header.fp-header .container {
  padding-left: 24px;
  padding-right: 24px;
}
.tif-sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; margin: -1px; padding: 0; border: 0;
}

/* ───────── Header ───────── */
body .site-header.fp-header {
  background: var(--tif-dark);
  border-bottom: 0;
  box-shadow: none;
}
body .fp-header-main { border-bottom: 0; }
body .fp-header-main-inner { min-height: 72px; gap: 28px; }

body .fp-logo-text {
  font-family: var(--tif-serif);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #fff;
  line-height: 1.15;
}
body .fp-logo { color: #fff; }

body .fp-nav { display: flex; justify-content: center; }
body .fp-nav ul { gap: 2px; width: max-content; margin: 0 auto; }
body .fp-nav a {
  color: rgba(255, 255, 255, .72);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 999px;
}
body .fp-nav a:hover,
body .fp-nav a.is-active { color: #fff; background: rgba(255, 255, 255, .1); }

body .fp-header-tools { gap: 12px; }

.tif-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 210px;
  height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  background: #26262a;
  color: #a1a1aa;
  border: 1px solid transparent;
  transition: border-color .15s, background .15s;
}
.tif-search:focus-within { border-color: rgba(255, 255, 255, .35); background: #2e2e33; }
.tif-search button {
  display: flex; align-items: center; justify-content: center;
  background: none; border: 0; padding: 0; color: inherit; cursor: pointer;
}
.tif-search input {
  flex: 1; min-width: 0; border: 0; outline: 0;
  background: transparent; color: #fff; font-size: 14px; padding: 0;
}
.tif-search input::placeholder { color: #a1a1aa; }

body .fp-header-tools .btn-login {
  background: none;
  border: 0;
  color: rgba(255, 255, 255, .85);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 6px;
}
body .fp-header-tools .btn-login:hover { color: #fff; background: none; }
body .fp-header-tools .btn-subscribe {
  background: #fff;
  color: var(--tif-ink);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 22px;
}
body .fp-header-tools .btn-subscribe:hover { background: #e5e5e5; }
body .fp-header .user-btn { color: #fff; }

/* Кнопки и акценты (модалки, куки, поиск, paywall) */
.btn-primary,
.btn-cookie-accept,
.sub-cta-btn,
.paywall-btn-main,
.btn-search-submit,
.footer-newsletter-btn {
  background: var(--tif-ink) !important;
  color: #fff !important;
  border-radius: 999px;
}
.btn-primary:hover,
.btn-cookie-accept:hover,
.sub-cta-btn:hover,
.paywall-btn-main:hover,
.btn-search-submit:hover,
.footer-newsletter-btn:hover {
  background: #333 !important;
}
.btn-secondary {
  border-color: var(--tif-line);
  color: var(--tif-ink);
  border-radius: 999px;
}
.btn-secondary:hover { background: var(--tif-chip); }
.cookie-banner { border-top-color: rgba(255, 255, 255, .15); background: var(--tif-dark); }
.btn-cookie-settings {
  background: transparent;
  border-color: rgba(255, 255, 255, .35);
  color: #fff;
  border-radius: 999px;
}
.btn-cookie-settings:hover { background: rgba(255, 255, 255, .08); }
.toggle input:checked ~ .slider { background: var(--tif-ink); }
.auth-modal-logo rect { fill: var(--tif-ink) !important; }
.sub-signin-link,
.auth-switch-btn { color: var(--tif-ink) !important; }
.sub-signin-link:hover,
.auth-switch-btn:hover { color: #333 !important; }
.sub-star-badge { color: var(--tif-ink); }
.breadcrumbs a:hover,
.article-body a { color: var(--tif-ink); }
.page-btn.active,
.page-btn-active,
.page-btn.page-btn-active { background: var(--tif-ink); border-color: var(--tif-ink); }

/* ───────── Category tags (neutral) ───────── */
.category-tag, .category-tag.cat-label, .fp-tag {
  background: none !important;
  color: var(--tif-muted) !important;
  padding: 0;
  border-radius: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
}

/* ───────── Home ───────── */
.tif-home { padding: 28px 0 72px; }

.tif-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
  align-items: stretch;
}

.tif-hero {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  min-height: 500px;
  background: #1a1a1c;
  isolation: isolate;
}
.tif-slide {
  position: absolute; inset: 0;
  opacity: 0; visibility: hidden;
  transition: opacity .6s ease, visibility .6s;
}
.tif-slide.is-active { opacity: 1; visibility: visible; z-index: 1; }
.tif-slide-img { position: absolute; inset: 0; display: block; }
.tif-slide-img picture,
.tif-slide-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tif-slide-shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(8, 8, 10, .9) 0%, rgba(8, 8, 10, .66) 38%, rgba(8, 8, 10, .08) 78%),
    linear-gradient(0deg, rgba(0, 0, 0, .42), transparent 38%);
  pointer-events: none;
}
.tif-slide-body {
  position: absolute; top: 0; bottom: 0; left: 0;
  max-width: 660px;
  padding: 56px 60px 56px 56px;
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
  color: #fff;
}
.tif-slide-cat {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: 12px; font-weight: 600; letter-spacing: .16em; color: #fff;
  margin-bottom: 20px;
}
.tif-slide-cat::before { content: ''; width: 30px; height: 1px; background: rgba(255, 255, 255, .8); }
.tif-slide-body h2 {
  font-family: var(--tif-serif);
  font-size: clamp(28px, 3.1vw, 44px);
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 18px;
}
.tif-slide-body h2 a { color: #fff; }
.tif-slide-body p {
  font-size: 15.5px; line-height: 1.6;
  color: rgba(255, 255, 255, .82);
  margin: 0 0 26px;
  max-width: 520px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.tif-pill-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255, 255, 255, .94); color: var(--tif-ink);
  font-size: 14px; font-weight: 600;
  padding: 12px 22px; border-radius: 999px;
  transition: background .15s, transform .15s;
}
.tif-pill-btn:hover { background: #fff; transform: translateX(2px); }
.tif-slide-meta { margin-top: 22px; font-size: 12.5px; color: rgba(255, 255, 255, .7); }
.tif-slide-meta i, .tif-card-foot i { font-style: normal; margin: 0 4px; }

.tif-hero-nav {
  position: absolute; right: 22px; bottom: 22px; z-index: 3;
  display: flex; gap: 10px;
}
.tif-hero-nav button {
  width: 42px; height: 42px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255, 255, 255, .45);
  background: rgba(10, 10, 12, .4);
  backdrop-filter: blur(6px);
  color: #fff; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.tif-hero-nav button:hover { background: rgba(255, 255, 255, .22); border-color: #fff; }

.tif-most {
  background: #fff;
  border: 1px solid var(--tif-line);
  border-radius: 18px;
  padding: 26px 24px 12px;
  display: flex; flex-direction: column;
}
.tif-most-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.tif-most-head h2 { font-family: var(--tif-serif); font-size: 26px; font-weight: 700; margin: 0; }
.tif-most-head a { font-size: 13px; color: var(--tif-muted); }
.tif-most-head a:hover { color: var(--tif-ink); }
.tif-most ol { list-style: none; margin: 0; padding: 0; flex: 1; display: flex; flex-direction: column; justify-content: space-between; }
.tif-most li {
  display: grid; grid-template-columns: 22px 68px minmax(0, 1fr);
  gap: 12px; align-items: center;
  padding: 13px 0; border-top: 1px solid var(--tif-line);
}
.tif-most li:first-child { border-top: 0; }
.tif-most-num { font-size: 12px; font-weight: 600; color: var(--tif-soft); }
.tif-most-thumb { display: block; width: 68px; height: 58px; border-radius: 9px; overflow: hidden; background: #e5e7eb; }
.tif-most-thumb picture,
.tif-most-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tif-most-text a {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  font-size: 13.5px; font-weight: 700; line-height: 1.3; color: var(--tif-ink);
}
.tif-most-text a:hover { text-decoration: underline; text-underline-offset: 3px; }
.tif-most-text span { display: block; margin-top: 5px; font-size: 12px; color: var(--tif-soft); }

/* Filter pills */
.tif-filters { display: flex; flex-wrap: wrap; gap: 10px; margin: 36px 0 52px; }
.tif-filters a {
  padding: 10px 20px; border-radius: 999px;
  background: var(--tif-chip); color: var(--tif-ink);
  font-size: 14px; font-weight: 500;
  transition: background .15s, color .15s;
}
.tif-filters a:hover { background: #dedede; }
.tif-filters a.is-active { background: var(--tif-ink); color: #fff; }

/* Section heading */
.tif-section-head { margin-bottom: 30px; position: relative; scroll-margin-top: 90px; }
.tif-eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .16em; color: var(--tif-muted); }
.tif-section-head h2 {
  font-family: var(--tif-serif);
  font-size: clamp(32px, 4vw, 48px); font-weight: 700; line-height: 1.1;
  letter-spacing: -0.01em; margin: 8px 0 10px;
}
.tif-section-head p { font-size: 16px; color: var(--tif-muted); margin: 0; }
.tif-page-note { position: absolute; right: 0; bottom: 6px; font-size: 13px; color: var(--tif-soft); }

/* Feed + sticky skyscraper beside the article grid */
.tif-feed-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 28px;
  align-items: start;
}
.tif-feed-main { min-width: 0; }
.tif-feed-ad { position: sticky; top: 24px; }

/* Cards */
.tif-feed-main .tif-grid,
.tif-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 40px 24px;
}
.tif-feed-main .tif-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tif-card { display: flex; flex-direction: column; min-width: 0; }
.tif-card-img {
  display: block; aspect-ratio: 4 / 3;
  border-radius: 14px; overflow: hidden; background: #e5e7eb;
}
.tif-card-img picture,
.tif-card-img img {
  display: block; width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s ease;
}
.tif-card:hover .tif-card-img img { transform: scale(1.045); }
.tif-card-body { display: flex; flex-direction: column; flex: 1; padding: 16px 2px 0; }
.tif-card-cat { font-size: 11px; font-weight: 700; letter-spacing: .12em; color: var(--tif-muted); align-self: flex-start; }
.tif-card-cat:hover { color: var(--tif-ink); }
.tif-card-title {
  font-family: var(--tif-serif);
  font-size: 20px; line-height: 1.25; font-weight: 700; letter-spacing: -0.005em;
  margin: 9px 0 10px;
}
.tif-card-title a { color: var(--tif-ink); }
.tif-card-title a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.tif-card-excerpt {
  font-size: 14px; line-height: 1.55; color: #555; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tif-card-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: auto; padding-top: 16px;
  font-size: 12.5px; color: var(--tif-soft);
}
.tif-bookmark {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; margin-right: -6px;
  background: none; border: 0; border-radius: 50%; color: var(--tif-soft); cursor: pointer;
  transition: color .15s, background .15s;
}
.tif-bookmark:hover { color: var(--tif-ink); background: #ececec; }
.tif-bookmark.is-saved { color: var(--tif-ink); }
.tif-bookmark.is-saved svg { fill: currentColor; }

/* Pagination */
.tif-pagination { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 56px; }
.tif-page {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 42px; height: 42px; padding: 0 16px; border-radius: 999px;
  background: #fff; border: 1px solid var(--tif-line);
  font-size: 14px; font-weight: 500; color: var(--tif-ink);
  transition: border-color .15s;
}
.tif-page:hover { border-color: var(--tif-ink); }
.tif-page.is-active { background: var(--tif-ink); border-color: var(--tif-ink); color: #fff; }

/* ───────── Category / search pages ───────── */
.category-hero {
  background: var(--tif-bg);
  border-bottom: 0;
  padding: 52px 0 6px;
}
.category-hero .category-tag { display: none; }
.category-hero h1 {
  font-family: var(--tif-serif);
  font-size: clamp(36px, 5vw, 56px); font-weight: 700; letter-spacing: -0.01em;
  color: var(--tif-ink); margin-bottom: 10px;
}
.category-hero p { font-size: 17px; color: var(--tif-muted); max-width: 640px; }
.articles-list { padding-top: 0; padding-bottom: 72px; }
.category-filters { margin-top: 28px; }
.search-results-page { padding: 40px 0 72px; }
.search-page-title { font-family: var(--tif-serif); font-size: 40px; }

/* ───────── Article page ───────── */
.article-title {
  font-family: var(--tif-serif);
  font-weight: 700; letter-spacing: -0.01em;
}
.article-body h2,
.article-body h3 { font-family: var(--tif-serif); font-weight: 700; letter-spacing: -0.005em; }
.article-featured-img img,
.article-featured-img picture { border-radius: 16px; }
.article-featured-img { border-radius: 16px; overflow: hidden; }

/* ───────── Footer ───────── */
.site-footer {
  background: var(--tif-dark);
  color: #d4d4d8;
  border-top: 0;
  margin-top: 24px;
}
.tif-footer-logo {
  font-family: var(--tif-serif); font-size: 22px; font-weight: 600;
  color: #fff; letter-spacing: -0.01em;
}
.site-footer .footer-brand p,
.site-footer .footer-legal,
.site-footer .footer-legal-contact a,
.site-footer .footer-col a,
.site-footer .footer-bottom p,
.site-footer .footer-bottom p a,
.site-footer .footer-links a { color: #a1a1aa; }
.site-footer .footer-legal-name,
.site-footer .footer-legal-name strong { color: #e4e4e7; }
.site-footer .footer-col h4 { color: #71717a; }
.site-footer .footer-col a:hover,
.site-footer .footer-legal-contact a:hover,
.site-footer .footer-bottom p a:hover,
.site-footer .footer-links a:hover { color: #fff; }
.site-footer .footer-disclaimer {
  margin: 0 0 28px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid #3f3f46;
  border-radius: 8px;
}
.site-footer .footer-disclaimer-title {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #e4e4e7;
}
.site-footer .footer-disclaimer-text {
  margin: 0;
  font-size: 11px;
  line-height: 1.65;
  color: #a1a1aa;
}
.site-footer .footer-bottom { border-top: 1px solid #27272a; padding-top: 18px; }
.site-footer .footer-newsletter-btn { background: #fff; color: var(--tif-ink); border-radius: 999px; }
.site-footer .footer-newsletter-btn:hover { background: #e5e5e5; }

/* ───────── Responsive ───────── */
@media (max-width: 1240px) {
  body .fp-logo-text { font-size: 19px; }
  body .fp-header-main-inner { gap: 16px; }
  .tif-search { width: 150px; }
  body .fp-nav a { padding: 8px 10px; }
}
@media (max-width: 1180px) {
  .tif-top { grid-template-columns: minmax(0, 1fr) 320px; }
  .tif-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tif-feed-main .tif-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tif-slide-body { padding: 44px 40px; }
}
@media (max-width: 1024px) {
  .tif-feed-wrap { grid-template-columns: 1fr; }
  .tif-feed-ad { display: none; }
  .tif-feed-main .tif-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1060px) {
  .tif-search { width: 120px; }
}
@media (max-width: 960px) {
  .tif-search { display: none; }
  body .site-header.fp-header { display: block !important; }
  body .fp-nav { display: none !important; }
  body .site-header.fp-header .container {
    padding-left: 18px;
    padding-right: 18px;
  }
  body .fp-header-main-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 56px;
    padding: 10px 0;
  }
  body .fp-logo { flex: 1 1 auto; min-width: 0; padding-right: 4px; }
  body .fp-logo-text {
    display: block;
    font-size: clamp(16px, 4.5vw, 19px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body .fp-header-tools { flex: 0 0 auto; gap: 4px; }
  body .fp-search-toggle,
  body .fp-header .btn-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    color: #fff;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 10px;
  }
  body .fp-search-toggle:hover { background: rgba(255, 255, 255, .1); color: #fff; }
  body .fp-header .btn-menu-toggle span { background: #fff; width: 18px; }
  body .fp-header .mobile-menu {
    background: var(--tif-dark);
    border-top: 1px solid rgba(255, 255, 255, .1);
  }
  body .fp-header .mobile-menu a { color: rgba(255, 255, 255, .85); }
  body .fp-header .mobile-menu a:hover { color: #fff; }
  body .fp-header .mobile-divider { background: rgba(255, 255, 255, .12); }
  body .fp-mobile-search:not([hidden]) {
    background: var(--tif-dark);
    border-bottom: 1px solid rgba(255, 255, 255, .1);
  }
  body .fp-mobile-search .fp-search-form {
    background: #26262a;
    border-color: rgba(255, 255, 255, .12);
  }
  body .fp-mobile-search .fp-search-form input { color: #fff; }
  body .fp-mobile-search .fp-search-form button {
    background: #fff;
    color: var(--tif-ink);
  }
  body .fp-mobile-search .fp-search-form button:hover { background: #e5e5e5; }
  .tif-top { grid-template-columns: 1fr; }
  .tif-hero { min-height: 460px; }
}
@media (max-width: 820px) {
  .tif-grid,
  .tif-feed-main .tif-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 18px; }
}
@media (max-width: 768px) {
  .tif-filters { flex-wrap: nowrap; overflow-x: auto; margin: 26px -16px 36px; padding: 0 16px 4px; scrollbar-width: none; }
  .tif-filters::-webkit-scrollbar { display: none; }
  .tif-filters a { white-space: nowrap; }
  .fp-bottom-nav { background: #fff; }
  .fp-bottom-nav a.is-active,
  .fp-bottom-nav a:hover,
  .fp-bottom-nav button:hover { color: var(--tif-ink); }
}
@media (max-width: 560px) {
  .tif-home { padding-top: 16px; }
  .tif-hero { min-height: 480px; border-radius: 14px; }
  .tif-slide-shade {
    background: linear-gradient(0deg, rgba(8, 8, 10, .92) 0%, rgba(8, 8, 10, .6) 55%, rgba(8, 8, 10, .1) 100%);
  }
  .tif-slide-body { justify-content: flex-end; padding: 28px 22px 76px; max-width: none; right: 0; }
  .tif-slide-body p { -webkit-line-clamp: 2; font-size: 14.5px; margin-bottom: 20px; }
  .tif-hero-nav { right: 16px; bottom: 16px; }
  .tif-most { padding: 22px 18px 6px; border-radius: 14px; }
  .tif-grid,
  .tif-feed-main .tif-grid { grid-template-columns: 1fr; }
  .tif-card-title { font-size: 21px; }
}
@media (prefers-reduced-motion: reduce) {
  .tif-slide, .tif-card-img img { transition: none; }
}
