/* =========================================================
   Chalupa na horách – child šablona Cassiopeia (Joomla 6)
   Vzhled převzatý z původní šablony template_chalupanahorach_cz,
   doplněný o plně responzivní (mobilní) layout.
   ========================================================= */

:root {
  --ch-white: #fff;
  --ch-black: #000;
  --ch-grey: #a6beca;
  --ch-grey-dark: #86a7b7;
  --ch-grey-light: #e3ebee;
  --ch-blue: #306eb9;
  --ch-navy: #0d2a4f;
  --ch-green: #5fbd4a;
  --ch-green-hover: #76c764;
  --ch-green-light: #e0f0f4;
  --ch-orange: #f55b30;
  --ch-font: Tahoma, Verdana, "Segoe UI", Arial, Helvetica, sans-serif;
  --ch-header-h: 96px;
  --ch-maxw: 1170px;
}

/* ---------- základ ---------- */
html { scroll-behavior: smooth; }
body.site {
  margin: 0;
  font-family: var(--ch-font);
  font-size: 15px;
  font-weight: 300;
  line-height: 1.5;
  color: var(--ch-black);
  background: var(--ch-white);
  min-width: 320px;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; }
a { color: var(--ch-blue); }
a:hover { color: var(--ch-orange); }
p { margin: 0 0 .66rem; line-height: 1.7em; }
p:last-child { margin-bottom: 0; }
b, strong { font-weight: bold; }

h1, h2, h3, h4, h5, h6 {
  margin: 1em 0 .5em;
  font-family: var(--ch-font);
  font-weight: 800;
  line-height: 1.3em;
  color: var(--ch-blue);
}
h1:first-child, h2:first-child, h3:first-child, h4:first-child { margin-top: 0; }
h1 { font-size: 2em; }
h2 { font-size: 2em; margin: .5em 0 1em; }
h3 { font-size: 1.6em; font-weight: 700; }
h4 { font-size: 1.4em; font-weight: 700; }
h5 { font-size: 1.2em; font-weight: 700; }
h6 { font-size: 1em; font-weight: 700; }

[id] { scroll-margin-top: calc(var(--ch-header-h) + 8px); }

.sizestab { max-width: var(--ch-maxw); padding: 0 1rem; margin: 0 auto; }
.sizestab .sizestab { padding: 0; }
.padding-vertical { padding-top: 1rem; padding-bottom: 1rem; }
.clear { clear: both; }

/* ---------- tlačítka ---------- */
.btn {
  display: inline-block;
  width: auto;
  margin: .25rem .5rem;
  padding: .5rem 1.25rem;
  font-weight: bold;
  line-height: 1rem;
  text-align: center;
  text-decoration: none;
  text-transform: none;
  white-space: nowrap;
  color: var(--ch-white);
  background: #f7764f;
  border: 1px solid var(--ch-orange);
  border-radius: .8em;
  transition: background .3s, box-shadow .3s;
}
.btn:hover, .btn:focus { color: var(--ch-white); background: var(--ch-orange); text-decoration: none; }
.btn.btn-green { background: var(--ch-green-hover); border-color: var(--ch-green); color: var(--ch-white); }
.btn.btn-green:hover, .btn.btn-green:focus { background: var(--ch-green); border-color: var(--ch-green); color: var(--ch-white); }
.btn.btn-big { padding: .7rem 1.8rem; border-radius: 1.2em; }

/* ---------- hlavička ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--ch-white);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: var(--ch-header-h);
}
.header p { margin: 0; line-height: 1; }
.header-logo { flex: 0 0 auto; order: 1; }
.header-logo a { display: block; line-height: 1; }
.header-logo img { display: block; width: 160px; padding: .8rem 0; }
.header-nav { order: 2; margin-left: auto; }
.header-contact { order: 3; }
.header-contact .btn { margin: 0; padding: 1rem; }

.header-nav ul.mod-menu {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  list-style: none;
}
.header-nav ul.mod-menu > li { position: relative; margin: 0; font-size: 1.1rem; }
.header-nav ul.mod-menu > li:first-child { display: none; } /* "Domů" – stejně jako na původním webu */
.header-nav ul.mod-menu > li > a {
  display: inline-block;
  padding: 0 1rem;
  line-height: 3rem;
  color: var(--ch-blue);
  font-weight: 300;
  text-decoration: none;
  text-transform: uppercase;
}
.header-nav ul.mod-menu > li > a:hover,
.header-nav ul.mod-menu > li.active > a { color: var(--ch-orange); }

.menu-toggle { display: none; }

