/* ═══════════════════════════════════════════════════════════════
   Template 4 — Shared styles
   All colors use CSS custom properties set by color_scheme partial.
   ═══════════════════════════════════════════════════════════════ */

/* ── Reset / Base ─────────────────────────────────────────────────── */
:root {
  --color-primary:    #1d4ed8;
  --color-secondary:  #7c3aed;
  --color-accent:     #f59e0b;
  --color-text:       #111827;
  --color-text-muted: #6b7280;
  --color-heading:    #111827;
  --color-bg:         #ffffff;
  --color-bg-alt:     #f8fafc;
  --color-hero-bg:    #1e293b;
  --color-nav-bg:     #ffffff;
  --color-footer-bg:  #1e293b;
  --font-heading:     system-ui, -apple-system, sans-serif;
  --font-body:        system-ui, -apple-system, sans-serif;
  --s4-section-py:    4rem;
  --s4-radius:        10px;
  --s4-shadow:        0 2px 8px rgba(0,0,0,.08);
}

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

body.s4-body {
  font-family: var(--font-body);
  color:        var(--color-text);
  background:   var(--color-bg);
  margin: 0;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color:        var(--color-heading);
  font-weight:  700;
}

a { color: var(--color-primary); }
a:hover { color: var(--color-secondary); }

/* ── Buttons ──────────────────────────────────────────────────────── */
.s4-btn-primary {
  display: inline-block;
  background: var(--color-primary);
  color: #fff !important;
  padding: .65rem 1.5rem;
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: opacity .15s, transform .15s;
  line-height: 1.4;
}
.s4-btn-primary:hover {
  opacity: .9;
  transform: translateY(-1px);
  text-decoration: none;
}
.s4-btn-primary--lg { padding: .85rem 2rem; font-size: 1.05rem; }

/* ── Navigation ──────────────────────────────────────────────────── */
.s4-nav { position: sticky; top: 0; z-index: 1000; box-shadow: 0 1px 6px rgba(0,0,0,.07); }
.s4-nav__link {
  color: var(--color-heading) !important;
  font-weight: 500;
  font-size: .95rem;
  transition: color .15s;
}
.s4-nav__link:hover, .s4-nav__link.active { color: var(--color-primary) !important; }
.s4-nav__brand { font-size: 1.1rem; font-weight: 700; }

/* ── Sections ─────────────────────────────────────────────────────── */
.s4-section {
  padding: var(--s4-section-py) 0;
}
.s4-section--alt {
  background: var(--color-bg-alt);
}
.s4-section__title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--color-heading);
  margin-bottom: 2rem;
  position: relative;
  padding-bottom: .75rem;
}
.s4-section__title::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 3rem; height: 3px;
  background: var(--color-primary);
  border-radius: 2px;
}
.s4-section__meta {
  color: var(--color-text-muted);
  font-size: .9rem;
  margin-bottom: 1.5rem;
}

/* ── Blog card shared styles ─────────────────────────────────────── */
.s4-blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
}
.s4-blog-card {
  background: var(--color-bg);
  border: 1px solid var(--color-bg-alt);
  border-radius: var(--s4-radius);
  overflow: hidden;
  box-shadow: var(--s4-shadow);
  transition: box-shadow .2s, transform .2s;
  display: flex;
  flex-direction: column;
}
.s4-blog-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,.12); transform: translateY(-2px); }
.s4-blog-card__img-wrap { display: block; overflow: hidden; aspect-ratio: 16/9; }
.s4-blog-card__img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.s4-blog-card:hover .s4-blog-card__img-wrap img { transform: scale(1.04); }
.s4-blog-card__body { padding: 1.1rem; display: flex; flex-direction: column; flex: 1; gap: .5rem; }
.s4-blog-card__title { font-size: 1rem; font-weight: 600; margin: 0; }
.s4-blog-card__title a { color: var(--color-heading); text-decoration: none; }
.s4-blog-card__title a:hover { color: var(--color-primary); }
.s4-blog-card__excerpt { font-size: .88rem; color: var(--color-text-muted); margin: 0; line-height: 1.5; }
.s4-blog-card__date { font-size: .8rem; color: var(--color-text-muted); margin-top: auto; }
.s4-blog-card__date .fa { margin-right: .3rem; color: var(--color-primary); }

.s4-badge {
  display: inline-block;
  background: var(--color-primary);
  color: #fff;
  font-size: .72rem;
  font-weight: 600;
  padding: .2rem .55rem;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.s4-badge--primary { background: var(--color-primary); }

.s4-link-more {
  font-size: .9rem;
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
  white-space: nowrap;
}
.s4-link-more:hover { color: var(--color-secondary); }
.s4-link-more .fa { font-size: .75rem; margin-left: .3rem; }

/* ── Blog horizontal list ────────────────────────────────────────── */
.s4-blog-hlist { display: flex; flex-direction: column; gap: 1.25rem; }
.s4-blog-hlist__item {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  padding: 1.25rem;
  background: var(--color-bg);
  border: 1px solid var(--color-bg-alt);
  border-radius: var(--s4-radius);
  box-shadow: var(--s4-shadow);
}
.s4-blog-hlist__body { flex: 1; display: flex; flex-direction: column; gap: .4rem; }
.s4-blog-hlist__title { font-size: 1rem; font-weight: 600; margin: 0; }
.s4-blog-hlist__title a { color: var(--color-heading); text-decoration: none; }
.s4-blog-hlist__title a:hover { color: var(--color-primary); }
.s4-blog-hlist__excerpt { font-size: .88rem; color: var(--color-text-muted); margin: 0; }
.s4-blog-hlist__date { font-size: .8rem; color: var(--color-text-muted); margin-top: auto; }
.s4-blog-hlist__img-wrap { flex-shrink: 0; width: 120px; border-radius: 8px; overflow: hidden; aspect-ratio: 4/3; }
.s4-blog-hlist__img-wrap img { width: 100%; height: 100%; object-fit: cover; }

/* ── Article body ────────────────────────────────────────────────── */
.s4-article h1, .s4-article h2, .s4-article h3 { color: var(--color-heading); }
.s4-article h2 { font-size: 1.5rem; margin-top: 2rem; margin-bottom: .75rem; }
.s4-article h3 { font-size: 1.15rem; margin-top: 1.5rem; margin-bottom: .5rem; }
.s4-article p  { line-height: 1.75; color: var(--color-text); }
.s4-article a  { color: var(--color-primary); }
.s4-article ul, .s4-article ol { padding-left: 1.4rem; line-height: 1.8; }

/* ── Footer ──────────────────────────────────────────────────────── */
.s4-footer { margin-top: 4rem; }
.s4-footer__link {
  color: rgba(255,255,255,.7);
  text-decoration: none;
  font-size: .9rem;
  transition: color .15s;
}
.s4-footer__link:hover { color: #fff; text-decoration: none; }

/* ── Video wrapper ───────────────────────────────────────────────── */
.s4-video-wrapper { background: #000; }

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 576px) {
  :root { --s4-section-py: 2.5rem; }
  .s4-blog-hlist__img-wrap { display: none; }
  .s4-blog-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 400px) {
  .s4-blog-grid { grid-template-columns: 1fr; }
}
