/* ============================================================
   Services / Portfolio / Gallery pages (Phase 5)
   ============================================================ */

/* ---- Services index ---- */
.svc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.svc-item { padding: 32px 28px; }
.svc-item__icon { width: 62px; height: 62px; border-radius: 16px; background: var(--fst-bg-navy-soft); color: var(--fst-navy); display: grid; place-items: center; font-size: 1.6rem; margin-bottom: 18px; transition: all var(--transition); }
.svc-item:hover .svc-item__icon { background: var(--fst-red); color: #fff; transform: rotate(-6deg); }
.svc-item h3 { font-size: 1.2rem; margin-bottom: 10px; }
.svc-item p { color: var(--fst-slate); font-size: .94rem; margin-bottom: 16px; }
.svc-item .link { font-family: var(--font-display); font-weight: 600; font-size: .88rem; color: var(--fst-red); display: inline-flex; align-items: center; gap: 6px; }
.svc-item .link i { transition: transform var(--transition); }
.svc-item:hover .link i { transform: translateX(4px); }

/* ---- Service detail ---- */
.svc-detail { display: grid; grid-template-columns: 1fr 320px; gap: 40px; align-items: start; }
.svc-detail__main h2 { font-size: 1.5rem; margin: 30px 0 14px; }
.svc-detail__main p { color: var(--fst-slate); line-height: 1.8; margin-bottom: 14px; }
.svc-hero-img { border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 16/9; background: linear-gradient(135deg,var(--fst-navy),var(--fst-navy-900)); margin-bottom: 28px; display: grid; place-items: center; }
.svc-hero-img img { width: 100%; height: 100%; object-fit: cover; }
.svc-hero-img .ph { color: rgba(255,255,255,.25); font-size: 4rem; }
.svc-benefits { list-style: none; }
.svc-benefits li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; color: var(--fst-ink); }
.svc-benefits li i { color: var(--fst-green); margin-top: 4px; font-size: 1.05rem; }

