/*
Theme Name: Малай Ньюс
Theme URI: https://malainews.ru
Author: Malai News
Description: Культурная газета Санкт-Петербурга — события, выставки, театр, музыка и город.
Version: 1.0.0
Requires at least: 6.4
Tested up to: 6.8
Requires PHP: 8.1
Text Domain: malai-news
*/

:root {
  --ink: #1a1a17;
  --muted: #5c584f;
  --paper: #f6f1e6;
  --paper-2: #efe8d8;
  --rule: #d7cbb3;
  --navy: #1c3354;
  --gold: #a67c4a;
  --burgundy: #7a2e3c;
  --white: #fffcf6;
  --serif: "Literata", "Iowan Old Style", "Palatino Linotype", serif;
  --sans: "Manrope", "Segoe UI", sans-serif;
  --measure: 40rem;
  --wrap: 72rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.05rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration-color: color-mix(in srgb, var(--gold) 70%, transparent); text-underline-offset: .18em; }
a:hover { color: var(--burgundy); }
img, svg { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.18; letter-spacing: -0.02em; margin: 0 0 .5em; }
p { margin: 0 0 1em; }
.skip { position: absolute; left: -999px; top: 0; background: var(--navy); color: #fff; padding: .5rem 1rem; z-index: 20; }
.skip:focus { left: 1rem; top: 1rem; }
.wrap { width: min(var(--wrap), calc(100% - 2rem)); margin-inline: auto; }

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .55rem 0;
  font-size: .78rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--rule);
}
.masthead {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 1rem;
  padding: 1.4rem 0 1.1rem;
  border-bottom: 3px double var(--navy);
}
.brand { justify-self: center; text-align: center; text-decoration: none; }
.brand-kicker {
  display: block;
  font-size: .72rem;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: .35rem;
}
.brand-name {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 7vw, 4.6rem);
  line-height: .9;
  color: var(--navy);
  font-weight: 700;
}
.brand-tag { display: block; margin-top: .45rem; color: var(--muted); font-size: .92rem; }
.mast-side { font-size: .85rem; color: var(--muted); max-width: 14rem; }
.mast-side--right { justify-self: end; text-align: right; }

.nav-wrap { border-bottom: 1px solid var(--rule); background: var(--paper); position: sticky; top: 0; z-index: 8; }
.menu {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .2rem 1.4rem;
  list-style: none;
  margin: 0;
  padding: .7rem 0;
  font-size: .92rem;
}
.menu a { text-decoration: none; color: var(--navy); }
.menu a:hover, .menu .current-menu-item a { color: var(--burgundy); }
.nav-toggle {
  display: none;
  width: 2.6rem; height: 2.6rem;
  border: 1px solid var(--rule);
  background: var(--white);
  cursor: pointer;
}
.search-slot { display: flex; align-items: center; }
.search-form { display: flex; gap: .35rem; }
.search-form input[type="search"] {
  border: 1px solid var(--rule);
  background: var(--white);
  padding: .4rem .6rem;
  font: inherit;
  min-width: 10rem;
}
.search-form button { background: var(--navy); color: var(--white); border: 0; padding: .4rem .7rem; cursor: pointer; font: inherit; }

