/* ─── TOOLKIT LIBRARY (Elite Dark Theme) ─── */

:root {
    --tk-bg: #0b0b0b;
    --tk-gold: #b8943f;
    --tk-gold-dim: rgba(184, 148, 63, 0.3);
    --tk-border: rgba(255, 255, 255, 0.08);
    --tk-card-bg: rgba(255, 255, 255, 0.02);
    --tk-text: #fff;
    --tk-text-muted: #aaa;
}

/* ─── LAYOUT ─── */
.tk-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 4rem;
}

.tk-section-home {
    padding: 6rem 0;
    position: relative;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* ─── PREMIUM HERO SECTION ─── */
.tk-hero {
    padding: 5rem 0 4rem;
    position: relative;
    overflow: hidden;
    text-align: center;
    background: #0a0a0a;
}

.tk-hero::before {
    content: '';
    position: absolute;
    top: -20%;
    left: -10%;
    width: 60%;
    height: 140%;
    background: radial-gradient(circle at 0% 50%, rgba(184, 148, 63, 0.12) 0%, transparent 70%);
    pointer-events: none;
    z-index: 1;
}

.tk-hero .tk-container {
    position: relative;
    z-index: 2;
}

.tk-hero-content {
    max-width: 900px;
    margin: 0 auto;
    animation: tk-fade-up 1s ease-out;
}

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

.tk-hero-eyebrow {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--tk-gold);
    border: 1px solid rgba(184, 148, 63, 0.2);
    display: inline-block;
    padding: 0.4rem 1.5rem;
    margin-bottom: 2rem;
    font-weight: 700;
    background: rgba(184, 148, 63, 0.03);
}

.tk-hero-title {
    font-family: 'Playfair Display', serif;
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    color: #fff;
    margin-bottom: 2rem;
    letter-spacing: -1px;
}

.tk-hero-title em {
    color: var(--tk-gold);
    font-style: italic;
}

.tk-hero-subtitle {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--tk-text-muted);
    max-width: 700px;
    margin: 0 auto;
    font-weight: 300;
}

.tk-library-page {
    background: #000;
    color: var(--tk-text);
    padding: 2rem 0 8rem;
    position: relative;
}

/* ─── SEARCH & FILTERS ─── */
.tk-filters {
    margin-bottom: 4rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
}

.tk-filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: center;
}

.tk-filter-search {
    flex-grow: 1;
    display: flex;
    gap: 0.5rem;
    min-width: 300px;
}

.tk-filter-search input {
    flex-grow: 1;
    background: #111;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.8rem 1.2rem;
    color: #fff;
    font-size: 0.95rem;
    transition: 0.3s;
}

.tk-filter-search input:focus {
    outline: none;
    border-color: var(--tk-gold);
    box-shadow: 0 0 10px rgba(184, 148, 63, 0.2);
}

.tk-filter-search button {
    background: var(--tk-gold);
    color: #000;
    border: none;
    border-radius: 8px;
    padding: 0.8rem 1.5rem;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
    cursor: pointer;
    transition: 0.3s;
}

.tk-filter-search button:hover {
    background: #fff;
    transform: translateY(-2px);
}

.tk-filter-pillar select {
    background: #111;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.8rem 2.5rem 0.8rem 1.2rem;
    color: #fff;
    font-size: 0.95rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23b8943f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    transition: 0.3s;
    min-width: 200px;
}

.tk-filter-pillar select:focus {
    outline: none;
    border-color: var(--tk-gold);
}

.tk-filter-reset {
    font-size: 0.8rem;
    color: var(--tk-text-muted);
    text-decoration: none;
    transition: 0.3s;
    border-bottom: 1px solid transparent;
}

.tk-filter-reset:hover {
    color: var(--tk-gold);
    border-color: var(--tk-gold);
}

@media (max-width: 768px) {
    .tk-filter-search { width: 100%; min-width: 0; }
    .tk-filter-pillar { width: 100%; }
    .tk-filter-pillar select { width: 100%; }
}

/* ─── TOOLKIT GRID ─── */
.tk-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
}

@media (max-width: 1024px) {
    .tk-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .tk-grid { grid-template-columns: 1fr; }
}

.tk-card {
    background: #111;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    padding: 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.tk-card:hover {
    transform: translateY(-8px);
    border-color: rgba(184, 148, 63, 0.3);
    background: #161616;
    box-shadow: 
        0 30px 60px rgba(0, 0, 0, 0.7),
        inset 0 0 40px rgba(184, 148, 63, 0.05);
}

