/*
 Theme Name:   Transzhumanizmus Child
 Theme URI:    https://transzhumanizmus.hu
 Description:  GeneratePress child theme – Academic Minimal design system
 Author:       transzhumanizmus.hu
 Author URI:   https://transzhumanizmus.hu
 Template:     generatepress
 Version:      1.0.0
 License:      GNU General Public License v2 or later
 Text Domain:  th-child
*/

/* ═══════════════════════════════════════════════════
   1. DESIGN TOKENS (CSS Custom Properties)
   ═══════════════════════════════════════════════════ */

:root {
  /* ── Szín rendszer (HSL) ── */

  /* Alap */
  --th-bg:              40 25% 97%;      /* meleg ivory */
  --th-fg:              220 20% 12%;     /* mély szürke-kék */

  /* Kártya */
  --th-card:            40 20% 95%;
  --th-card-fg:         220 20% 12%;

  /* Elsődleges – mély teal-kék */
  --th-primary:         200 55% 22%;
  --th-primary-fg:      40 25% 97%;

  /* Másodlagos */
  --th-secondary:       40 15% 92%;
  --th-secondary-fg:    220 20% 18%;

  /* Tompított */
  --th-muted:           40 12% 93%;
  --th-muted-fg:        220 10% 46%;

  /* Akcentus – meleg arany */
  --th-accent:          42 75% 52%;
  --th-accent-fg:       220 20% 10%;

  /* Szegély & bevitel */
  --th-border:          40 15% 88%;
  --th-input:           40 15% 88%;
  --th-ring:            200 55% 22%;

  /* Destruktív */
  --th-destructive:     0 72% 51%;
  --th-destructive-fg:  0 0% 100%;

  /* ── Speciális tokenek ── */
  --th-hero-gradient:   linear-gradient(135deg, hsl(200 55% 18%), hsl(210 40% 12%));
  --th-hero-overlay:    linear-gradient(to right, hsl(200 55% 18% / 0.92), hsl(210 40% 12% / 0.75));
  --th-gold-glow:       0 4px 20px -4px hsl(42 75% 52% / 0.3);
  --th-card-shadow:     0 1px 3px 0 hsl(220 20% 12% / 0.06), 0 1px 2px -1px hsl(220 20% 12% / 0.06);
  --th-card-shadow-hover: 0 10px 30px -8px hsl(220 20% 12% / 0.1);

  /* ── Tipográfia ── */
  --th-font-serif:      'Source Serif 4', Georgia, serif;
  --th-font-sans:       'Inter', system-ui, sans-serif;

  /* ── Térköz skála (8px alap) ── */
  --th-space-1:  0.25rem;   /* 4px  */
  --th-space-2:  0.5rem;    /* 8px  */
  --th-space-3:  0.75rem;   /* 12px */
  --th-space-4:  1rem;      /* 16px */
  --th-space-5:  1.5rem;    /* 24px */
  --th-space-6:  2rem;      /* 32px */
  --th-space-8:  3rem;      /* 48px */
  --th-space-10: 4rem;      /* 64px */
  --th-space-12: 5rem;      /* 80px */

  /* ── Lekerekítés ── */
  --th-radius:   0.375rem;
}

/* ═══════════════════════════════════════════════════
   2. SÖTÉT MÓD
   ═══════════════════════════════════════════════════ */

@media (prefers-color-scheme: dark) {
  :root {
    --th-bg:            220 20% 8%;
    --th-fg:            40 15% 90%;

    --th-card:          220 18% 12%;
    --th-card-fg:       40 15% 90%;

    --th-primary:       200 50% 60%;
    --th-primary-fg:    220 20% 8%;

    --th-secondary:     220 15% 16%;
    --th-secondary-fg:  40 15% 88%;

    --th-muted:         220 15% 16%;
    --th-muted-fg:      220 10% 55%;

    --th-accent:        42 70% 55%;
    --th-accent-fg:     220 20% 8%;

    --th-border:        220 15% 20%;
    --th-input:         220 15% 20%;
    --th-ring:          200 50% 60%;

    --th-destructive:   0 62.8% 30.6%;

    --th-hero-gradient: linear-gradient(135deg, hsl(220 25% 6%), hsl(220 20% 4%));
    --th-hero-overlay:  linear-gradient(to right, hsl(220 25% 6% / 0.95), hsl(220 20% 4% / 0.8));
    --th-card-shadow:   0 1px 3px 0 hsl(0 0% 0% / 0.2);
    --th-card-shadow-hover: 0 10px 30px -8px hsl(0 0% 0% / 0.3);
  }
}


/* ═══════════════════════════════════════════════════
   3. ALAP STÍLUSOK
   ═══════════════════════════════════════════════════ */

