/* Build 0158 — Resources Runtime Modernization & Security Hardening.
   Shared public presentation for Chat Networks, mIRC Versions, IRC numerics,
   Videos, Partners, About and preserved TG007 reference documents. */

.tg-resource-nav {
    border-top: 1px solid rgba(18, 31, 43, .07);
    border-bottom: 1px solid var(--tg007-line, #dbe2e7);
    background: rgba(255, 255, 255, .98);
}

.tg-resource-nav-inner {
    display: flex;
    align-items: center;
    gap: .2rem;
    overflow-x: auto;
    padding-block: .4rem;
    scrollbar-width: thin;
}

.tg-resource-nav a {
    flex: 0 0 auto;
    padding: .52rem .72rem;
    border: 1px solid transparent;
    border-radius: .62rem;
    color: #53616c !important;
    font-size: .73rem;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
}

.tg-resource-nav a:hover,
.tg-resource-nav a:focus-visible {
    border-color: #dbe4e9;
    color: #285f87 !important;
    background: #f7f9fa;
}

.tg-resource-nav a.is-active {
    border-color: #cbdce7;
    color: #214f70 !important;
    background: #edf5fa;
    box-shadow: inset 0 -2px 0 rgba(48, 112, 157, .45);
}

.tg-resource-section,
.tg-resource-submit-section {
    position: relative;
    padding-block: clamp(1.9rem, 3vw, 2.45rem);
    background: #f8f8f6;
}

.tg-resource-section--muted,
.tg-resource-submit-section {
    border-top: 1px solid #e0e6ea;
    background:
        radial-gradient(circle at 0 0, rgba(61, 126, 173, .045), transparent 28rem),
        #f3f6f7;
}

.tg-resource-section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1.25rem;
    margin-bottom: 1rem;
}

.tg-resource-section-head > div:first-child {
    min-width: 0;
}

.tg-resource-section-head h2,
.tg-resource-reading-copy h2,
.tg-resource-submit-intro h2 {
    margin: .22rem 0 .35rem;
    color: #24313a;
    font-family: "Space Grotesk", Inter, sans-serif;
    font-weight: 800;
    letter-spacing: -.035em;
    line-height: 1.08;
}

.tg-resource-section-head h2 {
    font-size: clamp(1.55rem, 2.5vw, 2rem);
}

.tg-resource-section-head p,
.tg-resource-reading-copy p,
.tg-resource-submit-intro p,
.tg-resource-submit-intro li {
    color: #62707a;
    line-height: 1.58;
}

.tg-resource-section-head p {
    max-width: 660px;
    margin: 0;
    font-size: .84rem;
}

/* Older shared heading class remains supported for archived Resources markup. */
.tg-resource-heading {
    align-items: end;
    margin-bottom: 1rem;
}

.tg-resource-heading p {
    max-width: 560px;
    margin: 0;
    color: #687681;
    font-size: .82rem;
    text-align: right;
}

.tg-resource-filter {
    width: min(100%, 320px);
    flex: 0 0 min(320px, 42%);
}

.tg-resource-filter > span {
    display: block;
    margin: 0 0 .28rem;
    color: #65737d;
    font-size: .68rem;
    font-weight: 850;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.tg-resource-filter input {
    width: 100%;
    height: 40px;
    padding: 0 .82rem;
    border: 1px solid #cfd9df;
    border-radius: .68rem;
    outline: 0;
    color: #293740;
    background: #fff;
    font: inherit;
    font-size: .82rem;
    box-shadow: 0 5px 14px rgba(29, 43, 54, .025);
}

.tg-resource-filter input:focus {
    border-color: #72a0bd;
    box-shadow: 0 0 0 3px rgba(61, 126, 173, .12);
}

.tg-resource-directory-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .4rem 1rem;
    margin-bottom: .75rem;
    color: #77848d;
    font-size: .7rem;
    font-weight: 700;
}

.tg-resource-directory-summary strong {
    color: #355b75;
}

.tg-resource-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .8rem;
}

