/* theme-light.css — светлая тема: новости, товары, видео, "Популярное" */

:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --border: #e6e8ef;
  --text: #1f2430;
  --text-muted: #6b7280;
  --accent: #4c6ef5;
  --accent-hover: #3b5bdb;
  --news-accent: #f08c00;
  --ink: #111318;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(20, 24, 40, 0.06);
  --shadow-hover: 0 8px 24px rgba(20, 24, 40, 0.10);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Segoe UI", Arial, system-ui, -apple-system, sans-serif;
  line-height: 1.55;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header .logo { font-weight: 700; font-size: 1.25rem; color: var(--text); text-decoration: none; }
.site-header nav a { color: var(--text-muted); font-weight: 500; margin-left: 18px; }
.site-header nav a:hover { color: var(--accent); }

.rss-container { max-width: 1100px; margin: 0 auto; padding: 24px 32px 0; }
.rss-container:last-of-type { padding-bottom: 64px; }
.rss-header h1, .rss-header h2 { font-size: 1.5rem; font-weight: 700; margin: 0 0 6px; }
.collection-meta { color: var(--text-muted); font-size: 0.85rem; margin: 0 0 20px; }
.lead-intro { color: var(--text-muted); font-size: 0.95rem; max-width: 720px; margin: 0 0 20px; line-height: 1.6; }

.news-section, .video-section { border-bottom: 1px solid var(--border); padding-bottom: 32px; margin-bottom: 8px; }
.collection-section { padding-top: 32px; }

