/* ===================================================
   Projekt Srdce – styl „projekt jako repozitář“
   Struktura inspirovaná GitHubem, barvy z původní vize:
   teplá růžová, krémová, zemitá zeleň. Bez externích fontů.
   =================================================== */

:root {
  --bg:          #faf7f2;
  --surface:     #ffffff;
  --surface-2:   #f4efe7;
  --border:      #e4dbcf;
  --border-soft: #eee6db;
  --text:        #2f2622;
  --text-soft:   #6e6159;
  --rose:        #b8665b;
  --rose-deep:   #9a4f45;
  --rose-pale:   #f6e5e2;
  --leaf:        #4f7a3a;
  --leaf-deep:   #3d6229;
  --leaf-pale:   #e3eed8;
  --plum:        #7d5a8c;
  --plum-pale:   #efe6f3;
  --gray-pale:   #efebe5;
  --focus:       #b8665b55;

  --hm0: #ece6dc; --hm1: #c6dcae; --hm2: #9cc57a; --hm3: #6fa04c; --hm4: #4f7a3a;

  --ff: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ff-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --ff-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --radius: 8px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--ff); font-size: 15px; line-height: 1.55;
  color: var(--text); background: var(--bg);
}
img { max-width: 100%; display: block; }
a { color: var(--rose-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
p { margin: 0 0 .8em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--text-soft); }
.small { font-size: 13px; }
.lead { font-size: 17px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: #fff; padding: 8px 12px; z-index: 100; }
.ico { width: 16px; height: 16px; fill: currentColor; vertical-align: -3px; flex: none; }

/* ── Horní lišta ── */
.topbar { background: #2f2622; color: #f6efe6; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.brand { color: #fff; font-weight: 600; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.brand:hover { text-decoration: none; }
.brand-heart { color: #e8a59c; font-size: 22px; line-height: 1; }
.lang { display: flex; gap: 4px; }
.lang a { color: #d9cdc0; font-size: 12px; font-weight: 600; padding: 4px 8px; border-radius: 6px; border: 1px solid transparent; }
.lang a.on { color: #fff; border-color: #6e6159; }
.lang a:hover { text-decoration: none; color: #fff; }

/* ── Hlavička „repozitáře“ ── */
.repo-head { background: var(--surface-2); border-bottom: 1px solid var(--border); padding-top: 20px; }
.repo-title { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.repo-path { font-size: 20px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.repo-path .ico { color: var(--text-soft); }
.repo-path a { color: var(--rose-deep); }
.repo-path .slash { color: var(--text-soft); }
.pill { font-size: 12px; font-weight: 500; color: var(--text-soft); border: 1px solid var(--border); border-radius: 2em; padding: 1px 8px; }
.repo-actions { display: flex; gap: 8px; }

.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin-bottom: -1px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
  padding: 10px 14px 12px; color: var(--text); border-bottom: 2px solid transparent; font-size: 14px;
}
.tabs a .ico { color: var(--text-soft); }
.tabs a:hover { text-decoration: none; border-bottom-color: var(--border); }
.tabs a.on { font-weight: 600; border-bottom-color: var(--rose); }
.tabs a.on .ico { color: var(--text); }
.count {
  display: inline-block; min-width: 20px; padding: 0 6px; font-size: 12px; font-weight: 500; line-height: 18px;
  text-align: center; background: var(--gray-pale); border-radius: 2em; color: var(--text);
}

/* ── Tlačítka, štítky ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px; font-size: 14px; font-weight: 500;
  line-height: 20px; color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px; cursor: pointer; font-family: inherit;
}
.btn:hover { text-decoration: none; background: var(--surface-2); }
.btn-sm { padding: 3px 10px; font-size: 13px; }
.btn-heart { background: var(--rose); border-color: var(--rose-deep); color: #fff; }
.btn-heart:hover { background: var(--rose-deep); }
.btn-heart .ico { color: #fff; }
.btn-block { width: 100%; justify-content: center; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 2em;
  font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid transparent;
}
.badge-done    { background: var(--plum-pale); color: var(--plum); border-color: #dccbe4; }
.badge-active  { background: var(--leaf-pale); color: var(--leaf-deep); border-color: #c8ddb5; }
.badge-planned { background: var(--gray-pale); color: var(--text-soft); border-color: var(--border); }
.chip {
  display: inline-block; font-family: var(--ff-mono); font-size: 12px; padding: 0 6px; border-radius: 6px;
  background: var(--rose-pale); color: var(--rose-deep);
}
.chip:hover { text-decoration: none; background: #f0d6d1; }
.phase-code {
  font-family: var(--ff-mono); font-size: 12px; color: var(--text-soft); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; margin-right: 6px; vertical-align: 2px;
}
.phase-code.big { font-size: 15px; vertical-align: 4px; margin-left: 4px; }
.topic {
  display: inline-block; font-size: 12px; font-weight: 500; padding: 2px 10px; margin: 0 4px 6px 0;
  border-radius: 2em; background: var(--leaf-pale); color: var(--leaf-deep);
}

/* ── Rozvržení ── */
.main { padding-top: 24px; padding-bottom: 48px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.col-main > * + * { margin-top: 16px; }
.col-side > * + * { margin-top: 0; }

.box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.box-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border);
  font-size: 14px; font-weight: 600;
}
.box-head .ico { color: var(--text-soft); margin-right: 4px; }
.box-link { font-weight: 400; font-size: 13px; }
.box-body { padding: 16px 20px; }

.side-block { padding: 0 0 20px; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.side-block:last-child { border-bottom: 0; }
.side-block h2 { font-size: 15px; display: flex; align-items: center; gap: 8px; }
.side-block h2 a { color: var(--text); }
.facts { list-style: none; padding: 0; margin: 0 0 12px; }
.facts li { display: flex; gap: 8px; align-items: center; padding: 3px 0; color: var(--text-soft); }
.side-join p { color: var(--text-soft); }

.page-intro { max-width: 760px; margin-bottom: 24px; }
.page-intro h1 { font-family: var(--ff-display); font-size: 34px; font-weight: 600; }
.page-intro h1 .ico { width: 26px; height: 26px; color: var(--rose); vertical-align: -2px; }
.legend { display: flex; gap: 8px; flex-wrap: wrap; }
.h-section { font-size: 18px; margin: 32px 0 12px; display: flex; align-items: center; gap: 8px; }
.h-section .ico { color: var(--text-soft); }

/* ── Text (README) ── */
.prose { font-size: 15px; }
.prose h2 { font-family: var(--ff-display); font-size: 26px; margin: 4px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border-soft); }
.prose h3 { font-size: 17px; margin: 20px 0 8px; }
.prose ul { padding-left: 22px; margin: 0 0 1em; }
.prose li { margin: 3px 0; }
.prose blockquote { margin: 0 0 1em; padding: 0 16px; border-left: 4px solid var(--border); color: var(--text-soft); }
.prose img { border-radius: 6px; margin: 8px 0; }
.prose > :last-child { margin-bottom: 0; }

/* ── Progres ── */
.progress { height: 8px; background: var(--gray-pale); border-radius: 4px; overflow: hidden; margin: 10px 0; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--leaf), #77a556); border-radius: 4px; }
.progress.thin { height: 4px; margin: 4px 0 0 18px; }

/* ── Právě probíhá ── */
.box-now .box-head { background: var(--leaf-pale); color: var(--leaf-deep); }
.box-now .box-head .ico { color: var(--leaf); animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .box-now .box-head .ico { animation: none; } }
.now-item { display: block; padding: 14px 20px; color: var(--text); border-top: 1px solid var(--border-soft); }
.now-item:first-of-type { border-top: 0; }
.now-item:hover { text-decoration: none; background: #fcfaf6; }
.now-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 4px; }
.now-title strong { font-size: 16px; }
.now-item p { color: var(--text-soft); margin: 0; }

.meta { font-size: 13px; color: var(--text-soft); display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }

/* ── Deník („commity“) ── */
.commits { list-style: none; margin: 0; padding: 0; }
.commit { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--border-soft); }
.commit:first-child { border-top: 0; }
.commit-main { flex: 1; min-width: 0; }
.commit-main strong { font-weight: 600; }
.commit-main p { margin: 2px 0 4px; color: var(--text-soft); font-size: 14px; }
.commit-main details summary { cursor: pointer; list-style: none; }
.commit-main details summary::-webkit-details-marker { display: none; }
.commit-main details summary::after { content: " …"; color: var(--text-soft); font-weight: 400; }
.commit-main details[open] summary::after { content: ""; }
.commit-main details .prose { margin: 8px 0; font-size: 14px; }
.commit-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; flex: none; }
.empty { padding: 16px; color: var(--text-soft); }
.log-month { font-size: 14px; color: var(--text-soft); font-weight: 500; margin: 20px 0 8px; display: flex; gap: 8px; align-items: center; }

/* ── Heatmapa ── */
.heatmap-scroll { overflow-x: auto; padding-bottom: 4px; }
.heatmap { display: inline-block; min-width: 100%; }
.hm-months { display: grid; grid-template-columns: repeat(53, 13px); gap: 3px; font-size: 11px; color: var(--text-soft); height: 16px; }
.hm-months span { white-space: nowrap; overflow: visible; }
.hm-grid { display: grid; grid-template-columns: repeat(53, 13px); gap: 3px; }
.hm-week { display: grid; grid-template-rows: repeat(7, 13px); gap: 3px; }
.hm-grid i, .hm-legend i { display: block; width: 13px; height: 13px; border-radius: 3px; background: var(--hm0); }
.hm-grid i.hm-out { background: transparent; }
i.l1 { background: var(--hm1) !important; } i.l2 { background: var(--hm2) !important; }
i.l3 { background: var(--hm3) !important; } i.l4 { background: var(--hm4) !important; }
.hm-legend { display: flex; align-items: center; justify-content: flex-end; gap: 3px; font-size: 12px; color: var(--text-soft); margin-top: 8px; }
.hm-legend i { display: inline-block; }

/* ── Mini fáze v postranním panelu ── */
.mini-phases { list-style: none; padding: 0; margin: 0 0 8px; }
.mini-phases li { padding: 5px 0; }
.mini-phases a { display: grid; grid-template-columns: 10px 1fr auto; gap: 8px; align-items: center; color: var(--text); font-size: 14px; }
.mini-phases a:hover { text-decoration: none; color: var(--rose-deep); }
.mp-dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--border); background: var(--surface); }
.st-done .mp-dot { background: var(--plum); border-color: var(--plum); }
.st-active .mp-dot { background: var(--leaf); border-color: var(--leaf); }
.mp-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-period { font-size: 12px; color: var(--text-soft); white-space: nowrap; }
.st-done .progress span { background: var(--plum); }

.side-albums { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.side-albums img { aspect-ratio: 4/3; object-fit: cover; border-radius: 6px; width: 100%; }

/* ── Cesta projektu ── */
.roadmap { list-style: none; margin: 0; padding: 0 0 0 36px; position: relative; }
.roadmap::before { content: ""; position: absolute; left: 11px; top: 8px; bottom: 8px; width: 2px; background: var(--border); }
.rm-item { position: relative; margin-bottom: 18px; }
.rm-marker {
  position: absolute; left: -36px; top: 14px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--border); display: grid; place-items: center; color: #fff;
}
.rm-marker .ico { width: 14px; height: 14px; }
.st-done > .rm-marker { background: var(--plum); border-color: var(--plum); }
.st-active > .rm-marker { background: var(--leaf); border-color: var(--leaf); box-shadow: 0 0 0 4px var(--leaf-pale); }
.rm-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 14px 20px 0; }
.rm-head h2 { display: inline; font-size: 19px; }
.rm-head h2 a { color: var(--text); }
.rm-body { padding: 6px 20px 16px; }
.rm-body > p { margin: 6px 0 0; }
.st-planned .rm-card { background: #fdfbf8; }
.rm-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }

.tasks { list-style: none; margin: 8px 0 0; padding: 0; }
.tasks li { display: flex; gap: 8px; align-items: flex-start; padding: 3px 0; font-size: 14px; }
.tasks li > span:nth-child(2) { flex: 1; }
.tick {
  flex: none; width: 16px; height: 16px; margin-top: 2px; border: 1.5px solid #bfb2a4; border-radius: 4px;
  display: grid; place-items: center; background: var(--surface);
}
.tasks li.done .tick { background: var(--plum); border-color: var(--plum); color: #fff; }
.tasks li.done .tick .ico { width: 12px; height: 12px; }
.tasks li.done > span:nth-child(2) { color: var(--text-soft); }

/* ── Detail fáze ── */
.issue-head { margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.issue-head h1 { font-size: 30px; font-family: var(--ff-display); font-weight: 600; }
.issue-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 32px; flex-wrap: wrap; }

/* ── Galerie ── */
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.album { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; color: var(--text); }
.album:hover { text-decoration: none; border-color: var(--rose); }
.album-cover { position: relative; aspect-ratio: 4/3; background: var(--surface-2); }
.album-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.album:hover .album-cover img { transform: scale(1.03); }
.album-cover { overflow: hidden; }
.album-count { position: absolute; right: 8px; bottom: 8px; background: rgba(47,38,34,.75); color: #fff; font-size: 12px; padding: 2px 8px; border-radius: 2em; display: flex; gap: 4px; align-items: center; }
.album-body { padding: 10px 14px 12px; }
.album-body strong { display: block; margin-bottom: 2px; }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.photo-grid.small { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; }
.photo-grid.wide { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.photo-grid .ph { display: block; border-radius: 6px; overflow: hidden; background: var(--surface-2); }
.photo-grid img { width: 100%; aspect-ratio: 4/3; object-fit: cover; transition: transform .3s; }
.photo-grid.wide img { aspect-ratio: 16/9; }
.photo-grid .ph:hover img { transform: scale(1.04); }

.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(20,15,12,.94); display: flex; align-items: center; justify-content: center; }
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; max-width: 92vw; max-height: 90vh; text-align: center; }
.lightbox img { max-width: 92vw; max-height: 84vh; object-fit: contain; margin: 0 auto; }
.lightbox figcaption { color: #e9dfd4; font-size: 14px; margin-top: 8px; min-height: 1em; }
.lightbox button { position: absolute; background: none; border: 0; color: #fff; font-size: 44px; line-height: 1; cursor: pointer; padding: 12px 18px; opacity: .8; }
.lightbox button:hover { opacity: 1; }
.lb-close { top: 8px; right: 8px; }
.lb-prev { left: 4px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 4px; top: 50%; transform: translateY(-50%); }

/* ── Vize ── */
.vision-top { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.study { margin: 0; }
.study img { width: 100%; background: #fff; }
.vision-text > * + * { margin-top: 16px; }
.callout { border-color: #c8ddb5; background: var(--leaf-pale); }
.callout h2 { font-size: 17px; display: flex; gap: 8px; align-items: center; }
.zones { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; padding: 0; list-style: none; }

/* ── Přidejte se ── */
.join-hero .lead { font-size: 18px; }
.offer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 28px; }
.offer h3 { font-size: 16px; color: var(--rose-deep); }
.offer p { color: var(--text-soft); font-size: 14px; margin: 0; }
.form label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.form input[type=text], .form input[type=email], .form input[type=tel], .form textarea {
  display: block; width: 100%; margin-top: 4px; padding: 8px 12px; font: inherit; font-weight: 400;
  border: 1px solid var(--border); border-radius: 6px; background: #fff; color: var(--text);
}
.form input:focus, .form textarea:focus { outline: none; border-color: var(--rose); box-shadow: 0 0 0 3px var(--focus); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.interest { border: 1px solid var(--border-soft); border-radius: 6px; padding: 8px 14px 4px; margin: 0 0 14px; }
.interest legend { font-size: 14px; font-weight: 600; padding: 0 4px; }
.form .check { display: flex; gap: 8px; align-items: center; font-weight: 400; margin-bottom: 6px; }
.form .check input { accent-color: var(--rose); width: 16px; height: 16px; }
.hp { position: absolute; left: -9999px; }
.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; font-size: 14px; }
.flash.success { background: var(--leaf-pale); color: var(--leaf-deep); border: 1px solid #c8ddb5; }
.flash.error { background: var(--rose-pale); color: var(--rose-deep); border: 1px solid #ecc9c3; }
.event-list { list-style: none; padding: 0; margin: 0; }
.event-list li { padding: 8px 0; border-top: 1px solid var(--border-soft); }
.event-list li:first-child { border-top: 0; }
.ev-date { display: block; font-family: var(--ff-mono); font-size: 12px; color: var(--leaf-deep); }

/* ── Patička ── */
.footer { border-top: 1px solid var(--border); padding: 24px 0 40px; color: var(--text-soft); font-size: 13px; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center; }
.footer nav { display: flex; flex-wrap: wrap; gap: 16px; }
.footer .brand-heart { font-size: 16px; color: var(--rose); }

/* ── Mobil ── */
@media (max-width: 900px) {
  .layout, .vision-top { grid-template-columns: minmax(0, 1fr); }
  .col-side { border-top: 1px solid var(--border); padding-top: 20px; }
}
@media (max-width: 600px) {
  .wrap { padding: 0 16px; }
  .repo-path { font-size: 17px; }
  .repo-actions { width: 100%; }
  .repo-actions .btn { flex: 1; justify-content: center; }
  .page-intro h1, .issue-head h1 { font-size: 26px; }
  .form-row { grid-template-columns: 1fr; }
  .rm-head { flex-direction: column; gap: 6px; padding: 12px 14px 0; }
  .rm-body { padding: 6px 14px 14px; }
  .roadmap { padding-left: 28px; }
  .roadmap::before { left: 9px; }
  .rm-marker { left: -28px; width: 20px; height: 20px; }
  .box-body { padding: 14px; }
  .commit { flex-wrap: wrap; padding: 12px 14px; }
  .photo-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .photo-grid.wide { grid-template-columns: 1fr; }
}
