/* Дополнили общие стили из shared.css специфическими блоками портала */

.hero-subtitle{
  font-size: clamp(20px, 1.7vw, 24px);
  color: var(--text-2);
  max-width: 840px;
  margin-top: 10px;
  margin-bottom: 4px;
}

/* Компактный превью‑список новостей внутри окна портала в hero */
.hero-news-list{
  margin-top: 10px;
  display:flex;
  flex-direction:column;
  gap:8px;
  font-size:12px;
  color:var(--text-2);
}
.hero-news-item-title{
  font-size:13px;
  font-weight:800;
  letter-spacing:-0.01em;
  color:var(--text);
  margin-bottom:2px;
}
.hero-news-item-meta{
  font-size:11px;
  font-weight:700;
  color:var(--text-3);
}

.section{
  padding: 120px 0;
}

.section-header{
  text-align:center;
  margin-bottom: 40px;
}
.section-header .section-tag{
  display:inline-flex;
  align-items:center;
  padding:6px 14px;
  border-radius:999px;
  border:1px solid var(--stroke);
  background:var(--bg-elev-1);
  font-size:12px;
  font-weight:700;
  color:var(--accent);
  margin-bottom:10px;
}
.section-header h2{
  font-size:clamp(32px,3.4vw,48px);
  letter-spacing:-0.03em;
  margin-bottom:8px;
}
.section-header p{
  max-width:760px;
  margin:0 auto;
  color:var(--text-2);
  font-size:16px;
}

.news-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:18px;
}
.news-card{
  border-radius:var(--radius-lg);
  border:1px solid var(--stroke);
  background:linear-gradient(180deg,rgba(255,255,255,0.08),rgba(255,255,255,0.04));
  padding:18px 18px 16px;
  position:relative;
  overflow:hidden;
  transition:transform .18s var(--ease),border-color .18s var(--ease),box-shadow .18s var(--ease);
}
.news-card::before{
  content:"";
  position:absolute;
  inset:-2px;
  background:linear-gradient(135deg,rgba(255,255,255,0.12),transparent 40%,rgba(255,255,255,0.04));
  opacity:0.4;
  pointer-events:none;
  mix-blend-mode:overlay;
}
.news-card > *{ position:relative; z-index:1; }
.news-card:hover{
  transform:translateY(-3px);
  border-color:var(--stroke-strong);
  box-shadow:var(--shadow-soft);
}
.news-meta{
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom:8px;
  font-size:12px;
  color:var(--text-3);
  font-weight:700;
}
.news-category{
  padding:4px 10px;
  border-radius:999px;
  background:rgba(76,195,255,0.18);
  border:1px solid rgba(76,195,255,0.35);
  color:var(--a2);
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:0.06em;
}
.news-card h3{
  font-size:17px;
  margin-bottom:6px;
  letter-spacing:-0.02em;
}
.news-excerpt{
  font-size:14px;
  color:var(--text-2);
  line-height:1.55;
}

.norms-grid{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:18px;
}
.norm-card{
  border-radius:var(--radius-xl);
  border:1px solid var(--stroke);
  background:linear-gradient(180deg,rgba(255,255,255,0.08),rgba(255,255,255,0.04));
  padding:20px 18px 16px;
  position:relative;
  overflow:hidden;
}
.norm-header{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
  margin-bottom:8px;
}
.norm-code{
  font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;
  font-size:12px;
  color:var(--accent);
  font-weight:700;
}
.norm-badge{
  padding:4px 10px;
  border-radius:999px;
  font-size:11px;
  font-weight:700;
  border:1px solid rgba(255,255,255,0.16);
  background:rgba(255,159,10,0.16);
  color:#ffd08a;
}
.norm-badge.critical{
  background:rgba(255,69,58,0.18);
  color:#ffb3ac;
}
.norm-badge.minor{
  background:rgba(123,255,176,0.16);
  color:#b4ffd6;
}
.norm-card h3{
  font-size:17px;
  margin-bottom:6px;
}
.norm-change{
  font-size:14px;
  color:var(--text-2);
  line-height:1.55;
  margin-bottom:10px;
}
.norm-footer{
  display:flex;
  justify-content:space-between;
  align-items:center;
  font-size:12px;
  color:var(--text-3);
  border-top:1px solid var(--stroke);
  padding-top:8px;
  margin-top:4px;
}
.norm-link{
  color:var(--a2);
  text-decoration:none;
  font-weight:700;
  font-size:12px;
}