.tk-icon-box {
    width: 42px;
    height: 42px;
    background: rgba(184, 148, 63, 0.05);
    border: 1px solid rgba(184, 148, 63, 0.3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    margin-bottom: 1.75rem;
    color: var(--tk-gold);
    transition: 0.4s;
}

.tk-card:hover .tk-icon-box {
    background: var(--tk-gold);
    color: #000;
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(184, 148, 63, 0.3);
}

.tk-card h2,
.tk-card h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.55rem;
    margin-bottom: 1.25rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
}

.tk-card .tk-description {
    font-size: 0.95rem;
    color: var(--tk-text-muted);
    line-height: 1.6;
    margin-bottom: 2.5rem;
    flex-grow: 1;
}

.tk-btn-download {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: #fff;
    text-transform: uppercase;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 2px;
    text-decoration: none;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    transition: 0.3s;
}

.tk-btn-download:hover {
    color: var(--tk-gold);
    gap: 1rem;
}

/* ─── EMPTY STATE ─── */
.tk-empty {
    text-align: center;
    padding: 5rem 0;
    color: var(--tk-text-muted);
    grid-column: 1 / -1;
}

.tk-empty h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    color: #f5f0ea;
    margin: 0 0 0.5rem;
}

.tk-empty p {
    font-family: 'Libre Franklin', sans-serif;
    font-size: 0.92rem;
    color: rgba(153, 153, 153, 0.95);
    margin: 0 0 1.25rem;
}

.tk-empty-link {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.62rem;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--tk-gold);
    text-decoration: none;
}

.tk-empty-link:hover {
    color: #d4bc6e;
}

/* ─── LIBRARY PAGE (Professional Layout) ─── */
.tk-page {
    background: #0a0a0a;
    color: #e0e0e0;
    font-family: 'Libre Franklin', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.tk-breadcrumb {
    padding: 1.5rem 4rem;
    font-size: 0.72rem;
    color: #999;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.tk-breadcrumb-inner {
    max-width: 1240px;
    margin: 0 auto;
}

.tk-breadcrumb a {
    color: #999;
    text-decoration: none;
}

.tk-breadcrumb a:hover {
    color: var(--tk-gold);
}

.tk-breadcrumb .sep {
    margin: 0 0.6rem;
    opacity: 0.5;
}

.tk-hero--library {
    text-align: left;
    padding: 4.5rem 0 3rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.tk-hero--library::before {
    background: radial-gradient(circle at 10% 20%, rgba(184, 148, 63, 0.05), transparent 45%);
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.tk-hero-layout {
    margin-bottom: 2.75rem;
}

.tk-hero-copy {
    max-width: 720px;
}

.tk-hero--library .tk-hero-eyebrow {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.68rem;
    letter-spacing: 2.2px;
    text-transform: uppercase;
    color: var(--tk-gold);
    font-weight: 500;
    border: none;
    background: none;
    padding: 0;
    margin: 0 0 0.85rem;
    display: block;
}

.tk-hero--library .tk-hero-title {
    font-size: clamp(2.25rem, 4.5vw, 3.5rem);
    font-weight: 700;
    margin: 0 0 1rem;
    letter-spacing: -0.02em;
}

.tk-hero--library .tk-hero-subtitle {
    font-size: 1rem;
    font-weight: 300;
    line-height: 1.65;
    color: rgba(153, 153, 153, 0.95);
    max-width: 620px;
    margin: 0;
    text-align: left;
}

.tk-search-section {
    padding: 0 0 2.5rem;
}

.tk-search-section .tk-container {
    max-width: 760px;
}

.tk-search-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}

.tk-search-unified {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    min-height: 52px;
    padding: 0.35rem 0.35rem 0.35rem 1.1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(184, 148, 63, 0.22);
    border-radius: 999px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.tk-search-unified:focus-within {
    border-color: var(--tk-gold);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 0 0 4px rgba(184, 148, 63, 0.12);
}

.tk-search-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    stroke: rgba(184, 148, 63, 0.75);
}

.tk-search-unified input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    padding: 0.65rem 0;
    font-family: 'Libre Franklin', sans-serif;
    font-size: 0.95rem;
    color: #fff;
}

.tk-search-unified input::placeholder {
    color: rgba(255, 255, 255, 0.42);
}

.tk-search-unified input:focus {
    outline: none;
}

.tk-search-submit {
    flex-shrink: 0;
    height: 42px;
    padding: 0 1.35rem;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #0b0b0b;
    background: linear-gradient(135deg, #dfbf78 0%, #b8943f 55%, #9a7a32 100%);
    border: none;
    border-radius: 999px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.tk-search-submit:hover {
    filter: brightness(1.06);
    box-shadow: 0 4px 16px rgba(184, 148, 63, 0.28);
    transform: translateY(-1px);
}

.tk-search-reset {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    transition: color 0.2s ease;
}

.tk-search-reset:hover {
    color: var(--tk-gold);
}

/* Visually hidden labels (CFO layout does not load core WP utility). */
.tk-page .screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    white-space: nowrap;
}

.tk-library-page {
    background: #0a0a0a;
    padding: 3.5rem 0 8rem;
}

.tk-section-head {
    margin-bottom: 2.75rem;
    max-width: 720px;
}

.tk-section-eyebrow {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.68rem;
    letter-spacing: 2.2px;
    text-transform: uppercase;
    color: var(--tk-gold);
    margin: 0 0 0.75rem;
    font-weight: 500;
}

.tk-section-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.75rem, 3vw, 2.35rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    color: #f5f0ea;
    margin: 0 0 0.65rem;
    line-height: 1.2;
}

.tk-section-sub {
    font-family: 'Libre Franklin', sans-serif;
    font-size: 0.95rem;
    font-weight: 300;
    line-height: 1.65;
    color: rgba(153, 153, 153, 0.95);
    margin: 0;
}

.tk-library-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.75rem;
    min-height: 120px;
}

