/**
 * SNAPSMACK - The Grid Skin Styles
 * Alpha v0.7.5
 *
 * Clean, minimal Instagram-inspired grid skin.
 * All configurable values are CSS custom properties on :root.
 * The compiled CSS blob from smack-skin.php loads after this file
 * and overrides defaults via the same :root variables.
 */

/*
 * SNAPSMACK_EOF_HEADER
 * Last non-empty line of this file MUST be the canonical CSS EOF
 * marker: slash-star, space, five equals, space, the literal string
 * 'SNAPSMACK EOF', space, five equals, space, star-slash.
 * (Authoritative byte sequence: tools/check-eof.py EOF_MARKERS['.css'].)
 * Missing or different = truncated/corrupted. Restore before saving.
 */




/* ==========================================================================
   CUSTOM PROPERTY DEFAULTS
   Override these via the skin settings panel (compiled CSS blob).
   ========================================================================== */

:root {
    --bg-primary:        #ffffff;
    --text-primary:      #262626;
    --text-secondary:    #8e8e8e;
    --accent-color:      #0095f6;
    --border-color:      #dbdbdb;
    --font-body:         'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

    --grid-gap:          2px;
    --grid-bg:           #ffffff;
    --tile-radius:       0px;
    --grid-gutter:       0px;
    --grid-max-width:    935px;

    /* Carousel dot colours — inherit site accent */
    --carousel-dot-color:        rgba(38, 38, 38, 0.2);
    --carousel-dot-active-color: var(--accent-color);
}

/* ==========================================================================
   RESET & BASE
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--text-primary);
    text-decoration: none;
}
a:hover { opacity: 0.7; }

img { display: block; max-width: 100%; }

/* ==========================================================================
   LAYOUT SHELL
   ========================================================================== */

/* Max-width content column — wraps profile, sticky nav, and grid on landing page */
.tg-content-wrap {
    box-sizing: border-box;
    /* Card = grid width + a white gutter on each side. With box-sizing:border-box
       the inner content stays at --grid-max-width while the card itself grows by
       the gutter, so the white extends outward over the background treatment. */
    max-width: calc(var(--grid-max-width, 935px) + (2 * var(--grid-gutter, 0px)));
    margin: 0 auto;
    padding-left: var(--grid-gutter, 0px);
    padding-right: var(--grid-gutter, 0px);
}

/* General constrained wrapper — profile header, topbar, post view, archive */
.tg-wrap {
    padding: 0 var(--grid-gutter);
}

/* ==========================================================================
   STICKY NAV
   Sits between profile header and grid. Sticks to top when profile scrolls off.
   JS (tg-nav.js) adds .profile-hidden class to reveal the mini avatar.
   ========================================================================== */

.tg-sticky-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-primary);
    border-bottom: 1px solid color-mix(in srgb, var(--ic-navline-color, var(--border-color)) calc(var(--ic-navline-opacity, 100) * 1%), transparent);
    /* Optional admin drop shadow on the nav line — hard-edged (no blur),
       down-and-right, capped at 3px. The old 4px BLURRED shadow bled faint
       vertical lines at the bar's ends; a hard offset shadow doesn't. */
    box-shadow: var(--ic-navline-shadow, none);
}

.tg-sticky-nav-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 0 var(--grid-gutter, 0px);
    height: 40px;
    overflow: hidden;
}

/* Mini avatar — absolutely positioned left, hidden until profile scrolls off screen */
.tg-sticky-avatar {
    position: absolute;
    left: 12px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 0.2s, transform 0.2s;
    pointer-events: none;
}

.tg-sticky-avatar-initials {
    position: absolute;
    left: 12px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    flex-shrink: 0;
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 0.2s, transform 0.2s;
    pointer-events: none;
}

.tg-sticky-nav.profile-hidden .tg-sticky-avatar,
.tg-sticky-nav.profile-hidden .tg-sticky-avatar-initials {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

/* Nav links */
.tg-sticky-nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.tg-sticky-nav-links a {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    letter-spacing: 0.2px;
    text-transform: var(--nav-text-transform, none);
    text-shadow: var(--nav-text-glow, none);
    transition: color 0.15s, text-shadow 0.15s;
}

.tg-sticky-nav-links a:hover,
.tg-sticky-nav-links a.active {
    color: var(--text-primary);
    opacity: 1;
    text-shadow: var(--nav-text-glow-strong, var(--nav-text-glow, none));
}

/* Top nav bar (existing) */
.tg-topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
}

