/* =========================================================
   Kártevők és kórokozók – page-specifikus override (MINIMÁL)
   Cél: semmi redesign; csak ha valamit muszáj YOO/örökölt CSS miatt.
   A tényleges legacy kinézet a legacy-style2.css-ben legyen.
   ========================================================= */

body.page-template-pests {
  --kk-accent: var(--uk-global-primary-background, #71bb55);
}

/* Védőöv: ha külső CSS elrontja az all-pest listában a betű/label span-t */
body.page-template-pests section.all-pest ul.pests.wrap > li > span {
  position: static;
  left: auto;
}

/* =========================================================
   ALL-PEST – “thumb + caption” a jelenlegi markupra (BY ABC alapnézet)
   Markup: section.all-pest > ul.pests.wrap > li > span + a.pest > span
   ========================================================= */

/* Egy “elem” (betű + 1 kártevő-kör) */
body.page-template-pests section.all-pest ul.pests.wrap > li {
  display: block !important;
  position: relative;
  padding: 0 0 60px 50px; /* hely a betűnek */
  margin: 18px 0 10px;
  clear: both;
}

/* Betű */
body.page-template-pests section.all-pest ul.pests.wrap > li > span {
  position: absolute;
  left: 0;
  top: 0;

  font-size: 20px;
  font-weight: 700;
  color: var(--kk-accent);
  text-transform: uppercase;
  line-height: 1;

  width: auto;
  height: auto;
  margin: 0;
}

/* Thumb kör */
body.page-template-pests section.all-pest ul.pests.wrap > li > a.pest {
  display: block !important;
  width: 80px !important;
  height: 80px !important;

  border-radius: 50% !important;
  overflow: visible !important;

  background-color: #eee !important;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;

  border: 0 !important;
  padding: 0 !important;
  margin: 0 !important;

  color: inherit !important;
  text-decoration: none !important;

  position: relative !important;
}

/* Felirat a kör alatt */
body.page-template-pests section.all-pest ul.pests.wrap > li > a.pest > span {
  position: absolute !important;
  left: -10px !important;
  top: 86px !important;

  width: calc(100% + 20px) !important;
  max-height: 40px !important;
  overflow: hidden !important;

  color: #111 !important;
  font-size: 12px !important;
  line-height: 16px !important;
  font-weight: 500 !important;
  text-transform: uppercase !important;
  text-align: center !important;

  border: 0 !important;
  text-decoration: none !important;
  background: transparent !important;

  white-space: normal !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
  hyphens: auto !important;

  display: -webkit-box !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 2 !important;

  height: auto !important;
  min-height: 32px !important;
}

body.page-template-pests section.all-pest ul.pests.wrap > li > a.pest:hover > span {
  color: var(--kk-accent) !important;
}

/* =========================================================
   BY PLANTS – egy place soron belül több pest thumb egymás mellett
   (ugyanaz a markup, csak más ritmus + inline thumbok)
   ========================================================= */

body.page-template-pests section.all-pest.all-pest--by-plants ul.pests.wrap > li {
  padding: 0 0 20px 110px; /* több hely a hosszabb címkéknek */
  margin: 0 0 20px;
  border-bottom: 1px solid #eee;
  text-align: left !important;
}

/* thumbok inline sorba, margókkal */
body.page-template-pests section.all-pest.all-pest--by-plants ul.pests.wrap > li > a.pest {
  display: inline-block !important;
  vertical-align: top !important;
  margin: 0 20px 60px 0 !important;
}

/* =========================================================
   SINGLE PEST / PEST SHEET – header + data + table
   (grid csak a sheet-contentben; minden más full-width flow)
   ========================================================= */

body.single-pest section.pest-sheet .pest-sheet-content,
body.page-template-pests section.pest-sheet .pest-sheet-content {
  display: grid !important;
  grid-template-columns: 110px 1fr 280px; /* thumb | cím | data */
  column-gap: 24px;
  row-gap: 10px;
  align-items: start;
}

/* Default: minden közvetlen gyerek full width sor (így nem esik szét ami “alatta van”) */
body.single-pest section.pest-sheet .pest-sheet-content > *,
body.page-template-pests section.pest-sheet .pest-sheet-content > * {
  grid-column: 1 / -1;
}

/* Header kivételek */
body.single-pest section.pest-sheet .pest-sheet-content .thumb,
body.page-template-pests section.pest-sheet .pest-sheet-content .thumb {
  grid-column: 1;
  grid-row: 1 / span 2;

  float: none !important;
  margin: 0 !important;

  width: 110px;
  height: 110px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
}

body.single-pest section.pest-sheet .pest-sheet-content h1,
body.page-template-pests section.pest-sheet .pest-sheet-content h1 {
  grid-column: 2;
  grid-row: 1;
  margin: 0 !important;
  line-height: 1.15;
}



/* Header: 1. sor legyen a thumb magassága, így a h1 középre igazítható */
body.single-pest section.pest-sheet .pest-sheet-content,
body.page-template-pests section.pest-sheet .pest-sheet-content {
  grid-template-rows: 110px auto auto auto !important;
}

/* thumb ne spanoljon 2 sort, hanem legyen az első sorban */
body.single-pest section.pest-sheet .pest-sheet-content .thumb,
body.page-template-pests section.pest-sheet .pest-sheet-content .thumb {
  grid-row: 1 !important;
}

/* cím középre a 110px-es sorban */
body.single-pest section.pest-sheet .pest-sheet-content h1,
body.page-template-pests section.pest-sheet .pest-sheet-content h1 {
  grid-row: 1 !important;
  align-self: center !important;
}

/* data maradhat középen (vagy start, ha felül szeretnéd) */
body.single-pest section.pest-sheet .pest-sheet-content .data,
body.page-template-pests section.pest-sheet .pest-sheet-content .data {
  grid-row: 1 !important;
  align-self: center !important; /* ha inkább felül: start */
}




body.single-pest section.pest-sheet .pest-sheet-content .data,
body.page-template-pests section.pest-sheet .pest-sheet-content .data {
  grid-column: 3;
  grid-row: 1 / span 2;

  float: none !important;
  display: block !important;
  text-align: right !important;
  padding: 0 !important;
  margin: 0 !important;
}

body.single-pest section.pest-sheet .pest-sheet-content .data h5,
body.page-template-pests section.pest-sheet .pest-sheet-content .data h5 {
  display: block !important;
  margin: 0 0 6px 0 !important;

  font-size: 14px !important;
  font-weight: 500 !important;
  line-height: 16px !important;
  text-transform: uppercase !important;
  letter-spacing: .02em !important;
}

body.single-pest section.pest-sheet .pest-sheet-content .data b,
body.page-template-pests section.pest-sheet .pest-sheet-content .data b {
  display: block !important;
  font-size: 18px !important;
  line-height: 26px !important;
  margin: 0 !important;
}

body.single-pest section.pest-sheet .pest-sheet-content .data b span,
body.page-template-pests section.pest-sheet .pest-sheet-content .data b span {
  display: none !important;
}

/* “Előfordulás” cím (a táblázat felett) */
body.single-pest section.pest-sheet .pest-sheet-content > h4,
body.page-template-pests section.pest-sheet .pest-sheet-content > h4 {
  grid-row: 3;
  margin: 10px 0 6px 0 !important;
  text-align: left !important;
  text-transform: uppercase !important;
  letter-spacing: .02em !important;
  position: relative !important;
}

/* H4 ikon (ha pseudo-element) */
body.single-pest section.pest-sheet .pest-sheet-content > h4::before,
body.single-pest section.pest-sheet .pest-sheet-content > h4::after,
body.page-template-pests section.pest-sheet .pest-sheet-content > h4::before,
body.page-template-pests section.pest-sheet .pest-sheet-content > h4::after {
  top: 50% !important;
  transform: translateY(-50%) !important;
}

/* Táblázat */
body.single-pest section.pest-sheet .pest-sheet-content table.pest-actions,
body.page-template-pests section.pest-sheet .pest-sheet-content table.pest-actions {
  grid-row: 4;

  border-collapse: collapse !important;
  width: 100% !important;
  table-layout: fixed !important;
  margin: 0 0 20px 0 !important;
}

body.single-pest section.pest-sheet table.pest-actions th,
body.single-pest section.pest-sheet table.pest-actions td,
body.page-template-pests section.pest-sheet table.pest-actions th,
body.page-template-pests section.pest-sheet table.pest-actions td {
  border: 1px solid var(--kk-border, #ccc) !important;
  height: 24px !important;
  line-height: 24px !important;
  padding: 2px !important;
  text-align: center !important;

  font-size: inherit !important;
  font-weight: inherit !important;
}

/* Jan (th:first-child) egyezzen a többivel (desktop) */
body.single-pest section.pest-sheet table.pest-actions__desktop th:first-child,
body.page-template-pests section.pest-sheet table.pest-actions__desktop th:first-child {
  width: auto !important;
  border-left: 1px solid var(--kk-border, #ccc) !important;
  background: transparent !important;
  color: inherit !important;
}

/* Desktop pest-actions: a bal szélső (Jan) ugyanúgy viselkedjen, mint a többi hónap */
body.single-pest section.pest-sheet table.pest-actions__desktop tr th:first-child,
body.page-template-pests section.pest-sheet table.pest-actions__desktop tr th:first-child {
  text-transform: none !important;   /* ez üti a global uppercase-et */
  text-align: center !important;
  padding-right: 2px !important;
  font-size: inherit !important;
  font-weight: inherit !important;
}

/* Kiemelt hónap */
body.single-pest section.pest-sheet table.pest-actions th span,
body.single-pest section.pest-sheet table.pest-actions td span,
body.page-template-pests section.pest-sheet table.pest-actions th span,
body.page-template-pests section.pest-sheet table.pest-actions td span {
  background: var(--kk-green, #71bb55) !important;
  color: #fff !important;
  display: block !important;
  font-weight: 500 !important;
  height: 100% !important;
}

/* =========================================================
   PEST SHEET – Károsított növények (thumb + caption)
   ========================================================= */

body.page-template-pests section.pest-sheet .pest-sheet-content h3,
body.single-pest section.pest-sheet .pest-sheet-content h3 {
  margin: 26px 0 12px !important;
  text-transform: uppercase;
  letter-spacing: .02em;
}

body.page-template-pests section.pest-sheet .pest-sheet-content ul.plants,
body.single-pest section.pest-sheet .pest-sheet-content ul.plants {
  list-style: none;
  padding: 0;
  margin: 0;
  text-align: left;
}

body.page-template-pests section.pest-sheet .pest-sheet-content ul.plants > li,
body.single-pest section.pest-sheet .pest-sheet-content ul.plants > li {
  display: inline-block;
  vertical-align: top;
  margin: 0 20px 60px 0;
  padding: 0;
  position: relative;
  border-bottom: 0 !important;
}

body.page-template-pests section.pest-sheet .pest-sheet-content ul.plants > li > a.plant,
body.single-pest section.pest-sheet .pest-sheet-content ul.plants > li > a.plant {
  display: block !important;
  width: 80px !important;
  height: 80px !important;

  border-radius: 50% !important;
  overflow: visible !important;

  background-color: #eee !important;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;

  border: 0 !important;
  padding: 0 !important;
  margin: 0 !important;

  color: inherit !important;
  text-decoration: none !important;

  position: relative !important;
}

body.page-template-pests section.pest-sheet .pest-sheet-content ul.plants > li > a.plant > span,
body.single-pest section.pest-sheet .pest-sheet-content ul.plants > li > a.plant > span {
  position: absolute !important;
  left: -10px !important;
  top: 86px !important;

  width: calc(100% + 20px) !important;
  max-height: 40px !important;
  overflow: hidden !important;

  color: #111 !important;
  font-size: 12px !important;
  line-height: 16px !important;
  font-weight: 500 !important;
  text-transform: uppercase !important;
  text-align: center !important;

  background: transparent !important;

  display: -webkit-box !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 2 !important;
}

body.page-template-pests section.pest-sheet .pest-sheet-content ul.plants > li > a.plant:hover > span,
body.single-pest section.pest-sheet .pest-sheet-content ul.plants > li > a.plant:hover > span {
  color: var(--kk-accent) !important;
}

/* =========================================================
   UIkit galéria spacing (ha kell)
   ========================================================= */

section.pest-sheet { padding-bottom: 0px !important; }
section.gallery   { padding-top: 0px !important; }