.hero {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 2rem;
  padding: 2.2rem 0 2.4rem;
  border-bottom: 1px solid var(--rule);
}
.kicker {
  font-size: .75rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--burgundy);
  font-weight: 700;
  text-decoration: none;
}
.hero h1 { font-size: clamp(2rem, 4.4vw, 3.4rem); margin: .35rem 0 .7rem; }
.hero h1 a { text-decoration: none; }
.dek { font-size: 1.15rem; color: var(--muted); max-width: 38rem; }
.meta { font-size: .85rem; color: var(--muted); display: flex; gap: .7rem; flex-wrap: wrap; margin-top: .8rem; }
.cover {
  min-height: 22rem;
  background:
    linear-gradient(180deg, transparent 40%, rgba(28,51,84,.35)),
    repeating-linear-gradient(-18deg, #2a466c 0 2px, #1c3354 2px 18px);
  display: grid;
  place-items: end start;
  color: #f6f1e6;
  padding: 1.4rem;
  position: relative;
  overflow: hidden;
}
.cover::before {
  content: "";
  position: absolute;
  inset: 12% 18% 22% 18%;
  border: 1px solid color-mix(in srgb, #f6f1e6 35%, transparent);
  border-radius: 50% 50% 0 0 / 70% 70% 0 0;
}
.cover span { position: relative; font-family: var(--serif); font-size: 1.4rem; }
.cover img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }

.section { padding: 2.2rem 0; }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--ink);
  margin-bottom: 1.3rem;
  padding-bottom: .4rem;
}
.section-head h2 { font-size: 1.45rem; margin: 0; }
.section-head a { font-size: .85rem; color: var(--muted); text-decoration: none; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem; }
.stack { display: grid; gap: 1.3rem; }
.card { display: grid; gap: .55rem; }
.card h3 { font-size: 1.35rem; margin: 0; }
.card h3 a { text-decoration: none; }
.card p { color: var(--muted); margin: 0; }
.card-media {
  aspect-ratio: 16/10;
  background: var(--paper-2);
  overflow: hidden;
}
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.cover-sm {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  font-family: var(--serif);
  font-size: 2.4rem;
  color: var(--white);
  background: linear-gradient(145deg, var(--navy), #4a6a8f);
}
.cover-sm.cat-vystavki { background: linear-gradient(145deg, #7a2e3c, #c47a55); }
.cover-sm.cat-teatr { background: linear-gradient(145deg, #3a2744, #7a4e6c); }
.cover-sm.cat-muzyka { background: linear-gradient(145deg, #24443a, #6d8b6a); }
.cover-sm.cat-gorod { background: linear-gradient(145deg, #3d4a5c, #8aa0b8); }

.list-row {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 1rem;
  padding: 1rem 0;
  border-top: 1px solid var(--rule);
}
.list-row time { color: var(--muted); font-size: .82rem; }
.list-row h3 { font-size: 1.12rem; margin: 0; }
.list-row h3 a { text-decoration: none; }

.footer {
  margin-top: 2rem;
  padding: 2rem 0 2.4rem;
  border-top: 3px double var(--navy);
  color: var(--muted);
  font-size: .92rem;
}
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 1.5rem; }
.footer strong { color: var(--navy); font-family: var(--serif); font-size: 1.2rem; display: block; margin-bottom: .4rem; }
.footer .menu { justify-content: start; padding: 0; flex-direction: column; gap: .35rem; }

.article { padding: 2rem 0 3rem; max-width: var(--measure); }
.article .kicker { margin-bottom: .4rem; display: inline-block; }
.article h1 { font-size: clamp(2.1rem, 5vw, 3.2rem); }
.article-body { font-family: var(--serif); font-size: 1.16rem; line-height: 1.72; }
.article-body > p:first-of-type::first-letter {
  font-size: 3.4rem;
  float: left;
  line-height: .8;
  padding: .12em .12em 0 0;
  color: var(--navy);
  font-weight: 700;
}
.article-body h2 { margin-top: 1.6em; }
.related { margin-top: 2.5rem; padding-top: 1.2rem; border-top: 1px solid var(--rule); }
.related ul { list-style: none; padding: 0; display: grid; gap: .7rem; }

.archive-head { padding: 1.6rem 0 .8rem; border-bottom: 1px solid var(--ink); }
.archive-head h1 { font-size: 2.2rem; }
.feed { display: grid; gap: 0; padding: 0 0 3rem; }

.page-404, .search-head { padding: 3rem 0; text-align: center; }

@media (max-width: 860px) {
  .masthead, .hero, .split, .footer-grid, .list-row { grid-template-columns: 1fr; }
  .mast-side, .mast-side--right { justify-self: center; text-align: center; max-width: none; }
  .nav-toggle { display: block; position: absolute; right: 1rem; top: .45rem; }
  .nav-wrap { position: relative; }
  .menu-primary { display: none; }
  body.nav-open .menu-primary { display: flex; flex-direction: column; padding: .4rem 1rem 1rem; }
  .cover, .card-media { min-height: 14rem; }
}