.knowledge-grid{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:16px;
}
.knowledge-card{
  border-radius:var(--radius-lg);
  border:1px solid var(--stroke);
  background:linear-gradient(180deg,rgba(255,255,255,0.08),rgba(255,255,255,0.04));
  padding:16px;
  text-align:center;
  transition:transform .18s var(--ease),border-color .18s var(--ease),box-shadow .18s var(--ease);
}
.knowledge-card:hover{
  transform:translateY(-3px);
  border-color:var(--stroke-strong);
  box-shadow:var(--shadow-soft);
}
.knowledge-icon{
  width:46px;
  height:46px;
  border-radius:16px;
  margin:0 auto 8px;
  display:grid;
  place-items:center;
  font-size:24px;
  background:linear-gradient(135deg,rgba(124,92,255,0.6),rgba(76,195,255,0.6));
  box-shadow:0 10px 26px rgba(0,0,0,0.35);
}
.knowledge-card h3{
  font-size:15px;
  margin-bottom:4px;
}
.knowledge-count{
  font-size:12px;
  color:var(--text-3);
}

.check-tool{
  border-radius:calc(var(--radius-xl) + 6px);
  border:1px solid var(--stroke);
  background:linear-gradient(135deg,rgba(124,92,255,0.18),rgba(76,195,255,0.12));
  padding:26px 22px;
  box-shadow:var(--shadow-soft);
  display:grid;
  grid-template-columns:1.1fr 0.9fr;
  gap:22px;
  align-items:center;
}
.check-left h2{
  font-size:clamp(28px,3vw,40px);
  letter-spacing:-0.03em;
  margin-bottom:10px;
}
.check-left p{
  font-size:15px;
  color:var(--text-2);
  margin-bottom:14px;
}
.check-features{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:10px;
  margin-bottom:16px;
}
.check-feature{
  display:flex;
  align-items:center;
  gap:8px;
  font-size:13px;
  color:var(--text-2);
}
.check-feature-icon{
  width:20px;
  height:20px;
  border-radius:999px;
  background:rgba(123,255,176,0.20);
  border:1px solid rgba(123,255,176,0.60);
  display:grid;
  place-items:center;
  font-size:12px;
}
.check-right{
  border-radius:var(--radius-lg);
  border:1px solid var(--stroke);
  background:rgba(0,0,0,0.35);
  padding:14px;
  min-height:180px;
}
.check-right pre{
  font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;
  font-size:12px;
  color:var(--text-2);
  white-space:pre-wrap;
  margin:0;
}

footer{
  border-top:1px solid var(--stroke);
  padding:26px 0 40px;
  margin-top:40px;
  font-size:13px;
  color:var(--text-3);
}
.footer-inner{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
}
.footer-links{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
}
.footer-links a{
  color:var(--text-3);
  text-decoration:none;
  font-size:12px;
}

@media (max-width: 980px){
  .news-grid{ grid-template-columns:1fr 1fr; }
  .knowledge-grid{ grid-template-columns:1fr 1fr; }
  .norms-grid{ grid-template-columns:1fr; }
  .check-tool{ grid-template-columns:1fr; }
}
@media (max-width: 720px){
  .news-grid,
  .knowledge-grid{ grid-template-columns:1fr; }
  .section{ padding:90px 0; }
}

/* ===========================
   MOBILE OPTIMIZATION
   Single-column cards, maximized space
   =========================== */
