/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Poppins', sans-serif;
  font-weight: 400;
  line-height: 1.65;
  background-color: #f0f9ff;
  color: #0c4a6e;
  min-height: 100vh;
}

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

a { color: #0891b2; text-decoration: none; transition: color 0.2s; }
a:hover { color: #0e7490; }

ul, ol { list-style: none; }

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  line-height: 1.3;
  color: #0c4a6e;
}
h1 { font-size: 2rem; margin-bottom: 0.75rem; }
h2 { font-size: 1.5rem; margin-bottom: 0.5rem; }
h3 { font-size: 1.2rem; margin-bottom: 0.45rem; }

/* === CONTAINER === */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* === HEADER === */
header {
  background: linear-gradient(135deg, #0c4a6e 0%, #0e7490 50%, #0891b2 100%);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
  position: sticky;
  top: 0;
  z-index: 200;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  gap: 1.5rem;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  flex-shrink: 0;
}

.site-logo img { width: 40px; height: 40px; flex-shrink: 0; }

.site-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  font-family: 'Poppins', sans-serif;
  line-height: 1.2;
}

/* === NAV === */
nav ul {
  display: flex;
  gap: 0.15rem;
  flex-wrap: wrap;
  align-items: center;
}

nav ul li a {
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 0.7rem;
  border-radius: 5px;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
  display: block;
}

nav ul li a:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.burger-btn {
  display: none;
  background: none;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 6px;
  cursor: pointer;
  padding: 0.4rem;
  color: #fff;
  flex-shrink: 0;
  transition: border-color 0.2s;
}

.burger-btn:hover { border-color: #fff; }

/* === PAGE WRAPPER (flexbox layout) === */
.page-wrapper {
  display: flex;
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.75rem 1rem;
  align-items: flex-start;
}

.sidebar {
  width: 29%;
  min-width: 240px;
  flex-shrink: 0;
}

.main-content {
  flex: 1;
  min-width: 0;
}

/* === BREADCRUMBS === */
.breadcrumbs {
  background: #e0f2fe;
  border-bottom: 1px solid #bae6fd;
  padding: 0.55rem 0;
  font-size: 0.8rem;
}

.breadcrumbs .container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
}

.breadcrumbs a { color: #0891b2; font-weight: 600; }
.breadcrumbs a:hover { color: #0e7490; }
.breadcrumbs .sep { color: #7eb8c9; }
.breadcrumbs .current { color: #0c4a6e; font-weight: 600; }

/* === SIDEBAR WIDGETS === */
.widget {
  background: #ffffff;
  border: 1px solid #bae6fd;
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.widget h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0e7490;
  padding-bottom: 0.65rem;
  margin-bottom: 0.75rem;
  border-bottom: 2px solid #bae6fd;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.widget-posts ul li {
  padding: 0.5rem 0;
  border-bottom: 1px solid #f0f9ff;
}

.widget-posts ul li:last-child { border-bottom: none; }

.widget-posts ul li a {
  font-size: 0.83rem;
  color: #0c4a6e;
  font-weight: 600;
  line-height: 1.4;
  display: block;
  transition: color 0.2s;
}

.widget-posts ul li a:hover { color: #0891b2; }

.post-date {
  display: block;
  font-size: 0.72rem;
  color: #7eb8c9;
  margin-top: 0.15rem;
}

.widget-categories ul li { padding: 0.3rem 0; }

.widget-categories ul li a {
  font-size: 0.85rem;
  color: #0891b2;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.2s;
}

.widget-categories ul li a::before { content: '»'; color: #f97316; font-weight: 700; }
.widget-categories ul li a:hover { color: #0e7490; }

/* === TAGS CLOUD (sidebar + article bottom) === */
.tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

a.tag-pill {
  display: inline-block;
  background: #e0f2fe;
  color: #0891b2;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 1px solid #bae6fd;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  text-decoration: none;
}

a.tag-pill:hover {
  background: #0891b2;
  color: #ffffff;
  border-color: #0891b2;
}

/* === ARTICLE TAGS (bottom of article) === */
.article-tags-wrapper {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid #bae6fd;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tags-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #0c4a6e;
  white-space: nowrap;
}

/* === SECTION TITLE === */
.section-title {
  font-size: 1.4rem;
  color: #0e7490;
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid #0891b2;
  font-weight: 700;
}

/* === ARTICLE CARDS (general) === */
.article-card {
  background: #ffffff;
  border: 1px solid #bae6fd;
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.article-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(8, 145, 178, 0.15);
}

.card-image {
  overflow: hidden;
  height: 180px;
  display: block;
  background: #e0f2fe;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s;
}

.article-card:hover .card-image img { transform: scale(1.05); }

.card-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-category {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #ffffff;
  background: #f97316;
  padding: 0.18rem 0.5rem;
  border-radius: 3px;
  margin-bottom: 0.5rem;
}

.card-body h3 {
  font-size: 0.92rem;
  margin-bottom: 0.5rem;
  line-height: 1.4;
  flex: 1;
}

.card-body h3 a { color: #0c4a6e; font-weight: 700; }
.card-body h3 a:hover { color: #0891b2; }

.card-excerpt {
  font-size: 0.78rem;
  color: #4a7a8a;
  margin-bottom: 0.6rem;
  line-height: 1.5;
}

.card-date {
  font-size: 0.72rem;
  color: #7eb8c9;
  font-weight: 600;
}

/* === HOMEPAGE GRID (3 columns) === */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-bottom: 2rem;
}

/* === CATEGORY / CATALOG GRID (2 columns) === */
.category-grid,
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

/* === CATEGORY PAGE HEADER === */
.category-header {
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 3px solid #0891b2;
}

.category-header h1 {
  font-size: 1.75rem;
  color: #0e7490;
}

.category-header p {
  color: #4a7a8a;
  font-size: 0.9rem;
  margin-top: 0.35rem;
}

/* === SINGLE ARTICLE PAGE === */
article.single-article {
  background: #ffffff;
  border: 1px solid #bae6fd;
  border-radius: 10px;
  padding: 2rem;
}

article.single-article h1 {
  font-size: 1.7rem;
  margin-bottom: 0.4rem;
  line-height: 1.3;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.article-date {
  font-size: 0.82rem;
  color: #7eb8c9;
  font-weight: 600;
}

.article-cat-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #fff;
  background: #f97316;
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
}

.article-first-image {
  margin-bottom: 1.75rem;
  border-radius: 8px;
  overflow: hidden;
}

.article-first-image img {
  width: 100%;
  border-radius: 8px;
}

/* === ENTRY CONTENT (article body injected by system) === */
.entry-content h2 {
  font-size: 1.3rem;
  color: #0e7490;
  margin: 1.75rem 0 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 2px solid #bae6fd;
}

.entry-content h3 {
  font-size: 1.1rem;
  color: #0891b2;
  margin: 1.4rem 0 0.5rem;
}

.entry-content p {
  margin-bottom: 1rem;
  color: #0c4a6e;
}

.entry-content ul {
  list-style: disc;
  margin: 0.75rem 0 1rem 1.5rem;
}

.entry-content ol {
  list-style: decimal;
  margin: 0.75rem 0 1rem 1.5rem;
}

.entry-content li {
  margin-bottom: 0.4rem;
  padding-left: 0.25rem;
}

.entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.88rem;
  border-radius: 6px;
  overflow: hidden;
}

.entry-content table th {
  background: #0e7490;
  color: #ffffff;
  padding: 0.7rem 0.85rem;
  text-align: left;
  font-weight: 700;
  font-size: 0.82rem;
}

.entry-content table td {
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid #bae6fd;
  color: #0c4a6e;
}

.entry-content table tbody tr:nth-child(even) { background: #f0f9ff; }
.entry-content table tbody tr:hover { background: #e0f2fe; }

.entry-content blockquote {
  background: #f0f9ff;
  border-left: 4px solid #0891b2;
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  font-style: italic;
  color: #0c4a6e;
  border-radius: 0 6px 6px 0;
  font-size: 0.97rem;
  line-height: 1.7;
}

.entry-content .infobox {
  background: #e0f2fe;
  border: 1px solid #0891b2;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  font-size: 0.92rem;
  position: relative;
  padding-top: 2.25rem;
}

.entry-content .infobox::before {
  content: 'ℹ На заметку';
  position: absolute;
  top: 0.75rem;
  left: 1.25rem;
  font-weight: 700;
  color: #0891b2;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-style: normal;
}

.entry-content .stat-block {
  background: linear-gradient(135deg, #0e7490, #0891b2);
  color: #ffffff;
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
}

.entry-content .stat-block span {
  display: block;
  font-size: 0.82rem;
  font-weight: 400;
  opacity: 0.85;
  margin-top: 0.35rem;
}

.entry-content a { color: #0891b2; text-decoration: underline; }
.entry-content a:hover { color: #0e7490; }

.entry-content img {
  border-radius: 8px;
  margin: 1.25rem 0;
  width: 100%;
}

/* === FOOTER === */
footer {
  background: #0c4a6e;
  color: #bae6fd;
  margin-top: 3rem;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem 0;
}

.footer-read-also h3 {
  color: #ffffff;
  font-size: 1.05rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #0891b2;
}

.footer-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.footer-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  padding: 0.85rem;
}

.footer-card a {
  color: #bae6fd;
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  line-height: 1.45;
  text-decoration: none;
}

.footer-card a::before { content: '→'; color: #f97316; flex-shrink: 0; }
.footer-card a:hover { color: #ffffff; }

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.1rem 1rem;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.footer-bottom p {
  font-size: 0.78rem;
  color: #7eb8c9;
}

.footer-bottom .footer-nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-bottom .footer-nav a {
  font-size: 0.78rem;
  color: #7eb8c9;
  text-decoration: none;
}

.footer-bottom .footer-nav a:hover { color: #bae6fd; }

/* === ABOUT AUTHOR BLOCK (homepage) === */
.author-block {
  background: #ffffff;
  border: 1px solid #bae6fd;
  border-radius: 10px;
  padding: 1.5rem;
  margin-top: 2rem;
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}

.author-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0891b2, #0e7490);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.75rem;
  color: #fff;
  font-weight: 700;
}

.author-info h3 {
  font-size: 1rem;
  color: #0e7490;
  margin-bottom: 0.25rem;
}

.author-info p {
  font-size: 0.83rem;
  color: #4a7a8a;
  line-height: 1.6;
}

/* === TAG PAGE === */
.tag-page-header {
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 3px solid #0891b2;
}

.tag-page-header h1 { font-size: 1.75rem; color: #0e7490; }

/* === RESPONSIVE === */
@media (max-width: 1024px) {
  .site-name { font-size: 1rem; }
  .articles-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .footer-cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  header { position: relative; }

  .header-inner { height: auto; padding: 1rem; flex-wrap: wrap; }

  nav {
    width: 100%;
    order: 3;
    position: relative;
  }

  nav ul {
    display: none;
    flex-direction: column;
    background: #0c4a6e;
    padding: 0.75rem 0;
    border-top: 1px solid rgba(255,255,255,0.15);
    width: 100%;
  }

  nav ul.open { display: flex; }
  nav ul li { width: 100%; }
  nav ul li a { padding: 0.6rem 1rem; border-radius: 0; width: 100%; }

  .burger-btn { display: flex; align-items: center; justify-content: center; }

  .site-logo { order: 1; }
  .burger-btn { order: 2; }

  .page-wrapper { flex-direction: column; gap: 1.5rem; padding: 1rem; }

  .sidebar {
    width: 100%;
    min-width: unset;
    order: 2;
  }

  .main-content { order: 1; }

  .articles-grid { grid-template-columns: 1fr; }

  .category-grid, .catalog-grid { grid-template-columns: 1fr; }

  .footer-cards { grid-template-columns: 1fr; }

  article.single-article { padding: 1.25rem; }

  article.single-article h1 { font-size: 1.4rem; }

  .author-block { flex-direction: column; }

  .section-title { font-size: 1.2rem; }
}

@media (max-width: 480px) {
  h1 { font-size: 1.4rem; }
  .footer-bottom { flex-direction: column; text-align: center; }
}
