/* SavilTech — Blog (#FFD60A) */

.page-blog {
  --bl-gold: #ffd60a;
}

.page-blog .text-gold {
  color: #ffd60a !important;
  text-shadow: 0 0 28px rgba(255, 214, 10, 0.35);
}

.bl-text-justify {
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}

/* Banner: aurora vertical + deslocamento suave (≠ equipa / clientes / portfólio) */
.page-blog .bl-banner--fullwidth {
  position: relative;
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  min-height: clamp(300px, 48vh, 520px) !important;
  display: block !important;
  overflow: hidden;
  background: #000;
}

.page-blog .bl-banner__media {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.page-blog .bl-banner__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  will-change: transform, filter;
  animation:
    blBannerReveal 1.3s cubic-bezier(0.22, 1, 0.36, 1) forwards,
    blBannerAurora 22s ease-in-out 1.3s infinite alternate;
}

@keyframes blBannerReveal {
  0% {
    opacity: 0;
    filter: brightness(0.3) saturate(0.4);
    transform: scale(1.24) translateY(3%);
  }
  100% {
    opacity: 1;
    filter: brightness(1) saturate(1);
    transform: scale(1.1) translateY(0);
  }
}

@keyframes blBannerAurora {
  0% {
    transform: scale(1.1) translateX(-1%);
    object-position: 45% center;
  }
  100% {
    transform: scale(1.05) translateX(1%);
    object-position: 55% center;
  }
}

.page-blog .bl-banner__aurora {
  position: absolute;
  inset: -20%;
  z-index: 1;
  background: linear-gradient(
    105deg,
    transparent 0%,
    rgba(255, 214, 10, 0.06) 25%,
    transparent 40%,
    rgba(255, 214, 10, 0.1) 55%,
    transparent 70%,
    rgba(255, 214, 10, 0.05) 85%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: blAuroraSweep 10s ease-in-out infinite;
  pointer-events: none;
  mix-blend-mode: screen;
}

@keyframes blAuroraSweep {
  0%, 100% { background-position: 0% 50%; opacity: 0.7; }
  50% { background-position: 100% 50%; opacity: 1; }
}

.page-blog .bl-banner__scanline {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0, 0, 0, 0.04) 3px,
    rgba(0, 0, 0, 0.04) 6px
  );
  pointer-events: none;
  opacity: 0.5;
}

.page-blog .bl-banner__overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  background:
    radial-gradient(ellipse 85% 65% at 50% 100%, rgba(0, 0, 0, 0.92), transparent 55%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.45), transparent 42%, rgba(0, 0, 0, 0.65));
}

.page-blog .bl-banner__content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  padding-bottom: clamp(28px, 4vw, 44px);
}

.page-blog .bl-banner .section-tag {
  background: rgba(255, 214, 10, 0.12);
  border: 1px solid rgba(255, 214, 10, 0.35);
  color: #ffd60a;
}

.page-blog .bl-banner__title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 10px;
  background: linear-gradient(135deg, #fff 40%, #ffd60a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.page-blog .bl-banner__desc {
  color: rgba(255, 255, 255, 0.75);
  max-width: 520px;
}

/* Secção blog */
.bl-blog-section {
  padding: clamp(56px, 8vw, 88px) 0 clamp(100px, 11vw, 120px);
  background: #000;
  position: relative;
}

.bl-blog-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 214, 10, 0.35), transparent);
}

.bl-blog-header {
  text-align: center;
  max-width: 760px;
  margin: 0 auto clamp(32px, 4vw, 44px);
}

.bl-blog-header .section-tag {
  background: rgba(255, 214, 10, 0.1);
  border: 1px solid rgba(255, 214, 10, 0.35);
  color: #ffd60a;
}

.bl-blog-header h2 {
  font-size: clamp(1.3rem, 2.8vw, 1.7rem);
  font-weight: 800;
  color: #fff;
  margin: 12px 0 12px;
}

.bl-blog-header p {
  color: rgba(255, 255, 255, 0.68);
  line-height: 1.8;
}

/* Filtros */
.bl-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: clamp(32px, 4vw, 44px);
}

.bl-filter {
  padding: 8px 16px;
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 214, 10, 0.2);
  border-radius: 50px;
  cursor: pointer;
  transition:
    color 0.3s ease,
    background 0.35s ease,
    border-color 0.35s ease,
    transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bl-filter:hover,
