/* ═══════════════════════════════════════════════════════════════
   main.css — Zavify WordPress Theme
   Global layout, components, utilities shared across all pages
═══════════════════════════════════════════════════════════════ */

/* ─── Scroll-in Animations (progressive enhancement) ────────
   Elements are ALWAYS visible. The .zavify-js class is added to
   body by JS — only then do elements animate in on scroll.
   This means posts always show even if JS is slow/blocked.
─────────────────────────────────────────────────────────────── */
.anim { opacity: 1; transform: none; }

body.zavify-js .anim {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s cubic-bezier(0.22,1,0.36,1),
              transform 0.6s cubic-bezier(0.22,1,0.36,1);
}
body.zavify-js .anim.in-view {
  opacity: 1;
  transform: none;
}
body.zavify-js .anim-delay-1 { transition-delay: 0.07s; }
body.zavify-js .anim-delay-2 { transition-delay: 0.14s; }
body.zavify-js .anim-delay-3 { transition-delay: 0.21s; }
body.zavify-js .anim-delay-4 { transition-delay: 0.28s; }
body.zavify-js .anim-delay-5 { transition-delay: 0.35s; }
body.zavify-js .anim-delay-6 { transition-delay: 0.42s; }

/* ─── Typography ────────────────────────────────────────────── */
.text-xs    { font-size: 0.75rem; line-height: 1.4; }
.text-sm    { font-size: 0.875rem; line-height: 1.5; }
.text-base  { font-size: 1rem; line-height: 1.6; }
.text-lg    { font-size: 1.125rem; line-height: 1.5; }
.text-xl    { font-size: 1.25rem; line-height: 1.4; }
.text-2xl   { font-size: 1.5rem; line-height: 1.3; }
.text-3xl   { font-size: 1.875rem; line-height: 1.2; }
.text-4xl   { font-size: 2.25rem; line-height: 1.1; }
.text-5xl   { font-size: 3rem; line-height: 1.0; }
.text-6xl   { font-size: 3.75rem; line-height: 0.95; }
.text-7xl   { font-size: 4.5rem; line-height: 0.92; }
.text-8xl   { font-size: 6rem; line-height: 0.9; }

.font-mono   { font-family: var(--font-mono); }
.font-display { font-family: var(--font-display); }
.font-semibold { font-weight: 600; }
.font-bold   { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.font-black  { font-weight: 900; }

.tracking-tight  { letter-spacing: -0.035em; }
.tracking-wide   { letter-spacing: 0.05em; }
.tracking-widest { letter-spacing: 0.2em; }
.uppercase { text-transform: uppercase; }
.text-balance { text-wrap: balance; }

.text-muted    { color: var(--muted-foreground); }
.text-foreground { color: var(--foreground); }
.text-background { color: var(--background); }

/* ─── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 0.875rem;
  padding: 0.625rem 1.25rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s;
  border: none;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background-color: var(--foreground);
  color: var(--background);
  box-shadow: var(--shadow-soft);
}
.btn-primary:hover { box-shadow: var(--shadow-lift); }

.btn-accent {
  background-color: var(--accent);
  color: var(--foreground);
}
.btn-accent:hover { box-shadow: var(--shadow-glow); }

.btn-ghost {
  background-color: transparent;
  color: var(--foreground);
  border: 1.5px solid var(--border-strong);
}
.btn-ghost:hover { background-color: var(--muted); }

/* ─── Badges / Pills ────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  line-height: 1;
}
.badge-outline {
  border: 1.5px solid var(--border-strong);
  background-color: var(--card);
  color: var(--foreground);
}
.badge-accent {
  background-color: var(--accent);
  color: var(--foreground);
}
.badge-dark {
  background-color: var(--foreground);
  color: var(--background);
}
.badge-muted {
  background-color: var(--muted);
  color: var(--muted-foreground);
  border: 1px solid var(--border);
}

/* ─── Cards ─────────────────────────────────────────────────── */
.card {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-3xl);
  padding: 1.75rem;
  box-shadow: var(--shadow-soft);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
}

/* ─── Section spacing ───────────────────────────────────────── */
.section {
  padding-block: 6rem;
}
.section--border {
  border-bottom: 1px solid var(--border);
}
.section--muted {
  background-color: var(--muted);
}
.section--dark {
  background-color: var(--foreground);
  color: var(--background);
}

/* ─── Section headings ──────────────────────────────────────── */
.section-header {
  text-align: center;
  margin-bottom: 3.5rem;
}
.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background-color: var(--card);
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--foreground);
  margin-bottom: 1rem;
}
.section-eyebrow::before {
  content: '';
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--accent);
}
.section-eyebrow--dark {
  background-color: var(--foreground);
  color: var(--accent);
  border-color: transparent;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 3.75rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.0;
  color: inherit;
}

/* ─── Post meta row ─────────────────────────────────────────── */
.post-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted-foreground);
}
.post-meta__cat {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  background-color: var(--accent);
  color: var(--foreground);
  text-decoration: none;
  font-weight: 700;
  transition: opacity 0.2s;
}
.post-meta__cat:hover { opacity: 0.8; }
.post-meta__dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background-color: var(--border-strong);
}

/* ─── Pagination ────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding-top: 3rem;
  flex-wrap: wrap;
}
.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding-inline: 0.75rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 700;
  border: 1.5px solid var(--border);
  background-color: var(--card);
  color: var(--foreground);
  transition: all 0.2s;
  text-decoration: none;
}
.pagination a:hover {
  background-color: var(--foreground);
  color: var(--background);
  border-color: var(--foreground);
  transform: translateY(-1px);
}
.pagination .current {
  background-color: var(--accent);
  border-color: var(--accent);
  color: var(--foreground);
}

/* ─── Tags cloud ────────────────────────────────────────────── */
.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.tags-list a {
  display: inline-flex;
  padding: 0.3rem 0.8rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1.5px solid var(--border);
  background-color: var(--card);
  color: var(--muted-foreground);
  transition: all 0.2s;
  text-decoration: none;
}
.tags-list a:hover {
  background-color: var(--accent);
  border-color: var(--accent);
  color: var(--foreground);
}

/* ─── Background patterns ───────────────────────────────────── */
.bg-grid {
  background-image:
    linear-gradient(to right, rgba(15,15,15,0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15,15,15,0.06) 1px, transparent 1px);
  background-size: 56px 56px;
}
.bg-dots {
  background-image: radial-gradient(rgba(15,15,15,0.12) 1px, transparent 1px);
  background-size: 20px 20px;
}

/* ─── Arrow icon helper ─────────────────────────────────────── */
.arrow-icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: middle;
  transition: transform 0.2s;
}
.arrow-icon--rotate { transform: rotate(45deg); }

/* ─── Responsive grid helpers ───────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .section { padding-block: 4rem; }
}

/* ─── Focus styles (accessibility) ─────────────────────────── */
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ─── Scroll progress bar ───────────────────────────────────── */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  height: 2px;
  background-color: var(--accent);
  transition: width 0.1s linear;
  width: 0%;
  pointer-events: none;
}

/* ─── Skip to content ───────────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  padding: 0.5rem 1rem;
  background-color: var(--accent);
  color: var(--foreground);
  font-weight: 700;
  z-index: 10000;
  transition: top 0.2s;
}
.skip-link:focus { top: 0; }
