/* ==========================================================================
   Tools, search and saved posts. Colours come from site-header.css.
   ========================================================================== */

.tool-tabs {
    display: flex;
    gap: 6px;
    margin: 0 0 22px;
    padding-bottom: 4px;
    overflow-x: auto;
    scrollbar-width: none;
}

.tool-tabs::-webkit-scrollbar {
    display: none;
}

.tool-tabs a {
    display: flex;
    flex: none;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1px solid var(--site-line);
    border-radius: 999px;
    color: var(--site-text);
    font-size: 16px;
    font-weight: 600;
}

.tool-tabs a:hover {
    border-color: var(--site-blue);
    color: var(--site-blue);
}

.tool-tabs a.is-active {
    border-color: var(--site-blue);
    background: var(--site-blue);
    color: #fff;
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}

.tool-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 18px 20px;
    border: 1px solid var(--site-line);
    border-radius: 6px;
    background: var(--site-paper);
    color: var(--site-text);
}

a.tool-card:hover {
    border-color: var(--site-blue);
    color: var(--site-text);
}

.tool-card strong {
    color: var(--site-ink);
    font-size: 19px;
    font-weight: 700;
}

.tool-card__icon {
    align-self: flex-start;
    margin-bottom: 6px;
    color: var(--site-blue);
}

.tool-card__figure {
    color: var(--site-ink);
    font-size: 38px;
    font-weight: 700;
    line-height: 1.2;
}

.tool-change {
    font-size: 15.5px;
    font-weight: 600;
}

.tool-change--up {
    color: #0d7a3a;
}

.tool-change--down {
    color: var(--site-red);
}

.tool-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 18px;
    margin: 10px 0 0;
    padding-top: 10px;
    border-top: 1px solid var(--site-line);
}

.tool-facts dt {
    color: var(--site-muted);
    font-size: 14px;
    font-weight: 500;
}

.tool-facts dd {
    margin: 0;
    color: var(--site-ink);
    font-size: 16px;
    font-weight: 600;
}

.tool-table {
    overflow-x: auto;
    border: 1px solid var(--site-line);
    border-radius: 6px;
}

.tool-table table {
    width: 100%;
    border-collapse: collapse;
}

.tool-table th,
.tool-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--site-line);
    color: var(--site-text);
    font-size: 16px;
    text-align: left;
}

.tool-table th {
    background: var(--site-wash);
    color: var(--site-ink);
    font-weight: 700;
    white-space: nowrap;
}

.tool-table tr:last-child td {
    border-bottom: 0;
}

/* Prices stay on one line; on a phone the table scrolls sideways inside its box. */
.tool-table--figures td {
    white-space: nowrap;
}

.tool-table strong {
    margin-right: 6px;
    color: var(--site-ink);
}

.tool-band {
    display: inline-block;
    align-self: flex-start;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
}

