/* ═══════════════════════════════════════════════════════════
   GEEK Related Posts — Editorial 2026
   ═══════════════════════════════════════════════════════════ */

/* ── Tokens ─────────────────────────────────────────────── */
:root {
    --grp-accent:      #0b008a;
    --grp-accent-rgb:  11, 0, 138;
    --grp-corner:      5px;
    --grp-ratio:       56.25%;
    --grp-cols:        3;
}

:root,
[data-theme="light"],
.light-theme,
body.light {
    --grp-bg:          #ffffff;
    --grp-surface:     #f4f5f9;
    --grp-border:      #e5e7ec;
    --grp-text:        #0d0e12;
    --grp-text-sec:    #565b6e;
    --grp-text-muted:  #9ba3af;
    --grp-img-bg:      #e8eaef;
    --grp-shim-base:   #e4e6ec;
    --grp-shim-hi:     rgba(255,255,255,.86);
}

[data-theme="dark"],
html[data-theme="dark"],
body[data-theme="dark"],
[data-color-scheme="dark"],
[data-color-mode="dark"],
html.dark,
html.gdt-dark,
.dark-theme,
body.dark,
body.gdt-dark,
.gdt-dark,
.dark-mode,
.darkmode,
.is-dark-theme,
.wp-dark-mode-active {
    --grp-bg:          #272727;
    --grp-surface:     #272727;
    --grp-border:      #323232;
    --grp-text:        #ffffff;
    --grp-text-sec:    #ffffff;
    --grp-text-muted:  #a8a8a8;
    --grp-img-bg:      #202020;
    --grp-shim-base:   #202020;
    --grp-shim-hi:     rgba(255,255,255,.04);
}

/* ── Keyframes ───────────────────────────────────────────── */
@keyframes grp-shimmer {
    from { background-position: -640px 0 }
    to   { background-position:  640px 0 }
}

@keyframes grp-fade-up {
    from { opacity: 0; transform: translateY(10px) }
    to   { opacity: 1; transform: translateY(0) }
}


/* ══════════════════════════════════════════════════════════
   CLASSIC BLOCK — wrapper & heading
   ══════════════════════════════════════════════════════════ */

.grp-block {
    margin: 3em 0 0;
    contain: layout style;
}

.grp-block__head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.grp-block__label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--grp-text);
    white-space: nowrap;
    position: relative;
    padding-left: 10px;
}

.grp-block__label::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--grp-accent);
    border-radius: 2px;
}

.grp-block__line {
    flex: 1;
    height: 1px;
    background: var(--grp-border);
}


/* ── Grid ───────────────────────────────────────────────── */

.grp-block__grid {
    display: grid;
    grid-template-columns: repeat(var(--grp-cols, 3), 1fr);
    gap: 18px;
}

@media (max-width: 900px) {
    .grp-block[data-grp-cols="4"] .grp-block__grid,
    .grp-block[data-grp-cols="3"] .grp-block__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 560px) {
    .grp-block__grid { grid-template-columns: 1fr !important; }
}


/* ── Card ───────────────────────────────────────────────── */

.grp-card {
    display: flex;
    flex-direction: column;
    text-decoration: none !important;
    color: var(--grp-text) !important;
    background: var(--grp-bg);
    border: 1px solid var(--grp-border);
    border-radius: var(--grp-corner);
    overflow: hidden;
    position: relative;
    transition: border-color .22s ease;
    opacity: 0;
    animation: grp-fade-up .38s cubic-bezier(.22,1,.36,1) forwards;
}

.grp-card:nth-child(1) { animation-delay: .04s }
.grp-card:nth-child(2) { animation-delay: .10s }
.grp-card:nth-child(3) { animation-delay: .16s }
.grp-card:nth-child(4) { animation-delay: .22s }
.grp-card:nth-child(5) { animation-delay: .28s }
.grp-card:nth-child(6) { animation-delay: .34s }

.grp-card:hover {
    border-color: rgba(var(--grp-accent-rgb), .3);
}

.grp-card:focus-visible {
    outline: 2px solid var(--grp-accent);
    outline-offset: 2px;
}

/* Accent bar slides in from left on hover */
.grp-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--grp-accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .3s cubic-bezier(.22,1,.36,1);
    z-index: 3;
}
.grp-card:hover::before { transform: scaleX(1); }

/* Hide decorative elements from old design */
.grp-card::after,
.grp-card__corner,
.grp-card__arrow { display: none }


