/* Copyright 2024-2026 Jakub Kopřiva <khubick@protonmail.com> */
/* Licensed under the Apache License, Version 2.0 */
/* kbc-web-core — sdílené UI komponenty */

/* === UTILITY === */
.border-top    { border-top: 0.5px solid var(--border); }
.border-bottom { border-bottom: 0.5px solid var(--border); }

/* === TYPOGRAPHY === */
h1, h2, h3, h4 { font-family: var(--font-heading); }

/* === BLOG (Phase 3 #22) — neutral defaults, sites can override via per-site CSS === */
.blog-index { padding: 4rem 0; }
.blog-index-header { margin-bottom: 2.5rem; }
.blog-index-header h1 { margin: 0; font-size: clamp(2rem, 4vw, 3rem); }

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.75rem;
}
.blog-card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md, 8px);
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.blog-card:hover { transform: translateY(-2px); border-color: var(--text); }
.blog-card-link { display: block; color: inherit; text-decoration: none; }
.blog-card-cover { aspect-ratio: 16 / 9; overflow: hidden; background: var(--border); }
.blog-card-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.blog-card-body { padding: 1.25rem 1.25rem 1.5rem; }
.blog-card-date { font-size: 0.75rem; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }
.blog-card-title { margin: 0.4rem 0 0.6rem; font-size: 1.25rem; line-height: 1.3; }
.blog-card-perex { margin: 0; color: var(--muted); font-size: 0.95rem; line-height: 1.5; }

.blog-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 0.5px solid var(--border);
}
.blog-pagination a { color: var(--text); text-decoration: none; font-weight: 500; }
.blog-pagination a:hover { text-decoration: underline; }
.blog-pagination .disabled { color: var(--muted); cursor: default; }
.blog-pagination-current { color: var(--muted); font-size: 0.875rem; }

.blog-empty { color: var(--muted); padding: 2rem 0; }

.blog-post { padding: 4rem 0; }
.blog-post-header { max-width: 720px; margin: 0 auto 2rem; }
.blog-post-date { font-size: 0.8rem; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }
.blog-post-title { margin: 0.4rem 0 0.8rem; font-size: clamp(2rem, 4.5vw, 3rem); line-height: 1.15; }
.blog-post-perex { margin: 0; color: var(--muted); font-size: 1.1rem; line-height: 1.55; }
.blog-post-cover { margin: 0 0 2.5rem; max-width: 960px; margin-left: auto; margin-right: auto; }
.blog-post-cover img { width: 100%; height: auto; display: block; border-radius: var(--radius-md, 8px); }
.blog-post-content { max-width: 720px; margin: 0 auto; line-height: 1.7; }
.blog-post-content p { margin: 0 0 1rem; }
.blog-post-content h2 { margin: 2rem 0 1rem; }
.blog-post-content h3 { margin: 1.5rem 0 0.75rem; }
.blog-post-content ul, .blog-post-content ol { padding-left: 1.5rem; margin: 0 0 1rem; }
.blog-post-content blockquote { border-left: 3px solid var(--border); padding-left: 1rem; color: var(--muted); margin: 1rem 0; }
.blog-post-content pre { background: var(--surface); padding: 1rem; border-radius: var(--radius-sm, 4px); overflow-x: auto; }
.blog-post-content code { font-family: var(--font-mono); font-size: 0.9em; }
.blog-post-content img { max-width: 100%; height: auto; border-radius: var(--radius-sm, 4px); }

.blog-post-footer { max-width: 720px; margin: 2.5rem auto 0; padding-top: 1.5rem; border-top: 0.5px solid var(--border); }
.blog-post-back { color: var(--muted); text-decoration: none; }
.blog-post-back:hover { color: var(--text); }

/* Phase 9 #41 — per-section background image (selected via admin media picker).
   The wrapper carries an inline ``background-image: url(...)`` from
   _open.html; we layer cover/center sizing and a dark overlay for text
   readability.  ``isolation: isolate`` confines the overlay's z-index so
   nested floats don't accidentally stack above it. */
.section.section-with-bg-image {
  position: relative;
  isolation: isolate;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.section.section-with-bg-image::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: -1;
  pointer-events: none;
}

/* Logo in navbar (Phase 11 — theme.logo_url override).  Constrains height so
   tall PNG/SVG uploads don't blow up the navbar; width auto-derives from
   aspect ratio.  object-fit: contain keeps the logo whole on tall images.
   --logo-max-height comes from the inline :root block in _base.html when
   theme.logo_max_height is set (range 24..200 px, default 48). Mobile auto-
   scales to 75 % via calc(). */
.nav-logo-img {
  max-height: var(--logo-max-height, 48px);
  width: auto;
  object-fit: contain;
  display: block;
}
@media (max-width: 768px) {
  .nav-logo-img {
    max-height: calc(var(--logo-max-height, 48px) * 0.75);
  }
}
