/* =========================================================================
   KAMNA HELIOS – sekce „Realizace“ (https://www.kamnahelios.cz/realizace/)
   1) HERO sekce (nadpis + text + foto koláž) nad výpisem
   2) Kartový vzhled výpisu jednotlivých realizací (.news-item)
   3) Vzhled DETAILU jedné realizace (badge, perex, box s technikou,
      galerie fotek, banner na konci článku) – viz realizace-detail-sablona.html

   KAM VLOŽIT:
   Šablona → Vzhled webu → Nastavení šablony → CSS styly (vlastní CSS)
   (případně přímo do custom.css šablony, pokud ho používáte)

   Sekce 1) a 2) jsou schované pod „body.in-realizace“ (výpis), sekce 3)
   pod „body.in-realizace.type-post“ (detail jedné realizace) – týká se
   to tedy JEN stránek pod /realizace/ a nedotkne se to jiných výpisů
   (např. Novinky), které používají stejné .news-item/.news-wrapper třídy.
   ========================================================================= */

/* -------------------------------------------------------------------------
   1) HERO – dvousloupcové záhlaví nad výpisem
   Vlevo: automatický <h1>Realizace</h1> + text vložený do pole „Popis“
   Vpravo: koláž fotek (viz realizace-hero.html)
   ------------------------------------------------------------------------- */

body.in-realizace .sectionDescription {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  grid-template-areas:
    "heading gallery"
    "text    gallery";
  column-gap: 56px;
  row-gap: 18px;
  align-items: center;
  /* kontejner webu je hodně široký (cca 1740px) – bez vlastního
     max-width by se sloupce roztáhly do velké šířky a mezi textem
     a koláží by zbyla obří mezera. 1200px drží hero opticky stejně
     kompaktní jako v odsouhlaseném náhledu. */
  max-width: 1200px;
  margin: 8px auto 60px;
}

body.in-realizace .sectionDescription > h1 {
  grid-area: heading;
  margin: 0;
  font-size: clamp(30px, 3.6vw, 46px);
  line-height: 1.15;
  font-weight: 700;
  color: #1e1e1c;
}

body.in-realizace .hero-text {
  grid-area: text;
}

body.in-realizace .hero-kicker {
  display: inline-block;
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #c9822c; /* teplá „ohnivá" barva – klidně nahraďte brand barvou e-shopu */
}

body.in-realizace .hero-stats {
  display: flex;
  gap: 28px;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
}
body.in-realizace .hero-stats li {
  font-size: 14px;
  color: #6b6b68;
}
body.in-realizace .hero-stats strong {
  display: block;
  font-size: 24px;
  line-height: 1.3;
  font-weight: 700;
  color: #1e1e1c;
}

body.in-realizace .hero-text p {
  font-size: 16px;
  line-height: 1.65;
  color: #4a4a48;
  margin: 0 0 26px;
  max-width: 46em;
}

body.in-realizace .hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 28px;
  background: #000;
  color: #fff !important;
  font-size: 15px;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none !important;
  transition:
    background 0.2s ease,
    transform 0.2s ease;
}
body.in-realizace .hero-cta:hover {
  background: #222;
  transform: translateY(-2px);
}

/* ---- foto koláž vpravo ----
   max-width drží shluk fotek opticky stejně velký/kompaktní bez
   ohledu na to, jak široký je kontejner webu (ten je u vás cca
   1740px, takže bez omezení by se procentuální rozestupy fotek
   roztáhly do velké šířky a mezi kruhy by zbyly obří mezery). */
body.in-realizace .hero-gallery {
  grid-area: gallery;
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto; /* vycentrovaná v rámci pravého sloupce */
  height: 440px;
}

/* jemná barevná "koule" v pozadí koláže */
body.in-realizace .hero-gallery::before {
  content: "";
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  background: radial-gradient(
    circle at 35% 30%,
    #ffe3b8 0%,
    #ffd39e 35%,
    transparent 70%
  );
  filter: blur(6px);
  opacity: 0.75;
  z-index: 0;
}