/* ── Card image ─────────────────────────────────────────── */

.grp-card__thumb {
    width: 100%;
    padding-top: var(--grp-ratio);
    position: relative;
    overflow: hidden;
    background: var(--grp-img-bg);
    flex-shrink: 0;
}

/* Shimmer while loading */
.grp-card__thumb::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        var(--grp-shim-base) 0%,
        var(--grp-shim-hi)   42%,
        var(--grp-shim-base) 84%
    );
    background-size: 640px 100%;
    animation: grp-shimmer 1.5s ease-in-out infinite;
    z-index: 1;
    transition: opacity .3s ease;
}
.grp-card__thumb.grp-thumb-loaded::before {
    opacity: 0;
    pointer-events: none;
}

.grp-card__img {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: transform .45s cubic-bezier(.22,1,.36,1), opacity .28s ease;
    z-index: 2;
}
.grp-card__img.grp-img-loaded { opacity: 1; }
.grp-card:hover .grp-card__img { transform: scale(1.05); }

.grp-card__img-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--grp-surface);
    z-index: 2;
}
.grp-card__img-placeholder svg {
    width: 26px; height: 26px;
    color: var(--grp-accent);
    opacity: .14;
}


/* ── Card body ──────────────────────────────────────────── */

.grp-card__body {
    padding: 14px 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.grp-card__tag {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--grp-accent);
    line-height: 1;
    opacity: .85;
}

.grp-card__title {
    margin: 0;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.38;
    color: var(--grp-text);
    letter-spacing: -.01em;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color .18s ease;
}
.grp-card:hover .grp-card__title { color: var(--grp-accent); }

.grp-card__excerpt {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: var(--grp-text-sec);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.grp-card__meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    padding-top: 8px;
}

.grp-card__date {
    font-size: 11px;
    font-weight: 600;
    color: var(--grp-text-muted);
    white-space: nowrap;
}


/* ── Skeleton ───────────────────────────────────────────── */

.grp-card--skel {
    pointer-events: none;
    animation: none;
    opacity: 1;
}
.grp-card--skel::before,
.grp-card--skel::after { display: none !important }

.grp-skel-line {
    height: 10px;
    border-radius: 3px;
    background: var(--grp-shim-base);
    overflow: hidden;
    position: relative;
}
.grp-skel-line::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent  0%,
        var(--grp-shim-hi) 42%,
        transparent  84%
    );
    background-size: 560px 100%;
    animation: grp-shimmer 1.5s ease-in-out infinite;
}
.grp-skel-line:nth-child(2)::before { animation-delay: .08s }
.grp-skel-line:nth-child(3)::before { animation-delay: .16s }
.grp-skel-line:nth-child(4)::before { animation-delay: .24s }

.grp-skel-line--tag   { width: 52px;  height: 8px  }
.grp-skel-line--h1    { width: 90%;  height: 14px }
.grp-skel-line--h2    { width: 65%;  height: 14px }
.grp-skel-line--body  { width: 100% }
.grp-skel-line--body2 { width: 72%  }
.grp-skel-line--meta  { width: 40%;  height: 8px; margin-top: 4px }


/* ══════════════════════════════════════════════════════════
   SCROLL ROW
   ══════════════════════════════════════════════════════════ */

.grp-scroll-section {
    margin-top: 2.4em;
    position: relative;
}

.grp-scroll-section__head {
    margin-bottom: 14px;
}

.grp-scroll-track {
    display: -webkit-box !important;
    display: -ms-flexbox !important;
    display: flex !important;
    -webkit-box-orient: horizontal !important;
    -ms-flex-direction: row !important;
    flex-direction: row !important;
    -ms-flex-wrap: nowrap !important;
    flex-wrap: nowrap !important;
    align-items: stretch;
    gap: 12px;
    padding: 2px 2px 6px;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    touch-action: pan-x pan-y;
}
.grp-scroll-track::-webkit-scrollbar,
.grp-scroll-track::-webkit-scrollbar-track,
.grp-scroll-track::-webkit-scrollbar-thumb { display: none; height: 0 }

.grp-scroll-card {
    display: flex !important;
    flex-direction: column !important;
    flex: 0 0 190px !important;
    min-width: 190px !important;
    max-width: 190px !important;
    width: 190px !important;
    flex-shrink: 0 !important;
    scroll-snap-align: start;
    text-decoration: none !important;
    color: var(--grp-text) !important;
    background: var(--grp-bg);
    border: 1px solid var(--grp-border);
    border-radius: var(--grp-corner);
    overflow: hidden;
    position: relative;
    transition: border-color .2s ease;
    opacity: 0;
    animation: grp-fade-up .34s cubic-bezier(.22,1,.36,1) forwards;
}

