/* =============================================
   KONOPLA.UA — News Portal Styles v3
   ============================================= */

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green-900: #1b4332;
  --green-800: #2d6a4f;
  --green-700: #40916c;
  --green-600: #52b788;
  --green-100: #d8f3dc;
  --green-50: #f0faf3;
  --dark: #1a1a2e;
  --text: #2d2d3a;
  --text-secondary: #6b7280;
  --border: #e5e7eb;
  --bg: #f7f8fa;
  --white: #ffffff;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --radius: 10px;
  --radius-sm: 6px;
  --transition: 0.2s ease;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

a { color: var(--green-800); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--green-700); }

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

/* === HEADER === */
.site-header {
  background: var(--white);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-top {
  border-bottom: 1px solid var(--border);
}

.header-top-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--green-800);
  letter-spacing: -0.5px;
}
.logo:hover { color: var(--green-700); }
.logo-icon { font-size: 1.6rem; }
.logo-dot { color: var(--green-600); }

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tg-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--green-800);
  color: var(--white);
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background var(--transition);
}
.tg-btn:hover { background: var(--green-700); color: var(--white); }
.tg-btn svg { flex-shrink: 0; }

.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 1.2rem;
  cursor: pointer;
}

/* Category nav */
.category-nav {
  border-bottom: 2px solid var(--green-800);
  overflow: hidden;
}

.category-nav-inner {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 0;
}
.category-nav-inner::-webkit-scrollbar { display: none; }

.cat-link {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
}
.cat-link:hover, .cat-link.active {
  color: var(--green-800);
  border-bottom-color: var(--green-800);
}
.cat-emoji { font-size: 0.9rem; }

/* === FEATURED === */
.featured-section {
  margin: 24px 0;
}

.featured-card {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: box-shadow var(--transition);
}
.featured-card:hover { box-shadow: var(--shadow-lg); }

.featured-image-link {
  display: block;
  overflow: hidden;
}
.featured-img {
  width: 100%;
  height: 100%;
  min-height: 320px;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.featured-card:hover .featured-img { transform: scale(1.03); }

.featured-img-placeholder {
  width: 100%;
  height: 100%;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  background: var(--green-50);
}

.featured-body {
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.featured-title {
  font-size: 1.6rem;
  line-height: 1.3;
  margin: 12px 0;
  letter-spacing: -0.3px;
}
.featured-title a { color: var(--dark); }
.featured-title a:hover { color: var(--green-800); }

.featured-summary {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 16px;
}

/* === SECTION TITLES === */
.section-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--green-800);
  display: inline-block;
}

/* === NEWS GRID === */
.news-section { margin-bottom: 40px; }

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}

.news-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}
.news-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.news-card-image-link {
  display: block;
  overflow: hidden;
}
.news-card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.news-card:hover .news-card-img { transform: scale(1.04); }

.news-card-img-placeholder {
  width: 100%;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  background: var(--green-50);
  color: var(--green-600);
}

.news-card-body {
  padding: 16px 20px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-category {
  display: inline-block;
  background: var(--green-100);
  color: var(--green-800);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  width: fit-content;
}
.card-category:hover { background: var(--green-800); color: var(--white); }

.card-title {
  font-size: 1.05rem;
  line-height: 1.4;
  margin: 10px 0 8px;
  font-weight: 700;
}
.card-title a { color: var(--dark); }
.card-title a:hover { color: var(--green-800); }

.card-summary {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.5;
  margin-bottom: 12px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.card-source {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 160px;
}

/* === ARTICLE PAGE === */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 40px;
  padding-top: 30px;
  padding-bottom: 50px;
}

.article { max-width: 100%; }

.article-header { margin-bottom: 24px; }
.article-header h1 {
  font-size: 2rem;
  line-height: 1.25;
  letter-spacing: -0.5px;
  margin: 12px 0 16px;
  color: var(--dark);
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 0.88rem;
}
.meta-sep { color: var(--border); }

.article-figure { margin: 0 0 24px; }
.article-image {
  width: 100%;
  border-radius: var(--radius);
}
.image-credit {
  font-size: 0.72rem;
  color: var(--text-secondary);
  text-align: right;
  margin-top: 6px;
}
.image-credit a { color: var(--text-secondary); text-decoration: underline; }

.article-content {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--text);
}
.article-content p { margin-bottom: 18px; }
.article-content h2, .article-content h3 { margin: 28px 0 14px; color: var(--dark); }
.article-content a { text-decoration: underline; }
.article-content blockquote {
  border-left: 3px solid var(--green-600);
  padding: 12px 20px;
  margin: 20px 0;
  background: var(--green-50);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* Share buttons */
.share-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 28px 0 20px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.share-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.share-btn {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 500;
  background: var(--bg);
  color: var(--text);
  transition: all var(--transition);
}
.share-btn:hover { background: var(--green-100); color: var(--green-800); }

/* Tags */
.tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 16px 0;
}
.tag {
  background: var(--green-50);
  color: var(--green-800);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 500;
}
.tag:hover { background: var(--green-100); }

.original-source {
  margin: 20px 0;
  font-size: 0.88rem;
}

