/* GreenInsider Blog — index and post pages.
   Builds on css/liquid-glass.css (tokens, .glass, nav, footer, .page-hero, .chip, .btn). */

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---------- Shared bits ---------- */
.ins-chip { display: inline-flex; align-items: center; gap: .35rem; padding: .28rem .7rem; border-radius: var(--radius-pill);
    font-size: .76rem; font-weight: 700; letter-spacing: .02em; border: 1px solid var(--glass-border);
    background: rgba(22,163,74,.12); color: var(--accent); white-space: nowrap; }
.ins-chip.stage { background: rgba(255,255,255,.14); color: var(--text-2); }
[data-theme="dark"] .ins-chip.stage { background: rgba(255,255,255,.06); }
.ins-build { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .8rem; color: var(--text-3); overflow-wrap: anywhere; }
.ins-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.ins-date { color: var(--text-3); font-size: .85rem; font-weight: 500; }

/* Product logo panel: the logos are drawn on white, so they sit on a light panel in both themes */
.ins-logo { display: grid; place-items: center; background: #fff; border-radius: var(--radius-sm); border: 1px solid var(--glass-border); }
[data-theme="dark"] .ins-logo { background: rgba(255,255,255,.92); }
.ins-logo img { width: 100%; height: 100%; object-fit: contain; }

/* ---------- Index ---------- */
.ins-hero .eyebrow { margin-bottom: .6rem; }
.ins-hero-icon { width: 72px; height: 72px; margin: 0 auto 1rem; display: block; filter: drop-shadow(0 12px 24px rgba(22,163,74,.35)); }

.ins-featured { display: grid; grid-template-columns: minmax(0,.9fr) minmax(0,1.1fr); gap: clamp(1.2rem,3vw,2.4rem); align-items: center;
    padding: clamp(1rem,2vw,1.4rem); color: inherit; text-decoration: none; }
.ins-featured .ins-logo { aspect-ratio: 16/10; padding: clamp(1.2rem,4vw,2.6rem); }
.ins-featured-body { display: flex; flex-direction: column; gap: .75rem; padding: .4rem clamp(.4rem,1.5vw,1.2rem); }
.ins-featured-body h2 { font-size: clamp(1.5rem,3vw,2.1rem); letter-spacing: -.01em; }
.ins-featured-body p { color: var(--text-2); font-size: 1.02rem; }
.ins-featured-body .btn { align-self: flex-start; margin-top: .4rem; }

.ins-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin: 3rem 0 1.4rem; }
.ins-toolbar h2 { font-size: clamp(1.4rem,2.6vw,1.8rem); }
.ins-filters { display: flex; flex-wrap: wrap; gap: .5rem; }
.ins-filter { font: inherit; font-size: .88rem; font-weight: 600; padding: .5rem 1rem; border-radius: var(--radius-pill); cursor: pointer;
    color: var(--text-2); background: rgba(255,255,255,.14); border: 1px solid var(--glass-border); transition: all .2s var(--ease); }
[data-theme="dark"] .ins-filter { background: rgba(255,255,255,.06); }
.ins-filter:hover { color: var(--text-1); }
.ins-filter[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.ins-filter:focus-visible, .ins-card:focus-visible, .ins-featured:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.ins-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 1.5rem; }
.ins-card { display: flex; flex-direction: column; color: inherit; text-decoration: none; padding: .8rem; }
.ins-card .ins-logo { height: 140px; padding: 1.4rem 2rem; }
.ins-card-body { display: flex; flex-direction: column; gap: .55rem; padding: 1rem .5rem .4rem; flex: 1; }
.ins-card h3 { font-size: 1.18rem; line-height: 1.25; }
.ins-card p { color: var(--text-2); font-size: .93rem; flex: 1; }
.ins-more { display: inline-flex; align-items: center; gap: .35rem; color: var(--accent); font-weight: 600; font-size: .9rem; margin-top: .3rem; }
.ins-more svg { width: 16px; height: 16px; transition: transform .2s var(--ease); }
.ins-card:hover .ins-more svg, .ins-featured:hover .ins-more svg { transform: translateX(3px); }
.ins-empty { color: var(--text-3); text-align: center; padding: 2rem 0; }