body.in-realizace .hero-gallery__item {
  --rot: 0deg;
  position: absolute;
  border-radius: 50%;
  overflow: hidden;
  border: 6px solid #fff;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.16);
  z-index: 1;
  transform: rotate(var(--rot));
  will-change: transform;
  animation: heroFloat 6s ease-in-out infinite;
}
body.in-realizace .hero-gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* natočení fotky je uložené v proměnné --rot, aby se dalo bezpečně
   kombinovat s translateY() uvnitř animace (viz @keyframes heroFloat) –
   samotná animace tedy hýbe jen s "transform" (zpracovává grafická karta,
   bez přepočtu layoutu), díky čemuž je plynulá i při více fotkách najednou */
body.in-realizace .hero-gallery__item--1 {
  width: 150px;
  height: 150px;
  top: 0;
  left: 16%;
  --rot: -6deg;
  animation-delay: 0s;
}
body.in-realizace .hero-gallery__item--2 {
  width: 112px;
  height: 112px;
  top: 4%;
  left: 64%;
  --rot: 8deg;
  animation-delay: 0.6s;
  z-index: 2;
}
body.in-realizace .hero-gallery__item--3 {
  width: 126px;
  height: 126px;
  top: 38%;
  left: 0;
  --rot: 5deg;
  animation-delay: 1.2s;
}
body.in-realizace .hero-gallery__item--4 {
  width: 170px;
  height: 170px;
  top: 38%;
  left: 33%;
  --rot: -3deg;
  animation-delay: 0.3s;
  z-index: 3;
}
body.in-realizace .hero-gallery__item--5 {
  width: 132px;
  height: 132px;
  top: 70%;
  left: 12%;
  --rot: 7deg;
  animation-delay: 0.9s;
}
body.in-realizace .hero-gallery__item--6 {
  width: 108px;
  height: 108px;
  top: 72%;
  left: 62%;
  --rot: -9deg;
  animation-delay: 1.5s;
}

@keyframes heroFloat {
  0%,
  100% {
    transform: rotate(var(--rot)) translateY(0);
  }
  50% {
    transform: rotate(var(--rot)) translateY(-10px);
  }
}

@media (max-width: 991px) {
  body.in-realizace .sectionDescription {
    grid-template-columns: 1fr;
    grid-template-areas:
      "heading"
      "gallery"
      "text";
    row-gap: 28px;
    margin: 0 0 40px;
  }
  body.in-realizace .hero-gallery {
    height: 320px;
    max-width: 420px;
    margin: 0 auto 36px; /* extra mezera mezi koláží a textem pod ní */
  }
}

@media (max-width: 479px) {
  body.in-realizace .hero-gallery {
    height: 260px;
  }
  body.in-realizace .hero-gallery__item--1 {
    width: 100px;
    height: 100px;
  }
  body.in-realizace .hero-gallery__item--2 {
    width: 78px;
    height: 78px;
  }
  body.in-realizace .hero-gallery__item--3 {
    width: 86px;
    height: 86px;
  }
  body.in-realizace .hero-gallery__item--4 {
    width: 120px;
    height: 120px;
  }
  body.in-realizace .hero-gallery__item--5 {
    width: 90px;
    height: 90px;
  }
  body.in-realizace .hero-gallery__item--6 {
    width: 74px;
    height: 74px;
  }
  body.in-realizace .hero-stats {
    gap: 18px;
    flex-wrap: wrap;
  }
}

/* -------------------------------------------------------------------------
   2) KARTY VÝPISU REALIZACÍ
   Mění automaticky generovaný výpis (#newsWrapper .news-item) na
   mřížku 3 karet vedle sebe: obrázek nahoře, text pod ním,
   černé tlačítko "Prohlédnout" dole na kartě.
   ------------------------------------------------------------------------- */

body.in-realizace #newsWrapper.news-wrapper {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 28px !important;
  width: 100% !important;
}

body.in-realizace #newsWrapper .news-item {
  position: relative;
  display: flex !important;
  flex-direction: column !important;
  width: auto !important;
  max-width: none !important;
  min-width: 0 !important;
  float: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 1px solid #ebebe9;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 10px rgba(20, 20, 20, 0.05);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}
body.in-realizace #newsWrapper .news-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 32px rgba(20, 20, 20, 0.12);
}

/* obrázek nahoře, ve stejném poměru stran u všech karet.
   Šablona (screen.min.css) vnucuje .image/.text max-width:50%,
   min-width:50% a .image pevnou height:400/440px (viz media
   dotazy pro 480/768/1200px) – proto tu jede "!important" skoro
   na všem a poměr stran řešíme přes padding-top trik, který je
   na podobné kolize odolnější než aspect-ratio. */