.tg-topbar-inner {
    padding: 0 var(--grid-gutter);
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tg-site-name {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.3px;
    color: var(--text-primary);
}

/* ==========================================================================
   PROFILE HEADER
   Shown above the grid on the landing page.
   ========================================================================== */

.tg-profile {
    padding: 30px 0 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    /* Same configurable nav line as the bottom border of .tg-sticky-nav, so the
       line above and below the menu match. */
    border-bottom: 1px solid color-mix(in srgb, var(--ic-navline-color, var(--border-color)) calc(var(--ic-navline-opacity, 100) * 1%), transparent);
}

.tg-profile-avatar {
    width: 77px;
    height: 77px;
    border-radius: 50%;
    background: var(--border-color);
    flex-shrink: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tg-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tg-profile-avatar-initials {
    font-size: 28px;
    font-weight: 300;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.tg-profile-info { flex: 0 1 auto; min-width: 0; }

.tg-profile-nameline {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 10px;
}

.tg-profile-username {
    font-size:   var(--blog-title-size, 20px);
    font-weight: var(--blog-title-weight, 300);
    font-family: var(--blog-title-font, inherit);
    margin: 0;
    color: var(--text-primary);
    text-shadow: var(--profile-text-glow, none);
}

.tg-profile-tagline-sep {
    font-size: var(--blog-title-size, 20px);
    font-weight: 300;
    color: var(--text-secondary);
    line-height: 1;
}

.tg-profile-tagline {
    font-size:   var(--tagline-size, 16px);
    font-weight: var(--tagline-weight, 300);
    font-family: var(--tagline-font, inherit);
    color: var(--tagline-color, var(--text-secondary));
    margin: 0;
    text-shadow: var(--profile-text-glow, none);
}

.tg-profile-stats {
    display: flex;
    gap: 24px;
    margin-bottom: 10px;
}

.tg-profile-stat {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.tg-profile-stat-num {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.tg-profile-stat-label {
    font-size: 14px;
    color: var(--posts-color, var(--text-secondary));
    text-shadow: var(--posts-glow, none);
}

.tg-profile-bio {
    /* Bio glow is its OWN control (--bio-text-glow), independent of the
       title/tagline Text Glow, so it can be turned off on the bio alone. */
    margin:      8px 0 0;
    font-size:   14px;
    line-height: 1.5;
    color:       var(--bio-color, var(--text-secondary));
    max-width:   480px;
    text-shadow: var(--bio-text-glow, none);
}


/* ==========================================================================
   3-COLUMN GRID
   ========================================================================== */

/* 3-column grid — constrained by .tg-content-wrap max-width.
   Width is 100% of the content column (not full viewport). */
.tg-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--grid-gap);
    background: var(--grid-bg);
    margin-top: var(--grid-gap);
    width: 100%;
}

/* Individual grid tile */
.tg-tile {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--border-color);
    border-radius: var(--tile-radius);
}

/* Folded tiles (beyond the first batch) are removed from layout by
   ss-engine-aurora-reveal.js so a large blog starts short and GROWS as you
   scroll, instead of laying out every post at full height at once. */
.tg-grid .tg-tile.tg-fold { display: none; }

.tg-tile a {
    display: block;
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
}

.tg-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: opacity 0.2s;
}

.tg-tile:hover img { filter: brightness(0.8); }
/* The generic `a:hover{opacity:.7}` was dimming the whole tile LINK on hover,
   letting the Organized Mayhem background show through the print. Keep tile
   links fully opaque — the brightness darken on the image is the only hover cue. */
.tg-tile a:hover { opacity: 1; }

/* Carousel indicator badge (top-right corner) */
.tg-tile-indicator {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    pointer-events: none;
    line-height: 1;
}

.tg-tile-indicator--icon {
    color: #fff;
    font-size: 16px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    /* Unicode: layered squares ⧉ */
}

.tg-tile-indicator--count {
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    letter-spacing: 0.3px;
}

/* Hover overlay: title or count shown on hover */
.tg-tile-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 1;
    pointer-events: none;
    padding: 12px;
}

