/* ============================================================
   TOOLS HUB — HEALTHY KNOTS
   Fresh clean stylesheet
   ============================================================ */

/* ---------- Foundation ---------- */

.hk-tools-hub {
    background: #fbfefc;
}

.hk-tools-container {
    width: min(1200px, calc(100% - 40px));
    margin: 0 auto;
}

.hk-tools-hero,
.hk-tools-topics,
.hk-tools-library,
.hk-tools-soon,
.hk-tools-support {
    padding: clamp(60px, 8vw, 96px) 0;
}

.hk-tools-section-head {
    max-width: 760px;
    margin: 0 auto 46px;
    text-align: center;
}

.hk-tools-kicker,
.hk-tools-section-head > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 8px 14px;
    border-radius: 999px;

    background: #f0fdf4;
    border: 1px solid #bbf7d0;

    color: #166534;

    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hk-tools-section-head h2,
.hk-tools-hero h1 {
    color: #0f172a;
    letter-spacing: -0.055em;
}

.hk-tools-section-head h2 {
    margin: 18px 0 12px;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.08;
}

.hk-tools-section-head p {
    max-width: 680px;
    margin: 0 auto;
    color: #64748b;
    font-size: 1rem;
    line-height: 1.8;
}

/* ---------- Hero ---------- */

.hk-tools-hero {
    text-align: center;
    background:
        radial-gradient(circle at 50% 0%, rgba(187, 247, 208, 0.38), transparent 34%),
        linear-gradient(180deg, #f7fffa 0%, #ffffff 100%);
}

.hk-tools-hero h1 {
    max-width: 860px;
    margin: 18px auto 14px;
    font-size: clamp(2.7rem, 7vw, 5rem);
    line-height: 0.98;
}

.hk-tools-hero p {
    max-width: 760px;
    margin: 0 auto;
    color: #52645c;
    font-size: 1.08rem;
    line-height: 1.8;
}

.hk-tools-trust-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;

    margin-top: 28px;
}

.hk-tools-trust-row span {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 14px;

    border-radius: 999px;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);

    color: #315448;
    font-size: 0.84rem;
    font-weight: 900;

    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.04);
}

/* ---------- Topic Cards ---------- */

.hk-tools-topics {
    background: linear-gradient(180deg, #ffffff 0%, #f8fffb 100%);
}

.hk-topic-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.hk-topic-card {
    min-height: 180px;
    padding: 24px;

    border: 1px solid rgba(15, 23, 42, 0.07);
    border-radius: 28px;

    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.05);

    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;

    text-align: left;
    cursor: pointer;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease,
        background 0.2s ease;
}

.hk-topic-card:hover,
.hk-topic-card:focus-visible,
.hk-topic-card.is-active {
    transform: translateY(-3px);
    border-color: rgba(22, 101, 52, 0.28);
    background: #f0fdf4;
    box-shadow: 0 24px 60px rgba(22, 101, 52, 0.10);
    outline: none;
}

.hk-topic-card > span {
    width: 46px;
    height: 46px;

    display: grid;
    place-items: center;

    border-radius: 16px;
    background: #f0fdf4;

    font-size: 1.35rem;
}

.hk-topic-card strong {
    color: #0f172a;
    font-size: 1.08rem;
    line-height: 1.25;
    font-weight: 900;
}

.hk-topic-card small {
    color: #64748b;
    font-size: 0.92rem;
    line-height: 1.65;
}

.hk-topic-card-wide {
    grid-column: span 3;
    min-height: 130px;
}

/* ---------- Advanced Filter Panel ---------- */

.hk-tools-filter-panel {
    max-width: 980px;
    margin: 0 auto 42px;
    padding: 24px;

    border-radius: 28px;
    border: 1px solid rgba(15, 23, 42, 0.07);

    background: #ffffff;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.05);

    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 16px;
    align-items: end;
}

.hk-tools-filter-panel label {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hk-tools-filter-panel label > span {
    color: #475569;
    font-size: 0.82rem;
    font-weight: 900;
}

.hk-tools-filter-panel input,
.hk-tools-filter-panel select {
    width: 100%;
    min-height: 48px;
    padding: 0 14px;

    border-radius: 15px;
    border: 1px solid #dbe4ea;

    background: #ffffff;
    color: #0f172a;

    font-size: 0.94rem;
    font-weight: 700;
}

.hk-tools-filter-panel input:focus,
.hk-tools-filter-panel select:focus {
    outline: none;
    border-color: #16a34a;
    box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.10);
}

/* ---------- Tool Cards ---------- */

.hk-tools-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}
@media (max-width: 900px) {
    .hk-tools-grid {
        grid-template-columns: 1fr;
    }
}

