/* =========================================================
   Katalog webů — stylesheet v3
   Koncept: čistý, profesionální "srovnávací adresář" — světlé
   panely v barvě kategorie, číslované seznamy, sloupcová mřížka.
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root{
  --bg:        #F5F6F8;
  --panel:     #FFFFFF;
  --ink:       #14161F;
  --line:      #E4E6EC;
  --line-soft: #EEF0F4;
  --text:      #1B1E27;
  --muted:     #6B7180;
  --dim:       #9297A6;

  /* barvy přiřazené kategoriím (cyklicky) */
  --c1: #2563EB; /* modrá */
  --c2: #7C3AED; /* fialová */
  --c3: #059669; /* zelená */
  --c4: #DC2626; /* červená */
  --c5: #D97706; /* jantarová */
  --c6: #DB2777; /* purpurová */

  --radius: 12px;
  --max: 1240px;
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html, body{ max-width: 100%; }
body{
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a{ color: inherit; text-decoration: none; }
img{ max-width: 100%; display: block; }
:focus-visible{ outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 3px; }

.wrap{ max-width: var(--max); margin: 0 auto; padding: 0 24px; width: 100%; }
@media (max-width: 480px){ .wrap{ padding: 0 16px; } }

h1, h2, h3{ font-weight: 700; letter-spacing: -.01em; }

/* ---------- Masthead ---------- */
.masthead{ background: var(--ink); color: #fff; position: relative; }
.masthead-top{
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; gap: 20px;
}
.brand{ display: flex; align-items: center; gap: 10px; font-size: 1.1rem; font-weight: 700; min-width: 0; }
/* Logo obsahuje ikonku přesahující o ~22px vlevo za samotný text —
   posunutím obrázku doprava zarovnáme viditelný text loga s nadpisem pod ním. */
.brand img{ height: 60px; width: auto; max-width: 54vw; display: block; vertical-align: middle; margin-left: 22px; }
@media (max-width: 760px){
  .brand img{ height: 44px; margin-left: 16px; }
}
.brand .mark{
  width: 28px; height: 28px; border-radius: 7px; background: #fff; color: var(--ink);
  display: grid; place-items: center; font-size: .95rem; flex-shrink: 0;
}

/* Desktop nav — řádek odkazů */
.masthead nav{ display: flex; gap: 2px; font-size: .87rem; flex-wrap: wrap; }
.masthead nav a{ color: #C7CAD6; padding: 7px 12px; border-radius: 7px; white-space: nowrap; }
.masthead nav a:hover{ color: #fff; background: rgba(255,255,255,.08); }

/* Hamburger tlačítko — skryté na desktopu */
.nav-toggle{
  display: none; flex-direction: column; justify-content: center; gap: 4px;
  width: 38px; height: 38px; border: 0; background: rgba(255,255,255,.08);
  border-radius: 8px; cursor: pointer; flex-shrink: 0;
}
.nav-toggle span{ display: block; width: 18px; height: 2px; background: #fff; margin: 0 auto; border-radius: 2px; }

@media (max-width: 760px){
  .nav-toggle{ display: flex; }
  .masthead nav{
    display: none;
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; flex-wrap: nowrap; gap: 2px;
    background: var(--ink); border-top: 1px solid rgba(255,255,255,.1);
    padding: 10px 16px 16px; box-shadow: 0 12px 24px rgba(0,0,0,.25);
  }
  .masthead nav.open{ display: flex; }
  .masthead nav a{ padding: 11px 10px; border-radius: 6px; }
}

/* ---------- Page header (search) ---------- */
.page-header{ background: var(--ink); color: #fff; padding: 34px 0 46px; }
.page-header .stats{ display: flex; gap: 18px; font-size: .82rem; color: #9BA0B0; margin-bottom: 14px; }
.page-header .stats b{ color: #fff; }
.page-header h1{ font-size: clamp(1.7rem, 3.4vw, 2.35rem); margin: 0 0 10px; max-width: 26ch; }
.page-header p.lede{ color: #ADB1C2; max-width: 60ch; margin: 0 0 24px; font-size: 1rem; }
.search-box{ display: flex; max-width: 520px; background: #fff; border-radius: 9px; overflow: hidden; }
.search-box input{ flex: 1; border: 0; padding: 13px 16px; font-size: .93rem; font-family: inherit; color: var(--text); }
.search-box button{
  border: 0; cursor: pointer; background: var(--c1); color: #fff; font-weight: 600;
  font-size: .88rem; padding: 0 20px;
}
.search-box button:hover{ filter: brightness(1.08); }

/* ---------- Panel grid (homepage) ---------- */
.content{ padding: 40px 0 90px; }
.panel-grid{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
  align-items: start;
}
@media (max-width: 1100px){ .panel-grid{ grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 800px){ .panel-grid{ grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px){ .panel-grid{ grid-template-columns: 1fr; } }

.panel{
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 3px solid var(--acc, var(--c1));
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  display: flex; flex-direction: column;
}
.panel-head{ display: flex; align-items: center; gap: 9px; margin-bottom: 4px; }
.panel-icon{ font-size: 1.15rem; line-height: 1; }
.panel-head h2{ font-size: 1rem; margin: 0; }
.panel-rule{ width: 34px; height: 3px; background: var(--acc, var(--c1)); border-radius: 3px; margin: 8px 0 10px; }
.panel-desc{ font-size: .82rem; color: var(--muted); margin: 0 0 12px; min-height: 2.6em; }

.panel-list{ list-style: none; margin: 0 0 14px; padding: 0; }
.panel-list li{
  display: flex; align-items: baseline; gap: 8px;
  padding: 5px 0; font-size: .87rem; border-bottom: 1px dashed var(--line-soft);
  max-width: 100%;
}
.panel-list li:last-child{ border-bottom: 0; }
.panel-list .n{ color: var(--dim); font-variant-numeric: tabular-nums; width: 1.4em; flex-shrink: 0; text-align: right; font-size: .8rem; }
.panel-list a{
  color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; min-width: 0; flex: 1 1 auto;
}
.panel-list a:hover{ color: var(--acc, var(--c1)); }
.panel-list .badge{
  font-size: .62rem; font-weight: 700; color: var(--acc, var(--c1));
  background: color-mix(in srgb, var(--acc, var(--c1)) 12%, transparent);
  padding: 1px 6px; border-radius: 999px; flex-shrink: 0;
}
.panel-list li.fade{ opacity: .4; }

@media (max-width: 540px){
  .panel{ padding: 16px 16px 14px; }
  .panel-grid{ gap: 16px; }
}
@media (max-width: 520px){
  .panel-grid{ grid-template-columns: 1fr; }
  .panel{ width: 95%; margin: 0 auto; }
}

.panel-cta{
  margin-top: auto;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--acc, var(--c1)); color: #fff; font-weight: 600; font-size: .84rem;
  padding: 10px 14px; border-radius: 8px;
}
.panel-cta:hover{ filter: brightness(1.08); }

.empty-state{
  padding: 70px 20px; text-align: center; color: var(--muted);
  border: 1px dashed var(--line); border-radius: var(--radius); grid-column: 1 / -1;
}

/* ---------- Category page: full index list ---------- */
.index-head{
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  margin-bottom: 24px; padding-bottom: 16px; border-bottom: 3px solid var(--acc, var(--c1));
}
.index-head h2{ font-size: 1.5rem; margin: 0; display: flex; align-items: center; gap: 10px; }
.index-head .meta{
  font-size: .78rem; font-weight: 700; color: #fff; background: var(--acc, var(--c1));
  padding: 5px 14px; border-radius: 999px; white-space: nowrap;
}

.row{
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 18px; align-items: center;
  max-width: 100%;
  background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--acc, var(--c1));
  border-radius: var(--radius); padding: 18px 20px; margin-bottom: 14px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.row:last-child{ margin-bottom: 0; }
.row:hover{ transform: translateY(-3px); box-shadow: var(--shadow, 0 14px 28px -12px rgba(0,0,0,.18)); }
.row .n{
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  background: color-mix(in srgb, var(--acc, var(--c1)) 14%, transparent);
  color: var(--acc, var(--c1)); font-weight: 800; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
}
.row h3{ margin: 0 0 5px; font-size: 1.05rem; overflow-wrap: anywhere; }
.row h3 a{ color: var(--text); }
.row h3 a:hover{ color: var(--acc, var(--c1)); }
.row p{ margin: 0 0 9px; color: var(--muted); font-size: .89rem; max-width: 62ch; overflow-wrap: anywhere; }
.row .tags{ display: flex; flex-wrap: wrap; gap: 6px; }
.tag{ font-size: .74rem; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; text-decoration: none; display: inline-block; }
.tag:hover{ color: #fff; background: var(--acc, var(--c1)); border-color: var(--acc, var(--c1)); text-decoration: none; }
.tag.tag-cat{ color: var(--acc, var(--c1)); border-color: var(--acc, var(--c1)); font-weight: 600; }
.tag.tag-cat:hover{ color: #fff; }
.row .side{ text-align: right; font-size: .78rem; color: var(--muted); white-space: nowrap; }
.row .rating{
  display: inline-block; font-weight: 700; font-size: .82rem; color: var(--acc, var(--c1));
  background: color-mix(in srgb, var(--acc, var(--c1)) 12%, transparent);
  padding: 3px 11px; border-radius: 999px; margin-bottom: 6px;
}

@media (max-width: 640px){
  .row{ grid-template-columns: 36px minmax(0, 1fr); row-gap: 8px; padding: 16px; }
  .row .n{ width: 32px; height: 32px; font-size: .9rem; }
  .row .side{
    grid-column: 2 / -1; text-align: left; white-space: normal;
    display: flex; align-items: center; gap: 12px; padding-top: 2px;
  }
  .row .rating{ margin-bottom: 0; }
}
@media (max-width: 520px){
  .index-head, .row{ width: 95%; margin-left: auto; margin-right: auto; }
}

/* ---------- Listing detail page ---------- */
.detail-hero{ background: var(--ink); color: #fff; padding: 30px 0 36px; }
.breadcrumb{ font-size: .82rem; color: #9BA0B0; margin-bottom: 16px; }
.breadcrumb a{ color: #9BA0B0; }
.breadcrumb a:hover{ color: #fff; }
.cat-chip{
  display: inline-block; font-size: .76rem; font-weight: 700; color: #fff;
  background: var(--acc, var(--c1)); padding: 4px 11px; border-radius: 999px; margin-bottom: 12px;
}
.detail-hero h1{ font-size: clamp(1.7rem, 3.6vw, 2.3rem); margin: 0 0 10px; max-width: 22ch; color: #fff; }
.detail-hero .lede{ color: #ADB1C2; max-width: 66ch; font-size: 1.02rem; margin: 0 0 20px; }
.detail-meta{ display: flex; flex-wrap: wrap; gap: 18px; align-items: center; font-size: .87rem; color: #ADB1C2; }
.btn{
  display: inline-block; font-weight: 700; font-size: .88rem; color: #fff;
  padding: 10px 20px; border-radius: 8px; background: var(--acc, var(--c1));
}
.btn:hover{ filter: brightness(1.1); }

.article-body{ max-width: 68ch; padding: 34px 0 0; font-size: 1rem; }
.article-body h3{ margin-top: 1.5em; color: var(--text); }
.article-body p{ margin: 0 0 1.1em; color: #3A3E4A; }
.article-body ul, .article-body ol{ margin: 0 0 1.1em; padding-left: 1.3em; color: #3A3E4A; }
.article-body li{ margin-bottom: .4em; }

/* ---------- Detail: dvousloupcový layout (obsah + pravý panel) ---------- */
.detail-layout{
  display: grid; grid-template-columns: 1fr 300px; gap: 40px;
  align-items: start; padding: 34px 0 60px;
}
@media (max-width: 900px){ .detail-layout{ grid-template-columns: 1fr; } }

.detail-aside{ display: flex; flex-direction: column; gap: 18px; position: sticky; top: 16px; }
.aside-box{ background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.aside-box h4{ margin: 0 0 12px; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.aside-box .info-row{ display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line-soft); font-size: .89rem; }
.aside-box .info-row:last-child{ border-bottom: 0; }
.aside-box .info-row span:first-child{ color: var(--muted); }
.aside-box .tags{ display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.aside-box .btn{ display: block; text-align: center; margin-top: 6px; }
.ad-box{ background: var(--panel); border: 1px dashed var(--line); border-radius: var(--radius); overflow: hidden; }

/* Hlasování návštěvníků (1–5 hvězd), AJAX přes vote.php */
.vote-widget .stars-input{ display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; font-size: 1.6rem; line-height: 1; margin: 6px 0 8px; }
.vote-widget .stars-input button{
  background: none; border: 0; cursor: pointer; padding: 0; color: var(--line);
  transition: color .12s ease, transform .1s ease;
}
.vote-widget .stars-input button.filled,
.vote-widget .stars-input button.filled ~ button{ color: var(--acc, var(--c1)); }
.vote-widget .stars-input button:hover,
.vote-widget .stars-input button:hover ~ button{ color: var(--acc, var(--c1)); transform: scale(1.08); }
.vote-widget small{ color: var(--muted); font-size: .8rem; }
.vote-widget .msg{ font-size: .8rem; margin-top: 6px; }
.vote-widget .msg.ok{ color: var(--c3); }
.vote-widget .msg.err{ color: var(--c4); }

/* ---------- Footer ---------- */
footer{ border-top: 1px solid var(--line); padding: 30px 0; font-size: .85rem; color: var(--dim); }
footer .wrap{ display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
footer a{ color: var(--muted); }
footer a:hover{ color: var(--text); }

.sr-only{ position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