.grp-scroll-card:nth-child(1)  { animation-delay: .06s }
.grp-scroll-card:nth-child(2)  { animation-delay: .11s }
.grp-scroll-card:nth-child(3)  { animation-delay: .16s }
.grp-scroll-card:nth-child(4)  { animation-delay: .21s }
.grp-scroll-card:nth-child(5)  { animation-delay: .26s }
.grp-scroll-card:nth-child(6)  { animation-delay: .31s }
.grp-scroll-card:nth-child(7)  { animation-delay: .36s }
.grp-scroll-card:nth-child(8)  { animation-delay: .41s }
.grp-scroll-card:nth-child(9)  { animation-delay: .46s }
.grp-scroll-card:nth-child(10) { animation-delay: .51s }

.grp-scroll-card:hover {
    border-color: rgba(var(--grp-accent-rgb), .26);
}

.grp-scroll-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--grp-accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .26s cubic-bezier(.22,1,.36,1);
    z-index: 3;
}
.grp-scroll-card:hover::before { transform: scaleX(1); }

/* Scroll card image */
.grp-scroll-card__thumb {
    width: 100%;
    height: 115px;
    overflow: hidden;
    background: var(--grp-img-bg);
    position: relative;
    flex-shrink: 0;
}

.grp-scroll-card__thumb::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        var(--grp-shim-base) 0%,
        var(--grp-shim-hi)   42%,
        var(--grp-shim-base) 84%
    );
    background-size: 500px 100%;
    animation: grp-shimmer 1.5s ease-in-out infinite;
    z-index: 1;
    transition: opacity .28s ease;
}
.grp-scroll-card__thumb.grp-thumb-loaded::before { opacity: 0; pointer-events: none }

.grp-scroll-card__img {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: transform .4s cubic-bezier(.22,1,.36,1), opacity .26s ease;
    z-index: 2;
}
.grp-scroll-card__img.grp-img-loaded { opacity: 1 }
.grp-scroll-card:hover .grp-scroll-card__img { transform: scale(1.06) }

.grp-scroll-card__no-img {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--grp-surface);
    z-index: 2;
}
.grp-scroll-card__no-img svg {
    width: 20px; height: 20px;
    color: var(--grp-accent);
    opacity: .14;
}

/* Scroll card body */
.grp-scroll-card__body {
    padding: 9px 11px 12px;
}

.grp-scroll-card__title {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.38;
    color: var(--grp-text);
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color .18s ease;
}
.grp-scroll-card:hover .grp-scroll-card__title { color: var(--grp-accent) }

/* Fade mask */
.grp-scroll-fade {
    position: absolute;
    top: 2px; bottom: 6px;
    width: 40px;
    pointer-events: none;
    z-index: 5;
}
.grp-scroll-fade--right {
    right: 0;
    background: linear-gradient(90deg, transparent, var(--grp-bg) 88%);
}

/* Scroll skeleton */
.grp-scroll-skel {
    flex: 0 0 190px;
    min-width: 190px;
    scroll-snap-align: start;
    border-radius: var(--grp-corner);
    overflow: hidden;
    background: var(--grp-bg);
    border: 1px solid var(--grp-border);
}

.grp-scroll-skel__img {
    width: 100%;
    height: 115px;
    background: var(--grp-shim-base);
    position: relative;
    overflow: hidden;
}
.grp-scroll-skel__img::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent 0%, var(--grp-shim-hi) 42%, transparent 84%);
    background-size: 500px 100%;
    animation: grp-shimmer 1.5s ease-in-out infinite;
}

.grp-scroll-skel__body { padding: 9px 11px; display: flex; flex-direction: column; gap: 6px }
.grp-scroll-skel__line {
    height: 9px;
    border-radius: 3px;
    background: var(--grp-shim-base);
    overflow: hidden;
    position: relative;
}
.grp-scroll-skel__line::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent 0%, var(--grp-shim-hi) 42%, transparent 84%);
    background-size: 400px 100%;
    animation: grp-shimmer 1.5s ease-in-out infinite;
}
.grp-scroll-skel__line--w90 { width: 90% }
.grp-scroll-skel__line--w65 { width: 65% }
.grp-scroll-skel__line--w75 { width: 75% }