/* ---------- barevné sady sekcí (z původní šablony) ---------- */
.bg-set-light, .bg_set_light { background: var(--ch-grey); color: var(--ch-black); }
.bg-set-light :is(h1, h2, h3, a), .bg_set_light :is(h1, h2, h3, a) { color: var(--ch-black); }

.bg-set-dark-img, .bg_set_dark_img {
  overflow: hidden;
  color: var(--ch-white);
  background: url("../images/bg_blue_cloud.jpg") no-repeat center center var(--ch-grey-dark);
  background-size: cover;
}
.bg-set-dark-img :is(h1, h2, h3, a), .bg_set_dark_img :is(h1, h2, h3, a) { color: var(--ch-white); }

.bg-set-chalupa, .bg_set_chalupa {
  overflow: hidden;
  color: var(--ch-white);
  background: url("../images/bg_top_chalupa.jpg") no-repeat top center var(--ch-green-light);
  background-size: 110% auto;
  padding: 17rem 0 3rem !important;
}
.bg-set-chalupa :is(h1, h2, h3, a), .bg_set_chalupa :is(h1, h2, h3, a) { color: var(--ch-white); }
.bg_set_chalupa > .sizestab > h2 { text-shadow: 0 2px 8px rgba(0, 0, 0, .45); }

.bg-set-mapa, .bg_set_mapa {
  overflow: hidden;
  color: var(--ch-black);
  background: url("../images/bg_mapa.jpg") no-repeat center center var(--ch-grey-dark);
  background-size: cover;
}
.bg-set-white, .bg_set_white { background: var(--ch-white); }
.bg-set-green, .bg_set_green { background: var(--ch-green); color: var(--ch-white); }
.bg-set-green :is(h1, h2, h3, h4, h5, h6, label, a), .bg_set_green :is(h1, h2, h3, h4, h5, h6, label, a) { color: var(--ch-white); }
.bg-set-green a:hover { color: var(--ch-blue); }

/* ---------- článek (one-page) ---------- */
.item-page.without-sizestab section { position: relative; padding: 2.5rem 1rem; }
.item-page.without-sizestab section > div { max-width: var(--ch-maxw); padding: 0 1rem; margin: 0 auto; }
.item-page.without-sizestab .page-header { position: relative; overflow: hidden; padding: 0; }
.item-page.without-sizestab .page-header > .sizestab { padding: 0 1rem; }
.item-page img[src*="images/template/svg/"] { display: inline-block; }

.maincontent .padding { padding: 1.5rem; }
.maincontent .nopadding { padding: 0; }

/* tabulky použité jako flex layout (tr.flexbox > td.item) */
.maincontent table { border-collapse: collapse; }
.maincontent table:has(> tbody > tr.flexbox) { display: block; width: 100% !important; }
.maincontent table:has(> tbody > tr.flexbox) > tbody { display: block; }
.maincontent tr.flexbox { display: flex; flex-wrap: wrap; align-items: stretch; }
.maincontent tr.flexbox > td.item { display: block; flex: 1 0 auto; }
.maincontent tr.flexbox.cols-2 > td.item { flex: 2 0 39%; width: 50%; min-width: 280px; }
.maincontent tr.flexbox.cols-3 > td.item { flex: 3 0 30%; width: 33%; min-width: 280px; }
.maincontent tr.flexbox.cols-3 > td.item[colspan="2"] { flex: 6 0 60%; }
.maincontent tr.flexbox.flex-separated > td.item { margin: .5rem; }

.img-cover {
  display: block;
  width: 100%;
  height: 100% !important;
  min-height: 250px;
  object-fit: cover;
}

/* fotka v odkazu (JCE MediaBox dělá z odkazu inline-block) – vždy na celou šířku boxu */
.maincontent a:has(> img.img-cover) { display: block; width: 100%; }
.maincontent a:has(> img.img-cover) > img.img-cover { width: 100% !important; max-width: none; }

/* "To nejlepší pro vás" */
.box-to-nej-pro-vas { margin: 3rem 0; background: var(--ch-white); color: var(--ch-black); }
.box-to-nej-pro-vas td.item { padding: 0; vertical-align: middle; }
.box-to-nej-pro-vas td.item > div { padding: 1.5rem; }
.box-to-nej-pro-vas td.item:not(:has(img.img-cover)) { display: flex !important; align-items: center; justify-content: center; }
.box-to-nej-pro-vas h3 { color: var(--ch-black) !important; }