.svc-sidebar__box { background: #fff; border: 1px solid var(--fst-line); border-radius: var(--radius); padding: 22px; margin-bottom: 20px; position: relative; top: 96px; }
.svc-list { list-style: none; }
.svc-list li { margin-bottom: 2px; }
.svc-list a { display: flex; justify-content: space-between; align-items: center; padding: 11px 14px; border-radius: 8px; color: var(--fst-slate); font-weight: 500; font-size: .92rem; transition: all .18s; }
.svc-list a:hover, .svc-list a.active { background: var(--fst-navy); color: #fff; }
.svc-list a i { font-size: .8rem; }

.svc-cta-box { background: linear-gradient(135deg,var(--fst-red),var(--fst-red-700)); color: #fff; border-radius: var(--radius); padding: 26px; text-align: center; }
.svc-cta-box i { font-size: 2.2rem; margin-bottom: 12px; }
.svc-cta-box h3 { color: #fff; margin-bottom: 8px; }
.svc-cta-box p { color: rgba(255,255,255,.9); font-size: .9rem; margin-bottom: 16px; }

/* ---- Filter pills (portfolio + gallery) ---- */
.filter-pills { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-bottom: 36px; }
.filter-pill { padding: 9px 20px; border-radius: 100px; border: 1.5px solid var(--fst-line); background: #fff; color: var(--fst-slate); font-family: var(--font-display); font-weight: 600; font-size: .88rem; transition: all var(--transition); cursor: pointer; }
.filter-pill:hover { border-color: var(--fst-navy); color: var(--fst-navy); }
.filter-pill.active { background: var(--fst-navy); color: #fff; border-color: var(--fst-navy); }

/* ---- Portfolio grid ---- */
.portfolio-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.portfolio-item { position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4/3; display: block; }
.portfolio-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.portfolio-item:hover img { transform: scale(1.08); }
.portfolio-item__ph { width: 100%; height: 100%; background: linear-gradient(135deg,var(--fst-navy),var(--fst-navy-900)); display: grid; place-items: center; color: rgba(255,255,255,.25); font-size: 2.6rem; }
.portfolio-item__info { position: absolute; inset: 0; background: linear-gradient(to top, rgba(2,16,40,.92), rgba(2,16,40,.1) 65%); display: flex; flex-direction: column; justify-content: flex-end; padding: 22px; opacity: 1; }
.portfolio-item__info span { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #ff8077; margin-bottom: 6px; }
.portfolio-item__info h3 { color: #fff; font-size: 1.12rem; margin-bottom: 4px; }
.portfolio-item__info p { color: #c4d0e3; font-size: .84rem; }
.portfolio-item__view { position: absolute; top: 16px; right: 16px; width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.2); backdrop-filter: blur(4px); display: grid; place-items: center; color: #fff; opacity: 0; transform: translateY(-6px); transition: all var(--transition); }
.portfolio-item:hover .portfolio-item__view { opacity: 1; transform: translateY(0); }

/* ---- Project detail ---- */
.proj-detail { display: grid; grid-template-columns: 1.6fr 1fr; gap: 40px; align-items: start; }
.proj-gallery__main { border-radius: var(--radius); overflow: hidden; aspect-ratio: 16/10; background: var(--fst-bg-alt); margin-bottom: 12px; }
.proj-gallery__main img { width: 100%; height: 100%; object-fit: cover; }
.proj-thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
.proj-thumb { width: 88px; height: 64px; border-radius: 8px; overflow: hidden; border: 2px solid var(--fst-line); cursor: pointer; transition: border-color .2s; }
.proj-thumb.active, .proj-thumb:hover { border-color: var(--fst-red); }
.proj-thumb img { width: 100%; height: 100%; object-fit: cover; }
.proj-meta { background: #fff; border: 1px solid var(--fst-line); border-radius: var(--radius); padding: 26px; position: sticky; top: 96px; }
.proj-meta h1 { font-size: 1.5rem; margin-bottom: 16px; }
.proj-meta__row { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--fst-line); font-size: .92rem; }
.proj-meta__row:last-of-type { border-bottom: 0; }
.proj-meta__row i { color: var(--fst-red); width: 20px; text-align: center; margin-top: 2px; }
.proj-meta__row strong { display: block; color: var(--fst-navy); font-family: var(--font-display); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.proj-desc { line-height: 1.85; color: var(--fst-slate); margin-top: 26px; }

/* ---- Gallery (media) ---- */
.gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.gallery-cell { position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 1; cursor: pointer; background: #0a1b3a; }
.gallery-cell img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.gallery-cell:hover img { transform: scale(1.08); }
.gallery-cell__overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(2,16,40,.8), transparent 55%); display: flex; flex-direction: column; justify-content: flex-end; padding: 14px; opacity: 0; transition: opacity var(--transition); }
.gallery-cell:hover .gallery-cell__overlay { opacity: 1; }
.gallery-cell__overlay h4 { color: #fff; font-size: .9rem; }
.gallery-cell__overlay span { color: #c4d0e3; font-size: .76rem; }
.gallery-cell__type { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 50%; background: rgba(2,16,40,.6); color: #fff; display: grid; place-items: center; font-size: .85rem; z-index: 2; }
.gallery-cell__play { position: absolute; inset: 0; display: grid; place-items: center; z-index: 1; }
.gallery-cell__play i { width: 48px; height: 48px; border-radius: 50%; background: var(--fst-red); color: #fff; display: grid; place-items: center; font-size: 1.1rem; box-shadow: 0 6px 16px rgba(201,24,18,.45); }

/* Lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(2,12,28,.94); z-index: 2000; display: none; align-items: center; justify-content: center; padding: 30px; }
.lightbox.open { display: flex; }
.lightbox__inner { position: relative; max-width: 1000px; width: 100%; max-height: 90vh; }
.lightbox__inner img, .lightbox__inner video, .lightbox__inner iframe { width: 100%; max-height: 90vh; border-radius: 10px; display: block; background: #000; }
.lightbox__inner iframe { aspect-ratio: 16/9; height: auto; }
.lightbox__close { position: absolute; top: -44px; right: 0; background: none; border: 0; color: #fff; font-size: 1.8rem; cursor: pointer; }
.lightbox__cap { color: #fff; text-align: center; margin-top: 14px; font-size: .92rem; }
.lightbox__nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,.15); border: 0; color: #fff; width: 48px; height: 48px; border-radius: 50%; cursor: pointer; font-size: 1.2rem; }
.lightbox__nav.prev { left: -64px; }
.lightbox__nav.next { right: -64px; }

@media (max-width: 992px) {
    .svc-grid, .portfolio-grid { grid-template-columns: repeat(2, 1fr); }
    .gallery-grid { grid-template-columns: repeat(3, 1fr); }
    .svc-detail, .proj-detail { grid-template-columns: 1fr; }
    .svc-sidebar__box, .proj-meta { position: static; }
    .lightbox__nav.prev { left: 8px; } .lightbox__nav.next { right: 8px; }
}
@media (max-width: 600px) {
    .svc-grid, .portfolio-grid, .gallery-grid { grid-template-columns: 1fr 1fr; }
    .svc-item { padding: 24px 20px; }
}
@media (max-width: 420px) {
    .gallery-grid { grid-template-columns: 1fr 1fr; }
    .svc-grid, .portfolio-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Blog / Resources (Phase 7)
   ============================================================ */
.blog-layout { display: grid; grid-template-columns: 1fr 320px; gap: 40px; align-items: start; }
.blog-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.post-card { display: flex; flex-direction: column; height: 100%; }
.post-card__media { aspect-ratio: 16/9; overflow: hidden; background: var(--fst-bg-alt); position: relative; }
.post-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.post-card:hover .post-card__media img { transform: scale(1.06); }
.post-card__media .ph { width: 100%; height: 100%; display: grid; place-items: center; background: linear-gradient(135deg,var(--fst-navy),var(--fst-navy-900)); color: rgba(255,255,255,.25); font-size: 2.4rem; }
.post-card__cat { position: absolute; top: 12px; left: 12px; background: var(--fst-red); color: #fff; font-size: .72rem; font-weight: 700; padding: 5px 12px; border-radius: 100px; }
.post-card__body { padding: 22px; display: flex; flex-direction: column; flex: 1; }
.post-card__meta { font-size: .78rem; color: var(--fst-muted); margin-bottom: 8px; display: flex; gap: 14px; }
.post-card__body h3 { font-size: 1.12rem; line-height: 1.35; margin-bottom: 10px; }
.post-card__body h3 a { color: var(--fst-navy); }
.post-card__body h3 a:hover { color: var(--fst-red); }
.post-card__body p { color: var(--fst-slate); font-size: .9rem; margin-bottom: 14px; flex: 1; }
.post-card__more { font-family: var(--font-display); font-weight: 600; font-size: .85rem; color: var(--fst-red); display: inline-flex; align-items: center; gap: 6px; }

.blog-sidebar__box { background: #fff; border: 1px solid var(--fst-line); border-radius: var(--radius); padding: 22px; margin-bottom: 22px; }
.blog-sidebar__box h3 { font-size: 1.05rem; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 2px solid var(--fst-line); }
.blog-search { display: flex; }
.blog-search input { flex: 1; padding: 11px 14px; border: 1.5px solid var(--fst-line); border-right: 0; border-radius: 8px 0 0 8px; font-size: .9rem; }
.blog-search button { background: var(--fst-navy); color: #fff; border: 0; padding: 0 16px; border-radius: 0 8px 8px 0; cursor: pointer; }
.cat-links { list-style: none; }
.cat-links a { display: flex; justify-content: space-between; padding: 9px 0; color: var(--fst-slate); font-size: .92rem; border-bottom: 1px solid var(--fst-line); }
.cat-links a:hover { color: var(--fst-red); padding-left: 6px; transition: all .18s; }
.recent-post { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--fst-line); }
.recent-post:last-child { border-bottom: 0; }
.recent-post img, .recent-post .ph { width: 60px; height: 60px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.recent-post .ph { background: var(--fst-bg-navy-soft); display: grid; place-items: center; color: var(--fst-navy); }
.recent-post a { font-size: .86rem; font-weight: 600; color: var(--fst-navy); line-height: 1.3; }
.recent-post a:hover { color: var(--fst-red); }
.recent-post span { font-size: .74rem; color: var(--fst-muted); }

/* Single post */
.post-hero { aspect-ratio: 21/9; border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 28px; background: var(--fst-bg-alt); }
.post-hero img { width: 100%; height: 100%; object-fit: cover; }
.post-header h1 { font-size: clamp(1.6rem,3.4vw,2.4rem); margin-bottom: 14px; }
.post-header__meta { display: flex; gap: 18px; flex-wrap: wrap; color: var(--fst-muted); font-size: .88rem; margin-bottom: 28px; padding-bottom: 22px; border-bottom: 1px solid var(--fst-line); }
.post-header__meta i { color: var(--fst-red); margin-right: 5px; }
.post-content { line-height: 1.85; color: var(--fst-ink); font-size: 1.02rem; }
.post-content p { margin-bottom: 18px; }
.post-content h2, .post-content h3 { color: var(--fst-navy); margin: 28px 0 12px; }
.post-content ul, .post-content ol { margin: 0 0 18px 22px; }
.post-content li { margin-bottom: 8px; }
.post-content img { border-radius: 10px; margin: 18px 0; }
.post-share { display: flex; gap: 10px; align-items: center; margin-top: 32px; padding-top: 22px; border-top: 1px solid var(--fst-line); }
.post-share a { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: #fff; }

@media (max-width: 992px) {
    .blog-layout { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .blog-grid { grid-template-columns: 1fr; }
}