.hk-tool-card {
    padding: clamp(24px, 4vw, 34px);

    border-radius: 30px;
    border: 1px solid rgba(15, 23, 42, 0.07);

    background: #ffffff;
    box-shadow: 0 20px 54px rgba(15, 23, 42, 0.06);

    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hk-tool-card-top,
.hk-tool-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hk-tool-type,
.hk-tool-time,
.hk-tool-meta span {
    display: inline-flex;
    align-items: center;

    min-height: 30px;
    padding: 0 12px;

    border-radius: 999px;

    background: #f0fdf4;
    border: 1px solid #bbf7d0;

    color: #166534;

    font-size: 0.78rem;
    font-weight: 900;
}

.hk-tool-card h3 {
    margin: 0;

    color: #020617;

    font-size: clamp(1.45rem, 3vw, 2rem);
    line-height: 1.14;
    letter-spacing: -0.045em;
}

.hk-tool-official-name {
    color: #64748b;
    font-size: 0.92rem;
    font-weight: 800;
}

.hk-tool-card p {
    margin: 0;

    color: #475569;

    font-size: 1rem;
    line-height: 1.75;
}

.hk-tool-card-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: fit-content;
    min-height: 46px;
    padding: 0 18px;

    margin-top: auto;

    border-radius: 999px;

    background: #166534;
    color: #ffffff !important;

    text-decoration: none;
    font-weight: 900;

    box-shadow: 0 14px 30px rgba(22, 101, 52, 0.16);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.hk-tool-card-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 36px rgba(22, 101, 52, 0.20);
}

/* ---------- Empty State ---------- */

.hk-tools-empty {
    grid-column: 1 / -1;

    display: grid;
    gap: 10px;

    padding: 22px;

    border-radius: 24px;

    background: #fffbeb;
    border: 1px solid #fde68a;

    color: #78350f;

    text-align: center;
    line-height: 1.6;
}

.hk-tools-empty strong {
    font-size: 1rem;
    font-weight: 900;
}

.hk-tools-empty span {
    max-width: 620px;
    margin: 0 auto;

    font-size: 0.95rem;
    font-weight: 700;
}

/* ---------- Coming Soon ---------- */

.hk-tools-soon {
    background: #f8fafc;
}

.hk-tools-grid-muted .hk-tool-card {
    background: rgba(255, 255, 255, 0.76);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.04);
}

.hk-tool-card-soon {
    opacity: 0.86;
}

.hk-tool-soon-label {
    display: inline-flex;
    width: fit-content;

    padding: 8px 12px;

    border-radius: 999px;

    background: #f8fafc;
    border: 1px solid #e2e8f0;

    color: #64748b;

    font-size: 0.82rem;
    font-weight: 900;
}

/* ---------- Support CTA ---------- */

.hk-tools-support-card {
    max-width: 980px;
    margin: 0 auto;

    padding: clamp(34px, 6vw, 64px);

    border-radius: 36px;

    background:
        radial-gradient(circle at top right, rgba(187, 247, 208, 0.5), transparent 34%),
        linear-gradient(135deg, #052e16, #14532d);

    color: #ffffff;
    text-align: center;

    box-shadow: 0 26px 70px rgba(20, 83, 45, 0.22);
}

.hk-tools-support-card > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 32px;
    padding: 0 14px;

    border-radius: 999px;

    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.14);

    color: #dcfce7;

    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.hk-tools-support-card h2 {
    max-width: 760px;
    margin: 18px auto;

    color: #ffffff;

    font-size: clamp(2rem, 5vw, 3.6rem);
    line-height: 1.05;
    letter-spacing: -0.06em;
}

.hk-tools-support-card p {
    max-width: 640px;
    margin: 0 auto;

    color: rgba(255, 255, 255, 0.76);

    font-size: 1.05rem;
    line-height: 1.75;
}

.hk-tools-support-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;

    margin-top: 28px;
}

.hk-tools-support-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 48px;
    padding: 0 20px;

    border-radius: 999px;

    background: #ffffff;
    color: #14532d;

    text-decoration: none;
    font-weight: 900;
}

.hk-tools-support-actions a:last-child {
    background: rgba(255,255,255,0.12);
    color: #ffffff;

    border: 1px solid rgba(255,255,255,0.18);
}

/* ---------- Responsive ---------- */

@media (max-width: 980px) {
    .hk-topic-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hk-topic-card-wide {
        grid-column: span 2;
    }

    .hk-tools-filter-panel {
        grid-template-columns: 1fr 1fr;
    }

    .hk-tools-search {
        grid-column: 1 / -1;
    }
}

