/*
Theme Name: NaMTB
Theme URI: https://namtb.pl/
Author: JCD.PL
Description: Minimalistyczny, szybki motyw serwisu NaMTB.pl - kolarstwo górskie MTB.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 8.0
License: GPL-2.0-or-later
Text Domain: namtb
*/

:root {
  --ink: #111316;
  --ink-2: #3a3f47;
  --muted: #6b7280;
  --line: #e7e8ea;
  --soft: #f5f6f7;
  --bg: #ffffff;
  --red: #e3262f;
  --blue: #1aa1e2;
  --radius: 10px;
  --wrap: 1200px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); font-size: 17px; line-height: 1.6; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--red); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; font-weight: 800; letter-spacing: -.015em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 100; width: auto; height: auto; clip: auto; padding: 10px 14px; background: var(--ink); color: #fff; border-radius: 6px; }

/* ---------- Nagłówek ---------- */
.topbar { background: var(--ink); color: #c9ccd1; font-size: 13px; }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 36px; }
.topbar ul { list-style: none; display: flex; gap: 18px; margin: 0; padding: 0; }
.topbar a:hover { color: #fff; }
.topbar .social { display: flex; gap: 14px; }

.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.94); backdrop-filter: saturate(160%) blur(10px); border-bottom: 1px solid var(--line); }
.site-header .bar { display: flex; align-items: center; gap: 28px; min-height: 68px; }
.logo { display: inline-flex; align-items: baseline; font-weight: 900; font-style: italic; font-size: 30px; letter-spacing: -.04em; line-height: 1; white-space: nowrap; }
.logo:hover { color: inherit; }
.logo .na { color: var(--red); }
.logo .pl { color: var(--blue); }
.logo img { max-height: 40px; width: auto; }

