/* ─── JDI Blog Page Stylesheet ─── */

:root {
  --blog-card-shadow: 0 10px 30px rgba(25, 52, 80, 0.04);
  --blog-card-hover-shadow: 0 20px 50px rgba(25, 52, 80, 0.1);
  --glass-bg: rgba(255, 255, 255, 0.75);
  --glass-border: rgba(255, 255, 255, 0.4);
}

body {
  background: #ffffff;
  color: var(--jdi-navy);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 2;
}

/* ─── Hero Section ────────────────────────────────────────── */
.blog-hero {
  position: relative;
  padding: 110px 5% 90px;
  background: linear-gradient(135deg, rgba(25, 52, 80, 0.92) 30%, rgba(27, 95, 144, 0.75) 100%), url('../Assets/Cover-2.webp') center/cover no-repeat;
  color: #ffffff;
  text-align: center;
  overflow: hidden;
}

.blog-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.15;
  background-image: radial-gradient(circle at 15% 25%, var(--jdi-cyan) 0%, transparent 55%),
                    radial-gradient(circle at 85% 75%, var(--jdi-gold) 0%, transparent 55%);
  pointer-events: none;
}

.hero-container {
  position: relative;
  z-index: 10;
  max-width: 800px;
  margin: 0 auto;
}

.hero-eyebrow {
  display: inline-block;
  font-family: var(--nav-font);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--jdi-cyan);
  background: rgba(30, 168, 252, 0.12);
  border: 1px solid rgba(30, 168, 252, 0.3);
  border-radius: 40px;
  padding: 6px 20px;
  margin-bottom: 20px;
}

.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 18px;
  letter-spacing: -0.03em;
}

.hero-title span {
  background: linear-gradient(90deg, #ffffff, var(--jdi-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  font-size: clamp(0.95rem, 1.8vw, 1.15rem);
  font-weight: 300;
  line-height: 1.65;
  color: #e2e8f0;
  max-width: 680px;
  margin: 0 auto;
}

/* ─── Blog Articles Container ───────────────────────────────── */
.blog-container {
  max-width: 1200px;
  margin: 70px auto 120px;
  padding: 0 4%;
  position: relative;
  z-index: 20;
  width: 100%;
}

/* Featured Post Card (Apple Style) */
.featured-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  box-shadow: var(--blog-card-shadow);
  display: flex;
  overflow: hidden;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  margin-bottom: 60px;
}

.featured-card:hover {
  transform: translateY(-6px) scale(1.005);
  box-shadow: var(--blog-card-hover-shadow);
  border-color: rgba(30, 168, 252, 0.3);
}

.featured-img-wrapper {
  flex: 1.1;
  min-height: 420px;
  overflow: hidden;
  position: relative;
}

.featured-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%);
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), filter 0.6s ease;
}

.featured-card:hover .featured-img-wrapper img {
  transform: scale(1.04);
  filter: grayscale(0%);
}

.featured-content {
  flex: 0.9;
  padding: 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-left: 1px solid rgba(0, 0, 0, 0.03);
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  font-family: var(--nav-font);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.post-tag {
  color: var(--jdi-cyan);
  background: rgba(30, 168, 252, 0.08);
  border: 1px solid rgba(30, 168, 252, 0.2);
  padding: 4px 14px;
  border-radius: 40px;
}

.post-date {
  color: #64748b;
}

.post-title {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 800;
  color: var(--jdi-navy);
  line-height: 1.2;
  margin-bottom: 24px;
  letter-spacing: -0.02em;
}

.post-excerpt {
  font-size: 1.02rem;
  color: #475569;
  line-height: 1.7;
  margin-bottom: 36px;
}

.btn-read {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--jdi-blue);
  font-family: var(--nav-font);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  transition: gap 0.25s, color 0.25s;
}

.btn-read svg {
  width: 16px;
  height: 16px;
  transition: transform 0.25s;
}

.featured-card:hover .btn-read {
  color: var(--jdi-cyan);
  gap: 12px;
}

.featured-card:hover .btn-read svg {
  transform: translateX(4px);
}

/* Secondary Articles Grid */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 48px;
}

.blog-card {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(25, 52, 80, 0.02);
  display: flex;
  flex-direction: column;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

.blog-card:hover {
  transform: translateY(-5px) scale(1.01);
  box-shadow: var(--blog-card-hover-shadow);
  border-color: rgba(30, 168, 252, 0.3);
}

.blog-card-img {
  height: 220px;
  overflow: hidden;
  position: relative;
}

.blog-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), filter 0.5s ease;
}

.blog-card:hover .blog-card-img img {
  transform: scale(1.05);
  filter: grayscale(0%);
}

.blog-card-body {
  padding: 36px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.blog-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--jdi-navy);
  line-height: 1.35;
  margin-bottom: 12px;
  letter-spacing: -0.015em;
}

.blog-card-excerpt {
  font-size: 0.92rem;
  color: #64748b;
  line-height: 1.6;
  margin-bottom: 20px;
  flex: 1;
}