@media (max-width: 640px) {
    .hk-tools-container {
        width: min(100% - 32px, 100%);
    }

    .hk-tools-hero,
    .hk-tools-topics,
    .hk-tools-library,
    .hk-tools-soon,
    .hk-tools-support {
        padding: 52px 0;
    }

    .hk-tools-hero h1 {
        font-size: clamp(2.35rem, 12vw, 3.4rem);
    }

    .hk-topic-grid,
    .hk-tools-filter-panel {
        grid-template-columns: 1fr;
    }

    .hk-topic-card,
    .hk-topic-card-wide {
        grid-column: auto;
        min-height: auto;
        padding: 20px;
        border-radius: 22px;
    }

    .hk-tools-filter-panel {
        padding: 20px;
        border-radius: 24px;
    }

    .hk-tool-card-link,
    .hk-tools-support-actions a {
        width: 100%;
    }

    .hk-tools-support-card {
        border-radius: 28px;
        text-align: left;
    }
}
.hk-tools-filter-panel {
    margin-bottom: 56px;
}
.hk-tool-card.is-hidden,
.hk-tools-empty.is-hidden {
    display: none !important;
}
/* ============================================================
   TOOLS HUB — FINAL POLISH
   ============================================================ */

/* Reduce big gap between topic cards and featured section */
.hk-tools-topics {
    padding-bottom: clamp(38px, 5vw, 58px);
}

.hk-tools-library {
    padding-top: clamp(42px, 5vw, 64px);
}

/* Tighten Find a Tool area */
.hk-tools-find-tools {
    max-width: 980px;
    margin: 0 auto 16px;
}

.hk-tools-find-tools h3 {
    margin: 0 0 8px;
}

.hk-tools-find-tools p {
    margin: 0;
}

/* Fix desktop filter overlap */
.hk-tools-filter-panel {
    grid-template-columns: minmax(280px, 1.7fr) minmax(190px, 1fr) minmax(190px, 1fr) minmax(190px, 1fr);
    gap: 14px;
}

/* Smaller empty state */
.hk-tools-empty {
    padding: 22px;
}

/* Center mobile card buttons */
@media (max-width: 640px) {
    .hk-tool-card-link {
        width: 100%;
        text-align: center;
    }

    .hk-tool-card {
        align-items: stretch;
    }
}

/* Prevent filter squeeze on medium screens */
@media (max-width: 1100px) {
    .hk-tools-filter-panel {
        grid-template-columns: 1fr 1fr;
    }

    .hk-tools-search {
        grid-column: 1 / -1;
    }
}

@media (max-width: 640px) {
    .hk-tools-filter-panel {
        grid-template-columns: 1fr;
    }
}
/* ============================================================
   TOOLS HUB — FINAL FORM CONTROL FIXES
   ============================================================ */

/* Desktop: stop filter fields from sitting on each other */
.hk-tools-filter-panel {
    grid-template-columns:
        minmax(340px, 2fr)
        minmax(220px, 1fr)
        minmax(220px, 1fr)
        minmax(220px, 1fr);
    column-gap: 22px;
    row-gap: 16px;
}

.hk-tools-filter-panel label {
    min-width: 0;
}

.hk-tools-filter-panel input,
.hk-tools-filter-panel select {
    box-sizing: border-box;
    min-width: 0;
}

/* Mobile: button/card alignment */
@media (max-width: 640px) {
    .hk-tool-card {
        overflow: hidden;
    }

    .hk-tool-card-link {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        justify-content: center;
        align-self: center;
    }
}
/* Keep desktop filter panel inside its card */
.hk-tools-filter-panel {
    max-width: 1100px;
    grid-template-columns:
        minmax(280px, 1.6fr)
        minmax(180px, 1fr)
        minmax(180px, 1fr)
        minmax(180px, 1fr);
}

.hk-tools-filter-panel select,
.hk-tools-filter-panel input {
    max-width: 100%;
}
/* Mobile: force filter panel back to one column */
@media (max-width: 640px) {
    .hk-tools-filter-panel {
        max-width: 100%;
        width: 100%;
        grid-template-columns: 1fr !important;
        gap: 14px;
        padding: 18px;
        overflow: hidden;
    }

    .hk-tools-filter-panel label,
    .hk-tools-filter-panel input,
    .hk-tools-filter-panel select {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }
}
@media (max-width: 640px) {
    .hk-tools-find-tools {
        text-align: center;
        padding: 0 18px;
    }
}@media (max-width: 640px) {
    .hk-tools-filter-panel {
        width: calc(100% - 28px);
        margin-left: auto;
        margin-right: auto;
    }
}