.tg-resource-card {
    min-width: 0;
    overflow: hidden;
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    border: 1px solid var(--tg007-line, #dbe2e7);
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 8px 24px rgba(26, 36, 44, .045);
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.tg-resource-card:hover {
    border-color: #c9d5dd;
    box-shadow: 0 13px 30px rgba(26, 36, 44, .075);
    transform: translateY(-1px);
}

.tg-resource-card[hidden] {
    display: none !important;
}

.tg-resource-card-media {
    min-height: 156px;
    display: grid;
    place-items: center;
    padding: .85rem;
    border-right: 1px solid #e0e6ea;
    background:
        radial-gradient(circle at 28% 20%, rgba(75, 136, 178, .13), transparent 44%),
        linear-gradient(145deg, #eef3f6, #e5ebef);
}

.tg-resource-card-media img,
.tg-resource-media-placeholder {
    display: block;
    width: 100%;
    max-width: 128px;
    aspect-ratio: 2 / 1;
    object-fit: contain;
    border: 1px solid rgba(55, 92, 118, .14);
    border-radius: .72rem;
    background: rgba(255, 255, 255, .9);
    box-shadow: 0 8px 18px rgba(32, 49, 61, .05);
}

.tg-resource-media-placeholder {
    position: relative;
    overflow: hidden;
    display: grid;
    place-items: center;
    color: #52738a;
    font-family: "Space Grotesk", Inter, sans-serif;
    font-size: 1rem;
    font-weight: 850;
    letter-spacing: .15em;
}

.tg-resource-media-placeholder::after {
    position: absolute;
    right: -20px;
    bottom: -26px;
    width: 78px;
    height: 78px;
    border: 13px solid rgba(48, 104, 147, .055);
    border-radius: 50%;
    content: "";
}

.tg-resource-card-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 1rem 1.05rem;
}

.tg-resource-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem .65rem;
    margin-bottom: .34rem;
    color: #76848e;
    font-size: .64rem;
    font-weight: 780;
}

.tg-resource-card-meta span:first-child {
    color: #467291;
    text-transform: uppercase;
    letter-spacing: .035em;
}

.tg-resource-card h3 {
    margin: 0;
    color: #26323b;
    font-family: "Space Grotesk", Inter, sans-serif;
    font-size: 1.04rem;
    font-weight: 830;
    letter-spacing: -.025em;
    line-height: 1.18;
}

.tg-resource-card-body > p {
    margin: .5rem 0 .75rem;
    color: #64727c;
    font-size: .78rem;
    line-height: 1.5;
}

.tg-resource-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    margin-top: auto;
}

.tg-resource-card-actions .tg-btn {
    min-height: 34px;
    padding: .48rem .72rem;
    font-size: .7rem;
}

