/* ==========================================================================
   Дягиль — main styles (HTML/CSS for WordPress)
   ========================================================================== */

:root {
  --bg: #fffdfa;
  --bg-soft: #efeee9;
  --text: #1a1a1a;
  --text-muted: #8a8a8a;
  --line: #d8d6d0;
  --white: #ffffff;

  --rubric-spec: #A2997F;
  --rubric-fun: #79B997;
  --rubric-people: #8F79B9;
  --rubric-city: #CF6656;
  --logo-color: #101010;

  --sidebar-w: 50px;
  --container: 1300px;
  --gap: 24px;
  --pad-left: 0px;
  --pad-right: 0px;

  --font: "Onest", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-weight: 400;
  font-size: 12px;
  line-height: 1.2;
  color: var(--text);
  background: var(--bg);
}

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
  padding: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

h1,
h2,
h3,
p {
  margin: 0;
}

/* --------------------------------------------------------------------------
   Typography helpers (from Figma)
   -------------------------------------------------------------------------- */

.t-sidebar {
  font-family: var(--font);
  font-weight: 500;
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: uppercase;
  text-align: center;
}

.t-title {
  font-family: var(--font);
  font-weight: 500;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: 0;
  color: #000000;
}

.t-title-sm {
  font-family: var(--font);
  font-weight: 500;
  font-size: 14px;
  line-height: 1.2;
  letter-spacing: 0;
  color: #000000;
}

.t-rubric {
  font-family: var(--font);
  font-weight: 600;
  font-size: 12px;
  line-height: 1.2;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.rubric__tag {
  color: #000000;
}

.t-excerpt {
  font-family: var(--font);
  font-weight: 400;
  font-size: 12px;
  line-height: 1.2;
  letter-spacing: 0;
}

.t-meta {
  font-family: var(--font);
  font-weight: 600;
  font-size: 12px;
  line-height: 1.2;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.t-hero {
  font-family: var(--font);
  font-weight: 500;
  font-style: normal;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: 0;
  color: #000000;
}

.t-logo {
  font-family: var(--font);
  font-weight: 800;
  font-size: 42px;
  line-height: 1;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  font-style: italic;
}

/* --------------------------------------------------------------------------
   Shell / sidebar
   -------------------------------------------------------------------------- */

.page {
  position: relative;
  min-height: 100vh;
  padding-left: var(--sidebar-w);
}

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-w);
  max-width: var(--sidebar-w);
  height: auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  z-index: 20;
  overflow: hidden;
  box-sizing: border-box;
}

.sidebar__item {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  min-height: 0;
  padding: 14px 0;
  box-sizing: border-box;
  color: var(--text);
}

.sidebar__item::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-top-left-radius: 5px;
  pointer-events: none;
  transition: filter 0.2s ease;
}

.sidebar__text {
  position: relative;
  z-index: 1;
  display: inline-block;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.sidebar__item:last-child {
  flex: 1 1 auto;
  justify-content: center;
  align-items: flex-start;
  padding-top: 14px;
}

.sidebar__item:hover::after {
  filter: brightness(0.96);
}

/* фон = цвет блока выше; ::after = свой цвет со скруглением */
.sidebar__item--city {
  background-color: var(--bg);
}

.sidebar__item--city::after {
  background-color: #CF6656;
}

.sidebar__item--people {
  background-color: #CF6656;
}

.sidebar__item--people::after {
  background-color: #8F79B9;
}

.sidebar__item--fun {
  background-color: #8F79B9;
}

.sidebar__item--fun::after {
  background-color: #79B997;
}

.sidebar__item--spec {
  background-color: #79B997;
}

.sidebar__item--spec::after {
  background-color: #A2997F;
}

/* --------------------------------------------------------------------------
   Main column
   -------------------------------------------------------------------------- */

.main {
  width: min(var(--container), 100%);
  max-width: 1300px;
  margin-left: auto;
  margin-right: auto;
  min-width: 0;
}

.container {
  width: 100%;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 30px 0 50px;
}

.header__logo {
  display: inline-flex;
  align-items: center;
}

.header__logo-icon {
  display: block;
  width: 176px;
  height: 75px;
  background-color: var(--logo-color);
  -webkit-mask-image: url("../assets/img/logo.svg");
  mask-image: url("../assets/img/logo.svg");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: left center;
  mask-position: left center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.header__star {
  position: absolute;
  top: 25px;
  right: 0;
  width: 91.34px;
  height: 76.56px;
  opacity: 1;
  color: var(--text);
  flex-shrink: 0;
}

.header__star img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

/* --------------------------------------------------------------------------
   News strip
   -------------------------------------------------------------------------- */

.news {
  padding: 0 0 18px;
}

.news__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 50px;
  margin-bottom: 2px;
  padding: 0 11px;
  background: #F1F0EB;
  border-top-left-radius: 5px;
}

.news__label {
  font-family: var(--font);
  font-weight: 500;
  font-style: normal;
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: uppercase;
  color: #000000;
}

.news__expand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font);
  font-weight: 500;
  font-style: normal;
  font-size: 12px;
  line-height: 1.2;
  letter-spacing: 0;
  text-align: right;
  color: #000000;
  text-decoration: none;
}

