/* Strona zbiorcza narzędzi – [apteka_narzedzia_hub]. Czcionka dziedziczona z motywu. */
.apteka-hub {
    --ah-accent: #0b7a5f;
    --ah-soft: #e8f4ef;
    --ah-radius: 14px;
    --ah-border: #d7e0e4;
    --ah-text: #16232b;
    --ah-muted: #52626b;
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 24px 0;
    padding: 0;
}
.apteka-hub--cols-1 { grid-template-columns: minmax(0, 1fr); }
.apteka-hub--cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.apteka-hub--cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 960px) {
    .apteka-hub--cols-3,
    .apteka-hub--cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .apteka-hub,
    .apteka-hub--cols-2,
    .apteka-hub--cols-3,
    .apteka-hub--cols-4 { grid-template-columns: minmax(0, 1fr); gap: 12px; }
}

.apteka-hub .apteka-hub__card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 20px 20px 18px;
    background: #fff;
    color: var(--ah-text);
    border: 1px solid var(--ah-border);
    border-radius: var(--ah-radius);
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.apteka-hub .apteka-hub__card:hover {
    border-color: var(--ah-accent);
    box-shadow: 0 8px 24px rgba(16, 35, 43, .08);
    transform: translateY(-2px);
}
.apteka-hub .apteka-hub__card:focus-within {
    outline: 3px solid color-mix(in srgb, var(--ah-accent) 40%, transparent);
    outline-offset: 2px;
}

.apteka-hub .apteka-hub__icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: var(--ah-soft);
    color: var(--ah-accent);
}
.apteka-hub .apteka-hub__icon svg { width: 24px; height: 24px; display: block; }

.apteka-hub .apteka-hub__title {
    margin: 6px 0 0;
    padding: 0;
    font-size: 1.12rem;
    line-height: 1.3;
    font-weight: 700;
    letter-spacing: -.01em;
    color: var(--ah-text);
}
.apteka-hub .apteka-hub__link,
.apteka-hub .apteka-hub__link:visited {
    color: inherit;
    text-decoration: none;
    box-shadow: none;
}
/* cały kafelek klikalny (rozciągnięty link) */
.apteka-hub .apteka-hub__link::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
}
.apteka-hub .apteka-hub__link:focus { outline: none; }

.apteka-hub .apteka-hub__text {
    margin: 0;
    flex: 1 1 auto;
    font-size: .95rem;
    line-height: 1.5;
    color: var(--ah-muted);
}
.apteka-hub .apteka-hub__badge {
    margin: 0;
    font-size: .8rem;
    line-height: 1.4;
    color: var(--ah-muted);
    opacity: .85;
}
.apteka-hub .apteka-hub__more {
    margin-top: 6px;
    font-size: .95rem;
    font-weight: 600;
    color: var(--ah-accent);
}
.apteka-hub .apteka-hub__arrow { display: inline-block; transition: transform .15s ease; }
.apteka-hub .apteka-hub__card:hover .apteka-hub__arrow { transform: translateX(3px); }

.apteka-hub .apteka-hub__missing {
    padding: 16px;
    border: 2px dashed #c0392b;
    border-radius: var(--ah-radius);
    background: #fff5f4;
    color: #7a1f14;
    font-size: .9rem;
    line-height: 1.5;
}

@media (prefers-reduced-motion: reduce) {
    .apteka-hub .apteka-hub__card,
    .apteka-hub .apteka-hub__arrow { transition: none; }
    .apteka-hub .apteka-hub__card:hover { transform: none; }
}

/* Grupy kafelków */
.apteka-hub-groups { margin: 24px 0; }
.apteka-hub-groups .apteka-hub { margin: 14px 0 0; }
.apteka-hub-groups .apteka-hub__group-title {
    margin: 36px 0 0;
    padding: 0;
    font-size: 1.3rem;
    line-height: 1.3;
    font-weight: 700;
}
.apteka-hub-groups .apteka-hub__group-title:first-child { margin-top: 0; }

/* Narzędzie w okienku (gdy brak osobnej strony) */
.apteka-hub .apteka-hub__note {
    position: relative;
    z-index: 1;
    margin: 4px 0 0;
    padding: 6px 9px;
    border-radius: 8px;
    background: #fff6e0;
    color: #8a5a00;
    font-size: .78rem;
    line-height: 1.4;
}
.apteka-hub__dialog {
    width: min(780px, calc(100% - 24px));
    max-width: none;
    max-height: calc(100vh - 32px);
    margin: auto;
    padding: 0;
    border: 0;
    border-radius: 16px;
    background: #f4f6f7;
    color: #16232b;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .28);
    overflow: auto;
    overscroll-behavior: contain;
}
.apteka-hub__dialog::backdrop { background: rgba(16, 35, 43, .55); }
html:has(.apteka-hub__dialog[open]) { overflow: hidden; }
.apteka-hub__dialog-head {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px 10px 18px;
    background: #fff;
    border-bottom: 1px solid #d7e0e4;
}
.apteka-hub__dialog-title { font-weight: 700; font-size: 1rem; line-height: 1.3; }
.apteka-hub__close {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid #d7e0e4;
    border-radius: 10px;
    background: #fff;
    color: #16232b;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}
.apteka-hub__close:hover { border-color: #16232b; }
.apteka-hub__dialog-body { padding: 14px; }
@media (max-width: 600px) {
    .apteka-hub__dialog { width: 100%; height: 100%; max-height: 100%; border-radius: 0; }
    .apteka-hub__dialog-body { padding: 10px; }
}