/* Scroll responsive */
@media (max-width: 580px) {
    .grp-scroll-section { overflow: visible !important }
    .grp-scroll-card,
    .grp-scroll-card[class] {
        -webkit-flex: 0 0 155px !important;
        flex: 0 0 155px !important;
        min-width: 155px !important;
        max-width: 155px !important;
        width: 155px !important;
    }
    .grp-scroll-card__thumb { height: 90px !important }
    .grp-scroll-skel {
        flex: 0 0 155px !important;
        min-width: 155px !important;
    }
    .grp-scroll-skel__img { height: 90px !important }
}


/* ══════════════════════════════════════════════════════════
   MAGAZINE MODE
   ══════════════════════════════════════════════════════════ */

.grp-mag {
    margin: 2.4em 0 0;
    contain: layout style;
    color: var(--grp-text);
}

.grp-mag,
.grp-mag * { box-sizing: border-box }

.grp-mag a {
    color: inherit;
    text-decoration: none !important;
}

.grp-mag__section {
    margin-top: 38px;
}
.grp-mag__section:first-child { margin-top: 0 }


/* ── Section heading ──────────────────────────────────────── */

.grp-mag__head {
    display: grid;
    grid-template-columns: 3px auto minmax(24px, 1fr);
    align-items: center;
    column-gap: 14px;
    margin-bottom: 20px;
}

.grp-mag__head::before {
    content: '';
    grid-column: 1;
    grid-row: 1;
    width: 3px;
    height: 22px;
    background: var(--grp-accent);
    border-radius: 2px;
}

.grp-mag__head::after {
    content: '';
    grid-column: 3;
    grid-row: 1;
    height: 1px;
    background: var(--grp-border);
    min-width: 24px;
}

.grp-mag__head > div {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
}

/* Unused head elements */
.grp-mag__head p,
.grp-mag__head-icon,
.grp-mag__spark,
.grp-mag__head-mark { display: none !important }

.grp-mag__head h2 {
    margin: 0;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--grp-text);
    line-height: 1.2;
    white-space: nowrap;
}

/* Tag pill */
.grp-mag__pill,
.grp-mag__pill--small,
.grp-mag-news__tag {
    display: inline-flex;
    align-items: center;
    color: var(--grp-accent);
    background: rgba(var(--grp-accent-rgb), .09);
    border: 1px solid rgba(var(--grp-accent-rgb), .16);
    border-radius: calc(var(--grp-corner) + 4px);
    padding: 3px 8px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    line-height: 1.5;
}
.grp-mag__pill--small,
.grp-mag-news__tag { font-size: 9.5px; padding: 2px 7px }

/* Shared card transitions */
.grp-mag-feature,
.grp-mag-side,
.grp-mag-useful,
.grp-mag-news-card,
.grp-mag-topic {
    border: 1px solid var(--grp-border);
    border-radius: var(--grp-corner);
    background: var(--grp-bg);
    transition: border-color .2s ease;
}

.grp-mag-feature:focus-visible,
.grp-mag-side:focus-visible,
.grp-mag-useful:focus-visible,
.grp-mag-news-card:focus-visible,
.grp-mag-topic:focus-visible {
    outline: 2px solid var(--grp-accent);
    outline-offset: 2px;
}

/* ── Main grid ──────────────────────────────────────────── */

.grp-mag-main__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.18fr) minmax(260px, .82fr);
    gap: 16px;
    align-items: stretch;
}


/* ── Feature card ───────────────────────────────────────── */

.grp-mag-feature {
    min-height: 420px;
    display: flex;
    overflow: hidden;
    position: relative;
    isolation: isolate;
    border: 0 !important;
    background: #0d0f18 !important;
    border-radius: var(--grp-corner);
}

.grp-mag-feature__media,
.grp-mag-feature__img,
.grp-mag-feature__shade {
    position: absolute;
    inset: 0;
}

.grp-mag-feature__img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .55s cubic-bezier(.22,1,.36,1);
}
.grp-mag-feature:hover .grp-mag-feature__img { transform: scale(1.04) }

.grp-mag-feature__shade {
    z-index: 1;
    background:
        linear-gradient(0deg,
            rgba(5,6,14,.95)  0%,
            rgba(5,6,14,.52)  45%,
            rgba(5,6,14,.10) 100%),
        linear-gradient(90deg,
            rgba(var(--grp-accent-rgb), .20) 0%,
            transparent 50%);
}

