/* ============================================================
   SVJ Jasanová 1, 3, 5, Blansko – společné styly pro celý web
   Jedna změna zde = změna na všech stránkách.
   ============================================================ */

:root {
  --bg: #faf6f0;
  --panel: #ffffff;
  --text: #1c1917;
  --muted: #57534e;
  --line: #eadfd2;
  --primary: #c2410c;
  --secondary: #ea580c;
  --teal: #14b8a6;
  --amber: #f59e0b;
  --violet: #b45309;
  --emerald: #10b981;
  --radius: 14px;
  --shadow: 0 8px 24px rgba(60, 30, 10, .08);
  --sidebar-w: 260px;
  --container: 1040px;
  --safe: env(safe-area-inset-bottom);
}

* { box-sizing: border-box }
html { scroll-behavior: smooth }

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  padding-bottom: var(--safe);
}

img { max-width: 100%; display: block; height: auto }
a { color: var(--primary); text-decoration: none }
a:hover { text-decoration: underline }

.container { max-width: var(--container); margin: 0 auto; padding: 0 20px }

/* Skip link */
.skip-link { position: absolute; left: -9999px; top: auto }
.skip-link:focus {
  left: 12px; top: 12px;
  background: #fff;
  border: 1px solid var(--line);
  padding: 8px 12px;
  border-radius: 10px;
  z-index: 9999;
}

/* Header */
header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 68px }
.brand { display: flex; align-items: center; gap: 12px }
.logo {
  width: 36px; height: 36px; border-radius: 10px;
  background: conic-gradient(from 200deg, var(--primary), var(--secondary));
  box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center;
  color: #fff; flex: 0 0 36px;
}
.logo svg { width: 22px; height: 22px }
.brand h1 { font-size: 18px; margin: 0 }
.brand small { display: block; color: var(--muted) }

