:root{
  --bd:#171D28;
  --blue:#0C4DA2;
  --deep:#041D3C;
  --card:#fff;
  --radius:14px;
  --shadow:0 10px 24px rgba(0,0,0,.12);
}

/* ===== GRID ===== */
.naujienos-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:30px;
  margin:40px 0;
}

@media (max-width: 900px){
  .naujienos-grid{
    grid-template-columns:1fr;
    gap:18px;
    margin:18px 0;
  }
}

/* ===== BASE CARD ===== */
.naujienos-item{
  background:var(--card);
  border:1px solid var(--bd);
  border-radius:var(--radius);
  padding:24px;
  transition:transform .25s ease, box-shadow .25s ease;
}

.naujienos-item:hover{
  transform:translateY(-4px);
  box-shadow:var(--shadow);
}

@media (max-width: 900px){
  .naujienos-item{ padding:16px; border-radius:12px; }
}

/* ===== FEATURED = PHOTO2 LAYOUT (image left, text right, button bottom) ===== */
.naujienos-item-featured{
  grid-column: 1 / -1;
  display:grid;
  grid-template-columns: minmax(0,.95fr) minmax(0,1.05fr);
  gap:26px;
  align-items:stretch;
  position:relative;
  overflow:visible; /* allow orbit dots */
}

/* Left image box */
.naujienos-featured-media{
  display:block;
  border-radius:12px;
  overflow:hidden;
  border:1px solid var(--bd);
  background:#0b1530;
  /* controls height so the first block DOES NOT take over the page */
  aspect-ratio: 4 / 3;
}

.naujienos-featured-img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

/* Right content */
.naujienos-featured-body{
  display:flex;
  flex-direction:column;
  gap:14px;
  min-width:0;
}

.naujienos-title{
  font-family:Inter,system-ui,Segoe UI,Roboto,Arial,sans-serif;
  text-transform:uppercase;
  font-weight:300;
  letter-spacing:.04em;
  color:#000;
  line-height:1.2;
  margin:0;
  font-size:1.4rem;
}

.naujienos-item-featured .naujienos-title{
  font-size:1.65rem;
}

.naujienos-excerpt{
  font-family:Archivo,system-ui,Arial,sans-serif;
  color:#000;
  font-weight:300;
  line-height:1.6;
  margin:0;
  font-size:1rem;

  /* no line-clamp -> no weird clipping */
  display:block;
  overflow:visible;
}
/* Push CTA to bottom like your sketch */
.naujienos-item-featured .val-news-cta{
  margin-top:auto;
  align-self:flex-start;
}

/* Mobile: stack (image on top, text below, button full width) */
@media (max-width: 900px){
  .naujienos-item-featured{
    grid-column: auto;
    grid-template-columns:1fr;
    gap:14px;
  }
  .naujienos-featured-media{
    aspect-ratio: 16 / 9;
  }
  .naujienos-item-featured .val-news-cta{
    width:100%;
    align-self:stretch;
  }
  .naujienos-item-featured .naujienos-title{ font-size:1.2rem; }
  .naujienos-excerpt{ -webkit-line-clamp: 5; font-size:.98rem; }
}

/* ===== NORMAL (non-featured) cards ===== */
.naujienos-image{
  display:block;
  width:100%;
  border-radius:12px;
  overflow:hidden;
  border:1px solid var(--bd);
  background:#0b1530;
  aspect-ratio: 16 / 10;
  margin-bottom:16px;
}
.naujienos-image img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.naujienos-content{ display:block; }
.naujienos-item:not(.naujienos-item-featured) .naujienos-title{ font-size:1.1rem; }

/* ===== CTA BUTTON (taken from your form behavior) ===== */
.val-news-cta{
  --wedge: 170px;
  --h: 44px;

  position:relative;
  display:flex;
  align-items:center;
  justify-content:flex-start;

  height:var(--h);
  border-radius:10px;
  overflow:hidden;

  text-decoration:none;
  background: linear-gradient(180deg, var(--blue) 0%, var(--deep) 100%);
  padding-left:34px;
  padding-right: calc(var(--wedge) + 16px);

  border:0;
  cursor:pointer;
}

/* text */
.val-news-cta-text{
  color:#fff;
  font-weight:800;
  letter-spacing:.04em;
  text-transform:uppercase;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-size:14px;
  line-height:1;
  position:relative;
  z-index:2;
}

/* White wedge slides OUT on hover (so blue fills full button) */
.val-news-cta::after{
  content:"";
  position:absolute;
  top:0; right:0;
  width:var(--wedge);
  height:100%;
  background:#fff;
  clip-path: polygon(30% 0,100% 0,100% 100%,0 100%);
  z-index:1;
  transform: translateX(0);
  transition: transform .35s ease;
}

.val-news-cta:hover::after,
.val-news-cta:focus-visible::after{
  transform: translateX(calc(var(--wedge) + 10px));
}

