/**
 * Legal Platform — Custom styles (1:1 для темы WordPress)
 */

:root {
  --lp-banner-h: 0rem;
  --lp-header-h: 3.5rem;
  --color-bg: #fafafa;
  --color-surface: #ffffff;
  --color-text: #1a1a2e;
  --color-text-muted: #64748b;
  --color-border: #e2e8f0;
  --color-primary: #0f172a;
  --color-accent: #1e40af;
  --color-accent-hover: #1d4ed8;
  --header-bg: rgba(255, 255, 255, 0.95);
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --footer-bg: #0f172a;
  --footer-text: #f1f5f9;
  --footer-text-muted: #94a3b8;
  --footer-border: #334155;
}

:root.dark {
  --color-bg: #0f172a;
  --color-surface: #1e293b;
  --color-text: #f1f5f9;
  --color-text-muted: #94a3b8;
  --color-border: #334155;
  --color-primary: #f8fafc;
  --color-accent: #60a5fa;
  --color-accent-hover: #93c5fd;
  --header-bg: rgba(15, 23, 42, 0.95);
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.2);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.2);
  --footer-bg: #0c1222;
  --footer-text: #f1f5f9;
  --footer-text-muted: #94a3b8;
  --footer-border: #334155;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  transition: background-color 0.3s ease, color 0.2s ease;
}

.site-header {
  top: var(--lp-banner-h);
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  transition: top 0.2s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.site-header.scrolled {
  box-shadow: var(--shadow-md);
}

/* Контентная область: авто-отступ сверху с учётом хедера + баннера */
.main-content-pt {
  padding-top: calc(var(--lp-banner-h) + var(--lp-header-h));
  transition: padding-top 0.2s ease;
}

@media (min-width: 768px) {
  :root {
    --lp-header-h: 4rem;
  }
}

.mega-search-panel[aria-hidden="true"] {
  opacity: 0;
  transform: scaleY(0.95);
  pointer-events: none;
}

.mega-search-panel[aria-hidden="false"] {
  opacity: 1;
  transform: scaleY(1);
}

.category-nav-link {
  position: relative;
}

.category-nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2px;
  background: var(--color-accent);
  transform: scaleX(0);
  transition: transform 0.25s ease;
}

.category-nav-link.active::after,
.category-nav-link:hover::after {
  transform: scaleX(1);
}

.article-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.article-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.sidebar-left,
.sidebar-right {
  position: sticky;
  top: 3.5rem;
  align-self: flex-start;
  max-height: calc(100vh - 3.5rem);
}

.tab-link.active {
  border-bottom-color: var(--color-accent) !important;
  color: var(--color-accent) !important;
}

.swiper-button-next,
.swiper-button-prev {
  color: var(--color-text) !important;
}

/* Hide Swiper's default icon pseudo-elements for custom-styled buttons */
.editorial-video-swiper .swiper-button-next::after,
.editorial-video-swiper .swiper-button-prev::after {
  display: none !important;
}

/* Lock carousel thumbnail so images never cause layout shifts.
   display:block overrides .img-placeholder's display:flex so that
   aspect-ratio:16/9 is always respected, even when this is a flex item. */
.lp-video-thumb {
  display: block !important;
  position: relative !important;
  flex-shrink: 0;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  min-width: 140px;
  /* align-self:flex-start prevents the parent flex row from stretching
     the thumbnail taller than its aspect-ratio */
  align-self: flex-start;
}
.lp-video-thumb img {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}
/* Overlay & duration badge are also absolutely placed — keep them that way */
.lp-video-thumb > span {
  position: absolute;
}

.swiper-pagination-bullet {
  background: var(--color-text-muted) !important;
  opacity: 0.6;
}

.swiper-pagination-bullet-active {
  opacity: 1;
  background: var(--color-accent) !important;
}

.modal-overlay {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

html {
  scroll-behavior: smooth;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  flex-shrink: 0;
  animation: pulse-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
  50% { opacity: 0.85; transform: scale(1.1); box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

[x-cloak] {
  display: none !important;
}

.img-placeholder {
  background: linear-gradient(135deg, var(--color-border) 0%, var(--color-surface) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.sidebar-banner {
  background: linear-gradient(145deg, rgba(30, 64, 175, 0.12) 0%, rgba(30, 64, 175, 0.06) 100%);
  border: 2px solid var(--color-accent);
  box-shadow: 0 4px 14px rgba(30, 64, 175, 0.15);
}

.sidebar-banner:hover {
  box-shadow: 0 6px 20px rgba(30, 64, 175, 0.25);
  transform: translateY(-1px);
}

/* Profile button in header — always a perfect circle */
.header-profile-btn {
  width: 2.25rem;       /* 36px = w-9 */
  height: 2.25rem;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.header-profile-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-pro {
  box-shadow: 0 0 0 2px var(--color-surface), 0 0 0 4px #d97706;
}

.badge-pro {
  display: inline-flex;
  align-items: center;
  padding: 0.2em 0.5em;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #b45309;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-radius: 0.375rem;
  border: 1px solid #f59e0b;
}

.sidebar-nav-link-pro .pro-label {
  margin-left: auto;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.15em 0.4em;
  border-radius: 0.25rem;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #b45309;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