.news__expand-icon {
  width: 12px;
  height: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.news__expand-icon img,
.news__expand-icon svg {
  width: 100%;
  height: 100%;
}

.news__list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: center;
  gap: 16px;
  height: 140px;
  margin: 0;
  padding: 0;
  background: #F1F0EB;
  list-style: none;
}

.news-card {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
  height: 140px;
}

.news-card__media {
  width: 140px;
  height: 140px;
  overflow: hidden;
  background: var(--bg-soft);
  flex-shrink: 0;
}

.news-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.news-card__body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 0;
  min-width: 0;
  padding: 5px 0;
  height: 100%;
}

.news-card__title {
  margin: 0;
  color: #000000;
}

.news-card__time {
  font-family: var(--font);
  font-weight: 500;
  font-style: normal;
  font-size: 10px;
  line-height: 1.2;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  vertical-align: middle;
  color: #000000;
  margin-top: auto;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  display: grid;
  grid-template-columns: 806px minmax(0, 1fr);
  gap: 28px;
  padding: 28px 0 36px;
  align-items: start;
}

.hero__media {
  width: 806px;
  max-width: 100%;
  height: 500px;
  overflow: hidden;
  background: var(--bg-soft);
}

.hero__media img,
.hero__media .ph {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__body {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 381px;
  height: 500px;
  min-height: 500px;
  padding-top: 0;
}

.hero__rubric {
  margin-bottom: 18px;
}

.hero__title {
  margin-bottom: 18px;
  color: #000000;
}

.hero__title a {
  color: #000000;
}

.hero__excerpt {
  margin-top: auto;
  font-family: var(--font);
  font-weight: 400;
  font-style: normal;
  font-size: 12px;
  line-height: 1.2;
  letter-spacing: 0;
  vertical-align: bottom;
  color: #000000;
}

.hero__date {
  padding-top: 16px;
  align-self: flex-start;
  color: #000000;
}

/* --------------------------------------------------------------------------
   Articles grid
   -------------------------------------------------------------------------- */

.feed {
  padding: 36px 0 8px;
}

.feed--category {
  padding-top: 0;
}

.feed--page {
  padding-top: 0;
}

.category__head {
  margin-bottom: 50px;
}

.feed--category .feed__row {
  row-gap: 110px;
}

.page-content {
  max-width: 780px;
}

.page-content__body {
  font-family: var(--font);
  font-weight: 400;
  font-size: 18px;
  line-height: 1.4;
  color: #000000;
}

.page-content__body p {
  margin: 0 0 1.2em;
}

.page-content__body h2 {
  margin: 1.6em 0 0.6em;
  font-weight: 500;
  font-size: 22px;
  line-height: 1.2;
}

.page-content__body ul,
.page-content__body ol {
  margin: 0 0 1.2em;
  padding-left: 1.2em;
  list-style: disc;
}

.page-content__body a {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.feed__row {
  display: grid;
  grid-template-columns: repeat(4, 300px);
  justify-content: space-between;
  gap: var(--gap);
  margin-bottom: 110px;
  align-items: start;
}

.feed__row:last-child {
  margin-bottom: 50px;
}

.card {
  display: flex;
  flex-direction: column;
  width: 300px;
  max-width: 100%;
  max-height: 570px;
  min-width: 0;
  overflow: hidden;
}

.card__media {
  width: 100%;
  overflow: hidden;
  background: var(--bg-soft);
  margin-bottom: 14px;
}

.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card__media--sq {
  aspect-ratio: 1 / 1;
}

.card__media--portrait {
  aspect-ratio: 3 / 4;
}

.card__media--wide {
  aspect-ratio: 4 / 3;
}

.card__rubric {
  margin-bottom: 10px;
}

.card__rubric--spec {
  color: var(--rubric-spec);
}

.card__rubric--fun {
  color: var(--rubric-fun);
}

.card__rubric--people {
  color: var(--rubric-people);
}

.card__rubric--city {
  color: var(--rubric-city);
}

.card__title {
  margin-bottom: 10px;
  color: #000000;
}

.card__title a {
  color: #000000;
}

.card__excerpt {
  margin-bottom: 10px;
  color: #3a3a3a;
}

.card__footer {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin-top: auto;
  padding-top: 0;
}

.card__author {
  min-width: 0;
}

.card__date {
  color: #000000;
}

/* Promo tile */
.promo {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #d4c4a8;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: 24px;
  color: var(--text);
}

.promo__star {
  position: absolute;
  inset: 8% 4% auto auto;
  width: min(78%, 240px);
  color: rgba(255, 255, 255, 0.92);
  pointer-events: none;
  filter: brightness(0) invert(1);
}

.promo__star img {
  width: 100%;
  height: auto;
  display: block;
}

.promo__title {
  position: relative;
  z-index: 1;
  font-weight: 700;
  font-size: clamp(28px, 2.6vw, 40px);
  line-height: 1.05;
  text-transform: uppercase;
  max-width: 8ch;
}

/* --------------------------------------------------------------------------
   Subscribe
   -------------------------------------------------------------------------- */

.subscribe {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin: 24px 0 0;
  padding: 40px 0;
}

.subscribe__lead {
  font-weight: 500;
  font-size: clamp(22px, 2.4vw, 32px);
  line-height: 1.2;
  max-width: 18ch;
}

.subscribe__icons {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 28px;
}

.subscribe__icon {
  width: 36px;
  height: 36px;
  color: var(--text);
}

.subscribe__icon svg {
  width: 100%;
  height: 100%;
}

.subscribe__form-title {
  font-weight: 500;
  font-size: clamp(22px, 2.4vw, 32px);
  line-height: 1.2;
  max-width: 16ch;
  margin-bottom: 28px;
}

.subscribe__field {
  display: block;
  width: 100%;
  max-width: 420px;
  border: 0;
  border-bottom: 1px solid var(--text);
  background: transparent;
  padding: 10px 0;
  font-size: 14px;
  outline: none;
}

.subscribe__field::placeholder {
  color: var(--text-muted);
}

.subscribe__check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 18px;
  max-width: 420px;
  font-size: 11px;
  line-height: 1.35;
  color: #555;
}

.subscribe__check input {
  margin-top: 2px;
  flex-shrink: 0;
}

.subscribe__check a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.footer {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 24px;
  padding: 50px 0;
}

.footer__socials {
  display: flex;
  align-items: center;
  gap: 14px;
}

.footer__social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 29px;
  height: 29px;
  color: var(--text);
  flex-shrink: 0;
}