/* Legacy directory classes retained for old cached/reference fragments. */
.tg-resource-directory {
    border-top: 1px solid var(--tg007-line, #dbe2e7);
}

.tg-resource-listing {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 1.1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--tg007-line, #dbe2e7);
}

.tg-resource-listing-media {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.tg-resource-listing-media img {
    width: 170px;
    aspect-ratio: 2 / 1;
    object-fit: contain;
    border: 1px solid #d5dde2;
    border-radius: .75rem;
    background: #fff;
}

.tg-resource-listing-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
}

.tg-resource-listing-title h3 {
    margin: 0;
    color: #26323b;
    font-family: "Space Grotesk", Inter, sans-serif;
}

.tg-resource-listing-title span {
    color: #74818a;
    font-size: .7rem;
    font-weight: 700;
}

.tg-resource-listing-copy > p {
    color: #64727c;
    line-height: 1.55;
}

.tg-resource-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.tg-resource-empty {
    padding: 1.2rem 1.3rem;
    border: 1px solid var(--tg007-line, #dbe2e7);
    border-radius: .9rem;
    background: #fff;
    box-shadow: 0 7px 20px rgba(25, 37, 46, .035);
}

.tg-resource-empty--wide {
    max-width: 920px;
    margin-inline: auto;
}

.tg-resource-empty h2,
.tg-resource-empty h3 {
    margin: 0 0 .3rem;
    color: #293740;
    font-family: "Space Grotesk", Inter, sans-serif;
    font-size: 1rem;
}

.tg-resource-empty p {
    margin: 0;
    color: #6a7780;
    font-size: .8rem;
}

.tg-resource-filter-empty {
    margin-top: .75rem;
    border-style: dashed;
    text-align: center;
}

/* ---------- Network submission ---------- */
.tg-resource-submit-grid {
    display: grid;
    grid-template-columns: minmax(250px, .7fr) minmax(0, 1.3fr);
    gap: clamp(1.5rem, 4vw, 3.25rem);
    align-items: start;
}

.tg-resource-submit-intro {
    position: sticky;
    top: 1.25rem;
}

.tg-resource-submit-intro h2 {
    font-size: clamp(1.45rem, 2.6vw, 1.9rem);
}

.tg-resource-submit-intro p,
.tg-resource-submit-intro li {
    font-size: .82rem;
}

.tg-resource-submit-intro ul {
    margin: .85rem 0 0;
    padding-left: 1.05rem;
}

.tg-resource-submit-intro li + li {
    margin-top: .35rem;
}

.tg-resource-submit-intro a {
    color: #286d9c !important;
    font-weight: 800;
    text-decoration: none;
}

.tg-resource-form-panel {
    overflow: hidden;
    border: 1px solid #d5dee4;
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 10px 30px rgba(26, 36, 44, .055);
}

.tg-resource-form {
    display: grid;
    gap: .85rem;
    padding: 1.15rem;
}

.tg-resource-form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .8rem;
}

.tg-resource-field {
    display: grid;
    gap: .34rem;
}

.tg-resource-field label {
    color: #354550;
    font-size: .69rem;
    font-weight: 850;
    letter-spacing: .025em;
    text-transform: uppercase;
}

.tg-resource-field input,
.tg-resource-field textarea {
    width: 100%;
    border: 1px solid #cdd7de;
    border-radius: .68rem;
    outline: 0;
    color: #293740;
    background: #fbfcfc;
    font: inherit;
    font-size: .83rem;
}

.tg-resource-field input {
    min-height: 42px;
    padding: .65rem .75rem;
}

.tg-resource-field textarea {
    min-height: 132px;
    padding: .7rem .75rem;
    resize: vertical;
    line-height: 1.5;
}

.tg-resource-field input:focus,
.tg-resource-field textarea:focus {
    border-color: #6f9dbb;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(61, 126, 173, .12);
}

.tg-resource-field input[readonly] {
    color: #67747d;
    background: #f0f3f5;
}

.tg-resource-submit-button {
    width: 100%;
    justify-content: center;
    margin-top: .1rem;
}

.tg-resource-submit-button[disabled] {
    opacity: .65;
    cursor: wait;
}

.tg-resource-notice {
    display: grid;
    gap: .15rem;
    margin: 1rem 1rem 0;
    padding: .75rem .85rem;
    border: 1px solid #cadde9;
    border-radius: .7rem;
    color: #2e536a;
    background: #edf5fa;
    font-size: .78rem;
}

.tg-resource-notice--success {
    border-color: #c8dfd0;
    color: #315b41;
    background: #eef7f1;
}

.tg-resource-notice--error {
    border-color: #e5c9c9;
    color: #7a3c3c;
    background: #fbefef;
}

.tg-resource-captcha {
    min-height: 78px;
    overflow-x: auto;
}

/* ---------- Reading / mIRC archive ---------- */
.tg-resource-reading-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(250px, .65fr);
    gap: 1.25rem;
    align-items: start;
}