.grp-mag-feature__body {
    position: relative;
    z-index: 2;
    margin-top: auto;
    padding: 28px 30px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    color: #fff;
}

.grp-mag-feature .grp-mag__pill {
    color: #fff;
    background: rgba(var(--grp-accent-rgb), .82);
    border-color: rgba(var(--grp-accent-rgb), .5);
}

.grp-mag-feature__title {
    margin: 0;
    font-size: clamp(18px, 1.85vw, 24px);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -.02em;
    color: #fff;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color .18s ease;
}
.grp-mag-feature:hover .grp-mag-feature__title { color: rgba(255,255,255,.86) }

.grp-mag-feature__excerpt {
    margin: 0;
    font-size: 14px;
    line-height: 1.54;
    color: rgba(255,255,255,.78);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 460px;
}

.grp-mag-feature__foot {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 2px;
}

.grp-mag-feature__date {
    font-size: 11.5px;
    font-weight: 600;
    color: rgba(255,255,255,.56);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.grp-mag-feature__cta { display: none }

/* Placeholder when no image */
.grp-mag-feature__img.grp-mag__placeholder {
    background: linear-gradient(135deg, #161926, #0d0f18);
    display: flex;
    align-items: center;
    justify-content: center;
}
.grp-mag-feature__img.grp-mag__placeholder svg {
    width: 44px; height: 44px;
    color: var(--grp-accent);
    opacity: .22;
}


/* ── Side column ────────────────────────────────────────── */

.grp-mag-main__side {
    display: grid;
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.grp-mag-side {
    min-height: 200px;
    display: flex;
    overflow: hidden;
    position: relative;
    isolation: isolate;
    border: 0 !important;
    background: #0d0f18 !important;
    border-radius: var(--grp-corner);
}

.grp-mag-side__media,
.grp-mag-side__img {
    position: absolute;
    inset: 0;
}

.grp-mag-side__img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .48s cubic-bezier(.22,1,.36,1);
}
.grp-mag-side:hover .grp-mag-side__img { transform: scale(1.05) }

/* Dark gradient overlay via ::after */
.grp-mag-side::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(0deg,
            rgba(5,6,14,.90)  0%,
            rgba(5,6,14,.40)  52%,
            rgba(5,6,14,.06) 100%);
}

.grp-mag-side__body {
    position: relative;
    z-index: 2;
    width: 100%;
    margin-top: auto;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
    color: #fff;
}

.grp-mag-side .grp-mag__pill--small {
    color: #fff;
    background: rgba(255,255,255,.12);
    border-color: rgba(255,255,255,.20);
}

.grp-mag-side__title {
    margin: 0;
    font-size: 14.5px;
    font-weight: 800;
    line-height: 1.34;
    color: #fff;
    letter-spacing: -.01em;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color .18s ease;
}
.grp-mag-side:hover .grp-mag-side__title { color: rgba(255,255,255,.86) }

.grp-mag-side__date {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255,255,255,.50);
}

.grp-mag-side__img.grp-mag__placeholder {
    background: linear-gradient(135deg, #161926, #0d0f18);
    display: flex;
    align-items: center;
    justify-content: center;
}
.grp-mag-side__img.grp-mag__placeholder svg {
    width: 34px; height: 34px;
    color: rgba(255,255,255,.14);
    opacity: 1;
}


/* ── Useful / Interesting grid ──────────────────────────── */

.grp-mag-useful-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.grp-mag-useful {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: var(--grp-corner);
}

.grp-mag-useful:hover {
    border-color: rgba(var(--grp-accent-rgb), .26);
}

.grp-mag-useful__icon { display: none }

.grp-mag-useful__media {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--grp-img-bg);
    flex-shrink: 0;
}

.grp-mag-useful__img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .44s cubic-bezier(.22,1,.36,1);
}
.grp-mag-useful:hover .grp-mag-useful__img { transform: scale(1.04) }

.grp-mag__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--grp-surface);
}
.grp-mag__placeholder svg {
    width: 36px; height: 36px;
    color: var(--grp-accent);
    opacity: .16;
}

.grp-mag-useful__body {
    padding: 14px 16px 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 6px;
}

.grp-mag-useful__tag {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--grp-accent);
    line-height: 1;
}

.grp-mag-useful__title {
    margin: 0;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.38;
    color: var(--grp-text);
    letter-spacing: -.01em;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color .18s ease;
}
.grp-mag-useful:hover .grp-mag-useful__title { color: var(--grp-accent) }