.footer__social img,
.footer__social svg {
  width: 29px;
  height: 29px;
  display: block;
}

.footer__social:not(.footer__social--tg) {
  width: 35px;
  height: 20px;
}

.footer__social:not(.footer__social--tg) img {
  width: 35px;
  height: 20px;
  transform: none;
}

.footer__social--tg {
  width: 29px;
  height: 29px;
  border: 0;
  border-radius: 50%;
  box-sizing: border-box;
  background: #000000;
}

.footer__social--tg img {
  width: 15px;
  height: 15px;
  filter: brightness(0) invert(1);
}

.footer__nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-self: center;
  gap: 10px;
  font-family: var(--font);
  font-weight: 600;
  font-style: normal;
  font-size: 12px;
  line-height: 1.2;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-align: center;
}

.footer__nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 18px;
}

.footer__nav a {
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  text-decoration: underline;
  text-decoration-style: solid;
  text-underline-offset: 0.25em;
  text-decoration-thickness: 0.13em;
  text-decoration-skip-ink: auto;
  vertical-align: bottom;
}

.footer__age {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: none;
  color: #000000;
  font-family: var(--font);
  font-weight: 400;
  font-style: normal;
  font-size: 12px;
  line-height: 1.2;
  letter-spacing: 0;
  text-decoration: none;
}

