/*
 * BYTEPOINT — Single cikk oldal stílusok
 * v2.4.4
 */

/* ============ ARTICLE HERO ============ */
.article-hero {
  position: relative;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  aspect-ratio: 16/9; overflow: hidden;
  max-height: 50vh;
  background: var(--bg-card);
}
.article-hero img { width: 100%; height: 100%; object-fit: cover; }
.article-hero::after {
  content: ''; position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(5,6,8,.1) 0%, rgba(5,6,8,.5) 60%, rgba(5,6,8,.96) 100%),
    repeating-linear-gradient(0deg, var(--scanline) 0px, var(--scanline) 1px, transparent 1px, transparent 4px);
}
.article-hero-content {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 48px; z-index: 2; color: white;
}
.article-hero-meta {
  display: flex; align-items: center; gap: 12px;
  margin-top: 16px; flex-wrap: wrap;
}
.article-hero-meta .meta-sep { color: rgba(255,255,255,.3); }
.article-hero-meta .meta-item {
  font-family: 'Geist Mono', monospace; font-size: 11px;
  color: rgba(255,255,255,.6); display: flex; align-items: center; gap: 5px;
}
.article-hero-title {
  font-size: 48px; font-weight: 700; line-height: 1.05;
  letter-spacing: -0.03em; max-width: 900px; color: white;
}

/* Hero nélküli fejléc */
.article-hero-text {
  padding: 40px 0 0;
  border-bottom: 1px solid var(--border);
}
.article-hero-title-flat {
  font-size: 36px; font-weight: 700;
  letter-spacing: -0.03em; line-height: 1.1;
  margin: 12px 0 24px;
}

/* ============ ARTICLE LAYOUT ============ */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 48px;
  padding: 24px 0 80px;
  align-items: start;
}
.article-main {}

/* ============ AUTHOR BAR ============ */
.author-bar {
  display: flex !important; align-items: center; justify-content: space-between;
  padding: 16px 20px !important;
  background: var(--bg-elevated) !important; border: 1px solid var(--border) !important;
  margin-bottom: 32px !important; gap: 16px;
  border-radius: 0 !important;
}
.author-info { display: flex; align-items: center; gap: 12px; }
.author-avatar {
  width: 36px !important; height: 36px !important;
  background: var(--border-strong) !important; border: 1px solid var(--border) !important;
  display: flex !important; align-items: center; justify-content: center;
  font-family: 'Geist Mono', monospace !important; font-size: 12px !important;
  font-weight: 700 !important; color: var(--accent) !important; flex-shrink: 0;
  border-radius: 0 !important;
}
.author-name {
  font-family: 'Geist Mono', monospace !important; font-size: 12px !important;
  font-weight: 600 !important; color: var(--text) !important; margin-bottom: 2px;
  display: block;
}
.author-date {
  font-family: 'Geist Mono', monospace !important; font-size: 10px !important;
  color: var(--text-muted) !important; text-transform: uppercase; letter-spacing: 0.08em;
  display: block;
}
.author-stats {
  display: flex; gap: 20px;
  font-family: 'Geist Mono', monospace; font-size: 11px; color: var(--text-muted);
}
.author-stats .val { color: var(--accent); font-weight: 600; }

/* ============ ARTICLE CONTENT ============ */
.article-lead {
  font-size: 19px; line-height: 1.6; color: var(--text-secondary);
  border-left: 3px solid var(--accent); padding-left: 20px;
  margin-bottom: 36px; font-weight: 400;
}