.tg-resource-reading-copy,
.tg-resource-callout,
.tg-resource-side-card {
    border: 1px solid var(--tg007-line, #dbe2e7);
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 8px 24px rgba(26, 36, 44, .04);
}

.tg-resource-reading-copy {
    padding: 1.25rem 1.35rem;
}

.tg-resource-reading-copy h2 {
    font-size: clamp(1.45rem, 2.6vw, 1.9rem);
}

.tg-resource-reading-copy p {
    margin: .6rem 0 0;
    font-size: .83rem;
}

.tg-resource-callout,
.tg-resource-side-card {
    padding: 1.1rem 1.15rem;
}

.tg-resource-callout {
    border-top: 3px solid #4d83a6;
}

.tg-resource-callout strong,
.tg-resource-side-card h3 {
    display: block;
    margin: 0 0 .35rem;
    color: #2b4658;
    font-family: "Space Grotesk", Inter, sans-serif;
    font-weight: 800;
}

.tg-resource-callout p,
.tg-resource-side-card p {
    margin: 0;
    color: #64727c;
    font-size: .78rem;
    line-height: 1.55;
}

.tg-version-table-wrap {
    overflow: hidden;
    border: 1px solid #d5dee4;
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 8px 24px rgba(26, 36, 44, .04);
}

.tg-version-table {
    width: 100%;
    border-collapse: collapse;
}

.tg-version-table th,
.tg-version-table td {
    padding: .72rem .9rem;
    border-bottom: 1px solid #e5eaed;
    text-align: left;
    vertical-align: middle;
}

.tg-version-table th {
    color: #5e6d77;
    background: #f3f6f8;
    font-size: .66rem;
    font-weight: 850;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.tg-version-table td {
    color: #5d6a73;
    font-size: .78rem;
}

.tg-version-table td strong {
    color: #2c3a43;
}

.tg-version-table tbody tr:last-child td {
    border-bottom: 0;
}

.tg-version-table tbody tr:hover {
    background: #fafbfc;
}

.tg-version-table tr[hidden] {
    display: none !important;
}

.tg-resource-download,
.tg-resource-text-link {
    color: #286d9c !important;
    font-weight: 800;
    text-decoration: none;
}

.tg-resource-download:hover,
.tg-resource-download:focus-visible,
.tg-resource-text-link:hover,
.tg-resource-text-link:focus-visible {
    text-decoration: underline;
}

.tg-resource-unavailable {
    color: #8a949b;
    font-size: .74rem;
}

/* ---------- Videos ---------- */
.tg-video-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 270px;
    gap: 1rem;
    align-items: start;
}

.tg-video-frame {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    border: 1px solid #cbd5dc;
    border-radius: 1rem;
    background: #111a21;
    box-shadow: 0 14px 34px rgba(20, 31, 39, .14);
}

.tg-video-frame iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.tg-video-frame iframe[hidden] {
    display: none;
}

.tg-video-consent {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 520px);
    place-content: center;
    gap: 1rem;
    padding: clamp(1rem, 4vw, 2.25rem);
    color: #f5f8fa;
    background:
        radial-gradient(circle at 25% 25%, rgba(64, 126, 169, .24), transparent 32%),
        linear-gradient(145deg, rgba(30, 44, 55, .98), rgba(14, 23, 30, .99));
}

.tg-video-consent[hidden] {
    display: none;
}

.tg-video-consent .tg-kicker {
    color: #86b9da;
}

.tg-video-consent h3 {
    margin: .2rem 0 .35rem;
    color: #fff;
    font-family: "Space Grotesk", Inter, sans-serif;
    font-size: clamp(1.2rem, 2.5vw, 1.65rem);
}

.tg-video-consent p {
    margin: 0 0 .8rem;
    color: #c5d0d7;
    font-size: .8rem;
}

.tg-video-consent-mark {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 50%;
    color: #fff;
    background: rgba(61, 126, 173, .28);
    font-size: 1.1rem;
}

.tg-resource-side-card .tg-kicker {
    display: block;
    margin-bottom: .25rem;
}

.tg-resource-side-card h3 {
    font-size: 1rem;
}

.tg-resource-side-card .tg-resource-text-link {
    display: inline-block;
    margin-top: .75rem;
    font-size: .75rem;
}

/* ---------- IRC raw/reference pages ---------- */
.tg-resource-reference-layout {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}

.tg-resource-reference-nav {
    position: sticky;
    top: 1rem;
    padding: .9rem;
    border: 1px solid #d8e0e5;
    border-radius: .9rem;
    background: #fff;
    box-shadow: 0 7px 20px rgba(25, 37, 46, .035);
}

.tg-resource-reference-nav nav {
    display: grid;
    gap: .15rem;
    margin-top: .45rem;
}

.tg-resource-reference-nav a {
    padding: .42rem .5rem;
    border-radius: .5rem;
    color: #566773 !important;
    font-size: .74rem;
    font-weight: 750;
    text-decoration: none;
}

.tg-resource-reference-nav a:hover,
.tg-resource-reference-nav a:focus-visible {
    color: #285f87 !important;
    background: #edf5fa;
}

.tg-resource-reference {
    min-width: 0;
    padding: 1.2rem 1.3rem;
    border: 1px solid #d8e0e5;
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 8px 24px rgba(26, 36, 44, .04);
}

.tg-resource-reference-title {
    scroll-margin-top: 1rem;
    margin: 1.5rem 0 .55rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e7ea;
    color: #2a3b47;
    font-family: "Space Grotesk", Inter, sans-serif;
    font-size: 1rem;
    font-weight: 820;
    letter-spacing: -.02em;
}

.tg-resource-reference > .tg-resource-reference-title:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.tg-resource-reference-content {
    color: #5e6c76;
    font-size: .8rem;
    line-height: 1.58;
}