.footer__legal {
  max-width: 360px;
  font-size: 10px;
  line-height: 1.35;
  color: #666;
  text-align: right;
}

/* --------------------------------------------------------------------------
   Placeholders (replace with real assets)
   -------------------------------------------------------------------------- */

.ph {
  width: 100%;
  height: 100%;
  background:
    linear-gradient(135deg, #e8e4dc 0%, #d5d0c6 100%);
}

.ph--hero {
  background:
    linear-gradient(160deg, #dce6d8 0%, #b7c4a8 45%, #8fa88a 100%);
}

.ph--1 {
  background: linear-gradient(160deg, #e8d5b8, #c9a882);
}

.ph--2 {
  background: linear-gradient(160deg, #d6cfc4, #9e9588);
}

.ph--3 {
  background: linear-gradient(160deg, #e2c8c0, #b8898a);
}

.ph--4 {
  background: linear-gradient(160deg, #cfd8d2, #8ea39a);
}

.ph--5 {
  background: linear-gradient(160deg, #d9d2c8, #a89f93);
}

.ph--6 {
  background: linear-gradient(160deg, #cfc8bc, #7d766c);
}

.ph--7 {
  background: linear-gradient(160deg, #d5e0d0, #9bb08e);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1100px) {
  .news__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    height: auto;
    gap: 12px;
    padding: 12px;
  }

  .news-card {
    height: auto;
    min-height: 100px;
    grid-template-columns: 100px minmax(0, 1fr);
  }

  .news-card__media {
    width: 100px;
    height: 100px;
  }

  .feed__row {
    grid-template-columns: repeat(2, 300px);
    justify-content: space-between;
  }

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

  .hero__media {
    width: 100%;
    height: auto;
    aspect-ratio: 806 / 500;
  }

  .hero__body {
    height: auto;
    min-height: 0;
  }

  .hero__excerpt {
    margin-top: 24px;
  }
}

@media (max-width: 900px) {
  .news__list {
    grid-template-columns: 1fr;
    height: auto;
    align-items: stretch;
    gap: 0;
    padding: 0;
  }

  .news__list > li {
    border-top: 1px solid rgba(0, 0, 0, 0.06);
  }

  .news__list > li:first-child {
    border-top: 0;
  }

  .news-card {
    height: auto;
    min-height: 0;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 12px;
    padding: 10px 12px;
  }

  .news-card__media {
    width: 96px;
    height: 96px;
  }

  .news-card__body {
    padding: 2px 0;
  }
}

@media (max-width: 768px) {
  :root {
    --sidebar-w: 36px;
    --gap: 18px;
  }

  .main {
    width: 100%;
    padding-inline: 16px;
  }

  .t-sidebar {
    font-size: 12px;
  }

  .t-logo {
    font-size: 28px;
  }

  .header {
    padding-top: 18px;
  }

  .header__logo-icon {
    width: 120px;
    height: 51px;
  }

  .header__star {
    top: 18px;
    width: 64px;
    height: 54px;
  }

  .feed__row {
    grid-template-columns: minmax(0, 300px);
    justify-content: center;
  }

  .card {
    width: 100%;
    max-width: 300px;
  }

  .subscribe {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .footer {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .footer__legal {
    text-align: left;
    max-width: none;
  }
}