/* ---------- Post ---------- */
.post-hero { padding: 8.5rem 0 2rem; }
.post-hero-card { padding: clamp(1.6rem,4vw,2.8rem); }
.post-back { display: inline-flex; align-items: center; gap: .4rem; color: var(--text-2); font-size: .9rem; font-weight: 600; margin-bottom: 1.2rem; }
.post-back:hover { color: var(--accent); }
.post-back svg { width: 16px; height: 16px; }
.post-hero-card h1 { font-size: clamp(1.8rem,4.2vw,2.9rem); letter-spacing: -.02em; margin: .7rem 0 .6rem; }
.post-hero-card h1 .grad { background: linear-gradient(120deg, var(--accent) 0%, var(--accent-2) 50%, var(--accent-deep) 100%);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.post-byline { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; color: var(--text-2); font-size: .92rem; margin-top: 1rem; }
.post-byline b { color: var(--text-1); font-weight: 600; }

.post-layout { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: 1.5rem; align-items: start; padding-bottom: 4rem; }
.post-aside { position: sticky; top: 6.5rem; display: grid; gap: 1.5rem; }

.post-body { padding: clamp(1.4rem,3.5vw,2.6rem); color: var(--text-2); font-size: 1.04rem; line-height: 1.75; min-width: 0; }
.post-body > :first-child { margin-top: 0; }
.post-body h2 { font-size: clamp(1.35rem,2.6vw,1.75rem); color: var(--text-1); margin: 2.2rem 0 .8rem; }
.post-body h3 { font-size: 1.2rem !important; font-weight: 700 !important; color: var(--text-1); margin: 1.6rem 0 .6rem; }
.post-body p { margin: 0 0 1rem; }
.post-body b, .post-body strong { color: var(--text-1); }
.post-body ul, .post-body ol { margin: 0 0 1.2rem; padding-left: 1.3rem; display: grid; gap: .35rem; }
.post-body li::marker { color: var(--accent); }
.post-body a { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.post-body code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .88em; padding: .1em .4em; border-radius: 6px;
    background: rgba(22,163,74,.12); color: var(--text-1); }
.post-body figure { margin: 1.4rem 0 1.8rem; }
.post-body .insider-img { display: block; width: 100%; height: auto; border-radius: var(--radius-sm); border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow); cursor: zoom-in; background: #1b1020; }
.post-body .insider-caption, .post-body figcaption { margin-top: .6rem; font-size: .86rem; color: var(--text-3); text-align: center; }
.post-body video, .post-body iframe { max-width: 100%; border-radius: var(--radius-sm); }

.post-body .cmp-wrap { overflow-x: auto; margin: 1rem 0 1.6rem; border-radius: var(--radius-sm); border: 1px solid var(--glass-border); }
.post-body .cmp { width: 100%; border-collapse: collapse; font-size: .93rem; line-height: 1.5; }
.post-body .cmp th, .post-body .cmp td { padding: .65rem .85rem; border-bottom: 1px solid var(--glass-border); text-align: left; vertical-align: top; }
.post-body .cmp thead th { color: var(--accent); background: rgba(22,163,74,.08); }
.post-body .cmp tr:last-child td { border-bottom: 0; }
.post-body .cmp td:first-child { font-weight: 600; color: var(--text-1); white-space: nowrap; }

.post-specs { padding: 1.6rem; }
.post-specs h2 { font-size: 1.15rem; margin-bottom: 1rem; }
.post-specs .ins-logo { height: 96px; padding: 1rem 1.4rem; margin-bottom: 1.2rem; }
.post-specs dl { display: grid; gap: .8rem; margin: 0 0 1.4rem; }
.post-specs dt { font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.post-specs dd { margin: .1rem 0 0; color: var(--text-1); font-size: .93rem; overflow-wrap: anywhere; }
.post-specs .btn { width: 100%; justify-content: center; text-align: center; }

.post-more { padding: 1.4rem; }
.post-more h2 { font-size: 1.05rem; margin-bottom: .8rem; }
.post-more a { display: block; padding: .6rem .2rem; border-top: 1px solid var(--glass-border); color: var(--text-2); font-size: .9rem; }
.post-more a:first-of-type { border-top: 0; }
.post-more a:hover { color: var(--accent); }
.post-more a span { display: block; font-size: .78rem; color: var(--text-3); }

@media (max-width: 960px) {
    .post-layout { grid-template-columns: 1fr; }
    .post-aside { position: static; }
}
@media (max-width: 760px) {
    .ins-featured { grid-template-columns: 1fr; }
    .post-hero { padding-top: 7rem; }
}

/* Featured post with a real screenshot as cover */
.ins-cover { position: relative; aspect-ratio: 16/10; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--glass-border);
    background: #1b1020; box-shadow: var(--glass-shadow); }
.ins-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top left; }

/* Image lightbox (built by the gallery script at the end of each post) */
.modal { display: none; position: fixed; inset: 0; z-index: 2000; background: rgba(4, 12, 8, .82);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); animation: ins-fade .25s var(--ease); }
.modal.active { display: flex; align-items: center; justify-content: center; }
.modal-content { position: relative; max-width: 90%; max-height: 90vh; animation: ins-pop .25s var(--ease); }
.modal-img { width: 100%; height: auto; max-height: 85vh; border-radius: var(--radius-sm); object-fit: contain; }
.modal-close, .modal-nav { display: grid; place-items: center; color: #fff; cursor: pointer; border-radius: 50%;
    background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22); transition: background .2s var(--ease); }
.modal-close { position: absolute; top: 1rem; right: 1rem; width: 44px; height: 44px; font-size: 1.1rem; z-index: 2002; }
.modal-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; font-size: 1.2rem; z-index: 2001; }
.modal-close:hover, .modal-nav:hover { background: var(--accent); color: var(--on-accent); }
.modal-prev { left: 1rem; }
.modal-next { right: 1rem; }
.modal-counter { position: absolute; bottom: -2rem; left: 50%; transform: translateX(-50%); color: rgba(255,255,255,.8); font-size: .85rem; }
@keyframes ins-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ins-pop { from { transform: scale(.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .modal, .modal-content { animation: none; } }
