/* ══════════════════════════════════════════
   Home YourS — PHP Blog Styles
   Matches Scandinavian design of Astro site
   ══════════════════════════════════════════ */

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

:root {
  --bone:      #F7F3EE;
  --parchment: #EDE8E1;
  --stone:     #D6CFC7;
  --pewter:    #9A918A;
  --slate:     #4A4540;
  --charcoal:  #1C1B19;
  --forest:    #2C4A2E;
  --forest-light: #3d6640;
  --forest-pale: #EEF3EE;
  --white:     #FFFFFF;

  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans:  'Inter', system-ui, sans-serif;

  --radius: 2px;
  --container: 1180px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bone);
  color: var(--charcoal);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Layout ────────────────────────────── */
.site-wrap { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.25rem;
}

@media (min-width: 768px) {
  .container { padding: 0 2rem; }
}

/* ── Header ─────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bone);
  border-bottom: 1px solid var(--stone);
  padding: 1rem 0;
  transition: background 0.3s, box-shadow 0.3s;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--font-serif);
  font-size: 1.375rem;
  color: var(--charcoal);
  text-decoration: none;
  letter-spacing: -0.01em;
}

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

.nav {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav a {
  font-size: 0.875rem;
  color: var(--slate);
  text-decoration: none;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 0.2s;
}

.nav a:hover { color: var(--charcoal); }

.nav-cta {
  background: var(--forest);
  color: var(--white) !important;
  padding: 0.5rem 1.25rem;
  font-size: 0.8125rem !important;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.nav-cta:hover { background: var(--forest-light); color: var(--white) !important; }

.lang-switch {
  font-size: 0.8125rem;
  color: var(--pewter);
  text-decoration: none;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--stone);
  transition: color 0.2s;
}

.lang-switch:hover { color: var(--charcoal); }

@media (max-width: 767px) {
  .nav { display: none; }
}

/* ── Hero / Page header ─────────────────── */
.page-hero {
  background: var(--parchment);
  border-bottom: 1px solid var(--stone);
  padding: 4rem 0 3rem;
}

@media (min-width: 1024px) {
  .page-hero { padding: 6rem 0 4rem; }
}

.divider {
  width: 2.5rem;
  height: 1px;
  background: var(--forest);
  margin-bottom: 1rem;
}

.page-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--charcoal);
  margin-bottom: 0.5rem;
}

.page-sub {
  color: var(--slate);
  font-size: 1.0625rem;
}

/* ── Blog grid ──────────────────────────── */
.section { padding: 4rem 0; }

@media (min-width: 1024px) { .section { padding: 5rem 0; } }

.featured-post { margin-bottom: 3.5rem; }

.posts-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .posts-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .posts-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── Post Card ──────────────────────────── */
.post-card {
  background: var(--white);
  border: 1px solid var(--stone);
  overflow: hidden;
  transition: box-shadow 0.3s, transform 0.3s;
}

.post-card:hover {
  box-shadow: 0 8px 24px rgba(28,27,25,.08);
  transform: translateY(-2px);
}

.post-card--featured {
  display: grid;
  grid-template-columns: 1fr;
  background: var(--white);
}

@media (min-width: 768px) {
  .post-card--featured { grid-template-columns: 1fr 1fr; }
}

.card-img {
  display: block;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--parchment);
}

.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
  display: block;
}

.post-card:hover .card-img img { transform: scale(1.03); }

.post-card--featured .card-img {
  aspect-ratio: 4/3;
  height: 100%;
}

@media (min-width: 768px) {
  .post-card--featured .card-img { aspect-ratio: unset; min-height: 300px; }
}

.card-body { padding: 1.5rem; display: flex; flex-direction: column; }

.post-card--featured .card-body { padding: 2rem 2.5rem; justify-content: center; }

.card-meta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.tag {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pewter);
  background: var(--parchment);
  padding: 0.25rem 0.625rem;
  display: inline-block;
}

.card-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1.35;
  color: var(--charcoal);
  margin-bottom: 0.625rem;
}

.post-card--featured .card-title { font-size: 1.625rem; }

.card-title a { text-decoration: none; color: inherit; transition: color 0.2s; }
.card-title a:hover { color: var(--forest); }

.card-desc {
  font-size: 0.9375rem;
  color: var(--slate);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--forest);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: auto;
}

.card-link::after { content: '→'; }
.card-link:hover { color: var(--forest-light); }

.empty-msg {
  text-align: center;
  padding: 5rem 0;
  color: var(--pewter);
}

/* ── Single Post ────────────────────────── */
.post-hero {
  height: 18rem;
  overflow: hidden;
  background: var(--parchment);
}

@media (min-width: 1024px) { .post-hero { height: 26rem; } }

.post-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-wrap { max-width: 780px; margin: 0 auto; padding: 3rem 1.25rem 5rem; }

@media (min-width: 768px) { .post-wrap { padding: 4rem 2rem 6rem; } }

.post-meta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.post-meta a { text-decoration: none; transition: color 0.2s; }
.post-meta a:hover { color: var(--charcoal); }