.grp-mag-useful__excerpt {
    margin: 0;
    font-size: 13px;
    line-height: 1.58;
    color: var(--grp-text-sec);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Arrow hidden */
.grp-mag__arrow { display: none }


/* ── News / Kits horizontal scroll ─────────────────────── */

.grp-mag-news-wrap { position: relative }

.grp-mag-news-track {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    padding: 3px 2px 8px;
}
.grp-mag-news-track::-webkit-scrollbar { display: none }

.grp-mag-news-card {
    flex: 0 0 236px;
    min-width: 236px;
    overflow: hidden;
    scroll-snap-align: start;
    border-radius: var(--grp-corner);
}

.grp-mag-news-card--kit  { border-top: 2px solid #52aa6b }
.grp-mag-news-card--news { border-top: 2px solid rgba(37,99,235,.80) }

.grp-mag-news-card__media {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--grp-img-bg);
    position: relative;
}

.grp-mag-news__img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .38s cubic-bezier(.22,1,.36,1);
}
.grp-mag-news-card:hover .grp-mag-news__img { transform: scale(1.05) }

.grp-mag-news-card__body {
    padding: 12px 14px 15px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-height: 104px;
}

/* Tag line hidden — color accent on top border is enough */
.grp-mag-news__tag { display: none }

.grp-mag-news__title {
    margin: 0;
    font-size: 13.5px;
    font-weight: 800;
    line-height: 1.36;
    color: var(--grp-text);
    letter-spacing: -.01em;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color .18s ease;
}
.grp-mag-news-card:hover .grp-mag-news__title { color: var(--grp-accent) }

.grp-mag-news-card__foot { margin-top: auto }

.grp-mag-news__date {
    font-size: 11px;
    font-weight: 600;
    color: var(--grp-text-muted);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.grp-mag-news-list {
    display: grid;
    background: var(--grp-bg);
    border: 1px solid var(--grp-border);
    border-radius: var(--grp-corner);
    overflow: hidden;
}

.grp-mag-news-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    min-height: 56px;
    padding: 11px 14px;
    background: var(--grp-bg);
    border-top: 1px solid var(--grp-border);
}
.grp-mag-news-row:first-child { border-top: 0 }

.grp-mag-news-row__title {
    color: var(--grp-text);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color .18s ease;
}
.grp-mag-news-row:hover .grp-mag-news-row__title { color: var(--grp-accent) }

.grp-mag-news-row__date {
    color: var(--grp-text-muted);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.grp-mag-news-row__arrow {
    color: var(--grp-text);
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    transition: color .18s ease;
}

.grp-mag-news-row--more:hover .grp-mag-news-row__arrow {
    color: var(--grp-accent);
}

/* Nav prev/next buttons */
.grp-mag-news__nav {
    position: absolute;
    top: 50%;
    z-index: 4;
    width: 36px; height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--grp-bg);
    border: 1px solid var(--grp-border);
    border-radius: 50%;
    color: var(--grp-text);
    cursor: pointer;
    transform: translateY(-50%);
    transition: opacity .18s ease, color .18s ease, transform .18s ease;
}
.grp-mag-news__nav--prev { left: -10px }
.grp-mag-news__nav--next { right: -10px }
.grp-mag-news__nav:hover {
    color: var(--grp-accent);
    transform: translateY(-50%) scale(1.06);
}
.grp-mag-news__nav[aria-disabled="true"] { opacity: 0; pointer-events: none }
.grp-mag-news__nav svg { width: 15px; height: 15px }

/* Elements unused / hidden in this design */
.grp-mag-news-card__badge,
.grp-mag-news-card__media::after,
.grp-mag-news__go,
.grp-mag-topic__go,
.grp-mag-icon,
.grp-mag__pill-icon,
.grp-mag__meta-icon,
.grp-mag-icon svg { display: none !important }


/* ── Topic cards (if ever used) ─────────────────────────── */

.grp-mag-topics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.grp-mag-topic {
    min-height: 88px;
    padding: 12px;
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    overflow: hidden;
    border-radius: var(--grp-corner);
}
.grp-mag-topic:hover { border-color: rgba(var(--grp-accent-rgb), .24) }

