/*
Theme Name: Apple Help Modern
Theme URI: https://apple-help.ru/
Author: Apple-Help.ru
Description: Lightweight migration theme preserving the familiar Apple-Help.ru news and help layout.
Version: 1.1.3
Requires at least: 7.1
Requires PHP: 8.1
Text Domain: apple-help-modern
*/

:root {
  --ink: #25272b;
  --muted: #6f747c;
  --line: #e3e5e8;
  --soft: #f5f6f7;
  --accent: #c82c2d;
  --accent-dark: #9f1f20;
  --nav: #24272b;
  --paper: #fff;
  --radius: 12px;
  --shadow: 0 10px 30px rgb(25 31 40 / 7%);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: #eef0f2;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
}
a { color: var(--accent); text-decoration: none; }
a:hover, a:focus-visible { color: var(--accent-dark); text-decoration: underline; }
img { max-width: 100%; height: auto; }
.screen-reader-text { position: absolute; clip: rect(1px, 1px, 1px, 1px); width: 1px; height: 1px; overflow: hidden; }
.screen-reader-text:focus { clip: auto; width: auto; height: auto; padding: .7rem; background: #fff; z-index: 100000; }

.site-shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.site-header { background: var(--paper); border-top: 4px solid var(--accent); }
.brand-row { min-height: 126px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand-logo { display: block; width: 288px; max-width: 70vw; }
.brand-tagline { color: var(--muted); font-size: .95rem; text-align: right; }
.main-nav { background: var(--nav); border-bottom: 3px solid var(--accent); }
.main-nav ul { display: flex; flex-wrap: wrap; gap: 0; margin: 0; padding: 0; list-style: none; }
.main-nav a { display: block; padding: 15px 20px; color: #fff; font-size: .86rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.main-nav a:hover, .main-nav a:focus-visible, .main-nav .current-menu-item > a, .main-nav .current_page_item > a { background: var(--accent); text-decoration: none; }

.content-grid {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) 270px;
  grid-template-areas: "left main right";
  gap: 24px;
  align-items: start;
  padding: 32px 0 48px;
}
.content-main, .widget { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.content-main { grid-area: main; min-width: 0; padding: clamp(20px, 3vw, 36px); }
.page-heading { margin: 0 0 28px; font-size: clamp(1.55rem, 3vw, 2.15rem); line-height: 1.2; }

.post-card { padding: 0 0 30px; margin: 0 0 34px; border-bottom: 1px solid var(--line); }
.post-card:last-child { border-bottom: 0; margin-bottom: 0; }
.post-card__title, .entry-title { margin: 0 0 10px; color: var(--ink); font-size: clamp(1.35rem, 2.5vw, 1.85rem); line-height: 1.25; }
.post-card__title a { color: inherit; }
.post-card__meta, .entry-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 20px; color: var(--muted); font-size: .88rem; }
.post-card__body > a[tabindex="-1"] { display: block; }
.post-card__thumb { display: block; width: 100%; max-width: 100%; margin: 4px 0 18px; border-radius: 8px; }
.post-card__body::after { content: ""; display: block; clear: both; }
.read-more { display: flex; align-items: center; width: fit-content; min-height: 38px; margin-left: auto; padding: 7px 14px; border: 1px solid var(--accent); border-radius: 7px; font-weight: 650; }
.read-more:hover { background: var(--accent); color: #fff; text-decoration: none; }
.entry-content { overflow-wrap: anywhere; }
.entry-content > :first-child { margin-top: 0; }
.entry-content iframe { max-width: 100%; }

.sidebar { display: flex; flex-direction: column; gap: 18px; }
.sidebar-left { grid-area: left; }
.sidebar-right { grid-area: right; }
.widget { padding: 20px; box-shadow: 0 8px 24px rgb(25 31 40 / 5%); }
.widget-title { margin: 0 0 14px; padding-bottom: 10px; border-bottom: 2px solid var(--accent); font-size: .98rem; letter-spacing: .04em; text-transform: uppercase; }
.widget ul { margin: 0; padding: 0; list-style: none; }
.widget li { padding: 7px 0; border-bottom: 1px solid var(--line); }
.widget li:last-child { border-bottom: 0; }
.widget_search form, .search-form { display: flex; gap: 8px; }
input[type="search"], input[type="text"], input[type="email"], input[type="url"], textarea {
  width: 100%; border: 1px solid #cfd3d8; border-radius: 7px; padding: 10px 12px; font: inherit;
}
button, input[type="submit"] { border: 0; border-radius: 7px; padding: 10px 15px; background: var(--accent); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.sape-zone { border-top: 4px solid var(--accent); background: #fffdf9; }
.sape-zone .widget-title { border-bottom-color: #d9b365; }
.tag-cloud { line-height: 1.8; }
.widget-calendar table { width: 100%; border-collapse: collapse; text-align: center; font-size: .82rem; }
.widget-calendar th, .widget-calendar td { padding: 3px 1px; }

.navigation.pagination { margin-top: 28px; }
.nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.page-numbers { padding: 7px 11px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.page-numbers.current { background: var(--accent); color: #fff; border-color: var(--accent); }

.post-navigation { display: flex; justify-content: space-between; gap: 16px; margin-top: 34px; padding-top: 24px; border-top: 1px solid var(--line); }
.post-navigation > div { flex: 1 1 0; }
.post-navigation__next { text-align: right; }
.post-navigation a { display: inline-flex; align-items: center; min-height: 40px; padding: 8px 14px; border: 1px solid var(--accent); border-radius: 7px; font-weight: 650; }
.post-navigation a:hover, .post-navigation a:focus-visible { background: var(--accent); color: #fff; text-decoration: none; }

.comments-area { margin-top: 42px; padding-top: 28px; border-top: 1px solid var(--line); }
.comment-list { padding-left: 0; list-style: none; }
.comment-body { margin: 0 0 18px; padding: 18px; background: var(--soft); border-radius: 8px; }
.comment-meta { font-size: .88rem; color: var(--muted); }

.site-footer { padding: 28px 0; background: #1e2023; color: #cfd2d6; font-size: .87rem; }
.site-footer a { color: #fff; }
.footer-inner { display: grid; gap: 8px; }

@media (max-width: 1040px) {
  .content-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas: "main main" "left right";
  }
}
@media (max-width: 620px) {
  .site-shell { width: min(100% - 20px, 1180px); }
  .brand-row { min-height: 100px; }
  .brand-tagline { display: none; }
  .main-nav a { padding: 12px 11px; font-size: .74rem; }
  .content-grid { grid-template-columns: 1fr; grid-template-areas: "main" "left" "right"; padding-top: 18px; gap: 18px; }
  .content-main { padding: 18px; }
  .post-navigation { flex-direction: column; }
  .post-navigation__next { text-align: left; }
  .post-card__thumb { margin: 0 0 16px; }
}