body.in-realizace #newsWrapper .news-item .image {
  order: 0;
  display: block !important;
  position: static !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  height: auto !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  flex: 0 0 auto !important;
  text-align: left !important;
}
body.in-realizace #newsWrapper .news-item .image a {
  display: block;
  position: relative;
  width: 100%;
  height: 0;
  padding-top: 75%; /* poměr stran 4:3 – nezávislé na výšce rodiče */
  overflow: hidden;
  margin: 0 !important;
}
body.in-realizace #newsWrapper .news-item .image img {
  position: absolute !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  object-fit: cover;
  display: block;
  /* šablona má na .image img ještě navěšené
     left:50%; top:50%; transform:translate(-50%,-50%);
     (starší trik na centrování bez object-fit) – bez
     vynulování transformu by to spolu s naším top:0/left:0
     posunulo obrázek o polovinu jeho velikosti mimo slot
     (vidět pak byl jen levý horní kvadrant fotky) */
  transform: none;
  transition: transform 0.5s ease;
}
body.in-realizace #newsWrapper .news-item:hover .image {
  top: 0 !important;
  transform: none !important;
}
body.in-realizace #newsWrapper .news-item:hover .image img {
  transform: scale(1.07);
}

/* textová část */
body.in-realizace #newsWrapper .news-item .text {
  display: flex !important;
  flex-direction: column;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  flex: 1 1 auto !important;
  margin: 0 !important;
  padding: 20px 20px 78px; /* dole místo pro tlačítko */
}

body.in-realizace #newsWrapper .news-item .title {
  order: 1;
  font-size: 18px;
  line-height: 1.32;
  font-weight: 700;
  color: #1e1e1c;
  margin: 0 0 10px;
  text-decoration: none;
}
body.in-realizace #newsWrapper .news-item .title:hover {
  color: #000;
}

body.in-realizace #newsWrapper .news-item .description {
  order: 2;
  font-size: 14px;
  line-height: 1.6;
  color: #5a5a57;
}
/* zkrácení textu na 4 řádky, aby byly karty stejně vysoké */
body.in-realizace #newsWrapper .news-item .description p {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}

/* Černé tlačítko "Prohlédnout" přilepené dole na kartě.
   Je to ::after pseudoelement odkazu .title – veze se tedy
   na stejném odkazu jako název, klikatelné je tak celé,
   aniž by bylo nutné upravovat HTML výpisu. */
body.in-realizace #newsWrapper .news-item .title::after {
  content: "Prohlédnout";
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  background: #000;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  letter-spacing: 0.2px;
  transition: background 0.2s ease;
}
body.in-realizace #newsWrapper .news-item:hover .title::after {
  background: #222;
}