.tg-tile:hover .tg-tile-overlay { opacity: 1; }

/* Dark-only hover: no pointer events, no padding needed */
.tg-tile-overlay--dark { padding: 0; }

.tg-tile-overlay-text {
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* ── Framed tile mode ──────────────────────────────────────────────────────
   Applied when per-image/carousel/grid style brings size below 100%,
   adds a border, or adds a shadow. PHP emits class .tg-tile--framed and
   CSS custom properties on the .tg-tile element itself.
   ──────────────────────────────────────────────────────────────────────── */

.tg-tile--framed {
    background: var(--tile-bg, #ffffff);
}

.tg-tile--framed a {
    display:         flex;
    align-items:     center;
    justify-content: center;
    background:      var(--tile-bg, #ffffff);
}

.tg-tile--framed img {
    /* override fill-tile behaviour */
    width:        var(--tile-img-size, 100%);
    height:       var(--tile-img-size, 100%);
    object-fit:   contain;
    border:       var(--tile-border-w, 0px) solid var(--tile-border-c, transparent);
    box-shadow:   var(--tile-shadow, none);
    box-sizing:   border-box;
    transition:   opacity 0.2s;
}

/* ── Trigram row ──────────────────────────────────────────────────────────
   Trigram tiles are plain square tiles. No special CSS needed — L, M, R
   all inherit .tg-tile's aspect-ratio: 1/1 and sit in the grid normally.
   ──────────────────────────────────────────────────────────────────────── */

/* Phantom tile: invisible placeholder to complete a partial row before a
   trigram set, so the L tile always starts at column 0. */
.tg-tile--phantom {
    visibility:     hidden;
    pointer-events: none;
}

/* Panorama tiles: the first tile forces a new row via grid-column: 1 */
.tg-tile--pano-first  { grid-column: 1; }
.tg-tile--pano-middle { /* naturally placed in column 2 */ }
.tg-tile--pano-last   { /* naturally placed in column 3 */ }

/* ==========================================================================
   SINGLE POST VIEW (layout.php) — Instagram two-panel layout
   ========================================================================== */

/* ── Outer two-panel container ─────────────────────────────────────────── */
.tg-post-ig {
    display:         flex;
    justify-content: center;
    height:          100dvh;
    overflow:        hidden;
    background:      var(--post-bg, #000);
}

/* ── Left: image panel (fixed, never scrolls) ──────────────────────────── */
.tg-post-ig-image {
    /* The Grid is classic-IG: the image panel is ALWAYS 1:1 square.
       Sized by container height; width derives from aspect-ratio. */
    flex:            0 0 auto;
    height:          100%;
    aspect-ratio:    1 / 1;
    min-width:       0;
    display:         flex;
    align-items:     center;
    justify-content: center;
    overflow:        hidden;
    background:      var(--post-bg, #000);
    position:        relative;
    padding:         0;
}

.tg-post-ig-image .tg-single-img {
    width:      100%;
    height:     100%;
    object-fit: contain;
    display:    block;
}

/* Carousel fills the image panel */
.tg-post-ig-image .tg-carousel-wrap {
    width:    100%;
    height:   100%;
    position: relative;
}

.tg-post-ig-image .ss-slider,
.tg-post-ig-image .slider-track {
    height: 100%;
}

.tg-post-ig-image .slider-slide {
    height:          100%;
    display:         flex !important;
    align-items:     center;
    justify-content: center;
    background:      var(--post-bg, #000);
}

.tg-post-ig-image .slider-slide img {
    max-width:   100% !important;
    max-height:  100% !important;
    width:       auto !important;
    height:      auto !important;
    object-fit:  contain !important;
}

/* Framed slides inside the image panel */
.tg-post-ig-image .tg-slide--framed img {
    max-height: 100% !important;
}

/* ── Right: info panel (scrollable) ────────────────────────────────────── */
.tg-post-ig-info {
    flex:           0 0 335px;
    width:          335px;
    border-left:    1px solid var(--border-color);
    background:     var(--bg-primary, #fff);
    display:        flex;
    flex-direction: column;
    overflow:       hidden;
}

/* Fixed header: back + avatar + site name */
.tg-post-ig-header {
    display:       flex;
    align-items:   center;
    gap:           10px;
    padding:       14px 16px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink:   0;
}

.tg-back-btn {
    background:  none;
    border:      none;
    cursor:      pointer;
    color:       var(--text-primary);
    font-size:   20px;
    padding:     4px 8px 4px 0;
    display:     flex;
    align-items: center;
    flex-shrink: 0;
}

.tg-back-btn:hover { opacity: 0.6; }

.tg-post-ig-avatar {
    width:         32px;
    height:        32px;
    border-radius: 50%;
    object-fit:    cover;
    flex-shrink:   0;
}

.tg-post-ig-avatar--initials {
    display:         flex;
    align-items:     center;
    justify-content: center;
    background:      var(--text-secondary, #8e8e8e);
    color:           #fff;
    font-size:       14px;
    font-weight:     600;
}

.tg-post-ig-sitename {
    font-size:     14px;
    font-weight:   600;
    color:         var(--text-primary);
    flex:          1;
    overflow:      hidden;
    white-space:   nowrap;
    text-overflow: ellipsis;
}

/* Scrollable body */
.tg-post-ig-body {
    flex:       1 1 0;
    overflow-y: auto;
    padding:    20px 22px;
}

/* IG-style caption block: bold username inline then caption text */
.tg-post-caption-block {
    margin-bottom: 12px;
}

.tg-post-ig-caption {
    font-size:   14px;
    color:       var(--text-primary);
    line-height: 1.6;
    margin:      0;
}

.tg-post-ig-caption-user {
    font-weight:  600;
    margin-right: 4px;
}

.description a,
.static-content a:not(.nav-menu a) {
    color:                  var(--accent-color);
    text-decoration:        underline;
    text-underline-offset:  2px;
}

.description a:hover,
.static-content a:not(.nav-menu a):hover { color: var(--text-primary); }

.description a:has(img),
.static-content a:has(img) {
    text-decoration: none !important;
    border-bottom:   none !important;
}

/* EXIF panel */
.tg-exif-panel {
    display:       flex;
    flex-wrap:     wrap;
    gap:           6px 16px;
    padding:       10px 0;
    border-top:    1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 12px;
}
/* No EXIF to show (phone/IG imports, GramOfSmack mode) → don't paint the bordered
   strip as empty stray lines. PHP also skips emitting the panel when no image has
   EXIF; this covers the carousel edge where only a later slide does. */
.tg-exif-panel:empty { display: none; }

.tg-exif-item {
    display:        flex;
    flex-direction: column;
}

.tg-exif-label {
    font-size:      10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color:          var(--text-secondary);
}

.tg-exif-value {
    font-size: 13px;
    color:     var(--text-primary);
}

/* Engagement bar — pinned between body and footer */
.tg-post-ig-actions {
    flex-shrink:  0;
    border-top:   1px solid var(--border-color);
    padding:      10px 16px 8px;
    background:   var(--bg-primary, #fff);
}

.tg-post-ig-action-icons {
    display:       flex;
    gap:           16px;
    margin-bottom: 6px;
}

.tg-action-btn {
    background:  none;
    border:      none;
    padding:     0;
    cursor:      pointer;
    color:       var(--text-primary);
    line-height: 1;
    display:     flex;
    align-items: center;
}

.tg-action-btn:hover { opacity: 0.6; }

.tg-action-bookmark { margin-left: auto; }

.tg-post-ig-date {
    font-size:      10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color:          var(--text-secondary);
    margin:         0;
}

/* Community component — flush to body edges */
.tg-community-wrap {
    border-top: 1px solid var(--border-color);
    margin:     16px -16px 0;
    padding:    0 16px;
}

/* ── Framed carousel slide (shared with grid tiles) ────────────────────── */
.tg-slide--framed {
    background:      var(--slide-bg, #000) !important;
    display:         flex !important;
    align-items:     center;
    justify-content: center;
    min-height:      280px;
}

.tg-slide--framed img {
    width:      var(--slide-img-size, 100%) !important;
    height:     auto !important;
    max-height: 80vh !important;
    object-fit: contain !important;
    border:     var(--slide-border-w, 0px) solid var(--slide-border-c, transparent) !important;
    box-shadow: var(--slide-shadow, none) !important;
    box-sizing: border-box !important;
    background: transparent !important;
}

/* Fallback carousel/single-img classes (used outside post view) */
.tg-carousel-wrap {
    position:   relative;
    background: var(--post-bg, #000);
    width:      100%;
}

.tg-single-img {
    width:      100%;
    max-height: 80vh;
    object-fit: contain;
    display:    block;
}

/* ── Footer pinned to bottom of right panel ────────────────────────────── */
.tg-post-ig-info > #system-footer {
    flex-shrink:   0;
    border-top:    1px solid var(--border-color);
    background:    var(--bg-primary, #fff);
    padding:       8px 16px;
    margin:        0;
}

.tg-post-ig-info > #system-footer .footer-metadata-bar p {
    font-size:      10px;
    letter-spacing: 0.3px;
    color:          var(--text-secondary);
    margin:         0;
}

/* ── Mobile: stack vertically ──────────────────────────────────────────── */
@media (max-width: 768px) {
    .tg-post-ig {
        flex-direction: column;
        height:         auto;
        overflow:       visible;
    }

    .tg-post-ig-image {
        /* Square here too — full width, 1:1. */
        flex:         0 0 auto;
        width:        100%;
        aspect-ratio: 1 / 1;
        height:       auto;
    }

    .tg-post-ig-info {
        width:    100%;
        flex:     0 0 auto;
        height:   auto;
        overflow: visible;
    }

    .tg-post-ig-body {
        overflow: visible;
    }
}

/* ==========================================================================
   POST MODAL OVERLAY
   IG-style popover: grid stays visible, dimmed behind 80% opaque backdrop.
   tg-modal.js populates #tg-modal-frame by fetching ?modal=1 fragments.
   ========================================================================== */

.tg-modal-overlay {
    position:        fixed;
    inset:           0;
    z-index:         900;
    display:         flex;
    align-items:     center;
    justify-content: center;
}

.tg-modal-overlay[hidden] { display: none; }

/* Prevent grid scroll while modal is open */
body.tg-modal-open { overflow: hidden; }

.tg-modal-backdrop {
    position:   absolute;
    inset:      0;
    background: rgba(0, 0, 0, 0.8);
}

.tg-modal-frame {
    position:      relative;
    z-index:       1;
    width:         auto;
    max-width:     92vw;
    height:        min(92vh, 900px);
    border-radius: 4px;
    overflow:      hidden;
    box-shadow:    0 8px 40px rgba(0, 0, 0, 0.6);
}

/* Force the post layout to fill the frame (overrides 100dvh default) */
.tg-modal-frame .tg-post-ig {
    height: 100%;
}

/* ==========================================================================
   ARCHIVE VIEW (categories, albums)
   Same grid as landing — just no profile header.
   ========================================================================== */

.tg-archive-header {
    padding: 20px 0 16px;
    border-bottom: 1px solid var(--border-color);
}

.tg-archive-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 4px;
}

.tg-archive-meta {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

/* ── Hashtag / Tag Page ──────────────────────────────────────────────────── */

.tg-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    opacity: .7;
    font-size: 13px;
    margin-bottom: 12px;
}

.tg-archive-header h2 {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 4px;
}

.tg-archive-header p {
    font-size: 13px;
    opacity: .6;
    margin: 0;
}

.tg-grid-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    opacity: .5;
}

/* ==========================================================================
   PAGINATION
   ========================================================================== */

.tg-pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    padding: 20px 16px;
}

.tg-page-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 6px 12px;
    cursor: pointer;
    font-size: 13px;
    border-radius: 4px;
    text-decoration: none;
    display: inline-block;
    transition: background 0.15s;
}

.tg-page-btn:hover,
.tg-page-btn.is-current {
    background: var(--text-primary);
    color: var(--bg-primary);
    border-color: var(--text-primary);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.tg-footer {
    border-top: 1px solid var(--border-color);
    padding: 24px 16px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 12px;
    letter-spacing: 0.5px;
}

.tg-footer a {
    color: var(--text-secondary);
}

.tg-footer a:hover {
    color: var(--text-primary);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 600px) {
    .tg-profile {
        gap: 20px;
        padding-top: 20px;
        padding-bottom: 20px;
    }
    .tg-profile-avatar {
        width: 56px;
        height: 56px;
    }
    .tg-profile-username { font-size: 16px; }
    .tg-profile-tagline-sep { font-size: 16px; }
    .tg-profile-tagline { font-size: 14px; }
    .tg-profile-stats { gap: 16px; }
}

/* ── Hashtag links in captions ────────────────────────────────────────────── */
.tg-hashtag {
    color: var(--accent-color, #0095f6);
    text-decoration: none;
    font-weight: 500;
}

.tg-hashtag:hover {
    text-decoration: underline;
}
/* ==========================================================================
   SYSTEM FOOTER OVERRIDES (core/footer.php → #system-footer)
   ========================================================================== */

#system-footer {
    /* Footer tracks the readability PANEL: spans the full panel width
       (content column + Panel Extend), centred, and never beyond it — the same
       content-aligned footer geometry as THE GRID, with this skin's own colours.
       Previously #system-footer was uncapped, so the bar/border/background
       spilled the full viewport width across the animated background ("escapes
       the content box"). SnapSmack footer rule: footer == panel width on every
       carousel skin, no exceptions. .inside below keeps the text in the content
       column so the bar spans the panel while the text stays centred on content. */
    border-top: 1px solid var(--border-color);
    background:  var(--footer-bg, var(--panel-bg, transparent));
    max-width:   calc(var(--grid-max-width, 935px) + 2 * var(--panel-extend, 0px));
    margin:      0 auto;
}

#system-footer .inside {
    max-width: var(--grid-max-width, 935px);
    margin: 0 auto;
    padding: 20px var(--grid-gutter, 0px);
}

#system-footer .footer-metadata-bar {
    text-align: center;
}

#system-footer .footer-metadata-bar p {
    margin: 0;
    font-size: 11px;
    color: var(--text-secondary);
    letter-spacing: 0.4px;
    line-height: 2;
}

#system-footer .footer-metadata-bar .sep {
    margin: 0 8px;
    opacity: 0.4;
}

#system-footer .footer-link {
    color: var(--text-secondary);
    text-decoration: none;
}

#system-footer .footer-link:hover {
    color: var(--text-primary);
    opacity: 1;
}

/* ==========================================================================
   STATIC PAGE (About, etc.)
   ========================================================================== */

.tg-static-page .tg-sticky-nav {
    position: sticky;
    top: 0;
}

.tg-static-content {
    max-width: 680px;
    margin: 0 auto;
    padding: 40px 28px 60px;
    /* Readability panel is now the shared .tg-content-wrap::before (full content
       width, all pages). This column just sets the reading width + padding. */
}

.tg-static-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 24px;
}