@media (max-width: 768px){
  /* Container: reduce padding for more content space */
  .container{
    padding: 0 12px;
  }

  /* Hero section: compact */
  .hero{
    padding-top: calc(var(--nav-h) + 20px);
  }
  .hero .grid-2{
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .hero-top{
    gap: 12px;
  }
  .hero h1{
    font-size: clamp(28px, 7vw, 40px);
    line-height: 1.1;
  }
  .hero-subtitle{
    font-size: clamp(14px, 3.5vw, 17px);
    margin-bottom: 0;
    line-height: 1.45;
  }
  .pill{
    font-size: 11px;
    padding: 6px 10px;
  }

  /* News portal widget: maximize mobile space */
  #news-portal-widget{
    height: clamp(380px, 65vh, 520px);
    border-radius: var(--radius-lg);
  }
  .news-topbar{
    padding: 8px 10px;
    gap: 6px;
    overflow-x: auto;
    justify-content: flex-start;
    scrollbar-width: none;
  }
  .news-topbar::-webkit-scrollbar{ display:none; }
  .theme-btn{
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 8px 10px;
    font-size: 11px;
    gap: 4px;
  }
  .theme-icon{
    font-size: 12px;
  }
  .news-body{
    padding: 8px;
    gap: 6px;
  }
  .news-list{
    gap: 6px;
    padding-right: 2px;
  }
  .news-item{
    padding: 10px;
    gap: 4px;
    border-radius: var(--radius-md);
  }
  .news-item a{
    font-size: 13px;
    line-height: 1.3;
  }
  .news-item-meta{
    gap: 6px;
    font-size: 11px;
  }
  .news-item .news-source{
    font-size: 9px;
    padding: 2px 5px;
  }
  .news-item .news-time{
    font-size: 9px;
  }
  .news-snippet{
    font-size: 11px;
    line-height: 1.4;
  }
  .news-skeleton{
    height: 48px;
  }

  /* Section styling */
  .section{
    padding: 60px 0;
  }
  .section-header{
    margin-bottom: 24px;
  }
  .section-header .section-tag{
    font-size: 11px;
    padding: 5px 10px;
    margin-bottom: 8px;
  }
  .section-header h2{
    font-size: clamp(24px, 6vw, 32px);
    margin-bottom: 6px;
  }
  .section-header p{
    font-size: 13px;
    line-height: 1.5;
  }

  /* News cards grid - single column */
  .news-grid{
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .news-card{
    padding: 14px;
    border-radius: var(--radius-md);
  }
  .news-meta{
    margin-bottom: 6px;
    font-size: 11px;
    gap: 8px;
  }
  .news-category{
    font-size: 10px;
    padding: 3px 8px;
  }
  .news-card h3{
    font-size: 15px;
    margin-bottom: 4px;
  }
  .news-excerpt{
    font-size: 13px;
    line-height: 1.5;
  }

  /* Norms grid - single column, compact */
  .norms-grid{
    gap: 12px;
  }
  .norm-card{
    padding: 14px;
    border-radius: var(--radius-md);
  }
  .norm-header{
    margin-bottom: 6px;
    gap: 8px;
  }
  .norm-code{
    font-size: 11px;
  }
  .norm-badge{
    font-size: 10px;
    padding: 3px 8px;
  }
  .norm-card h3{
    font-size: 15px;
    margin-bottom: 4px;
  }
  .norm-change{
    font-size: 13px;
    margin-bottom: 8px;
    line-height: 1.5;
  }
  .norm-footer{
    font-size: 11px;
    padding-top: 6px;
    margin-top: 2px;
  }
  .norm-link{
    font-size: 11px;
  }

  /* Knowledge grid - single column */
  .knowledge-grid{
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .knowledge-card{
    padding: 14px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    text-align: left;
    gap: 12px;
  }
  .knowledge-icon{
    width: 40px;
    height: 40px;
    border-radius: 12px;
    font-size: 20px;
    margin: 0;
    flex-shrink: 0;
  }
  .knowledge-card h3{
    font-size: 14px;
    margin-bottom: 2px;
  }
  .knowledge-count{
    font-size: 11px;
  }

  /* Check tool section */
  .check-tool{
    padding: 16px;
    border-radius: var(--radius-lg);
    gap: 16px;
  }
  .check-left h2{
    font-size: clamp(20px, 5vw, 28px);
    margin-bottom: 8px;
  }
  .check-left p{
    font-size: 13px;
    margin-bottom: 12px;
    line-height: 1.5;
  }
  .check-features{
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 12px;
  }
  .check-feature{
    font-size: 12px;
    gap: 6px;
  }
  .check-feature-icon{
    width: 18px;
    height: 18px;
    font-size: 10px;
  }
  .check-right{
    padding: 12px;
    min-height: 140px;
    border-radius: var(--radius-md);
  }
  .check-right pre{
    font-size: 11px;
  }

  /* Stats section - already in shared.css but enhance */
  .stats{
    margin-top: 14px;
    gap: 8px;
  }
  .stat{
    padding: 12px;
    border-radius: var(--radius-md);
  }
  .stat .v{
    font-size: 20px;
    margin-bottom: 2px;
  }
  .stat .l{
    font-size: 11px;
  }

  /* Contact section */
  .contact .actions{
    margin-top: 14px;
    gap: 10px;
  }
  .contact-grid{
    margin-top: 16px;
    gap: 10px;
  }
  .contact-item{
    min-width: auto;
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--radius-md);
  }
  .contact-item b{
    font-size: 11px;
    margin-bottom: 4px;
  }

  /* Footer */
  footer{
    padding: 20px 0 30px;
    margin-top: 30px;
  }
  .footer-inner{
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
  }
  .footer-links{
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
  }
  .footer-links a{
    font-size: 11px;
  }

  /* Nav adjustments */
  .nav{
    top: 8px;
  }
  .nav-inner{
    height: 60px;
    border-radius: 16px;
    padding: 10px 12px;
  }
  .brand{
    gap: 8px;
    font-size: 14px;
  }
  .brand small{
    font-size: 10px;
  }
  .btn{
    padding: 9px 12px;
    font-size: 12px;
  }
  .nav-cta .btn-primary{
    padding: 10px 14px;
    font-size: 13px;
  }
}

/* Extra small screens (iPhone SE, small Android) */
@media (max-width: 380px){
  .container{
    padding: 0 8px;
  }
  .hero h1{
    font-size: 24px;
  }
  .hero-subtitle{
    font-size: 13px;
  }
  #news-portal-widget{
    height: clamp(340px, 60vh, 440px);
  }
  .theme-btn{
    padding: 6px 8px;
    font-size: 10px;
  }
  .theme-btn .theme-icon{
    display: none;
  }
  .news-item a{
    font-size: 12px;
  }
  .section-header h2{
    font-size: 22px;
  }
  .knowledge-card{
    padding: 12px;
    gap: 10px;
  }
  .knowledge-icon{
    width: 36px;
    height: 36px;
    font-size: 18px;
  }
}

