/* ============================================================
   CLUBER — base element styles & brand utilities.
   Kept light: resets + sensible defaults so the tokens "just
   work" when a consumer links styles.css.
   ============================================================ */

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

body {
  margin: 0;
  background: var(--bg-page);
  color: var(--text-body);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-normal);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--text-strong);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  margin: 0 0 0.5em;
  font-weight: var(--fw-bold);
}

p { margin: 0 0 1em; }

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

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

/* — Brand utilities — */

/* Walnut-wood chrome surface (header / footer). Path is relative
   to this file's location in tokens/. */
.cluber-wood {
  background-color: var(--walnut-700);
  background-image: linear-gradient(rgba(28,15,7,0.55), rgba(28,15,7,0.55)),
                    url('../assets/bg-wood.jpg');
  background-size: auto, 512px;
  color: var(--text-on-dark);
}

/* Section heading — serif, used for "Свежее на Клубере" etc. */
.cluber-section-title {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  font-size: var(--fs-display-md);
  color: var(--text-strong);
}

/* Reading column for long-form articles */
.cluber-read {
  max-width: var(--container-read);
  margin-inline: auto;
}
.cluber-read p {
  font-size: var(--fs-body-lg);
  line-height: var(--lh-relaxed);
  color: var(--text-body);
}

/* Search field placeholder — brown, matching the field border */
.cluber-search-input::placeholder { color: var(--brown-text); opacity: 0.8; }

/* Authors grid — 4 per row on desktop, responsive down to 2 on mobile */
.cluber-author-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 36px 24px;
  justify-items: center;
  padding-bottom: 8px;
}
@media (max-width: 860px) {
  .cluber-author-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .cluber-author-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Site header nav — desktop spread, mobile burger dropdown */
.cluber-nav-links {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-left: 24px;
}
@media (max-width: 860px) {
  .cluber-burger { display: flex !important; }
  .cluber-nav-links {
    flex-basis: 100%;
    margin-left: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    overflow: hidden;
    max-height: 0;
    transition: max-height .25s ease;
  }
  .cluber-nav-links.is-open { max-height: 520px; margin-top: 6px; }
  .cluber-nav-links > a {
    padding: 12px 0;
    border-top: 1px solid rgba(255,255,255,0.12);
  }
}

/* Header top row — search drops to full width on mobile */
@media (max-width: 600px) {
  .cluber-header-top { flex-wrap: wrap; }
  .cluber-header-search {
    order: 5;
    flex-basis: 100% !important;
    max-width: none !important;
  }
  .cluber-logo { height: 34px !important; }
  .cluber-badge img { height: 32px !important; }
}

/* Author hero — stacks & centers on mobile */
@media (max-width: 700px) {
  .cluber-author-hero {
    flex-direction: column;
    text-align: center;
    padding: 32px 22px !important;
  }
  .cluber-author-hero > div { width: 100%; }
  .cluber-author-hero p { margin-left: auto !important; margin-right: auto !important; }
  .cluber-author-hero .cluber-author-topics,
  .cluber-author-hero > div > div { justify-content: center; }
}