/* ---------------- Новости ---------------- */
.news-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.news-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column;
  transition: box-shadow .18s ease, transform .18s ease;
}
.news-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); }
.news-image-link { display: block; }
.news-image { width: 100%; height: 130px; object-fit: cover; background: #eef0f5; display: block; }
.news-content { padding: 12px 14px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.news-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.news-source-badge {
  display: inline-block; background: #fff4e6; color: var(--news-accent);
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em;
  padding: 3px 8px; border-radius: 6px;
}
.news-date { font-size: 0.72rem; color: var(--text-muted); }
.news-title { font-size: 0.92rem; font-weight: 600; margin: 0; line-height: 1.35; }
.news-title a { color: var(--text); }
.news-title a:hover { color: var(--accent); }
.news-excerpt { font-size: 0.82rem; color: var(--text-muted); margin: 0; flex: 1; }
.news-readmore { font-size: 0.8rem; font-weight: 600; margin-top: auto; }

.news-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.news-filter-chip {
  display: inline-block; background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 7px 14px; font-size: 0.82rem; font-weight: 500;
  color: var(--text-muted); text-decoration: none; transition: background .15s ease, color .15s ease;
}
.news-filter-chip:hover { color: var(--text); text-decoration: none; }
.news-filter-chip.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------------- Видео ---------------- */
.video-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.video-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column;
  transition: box-shadow .18s ease, transform .18s ease;
}
.video-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); }
.video-card-thumb-link { position: relative; display: block; }
.video-card-image { width: 100%; height: 130px; object-fit: cover; background: #eef0f5; display: block; }
.video-card-duration {
  position: absolute; bottom: 6px; right: 6px; background: rgba(17,19,24,0.85);
  color: #fff; font-size: 0.68rem; font-weight: 600; padding: 2px 6px; border-radius: 4px;
}
.video-card-play {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 40px; height: 40px; border-radius: 50%; background: rgba(17,19,24,0.55);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem; opacity: 0; transition: opacity .15s ease;
}
.video-card-thumb-link:hover .video-card-play { opacity: 1; }
.video-card-body { padding: 10px 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.video-card-title { font-size: 0.88rem; font-weight: 600; margin: 0; line-height: 1.35; }
.video-card-title a { color: var(--text); }
.video-card-title a:hover { color: var(--accent); }
.video-card-date { font-size: 0.72rem; color: var(--text-muted); }

.video-search { display: flex; gap: 8px; margin-bottom: 20px; max-width: 480px; }
.video-search input[type="text"] {
  flex: 1; border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 12px; font-size: 0.88rem; color: var(--text); background: var(--surface);
}
.video-search button {
  background: var(--ink); color: #fff; border: none; border-radius: 8px;
  padding: 9px 16px; font-size: 0.85rem; font-weight: 600; cursor: pointer;
}
.video-search button:hover { opacity: 0.9; }
.video-search-reset { align-self: center; font-size: 0.82rem; color: var(--text-muted); text-decoration: underline; }
.video-search-inline { margin-top: 24px; }

.video-page { max-width: 1100px; margin: 0 auto; padding: 20px 32px 64px; }
.breadcrumbs { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 16px; }
.video-layout { display: grid; grid-template-columns: 1fr 300px; gap: 28px; align-items: start; }
.video-player-wrap { position: relative; width: 100%; padding-top: 56.25%; border-radius: var(--radius); overflow: hidden; background: #000; }
.video-player { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; }
.video-title { font-size: 1.35rem; font-weight: 700; margin: 18px 0 6px; }
.video-meta-line { color: var(--text-muted); font-size: 0.85rem; margin: 0 0 16px; }
.video-description { font-size: 0.92rem; color: var(--text); line-height: 1.6; }
.video-sidebar-title { font-size: 1rem; font-weight: 700; margin: 0 0 14px; }
.video-sidebar-list { display: flex; flex-direction: column; gap: 12px; }
.video-sidebar-item { display: flex; gap: 10px; align-items: flex-start; color: var(--text); }
.video-sidebar-item img { width: 100px; height: 60px; object-fit: cover; border-radius: 8px; background: #eef0f5; flex-shrink: 0; }
.video-sidebar-item-title { font-size: 0.82rem; font-weight: 500; line-height: 1.35; }
.video-sidebar-item:hover .video-sidebar-item-title { color: var(--accent); }

/* ---------------- Товары подборки: фото ВСЕГДА видно целиком ---------------- */
.collection-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.collection-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column;
  transition: box-shadow .18s ease, transform .18s ease;
}
.collection-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); }

/* object-fit: contain — картинка масштабируется целиком, не обрезается;
   пустое место по краям (если пропорции не 4:3) закрывается фоном. */
.collection-card-image {
  width: 100%;
  height: 150px;
  object-fit: contain;
  background: #eef0f5;
  padding: 8px;
  box-sizing: border-box;
  display: block;
}

.collection-card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.collection-card-title { font-size: 0.94rem; font-weight: 600; margin: 0; color: var(--text); line-height: 1.35; }

.collection-details { font-size: 0.84rem; color: var(--text-muted); }
.collection-details summary {
  cursor: pointer; font-weight: 500; color: var(--text-muted); list-style: none;
  padding: 0; display: inline-flex; align-items: center; gap: 4px;
}
.collection-details summary::-webkit-details-marker { display: none; }
.collection-details summary::after { content: "›"; display: inline-block; transition: transform .15s ease; }
.collection-details[open] summary::after { transform: rotate(90deg); }
.collection-details summary:hover { color: var(--text); }

.description-body { margin-top: 8px; }
.description-body p { margin: 0 0 8px; }
.description-body ul, .description-body ol { margin: 0 0 8px; padding-left: 20px; }
.description-body li { margin-bottom: 6px; }
.description-body a { color: var(--text); text-decoration: underline; word-break: break-word; }
.description-body a:hover { color: var(--accent); }
.description-body strong, .description-body b { color: var(--text); }

.btn-buy {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  align-self: stretch; margin-top: auto; background: var(--ink); color: #fff !important;
  padding: 9px 14px; border-radius: 10px; font-weight: 600; font-size: 0.82rem;
  border: none; transition: background .15s ease, opacity .15s ease;
}
.btn-buy:hover { background: #2b2f3a; text-decoration: none; opacity: 0.95; }
.btn-buy:focus-visible { outline: 2px solid var(--text-muted); outline-offset: 2px; }

.collection-nav {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--border);
  font-size: 0.9rem; flex-wrap: wrap; gap: 12px;
}

/* ---------------- Список подборок (/catalog) ---------------- */
.collections-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.collections-list-link {
  display: flex; align-items: center; gap: 14px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px;
  color: var(--text); transition: box-shadow .15s ease;
}
.collections-list-link:hover { box-shadow: var(--shadow-hover); text-decoration: none; }
.collections-list-thumb {
  width: 56px; height: 56px; object-fit: contain; border-radius: 8px;
  background: #eef0f5; padding: 4px; box-sizing: border-box; flex-shrink: 0;
}
.collections-list-text { display: flex; flex-direction: column; gap: 2px; }
.collections-list-date { font-size: 0.78rem; color: var(--text-muted); }
.collections-list-preview { font-size: 0.85rem; color: var(--text-muted); }

/* ---------------- Блок «Популярное» ---------------- */
.popular-section { padding-top: 40px; border-top: 1px solid var(--border); margin-top: 16px; }
.popular-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.popular-item {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 8px;
  transition: box-shadow .15s ease, transform .15s ease;
}
.popular-item:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); text-decoration: none; }
.popular-icon { width: 56px; height: 56px; border-radius: 10px; overflow: hidden; background: #eef0f5; }
.popular-icon img { width: 100%; height: 100%; object-fit: contain; padding: 4px; box-sizing: border-box; display: block; }
.popular-title { font-size: 0.78rem; font-weight: 600; color: var(--text); line-height: 1.25; }

/* ---------------- Пагинация ---------------- */
.pagination-list { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 24px 0; }
.pagination-list li a, .pagination-list li span {
  display: inline-block; padding: 6px 12px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); font-size: 0.85rem;
}
.pagination-list li span { background: var(--ink); color: #fff; border-color: var(--ink); }

.update-info { color: var(--text-muted); font-size: 0.9rem; margin: 20px 0; }
.site-footer { text-align: center; color: var(--text-muted); font-size: 0.82rem; padding: 24px 0 40px; }

@media (max-width: 1000px) {
  .news-grid, .collection-grid, .video-grid { grid-template-columns: repeat(3, 1fr); }
  .popular-grid { grid-template-columns: repeat(4, 1fr); }
  .video-layout { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .site-header { padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
  .rss-container { padding: 16px; }
  .news-grid, .collection-grid, .video-grid { grid-template-columns: repeat(2, 1fr); }
  .popular-grid { grid-template-columns: repeat(3, 1fr); }
  .collection-nav { justify-content: center; text-align: center; }
}

@media (max-width: 420px) {
  .news-grid, .collection-grid, .video-grid, .popular-grid { grid-template-columns: repeat(2, 1fr); }
}