.article-body { color: var(--text); }
.article-body > p,
.article-body p { font-size: 16px; line-height: 1.75; margin-bottom: 24px; color: var(--text-secondary); }
.article-body > h2,
.article-body h2 {
  font-size: 24px !important; font-weight: 700 !important; letter-spacing: -0.02em; color: var(--text) !important;
  margin: 40px 0 16px !important; padding-bottom: 10px !important; border-bottom: 1px solid var(--border) !important;
  display: flex !important; align-items: center; gap: 10px;
  background: none !important;
}
.article-body > h2::before,
.article-body h2::before { content: '//' !important; font-family: 'Geist Mono', monospace; font-size: 14px; color: var(--accent) !important; font-weight: 400 !important; }
.article-body > h3,
.article-body h3 { font-size: 18px !important; font-weight: 600 !important; letter-spacing: -0.01em; color: var(--text) !important; margin: 28px 0 12px !important; }
.article-body ul, .article-body ol { padding-left: 24px; margin-bottom: 24px; color: var(--text-secondary); }
.article-body li { margin-bottom: 6px; line-height: 1.6; }
.article-body a { color: var(--accent); text-decoration: underline; text-decoration-color: rgba(0,255,157,0.3); }
.article-body a:hover { text-decoration-color: var(--accent); }
.article-body blockquote {
  border-left: 3px solid var(--border-strong) !important; padding-left: 20px !important;
  margin: 24px 0 !important; color: var(--text-secondary); font-style: italic;
  background: none !important;
}
.article-body figure { margin: 32px 0; border: 1px solid var(--border); overflow: hidden; }
.article-body figure img { width: 100%; height: auto; display: block; }

/* Univerzális kép-szabály: konzisztens megjelenés feltöltött méret-aránytól
   függetlenül, DE a kép természetes arányát megőrizzük (nem vágunk,
   nem torzítunk). Csak teljes szélességet és margót kényszerítünk. */
.article-body img,
.article-body p > img,
.article-body .wp-block-image img,
.article-body figure.wp-block-image img {
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  display: block !important;
  margin: 32px 0 !important;
  border: 1px solid var(--border);
}

/* Ha az img figure-ben van, a margin onnan jön, ne dupla */
.article-body figure img,
.article-body .wp-block-image img {
  margin: 0 !important;
  border: none;
}

/* Alignfull / alignwide blokkok ne lógjanak ki a tartalomból */
.article-body .alignfull,
.article-body .alignwide,
.article-body figure.alignfull,
.article-body figure.alignwide {
  max-width: 100% !important;
  width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}
.article-body figcaption {
  padding: 10px 14px; font-family: 'Geist Mono', monospace;
  font-size: 11px; color: var(--text-muted);
  background: var(--bg-elevated); border-top: 1px solid var(--border);
}

/* ============================================================
   VIDEÓ ÉS IFRAME BEÁGYAZÁSOK (YouTube, Vimeo, X/Twitter, stb.)
   ============================================================ */
.article-body iframe,
.article-body video,
.article-body embed,
.article-body object {
  display: block;
  width: 100% !important;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  height: auto !important;
  border: 1px solid var(--border);
  margin: 32px 0;
  background: #000;
}

/* Gutenberg embed wrapper */
.article-body .wp-block-embed,
.article-body figure.wp-block-embed {
  margin: 32px 0 !important;
  width: 100%;
  max-width: 100%;
}

.article-body .wp-block-embed__wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
}

.article-body .wp-block-embed__wrapper iframe,
.article-body .wp-block-embed__wrapper video,
.article-body .wp-block-embed iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  border: 0;
}

/* Ha YouTube linkre nincs iframe, csak <a> + thumbnail (n8n pipeline) */
.article-body a[href*="youtube.com"] img,
.article-body a[href*="youtu.be"] img {
  width: 100% !important;
  aspect-ratio: 16 / 9 !important;
  object-fit: cover !important;
}
.article-body code {
  font-family: 'Geist Mono', monospace !important; font-size: 13px !important;
  background: var(--bg-elevated) !important; border: 1px solid var(--border) !important;
  padding: 2px 6px !important; color: var(--accent) !important;
}
.article-body pre {
  background: var(--bg-elevated) !important; border: 1px solid var(--border) !important;
  padding: 20px !important; overflow-x: auto; margin-bottom: 24px;
}
.article-body pre code { background: none !important; border: none !important; padding: 0 !important; }