/* ─── Reader Modal (Apple News Style) ───────────────────────── */
.article-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.article-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(25, 52, 80, 0.45);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.modal-container {
  position: relative;
  z-index: 10;
  background: #ffffff;
  border-radius: 28px;
  max-width: 820px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 30px 70px rgba(25, 52, 80, 0.2);
  border: 1px solid rgba(0, 0, 0, 0.05);
  transform: translateY(30px);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.article-modal.active .modal-container {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(25, 52, 80, 0.65);
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.6rem;
  font-weight: 300;
  z-index: 25;
  transition: background 0.2s, transform 0.2s;
}

.modal-close:hover {
  background: rgba(25, 52, 80, 0.9);
  transform: scale(1.05);
}

.modal-hero {
  width: 100%;
  height: 420px;
  overflow: hidden;
  position: relative;
}

.modal-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%);
  transition: filter 0.8s ease;
}

.article-modal.active .modal-hero img {
  filter: grayscale(0%);
}

.modal-body {
  padding: 60px;
}

.modal-meta-top {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.modal-title {
  font-family: var(--body-font);
  font-size: clamp(1.8rem, 4.5vw, 2.5rem);
  font-weight: 800;
  color: var(--jdi-navy);
  line-height: 1.15;
  margin-bottom: 36px;
  letter-spacing: -0.025em;
}

.modal-text-content {
  font-size: 1.05rem;
  color: #334155;
  line-height: 1.8;
  margin-bottom: 56px;
}

.modal-text-content p {
  margin-bottom: 32px;
}

.modal-text-content blockquote {
  border-left: 4px solid var(--jdi-cyan);
  padding: 8px 0 8px 24px;
  margin: 32px 0;
  font-size: 1.15rem;
  font-style: italic;
  font-weight: 500;
  color: var(--jdi-navy);
  background: rgba(30, 168, 252, 0.04);
  border-radius: 0 12px 12px 0;
}

/* ─── iCloud-Style Premium Photo Gallery ─────────────────────── */
.gallery-section {
  border-top: 1px solid #e2e8f0;
  padding-top: 60px;
  margin-top: 60px;
}

.gallery-section h3 {
  font-family: var(--body-font);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--jdi-navy);
  margin-bottom: 20px;
  letter-spacing: -0.01em;
}

/* Masonry/Grid shared album style (Desktop) */
.icloud-album-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 180px;
  gap: 16px;
  margin-bottom: 16px;
}

.album-item {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  cursor: zoom-in;
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
  background: #f1f5f9;
}

.album-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%);
  transition: transform 0.5s ease, filter 0.5s ease, box-shadow 0.3s ease;
}

.album-item:hover img {
  transform: scale(1.03);
  filter: grayscale(0%);
}

.article-modal.active .icloud-album-grid img {
  filter: grayscale(0%);
}

/* Custom Grid spans to resemble an iCloud Album structure */
.album-item.span-2-col {
  grid-column: span 2;
}

.album-item.span-2-row {
  grid-row: span 2;
}

.album-item.span-all-col {
  grid-column: span 3;
  grid-auto-rows: 240px;
}

/* Slider / Carousel View (Mobile fallback or swipe mode) */
.album-carousel-container {
  display: none; /* Hidden on desktop, layout displays grid */
  position: relative;
  width: 100%;
  border-radius: 20px;
  overflow: hidden;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.album-carousel-slider {
  display: flex;
  width: 100%;
  height: 260px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.album-carousel-slider::-webkit-scrollbar {
  display: none;
}

.album-carousel-slider img {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  object-fit: cover;
  scroll-snap-align: start;
  cursor: zoom-in;
}

.album-carousel-dots {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}

.carousel-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transition: all 0.3s ease;
  cursor: pointer;
}

.carousel-dot.active {
  background: #ffffff;
  transform: scale(1.3);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* ─── Responsive Media Queries ───────────────────────────── */
@media (max-width: 900px) {
  .featured-card {
    flex-direction: column;
  }
  
  .featured-img-wrapper {
    min-height: 280px;
  }
  
  .featured-content {
    padding: 36px;
    border-left: none;
    border-top: 1px solid rgba(0, 0, 0, 0.03);
  }
}

@media (max-width: 768px) {
  .blog-hero {
    padding: 60px 6% 50px;
  }
  
  .blog-container {
    margin-top: -20px;
  }
  
  .modal-body {
    padding: 28px;
  }
  
  .modal-hero {
    height: 280px;
  }

  /* Switch Album Grid to Carousel on small screen */
  .icloud-album-grid {
    display: none;
  }

  .album-carousel-container {
    display: block;
  }
}

/* Exclude grayscale filter for selected elements (e.g. Lugar de Mulher) */
.no-grayscale .featured-img-wrapper img,
.no-grayscale .blog-card-img img,
.article-modal.no-grayscale .modal-hero img,
.article-modal.no-grayscale .album-item img,
.article-modal.no-grayscale .album-carousel-slider img {
  filter: grayscale(0%) !important;
}
