/* --- THEME VARIABLES --- */
:root {
  --bg: #ffffff;
  --text: #111111;
  --muted: #666666;
  --border: #e8e8e8;
  --input-bg: #f4f4f4;
  --radius: 8px;
  --btn-bg: #000000;
  --btn-text: #ffffff;
}

[data-theme="dark"] {
  --bg: #0f172a;
  --text: #f8fafc;
  --muted: #94a3b8;
  --border: #1e293b;
  --input-bg: #1e293b;
  --btn-bg: #ffffff;
  --btn-text: #0f172a;
}

/* --- BASE & UTILITIES --- */
.hidden {
  display: none !important;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem 5rem;
}

/* --- SITE HEADER --- */
.site-header {
  width: 100%;
  background-color: var(--bg);
  padding: 1.5rem 2rem;
  box-sizing: border-box;
  transition: background-color 0.2s ease;
  position: relative;
  z-index: 100;
}

.header-container {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.brand {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

ul.nav {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 1.75rem !important;
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

ul.nav li {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

ul.nav li a {
  font-size: 0.925rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.15s ease;
}

ul.nav li a:hover {
  opacity: 0.6;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-left: auto;
}

.theme-toggle-btn,
.search-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s ease;
}

.theme-toggle-btn:hover,
.search-btn:hover {
  opacity: 0.6;
}

.signin-link {
  font-size: 0.925rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.15s ease;
}

.signin-link:hover {
  opacity: 0.6;
}

.subscribe-btn {
  background-color: var(--btn-bg);
  color: var(--btn-text);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  padding: 0.55rem 1.25rem;
  border-radius: 9999px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s ease;
}

.subscribe-btn:hover {
  opacity: 0.85;
}

.strava-btn {
  background-color: #FC4C02;
  color: #ffffff !important;
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  padding: 0.5rem 1.15rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  white-space: nowrap;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.strava-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.strava-btn svg {
  display: block;
}

/* --- HAMBURGER BUTTON & MOBILE MENU PANEL --- */
.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 22px;
  height: 16px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-left: 0.5rem;
}

.hamburger-btn .bar {
  width: 100%;
  height: 2px;
  background-color: var(--text);
  border-radius: 2px;
  transition: all 0.25s ease-in-out;
}

/* Animáció X ikonná nyitott állapotban */
.hamburger-btn.active .bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger-btn.active .bar:nth-child(2) {
  opacity: 0;
}
.hamburger-btn.active .bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Lenyíló mobil menü sáv */
.mobile-menu-overlay {
  position: fixed;
  top: 73px; /* A header magassága */
  left: 0;
  width: 100%;
  height: calc(100vh - 73px);
  background-color: var(--bg);
  display: flex;
  flex-direction: column;
  padding: 2rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.25s ease-in-out;
  z-index: 99;
}

.mobile-menu-overlay.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  list-style: none;
  margin-bottom: 2.5rem;
}

.mobile-nav a {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

.mobile-menu-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: auto;
  padding-bottom: 2rem;
}

.mobile-menu-actions .strava-btn {
  justify-content: center;
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
}

/* --- HERO SECTION --- */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  margin: 2rem 0 6rem;
}

.hero-image-wrapper {
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  overflow: hidden;
}

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

.hero-content h1 {
  font-size: 2.75rem;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.hero-content p {
  font-size: 1.05rem;
  color: var(--muted);
  margin-bottom: 2rem;
  line-height: 1.6;
}

.subscribe-form {
  display: flex;
  background-color: var(--input-bg);
  padding: 4px 4px 4px 16px;
  border-radius: 30px;
  max-width: 420px;
}

.subscribe-form input {
  flex-grow: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.9rem;
  color: var(--text);
}

/* --- POSTS FEED --- */
.posts-feed {
  display: flex;
  flex-direction: column;
  gap: 3.5rem;
}

.post-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  text-decoration: none;
  color: inherit;
}

.post-row-title {
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
  color: var(--text);
}

.post-row:hover .post-row-title {
  opacity: 0.7;
}

.post-row-meta {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.post-row-image-wrapper {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
  overflow: hidden;
  background-color: var(--input-bg);
}

.post-row-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --- SINGLE POST PAGE --- */
.single-post {
  max-width: 760px;
  margin: 0 auto;
}

.back-link {
  display: inline-block;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

.single-header h1 {
  font-size: 2.75rem;
  line-height: 1.2;
  font-weight: 800;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.single-meta {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 2.5rem;
}

.single-feature-image {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 3rem;
}

/* --- TAG PAGE STYLES --- */
.tag-header {
  margin-bottom: 2.5rem;
}

.tag-intro {
  text-align: center;
  margin-bottom: 2rem;
}

.tag-title {
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 0.75rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

.tag-description {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
  max-width: 680px;
  margin: 0 auto;
}

.tag-image-wrapper {
  width: 100%;
  height: 280px;
  border-radius: var(--radius);
  overflow: hidden;
  background-color: var(--input-bg);
}

.tag-feature-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Alkategória Menüsáv & Filter Buttons */
.subtag-nav {
  margin: 2rem 0 3.5rem;
  padding: 1rem;
  background-color: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.subtag-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
}

.subtag-btn {
  background-color: var(--bg);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  padding: 0.45rem 1.15rem;
  border-radius: 9999px;
  border: 1px solid var(--border);
  white-space: nowrap;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
}

.subtag-btn:hover {
  background-color: var(--btn-bg);
  color: var(--btn-text);
  border-color: var(--btn-bg);
  transform: translateY(-1px);
}

.subtag-btn.active {
  background-color: var(--btn-bg);
  color: var(--btn-text);
  border-color: var(--btn-bg);
}

/* --- GHOST CONTENT IMAGE CONSTRAINTS --- */
.ghost-post-body {
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--text);
}

.ghost-post-body p {
  margin-bottom: 1.75rem;
}

.ghost-post-body figure,
.ghost-post-body .kg-card,
.ghost-post-body .kg-image-card {
  margin: 2.5rem 0;
  max-width: 100% !important;
  width: 100% !important;
}

.ghost-post-body img,
.ghost-post-body figure img,
.ghost-post-body .kg-image {
  max-width: 100% !important;
  width: 100% !important;
  height: auto !important;
  object-fit: cover;
  border-radius: var(--radius);
  display: block;
}

.kg-width-wide {
  width: 100%;
  max-width: 100%;
}

.kg-width-full {
  width: 100%;
  max-width: 100%;
}

/* --- RESPONSIVE ADJUSTMENTS --- */
@media (max-width: 850px) {
  ul.nav, 
  .desktop-only {
    display: none !important;
  }
  
  .hamburger-btn {
    display: flex;
  }

  .site-header {
    padding: 1rem 1.5rem;
  }

  .container {
    padding: 0 1.5rem 3rem;
  }

  .hero, .post-row {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .hero-content h1 {
    font-size: 2rem;
  }
}