body {
  background-color: hsl(var(--th-bg));
  color: hsl(var(--th-fg));
  font-family: var(--th-font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--th-font-serif);
  letter-spacing: -0.01em;
  color: hsl(var(--th-fg));
}

a {
  color: hsl(var(--th-primary));
  text-decoration: none;
  transition: color 0.2s;
}
a:hover {
  color: hsl(var(--th-primary) / 0.8);
}


/* ═══════════════════════════════════════════════════
   4. HEADER / NAVIGÁCIÓ
   ═══════════════════════════════════════════════════ */

.th-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: hsl(var(--th-bg) / 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid hsl(var(--th-border));
}

.th-header__logo-mark {
  width: 2rem;
  height: 2rem;
  border-radius: var(--th-radius);
  background: hsl(var(--th-primary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: hsl(var(--th-primary-fg));
  font-family: var(--th-font-serif);
  font-weight: 700;
  font-size: 1.125rem;
}

.th-nav-link {
  padding: var(--th-space-2) var(--th-space-3);
  font-size: 0.875rem;
  font-family: var(--th-font-sans);
  font-weight: 500;
  color: hsl(var(--th-muted-fg));
  border-radius: var(--th-radius);
  transition: color 0.2s, background 0.2s;
}
.th-nav-link:hover {
  color: hsl(var(--th-fg));
}
.th-nav-link--active {
  color: hsl(var(--th-primary));
  background: hsl(var(--th-primary) / 0.05);
}


/* ═══════════════════════════════════════════════════
   5. HERO SZEKCIÓ
   ═══════════════════════════════════════════════════ */

.th-hero {
  position: relative;
  overflow: hidden;
}
.th-hero__overlay {
  position: absolute;
  inset: 0;
  background: var(--th-hero-overlay);
}
.th-hero__label {
  font-size: 0.75rem;
  font-family: var(--th-font-sans);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: hsl(var(--th-accent));
}
.th-hero__title {
  font-family: var(--th-font-serif);
  font-weight: 700;
  color: hsl(var(--th-primary-fg));
  line-height: 1.1;
  text-wrap: balance;
}
.th-hero__body {
  color: hsl(var(--th-primary-fg) / 0.7);
  line-height: 1.6;
}
.th-hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: var(--th-space-3) var(--th-space-5);
  background: hsl(var(--th-accent));
  color: hsl(var(--th-accent-fg));
  font-family: var(--th-font-sans);
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: 2px;
  transition: background 0.2s;
}
.th-hero__cta:hover {
  background: hsl(var(--th-accent) / 0.9);
  color: hsl(var(--th-accent-fg));
}


/* ═══════════════════════════════════════════════════
   6. CIKK KÁRTYA
   ═══════════════════════════════════════════════════ */

.th-card {
  background: hsl(var(--th-card));
  border: 1px solid hsl(var(--th-border));
  border-radius: var(--th-radius);
  box-shadow: var(--th-card-shadow);
  transition: box-shadow 0.3s, transform 0.3s;
  overflow: hidden;
}
.th-card:hover {
  box-shadow: var(--th-card-shadow-hover);
  transform: translateY(-2px);
}

.th-card__badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  font-size: 0.6875rem;
  font-family: var(--th-font-sans);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 2px;
}
/* Kategória színek */
.th-card__badge--tudomany    { background: hsl(200 55% 22% / 0.1); color: hsl(200 55% 35%); }
.th-card__badge--elettartam  { background: hsl(150 45% 40% / 0.1); color: hsl(150 45% 30%); }
.th-card__badge--ai          { background: hsl(260 45% 55% / 0.1); color: hsl(260 45% 45%); }
.th-card__badge--etika       { background: hsl(30 60% 50% / 0.1);  color: hsl(30 60% 35%);  }

.th-card__title {
  font-family: var(--th-font-serif);
  font-weight: 600;
  color: hsl(var(--th-fg));
  line-height: 1.3;
}
.th-card__excerpt {
  color: hsl(var(--th-muted-fg));
  font-size: 0.875rem;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.th-card__meta {
  font-size: 0.75rem;
  color: hsl(var(--th-muted-fg));
  font-family: var(--th-font-sans);
}


/* ═══════════════════════════════════════════════════
   7. CIKK OLVASÓ (PROSE)
   ═══════════════════════════════════════════════════ */

.th-prose {
  font-family: var(--th-font-serif);
  font-size: 1.125rem;
  line-height: 1.8;
  color: hsl(var(--th-fg));
  max-width: 72ch;
}

.th-prose p {
  margin-bottom: var(--th-space-5);
}

.th-prose h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: var(--th-space-12);
  margin-bottom: var(--th-space-4);
}

.th-prose h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: var(--th-space-8);
  margin-bottom: var(--th-space-3);
}