/* Highlight box */
.article-body .highlight-box {
  border: 1px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 5%, transparent);
  padding: 20px 24px; margin: 32px 0; position: relative;
}
.article-body .highlight-box::before {
  content: '> KEY.INSIGHT';
  position: absolute; top: -8px; left: 14px;
  background: var(--bg); padding: 0 6px;
  font-family: 'Geist Mono', monospace; font-size: 10px;
  color: var(--accent); letter-spacing: 0.12em;
}
.article-body .highlight-box p { margin: 0; color: var(--text); font-size: 15px; }

/* ============ TAGS + SOURCE + SHARE ============ */
.article-tags {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 40px 0 0; padding-top: 24px; border-top: 1px solid var(--border);
}
.article-tags-label {
  font-family: 'Geist Mono', monospace; font-size: 10px;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.1em; align-self: center; margin-right: 4px;
}
.tag {
  font-family: 'Geist Mono', monospace; font-size: 11px;
  padding: 4px 10px; border: 1px solid var(--border);
  color: var(--text-secondary); transition: all var(--transition); cursor: pointer;
  text-decoration: none;
}
.tag:hover { border-color: var(--accent); color: var(--accent); }

.article-source {
  display: flex; align-items: center; gap: 10px;
  margin-top: 20px; padding: 12px 16px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-left: 3px solid var(--hardware);
  font-family: 'Geist Mono', monospace; font-size: 11px; color: var(--text-muted);
}
.article-source a { color: var(--hardware); transition: color var(--transition); }
.article-source a:hover { color: var(--accent); }

.share-bar {
  display: flex; align-items: center; gap: 8px;
  margin-top: 16px; padding: 14px 20px;
  background: var(--bg-elevated); border: 1px solid var(--border);
}
.share-label { font-family: 'Geist Mono', monospace; font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; margin-right: 8px; }
.share-btn {
  padding: 6px 12px; font-family: 'Geist Mono', monospace; font-size: 11px;
  border: 1px solid var(--border); background: transparent;
  color: var(--text-secondary); cursor: pointer; transition: all var(--transition);
  text-transform: uppercase; letter-spacing: 0.08em; text-decoration: none;
  display: inline-block;
}
.share-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ============ KAPCSOLÓDÓ CIKKEK ============ */
.related-section { margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--border); }
.related-title {
  font-family: 'Geist Mono', monospace; font-size: 14px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--text);
  margin-bottom: 24px; display: flex; align-items: center; gap: 10px;
}
.related-title::before { content: '///'; color: var(--accent); font-weight: 400; }
.related-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1px; background: var(--border); border: 1px solid var(--border);
}
.related-card {
  background: var(--bg-card); padding: 16px; cursor: pointer;
  transition: all var(--transition); display: flex; flex-direction: column;
  gap: 10px; position: relative; overflow: hidden;
}
.related-card::before { content: ''; position: absolute; top: 0; left: 0; width: 0; height: 1px; background: var(--accent); transition: width 400ms; }
.related-card:hover::before { width: 100%; }
.related-card:hover { background: var(--bg-hover); }
.related-card:hover .related-card-title { color: var(--accent); }
.related-card img { width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.related-card-meta {
  font-family: 'Geist Mono', monospace; font-size: 10px; color: var(--text-muted);
  display: flex; justify-content: space-between; align-items: center;
}
.related-card-title { font-size: 14px; font-weight: 600; line-height: 1.3; transition: color var(--transition); }

/* ============ SIDEBAR ============ */
.article-sidebar {
  position: sticky; top: 80px;
  display: flex; flex-direction: column; gap: 24px;
}
.sidebar-block { border: 1px solid var(--border); background: var(--bg-card); overflow: hidden; }
.sidebar-block-title {
  padding: 10px 14px; background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  font-family: 'Geist Mono', monospace; font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent);
  display: flex; align-items: center; gap: 8px;
}
.sidebar-block-title::before { content: '//'; color: var(--text-muted); }

/* TOC */
.toc-list { list-style: none; padding: 12px 0; }
.toc-list li a {
  display: flex; align-items: baseline; gap: 10px;
  padding: 8px 14px; font-family: 'Geist Mono', monospace; font-size: 11px;
  color: var(--text-secondary); transition: all var(--transition);
  border-left: 2px solid transparent; text-decoration: none;
}
.toc-list li a:hover { color: var(--accent); background: var(--bg-hover); }
.toc-list li a.active { color: var(--accent); border-left-color: var(--accent); background: color-mix(in srgb, var(--accent) 5%, transparent); }
.toc-num { color: var(--text-muted); font-size: 10px; flex-shrink: 0; }