.main-nav { flex: 1; min-width: 0; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.main-nav ul::-webkit-scrollbar { display: none; }
.main-nav a { display: block; padding: 8px 12px; border-radius: 999px; font-size: 14.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.main-nav a:hover { background: var(--soft); color: var(--ink); }
.main-nav .current-menu-item > a, .main-nav .current-category-ancestor > a, .main-nav .current-post-ancestor > a { background: var(--ink); color: #fff; }

.icon-btn { display: inline-grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 999px; background: transparent; color: var(--ink); cursor: pointer; }
.icon-btn:hover { background: var(--soft); }
.icon-btn svg { width: 20px; height: 20px; }
.menu-toggle { display: none; }

.search-panel { display: none; border-top: 1px solid var(--line); padding: 14px 0; }
.search-panel.is-open { display: block; }
.search-form { display: flex; gap: 8px; }
.search-form input[type="search"] { flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--soft); }
.search-form input[type="search"]:focus { outline: none; border-color: var(--ink); background: #fff; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-size: 15px; font-weight: 700; padding: 11px 20px; border: 0; border-radius: 999px; background: var(--ink); color: #fff; cursor: pointer; }
.btn:hover { background: var(--red); color: #fff; }

/* ---------- Karty wpisów ---------- */
.kicker { display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--red); }
.meta { font-size: 13.5px; color: var(--muted); }
.meta span + span::before { content: "·"; margin: 0 7px; }
.thumb { position: relative; overflow: hidden; border-radius: var(--radius); background: var(--soft); aspect-ratio: 16 / 10; }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.card:hover .thumb img, .lead:hover .thumb img { transform: scale(1.04); }
.card { display: flex; flex-direction: column; gap: 12px; }
.card h3 { font-size: 19px; margin: 4px 0 0; }
.card:hover h3 { color: var(--red); }
.card .excerpt { font-size: 15px; color: var(--ink-2); margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px 28px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-4 .card h3 { font-size: 17px; }

/* ---------- Strona główna ---------- */
.hero { display: grid; grid-template-columns: 1.55fr 1fr; gap: 28px; padding: 32px 0 8px; }
.lead { display: flex; flex-direction: column; gap: 14px; }
.lead .thumb { aspect-ratio: 16 / 9; }
.lead h2 { font-size: clamp(26px, 3.2vw, 40px); margin: 0; }
.lead:hover h2 { color: var(--red); }
.lead .excerpt { font-size: 17px; color: var(--ink-2); margin: 0; }
.side-list { display: flex; flex-direction: column; gap: 18px; }
.mini { display: grid; grid-template-columns: 132px 1fr; gap: 14px; align-items: start; }
.mini .thumb { aspect-ratio: 4 / 3; border-radius: 8px; }
.mini h3 { font-size: 16px; margin: 2px 0 4px; }
.mini:hover h3 { color: var(--red); }

.section { padding: 44px 0 8px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 22px; padding-bottom: 12px; border-bottom: 2px solid var(--ink); }
.section-head h2 { font-size: 24px; margin: 0; }
.section-head a { font-size: 14px; font-weight: 700; color: var(--muted); }
.section-head a:hover { color: var(--red); }

/* ---------- Archiwa ---------- */
.page-head { padding: 40px 0 24px; }
.page-head h1 { font-size: clamp(30px, 4vw, 46px); margin: 6px 0 8px; }
.page-head p { color: var(--muted); margin: 0; max-width: 680px; }

.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 48px 0 16px; }
.pagination .page-numbers { display: inline-grid; place-items: center; min-width: 42px; height: 42px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); font-weight: 700; font-size: 15px; }
.pagination .page-numbers.current { background: var(--ink); border-color: var(--ink); color: #fff; }
.pagination a.page-numbers:hover { border-color: var(--ink); color: var(--ink); }
.pagination .dots { border: 0; }

/* ---------- Artykuł ---------- */
.article { padding: 40px 0 16px; }
.article-head { max-width: 820px; margin: 0 auto; text-align: center; }
.article-head h1 { font-size: clamp(30px, 4.4vw, 50px); margin: 10px 0 14px; }
.article-head .meta { font-size: 14.5px; }
.article-figure { max-width: 1040px; margin: 30px auto 0; }
.article-figure img { width: 100%; border-radius: 14px; }
.article-figure figcaption { font-size: 13px; color: var(--muted); margin-top: 8px; text-align: center; }

.prose { max-width: 720px; margin: 36px auto 0; font-size: 18.5px; line-height: 1.75; color: #1d2025; }
.prose > * + * { margin-top: 1.15em; }
.prose p { margin: 0; }
.prose h2 { font-size: 28px; margin: 1.8em 0 .5em; }
.prose h3 { font-size: 22px; margin: 1.6em 0 .4em; }
.prose a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover { color: var(--red); }
.prose img, .prose figure, .prose .wp-caption { max-width: 100%; height: auto; border-radius: 10px; margin-left: auto; margin-right: auto; }
.prose figure { margin: 1.6em 0; }
.prose .wp-caption { width: auto !important; }
.prose figcaption, .prose .wp-caption-text { font-size: 14px; color: var(--muted); text-align: center; margin-top: 8px; }
.prose blockquote { margin: 1.6em 0; padding: 4px 0 4px 22px; border-left: 4px solid var(--red); font-size: 21px; font-style: italic; color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .35em; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; display: block; overflow-x: auto; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.prose iframe, .prose embed, .prose video { max-width: 100%; border: 0; border-radius: 10px; }
.prose .wp-block-embed__wrapper iframe, .prose iframe[src*="youtube"] { width: 100%; height: auto; aspect-ratio: 16 / 9; }
.prose .alignleft { float: left; margin: .3em 1.4em 1em 0; max-width: 50%; }
.prose .alignright { float: right; margin: .3em 0 1em 1.4em; max-width: 50%; }
.prose .aligncenter { margin-left: auto; margin-right: auto; }
.prose::after { content: ""; display: table; clear: both; }

.article-foot { max-width: 720px; margin: 40px auto 0; padding-top: 22px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags a { font-size: 13.5px; font-weight: 600; padding: 6px 12px; border-radius: 999px; background: var(--soft); color: var(--ink-2); }
.tags a:hover { background: var(--ink); color: #fff; }
.share { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.share a { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink); }
.share a:hover { border-color: var(--ink); }
.share svg { width: 16px; height: 16px; }

/* ---------- Komentarze ---------- */
.comments { max-width: 720px; margin: 40px auto 0; }
.comments h2 { font-size: 22px; }
.comment-list { list-style: none; padding: 0; margin: 0 0 30px; }
.comment-list .children { list-style: none; padding-left: 24px; }
.comment-body { padding: 16px 0; border-bottom: 1px solid var(--line); font-size: 16px; }
.comment-meta { font-size: 13.5px; color: var(--muted); }
.comment-form label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea { width: 100%; font: inherit; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; }
.comment-form .submit { font: inherit; font-weight: 700; padding: 11px 20px; border: 0; border-radius: 999px; background: var(--ink); color: #fff; cursor: pointer; }

/* ---------- Stopka ---------- */
.site-footer { margin-top: 72px; background: var(--ink); color: #b9bdc4; font-size: 15px; }
.site-footer .wrap { padding-top: 48px; padding-bottom: 28px; }
.footer-top { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; padding-bottom: 32px; border-bottom: 1px solid rgba(255,255,255,.1); }
.site-footer .logo { color: #fff; font-size: 34px; }
.site-footer .about { max-width: 460px; margin: 14px 0 0; }
.footer-nav ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 24px; }
.site-footer a:hover { color: #fff; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 22px; font-size: 13.5px; }
.footer-bottom .social { display: flex; gap: 16px; }

/* ---------- 404 / pusto ---------- */
.empty { text-align: center; padding: 80px 0 40px; }
.empty h1 { font-size: clamp(34px, 5vw, 56px); }
.empty p { color: var(--muted); }
.empty .search-form { max-width: 520px; margin: 24px auto 0; }

/* ---------- Responsywność ---------- */
@media (max-width: 1080px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .site-header .bar { gap: 12px; }
  .menu-toggle { display: inline-grid; }
  .main-nav { position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-bottom: 1px solid var(--line); display: none; }
  .main-nav.is-open { display: block; }
  .main-nav ul { flex-direction: column; overflow: visible; padding: 10px 20px 18px; }
  .main-nav a { font-size: 16px; padding: 10px 14px; }
  .site-header .bar { justify-content: space-between; }
  .site-header .tools { display: flex; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .topbar .menu-up { display: none; }
  .grid, .grid-4 { grid-template-columns: 1fr; gap: 30px; }
  .mini { grid-template-columns: 108px 1fr; }
  .footer-top { grid-template-columns: 1fr; }
  .prose { font-size: 17.5px; }
  .logo { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .thumb img { transition: none; }
}