/* ===========================
   NEWS PORTAL (optimized)
   =========================== */

/* Live indicator */
.news-live-dot{
  width: 6px; height: 6px; border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e;
  animation: pulse-live 2s ease-in-out infinite;
}
@keyframes pulse-live{
  0%, 100%{ opacity: 1; }
  50%{ opacity: 0.5; }
}

/* News widget - balanced hero height */
#news-portal-widget{
  display: flex;
  flex-direction: column;
  height: clamp(520px, 65vh, 780px);
  min-height: 0;
}
@media (max-width: 980px){
  #news-portal-widget{
    height: clamp(420px, 70vh, 560px);
  }
}

/* Theme buttons in topbar */
.news-topbar{
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  justify-content: center;
}
.theme-btn{
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: -0.01em;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.04);
  color: var(--text-2);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.2s var(--ease);
}
.theme-btn::before{
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 40%,
    rgba(255,255,255,0.15) 50%,
    transparent 60%
  );
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}
.theme-btn:hover::before{
  transform: translateX(100%);
}
.theme-btn:hover{
  background: rgba(255,255,255,0.08);
  border-color: var(--stroke-strong);
  transform: translateY(-1px);
}
.theme-btn.active{
  background: linear-gradient(135deg, rgba(124,92,255,0.3), rgba(76,195,255,0.25));
  border-color: rgba(124,92,255,0.5);
  color: var(--text);
  box-shadow: 0 0 20px rgba(124,92,255,0.2), inset 0 1px 0 rgba(255,255,255,0.1);
}
.theme-btn.active::after{
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.1), transparent);
  pointer-events: none;
}
.theme-icon{
  font-size: 14px;
}
.news-body{
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  overflow: hidden;
  flex: 1 1 auto;
  min-height: 0;
}
.news-status-line{
  font-size: 11px;
  margin-bottom: 4px;
}

