/* =========================================================
   1. UHISED REEGLID
   ========================================================= */

/* Mobiilis on alati 1 veerg */
.esileht-grid-2,
.esileht-grid-3 {
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr; 
  margin-bottom: 32px;
}

@media (min-width: 768px) {
  .esileht-grid-2 { grid-template-columns: repeat(2, 1fr); }
  .esileht-grid-3 { grid-template-columns: repeat(3, 1fr); }
}

/* Veergude sisu vahed */
@media (min-width: 768px) {
  .layout--twocol-section--50-50 .layout__region--first { padding-right: 12px !important; }
  .layout--twocol-section--50-50 .layout__region--second { padding-left: 12px !important; }
}

@media (max-width: 767px) {
  .layout--twocol-section--50-50 .layout__region--second { margin-top: 24px !important; }
}

/* =========================================================
   2. UUDISTE "TEASER" VAADE
   ========================================================= */
.node--view-mode-teaser {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 40px;
  padding-bottom: 30px;
  border-bottom: 1px solid #eeeeee;
}

.node--view-mode-teaser .field--name-field-image { width: 100%; }

@media (min-width: 768px) {
  .node--view-mode-teaser { flex-direction: row; }
  .node--view-mode-teaser .field--name-field-image { flex: 0 0 300px; }
}

/* "Loe edasi" lingi stiil */
.node--view-mode-teaser .node-readmore a {
  display: inline-block;
  margin-top: 12px;
  font-weight: bold;
  text-transform: uppercase;
  color: #d32f2f;
  text-decoration: none;
}
.node--view-mode-teaser .node-readmore a:hover { text-decoration: underline; }

/* Pealkirja stiilid */
.node--view-mode-teaser h2 {
  border-bottom: none !important;
  padding-bottom: 0 !important;
  margin-bottom: 12px !important;
}

.node--view-mode-teaser h2 a {
  text-transform: none !important;
  font-size: 26px !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  color: #222222 !important;
  text-decoration: none !important;
}

.node--view-mode-teaser h2 a:hover { color: #d32f2f !important; text-decoration: none !important; }

/* Pealkirja peitmine Node 9543 */
body.page-node-9543 h1.page-title,
body.page-node-9543 .block-page-title-block { display: none !important; }

/* =========================================================
   3. MOBIILIVAATE TAIENDUSED
   ========================================================= */
@media all and (max-width: 767px) {
  .layout-builder__section,
  .view-esilehe-uudised,
  .region-content {
    padding-left: 16px !important;
    padding-right: 16px !important;
    box-sizing: border-box !important;
  }
}

@media all and (max-width: 991px) {
  .layout,
  .view-esilehe-uudised .row,
  .views-view-grid .views-row {
    display: flex !important;
    flex-direction: column !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .layout > .layout__region,
  .view-esilehe-uudised [class*="col-"],
  .views-view-grid .views-col {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-bottom: 32px !important;
  }

  .layout-builder__section article.node,
  .view-esilehe-uudised article.node { display: block !important; }

  .layout-builder__section article.node .field--type-image,
  .view-esilehe-uudised article.node .field--type-image,
  .layout-builder__section article.node .node__content,
  .view-esilehe-uudised article.node .node__content {
    display: block !important;
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .layout-builder__section article.node .field--type-image,
  .view-esilehe-uudised article.node .field--type-image { margin-bottom: 16px !important; }

  .layout-builder__section article.node img,
  .view-esilehe-uudised article.node img {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    object-fit: cover !important;
  }
}

/* =========================================================
   PLOKKIDE HALDAMINE: ORIGINAAL VS MOBIILNE
   ========================================================= */

/* 1. PEIDA ORIGINAALPLOKID (sidebaris) mobiilis */
@media all and (max-width: 991px) {
  /* Siin kasutasime varem #, nüüd kasutame . kuna tegu on klassiga */
  .block-views-blocktehisintellekt-pildiga-block-1,
  .block-views-blockturvalisus-block-1 {
    display: none !important;
  }
}

/* 2. PEIDA MOBIILI-SEKTSIOONI PLOKID arvutis */
@media all and (min-width: 992px) {
  .block-views-blocktehisintellekt-pildiga-block-3,
  .block-views-blockturvalisus-block-2 {
    display: none !important;
  }
}

/* 3. NÄITA MOBIILI-SEKTSIOONI PLOKKE ainult mobiilis */
@media all and (max-width: 991px) {
  .block-views-blocktehisintellekt-pildiga-block-3,
  .block-views-blockturvalisus-block-2 {
    display: block !important;
    margin-bottom: 30px;
  }
}
/* Topeltjoonte eemaldamine */
.view-taxonomy-term .views-row, 
.view-frontpage .views-row { border-bottom: none !important; }

/* Mobiili-spetsiifilised plokid (klassipĆµhine) */
@media all and (min-width: 992px) {
  .block-views-blocktehisintellekt-pildiga-block-3,
  .block-views-blockturvalisus-block-2 { display: none !important; }
}

@media all and (max-width: 991px) {
  .block-views-blocktehisintellekt-pildiga-block-3,
  .block-views-blockturvalisus-block-2 {
    display: block !important;
    margin-bottom: 30px;
  }
}

/* =========================================================
   4. VIDEODETECTOR PARANDUS
   ========================================================= */
.videodetector:hover .remove-videodetector {
    display: block;
}