.bl-filter.is-active {
  color: #0a0a0a;
  background: linear-gradient(135deg, #ffd60a, #e6b800);
  border-color: #ffd60a;
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(255, 214, 10, 0.25);
}

/* Grelha */
.bl-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.bl-post-card {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  background: rgba(8, 8, 8, 0.98);
  border: 1px solid rgba(255, 214, 10, 0.16);
  display: flex;
  flex-direction: column;
  transition:
    transform 0.55s cubic-bezier(0.34, 1.2, 0.64, 1),
    border-color 0.35s ease,
    box-shadow 0.45s ease;
}

.bl-post-card.is-hidden {
  display: none;
}

.bl-post-card--featured {
  grid-column: span 2;
  grid-row: span 1;
}

.bl-post-card--featured .bl-post-card__media {
  aspect-ratio: 21 / 9;
}

.bl-post-card:hover {
  transform: translateY(-10px);
  border-color: rgba(255, 214, 10, 0.5);
  box-shadow:
    0 28px 56px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(255, 214, 10, 0.1);
}

.bl-post-card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.bl-post-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1), filter 0.45s ease;
}

.bl-post-card:hover .bl-post-card__media img {
  transform: scale(1.12);
  filter: brightness(0.85);
}

.bl-post-card__badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #0a0a0a;
  background: linear-gradient(135deg, #ffd60a, #e6b800);
  border-radius: 50px;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.bl-post-card:hover .bl-post-card__badge {
  transform: scale(1.06);
  box-shadow: 0 6px 18px rgba(255, 214, 10, 0.4);
}

.bl-post-card__overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  transition: opacity 0.45s ease, background 0.45s ease;
}

.bl-post-card:hover .bl-post-card__overlay {
  opacity: 1;
  background: rgba(0, 0, 0, 0.72);
}

.bl-post-card__overlay span {
  padding: 10px 20px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #0a0a0a;
  background: #ffd60a;
  border-radius: 50px;
  transform: translateY(12px);
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bl-post-card:hover .bl-post-card__overlay span {
  transform: translateY(0);
}

.bl-post-card__overlay i {
  font-size: 2rem;
  color: #ffd60a;
  transform: scale(0.8);
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bl-post-card:hover .bl-post-card__overlay i {
  transform: scale(1);
}

.bl-post-card__shine {
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  z-index: 4;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  pointer-events: none;
  transition: left 0.75s ease;
}

.bl-post-card:hover .bl-post-card__shine {
  left: 130%;
}

.bl-post-card__body {
  padding: 22px 20px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.bl-post-card__date {
  font-size: 0.72rem;
  color: rgba(255, 214, 10, 0.75);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.bl-post-card__body h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 10px;
  line-height: 1.3;
  transition: color 0.35s ease;
}

.bl-post-card--featured .bl-post-card__body h3 {
  font-size: clamp(1.15rem, 2vw, 1.35rem);
}

.bl-post-card:hover .bl-post-card__body h3 {
  color: #ffd60a;
}

.bl-post-card__body p {
  font-size: 0.84rem;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.72;
  flex: 1;
  margin-bottom: 16px;
}

.bl-post-card__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #ffd60a;
  text-decoration: none;
  transition: gap 0.35s ease, color 0.3s ease;
}

.bl-post-card__link:hover {
  gap: 12px;
  color: #fff;
}

.bl-post-card__link i {
  transition: transform 0.35s ease;
}

.bl-post-card__link:hover i {
  transform: translateX(4px);
}

.bl-post-card__glow {
  position: absolute;
  inset: -30%;
  background: radial-gradient(circle at var(--bl-x, 50%) var(--bl-y, 30%), rgba(255, 214, 10, 0.1), transparent 45%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.bl-post-card:hover .bl-post-card__glow {
  opacity: 1;
}

.page-blog .bl-banner--fullwidth,
.page-blog .bl-blog-section {
  opacity: 1 !important;
  transform: none !important;
}

@media (max-width: 992px) {
  .bl-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .bl-post-card--featured {
    grid-column: span 2;
  }
}

@media (max-width: 640px) {
  .bl-grid {
    grid-template-columns: 1fr;
  }
  .bl-post-card--featured {
    grid-column: span 1;
  }
  .bl-post-card--featured .bl-post-card__media {
    aspect-ratio: 16 / 10;
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-blog .bl-banner__img,
  .page-blog .bl-banner__aurora {
    animation: none;
  }
  .bl-post-card:hover .bl-post-card__media img {
    transform: none;
  }
  .bl-post-card__overlay {
    opacity: 1;
  }
  .bl-post-card__overlay span {
    transform: none;
  }
}
