:root {
  --bg: #f4f7fa;
  --surface: #ffffff;
  --text: #15202b;
  --muted: #5a6b7d;
  --accent: #0d7ea8;
  --accent-dark: #095f80;
  --accent-soft: #e3f3f9;
  --border: #dde5ed;
  --shadow: 0 4px 24px rgba(21, 32, 43, 0.07);
  --shadow-lg: 0 12px 40px rgba(21, 32, 43, 0.12);
  --radius: 14px;
  --radius-lg: 20px;
  --max: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 16px;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }

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

/* Header */
.header {
  position: sticky; top: 0; z-index: 200;
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 64px; gap: 16px;
}
.logo {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 1.2rem; color: var(--text);
  text-decoration: none; letter-spacing: -0.03em;
}
.logo span { color: var(--accent); }
.logo-icon { width: 28px; height: 28px; color: var(--accent); }
.nav { display: flex; align-items: center; gap: 8px; }
.nav a {
  color: var(--muted); font-weight: 600; font-size: 0.92rem;
  padding: 8px 12px; border-radius: 8px; text-decoration: none;
}
.nav a:hover, .nav a.active { color: var(--accent); background: var(--accent-soft); }
.nav-cta {
  background: var(--accent) !important; color: #fff !important;
  padding: 9px 16px !important; border-radius: 999px !important;
}
.nav-cta:hover { background: var(--accent-dark) !important; color: #fff !important; }
.nav-toggle {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 8px;
}
.nav-toggle span {
  display: block; width: 22px; height: 2px; background: var(--text);
  border-radius: 2px;
}

/* Hero */
.hero-banner {
  position: relative; min-height: 480px;
  display: flex; align-items: flex-end;
  background: #1a3a4a center/cover no-repeat;
  margin-bottom: 48px; overflow: hidden;
}
.hero-bg-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 0;
}
.hero-banner::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,30,45,0.2) 0%, rgba(10,30,45,0.82) 100%);
}
.hero-content { position: relative; z-index: 1; padding: 56px 20px 64px; width: 100%; color: #fff; }
.hero-badge {
  display: inline-block; background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3); padding: 6px 14px;
  border-radius: 999px; font-size: 0.85rem; font-weight: 600; margin-bottom: 16px;
}
.hero-content h1 {
  margin: 0 0 14px; font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800; line-height: 1.1; max-width: 700px; letter-spacing: -0.03em;
}
.hero-content .lead { color: rgba(255,255,255,0.92); max-width: 560px; margin: 0 0 28px; font-size: 1.1rem; }
.hero-stats {
  display: flex; gap: 32px; margin-top: 36px; flex-wrap: wrap;
}
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats strong { font-size: 1.5rem; font-weight: 800; }
.hero-stats span { font-size: 0.82rem; opacity: 0.85; }

.cta-row { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff !important;
  padding: 13px 24px; border-radius: 999px;
  font-weight: 700; font-size: 0.95rem; border: none;
  cursor: pointer; transition: transform 0.15s, background 0.15s;
  text-decoration: none;
}
.btn:hover { background: var(--accent-dark); transform: translateY(-1px); }
.btn-secondary {
  background: rgba(255,255,255,0.12); border: 2px solid rgba(255,255,255,0.75);
  backdrop-filter: blur(4px);
}
.btn-secondary:hover { background: rgba(255,255,255,0.22); }
.btn-light { background: #fff; color: var(--accent-dark) !important; }
.btn-light:hover { background: #f0f9fc; }

/* Sections */
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 20px; flex-wrap: wrap; gap: 8px; }
.section-title { font-size: 1.55rem; font-weight: 800; margin: 0 0 20px; letter-spacing: -0.02em; }
.link-more { font-weight: 600; font-size: 0.95rem; }
.popular { padding-bottom: 48px; }
.popular-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px;
}
.popular-item {
  display: block; text-decoration: none; color: inherit;
  background: var(--surface); border-radius: var(--radius-lg);
  overflow: hidden; border: 1px solid var(--border);
  box-shadow: var(--shadow); transition: transform 0.2s, box-shadow 0.2s;
}
.popular-item:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); color: inherit; }
.popular-item img { width: 100%; height: 170px; object-fit: cover; }
.popular-item .info { padding: 14px 16px 18px; }
.popular-item h3 { margin: 0 0 4px; font-size: 1.05rem; font-weight: 700; }
.popular-item p { margin: 0; font-size: 0.85rem; color: var(--muted); }

.cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px; padding-bottom: 56px;
}
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow); transition: transform 0.2s;
}
.card:hover { transform: translateY(-3px); }
.card-img, .card-img-wrap {
  height: 170px; overflow: hidden; background-color: var(--accent-soft);
}
.card-img-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-body { padding: 18px 20px 22px; }
.card h2 { margin: 0 0 10px; font-size: 1.1rem; font-weight: 700; }
.card p { margin: 0; color: var(--muted); font-size: 0.92rem; line-height: 1.5; }
.card a { font-weight: 600; }

.cta-strip {
  display: flex; justify-content: space-between; align-items: center; gap: 24px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #fff; border-radius: var(--radius-lg); padding: 32px 36px;
  margin-bottom: 56px; flex-wrap: wrap;
}
.cta-strip h2 { margin: 0 0 8px; font-size: 1.35rem; }
.cta-strip p { margin: 0; opacity: 0.9; }
.cta-strip .btn { background: #fff; color: var(--accent-dark) !important; }

/* Guides catalog */
.page-head { padding: 40px 0 8px; }
.page-head h1 { margin: 0 0 10px; font-size: 2rem; font-weight: 800; }
.guides-toolbar { margin-bottom: 24px; }
.search-input {
  width: 100%; max-width: 480px; padding: 14px 18px;
  border: 1px solid var(--border); border-radius: 12px;
  font-size: 1rem; font-family: inherit; margin-bottom: 14px;
  background: var(--surface); box-shadow: var(--shadow);
}
.search-input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.filter-chip {
  border: 1px solid var(--border); background: var(--surface);
  padding: 8px 14px; border-radius: 999px; font-size: 0.85rem;
  font-weight: 600; color: var(--muted); cursor: pointer; font-family: inherit;
}
.filter-chip:hover, .filter-chip.active {
  background: var(--accent-soft); border-color: var(--accent); color: var(--accent-dark);
}
.result-count { font-size: 0.88rem; color: var(--muted); margin: 0; }
.guide-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px; padding-bottom: 56px;
}
.guide-card {
  display: block; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow); transition: transform 0.2s;
}
.guide-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); color: inherit; }
.guide-card-img {
  height: 160px; overflow: hidden; background-color: var(--accent-soft);
}
.guide-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.guide-card-body { padding: 14px 16px 18px; }
.guide-card h3 { margin: 0 0 6px; font-size: 1rem; font-weight: 700; }
.guide-card p { margin: 0; color: var(--muted); font-size: 0.85rem; }
.guide-card .small { display: block; margin-top: 8px; font-size: 0.8rem; color: var(--accent); font-weight: 600; }
.empty-state { text-align: center; color: var(--muted); padding: 40px 0; }

