:root {
  --bg: #ffffff;
  --alt: #f8fafc;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --border: #e2e8f0;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 10px 25px -5px rgba(0, 0, 0, 0.05);
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

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

.wrap {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

.wrap.narrow {
  max-width: 780px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 68px;
}

.logo {
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 1.3rem;
  display: inline-flex;
  align-items: center;
}

.logo span {
  color: var(--accent);
}

.logo.small {
  font-size: 1.05rem;
}

.site-header nav {
  display: flex;
  gap: 8px;
}

.site-header nav a {
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--muted);
  transition: all 0.15s ease;
}

.site-header nav a:hover {
  color: var(--text);
  background: var(--alt);
}

/* Hero */
.hero {
  background: linear-gradient(180deg, #f1f5f9 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
}

.hero-inner {
  padding: 70px 20px 80px;
  max-width: 840px;
  text-align: center;
  margin: 0 auto;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-weight: 800;
  color: var(--text);
}

.lead {
  margin: 20px auto 32px;
  max-width: 640px;
  color: var(--muted);
  font-size: 1.12rem;
  line-height: 1.6;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  border-radius: 10px;
  padding: 12px 24px;
  transition: all 0.18s ease;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.btn-read {
  align-self: flex-start;
  background: var(--accent);
  color: #fff;
  padding: 8px 16px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.btn-read:hover {
  background: var(--accent-dark);
  color: #fff;
  transform: translateY(-1px);
}

/* Sections */
.section {
  padding: 64px 0;
}

.section-alt {
  background: var(--alt);
  border-top: 1px solid var(--border);
}

.section-title {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  letter-spacing: -0.02em;
  font-weight: 800;
}

.section-sub {
  margin: 8px 0 36px;
  color: var(--muted);
  font-size: 1.05rem;
}

.about p {
  max-width: 740px;
  color: var(--muted);
  margin: 14px 0 0;
  font-size: 1.05rem;
  line-height: 1.7;
}

/* Grid & Cards */
.grid {
  display: grid;
  gap: 28px;
  grid-template-columns: repeat(3, 1fr);
}

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: #cbd5e1;
}

.card-media {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: #f1f5f9;
  position: relative;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
  background-color: #f1f5f9;
}

.card:hover .card-media img {
  transform: scale(1.04);
}

.card-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.badge {
  align-self: flex-start;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #dbeafe;
}

.card-title {
  margin: 0;
  font-size: 1.18rem;
  line-height: 1.35;
  letter-spacing: -0.01em;
  font-weight: 700;
}

.card-title a {
  color: var(--text);
  transition: color 0.15s ease;
}

.card-title a:hover {
  color: var(--accent);
}

.card-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
  flex: 1;
}

/* Article view */
.article {
  padding: 40px 0 80px;
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 8px;
  transition: color 0.15s ease;
}

.back:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

.article-head {
  padding-top: 8px;
}

.crumbs {
  margin: 16px 0 10px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
}

.crumbs a:hover {
  text-decoration: underline;
}

.crumbs span {
  color: var(--muted);
  margin: 0 4px;
}

.article-title {
  margin: 0;
  font-size: clamp(2rem, 4.5vw, 2.85rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-weight: 800;
  color: var(--text);
}

.article-sub {
  margin: 16px 0 14px;
  color: #475569;
  font-size: 1.15rem;
  line-height: 1.55;
}

.meta {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.article-hero {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 480px;
  object-fit: cover;
  border-radius: var(--radius);
  margin: 24px 0 36px;
  background-color: #f1f5f9;
  box-shadow: var(--shadow);
}

.article-body {
  font-size: 1.1rem;
  line-height: 1.75;
  color: #334155;
}

.article-body h2 {
  margin: 40px 0 14px;
  font-size: 1.55rem;
  letter-spacing: -0.02em;
  font-weight: 800;
  color: var(--text);
}

.article-body h3 {
  margin: 30px 0 12px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

.article-body p {
  margin: 0 0 20px;
}

.article-body ul {
  margin: 0 0 24px;
  padding-left: 24px;
}

.article-body li {
  margin-bottom: 10px;
}

/* Comment Form */
.comment-form {
  margin: 50px 0 24px;
  padding: 30px;
  background: var(--alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.comment-form h2 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 700;
}

.comment-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
}

.comment-form input,
.comment-form textarea {
  font: inherit;
  font-size: 0.95rem;
  padding: 12px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  width: 100%;
  resize: vertical;
}

.comment-form input:focus,
.comment-form textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.comment-form .btn {
  align-self: flex-start;
  margin-top: 4px;
}

.form-msg {
  margin: 0;
  color: #15803d;
  background: #dcfce7;
  border: 1px solid #bbf7d0;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
}



/* Comment form checkbox */
.comment-form .comment-check {
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  color: var(--text);
  font-weight: 500;
  line-height: 1.45;
  cursor: pointer;
}

.comment-form .comment-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  margin: 2px 0 0;
  padding: 0;
  accent-color: var(--accent);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--alt);
  margin-top: 60px;
}

.footer-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 28px;
  padding-bottom: 28px;
}

.site-footer nav {
  display: flex;
  gap: 16px;
}

.site-footer nav a {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
}

.site-footer nav a:hover {
  color: var(--accent);
}

.copy {
  margin: 0 0 0 auto;
  color: var(--muted);
  font-size: 0.88rem;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 48px;
}

.pagination button {
  font: inherit;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  border: 1px solid #cbd5e1;
  min-width: 44px;
  height: 44px;
  padding: 0 14px;
  border-radius: 8px;
  background: #ffffff;
  color: #1e293b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.pagination button:hover:not(:disabled) {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.pagination button.is-active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: #f1f5f9;
}

.pagination .dots {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 44px;
  color: var(--muted);
  font-weight: 700;
}

@media (max-width: 980px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .hero-inner {
    padding: 56px 20px;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 16px;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .section {
    padding: 44px 0;
  }
  .header-inner {
    height: auto;
    padding-top: 14px;
    padding-bottom: 14px;
  }
  .site-header nav a {
    padding: 6px 10px;
    font-size: 0.88rem;
  }
  .copy {
    margin: 8px 0 0;
    width: 100%;
  }
}

/* Final fix: these five articles must never show an image/photo box. */
#article-view[data-no-image="true"] .article-image-wrap,
#article-view[data-no-image="true"] .article-hero { display: none !important; }

/* Final adjustment: smaller images inside all blogs except 26, 28, 30, 31 and 35. */
.article-image-wrap {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}
.article-hero {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 430px;
  margin-top: 20px;
  margin-bottom: 28px;
}
@media (max-width: 800px) {
  .article-image-wrap { max-width: 100%; }
  .article-hero { max-height: none; margin-top: 18px; margin-bottom: 24px; }
}

/* Advertisement placeholders: visible reserved space for approved ad code. */
.ad-section {
  padding: 22px 0 8px;
  background: #fff;
}

.ad-slot {
  min-height: 150px;
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 18px;
  border: 1px solid #f1f5f9;
  background: #fff;
  color: #94a3b8;
  font-size: 11px;
  line-height: 1;
}

.ad-slot span {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ad-slot-article {
  min-height: 180px;
  max-width: 760px;
  margin: 22px auto 28px;
}

@media (max-width: 640px) {
  .ad-section { padding-top: 14px; }
  .ad-slot { min-height: 120px; padding-top: 14px; }
  .ad-slot-article { min-height: 130px; margin: 18px auto 22px; }
}


/* Final placement and mobile image sizing. Article advertisement appears directly below the site header and before Back to Articles. */
.article-ad-top {
  padding: 16px 0 4px;
  background: #fff;
}
.article-ad-top .ad-slot-article {
  margin: 0 auto 16px;
}

/* Keep article photos noticeably smaller, especially on mobile. */
.article-image-wrap {
  max-width: 640px;
  padding: 0 16px;
}
.article-hero {
  max-width: 640px;
  width: 100%;
  max-height: 360px;
  margin: 14px auto 26px;
  display: block;
}
@media (max-width: 800px) {
  .article-image-wrap {
    max-width: 100%;
    padding: 0 24px;
  }
  .article-hero {
    width: min(100%, 360px);
    max-height: 240px;
    aspect-ratio: 16 / 9;
    margin: 12px auto 20px;
  }
}
@media (max-width: 480px) {
  .article-image-wrap { padding: 0 30px; }
  .article-hero { width: min(100%, 300px); max-height: 190px; }
  .article-ad-top { padding-top: 10px; }
}


/* FINAL USER-REQUESTED LAYOUT: Home = Header > H1 > Ad > Articles. Article = Header > Ad > Article. */
.hero { background: #fff; border-bottom: 0; }
.hero-inner { padding: 26px 20px 12px; max-width: 1100px; text-align: left; }
.hero h1 { font-size: clamp(1.65rem, 4vw, 2.35rem); line-height: 1.2; }
#blog.section { padding-top: 22px; }
.article-head { display: block; padding-top: 8px; padding-bottom: 0; }
.article-ad-top { padding-top: 52px; padding-bottom: 18px; }
.article-ad-top .ad-slot-article { margin-bottom: 0; min-height: 178px; }
.article-image-wrap { margin-top: 0; }
@media (max-width: 640px) { .hero-inner { padding: 18px 16px 8px; } .hero h1 { font-size: 1.55rem; } #blog.section { padding-top: 16px; } }

/* Blog article layout: Header → Advertisement → Back → Category → Title → Article. */
.article-head .back { margin: 10px 0 24px; }
.article-head .crumbs { margin: 0 0 16px; }
.article-head .article-title { margin-bottom: 6px; max-width: 850px; }
.article-head .meta { margin-bottom: 24px; }
.article-head .article-sub { margin: 0 0 12px; max-width: 850px; }
@media (max-width: 640px) {
  .article-ad-top { padding-top: 24px; padding-bottom: 10px; }
  .article-ad-top .ad-slot-article { min-height: 130px; }
  .article-head { padding-top: 6px; }
  .article-head .back { margin-bottom: 18px; }
  .article-title { font-size: 2rem; }
}