.tg-static-body {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-primary);
}

.tg-static-body p {
    margin: 0 0 16px;
}

.tg-static-body a {
    color: var(--accent-color);
    text-decoration: none;
}

.tg-static-body a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   BACKGROUND TREATMENT  (skin admin → Treatment)
   Full-viewport image/colour layer behind the centred content card.
   The .tg-treatment-* layers are emitted by skin-profile.php ONLY when a
   treatment is active, so with no treatment these rules never match and the
   default flat layout is completely untouched.
   ========================================================================== */

.tg-treatment-bg {
    position: fixed;
    inset: 0;
    z-index: -2;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

.tg-treatment-overlay {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

/* When a treatment is present, the content column reads as a card floating
   over the background. */
body:has(.tg-treatment-bg) .tg-content-wrap,
body:has(.tg-treatment-bg).is-blogroll #scroll-stage {
    background: var(--bg-primary, #ffffff);
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.28);
    min-height: 100vh;
}

body:has(.tg-treatment-bg).is-blogroll #scroll-stage {
    max-width: var(--grid-max-width, 935px);
    margin: 0 auto;
}

/* ==========================================================================
   AVATAR LIGHTBOX
   ========================================================================== */

.tg-profile-avatar--zoom { cursor: zoom-in; }

.tg-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5vmin;
    background: rgba(0, 0, 0, 0.85);
    opacity: 0;
    transition: opacity 0.18s ease;
}
.tg-lightbox[hidden] { display: none; }
.tg-lightbox.is-open { opacity: 1; }