.grp-mag-topic__media {
    width: 46px; height: 46px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--grp-img-bg);
}
.grp-mag-topic__img { width: 100%; height: 100%; object-fit: cover; display: block }
.grp-mag-topic__body { min-width: 0; display: flex; flex-direction: column; gap: 5px }
.grp-mag-topic__name {
    font-size: 13px;
    font-weight: 800;
    color: var(--grp-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color .18s ease;
}
.grp-mag-topic:hover .grp-mag-topic__name { color: var(--grp-accent) }
.grp-mag-topic__count {
    font-size: 11px;
    color: var(--grp-text-muted);
}

:is(
    .gdt-dark,
    [data-theme="dark"],
    [data-color-scheme="dark"],
    [data-color-mode="dark"],
    html.dark,
    html.gdt-dark,
    .dark-theme,
    body.dark,
    body.gdt-dark,
    .dark-mode,
    .darkmode,
    .is-dark-theme,
    .wp-dark-mode-active
) :is(
    .grp-mag-feature,
    .grp-mag-side,
    .grp-mag-useful,
    .grp-mag-news-list,
    .grp-mag-news-card,
    .grp-mag-topic
) {
    background: #272727 !important;
    border: 1px solid #323232 !important;
}

:is(
    .gdt-dark,
    [data-theme="dark"],
    [data-color-scheme="dark"],
    [data-color-mode="dark"],
    html.dark,
    html.gdt-dark,
    .dark-theme,
    body.dark,
    body.gdt-dark,
    .dark-mode,
    .darkmode,
    .is-dark-theme,
    .wp-dark-mode-active
) :is(
    .grp-mag-useful__body,
    .grp-mag-news-card__body,
    .grp-mag-news-row
) {
    background: #272727;
}

:is(
    .gdt-dark,
    [data-theme="dark"],
    [data-color-scheme="dark"],
    [data-color-mode="dark"],
    html.dark,
    html.gdt-dark,
    .dark-theme,
    body.dark,
    body.gdt-dark,
    .dark-mode,
    .darkmode,
    .is-dark-theme,
    .wp-dark-mode-active
) .grp-mag-news-row {
    border-top-color: #323232;
}

:is(
    .gdt-dark,
    [data-theme="dark"],
    [data-color-scheme="dark"],
    [data-color-mode="dark"],
    html.dark,
    html.gdt-dark,
    .dark-theme,
    body.dark,
    body.gdt-dark,
    .dark-mode,
    .darkmode,
    .is-dark-theme,
    .wp-dark-mode-active
) .grp-mag-news-card--kit {
    border-top: 2px solid #52aa6b !important;
}

:is(
    .gdt-dark,
    [data-theme="dark"],
    [data-color-scheme="dark"],
    [data-color-mode="dark"],
    html.dark,
    html.gdt-dark,
    .dark-theme,
    body.dark,
    body.gdt-dark,
    .dark-mode,
    .darkmode,
    .is-dark-theme,
    .wp-dark-mode-active
) :is(
    .grp-mag-feature__title,
    .grp-mag-side__title,
    .grp-mag-useful__title,
    .grp-mag-news__title,
    .grp-mag-news-row__title,
    .grp-mag-topic__name,
    .grp-mag-useful__excerpt
) {
    color: #fff;
}

:is(
    .gdt-dark,
    [data-theme="dark"],
    [data-color-scheme="dark"],
    [data-color-mode="dark"],
    html.dark,
    html.gdt-dark,
    .dark-theme,
    body.dark,
    body.gdt-dark,
    .dark-mode,
    .darkmode,
    .is-dark-theme,
    .wp-dark-mode-active
) .grp-mag-useful__tag {
    color: #7ba2ff;
}

:is(
    .gdt-dark,
    [data-theme="dark"],
    [data-color-scheme="dark"],
    [data-color-mode="dark"],
    html.dark,
    html.gdt-dark,
    .dark-theme,
    body.dark,
    body.gdt-dark,
    .dark-mode,
    .darkmode,
    .is-dark-theme,
    .wp-dark-mode-active
) :is(
    .grp-card:hover .grp-card__title,
    .grp-scroll-card:hover .grp-scroll-card__title,
    .grp-mag-useful:hover .grp-mag-useful__title,
    .grp-mag-news-card:hover .grp-mag-news__title,
    .grp-mag-news-row:hover .grp-mag-news-row__title,
    .grp-mag-topic:hover .grp-mag-topic__name
) {
    color: #7ba2ff;
}

:is(
    .gdt-dark,
    [data-theme="dark"],
    [data-color-scheme="dark"],
    [data-color-mode="dark"],
    html.dark,
    html.gdt-dark,
    .dark-theme,
    body.dark,
    body.gdt-dark,
    .dark-mode,
    .darkmode,
    .is-dark-theme,
    .wp-dark-mode-active
) :is(
    .grp-mag-feature:hover .grp-mag-feature__title,
    .grp-mag-side:hover .grp-mag-side__title
) {
    color: rgba(255,255,255,.86);
}


/* ══════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════ */

@media (max-width: 920px) {
    .grp-mag-main__grid {
        grid-template-columns: 1fr;
    }
    .grp-mag-main__side {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: none;
    }
    .grp-mag-useful-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) }
    .grp-mag-topics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) }
    .grp-mag-news-card { flex: 0 0 220px; min-width: 220px }
}

