/* =========================================================
   Samachar Punjab — photo & video gallery styles
   Used by: home page gallery section, /photogallery,
   /photogallery/details/*, /videogallery
   ========================================================= */
.sp-gal {
    --g-ink: #16181d; --g-ink-2: #3d4250; --g-muted: #6b7180; --g-rule: #e5e2dc;
    --g-soft: #f7f5f1; --g-red: #c4161c; --g-red-dark: #9b1015; --g-radius: 12px;
    --g-head: 'Anek Gurmukhi', 'Noto Sans Gurmukhi', system-ui, sans-serif;
    --g-body: 'Noto Sans Gurmukhi', system-ui, sans-serif;
    color: var(--g-ink); font-family: var(--g-body);
}
.sp-gal *, .sp-gal *::before, .sp-gal *::after { box-sizing: border-box; }
.sp-gal a { color: inherit; text-decoration: none; }
.sp-gal h1, .sp-gal h2, .sp-gal h3, .sp-gal h4 { margin: 0; font-family: var(--g-head); color: var(--g-ink); }
.sp-gal p { color: var(--g-ink-2); }

/* ---------- section head ---------- */
.sp-gal-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap;
    border-bottom: 2px solid var(--g-ink); padding-bottom: 10px; margin-bottom: 22px; }
.sp-gal-head h2, .sp-gal-head h1 { font-size: 27px; font-weight: 700; display: flex; align-items: center; gap: 10px; line-height: 1.3; }
.sp-gal-head h1 { font-size: clamp(28px, 3.4vw, 38px); }
.sp-gal-head h2::before, .sp-gal-head h1::before { content: ""; width: 6px; height: 1em; background: var(--g-red); border-radius: 2px; }
.sp-gal-head p { margin: 6px 0 0; font-size: 16px; color: var(--g-muted); }
.sp-gal-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.sp-gal-tabs a { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px;
    border: 1px solid var(--g-rule); font-size: 15.5px; font-weight: 600; color: var(--g-ink-2); background: #fff; transition: all .15s; }
.sp-gal-tabs a:hover { border-color: var(--g-red); color: var(--g-red); }
.sp-gal-tabs a.is-active { background: var(--g-red); border-color: var(--g-red); color: #fff; }
.sp-gal-tabs svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- photo card ---------- */
.sp-photo-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 24px 20px; }
.sp-photo-grid--page { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px 22px; }
.sp-photo-card { display: flex; flex-direction: column; }
.sp-photo-frame { position: relative; aspect-ratio: 3 / 4; border-radius: var(--g-radius); overflow: hidden; background: var(--g-soft);
    border: 1px solid var(--g-rule); box-shadow: 0 1px 2px rgba(0,0,0,.04); transition: box-shadow .2s, transform .2s; }
.sp-photo-frame img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; transition: transform .5s ease; }
.sp-photo-card:hover .sp-photo-frame { box-shadow: 0 14px 30px rgba(0,0,0,.14); transform: translateY(-3px); }
.sp-photo-card:hover .sp-photo-frame img { transform: scale(1.04); }
.sp-photo-badge { position: absolute; right: 10px; bottom: 10px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%;
    background: rgba(17,18,22,.72); color: #fff; backdrop-filter: blur(4px); transition: background .2s; }
.sp-photo-card:hover .sp-photo-badge { background: var(--g-red); }
.sp-photo-badge svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; }
.sp-photo-card h3 { margin-top: 12px; font-size: 18px; font-weight: 600; line-height: 1.62;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; transition: color .15s; }
.sp-photo-card:hover h3 { color: var(--g-red); }
.sp-photo-meta { margin-top: 4px; font-size: 13.5px; color: var(--g-muted); display: flex; gap: 12px; flex-wrap: wrap; }
.sp-photo-meta span { display: inline-flex; align-items: center; gap: 4px; }
.sp-photo-meta svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }

/* ---------- home section ---------- */
.sp-gal-home { margin-top: 52px; padding: 40px 0 44px; background: var(--g-soft); border-top: 1px solid var(--g-rule); border-bottom: 1px solid var(--g-rule); }
.sp-gal-more { font-size: 16px; font-weight: 600; color: var(--g-red) !important; white-space: nowrap; }
.sp-gal-more:hover { color: var(--g-red-dark) !important; }

/* ---------- page wrapper ---------- */
.sp-gal-page { padding: 28px 0 56px; }
.sp-crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 14px; color: var(--g-muted); margin-bottom: 16px; }
.sp-crumbs a:hover { color: var(--g-red); }
.sp-crumbs span[aria-hidden] { opacity: .6; }
.sp-gal-empty { text-align: center; padding: 64px 20px; border: 2px dashed var(--g-rule); border-radius: var(--g-radius); color: var(--g-muted); font-size: 17px; }
.sp-gal-empty svg { width: 48px; height: 48px; fill: none; stroke: currentColor; stroke-width: 1.5; margin-bottom: 10px; opacity: .6; }

