/* ==========================================================================
   DreamTech 4U — Components used by the homepage and the tool directory.
   Depends on the tokens defined in style.css.
   ========================================================================== */

/* ---------- Breadcrumb ---------- */
.breadcrumb { padding-top: 1rem; font-size: .9rem; color: var(--muted); }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: .25rem .5rem; margin: 0; padding: 0; list-style: none; }
.breadcrumb li { display: inline-flex; align-items: center; gap: .5rem; }
.breadcrumb li + li::before { content: "›"; color: var(--muted); }
.breadcrumb a { color: var(--link); }
.breadcrumb [aria-current="page"] { color: var(--text); font-weight: 500; }

/* ---------- Page heading ---------- */
.page-head { padding: 1.25rem 0 1.5rem; }
.page-head h1 { font-size: clamp(1.6rem, 3.5vw + .5rem, 2.3rem); margin-bottom: .4rem; }
.page-head p { max-width: 62ch; margin: 0; color: var(--muted); }

/* ---------- Section header ---------- */
.section-alt { background: var(--surface-2); border-block: 1px solid var(--border); }
.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem 1rem;
    margin-bottom: 1.25rem;
}
.section-head h2 { margin: 0; }
.section-link {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-weight: 600;
    text-decoration: none;
}
.section-link:hover { text-decoration: underline; }

/* ---------- Category chip extras ---------- */
.chip-count {
    display: inline-grid;
    place-items: center;
    min-width: 1.6rem;
    height: 1.6rem;
    padding: 0 .4rem;
    font-size: .8rem;
    font-weight: 600;
    color: var(--link);
    background: var(--primary-soft);
    border-radius: 999px;
}
.chip[aria-current="true"] { border-color: var(--primary); background: var(--primary-soft); }

/* ---------- Form fields / filter bar ---------- */
.field label { display: block; margin-bottom: .3rem; font-size: .85rem; font-weight: 600; color: var(--muted); }
.field input[type="search"],
.field select {
    width: 100%;
    min-height: 46px;
    padding: .55rem .9rem;
    font: inherit;
    color: var(--text);
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
}
.field input[type="search"] { -webkit-appearance: none; appearance: none; }
.field input::placeholder { color: var(--muted); opacity: 1; }
.field input:focus, .field select:focus {
    outline: 3px solid color-mix(in srgb, var(--primary) 35%, transparent);
    border-color: var(--primary);
}

.filter-bar {
    display: grid;
    grid-template-columns: 1fr;
    gap: .85rem;
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.filter-actions { display: flex; gap: .5rem; }
.filter-actions .btn { flex: 1; }

.result-count { margin: 1.25rem 0 .75rem; font-weight: 600; color: var(--muted); }

/* ---------- Tool grid + card ---------- */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr));
    gap: 1rem;
}
.tool-card {
    display: flex;
    flex-direction: column;
    gap: .85rem;
    padding: 1.15rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.tool-card:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-2px); }
.tool-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    color: var(--link);
    background: var(--primary-soft);
    border-radius: 13px;
}
.tool-body { flex: 1; }
.tool-title { margin: 0; font-size: 1.1rem; }
.tool-en { margin: 0 0 .5rem; font-size: .8rem; color: var(--muted); }
.tool-desc { margin: 0; font-size: .95rem; color: var(--muted); }
.tool-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .6rem; }

.badge {
    display: inline-block;
    padding: .15rem .65rem;
    font-size: .78rem;
    font-weight: 600;
    color: var(--muted);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
}

.btn-sm { min-height: 40px; padding: .4rem .95rem; font-size: .92rem; }
.btn-disabled {
    color: var(--muted);
    background: var(--surface-2);
    border-color: var(--border);
    cursor: default;
}
.btn-disabled:active { transform: none; }
.btn-light { background: #fff; color: #1e3a8a; }
.btn-light:hover { background: #e0e7ff; }

/* ---------- Empty state ---------- */
.empty-state {
    margin-top: 1rem;
    padding: 2.5rem 1rem;
    text-align: center;
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}
.empty-state h2 { font-size: 1.25rem; }
.empty-state p { color: var(--muted); }

/* ---------- CTA band ---------- */
.cta-band {
    padding: clamp(1.75rem, 5vw, 3rem) 1.25rem;
    text-align: center;
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    border-radius: calc(var(--radius) + 6px);
}
.cta-band h2 { margin-bottom: .5rem; }
.cta-band p { max-width: 52ch; margin: 0 auto 1.25rem; opacity: .95; }

/* ---------- Responsive ---------- */
@media (min-width: 720px) {
    .filter-bar { grid-template-columns: 2fr 1fr 1fr auto; align-items: end; }
    .filter-actions .btn { flex: 0 0 auto; }
}
@media (hover: none) {
    .tool-card:hover { transform: none; }
}
@media print {
    .filter-bar, .cta-band { display: none !important; }
}