@media (max-width: 680px) {
    .grp-mag { margin-top: 2.4em }
    .grp-mag__section { margin-top: 40px }
    .grp-mag__section:first-child { margin-top: 0 }

    .grp-mag__head {
        grid-template-columns: 3px auto minmax(16px, 1fr);
        column-gap: 10px;
        margin-bottom: 24px;
    }
    .grp-mag__head h2 { font-size: 15px }
    .grp-mag__head::after { grid-column: 3; grid-row: 1 }

    .grp-mag-feature { min-height: 340px }
    .grp-mag-feature__body { padding: 20px 22px }
    .grp-mag-feature__title {
        font-size: 18px;
        line-height: 1.22;
    }

    .grp-mag-main__side { grid-template-columns: 1fr }
    .grp-mag-side { min-height: 180px }

    .grp-mag-useful-grid { grid-template-columns: 1fr }
    .grp-mag-topics-grid { grid-template-columns: repeat(2, 1fr) }

    .grp-mag-news-card {
        flex: 0 0 min(80vw, 240px);
        min-width: min(80vw, 240px);
    }
    .grp-mag-news-row {
        grid-template-columns: 1fr;
        gap: 4px;
        align-items: start;
    }
    .grp-mag-news-row__title { white-space: normal }
    .grp-mag-news-row--more {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
    }
    .grp-mag-news__nav { display: none }
}

@media (max-width: 420px) {
    .grp-mag-topics-grid { grid-template-columns: 1fr }
}


/* ══════════════════════════════════════════════════════════
   REDUCED MOTION
   ══════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
    .grp-card,
    .grp-scroll-card,
    .grp-mag-feature,
    .grp-mag-side,
    .grp-mag-useful,
    .grp-mag-news-card,
    .grp-mag-topic {
        animation: none !important;
        opacity: 1 !important;
        transition: border-color .18s ease !important;
    }

    .grp-card__img,
    .grp-scroll-card__img,
    .grp-mag-feature__img,
    .grp-mag-side__img,
    .grp-mag-useful__img,
    .grp-mag-news__img { transition: none !important }

    .grp-card::before,
    .grp-scroll-card::before { transition: none !important }

    .grp-card__thumb::before,
    .grp-scroll-card__thumb::before,
    .grp-skel-line::before,
    .grp-scroll-skel__img::before,
    .grp-scroll-skel__line::before { animation: none !important }
}


/* Mouse controls for the collections rail, aligned with the image edge. */
@media (min-width: 641px) {
    .grp-mag-kit-section .grp-mag-news__nav {
        box-sizing: border-box;
        width: 46px; height: 46px;
        min-width: 0; padding: 0; margin: 0;
        border: 0; border-radius: 50%;
        background: rgba(100, 112, 132, .32);
        color: #fff;
        box-shadow: 0 2px 12px rgba(0, 0, 0, .10);
        -webkit-backdrop-filter: blur(6px);
        backdrop-filter: blur(6px);
        display: inline-flex;
    }
    .grp-mag-kit-section .grp-mag-news__nav--prev { left: 12px; }
    .grp-mag-kit-section .grp-mag-news__nav--next { right: 12px; }
    .grp-mag-kit-section .grp-mag-news__nav svg { width: 24px; height: 24px; }
    .grp-mag-kit-section .grp-mag-news__nav:hover {
        background: rgba(76, 88, 110, .55); color: #fff;
    }
    .grp-mag-kit-section .grp-mag-news__nav:focus-visible {
        outline: 3px solid var(--grp-accent); outline-offset: 4px;
    }
    .grp-mag-kit-section .grp-mag-news__nav:disabled {
        opacity: 0; visibility: hidden; pointer-events: none;
    }
}