/* Sidebar kapcsolódó */
.sidebar-related-item {
  display: grid; grid-template-columns: 72px 1fr;
  gap: 12px; padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background var(--transition); align-items: start;
}
.sidebar-related-item:last-child { border-bottom: none; }
.sidebar-related-item:hover { background: var(--bg-hover); }
.sidebar-related-item:hover .sidebar-related-title { color: var(--accent); }
.sidebar-related-item img { width: 72px; height: 50px; object-fit: cover; }
.sidebar-related-title { font-size: 12px; font-weight: 600; line-height: 1.3; margin-bottom: 4px; transition: color var(--transition); }
.sidebar-related-meta { font-family: 'Geist Mono', monospace; font-size: 10px; color: var(--text-muted); }

/* Sidebar kategóriák */
.sidebar-cat-list { padding: 8px 0; }
.sidebar-cat-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 14px; font-family: 'Geist Mono', monospace; font-size: 11px;
  color: var(--text-secondary); border-bottom: 1px solid var(--border);
  cursor: pointer; transition: all var(--transition); text-decoration: none;
}
.sidebar-cat-item:last-child { border-bottom: none; }
.sidebar-cat-item:hover { background: var(--bg-hover); color: var(--accent); }
.sidebar-cat-count { background: var(--bg-elevated); border: 1px solid var(--border); padding: 1px 6px; font-size: 10px; color: var(--text-muted); }

/* ============ RESZPONZÍV ============ */
@media (max-width: 1100px) {
  .article-layout { grid-template-columns: 1fr 280px; gap: 32px; }
  .article-hero-title { font-size: 36px; }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .article-layout { grid-template-columns: 1fr; }
  .article-sidebar { position: static; }
  .article-hero-title { font-size: 28px; }
  .article-hero-content { padding: 24px; }
  .article-hero { aspect-ratio: 16/9; }
  .related-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .article-hero-title { font-size: 22px; }
  .article-lead { font-size: 16px; }
  .article-body p { font-size: 15px; }
  .article-body h2 { font-size: 20px; }
  .author-stats { display: none; }
  .share-bar { flex-wrap: wrap; }
}


/* ============================================================
   BYTEPOINT INTERNAL EMBED CARD
   - sötét stílusú kártya saját cikk-beágyazáshoz
   ============================================================ */
.article-body .bp-embed-card {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 0;
  margin: 32px 0 !important;
  text-decoration: none !important;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  overflow: hidden;
  transition: all 200ms ease;
}
.article-body .bp-embed-card:hover {
  border-color: var(--accent);
  background: var(--bg-elevated);
  transform: translateX(2px);
}

.article-body .bp-embed-img {
  display: block;
  background-size: cover;
  background-position: center;
  background-color: var(--bg);
  min-height: 140px;
}

.article-body .bp-embed-body {
  display: flex;
  flex-direction: column;
  padding: 16px 20px;
  gap: 8px;
}

.article-body .bp-embed-kicker {
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--accent);
  text-transform: uppercase;
}

.article-body .bp-embed-title {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
  letter-spacing: -0.01em;
}

.article-body .bp-embed-excerpt {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.article-body .bp-embed-cta {
  margin-top: auto;
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.05em;
}

@media (max-width: 640px) {
  .article-body .bp-embed-card {
    grid-template-columns: 120px 1fr;
  }
  .article-body .bp-embed-img {
    min-height: 100%;
    aspect-ratio: auto;
  }
  .article-body .bp-embed-body {
    padding: 12px 14px;
    gap: 6px;
  }
  .article-body .bp-embed-title {
    font-size: 14px;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .article-body .bp-embed-excerpt {
    display: none;
  }
  .article-body .bp-embed-kicker {
    font-size: 9px;
  }
  .article-body .bp-embed-cta {
    font-size: 10px;
  }
}
