/* ============================================================
   ПЕРВЫЙ МЕРИДИАН — весь дизайн в одном файле.
   Основные цвета вынесены в переменные ниже — меняйте их,
   чтобы быстро перекрасить весь сайт.
   ============================================================ */

:root {
  --ink:        #1a1a1a;   /* основной текст */
  --ink-soft:   #555;      /* второстепенный текст */
  --accent:     #a01b1b;   /* фирменный красный (шапка, рубрики, ссылки) */
  --accent-dk:  #7a1414;
  --bg:         #f7f5f1;   /* фон страницы — тёплый газетный */
  --card:       #ffffff;   /* фон карточек */
  --line:       #e3ddd3;   /* линии-разделители */
  --banner-bg:  #efe9df;
  --max:        1120px;    /* ширина контента */
  --serif:      Georgia, "Times New Roman", serif;
  --sans:       "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* ---------- Рекламный баннер ---------- */
.banner {
  background: var(--banner-bg);
  border-bottom: 1px solid var(--line);
  text-align: center;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-soft);
}
.banner a { display: block; padding: 14px 20px; color: var(--ink-soft); }
.banner a:hover { text-decoration: none; color: var(--accent); }

/* ---------- Шапка ---------- */
.masthead {
  background: var(--card);
  border-bottom: 3px solid var(--accent);
  padding: 22px 0 16px;
}
.masthead-inner { display: flex; flex-direction: column; align-items: center; text-align: center; }
.logo {
  font-size: clamp(30px, 6vw, 52px);
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--accent);
  text-transform: uppercase;
  line-height: 1;
}
.logo a { color: inherit; }
.logo a:hover { text-decoration: none; }
.tagline {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 8px;
}
.dateline {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 6px;
}

/* ---------- Навигация по рубрикам ---------- */
.nav {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.nav-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 2px;
}
.nav a {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink);
  padding: 13px 16px;
  border-bottom: 3px solid transparent;
}
.nav a:hover { color: var(--accent); text-decoration: none; border-bottom-color: var(--line); }
.nav a.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- Раскладка: меню слева + контент ---------- */
main { padding: 28px 0 10px; }

.layout { display: grid; grid-template-columns: 210px 1fr; gap: 28px; align-items: start; }
.content { min-width: 0; }