/* Guide article */
.guide { padding: 28px 0 56px; }
.breadcrumb { font-size: 0.85rem; color: var(--muted); margin-bottom: 16px; }
.breadcrumb a { color: var(--accent); text-decoration: none; }
.guide-hero, .page-hero {
  position: relative; height: 320px; border-radius: var(--radius-lg);
  background: center/cover no-repeat var(--accent-soft);
  margin-bottom: 0; overflow: hidden; box-shadow: var(--shadow-lg);
}
.guide-hero img, .page-hero img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.guide-intro, .page-intro {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 28px 28px;
  margin: -24px 0 28px;
  position: relative;
  z-index: 2;
  box-shadow: var(--shadow);
}
.guide-intro h1, .page-intro h1 {
  font-size: clamp(1.75rem, 4vw, 2.4rem);
  font-weight: 800; margin: 0 0 14px; letter-spacing: -0.02em;
}
.intro-text { color: var(--muted); font-size: 1.02rem; }
.intro-text p { margin: 0 0 12px; }
.intro-text p:last-child { margin-bottom: 0; }
.intro-highlight {
  background: var(--accent-soft); border-left: 4px solid var(--accent);
  padding: 12px 16px; border-radius: 0 10px 10px 0; color: var(--text) !important;
}
.guide h1 { font-size: clamp(1.75rem, 4vw, 2.4rem); font-weight: 800; margin: 0 0 12px; letter-spacing: -0.02em; }
.guide .lead { color: var(--muted); max-width: 720px; margin: 0 0 20px; font-size: 1.05rem; }
.guide-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.chip {
  background: var(--accent-soft); color: var(--accent-dark);
  border-radius: 999px; padding: 7px 14px; font-size: 0.82rem; font-weight: 600;
}
.guide-layout {
  display: grid; grid-template-columns: 1fr 300px; gap: 28px; align-items: start;
}
.guide-section {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px 24px; margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.guide-section h2 { margin: 0 0 12px; font-size: 1.15rem; font-weight: 700; }
.guide-section ul { margin: 0; padding-left: 20px; color: var(--muted); }
.guide-section p { margin: 0; color: var(--muted); }
.guide-section.tip { border-left: 4px solid var(--accent); }
.guide-aside { position: sticky; top: 84px; }
.aside-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.aside-card h3 { margin: 0 0 12px; font-size: 1rem; font-weight: 700; }
.aside-card dl { margin: 0; }
.aside-card dt { font-size: 0.75rem; text-transform: uppercase; color: var(--muted); margin-top: 10px; }
.aside-card dt:first-child { margin-top: 0; }
.aside-card dd { margin: 2px 0 0; font-weight: 600; }
.related-list { display: flex; flex-direction: column; gap: 10px; }
.related-card {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: var(--text); font-size: 0.88rem; font-weight: 600;
}
.related-card:hover { color: var(--accent); }
.aside-card.aside-photo { padding: 0; overflow: hidden; }
.aside-card.aside-photo .card-img-wrap { height: 180px; border-radius: 0; }
.related-img {
  width: 56px; height: 56px; border-radius: 10px;
  object-fit: cover; flex-shrink: 0; display: block;
}
.cta-box {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border-radius: var(--radius-lg); padding: 28px 32px; margin-top: 8px; color: #fff;
}
.cta-box h3 { margin: 0 0 8px; font-size: 1.2rem; }
.cta-box p { margin: 0 0 18px; opacity: 0.92; }

/* Static pages */
.page-content { padding: 48px 0 64px; max-width: 720px; }
.page-content h1 { font-size: 2rem; font-weight: 800; margin: 0 0 12px; }
.center-block { text-align: center; max-width: 480px; margin: 0 auto; padding: 80px 20px; }
.params {
  text-align: left; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; font-size: 13px; margin: 20px auto;
}

/* Footer */
.footer {
  background: var(--surface); border-top: 1px solid var(--border); margin-top: 20px;
}
.footer-grid {
  display: grid; grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 32px; padding: 48px 20px 32px;
}
.footer-brand p { color: var(--muted); font-size: 0.9rem; margin: 12px 0 0; max-width: 280px; }
.footer h4 { margin: 0 0 14px; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin-bottom: 8px; }
.footer a { color: var(--text); font-size: 0.92rem; text-decoration: none; font-weight: 500; }
.footer a:hover { color: var(--accent); }
.footer-bottom {
  border-top: 1px solid var(--border); padding: 18px 20px;
  color: var(--muted); font-size: 0.85rem;
}

@media (max-width: 900px) {
  .guide-layout { grid-template-columns: 1fr; }
  .guide-aside { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .nav-toggle { display: flex; }
  .nav {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    background: var(--surface); border-bottom: 1px solid var(--border);
    flex-direction: column; padding: 12px 20px 20px; box-shadow: var(--shadow-lg);
  }
  .nav.open { display: flex; }
  .nav a { width: 100%; }
  .hero-banner { min-height: 400px; }
  .cards, .popular-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .cta-strip { flex-direction: column; text-align: center; }
}