nav ul { display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; flex-wrap: nowrap }
nav a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 11px; border-radius: 10px; color: var(--text); white-space: nowrap; font-size: 15px }
nav a:hover { background: #fdeadd; text-decoration: none }
.hamburger { display: none; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 10px }

/* Hero */
.hero-wide { position: relative; margin: 0 0 12px 0; border-bottom: 1px solid var(--line); background: #fdf1e7; overflow: hidden }
.hero-wide .media { width: 100%; height: clamp(260px, 35vw, 460px); object-fit: cover; display: block; filter: brightness(.86) }
.hero-wide .overlay-text {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center; text-align: center;
  color: #fff; font-weight: 700; font-size: clamp(22px, 3.5vw, 44px);
  text-shadow: 0 3px 16px rgba(0, 0, 0, .45);
  background: linear-gradient(to bottom, rgba(0, 0, 0, .25) 0%, rgba(0, 0, 0, .45) 100%);
}
.hero-wide .bar { height: 6px; background: linear-gradient(90deg, var(--primary), var(--secondary), var(--violet)) }

.hero-body-wrap { margin: 16px 0 24px }
.hero-body { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px }
.title { font-size: clamp(26px, 3.2vw, 40px); margin: 8px 0 6px }
.lead { color: var(--muted); margin: 0 }

/* Layout */
main { padding: 8px 0 28px }
.layout { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); gap: 24px }
.sidebar { position: sticky; top: 96px; align-self: start }

/* Sidebar menu */
.menu { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden }
.menu h3 { margin: 0; padding: 14px 16px; background: #f5efe6; border-bottom: 1px solid var(--line); font-size: 14px; color: var(--muted) }
.menu a { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; color: var(--text); border-bottom: 1px solid var(--line) }
.menu a:last-child { border-bottom: none }
.menu a:hover { background: linear-gradient(90deg, #fdf1e7, #fef7ec) }
.menu a.is-active { background: linear-gradient(90deg, #fed7aa, #fde8d7); font-weight: 600; border-left: 4px solid var(--primary) }

/* Zvýrazněný oznamovací blok */
.section.announce {
  border: 2px solid #fdba74;
  background: linear-gradient(135deg, #fff7ed, #ffffff);
  box-shadow: 0 12px 32px rgba(194, 65, 12, .16);
}
.section.announce h2 { margin: 4px 0 8px }
.section.announce .address {
  font-size: clamp(18px, 2.2vw, 24px);
  font-weight: 700;
}

/* Section blocks */
section.section { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 24px }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 12px }
.accent { height: 6px; width: 100%; border-radius: 6px; margin: -6px 0 12px }

/* Color accents */
.section[data-theme="novinky"] .accent { background: linear-gradient(90deg, var(--primary), var(--secondary)) }
.section[data-theme="dokumenty"] .accent { background: linear-gradient(90deg, var(--teal), var(--emerald)) }
.section[data-theme="kalendar"] .accent { background: linear-gradient(90deg, var(--amber), #fbbf24) }
.section[data-theme="galerie"] .accent { background: linear-gradient(90deg, #e11d48, #fb923c) }
.section[data-theme="kontakt"] .accent { background: linear-gradient(90deg, var(--emerald), #34d399) }
.section[data-theme="odber"] .accent { background: linear-gradient(90deg, var(--secondary), var(--teal)) }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: #ffffff; color: var(--text);
  min-height: 44px;
}
.btn:hover { background: #faf3ea }
.btn.primary { background: linear-gradient(90deg, var(--primary), var(--secondary)); color: #fff; border: 0; cursor: pointer; font-size: 15px }

/* Grids and lists */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px }
@media (max-width:900px) { .grid-3 { grid-template-columns: repeat(2, 1fr) } }
@media (max-width:620px) { .grid-3 { grid-template-columns: 1fr } }

.card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #fff }
.meta { color: var(--muted); font-size: 14px }
.list { display: grid; gap: 10px }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: #fff }

footer { margin: 12px 0 40px; color: var(--muted); text-align: center }

/* Tag pills */
.tag { display: inline-flex; align-items: center; padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 600 }
.tag.info { color: #7c2d12; background: #fed7aa }
.tag.warn { color: #991b1b; background: #fecaca }
.tag.ok { color: #064e3b; background: #d1fae5 }
.tag.pin { color: #92400e; background: #fde68a }
.tag.new { color: #065f46; background: #a7f3d0; margin-right: 6px }

.card.pinned { border: 2px solid #fdba74; box-shadow: 0 12px 32px rgba(194, 65, 12, .16) }
.card.fresh { border: 2px solid #34d399; box-shadow: 0 12px 32px rgba(16, 185, 129, .18) }

/* Seznamy uvnitř karet novinek */
.card ul { margin: 6px 0 10px; padding-left: 20px }
.card ul li { margin-bottom: 6px }

/* Kontakty – karty s rolemi */
.contact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px }
@media (max-width:820px) { .contact-grid { grid-template-columns: 1fr } }

.contact-card {
  display: flex; gap: 12px; align-items: flex-start;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; box-shadow: var(--shadow);
}
.contact-avatar {
  flex: 0 0 44px; width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
}
.contact-body { flex: 1; min-width: 0 }
.contact-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap }
.contact-name { margin: 0; font-size: 16px; font-weight: 700 }

.role { display: inline-flex; align-items: center; padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; border: 1px solid transparent }
.role.chair { background: #fed7aa; color: #7c2d12; border-color: #fdba74 }      /* Předseda */
.role.account { background: #d1fae5; color: #064e3b; border-color: #a7f3d0 }   /* Účetní správce */
.role.manager { background: #e7e5e4; color: #44403c; border-color: #d6d3d1 }   /* Správce SVJ */
.role.member { background: #ffe4e6; color: #9f1239; border-color: #fecdd3 }    /* Člen */
.role.web { background: #ccfbf1; color: #115e59; border-color: #99f6e4 }       /* Správce stránek */

/* Podtržený modrý odkaz */
a.u { text-decoration: underline; color: var(--primary) }

.contact-meta { margin: 6px 0 10px; color: var(--muted); font-size: 14px }
.contact-actions { display: flex; gap: 8px; flex-wrap: wrap }
.contact-actions .btn { min-height: 38px; padding: 8px 12px; border-radius: 10px }

/* Mapa */
.map-wrap { margin-top: 16px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow) }
.map-wrap iframe { display: block; width: 100%; height: 340px; border: 0 }

/* Zkrácení dlouhých textů v kartách novinek (…) */
.card p.clamp {
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Odběr novinek jako pod-blok uvnitř sekce */
.subblock {
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding-top: 14px;
}
.subblock h3 { margin: 0 0 6px }

/* Newsletter formulář */
.newsletter-form { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px }
.newsletter-form input[type="email"],
.newsletter-form input[type="text"]:not(.hp) {
  flex: 1 1 240px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  min-height: 44px;
}
.newsletter-form input:focus { outline: 2px solid var(--secondary); outline-offset: 1px }
.newsletter-note { color: var(--muted); font-size: 13px; margin: 10px 0 0 }
.hidden { display: none }

/* Fotogalerie */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(340px, 480px));
  justify-content: center;
  align-items: start;
  gap: 20px;
  margin-inline: auto;
}
figure.photo-card {
  width: 100%; max-width: 480px; margin: 0;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  overflow: hidden; box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease;
}
figure.photo-card:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(2, 6, 23, .14) }
.photo { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block }
figcaption { padding: 12px 14px; font-size: 15px; color: var(--muted); text-align: center }
@media (max-width:760px) { .gallery-grid { grid-template-columns: 1fr; justify-content: center } }

/* MOBILE NAV */
@media (max-width:700px) {
  .layout { grid-template-columns: 1fr }
  .sidebar { display: none }
  .topbar { height: 64px }
  nav { position: static }
  .hamburger { display: inline-flex }

  nav ul {
    position: fixed;
    top: 64px; left: 0; right: 0;
    display: none;
    flex-direction: column;
    gap: 0;
    background: #fff;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    padding: 6px;
    z-index: 1000;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
  }
  nav ul.show { display: flex }
  nav ul li { list-style: none }
  nav a { width: 100%; padding: 14px 16px; border-radius: 10px; line-height: 1.35 }
  nav a:hover { background: #f5efe6; text-decoration: none }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto }
  * { animation: none !important; transition: none !important }
}

/* Print */
@media print {
  header, .sidebar, .hero-wide, .section[data-theme="galerie"] { display: none }
  .section { border: none; box-shadow: none }
  a[href]:after { content: " (" attr(href) ")"; font-size: 12px }
}