.sidebar { position: sticky; top: 60px; }
.sidemenu {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 2px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sidemenu a {
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  border-left: 3px solid transparent;
}
.sidemenu a:last-child { border-bottom: none; }
.sidemenu a:hover { background: var(--banner-bg); color: var(--accent); text-decoration: none; }
.sidemenu a.active { color: var(--accent); border-left-color: var(--accent); font-weight: 700; }

/* ---------- Контент разделов (гороскоп, зодиак, погода) ---------- */
.section-note { font-family: var(--sans); font-size: 14px; color: var(--ink-soft); margin: 0 0 20px; }

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.tile {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 16px 18px 18px;
}
.tile h3 { margin: 0 0 4px; font-size: 19px; color: var(--accent); }
.tile .tile-sub { font-family: var(--sans); font-size: 12px; color: #999; margin-bottom: 8px; }
.tile p { margin: 0; font-size: 15px; color: var(--ink-soft); }
.weather-tile p { font-style: italic; color: #b0a89c; }

/* ---------- Сонник ---------- */
.dreamlist { margin: 0; }
.dreamlist dt { font-weight: 700; color: var(--accent); font-size: 17px; margin-top: 16px; }
.dreamlist dd { margin: 4px 0 0; font-size: 16px; color: var(--ink-soft); }

/* ---------- Календарь ---------- */
.calendar { background: var(--card); border: 1px solid var(--line); border-radius: 2px; padding: 16px; max-width: 430px; }
.cal-head { font-family: var(--sans); font-weight: 700; text-align: center; margin-bottom: 12px; color: var(--accent); font-size: 17px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { font-family: var(--sans); font-size: 12px; font-weight: 700; color: var(--ink-soft); text-align: center; padding: 4px 0; }
.cal-day { font-family: var(--sans); font-size: 14px; text-align: center; padding: 8px 0; border-radius: 3px; }
.cal-empty { padding: 8px 0; }
.cal-today { background: var(--accent); color: #fff; font-weight: 700; }
.holidays-title { font-size: 18px; margin: 26px 0 10px; }
.holidays { font-family: var(--sans); font-size: 15px; color: var(--ink-soft); line-height: 1.9; padding-left: 18px; }
.holidays .h-date { font-weight: 700; color: var(--ink); }

/* ---------- Сетка статей ---------- */

.section-title {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 6px;
  margin: 10px 0 20px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}

/* Витрина (главная): плотная сетка + бесконечная подгрузка */
.showcase .card.hidden { display: none; }
.more-sentinel {
  grid-column: 1 / -1;
  text-align: center;
  font-family: var(--sans);
  font-size: 13px;
  color: #b0a89c;
  padding: 24px 0;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 2px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow .18s ease, transform .18s ease;
}
.card:hover { box-shadow: 0 6px 22px rgba(0,0,0,.09); transform: translateY(-2px); }

.card-img {
  aspect-ratio: 16 / 9;
  width: 100%;
  object-fit: cover;
  background: #ddd4c7;
  display: block;
}

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

.cat-tag {
  display: inline-block;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--accent);
  margin-bottom: 8px;
}

.card h3 { font-size: 20px; line-height: 1.3; margin: 0 0 10px; }
.card h3 a { color: var(--ink); }
.card h3 a:hover { color: var(--accent); text-decoration: none; }

.card p { font-size: 15px; color: var(--ink-soft); margin: 0 0 14px; flex: 1; }

.card .meta {
  font-family: var(--sans);
  font-size: 12px;
  color: #999;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

/* первая статья рубрики на главной — крупная */
.grid .card.lead-card { grid-column: span 3; flex-direction: row; }
.grid .card.lead-card .card-img { width: 55%; aspect-ratio: auto; min-height: 300px; }
.grid .card.lead-card .card-body { justify-content: center; }
.grid .card.lead-card h3 { font-size: 30px; }
.grid .card.lead-card p { font-size: 17px; }

/* ---------- Страница статьи ---------- */
.article {
  background: var(--card);
  border: 1px solid var(--line);
  max-width: 760px;
  margin: 28px auto;
  padding: 40px clamp(20px, 5vw, 56px) 48px;
}
.article .cat-tag { font-size: 12px; }
.article h1 { font-size: clamp(26px, 5vw, 40px); line-height: 1.2; margin: 6px 0 14px; }
.article .article-meta {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
  margin-bottom: 8px;
}
.article .lead-text { font-size: 20px; line-height: 1.5; color: #333; font-style: italic; margin: 20px 0 24px; }
.article .article-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #ddd4c7;
  margin: 0 0 8px;
  display: block;
}
.article .img-caption { font-family: var(--sans); font-size: 12px; color: #999; margin-bottom: 24px; }
.article p { font-size: 18px; margin: 0 0 20px; }
.article .source-box {
  font-family: var(--sans);
  font-size: 14px;
  background: var(--banner-bg);
  border-left: 3px solid var(--accent);
  padding: 14px 18px;
  margin-top: 30px;
  color: var(--ink-soft);
}
.back-link {
  display: block;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 18px;
}

/* ---------- Подвал ---------- */
footer {
  background: #2a2724;
  color: #cfc8bd;
  margin-top: 40px;
  padding: 34px 0;
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.7;
}
footer .logo-sm { font-weight: 900; letter-spacing: 1px; color: #fff; text-transform: uppercase; margin-bottom: 10px; }
footer a { color: #e8a0a0; }
footer .contacts { color: #e9e2d7; margin-bottom: 10px; font-size: 14px; }
footer .disclaimer { color: #8f8a82; margin-top: 14px; font-style: italic; }

/* ---------- Адаптивность ---------- */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .sidemenu { flex-direction: row; flex-wrap: wrap; }
  .sidemenu a { border-bottom: none; border-left: none; border-top: 3px solid transparent; flex: 1 1 auto; text-align: center; }
  .sidemenu a.active { border-left: none; border-top-color: var(--accent); }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .grid .card.lead-card { grid-column: span 2; flex-direction: column; }
  .grid .card.lead-card .card-img { width: 100%; aspect-ratio: 16/9; min-height: 0; }
  .grid .card.lead-card h3 { font-size: 24px; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 580px) {
  .grid { grid-template-columns: 1fr; }
  .grid .card.lead-card { grid-column: span 1; }
  .tiles { grid-template-columns: 1fr; }
  .nav a { padding: 11px 11px; font-size: 12px; }
  .article { padding: 26px 18px 34px; }
}