/* Idézet / Pull quote */
.th-prose blockquote {
  border-left: 4px solid hsl(var(--th-accent));
  padding-left: var(--th-space-5);
  padding-top: var(--th-space-2);
  padding-bottom: var(--th-space-2);
  margin: var(--th-space-8) 0;
  font-style: italic;
  font-size: 1.25rem;
  line-height: 1.6;
  color: hsl(var(--th-muted-fg));
}

/* Hivatkozás */
.th-prose a {
  color: hsl(var(--th-primary));
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: hsl(var(--th-primary) / 0.3);
  transition: text-decoration-color 0.2s;
}
.th-prose a:hover {
  text-decoration-color: hsl(var(--th-primary));
}

/* Lábjegyzet hivatkozás */
.th-prose sup {
  font-size: 0.75rem;
  color: hsl(var(--th-primary));
  cursor: pointer;
  transition: color 0.2s;
}
.th-prose sup:hover {
  color: hsl(var(--th-accent));
}

/* Ábra / kép felirat */
.th-prose figure {
  margin: var(--th-space-8) 0;
}
.th-prose figcaption {
  font-size: 0.875rem;
  color: hsl(var(--th-muted-fg));
  margin-top: var(--th-space-2);
  text-align: center;
  font-style: italic;
}


/* ═══════════════════════════════════════════════════
   8. TUDOMÁNYOS TÁBLÁZAT
   ═══════════════════════════════════════════════════ */

.th-prose table,
.th-table {
  width: 100%;
  margin: var(--th-space-8) 0;
  font-size: 0.875rem;
  border-collapse: collapse;
}

.th-prose thead,
.th-table thead {
  border-bottom: 2px solid hsl(var(--th-primary) / 0.2);
}

