/*
Theme Name: Chmajster Notes
Theme URI: https://chmajster.usermd.net/
Author: Chmajster
Author URI: https://chmajster.usermd.net/
Description: Lekki motyw blogowy inspirowany układem chmajster.usermd.net. Dwie kolumny, sidebar techniczny, czytelne fragmenty kodu, responsywność i wsparcie dla edytora blokowego.
Version: 1.0.3
Requires at least: 6.4
Tested up to: 6.8
Requires PHP: 8.1
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: chmajster-notes
Tags: blog, two-columns, right-sidebar, custom-menu, featured-images, threaded-comments, translation-ready, block-styles
*/

:root {
  --cm-bg: #8c684d;
  --cm-paper: rgba(250, 248, 244, .94);
  --cm-surface: rgba(255, 255, 255, .88);
  --cm-surface-2: #f1ece5;
  --cm-border: rgba(73, 56, 43, .18);
  --cm-text: #25231f;
  --cm-muted: #746b63;
  --cm-accent: #1f6f82;
  --cm-accent-2: #174f5d;
  --cm-coffee: #9a5a27;
  --cm-code: #171b1f;
  --cm-shadow: 0 18px 48px rgba(45, 30, 20, .22);
  --cm-soft-shadow: 0 8px 24px rgba(55, 39, 28, .12);
  --cm-radius: 14px;
  --cm-width: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  position: relative;
  min-height: 100vh;
  margin: 0;
  color: var(--cm-text);
  background-color: var(--cm-bg);
  background-repeat: no-repeat;
  background-position: center top;
  background-size: cover;
  background-attachment: fixed;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: rgba(55, 37, 24, .08);
}

a { color: var(--cm-accent); text-decoration: none; }
a:hover, a:focus { color: var(--cm-accent-2); }
img { max-width: 100%; height: auto; border-radius: 10px; }
button, input, textarea, select { font: inherit; }

