/* SA Posts Grid Widget — Sabbir Ahmed */

.sa-grid-wrap {
    display: block;
}

.sa-grid {
    display: grid;
}

/* ── Card ── */
.sa-card {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    cursor: pointer;
    transition: transform 0.35s ease, box-shadow 0.35s ease;
    background: #1a1a2e;
}

.sa-card__link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
    position: relative;
}

/* ── Thumbnail ── */
.sa-card__thumb {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.sa-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    display: block;
}

.sa-card__no-thumb {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
}

/* ── Overlay ── */
.sa-card__overlay {
    pointer-events: none;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    pointer-events: none;
    z-index: 1;
}

/* ── Content ── */
.sa-card__content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    z-index: 2;
  padding-top: 70px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  /* dark overlay */
  background:
    linear-gradient(
      to top,
      rgba(60, 72, 93, 0.88) 0%,
      rgba(60, 72, 93, 0.60) 35%,
      rgba(60, 72, 93, 0.18) 75%,
      rgba(60, 72, 93, 0) 100%
    ) ;

  /* soft fade at top of blur */
  mask-image: linear-gradient(to top, black 65%, transparent 100%);
  -webkit-mask-image: linear-gradient(to top, black 65%, transparent 100%);
}

/* re-enable pointer events on interactive children */
.sa-card__content a,
.sa-card__content button {
    pointer-events: auto;
}

.sa-card--featured .sa-card__content {
    padding: 28px;
}

/* ── Meta ── */
.sa-card__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: rgba(255,255,255,0.60);
    font-size: 12px;
}

.sa-card__category {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 100px;
    background: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.85);
    font-size: 11px;
    font-weight: 500;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.sa-card__date {
    font-size: 12px;
}

/* ── Title ── */
.sa-card__title {
    margin: 0 0 6px;
    padding: 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
}

.sa-card__title a {
    color: #ffffff;
    text-decoration: none;
    transition: opacity 0.2s;
}

.sa-card__title a:hover {
    opacity: 0.85;
}

.sa-card--featured .sa-card__title {
    font-size: 24px;
}

/* ── Excerpt ── */
.sa-card__excerpt {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: rgba(255,255,255,0.80);
}

/* ── Play Button ── */
.sa-card__play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 68px;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: 50%;
    z-index: 10;
    cursor: pointer;
    transition: transform 0.3s ease, filter 0.3s ease;
    text-decoration: none;
}

.sa-card__play:hover {
    transform: translate(-50%, -50%) scale(1.10);
    filter: brightness(1.25);
}

.sa-card__play svg {
    width: 68px;
    height: 68px;
    display: block;
    filter: drop-shadow(0 2px 16px rgba(0,0,0,0.55));
}

/* ────────────────────────────────────────
   RESPONSIVE
   Desktop  : >1024px  — full layout
   Tablet   : 768–1024 — 2 col, no featured span
   Mobile L : 480–767  — 1 col, smaller card
   Mobile S : <480     — 1 col, minimal padding
──────────────────────────────────────── */

/* Tablet */
@media (max-width: 1024px) {
    .sa-card--featured {
        grid-column: span 1 !important;
        min-height: 300px !important;
    }
    .sa-card--featured .sa-card__title {
        font-size: 20px;
    }
    .sa-card--featured .sa-card__content {
        padding: 20px;
    }
}

/* Mobile landscape */
@media (max-width: 767px) {
    .sa-grid {
        grid-template-columns: 1fr !important;
    }
    .sa-card--featured {
        grid-column: span 1 !important;
        min-height: 280px !important;
    }
    .sa-card {
        min-height: 240px !important;
    }
    .sa-card__title {
        font-size: 16px;
    }
    .sa-card--featured .sa-card__title {
        font-size: 18px;
    }
    .sa-card__excerpt {
        font-size: 12px;
    }
    .sa-card__content {
        padding: 16px;
    }
    .sa-card--featured .sa-card__content {
        padding: 16px;
    }
    .sa-card__play {
        width: 36px;
        height: 36px;
        bottom: 14px;
        right: 14px;
    }
}

/* Mobile portrait */
@media (max-width: 480px) {
    .sa-card {
        min-height: 200px !important;
    }
    .sa-card--featured {
        min-height: 240px !important;
    }
    .sa-card__title {
        font-size: 15px;
    }
    .sa-card__excerpt {
        display: none;
    }
    .sa-card__content {
        padding: 12px;
    }
}