/* ============ LATEST NEWS & ARTICLES ============ */
.news {
  background: #fff;
  padding: 72px 0;
  --angle: 0deg;
}
.news .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}
.news-title {
  font-family: 'Roboto', sans-serif;
  font-weight: 900;
  font-size: 2.2rem;
  text-align: center;
  margin: 0 0 28px 0;
}

/* Cards wrapper */
.news-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  justify-content: center;
  align-items: stretch;
}

/* Card */
.news-card {
  position: relative;
  box-sizing: border-box;
  flex: 1 1 calc(33.333% - 28px);
  max-width: calc(33.333% - 28px);
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.06);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .2s ease;
  cursor: pointer;
  z-index: 0;
}
.news-card:hover { transform: translateY(-4px); }

/* Gradient border (on hover) */
.news-card::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  background: conic-gradient(
    from var(--angle),
    var(--color1),
    var(--color2),
    var(--color3),
    var(--color4),
    var(--color5),
    var(--color1)
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}
.news-card:hover::before {
  opacity: 1;
  animation: spin-colors 3s linear infinite;
}
@keyframes spin-colors { to { --angle: 360deg; } }

/* Thumbnail */
.news-thumb {
  aspect-ratio: 16/9;
  background: #f5f7fa;
  overflow: hidden;
}
.news-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Content */
.news-content {
  padding: 18px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.news-meta {
  display: flex;
  justify-content: space-between;
  font-size: .9rem;
  color: #8a94a6;
}
.news-h3 {
  font-family: 'Roboto', sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  line-height: 1.45;
  color: #0f172a;
  margin: 0;
}
.news-excerpt { margin-top: .5rem; }

/* Read more (link or button) */
.news-more {
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent, #16a34a);
  font-weight: 700;
  text-decoration: underline;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.news-more .arrow { transition: transform .2s ease; }
.news-more:hover .arrow { transform: translateX(4px); }

/* Keyboard focus */
.news-card:focus-visible,
.news-more:focus-visible,
.blog-modal__nav:focus-visible,
.blog-modal__close:focus-visible {
  outline: 2px solid var(--color5);
  outline-offset: 3px;
}

/* 2 per row (tablets) */
@media (max-width: 900px) {
  .news-card {
    flex: 1 1 calc(50% - 28px);
    max-width: calc(50% - 28px);
  }
}

/* 1 per row (mobile) */
@media (max-width: 600px) {
  .news-card {
    flex: 1 1 100%;
    max-width: 100%;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .news-card::before { animation: none !important; }
}

/* ============ BLOG MODAL ============ */
/* Lock background scroll when modal is open */
html.modal-open,
body.modal-open { overflow: hidden; touch-action: none; }

/* Overlay */
.blog-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
  overflow: hidden;                 /* keep scroll inside dialog */
  overscroll-behavior: contain;     /* prevent background scroll chaining */
  background: transparent;
}
.blog-modal.is-open {
  display: grid;
  place-items: center;
  padding: clamp(12px, 4vh, 28px);
}

/* Backdrop */
.blog-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.6);
}

/* Dialog (scrollable if taller than viewport) */
.blog-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(900px, 92vw);
  max-height: calc(100svh - 2 * clamp(12px, 4vh, 28px));
  overflow: auto;                         /* internal scroll */
  -webkit-overflow-scrolling: touch;      /* iOS momentum */
  background: #fff;
  color: #111;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,.3);
}

/* Close button */
.blog-modal__close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: transparent;
  border: 0;
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
  color: #334155;
  border-radius: 8px;
}
.blog-modal__close:hover { background: #f1f5f9; color: #0f172a; }

/* Media area */
.blog-modal__media {
  position: relative;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  height: min(70vh, 70svh);
  min-height: 300px;
}
.blog-modal__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Prev/next controls (hidden unless multi-image) */
.blog-modal__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,.4);
  color: #fff;
  border: 0;
  font-size: 32px;
  width: 44px;
  height: 44px;
  border-radius: 22px;
  cursor: pointer;
  display: none;
}
.blog-modal.has-multi .blog-modal__nav { display: grid; place-items: center; }
.blog-modal__nav--prev { left: 12px; }
.blog-modal__nav--next { right: 12px; }

/* Body */
.blog-modal__content {
  padding: 1.25rem 1.25rem 1.5rem;
  overflow-wrap: anywhere;
}
.blog-modal__content h3 {
  margin: .2rem 0 1rem;
}

/* Buttons (shared safety) */
.btn {
  box-sizing: border-box;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  flex: 0 1 auto;
}
.estimate__actions,
.contact__actions,
.sb-actions,
.service-card-lg__cta,
.process__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
@media (max-width: 600px) {
  .estimate__actions .btn,
  .contact__actions .btn,
  .sb-actions .btn,
  .service-card-lg__cta .btn,
  .process__cta .btn {
    width: 100%;
    justify-content: center;
  }
}
.btn-read {
  width: auto !important;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