.th-prose th,
.th-table th {
  text-align: left;
  padding: var(--th-space-3) var(--th-space-4);
  font-family: var(--th-font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: hsl(var(--th-fg));
}

.th-prose td,
.th-table td {
  padding: var(--th-space-3) var(--th-space-4);
  border-bottom: 1px solid hsl(var(--th-border));
}


/* ═══════════════════════════════════════════════════
   9. LÁBJEGYZETEK
   ═══════════════════════════════════════════════════ */

.th-footnotes {
  font-size: 0.875rem;
  color: hsl(var(--th-muted-fg));
  border-top: 1px solid hsl(var(--th-border));
  padding-top: var(--th-space-5);
  margin-top: var(--th-space-12);
}

.th-footnotes p {
  margin-bottom: var(--th-space-2);
  padding-left: var(--th-space-5);
  position: relative;
}

.th-footnotes p::before {
  content: attr(data-note);
  position: absolute;
  left: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: hsl(var(--th-primary));
  font-family: var(--th-font-sans);
}


/* ═══════════════════════════════════════════════════
   10. TARTALOMJEGYZÉK (STICKY TOC)
   ═══════════════════════════════════════════════════ */

.th-toc {
  position: sticky;
  top: 6rem;
  padding: var(--th-space-5);
  border-left: 2px solid hsl(var(--th-border));
}

.th-toc__title {
  font-family: var(--th-font-sans);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: hsl(var(--th-muted-fg));
  margin-bottom: var(--th-space-4);
}

.th-toc__link {
  display: block;
  padding: var(--th-space-1) 0;
  font-size: 0.8125rem;
  font-family: var(--th-font-sans);
  color: hsl(var(--th-muted-fg));
  transition: color 0.2s;
}
.th-toc__link:hover,
.th-toc__link--active {
  color: hsl(var(--th-primary));
}


/* ═══════════════════════════════════════════════════
   11. NEWSLETTER SZEKCIÓ
   ═══════════════════════════════════════════════════ */

.th-newsletter {
  background: hsl(var(--th-primary));
  color: hsl(var(--th-primary-fg));
  padding: var(--th-space-12) 0;
}

.th-newsletter__title {
  font-family: var(--th-font-serif);
  font-weight: 700;
  color: hsl(var(--th-primary-fg));
}

.th-newsletter__input {
  background: hsl(var(--th-primary-fg) / 0.1);
  border: 1px solid hsl(var(--th-primary-fg) / 0.2);
  color: hsl(var(--th-primary-fg));
  padding: var(--th-space-3) var(--th-space-4);
  border-radius: var(--th-radius);
  font-family: var(--th-font-sans);
  font-size: 0.875rem;
}
.th-newsletter__input::placeholder {
  color: hsl(var(--th-primary-fg) / 0.5);
}

.th-newsletter__btn {
  background: hsl(var(--th-accent));
  color: hsl(var(--th-accent-fg));
  padding: var(--th-space-3) var(--th-space-5);
  font-family: var(--th-font-sans);
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: var(--th-radius);
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}
.th-newsletter__btn:hover {
  background: hsl(var(--th-accent) / 0.9);
}


/* ═══════════════════════════════════════════════════
   12. KATEGÓRIA JELVÉNYEK
   ═══════════════════════════════════════════════════ */

.th-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  font-family: var(--th-font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 9999px;
  background: hsl(var(--th-secondary));
  color: hsl(var(--th-secondary-fg));
}


/* ═══════════════════════════════════════════════════
   13. FOOTER
   ═══════════════════════════════════════════════════ */

.th-footer {
  background: hsl(var(--th-card));
  border-top: 1px solid hsl(var(--th-border));
  margin-top: var(--th-space-12);
}

.th-footer__heading {
  font-family: var(--th-font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: hsl(var(--th-fg));
  margin-bottom: var(--th-space-4);
}

.th-footer__link {
  font-size: 0.875rem;
  color: hsl(var(--th-muted-fg));
  transition: color 0.2s;
}
.th-footer__link:hover {
  color: hsl(var(--th-primary));
}


/* ═══════════════════════════════════════════════════
   14. GOMBOK
   ═══════════════════════════════════════════════════ */

.th-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--th-font-sans);
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: var(--th-radius);
  border: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.th-btn--primary {
  background: hsl(var(--th-primary));
  color: hsl(var(--th-primary-fg));
  padding: var(--th-space-3) var(--th-space-5);
}
.th-btn--primary:hover { background: hsl(var(--th-primary) / 0.9); }

.th-btn--accent {
  background: hsl(var(--th-accent));
  color: hsl(var(--th-accent-fg));
  padding: var(--th-space-3) var(--th-space-5);
}
.th-btn--accent:hover { background: hsl(var(--th-accent) / 0.9); }

.th-btn--outline {
  background: transparent;
  border: 1px solid hsl(var(--th-border));
  color: hsl(var(--th-fg));
  padding: var(--th-space-2) var(--th-space-4);
}
.th-btn--outline:hover {
  background: hsl(var(--th-muted));
}

.th-btn--ghost {
  background: transparent;
  color: hsl(var(--th-primary));
  padding: var(--th-space-2) var(--th-space-4);
}
.th-btn--ghost:hover {
  background: hsl(var(--th-primary) / 0.05);
}


/* ═══════════════════════════════════════════════════
   15. KERESÉS
   ═══════════════════════════════════════════════════ */

.th-search__input {
  width: 100%;
  padding: var(--th-space-3) var(--th-space-4);
  padding-left: 2.5rem;
  background: hsl(var(--th-muted));
  border: none;
  border-radius: var(--th-radius);
  font-size: 0.875rem;
  font-family: var(--th-font-sans);
  outline: none;
  transition: box-shadow 0.2s;
}
.th-search__input:focus {
  box-shadow: 0 0 0 2px hsl(var(--th-primary) / 0.2);
}


/* ═══════════════════════════════════════════════════
   16. SZERZŐI DOBOZ
   ═══════════════════════════════════════════════════ */

.th-author-box {
  display: flex;
  align-items: center;
  gap: var(--th-space-3);
}

.th-author-box__avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  background: hsl(var(--th-muted));
  object-fit: cover;
}

.th-author-box__name {
  font-family: var(--th-font-sans);
  font-weight: 600;
  font-size: 0.875rem;
  color: hsl(var(--th-fg));
}

.th-author-box__date {
  font-family: var(--th-font-sans);
  font-size: 0.75rem;
  color: hsl(var(--th-muted-fg));
}


/* ═══════════════════════════════════════════════════
   17. RESZPONZÍV MOBIL TIPOGRÁFIA
   ═══════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .th-prose {
    font-size: 1rem;
    line-height: 1.75;
  }
  .th-prose h2 {
    font-size: 1.25rem;
    margin-top: var(--th-space-8);
  }
  .th-prose h3 {
    font-size: 1.125rem;
    margin-top: var(--th-space-6);
  }
  .th-prose blockquote {
    font-size: 1.0625rem;
    padding-left: var(--th-space-4);
  }
}


/* ═══════════════════════════════════════════════════
   18. AKADÁLYMENTESSÉG (FOCUS)
   ═══════════════════════════════════════════════════ */

*:focus-visible {
  outline: 2px solid hsl(var(--th-ring));
  outline-offset: 2px;
}


/* ═══════════════════════════════════════════════════
   19. ANIMÁCIÓK
   ═══════════════════════════════════════════════════ */

@keyframes th-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.th-animate-fade-in {
  animation: th-fade-in 0.5s ease-out forwards;
}

@media (prefers-reduced-motion: reduce) {
  .th-animate-fade-in {
    animation: none;
    opacity: 1;
  }
}