/* Category Tabs (compact) */
.news-category-tabs{
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.news-category-tabs::-webkit-scrollbar{ display: none; }
.news-tab{
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 700;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.04);
  color: var(--text-2);
  cursor: pointer;
  transition: background .12s, border-color .12s;
  white-space: nowrap;
}
.news-tab:hover{ background: rgba(255,255,255,0.08); }
.news-tab.active{
  background: linear-gradient(135deg, rgba(124,92,255,0.25), rgba(76,195,255,0.2));
  border-color: rgba(124,92,255,0.4);
  color: var(--text);
}

/* News list */
.news-list{
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  flex: 1 1 auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-right: 4px;
}

/* News Item */
.news-item{
  border-radius: calc(var(--radius-md) + 2px);
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.05);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform .15s var(--ease), border-color .15s var(--ease), background .15s var(--ease);
}
.news-item:hover{
  transform: translateY(-1px);
  border-color: var(--stroke-strong);
  background: rgba(255,255,255,0.07);
}
.news-item a{
  color: var(--text);
  text-decoration: none;
  font-weight: 850;
  font-size: 13px;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.news-item a:focus-visible{
  outline: none;
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--ring) 45%, transparent);
  border-radius: 10px;
}
.news-item-meta{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 750;
}
.news-item .news-source{
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 700;
  border-radius: 4px;
  background: rgba(255,255,255,0.06);
  color: var(--text-3);
}
.news-item .news-category-badge{
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  opacity: 0.85;
}
.news-item .news-time{
  font-size: 10px;
  color: var(--text-3);
  opacity: 0.7;
}
.news-snippet{
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.45;
}

/* News Portal Footer */
.news-portal-footer{
  margin-top: 10px;
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.news-portal-footer a{
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

/* Skeleton loader */
.news-skeleton{
  height: 54px;
  border-radius: calc(var(--radius-md) + 2px);
  border: 1px solid var(--stroke);
  background:
    linear-gradient(90deg,
      rgba(255,255,255,0.04) 0%,
      rgba(255,255,255,0.08) 40%,
      rgba(255,255,255,0.04) 80%);
  background-size: 200% 100%;
  animation: shimmer 1.25s linear infinite;
}
@keyframes shimmer{
  0%{ background-position: 0% 0; }
  100%{ background-position: -200% 0; }
}

/* Error state */
.news-error{
  padding: 16px;
  text-align: center;
  color: var(--text-2);
  font-size: 13px;
}
.news-error-icon{
  font-size: 32px;
  margin-bottom: 8px;
}

/* Fade-in animation */
.news-item.fade-in{
  animation: fadeInUp 0.3s var(--ease) forwards;
}
@keyframes fadeInUp{
  from{ opacity: 0; transform: translateY(8px); }
  to{ opacity: 1; transform: translateY(0); }
}

/* Refresh timer */
.news-refresh-timer{
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Hide Pitch-page button on mobile */
@media (max-width: 980px) {
  .nav-pitch-link {
    display: none !important;
  }
}