.back-link {
  display: inline-block;
  margin-top: 20px;
  font-weight: 600;
  font-size: 0.9rem;
}

/* === SIDEBAR === */
.sidebar { position: sticky; top: 120px; align-self: start; }

.sidebar-section {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.sidebar-section h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--dark);
}

.related-item {
  display: block;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.related-item:last-child { border-bottom: none; }
.related-item:hover .related-title { color: var(--green-700); }
.related-title {
  display: block;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 4px;
  transition: color var(--transition);
}
.related-item time {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.sidebar-cta {
  background: var(--green-800);
  color: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
}
.cta-emoji { font-size: 2rem; margin-bottom: 8px; }
.sidebar-cta h3 { font-size: 1rem; margin-bottom: 4px; }
.sidebar-cta p { font-size: 0.85rem; opacity: 0.85; margin-bottom: 14px; }
.cta-btn {
  display: inline-block;
  background: var(--white);
  color: var(--green-800);
  padding: 8px 24px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.88rem;
}
.cta-btn:hover { background: var(--green-100); color: var(--green-900); }

/* === AD ZONES === */
.ad-zone {
  margin: 20px 0;
}
.ad-placeholder {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.ad-placeholder a {
  color: var(--green-700);
  font-weight: 600;
}
.ad-zone-sidebar .ad-placeholder {
  padding: 40px 14px;
  flex-direction: column;
}
.ad-zone-infeed {
  grid-column: 1 / -1;
}

/* === LIST / CATEGORY PAGE === */
.list-header {
  padding: 30px 0 20px;
}
.list-header h1 {
  font-size: 1.8rem;
  color: var(--dark);
  letter-spacing: -0.3px;
}
.list-count {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 4px;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  padding: 30px 0 40px;
}
.page-btn {
  padding: 8px 20px;
  border: 1px solid var(--green-800);
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--green-800);
  transition: all var(--transition);
}
.page-btn:hover { background: var(--green-800); color: var(--white); }
.page-info { color: var(--text-secondary); font-size: 0.88rem; }

/* === ABOUT PAGE === */
.about-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 0 60px;
}
.about-page h1 {
  font-size: 2rem;
  color: var(--dark);
  margin-bottom: 24px;
}
.about-content {
  font-size: 1.05rem;
  line-height: 1.8;
}
.about-content h2 {
  font-size: 1.3rem;
  color: var(--dark);
  margin: 32px 0 12px;
}
.about-content p { margin-bottom: 16px; }
.about-content ul { margin: 0 0 16px 24px; }
.about-content li { margin-bottom: 6px; }

/* === EMPTY STATE === */
.empty-state {
  text-align: center;
  padding: 80px 20px;
}
.empty-state h2 { font-size: 1.5rem; color: var(--dark); margin-bottom: 12px; }
.empty-state p { color: var(--text-secondary); margin-bottom: 8px; }

/* === FOOTER === */
.site-footer {
  background: var(--dark);
  color: #b0b3c0;
  padding: 40px 0 24px;
  margin-top: 60px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}

.footer-logo {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 10px;
}
.footer-desc {
  font-size: 0.85rem;
  line-height: 1.6;
  color: #8a8d9e;
}

.site-footer h4 {
  color: var(--white);
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.site-footer ul { list-style: none; }
.site-footer li { margin-bottom: 8px; }
.site-footer li a {
  color: #8a8d9e;
  font-size: 0.85rem;
  transition: color var(--transition);
}
.site-footer li a:hover { color: var(--green-600); }

.footer-ad-note {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #333350;
}
.footer-ad-note a {
  color: var(--green-600);
  font-weight: 600;
  font-size: 0.85rem;
}

.footer-bottom {
  padding-top: 20px;
  border-top: 1px solid #2a2a40;
  text-align: center;
}
.footer-bottom p { font-size: 0.8rem; margin-bottom: 4px; }
.footer-disclaimer { color: #5a5d6e; font-size: 0.72rem; }

/* === RESPONSIVE === */
@media (max-width: 1024px) {
  .article-layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .featured-card {
    grid-template-columns: 1fr;
  }
  .featured-img, .featured-img-placeholder {
    min-height: 200px;
  }
  .featured-body { padding: 20px; }
  .featured-title { font-size: 1.3rem; }
  
  .news-grid {
    grid-template-columns: 1fr;
  }
  
  .article-header h1 { font-size: 1.5rem; }
  
  .sidebar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .tg-btn span { display: none; }
  .menu-toggle { display: block; }
  
  .category-nav {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    border-bottom: none;
  }
  .category-nav.open {
    max-height: 500px;
    border-bottom: 2px solid var(--green-800);
  }
  .category-nav-inner {
    flex-direction: column;
    padding: 8px 0;
  }
  .cat-link {
    padding: 8px 16px;
    border-bottom: none;
  }
  
  .header-top-inner { padding: 10px 0; }
  .logo { font-size: 1.2rem; }
  
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  
  .share-buttons { flex-wrap: wrap; }
  
  .list-header h1 { font-size: 1.4rem; }
}