.tk-library-grid:empty {
    min-height: 0;
}

.tk-library-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(184, 148, 63, 0.14);
    border-radius: 14px;
    overflow: hidden;
    transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

a.tk-library-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
    border-color: rgba(184, 148, 63, 0.35);
}

.tk-library-card.is-unavailable {
    opacity: 0.72;
}

.tk-library-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.35rem 1.5rem 0;
    gap: 1rem;
}

.tk-library-icon {
    width: 44px;
    height: 44px;
    background: rgba(184, 148, 63, 0.06);
    border: 1px solid rgba(184, 148, 63, 0.22);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    color: var(--tk-gold);
    transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

a.tk-library-card:hover .tk-library-icon {
    background: rgba(184, 148, 63, 0.14);
    border-color: rgba(184, 148, 63, 0.35);
}

.tk-library-badge {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.58rem;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #fff;
    background: rgba(184, 148, 63, 0.9);
    padding: 0.35rem 0.65rem;
    border-radius: 4px;
}

.tk-library-badge--soon {
    color: #999;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.tk-library-card-body {
    padding: 1.15rem 1.5rem 1.45rem;
    display: flex;
    flex-direction: column;
}

.tk-library-card-body h2 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.15rem, 1.8vw, 1.35rem);
    font-weight: 600;
    color: #f5f0ea;
    line-height: 1.3;
    margin: 0 0 0.75rem;
    letter-spacing: -0.01em;
    transition: color 0.25s ease;
}

a.tk-library-card:hover .tk-library-card-body h2 {
    color: #d4bc6e;
}

.tk-library-description {
    font-family: 'Libre Franklin', sans-serif;
    font-size: 0.9rem;
    font-weight: 300;
    line-height: 1.65;
    color: rgba(153, 153, 153, 0.95);
}

.tk-library-description p {
    margin: 0;
}

.tk-library-card-footer {
    margin-top: 1.15rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.tk-library-action {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.62rem;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--tk-gold);
    transition: color 0.2s ease;
}

a.tk-library-card:hover .tk-library-action {
    color: #d4bc6e;
}

.tk-library-action--muted {
    color: #777;
}

@media (max-width: 991px) {
    .tk-breadcrumb,
    .tk-container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    .tk-library-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .tk-hero--library {
        padding: 3.5rem 0 2.5rem;
    }

    .tk-search-unified {
        flex-wrap: wrap;
        border-radius: 16px;
        padding: 0.75rem;
        gap: 0.65rem;
    }

    .tk-search-unified input {
        width: 100%;
        padding: 0.35rem 0;
    }

    .tk-search-submit {
        width: 100%;
        height: 44px;
    }
}