/* pagination (Bootstrap markup) */
.sp-gal .pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 40px 0 0; padding: 0; list-style: none; }
.sp-gal .page-link { display: grid; place-items: center; min-width: 42px; height: 42px; padding: 0 12px; border-radius: 8px !important;
    border: 1px solid var(--g-rule); color: var(--g-ink-2); font-weight: 600; background: #fff; }
.sp-gal .page-link:hover { border-color: var(--g-red); color: var(--g-red); background: #fff; }
.sp-gal .page-item.active .page-link { background: var(--g-red); border-color: var(--g-red); color: #fff; }
.sp-gal .page-item.disabled .page-link { opacity: .45; }
.sp-gal nav .small, .sp-gal nav p.text-muted { display: none; }

/* ---------- photo detail ---------- */
.sp-photo-detail { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; align-items: start; }
.sp-photo-detail h1 { font-size: clamp(26px, 3vw, 36px); font-weight: 700; line-height: 1.4; }
.sp-photo-detail .sp-photo-meta { margin: 10px 0 20px; font-size: 14.5px; }
.sp-photo-full { border-radius: var(--g-radius); overflow: hidden; border: 1px solid var(--g-rule); background: var(--g-soft); }
.sp-photo-full img { width: 100%; height: auto; display: block; }
.sp-photo-desc { margin-top: 20px; font-size: 18px; line-height: 1.8; }
.sp-share { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--g-rule); }
.sp-share strong { font-size: 15px; margin-right: 4px; }
.sp-share a, .sp-share button { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 8px; border: 0;
    font-size: 14.5px; font-weight: 600; color: #fff !important; cursor: pointer; font-family: inherit; }
.sp-share .fb { background: #1877f2; } .sp-share .wa { background: #25d366; } .sp-share .x { background: #111; } .sp-share .cp { background: var(--g-ink-2); }
.sp-share a:hover, .sp-share button:hover { filter: brightness(.92); }
.sp-side h2 { font-size: 21px; font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.sp-side h2::before { content: ""; width: 5px; height: 20px; background: var(--g-red); border-radius: 2px; }
.sp-side-list a { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--g-rule); align-items: start; }
.sp-side-list a:first-child { padding-top: 0; }
.sp-side-list .sp-photo-frame { aspect-ratio: 3 / 4; border-radius: 8px; }
.sp-side-list h3 { font-size: 16.5px; font-weight: 600; line-height: 1.62; margin: 0;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.sp-side-list a:hover h3 { color: var(--g-red); }
.sp-side-list .sp-photo-meta { margin-top: 4px; }

/* ---------- video ---------- */
.sp-video-stage { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 32px; align-items: start; margin-bottom: 44px; }
.sp-player { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: var(--g-radius); overflow: hidden; }
.sp-player iframe, .sp-player video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.sp-video-info h2 { font-size: clamp(22px, 2.4vw, 30px); font-weight: 700; line-height: 1.45; margin-top: 16px; }
.sp-video-info p { font-size: 17px; line-height: 1.75; margin: 10px 0 0; }
.sp-video-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px 22px; }
.sp-video-card { display: block; }
.sp-video-thumb { position: relative; aspect-ratio: 16 / 9; border-radius: var(--g-radius); overflow: hidden; background: linear-gradient(135deg, #22252c, #3a3e48); }
.sp-video-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s; }
.sp-video-card:hover .sp-video-thumb img { transform: scale(1.05); }
.sp-video-play { position: absolute; inset: 0; display: grid; place-items: center; }
.sp-video-play span { width: 56px; height: 56px; border-radius: 50%; background: rgba(196,22,28,.92); display: grid; place-items: center;
    box-shadow: 0 6px 18px rgba(0,0,0,.35); transition: transform .2s; }
.sp-video-card:hover .sp-video-play span { transform: scale(1.1); }
.sp-video-play svg { width: 20px; height: 20px; fill: #fff; margin-left: 3px; }
.sp-video-card.is-current .sp-video-thumb { outline: 3px solid var(--g-red); outline-offset: 3px; }
.sp-video-now { position: absolute; left: 10px; bottom: 10px; padding: 4px 9px; border-radius: 5px; background: var(--g-red); color: #fff; font-size: 12.5px; font-weight: 700; }
.sp-video-card h3 { margin-top: 12px; font-size: 17.5px; font-weight: 600; line-height: 1.62;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sp-video-card:hover h3 { color: var(--g-red); }
.sp-upnext a { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--g-rule); align-items: start; }
.sp-upnext a:first-child { padding-top: 0; }
.sp-upnext .sp-video-thumb { border-radius: 8px; }
.sp-upnext .sp-video-play span { width: 34px; height: 34px; } .sp-upnext .sp-video-play svg { width: 13px; height: 13px; }
.sp-upnext h3 { font-size: 16px; font-weight: 600; line-height: 1.62; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.sp-upnext a:hover h3 { color: var(--g-red); }

/* ---------- responsive ---------- */
@media (max-width: 1199px) {
    .sp-photo-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .sp-photo-grid > :nth-child(n+9) { display: none; }
    .sp-photo-grid--page > :nth-child(n+9) { display: flex; }
    .sp-photo-grid--page, .sp-video-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .sp-video-stage { grid-template-columns: minmax(0, 1fr) 300px; }
}
@media (max-width: 991px) {
    .sp-photo-detail, .sp-video-stage { grid-template-columns: minmax(0, 1fr); }
    .sp-photo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .sp-photo-grid > :nth-child(n+7) { display: none; }
    .sp-photo-grid--page > :nth-child(n+7) { display: flex; }
}
@media (max-width: 767px) {
    .sp-gal-head h2 { font-size: 23px; }
    /* home: swipeable strip */
    .sp-gal-home .sp-photo-grid { display: grid; grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 62%;
        overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; gap: 14px; }
    .sp-gal-home .sp-photo-grid > * { display: flex !important; scroll-snap-align: start; }
    .sp-photo-grid--page, .sp-video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 14px; }
    .sp-photo-card h3, .sp-video-card h3 { font-size: 16px; }
    .sp-upnext a { grid-template-columns: 120px minmax(0, 1fr); }
}
@media (max-width: 420px) {
    .sp-video-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
    .sp-gal * { transition: none !important; }
}