/* pokoje + ceník */
#pokoje { background-size: auto 400px; background-repeat: repeat-x; background-position: top center; }
.box-pokoje td.item:not(.bg-set-green) { background: var(--ch-white); color: var(--ch-black); }
.box-pokoje td.item p > a > img, .box-pokoje td.item p > img { display: block; }
.box-pokoje td.item > p:first-child { margin: 0; }
.box-pokoje td.item table { margin: 1rem auto; }
.box-pokoje td.item table td { padding: .25rem; vertical-align: middle; }
.box-pokoje td.item table img { width: 24px; height: 24px; }
.box-pokoje .pricelist { padding: 1rem 1.5rem; }
.box-pokoje .pricelist table td { padding: .3rem .25rem; border-bottom: 1px solid rgba(255, 255, 255, .25); vertical-align: top; }
.box-pokoje .pricelist table tr:last-child td { border-bottom: 0; }

/* společné prostory */
.bg-set-white.item { background: var(--ch-white); }

/* fotogalerie – mřížka náhledů */
#fotogalerie .sizestab > p:last-child {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  text-align: left !important;
}
#fotogalerie .sizestab > p:last-child > a {
  display: block;
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border-radius: 4px;
  background: rgba(255, 255, 255, .08);
}
#fotogalerie .sizestab > p:last-child > a img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
#fotogalerie .sizestab > p:last-child > a:hover img { transform: scale(1.05); }

/* kontakt / mapa */
.bg_set_mapa { min-height: 360px; }
.adresa { max-width: 300px; padding: 1.5rem; background: var(--ch-green); color: var(--ch-white); }
.adresa h4 { color: var(--ch-white); margin-top: 0; }
.adresa a { color: var(--ch-white); }

/* ---------- RSForm – rezervační formulář ---------- */
#rezervace .rsform, #rezervace form.formResponsive { max-width: 600px; margin: 0 auto; text-align: left; }
#userForm.formResponsive .formVertical label.formControlLabel,
#rezervace .formControlLabel { color: var(--ch-white); font-weight: 700; }
#rezervace input[type="text"], #rezervace input[type="email"], #rezervace input[type="tel"],
#rezervace input[type="number"], #rezervace textarea, #rezervace select {
  width: 100% !important;
  max-width: 100%;
  height: auto !important;
  min-height: 2.6rem;
  padding: .5rem .75rem;
  font: inherit;
  font-weight: 400;
  color: #333;
  background: var(--ch-white);
  border: 1px solid var(--ch-grey-light);
  border-radius: 6px;
  box-sizing: border-box;
}
#rezervace textarea { min-height: 120px; }
#rezervace input:focus, #rezervace textarea:focus, #rezervace select:focus { outline: 2px solid var(--ch-green); border-color: var(--ch-green); }
#rezervace .formRequired { color: var(--ch-white); }
#rezervace .formError, #rezervace .formValidation .formError { color: #b00020; font-weight: bold; }
#rezervace .formDescription:empty { display: none; }
#rezervace .rsform-calendar-button, #rezervace .btnCalendar {
  color: var(--ch-white);
  background: var(--ch-green-hover);
  border: 1px solid var(--ch-green);
  border-radius: .8em;
  padding: .45rem 1rem;
  font-weight: bold;
}
#rezervace button[type="submit"], #rezervace .rsform-submit-button {
  display: block;
  margin: 1rem auto 0;
  padding: .7rem 1.8rem;
  font-weight: bold;
  color: var(--ch-white);
  background: var(--ch-green-hover);
  border: 1px solid var(--ch-green);
  border-radius: 1.2em;
  cursor: pointer;
}
#rezervace button[type="submit"]:hover { background: var(--ch-green); }
#rezervace .formRow { display: flex; flex-wrap: wrap; gap: 0 1rem; }
#rezervace .formRow > [class*="formSpan"] { flex: 1 1 240px; }
#rezervace .formRow > .formSpan12 { flex-basis: 100%; }
#rezervace .rsform-block { margin-bottom: .75rem; }
#rezervace .formControls, #rezervace .formBody { width: 100%; }

/* ---------- patička ---------- */
.copyright .module { padding: 1rem; }
.copyright .bg-set-green { background: var(--ch-green); color: var(--ch-white); }
.copyright p { margin: 0; }

.back-to-top {
  position: fixed;
  right: 1em;
  bottom: 1.15em;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  font-size: 1.4em;
  line-height: 1;
  color: var(--ch-blue);
  text-decoration: none;
  background: rgba(255, 255, 255, .85);
  border: 3px solid var(--ch-blue);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s ease, transform .4s ease;
  transform: translateY(1rem);
}
.back-to-top.visible { opacity: .8; pointer-events: auto; transform: none; }
.back-to-top:hover { color: var(--ch-green); border-color: var(--ch-green); }