.tg-lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 4px;
    box-shadow: 0 10px 60px rgba(0, 0, 0, 0.6);
    cursor: zoom-out;
}

.tg-lightbox-close {
    position: absolute;
    top: 18px;
    right: 22px;
    width: 40px;
    height: 40px;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 34px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.8;
}
.tg-lightbox-close:hover { opacity: 1; }

/* ==========================================================================
   BLOGROLL  (core blogroll.php rendered inside the Grid shell)
   Scoped to body.is-blogroll so it only affects the blogroll page, and only
   on The Grid (this stylesheet is loaded only when The Grid is active).
   ========================================================================== */

/* Constrain the blogroll's scroll-stage to the content width so its sticky nav
   matches every other page (it otherwise spans the full window). */
body.is-blogroll #scroll-stage {
    max-width: var(--grid-max-width, 935px);
    margin: 0 auto;
}

body.is-blogroll .blogroll-canvas {
    max-width: 680px;
    margin: 0 auto;
    padding: 32px 20px 60px;
}

body.is-blogroll .static-page-title {
    font-size: var(--blog-title-size, 24px);
    font-weight: 300;
    color: var(--text-primary);
    margin: 0 0 24px;
}

body.is-blogroll .blogroll-category-heading {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 6px;
    margin: 32px 0 16px;
}

