/*
 * Free-Tools Chassis — geteilt von /tools und /tools/{slug}
 */

body.tools-page .shell {
    gap: 48px;
    max-width: 1120px;
}

/* —— Hero —— */
.tool-hero {
    padding-top: clamp(8px, 2vw, 24px);
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 52rem;
}

.tool-hero h1 {
    margin: 0;
    font-size: clamp(1.65rem, 4.2vw, 2.35rem);
    line-height: 1.12;
    letter-spacing: -0.02em;
}

.tool-hero__sub {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.55;
    color: var(--text-secondary);
}

.tool-hero__trust {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted, var(--text-secondary));
}

/* —— Two-column tool layout (form + sticky result) —— */
.tool-layout {
    display: grid;
    gap: 1.25rem;
    align-items: start;
}

@media (min-width: 900px) {
    .tool-layout {
        grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
        gap: 1.75rem;
    }

    .tool-result {
        position: sticky;
        top: 1rem;
    }
}

/* —— Explain —— */
.tool-explain {
    max-width: 48rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tool-explain h2 {
    margin: 0 0 0.35rem;
    font-size: clamp(1.35rem, 3vw, 1.7rem);
}

.tool-explain h3 {
    margin: 0.85rem 0 0;
    font-size: 1.05rem;
}

.tool-explain p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.65;
}

.tool-explain a {
    color: var(--text-primary);
}

.tool-faq .aud-faq__list {
    margin-top: 0.75rem;
}

/* —— More tools / index cards —— */
.tool-more__head,
.tools-index__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem 1.25rem;
    margin-bottom: 1rem;
}

.tool-more__head h2,
.tools-index__head h1 {
    margin: 0;
}

.tool-more__all {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-underline-offset: 2px;
}

.tool-more__grid,
.tools-index__grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .tool-more__grid,
    .tools-index__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 960px) {
    .tool-more__grid,
    .tools-index__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.tool-card {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 1.15rem 1.2rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    text-decoration: none;
    color: inherit;
    min-height: 100%;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tool-card:hover,
.tool-card:focus-visible {
    border-color: var(--text-primary);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
    outline: none;
}

.tool-card__icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 10px;
    background: var(--bg-muted, rgba(0, 0, 0, 0.05));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.25rem;
}

.tool-card__icon::before {
    content: "";
    width: 1rem;
    height: 1rem;
    border: 2px solid var(--text-primary);
    border-radius: 3px;
    opacity: 0.75;
}

.tool-card__icon[data-icon="calc"]::before {
    border-radius: 2px;
    box-shadow: inset 0 -0.35rem 0 0 var(--text-primary);
}

.tool-card__title {
    font-weight: 650;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
}

.tool-card__blurb {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-secondary);
    flex: 1;
}

.tool-card__badge {
    margin-top: 0.35rem;
    font-size: 0.75rem;
    color: var(--text-muted, var(--text-secondary));
    letter-spacing: 0.02em;
}

.tools-index__intro {
    margin: 0 0 1.5rem;
    max-width: 40rem;
    color: var(--text-secondary);
    line-height: 1.55;
    font-size: 1.05rem;
}

/* —— LeadGate modal —— */
.tool-leadgate {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

@media (min-width: 640px) {
    .tool-leadgate {
        align-items: center;
    }
}

.tool-leadgate[hidden] {
    display: none !important;
}

.tool-leadgate__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
}

.tool-leadgate__panel {
    position: relative;
    z-index: 1;
    width: min(100%, 420px);
    margin: 0;
    padding: 1.35rem 1.25rem 1.5rem;
    border-radius: 16px 16px 0 0;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 -12px 40px rgba(15, 23, 42, 0.18);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

@media (min-width: 640px) {
    .tool-leadgate__panel {
        border-radius: 16px;
        box-shadow: 0 18px 48px rgba(15, 23, 42, 0.2);
    }
}

.tool-leadgate__panel h2 {
    margin: 0 1.5rem 0 0;
    font-size: 1.2rem;
}

.tool-leadgate__lead {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.tool-leadgate__x {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    width: 40px;
    height: 40px;
    border: 0;
    background: transparent;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-secondary);
}

.tool-leadgate__form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tool-leadgate__field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.88rem;
}

.tool-leadgate__field input {
    min-height: 44px;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-app, var(--surface));
    color: var(--text-primary);
    font: inherit;
}

.tool-leadgate__check {
    display: flex;
    gap: 0.55rem;
    align-items: flex-start;
    font-size: 0.82rem;
    line-height: 1.45;
    color: var(--text-secondary);
    cursor: pointer;
}

.tool-leadgate__check input {
    margin-top: 0.2rem;
    flex-shrink: 0;
}

.tool-leadgate__hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.tool-leadgate__err {
    margin: 0;
    font-size: 0.85rem;
    color: #b91c1c;
}

.tool-leadgate__ok {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.5;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