#system-message-container { max-width: var(--ch-maxw); margin: 0 auto; }

/* ---------- JCE MediaBox ---------- */
.jcepopup { cursor: zoom-in; }

/* =========================================================
   RESPONZIVITA
   ========================================================= */
@media (max-width: 1316px) {
  .bg-set-chalupa, .bg_set_chalupa { padding: 5rem 0 3rem !important; }
}

@media (max-width: 980px) {
  .bg-set-chalupa, .bg_set_chalupa { background-size: auto 520px; background-position: center top; }
  .header-nav ul.mod-menu > li > a { padding: 0 .6rem; font-size: 1rem; }
}

/* tablet a mobil – hamburger menu */
@media (max-width: 860px) {
  :root { --ch-header-h: 68px; }
  .header-logo img { width: 120px; padding: .5rem 0; }
  .header-contact { order: 2; margin-left: auto; }
  .header-contact .btn { padding: .6rem .9rem; font-size: .85rem; }

  .menu-toggle {
    order: 3;
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0 9px;
    background: transparent;
    border: 0;
    cursor: pointer;
  }
  .menu-toggle-bar {
    display: block;
    height: 3px;
    background: var(--ch-green);
    border-radius: 2px;
    transition: transform .3s, opacity .3s;
  }
  .menu-open .menu-toggle-bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .menu-open .menu-toggle-bar:nth-child(2) { opacity: 0; }
  .menu-open .menu-toggle-bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

  .header-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin: 0;
    background: var(--ch-green);
    max-height: 0;
    overflow: hidden;
    transition: max-height .35s ease;
    box-shadow: 0 8px 16px rgba(0, 0, 0, .15);
  }
  .menu-open .header-nav { max-height: 70vh; }
  .header-nav ul.mod-menu { flex-direction: column; padding: .5rem 0; }
  .header-nav ul.mod-menu > li > a {
    display: block;
    padding: .25rem 1.5rem;
    line-height: 2.75rem;
    color: var(--ch-white);
    font-weight: bold;
  }
  .header-nav ul.mod-menu > li > a:hover { color: var(--ch-white); background: rgba(0, 0, 0, .1); }
}

@media (max-width: 768px) {
  .sizestab { padding: 0 .75rem; }
  h1 { font-size: 1.9em; }
  h2 { font-size: 1.8em; }
  h3 { font-size: 1.45em; }
  h4 { font-size: 1.25em; }
  .item-page.without-sizestab section { padding: 2rem 0; }
  .item-page.without-sizestab section > div { padding: 0 .75rem; }
  .maincontent .padding { padding: 1rem; }
  .bg-set-chalupa, .bg_set_chalupa { padding: 3rem 0 2rem !important; }
  .bg_set_chalupa img[src*="text_chalupa"] { width: 85%; }

  /* všechny sloupce pod sebe */
  .maincontent tr.flexbox > td.item,
  .maincontent tr.flexbox.cols-2 > td.item,
  .maincontent tr.flexbox.cols-3 > td.item,
  .maincontent tr.flexbox.cols-3 > td.item[colspan="2"] {
    flex: 1 0 100%;
    width: 100%;
    min-width: 0;
  }
  .maincontent tr.flexbox.flex-separated > td.item { margin: .4rem 0; }
  /* obrázek nad textem i u řádku, kde je text vlevo */
  .box-to-nej-pro-vas tr.flexbox > td.item:has(img.img-cover) { order: -1; }
  .box-to-nej-pro-vas { margin: 2rem 0; }
  .img-cover { min-height: 220px; max-height: 320px; }

  #fotogalerie .sizestab > p:last-child { grid-template-columns: repeat(2, 1fr); gap: 6px; }

  .bg_set_mapa { min-height: 0; padding-top: 12rem !important; }
  .adresa { max-width: none; }
}

@media (max-width: 468px) {
  body.site { font-size: 14px; }
  h1 { font-size: 1.7em; }
  h2 { font-size: 1.6em; }
  h3 { font-size: 1.3em; }
  .header-inner { gap: .5rem; }
  .header-logo img { width: 100px; }
  .header-contact .btn { padding: .5rem .6rem; font-size: .78rem; }
  .box-pokoje .pricelist { padding: 1rem; }
  .box-pokoje .pricelist table td { display: table-cell; font-size: .9rem; }
  .btn.btn-big { white-space: normal; }
}

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