.screen-reader-text {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.screen-reader-text:focus {
  position: fixed; z-index: 99999; top: 16px; left: 16px; width: auto; height: auto;
  clip: auto; padding: 10px 14px; margin: 0; background: #fff; color: #1f1d1a;
}

.cm-shell { width: min(calc(100% - 32px), var(--cm-width)); margin: 0 auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(255, 255, 255, .18);
  background: rgba(48, 35, 27, .90);
  box-shadow: 0 8px 24px rgba(36, 23, 15, .18);
  backdrop-filter: blur(12px) saturate(1.05);
}
.header-inner {
  min-height: 70px; display: flex; align-items: center; gap: 24px; justify-content: space-between;
}
.site-branding { min-width: 0; }
.site-title { margin: 0; font-size: 1.08rem; font-weight: 800; letter-spacing: -.02em; }
.site-title a { color: #fff; }
.site-description { margin: 2px 0 0; color: #ded3c9; font-size: .82rem; }
.custom-logo { max-height: 42px; width: auto; border-radius: 0; }

.primary-navigation ul {
  display: flex; align-items: center; gap: 6px; list-style: none; margin: 0; padding: 0;
}
.primary-navigation a {
  display: inline-flex; padding: 9px 12px; color: #f1e9e2; border-radius: 9px; font-size: .92rem;
}
.primary-navigation a:hover,
.primary-navigation .current-menu-item > a {
  background: rgba(255,255,255,.12); color: #fff;
}
.menu-toggle { display: none; }

.site-main-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 30px;
  margin-top: 34px;
  margin-bottom: 64px;
  padding: clamp(22px, 3.2vw, 38px);
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 20px;
  background: var(--cm-paper);
  box-shadow: 0 22px 60px rgba(48, 31, 20, .28);
  backdrop-filter: blur(5px);
}
.content-area { min-width: 0; }

.home-hero {
  padding: 30px 31px 27px;
  margin-bottom: 24px;
  border: 1px solid var(--cm-border);
  border-radius: calc(var(--cm-radius) + 2px);
  background: linear-gradient(135deg, rgba(31,111,130,.08), rgba(154,90,39,.04)), rgba(255,255,255,.76);
  box-shadow: var(--cm-soft-shadow);
}
.home-hero .eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 10px;
  color: var(--cm-accent); font-size: .78rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
}
.home-hero .eyebrow::before {
  content: ""; width: 8px; height: 8px; border-radius: 999px; background: var(--cm-coffee);
  box-shadow: 0 0 0 5px rgba(154,90,39,.10);
}
.home-hero h1 {
  margin: 0; max-width: 760px; color: #22201d;
  font-size: clamp(2rem, 5vw, 3.6rem); line-height: 1.06; letter-spacing: -.045em;
}
.home-hero p { max-width: 760px; margin: 16px 0 0; color: #645d56; font-size: 1.02rem; }

.page-header { margin-bottom: 24px; }
.page-title { margin: 0; color: #24211e; font-size: clamp(1.7rem, 4vw, 2.6rem); letter-spacing: -.035em; }
.archive-description { color: var(--cm-muted); }

.post-card, .single-article, .page-article {
  background: var(--cm-surface);
  border: 1px solid var(--cm-border);
  border-radius: var(--cm-radius);
  box-shadow: var(--cm-soft-shadow);
}
.post-card {
  padding: 27px 30px;
  margin-bottom: 20px;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.post-card:hover {
  transform: translateY(-2px);
  border-color: rgba(31,111,130,.35);
  box-shadow: 0 12px 30px rgba(55,39,28,.16);
}
.entry-title { margin: 0 0 10px; line-height: 1.22; letter-spacing: -.026em; }
.post-card .entry-title { font-size: clamp(1.25rem, 3vw, 1.7rem); }
.entry-title a { color: #28231f; }
.entry-title a:hover { color: var(--cm-accent); }
.entry-meta, .entry-footer { color: var(--cm-muted); font-size: .84rem; }
.entry-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 16px; }
.entry-summary { color: #514c47; }
.entry-summary p:last-child, .entry-content > :last-child { margin-bottom: 0; }
.read-more {
  display: inline-flex; margin-top: 8px; padding: 9px 13px;
  border: 1px solid rgba(31,111,130,.28); border-radius: 9px;
  color: var(--cm-accent-2); background: rgba(31,111,130,.04);
  font-size: .86rem; font-weight: 700;
}
.read-more:hover { border-color: var(--cm-accent); background: rgba(31,111,130,.09); }

.single-article, .page-article { padding: clamp(24px, 4vw, 42px); }
.single-article .entry-title, .page-article .entry-title {
  color: #24211e; font-size: clamp(2rem, 5vw, 3.25rem);
}
.entry-content { color: #3f3a36; }
.entry-content h2, .entry-content h3, .entry-content h4 {
  margin-top: 1.7em; color: #24211e; line-height: 1.22; letter-spacing: -.025em;
}
.entry-content h2 { font-size: 1.6rem; }
.entry-content h3 { font-size: 1.3rem; }
.entry-content ul, .entry-content ol { padding-left: 1.3rem; }
.entry-content blockquote {
  margin: 1.5rem 0; padding: 14px 20px;
  border-left: 3px solid var(--cm-accent);
  background: rgba(31,111,130,.07); color: #514b45;
}
.entry-content code:not(pre code) {
  padding: 2px 6px; border-radius: 6px;
  background: #eee9e3; color: #8a3f20;
  font-family: "SFMono-Regular", Consolas, monospace;
}
.entry-content pre, pre.wp-block-code {
  overflow-x: auto; padding: 20px;
  border: 1px solid #303841; border-radius: 12px;
  background: var(--cm-code); color: #e3edf4;
  line-height: 1.55; box-shadow: inset 0 1px rgba(255,255,255,.04);
}
.entry-content pre code { background: transparent; color: inherit; padding: 0; }
.entry-content table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; }
.entry-content th, .entry-content td { padding: 10px 12px; border: 1px solid var(--cm-border); text-align: left; }
.entry-content th { background: var(--cm-surface-2); color: #29241f; }

.post-tags { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--cm-border); color: var(--cm-muted); font-size: .88rem; }

/* Nawigacja poprzedni / następny wpis. WordPress umieszcza oba elementy w .nav-links. */
.post-navigation {
  margin-top: 26px;
}
.post-navigation .nav-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.post-navigation .nav-previous,
.post-navigation .nav-next {
  min-width: 0;
}
.post-navigation a {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 112px;
  height: 100%;
  padding: 20px 22px;
  overflow: hidden;
  border: 1px solid rgba(73, 56, 43, .16);
  border-radius: 14px;
  background: rgba(255,255,255,.78);
  box-shadow: 0 6px 18px rgba(55,39,28,.08);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.post-navigation a::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.72);
}
.post-navigation a:hover,
.post-navigation a:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(31,111,130,.38);
  background: rgba(255,255,255,.94);
  box-shadow: 0 12px 26px rgba(55,39,28,.13);
}
.post-navigation a:focus-visible {
  outline: 3px solid rgba(31,111,130,.16);
  outline-offset: 2px;
}
.post-navigation .nav-subtitle {
  display: block;
  margin-bottom: 6px;
  color: var(--cm-muted);
  font-size: .76rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: .065em;
  text-transform: uppercase;
}
.post-navigation .nav-title {
  display: block;
  overflow-wrap: anywhere;
  color: var(--cm-accent-2);
  font-size: 1rem;
  font-weight: 750;
  line-height: 1.35;
}
.post-navigation .nav-next {
  text-align: right;
}
.post-navigation .nav-next a {
  align-items: flex-end;
}

.widget-area { min-width: 0; }
.widget {
  margin-bottom: 18px;
  padding: 20px;
  background: rgba(255, 255, 255, .78);
  border: 1px solid var(--cm-border);
  border-radius: 13px;
  box-shadow: var(--cm-soft-shadow);
}
.widget-title, .widget h2, .widget h3 {
  margin: 0 0 14px; color: #2a241f; font-size: .96rem; letter-spacing: -.01em;
}
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 7px 0; border-bottom: 1px solid rgba(78,58,43,.10); font-size: .9rem; }
.widget li:last-child { border-bottom: 0; }
.widget p { color: #5d5650; font-size: .9rem; }
.widget-search .search-form { display: flex; gap: 8px; }
.search-field {
  width: 100%; min-width: 0; padding: 10px 12px;
  color: #29251f; background: rgba(255,255,255,.92);
  border: 1px solid rgba(73,56,43,.23); border-radius: 9px; outline: none;
}
.search-field:focus { border-color: var(--cm-accent); box-shadow: 0 0 0 3px rgba(31,111,130,.10); }
.search-submit, input[type="submit"], button:not(.menu-toggle) {
  cursor: pointer; padding: 10px 13px;
  border: 1px solid #175b6c; border-radius: 9px;
  background: var(--cm-accent); color: #fff; font-weight: 800;
}
.search-submit:hover, input[type="submit"]:hover { background: var(--cm-accent-2); }
.coffee-link {
  display: block; padding: 11px 13px; text-align: center; border-radius: 10px;
  background: #d7a05f; color: #332014; font-weight: 800;
}
.coffee-link:hover { background: #e3b170; color: #2b1b12; }

.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.pagination .page-numbers {
  min-width: 40px; padding: 8px 12px; text-align: center;
  border: 1px solid var(--cm-border); border-radius: 9px;
  background: rgba(255,255,255,.82);
}
.pagination .current { border-color: var(--cm-accent); color: #1b5665; font-weight: 800; }

.comments-area {
  margin-top: 24px; padding: clamp(22px,4vw,34px);
  border: 1px solid var(--cm-border); border-radius: var(--cm-radius);
  background: rgba(255,255,255,.88); box-shadow: var(--cm-soft-shadow);
}
.comment-list { padding-left: 20px; }
.comment-body { padding: 16px 0; border-bottom: 1px solid var(--cm-border); }
.comment-form label { display: block; margin-bottom: 5px; color: #655d55; font-size: .86rem; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%; padding: 10px 12px; color: #29251f;
  background: rgba(255,255,255,.96); border: 1px solid rgba(73,56,43,.23); border-radius: 9px;
}

.site-footer {
  border-top: 1px solid rgba(255,255,255,.15);
  background: rgba(48,35,27,.93);
  backdrop-filter: blur(10px);
}
.footer-inner {
  min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 18px;
  color: #ded2c7; font-size: .84rem;
}
.footer-inner p { margin: 0; }
.footer-inner a { color: #fff; }

.not-found {
  padding: 32px; border: 1px solid var(--cm-border); border-radius: var(--cm-radius);
  background: rgba(255,255,255,.88); box-shadow: var(--cm-soft-shadow);
}

@media (max-width: 900px) {
  .site-main-wrap { grid-template-columns: 1fr; }
  .widget-area { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
  .widget { margin: 0; }
  .widget-search, .widget-about { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  body { background-attachment: scroll; background-position: center top; }
  .cm-shell { width: min(calc(100% - 20px), var(--cm-width)); }
  .header-inner { min-height: 64px; }
  .site-description { display: none; }
  .menu-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 42px; height: 40px; padding: 0;
    border: 1px solid rgba(255,255,255,.25); border-radius: 9px;
    background: rgba(255,255,255,.08); color: #fff;
  }
  .primary-navigation {
    position: absolute; top: 64px; left: 10px; right: 10px; display: none;
    padding: 10px; border: 1px solid rgba(255,255,255,.18); border-radius: 12px;
    background: rgba(48,35,27,.97); box-shadow: var(--cm-shadow);
  }
  .primary-navigation.is-open { display: block; }
  .primary-navigation ul { display: block; }
  .primary-navigation a { display: block; }
  .site-main-wrap {
    margin-top: 18px; margin-bottom: 30px; padding: 14px; gap: 20px;
    border-radius: 15px; background: rgba(250,248,244,.96);
  }
  .home-hero { padding: 24px 21px; }
  .post-card { padding: 21px; }
  .widget-area { display: block; }
  .widget { margin-bottom: 14px; }
  .post-navigation .nav-links { grid-template-columns: 1fr; gap: 12px; }
  .post-navigation a { min-height: 94px; padding: 17px 18px; }
  .post-navigation .nav-next { text-align: left; }
  .post-navigation .nav-next a { align-items: flex-start; }
  .footer-inner { padding: 22px 0; display: block; }
}