.post-h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 4vw, 3rem);
  font-weight: 400;
  line-height: 1.2;
  color: var(--charcoal);
  margin-bottom: 2.5rem;
  letter-spacing: -0.02em;
}

/* ── Markdown prose ─────────────────────── */
.prose h2 {
  font-family: var(--font-serif);
  font-size: 1.625rem;
  font-weight: 400;
  margin-top: 3rem;
  margin-bottom: 1rem;
  color: var(--charcoal);
}

.prose h3 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 400;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: var(--charcoal);
}

.prose p {
  color: var(--slate);
  line-height: 1.75;
  margin-bottom: 1rem;
}

.prose strong { font-weight: 600; color: var(--charcoal); }
.prose em { font-style: italic; }

.prose ul { margin: 1rem 0; padding-left: 1.5rem; }
.prose ol { margin: 1rem 0; padding-left: 1.5rem; }
.prose li { color: var(--slate); margin-bottom: 0.35rem; line-height: 1.7; }

.prose .check-item {
  display: flex;
  gap: 0.625rem;
  align-items: flex-start;
  list-style: none;
  margin-left: 0;
  padding-left: 0;
  margin-bottom: 0.375rem;
  color: var(--slate);
}

.prose .check-item .check-icon { flex-shrink: 0; margin-top: 0.1em; }
.prose .check-item.yes .check-icon { color: var(--forest); }
.prose .check-item.no  .check-icon { color: var(--pewter); }

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9375rem;
}

.prose td, .prose th {
  border: 1px solid var(--stone);
  padding: 0.625rem 1rem;
  text-align: left;
  color: var(--slate);
}

.prose th { background: var(--parchment); font-weight: 600; color: var(--charcoal); }

.prose code {
  background: var(--parchment);
  padding: 0.1em 0.4em;
  font-family: 'Fira Code', monospace;
  font-size: 0.875em;
}

.prose pre {
  background: var(--parchment);
  border: 1px solid var(--stone);
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  border-radius: var(--radius);
}

.prose pre code { background: none; padding: 0; font-size: 0.875rem; }

.prose .check-list { list-style: none; padding: 0; margin: 1rem 0; }
.prose .check-item { display: flex; gap: 0.5rem; align-items: flex-start; margin-bottom: 0.4rem; color: var(--slate); }
.prose .check-item .check-icon { flex-shrink: 0; margin-top: 0.15em; font-style: normal; }
.prose .check-item.yes .check-icon { color: var(--forest); }
.prose .check-item.no  .check-icon { color: var(--pewter); }

/* ── Post CTA ───────────────────────────── */
.post-cta {
  margin-top: 3.5rem;
  background: var(--forest-pale);
  border: 1px solid rgba(44,74,46,.2);
  padding: 2rem;
}

.post-cta h3 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
}

.post-cta p { font-size: 0.9375rem; color: var(--slate); margin-bottom: 1.25rem; }

.cta-btns { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.btn-primary {
  background: var(--forest);
  color: var(--white);
  padding: 0.625rem 1.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  display: inline-block;
  transition: background 0.2s;
}

.btn-primary:hover { background: var(--forest-light); }

.btn-outline {
  border: 1px solid var(--charcoal);
  color: var(--charcoal);
  padding: 0.625rem 1.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  display: inline-block;
  transition: background 0.2s, color 0.2s;
}

.btn-outline:hover { background: var(--charcoal); color: var(--white); }

/* ── Related posts ──────────────────────── */
.related-section {
  background: var(--parchment);
  border-top: 1px solid var(--stone);
  padding: 4rem 0;
}

.section-heading {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 400;
  margin-bottom: 2rem;
}

.related-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 640px) {
  .related-grid { grid-template-columns: repeat(2, 1fr); }
}

.related-article a { text-decoration: none; }

.related-img {
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--parchment);
  margin-bottom: 1rem;
}

.related-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.related-article:hover .related-img img { transform: scale(1.04); }

.related-title {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-weight: 400;
  color: var(--charcoal);
  transition: color 0.2s;
  line-height: 1.4;
}

.related-article:hover .related-title { color: var(--forest); }

/* ── Footer ─────────────────────────────── */
.site-footer {
  background: var(--charcoal);
  color: rgba(255,255,255,.5);
  padding: 2.5rem 0;
  font-size: 0.875rem;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

@media (min-width: 768px) {
  .footer-inner { flex-direction: row; justify-content: space-between; align-items: center; }
}

.footer-logo {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  color: rgba(255,255,255,.85);
  text-decoration: none;
}

.footer-logo span { color: #8db090; }

.footer-links { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.footer-links a { color: rgba(255,255,255,.45); text-decoration: none; font-size: 0.8125rem; transition: color 0.2s; }
.footer-links a:hover { color: rgba(255,255,255,.8); }

/* ── Breadcrumb ─────────────────────────── */
.breadcrumb {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.8125rem;
  color: var(--pewter);
  margin-bottom: 1rem;
}

.breadcrumb a { color: var(--pewter); text-decoration: none; transition: color 0.2s; }
.breadcrumb a:hover { color: var(--slate); }
.breadcrumb span { opacity: .4; }
