/* =========================================
   T-DEV TOOLS HUB
========================================= */

.tools-page {
    width: 100%;
}

.tools-container {
    width: min(1200px, calc(100% - 40px));
    margin: 0 auto;
    padding: 32px 0 80px;
}


/* =========================================
   BREADCRUMB
========================================= */

.tools-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;

    margin-bottom: 36px;

    font-size: 14px;
    color: var(--text-muted);
}

.tools-breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
}

.tools-breadcrumb a:hover {
    color: var(--primary);
}

.tools-breadcrumb span:last-child {
    color: var(--text);
    font-weight: 600;
}


/* =========================================
   PAGE HEADER
========================================= */

.tools-page-header {
    max-width: 800px;
    margin: 0 auto 36px;

    text-align: center;
}

.tools-page-header h1 {
    margin: 0 0 14px;

    color: var(--heading);

    font-size: clamp(34px, 5vw, 52px);
    line-height: 1.1;
}

.tools-page-header p {
    margin: 0;

    color: var(--text-muted);

    font-size: 18px;
    line-height: 1.6;
}


/* =========================================
   SEARCH
========================================= */

.tools-search {
    max-width: 720px;
    margin: 0 auto 56px;
}

.tools-search input {
    width: 100%;
    min-height: 56px;

    padding: 0 18px;

    border: 1px solid var(--border);
    border-radius: var(--radius-md);

    background: var(--surface);
    color: var(--text);

    font-size: 16px;

    outline: none;

    box-shadow: var(--shadow-sm);

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.tools-search input::placeholder {
    color: var(--text-muted);
}

.tools-search input:focus {
    border-color: var(--primary);

    box-shadow:
        0 0 0 3px rgba(37, 99, 235, 0.12);
}


/* =========================================
   SECTIONS
========================================= */

.tools-section {
    margin-top: 56px;
}

.tools-section-header {
    margin-bottom: 24px;
}

.tools-section-header h2 {
    margin: 0 0 6px;

    color: var(--heading);

    font-size: 28px;
    line-height: 1.25;
}

.tools-section-header p {
    margin: 0;

    color: var(--text-muted);

    font-size: 15px;
}


/* =========================================
   CATEGORY GRID
========================================= */

.tools-category-grid {
    display: grid;

    grid-template-columns: repeat(3, 1fr);

    gap: 18px;
}


/* =========================================
   CATEGORY CARD
========================================= */

.tools-category-card {
    display: flex;
    align-items: center;

    gap: 16px;

    min-height: 108px;

    padding: 22px;

    border: 1px solid var(--border);
    border-radius: var(--radius-lg);

    background: var(--surface);

    color: var(--text);

    text-decoration: none;

    box-shadow: var(--shadow-sm);

    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.tools-category-card:hover {
    transform: translateY(-3px);

    border-color: var(--primary);

    box-shadow: var(--shadow-md);
}


/* Category Icon */

.tools-category-icon {
    width: 50px;
    height: 50px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    border-radius: var(--radius-md);

    background: var(--primary-soft);

    color: var(--primary);

    font-size: 22px;
}

.tools-category-content {
    min-width: 0;
}

.tools-category-content h3 {
    margin: 0 0 4px;

    color: var(--heading);

    font-size: 18px;
    line-height: 1.3;
}

.tools-category-content p {
    margin: 0;

    color: var(--text-muted);

    font-size: 14px;
}


/* =========================================
   TOOL GRID
========================================= */

.tools-grid {
    display: grid;

    grid-template-columns: repeat(4, 1fr);

    gap: 18px;
}


/* =========================================
   TOOL CARD
========================================= */

.tool-card {
    display: block;

    min-height: 180px;

    padding: 22px;

    border: 1px solid var(--border);
    border-radius: var(--radius-lg);

    background: var(--surface);

    color: var(--text);

    text-decoration: none;

    box-shadow: var(--shadow-sm);

    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.tool-card:hover {
    transform: translateY(-3px);

    border-color: var(--primary);

    box-shadow: var(--shadow-md);
}


/* Tool Icon */

.tool-card-icon {
    width: 46px;
    height: 46px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-bottom: 16px;

    border-radius: var(--radius-md);

    background: var(--primary-soft);

    color: var(--primary);

    font-size: 20px;
}

.tool-card h3 {
    margin: 0 0 8px;

    color: var(--heading);

    font-size: 17px;
    line-height: 1.3;
}

.tool-card p {
    margin: 0;

    color: var(--text-muted);

    font-size: 14px;
    line-height: 1.5;
}


/* =========================================
   MOBILE / TABLET
========================================= */

@media (max-width: 1000px) {

    .tools-category-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }

}


@media (max-width: 600px) {

    .tools-container {
        width: calc(100% - 24px);

        padding-top: 24px;
        padding-bottom: 60px;
    }

    .tools-breadcrumb {
        margin-bottom: 28px;

        font-size: 13px;
    }

    .tools-page-header {
        margin-bottom: 30px;
    }

    .tools-page-header h1 {
        font-size: 34px;
    }

    .tools-page-header p {
        font-size: 16px;
    }

    .tools-search {
        margin-bottom: 40px;
    }

    .tools-search input {
        min-height: 52px;
    }

    .tools-section {
        margin-top: 48px;
    }

    .tools-section-header h2 {
        font-size: 24px;
    }

    .tools-category-grid,
    .tools-grid {
        grid-template-columns: 1fr;
    }

    .tools-category-card {
        min-height: 96px;
    }

}


/* =========================================
   VERY SMALL SCREENS
========================================= */

@media (max-width: 380px) {

    .tools-container {
        width: calc(100% - 20px);
    }

    .tools-category-card,
    .tool-card {
        padding: 18px;
    }

}

/* =========================================================
   TOOLS PAGE LAYOUT SAFETY
   Ensures the archive remains centered even when WordPress
   uses the page slug instead of the page template condition.
========================================================= */
.tools-page {
    width: 100%;
    display: block;
}

.tools-container {
    width: min(1200px, calc(100% - 40px));
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 600px) {
    .tools-container {
        width: calc(100% - 24px);
    }
}