@media (max-width: 991px) {
  body.in-realizace #newsWrapper.news-wrapper {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}
@media (max-width: 599px) {
  body.in-realizace #newsWrapper.news-wrapper {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }
}

/* -------------------------------------------------------------------------
   3) DETAIL JEDNÉ REALIZACE
   Stránka jednotlivé realizace (např. /realizace/austroflamm-sina-xtra-chrast/)
   má v DOMu strukturu: <div class="news-item-detail"> <h1>…</h1>
   <div class="text"> …obsah pole Popis… </div> <div class="next-prev">
   tlačítko Další článek (to je automatické, do Popisu se nedává) </div>
   </div>. Vše níže cílí na třídy, které vkládáte přímo do Popisu podle
   realizace-detail-sablona.html – viz ten soubor pro strukturu.

   Scoped pod „body.in-realizace.type-post“, aby se to netýkalo výpisu
   (ten má „type-posts-listing“, ne „type-post“).
   ------------------------------------------------------------------------- */

/* badge/štítek s lokalitou hned pod nadpisem */
body.in-realizace.type-post .news-item-detail .text .rd-badge {
  display: inline-block;
  margin: 0 0 18px;
  padding: 6px 14px;
  background: #fdf1e0;
  color: #a8621c;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-radius: 999px;
}

/* první odstavec (perex) – trochu výraznější než zbytek textu */
body.in-realizace.type-post .news-item-detail .text .rd-lead {
  font-size: 17px;
  line-height: 1.7;
  color: #333;
}

body.in-realizace.type-post .news-item-detail .text h2 {
  font-size: 21px;
  line-height: 1.3;
  margin: 34px 0 14px;
  padding-top: 20px;
  border-top: 1px solid #ececea;
}
body.in-realizace.type-post .news-item-detail .text .rd-lead + h2,
body.in-realizace.type-post .news-item-detail .text .rd-badge + .rd-lead + h2 {
  border-top: none;
  padding-top: 0;
}

body.in-realizace.type-post .news-item-detail .text a {
  color: #1e1e1c;
  text-decoration: underline;
  text-decoration-color: #d8d4cc;
  text-underline-offset: 2px;
}
body.in-realizace.type-post .news-item-detail .text a:hover {
  color: #000;
  text-decoration-color: #000;
}

/* box s technickými parametry realizace */
body.in-realizace.type-post .news-item-detail .text .rd-specs {
  margin: 32px 0;
  padding: 22px 24px;
  background: #f7f6f4;
  border: 1px solid #ececea;
  border-radius: 14px;
}
body.in-realizace.type-post .news-item-detail .text .rd-specs__title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #1e1e1c;
  margin: 0 0 14px;
}
body.in-realizace.type-post .news-item-detail .text .rd-specs__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 28px;
}
body.in-realizace.type-post .news-item-detail .text .rd-specs__list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed #e1ddd5;
  font-size: 14px;
}
body.in-realizace.type-post
  .news-item-detail
  .text
  .rd-specs__list
  li:last-child,
body.in-realizace.type-post
  .news-item-detail
  .text
  .rd-specs__list
  li:nth-last-child(2) {
  border-bottom: none;
}
body.in-realizace.type-post .news-item-detail .text .rd-specs__list span {
  color: #767671;
  white-space: nowrap;
}
body.in-realizace.type-post .news-item-detail .text .rd-specs__list strong {
  font-weight: 600;
  text-align: right;
}
@media (max-width: 560px) {
  body.in-realizace.type-post .news-item-detail .text .rd-specs__list {
    grid-template-columns: 1fr;
  }
  body.in-realizace.type-post .news-item-detail .text .rd-specs__list li {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
  body.in-realizace.type-post .news-item-detail .text .rd-specs__list strong {
    text-align: left;
  }
}

/* galerie fotek – Shoptet po nahrání obrázků k článku vygeneruje
   .plus-gallery-wrap/.plus-gallery-item automaticky (i s inline
   style="width:200px;height:200px" na každé položce) – proto tu
   musí být "!important", aby přebilo tenhle inline styl. */
body.in-realizace.type-post .plus-gallery-wrap {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 10px !important;
  margin: 28px 0 !important;
}
body.in-realizace.type-post .plus-gallery-item {
  width: auto !important;
  height: auto !important;
  aspect-ratio: 1/1;
  margin: 0 !important;
  border: none !important;
  border-radius: 12px;
  overflow: hidden;
}
body.in-realizace.type-post .plus-gallery-item a {
  display: block;
  width: 100%;
  height: 100%;
}
body.in-realizace.type-post .plus-gallery-item img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
body.in-realizace.type-post .plus-gallery-item:hover img {
  transform: scale(1.06);
}
@media (max-width: 560px) {
  body.in-realizace.type-post .plus-gallery-wrap {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* banner na konci článku – proklik do kategorie/akce,
   URL a text si měníte přímo v HTML (viz šablona) */
body.in-realizace.type-post .news-item-detail .text .rd-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin: 40px 0 10px;
  padding: 26px 28px;
  background: #000;
  border-radius: 14px;
  text-decoration: none !important;
  transition:
    background 0.2s ease,
    transform 0.2s ease;
}
body.in-realizace.type-post .news-item-detail .text .rd-banner:hover {
  background: #222;
  transform: translateY(-2px);
}
body.in-realizace.type-post .news-item-detail .text .rd-banner__text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
body.in-realizace.type-post .news-item-detail .text .rd-banner__kicker {
  color: #e3a765;
  font-size: 12.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
body.in-realizace.type-post .news-item-detail .text .rd-banner__title {
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
}
body.in-realizace.type-post .news-item-detail .text .rd-banner__arrow {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
