/*
 * home.css — Homepage-only stylesheet
 * Theme : 2025
 * Author: Naser Shahsavar (iNaser)
 *
 * Design direction: editorial minimalism with a strong typographic voice.
 * Monochrome base, a single warm accent, generous whitespace, sharp details.
 * No utility bloat — every rule has a purpose.
 *
 * Load order: Vazirmatn font → home.css (both enqueued via wp_enqueue_scripts).
 */

/* ============================================================
   0. DESIGN TOKENS
   ============================================================ */
:root {
  /* Palette */
  --c-bg: #f7f5f2; /* warm off-white */
  --c-surface: #ffffff;
  --c-ink: #1a1a18; /* near-black */
  --c-ink-muted: #5c5c58;
  --c-accent: #c8500a; /* burnt orange */
  --c-accent-h: #a33f06; /* hover state  */
  --c-border: #e2ddd8;

  /* Typography */
  --f-display: "Vazirmatn", "Georgia", serif;
  --f-body: "Vazirmatn", system-ui, -apple-system, sans-serif;

  --fs-xs: 0.75rem; /*  12 px */
  --fs-sm: 0.875rem; /*  14 px */
  --fs-base: 1rem; /*  16 px */
  --fs-lg: 1.125rem; /*  18 px */
  --fs-xl: 1.375rem; /*  22 px */
  --fs-2xl: 1.75rem; /*  28 px */
  --fs-3xl: 2.5rem; /*  40 px */

  --lh-tight: 1.2;
  --lh-body: 1.7;

  /* Layout */
  --max-w: 900px;
  --gap: 2rem;
  --radius: 6px;
  --radius-lg: 12px;

  /* Motion */
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --dur-fast: 150ms;
  --dur-base: 260ms;
}

/* ============================================================
   1. RESET / BASE
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--f-body);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  color: var(--c-ink);
  background-color: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--c-accent);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
}

a:hover,
a:focus-visible {
  color: var(--c-accent-h);
  text-decoration: underline;
}

:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 3px;
  border-radius: 2px;
}

ul[role="list"] {
  list-style: none;
}

/* ============================================================
   2. LAYOUT HELPERS
   ============================================================ */
.site-header,
.site-main,
.site-footer {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

/* ============================================================
   3. SITE HEADER / NAV
   ============================================================ */
.site-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-block: 1.25rem;
}

.site-nav {
  display: flex;
  gap: 1rem;
}

.nav-lang {
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--c-ink-muted);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition:
    color var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease);
}

.nav-lang:hover,
.nav-lang:focus-visible {
  color: var(--c-accent);
  border-color: var(--c-accent);
  text-decoration: none;
}

/* ============================================================
   4. HERO SECTION
   ============================================================ */
.hero-section {
  padding-block: 3.5rem 4rem;
}

.hero-inner {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

/* ── Avatar ── */
.hero-avatar {
  flex-shrink: 0;
}

.hero-avatar img {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  object-fit: cover;
  /* Subtle ring to lift it off the bg */
  box-shadow:
    0 0 0 4px var(--c-bg),
    0 0 0 6px var(--c-border);
  /* Fade-in on load */
  animation: avatarReveal 0.6s var(--ease) both;
}

@keyframes avatarReveal {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ── Content ── */
.hero-content {
  animation: slideUp 0.55s var(--ease) 0.1s both;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-title {
  font-family: var(--f-display);
  font-size: var(--fs-3xl);
  font-weight: 800;
  line-height: var(--lh-tight);
  letter-spacing: -0.02em;
  color: var(--c-ink);
  margin-bottom: 0.35rem;
}

.hero-subtitle {
  font-size: var(--fs-lg);
  color: var(--c-accent);
  font-weight: 600;
  letter-spacing: 0.01em;
  margin-bottom: 1.25rem;
}

.hero-bio {
  font-size: var(--fs-base);
  color: var(--c-ink-muted);
  line-height: var(--lh-body);
  max-width: 56ch;
  margin-bottom: 1rem;
}

.hero-bio strong {
  color: var(--c-ink);
  font-weight: 700;
}

.hero-contact {
  font-size: var(--fs-sm);
  color: var(--c-ink-muted);
  margin-bottom: 1.75rem;
}

.hero-email {
  font-weight: 600;
  margin-left: 0.25rem;
}

/* ── CTA buttons ── */
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
}

.btn {
  display: inline-block;
  padding: 0.5rem 1.1rem;
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: var(--radius);
  transition:
    background-color var(--dur-fast) var(--ease),
    color var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast) var(--ease);
  text-decoration: none !important;
  cursor: pointer;
  white-space: nowrap;
}

.btn-outline {
  border: 1.5px solid var(--c-ink);
  color: var(--c-ink);
  background: transparent;
}

.btn-outline:hover,
.btn-outline:focus-visible {
  background: var(--c-ink);
  color: var(--c-bg);
  text-decoration: none;
}

.btn-ghost {
  border: 1.5px solid var(--c-border);
  color: var(--c-ink-muted);
  background: transparent;
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
  border-color: var(--c-ink-muted);
  color: var(--c-ink);
  text-decoration: none;
}

/* ============================================================
   5. POSTS SECTION
   ============================================================ */
.posts-section {
  padding-block: 3rem 4.5rem;
  border-top: 1px solid var(--c-border);
}

.posts-heading {
  font-family: var(--f-display);
  font-size: var(--fs-xl);
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--c-ink);
  margin-bottom: 2rem;
}

/* ── Grid ── */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

/* ── Post card ── */
.post-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition:
    box-shadow var(--dur-base) var(--ease),
    transform var(--dur-base) var(--ease);
}

.post-card:hover {
  box-shadow: 0 8px 28px -6px rgba(0, 0, 0, 0.12);
  transform: translateY(-3px);
}

/* Thumbnail */
.post-card__thumb {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--c-border);
}

.post-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s var(--ease);
}

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

/* Body */
.post-card__body {
  padding: 1rem 1.1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.post-card__title {
  font-family: var(--f-display);
  font-size: var(--fs-base);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.post-card__title a {
  color: var(--c-ink);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
}

.post-card__title a:hover,
.post-card__title a:focus-visible {
  color: var(--c-accent);
  text-decoration: none;
}

.post-card__date {
  font-size: var(--fs-xs);
  color: var(--c-ink-muted);
  font-variant-numeric: tabular-nums;
}

/* ── "All Posts" link ── */
.posts-more {
  text-align: center;
}

/* ============================================================
   6. SITE FOOTER
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--c-border);
  padding-block: 1.5rem;
  text-align: center;
}

.footer-copy {
  font-size: var(--fs-xs);
  color: var(--c-ink-muted);
}

.footer-copy a {
  color: var(--c-ink-muted);
  font-weight: 600;
}

.footer-copy a:hover {
  color: var(--c-accent);
}

/* ============================================================
   7. RESPONSIVE — TABLET  (≤ 720 px)
   ============================================================ */
@media (max-width: 720px) {
  .hero-inner {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .hero-content {
    max-width: 100%;
  }

  .hero-bio {
    max-width: 100%;
  }

  .hero-cta {
    justify-content: center;
  }

  .posts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================================
   8. RESPONSIVE — MOBILE  (≤ 480 px)
   ============================================================ */
@media (max-width: 480px) {
  :root {
    --fs-3xl: 1.875rem; /* scale down hero title */
  }

  .hero-avatar img {
    width: 160px;
    height: 160px;
  }

  .posts-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   9. REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