.tool-band--good { background: #d8f3e0; color: #0d5c2c; }
.tool-band--moderate { background: #fdf0c4; color: #6b5300; }
.tool-band--sensitive { background: #fde0c4; color: #7a3e00; }
.tool-band--unhealthy { background: #fbd5da; color: #8a1224; }
.tool-band--very-unhealthy { background: #e7d6f5; color: #551a8b; }
.tool-band--hazardous { background: #6b1324; color: #fff; }

.tool-lead {
    margin: 0 0 14px;
    color: var(--site-muted);
    font-size: 16px;
}

.tool-note {
    margin: 18px 0 0;
    color: var(--site-muted);
    font-size: 15.5px;
}

.tool-subhead {
    margin: 28px 0 12px;
    color: var(--site-ink);
    font-size: 23px;
    font-weight: 700;
}

/* Calendar
   ========================================================================== */

.tool-patro__head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 2px;
}

.tool-patro__head h2 {
    margin: 0;
    color: var(--site-ink);
    font-size: 27px;
    font-weight: 700;
}

.tool-patro__head a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--site-line);
    border-radius: 50%;
    color: var(--site-ink);
}

.tool-patro {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
}

.tool-patro__weekday {
    padding: 8px 4px;
    border-radius: 4px;
    background: var(--site-blue);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
}

.tool-patro__day {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 4px;
    border: 1px solid var(--site-line);
    border-radius: 4px;
}

.tool-patro__day b {
    color: var(--site-ink);
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
}

.tool-patro__day span {
    color: var(--site-muted);
    font-size: 13.5px;
}

.tool-patro__day.is-holiday b {
    color: var(--site-red);
}

.tool-patro__day small {
    display: -webkit-box;
    margin-top: 3px;
    overflow: hidden;
    color: var(--site-text);
    font-size: 13px;
    line-height: 1.4;
    text-align: center;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.tool-patro__day.is-holiday small {
    color: var(--site-red);
    font-weight: 600;
}

.tool-patro__day.is-today small {
    color: #fff;
}

.tool-patro__day.is-today {
    border-color: var(--site-red);
    background: var(--site-red);
}

.tool-patro__day.is-today b,
.tool-patro__day.is-today span {
    color: #fff;
}

.tool-events {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.tool-events li {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 8px 12px;
    border: 1px solid var(--site-line);
    border-radius: 6px;
}

.tool-events__day {
    flex: none;
    min-width: 30px;
    color: var(--site-ink);
    font-size: 21px;
    font-weight: 700;
    text-align: center;
}

.tool-events__name {
    flex: 1;
    min-width: 0;
    color: var(--site-text);
    font-size: 17px;
    line-height: 1.35;
}

.tool-events__tag {
    flex: none;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--site-red);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

/* Rashifal
   ========================================================================== */

.tool-rashi {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr));
    gap: 16px;
}

.tool-rashi__sign {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    padding: 16px 18px;
    border: 1px solid var(--site-line);
    border-radius: 6px;
    background: var(--site-paper);
}

.tool-rashi__symbol {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--site-blue);
    color: #fff;
    font-family: "Segoe UI Symbol", "Noto Sans Symbols2", "Noto Sans Symbols", sans-serif;
    font-size: 28px;
    line-height: 1;
}

.tool-rashi__sign h2 {
    margin: 0;
    color: var(--site-ink);
    font-size: 21px;
    font-weight: 700;
    line-height: 1.3;
}

.tool-rashi__sign p {
    margin: 4px 0 0;
    color: var(--site-text);
    font-size: 16.5px;
    line-height: 1.55;
}

.tool-rashi__sign .tool-rashi__letters {
    margin-top: 0;
    color: var(--site-muted);
    font-size: 14.5px;
}

/* Small screens: the event names move to the list under the calendar. */
@media (max-width: 639.98px) {
    .tool-patro {
        gap: 2px;
    }

    .tool-patro__weekday {
        padding: 6px 0;
        font-size: 14px;
    }

    .tool-patro__day {
        position: relative;
        padding: 5px 0;
    }

    .tool-patro__day b {
        font-size: 19px;
    }

    .tool-patro__day small {
        display: none;
    }

    .tool-patro__day.has-event::after {
        content: "";
        position: absolute;
        top: 4px;
        right: 4px;
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: var(--site-red);
    }

    .tool-patro__day.is-today.has-event::after {
        background: #fff;
    }
}

/* Date converter
   ========================================================================== */

.tool-convert {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
    gap: 16px;
}

.tool-convert__fields {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

.tool-convert__fields label {
    flex: 1 1 90px;
    color: var(--site-muted);
    font-size: 15px;
}

.tool-button {
    align-self: flex-start;
    margin-top: 10px;
    padding: 8px 22px;
    border: 0;
    border-radius: 4px;
    background: var(--site-blue);
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
}

.tool-button:hover {
    background: var(--site-blue-deep);
}

.tool-result {
    margin: 12px 0 0;
    padding: 10px 14px;
    border-radius: 4px;
    background: var(--site-wash);
    color: var(--site-ink);
    font-size: 18px;
    font-weight: 600;
}

.tool-result--error {
    color: var(--site-red);
    font-size: 16px;
    font-weight: 500;
}

/* Search and saved posts
   ========================================================================== */

.tool-search {
    position: relative;
    max-width: 680px;
    margin-bottom: 24px;
}

.tool-search__icon {
    position: absolute;
    top: 50%;
    left: 14px;
    color: var(--site-muted);
    transform: translateY(-50%);
}

.tool-search .uk-input {
    height: 48px;
    padding-left: 44px;
    border-radius: 6px;
    font-size: 18px;
}

.tool-saved {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.tool-saved li {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 10px;
    border: 1px solid var(--site-line);
    border-radius: 6px;
}

.tool-saved img {
    display: block;
    width: 96px;
    height: 72px;
    border-radius: 4px;
    object-fit: cover;
}

.tool-saved a {
    color: var(--site-ink);
    font-size: 17.5px;
    font-weight: 600;
    line-height: 1.4;
}

.tool-saved button {
    display: block;
    margin-top: 4px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--site-red);
    font-size: 15px;
    cursor: pointer;
}