.tg-resource-reference-content a {
    color: #286d9c !important;
    font-weight: 800;
}

.tg-resource-code {
    overflow-x: auto;
    margin: .7rem 0;
    padding: .68rem .78rem;
    border: 1px solid #314652;
    border-left: 4px solid #5285a6;
    border-radius: .55rem;
    color: #eaf1f5;
    background: #1d2a33;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: .76rem;
    line-height: 1.5;
    white-space: normal;
}

.tg-resource-code--syntax {
    border-left-color: #7899ad;
    background: #25343e;
}

.tg-mode-list {
    overflow: hidden;
    border: 1px solid #d9e1e6;
    border-radius: .9rem;
    background: #fff;
}

.tg-mode-row {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: .9rem;
    padding: .8rem .9rem;
    border-bottom: 1px solid #e4e9ec;
}

.tg-mode-row:last-child {
    border-bottom: 0;
}

.tg-mode-row code {
    align-self: start;
    padding: .3rem .45rem;
    border: 1px solid #c5d4dd;
    border-radius: .4rem;
    color: #245d83;
    background: #edf4f8;
    font-size: .88rem;
    font-weight: 850;
    text-align: center;
}

.tg-mode-row p {
    margin: 0;
    color: #5b6973;
    font-size: .79rem;
    line-height: 1.55;
}

@media (max-width: 1040px) {
    .tg-resource-card-grid {
        grid-template-columns: 1fr;
    }

    .tg-video-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .tg-resource-submit-grid,
    .tg-resource-reading-grid,
    .tg-resource-reference-layout {
        grid-template-columns: 1fr;
    }

    .tg-resource-submit-intro,
    .tg-resource-reference-nav {
        position: static;
    }

    .tg-resource-reference-nav nav {
        display: flex;
        flex-wrap: wrap;
        gap: .2rem;
    }
}

@media (max-width: 720px) {
    .tg-resource-section-head {
        align-items: stretch;
        flex-direction: column;
    }

    .tg-resource-filter {
        width: 100%;
        flex-basis: auto;
    }

    .tg-resource-card {
        grid-template-columns: 112px minmax(0, 1fr);
    }

    .tg-resource-card-media {
        min-height: 136px;
        padding: .65rem;
    }

    .tg-resource-form-row {
        grid-template-columns: 1fr;
    }

    .tg-video-consent {
        grid-template-columns: 1fr;
        align-content: center;
    }

    .tg-video-consent-mark {
        width: 44px;
        height: 44px;
    }

    .tg-version-table-wrap {
        overflow: visible;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    .tg-version-table,
    .tg-version-table tbody,
    .tg-version-table tr,
    .tg-version-table td {
        display: block;
        width: 100%;
    }

    .tg-version-table thead {
        display: none;
    }

    .tg-version-table tbody {
        display: grid;
        gap: .65rem;
    }

    .tg-version-table tr {
        padding: .72rem .8rem;
        border: 1px solid #d8e0e5;
        border-radius: .8rem;
        background: #fff;
        box-shadow: 0 6px 18px rgba(26, 36, 44, .035);
    }

    .tg-version-table td {
        display: grid;
        grid-template-columns: 92px minmax(0, 1fr);
        gap: .55rem;
        padding: .3rem 0;
        border: 0;
    }

    .tg-version-table td::before {
        color: #7b8790;
        content: attr(data-label);
        font-size: .64rem;
        font-weight: 850;
        letter-spacing: .025em;
        text-transform: uppercase;
    }
}

@media (max-width: 520px) {
    .tg-resource-nav-inner {
        padding-block: .32rem;
    }

    .tg-resource-nav a {
        padding: .48rem .62rem;
    }

    .tg-resource-card {
        grid-template-columns: 1fr;
    }

    .tg-resource-card-media {
        min-height: 112px;
        border-right: 0;
        border-bottom: 1px solid #e0e6ea;
    }

    .tg-resource-card-media img,
    .tg-resource-media-placeholder {
        max-width: 160px;
    }

    .tg-resource-card-body {
        padding: .9rem;
    }

    .tg-resource-reference,
    .tg-resource-reading-copy,
    .tg-resource-callout,
    .tg-resource-side-card {
        padding: 1rem;
    }

    .tg-mode-row {
        grid-template-columns: 58px minmax(0, 1fr);
        gap: .65rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tg-resource-card {
        transition: none;
    }
}