body.is-blogroll .blogroll-peer { margin: 0 0 20px; }

body.is-blogroll .blogroll-peer-name a {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
}
body.is-blogroll .blogroll-peer-name a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

body.is-blogroll .blogroll-peer-desc {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-secondary);
    margin: 3px 0 0;
}

/* Drop the raw URL line — the peer name is the link. */
body.is-blogroll .blogroll-peer-url { display: none; }

/* ==========================================================================
   COMMUNITY COMMENT FORM  (inside the Grid post modal)
   The core community component ships raw browser inputs; theme them to match
   the Grid modal. Scoped to .tg-post-ig so only the modal is affected, and
   higher specificity than ss-community.css so these win regardless of order.
   ========================================================================== */

.tg-post-ig .ss-comment-guest-fields {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

.tg-post-ig .ss-guest-name,
.tg-post-ig .ss-guest-email,
.tg-post-ig .ss-comment-textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--border-color, #dbdbdb);
    border-radius: 8px;
    background: transparent;
    padding: 9px 12px;
    font-size: 13px;
    font-family: inherit;
    color: var(--text-primary);
    transition: border-color 0.15s ease;
}

.tg-post-ig .ss-guest-name::placeholder,
.tg-post-ig .ss-guest-email::placeholder,
.tg-post-ig .ss-comment-textarea::placeholder {
    color: var(--text-secondary);
}