/* right arrow holder */
.val-news-cta-right{
  position:absolute;
  top:0; right:0;
  width:var(--wedge);
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:2;
  transition: transform .35s ease;
}

.val-news-cta-right img{
  width:26px;
  height:26px;
  display:block;
  opacity:.85;
  transition: filter .35s ease, opacity .35s ease, transform .35s ease;
}

/* arrow reacts */
.val-news-cta:hover .val-news-cta-right{ transform: translateX(6px); }
.val-news-cta:hover .val-news-cta-right img{
  opacity:1;
  filter: invert(1);
  transform: translateX(2px);
}

.val-news-cta:focus-visible{
  outline: 3px solid rgba(12,77,162,.35);
  outline-offset: 3px;
}

/* mini version for normal cards */
.val-news-cta--mini{
  --wedge: 120px;
  --h: 40px;
  padding-left:18px;
  border-radius:8px;
}
.val-news-cta--mini .val-news-cta-text{ font-size:12px; }
.val-news-cta--mini .val-news-cta-right img{ width:20px; height:20px; }

/* ===== ORBIT DOTS (featured only) ===== */
.naujienos-item-featured{ position:relative; }

.val-orbit{
  position:absolute;
  inset:0;
  pointer-events:none;
  z-index:9;
}

.val-orbit-dot{
  position:absolute;
  transform: translate(-50%, -50%);
}

.val-orbit-dot--big{
  width:35px;
  height:35px;
  border-radius:50%;
  background:var(--blue);
}

.val-orbit-dot--small{
  width:20px;
  height:20px;
  border-radius:50%;
  background:#cfd5de;
}

@media (max-width: 900px){
  .val-orbit-dot--big{ width:18px; height:18px; }
  .val-orbit-dot--small{ width:12px; height:12px; }
}

/* =========================
   FIX: stop mid-word breaking
   ========================= */
.naujienos-grid .naujienos-excerpt{
  word-break: normal !important;          /* kill break-all */
  overflow-wrap: break-word !important;  /* only break if absolutely needed */
  hyphens: auto;                          /* nicer breaks if browser supports LT */
}

/* =========================================
   FIX #1: Images always cover their box
   (prevents "empty band" under the image)
   ========================================= */
.naujienos-featured-media,
.naujienos-image{
  position:relative;
}

/* Force WP/theme img rules not to fight us */
.naujienos-featured-media img,
.naujienos-image img{
  position:absolute;
  inset:0;
  width:100% !important;
  height:100% !important;
  max-width:none !important;
  object-fit:cover;
  display:block;
}
/* =========================================
   FIX #2: No mid-word breaks
   ========================================= */
.naujienos-title,
.naujienos-excerpt{
  word-break: normal !important;
  overflow-wrap: normal !important; /* don't break inside words */
  hyphens: none !important;         /* prevents weird hyphenation splits */
}

/* Safety: on very tiny screens, allow breaking only if absolutely needed */
@media (max-width: 420px){
  .naujienos-excerpt{
    overflow-wrap: break-word !important;
  }
}
/* =========================================
   FIX #3A: Featured CTA pinned to bottom
   ========================================= */
.naujienos-featured-body{
  height:100%;
  align-self:stretch;
}

.naujienos-item-featured .val-news-cta{
  margin-top:auto; /* keep at bottom */
}
/* =========================================
   FIX #3B: Normal cards CTA pinned to bottom
   ========================================= */
.naujienos-item:not(.naujienos-item-featured){
  display:flex;
  flex-direction:column;
}

/* content area grows, CTA can stick to bottom */
.naujienos-content{
  display:flex;
  flex-direction:column;
  flex:1 1 auto;
}

.naujienos-item:not(.naujienos-item-featured) .val-news-cta{
  margin-top:auto;
  align-self:flex-start;
}

@media (max-width: 900px){
  .naujienos-item:not(.naujienos-item-featured) .val-news-cta{
    width:100%;
    align-self:stretch;
  }
}
/* Make CTA sit closer to the bottom edge */
.naujienos-item{
  padding: 24px 24px 16px; /* was 24px all around */
}

@media (max-width: 900px){
  .naujienos-item{
    padding: 16px 16px 12px; /* was 16px all around */
  }
}
/* =========================================
   ValovIT News Grid – CTA colors (global)
   Default: #0c4da2
   Hover:   #005a87
   ========================================= */

:root{
  --val-news-btn: #0c4da2;
  --val-news-btn-hover: #005a87;
}

/* override gradient -> solid color */
.val-news-cta{
  background: var(--val-news-btn) !important;
  transition: background-color .25s ease, transform .35s ease;
}

/* hover + keyboard focus */
.val-news-cta:hover,
.val-news-cta:focus-visible{
  background: var(--val-news-btn-hover) !important;
}