.tg-post-ig .ss-guest-name:focus,
.tg-post-ig .ss-guest-email:focus,
.tg-post-ig .ss-comment-textarea:focus {
    outline: none;
    border-color: var(--accent-color, #0095f6);
}

.tg-post-ig .ss-comment-input-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.tg-post-ig .ss-comment-textarea {
    resize: none;
    line-height: 1.4;
    min-height: 38px;
}

.tg-post-ig .ss-comment-input-row .ss-avatar-placeholder {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--border-color, #dbdbdb);
    color: var(--text-secondary);
    font-size: 13px;
}

.tg-post-ig .ss-comment-btns {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 8px;
}

.tg-post-ig .ss-comment-cancel,
.tg-post-ig .ss-comment-submit {
    border: none;
    background: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 8px;
    transition: background 0.15s ease;
}

.tg-post-ig .ss-comment-cancel { color: var(--text-secondary); }
.tg-post-ig .ss-comment-submit { color: var(--accent-color, #0095f6); }
.tg-post-ig .ss-comment-submit:hover { background: rgba(0, 149, 246, 0.08); }

.tg-post-ig .ss-comment-author {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ───────────────────────────────────────────────────────────────────────────
   INSTANT CAMERA 1.0.0 — skew of The Grid.
   Non-square configurable tile (the print aspect), uncropped print, square
   corners, drop shadow, + Organized Mayhem ambient background and white scrim.
   Overrides The Grid's square (aspect 1/1 + object-fit:cover) tiles. The rules
   above are The Grid's, kept intact; this appended block diverges them.
   ─────────────────────────────────────────────────────────────────────────── */

/* Tiles take the configured print aspect. Three across a trigram then equal the
   derived cover (3 wide × 1 tall) automatically. Square corners, never rounded. */
.tg-tile {
    aspect-ratio: var(--ic-tile-aspect, 1 / 1) !important;
    border-radius: 0 !important;
    /* Drop shadow so each print clearly lifts off the tabletop. */
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.30);
    background: transparent;
}
/* The print is shown WHOLE — the skin never crops it (spec §5). */
.tg-tile img {
    object-fit: contain !important;
    border-radius: 0 !important;
    background: transparent;
}

/* ── Background layers (spec §6.3): bottom = Organized Mayhem / static image,
      middle = white scrim, top = grid + chrome. ───────────────────────────── */
body { background: transparent !important; }      /* let the fixed layers show */
.ic-bg {
    position: fixed; inset: 0;
    z-index: -3;
    overflow: hidden;
    pointer-events: none;
}
.ic-bg-static { background-size: cover; background-position: center center; }
/* RACETRACK / RAINFALL ambient canvases fill the fixed .ic-bg layer. The
   engines draw at half resolution and the stretch reads as glow; the extra
   blur on RACETRACK sells the long-exposure look. */
.ic-bg canvas.ic-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.ic-bg-racetrack canvas.ic-canvas { filter: blur(0.6px); }
/* Cycle mode: all background layers are stacked; the crossfader
   (ss-engine-bg-cycle.js) toggles .cycle-active. 2s fade between backgrounds. */
.ic-bg-cyclelayer { opacity: 0; transition: opacity 2s ease-in-out; }
.ic-bg-cyclelayer.cycle-active { opacity: 1; }
.ic-scrim {
    position: fixed; inset: 0;
    z-index: -2;
    background: #ffffff;
    opacity: var(--ic-scrim, 0.6);
    pointer-events: none;
}
/* Scrim/tabletop shows through the grid: transparent gaps, navbar, and content
   column. The !important on the grid beats the "Gap Colour" control (--grid-bg),
   which otherwise repaints the gaps solid; same for the sticky nav's
   --bg-primary fill. Nav links keep their glow (above) for legibility. */
:root { --grid-bg: transparent; }
.tg-content-wrap { background: transparent !important; }
/* Panel (all pages): ONE centred translucent column behind the content on EVERY
   page — landing, About/static, archive, hashtag, blogroll. Fixed + full
   viewport height, so it reaches the top AND runs behind the footer. Width =
   content column + Panel Extend (gutters) each side. Transparent until Panel
   Opacity is dialled up. Sits above the scrim (-2), below the content (0).
   (Replaces the old landing-only + static-page panels — one control, whole skin.) */
.ic-panel {
    position: fixed;
    top: 0; bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: calc(var(--grid-max-width, 935px) + 2 * var(--panel-extend, 0px));
    background: var(--panel-bg, transparent);
    z-index: -1;
    pointer-events: none;
}
.tg-grid        { background: transparent !important; }
/* Navbar background (Navbar Colour + Opacity) applies ONLY to the stuck state —
   the bar pinned to the top as you scroll (.profile-hidden). At rest (inline on
   the landing) it stays transparent so the tabletop shows through. */
.tg-sticky-nav                 { background: transparent !important; }
.tg-sticky-nav.profile-hidden  { background: var(--ic-nav-bg, transparent) !important; }

/* ===== SNAPSMACK EOF ===== */
