/* ── Trinity Departments Widget ─────────────────────────────────────────────
   Scoped to .tdw-* classes — won't bleed into the WordPress theme.
   Colours match Trinity Hospital brand: navy #2B2D6E, coral #F05A5B
   ────────────────────────────────────────────────────────────────────────── */

/* ── Sections ───────────────────────────────────────────────────────────── */
.tdw-section {
    padding: 76px 24px;
    position: relative;
    font-family: 'Poppins', Nunito, sans-serif;
}
.tdw-section--tint  { background: #EEF0F8; }
.tdw-section--white { background: #ffffff; }

.tdw-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.tdw-divider {
    height: 3px;
    background: linear-gradient(90deg, #F05A5B 0%, rgba(240,90,91,.18) 100%);
    width: 100%;
}

/* ── Department header ──────────────────────────────────────────────────── */
.tdw-header { margin-bottom: 48px; }

.tdw-eyebrow {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2.8px;
    text-transform: uppercase;
    color: #F05A5B;
    margin-bottom: 12px;
}

.tdw-title {
    font-size: clamp(26px, 3.5vw, 34px);
    font-weight: 800;
    color: #2B2D6E;
    line-height: 1.2;
    margin-bottom: 16px;
}
.tdw-accent { color: #F05A5B; }

.tdw-rule {
    width: 52px;
    height: 3px;
    background: #F05A5B;
    border-radius: 2px;
    margin-bottom: 16px;
}

.tdw-desc {
    font-size: 15px;
    font-weight: 400;
    color: #666666;
    line-height: 1.7;
    max-width: 620px;
}

/* ── Cards grid ─────────────────────────────────────────────────────────── */
.tdw-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

/* ── Individual card ────────────────────────────────────────────────────── */
.tdw-card {
    border-radius: 13px;
    padding: 24px;
    box-shadow: 0 4px 18px rgba(0,0,0,.06);
    border-left: 3px solid transparent;
    transition: border-left-color .22s ease, box-shadow .22s ease, transform .22s ease;
    display: flex;
    flex-direction: column;
    min-height: 178px;
    position: relative;
    overflow: hidden;
}
.tdw-card::after {
    content: '';
    position: absolute;
    bottom: -18px;
    right: -18px;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(240,90,91,.05);
    pointer-events: none;
}
.tdw-card:hover {
    border-left-color: #F05A5B;
    box-shadow: 0 8px 28px rgba(0,0,0,.11);
    transform: translateY(-3px);
}

.tdw-card--blush { background: #FDF0EE; }
.tdw-card--sage  { background: #F0F4EC; }
.tdw-card--ivory { background: #F9F5EC; }

.tdw-card-icon {
    width: 36px;
    height: 36px;
    margin-bottom: 14px;
    flex-shrink: 0;
    color: #F05A5B;
}
.tdw-card-icon svg { width: 100%; height: 100%; display: block; }

.tdw-card-title {
    font-size: 16px;
    font-weight: 700;
    color: #1A1A2E;
    line-height: 1.35;
    margin-bottom: 7px;
    flex-grow: 1;
}

.tdw-card-sub {
    font-size: 12.5px;
    font-weight: 400;
    color: #777777;
    line-height: 1.5;
    margin-bottom: 14px;
}

.tdw-card-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12.5px;
    font-weight: 700;
    color: #F05A5B;
    text-decoration: none;
    letter-spacing: .2px;
    margin-top: auto;
    transition: gap .18s ease;
}
.tdw-card-link svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    transition: transform .18s ease;
}
.tdw-card-link:hover { text-decoration: underline; gap: 8px; }
.tdw-card-link:hover svg { transform: translateX(2px); }

/* ── Floating navigator — desktop ───────────────────────────────────────── */
.tdw-floatnav {
    position: fixed;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .35s ease;
}
.tdw-floatnav.tdw-visible {
    opacity: 1;
    pointer-events: all;
}

.tdw-fnav-item {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    font-family: 'Poppins', sans-serif;
}

.tdw-fnav-label {
    font-size: 11.5px;
    font-weight: 600;
    color: #2B2D6E;
    background: #fff;
    padding: 5px 11px;
    border-radius: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,.10);
    white-space: nowrap;
    opacity: 0;
    transform: translateX(6px);
    transition: opacity .22s ease, transform .22s ease;
    pointer-events: none;
    letter-spacing: .1px;
}
.tdw-fnav-item:hover .tdw-fnav-label,
.tdw-fnav-item.active .tdw-fnav-label {
    opacity: 1;
    transform: translateX(0);
}
.tdw-fnav-item.active .tdw-fnav-label {
    color: #F05A5B;
    font-weight: 700;
}

.tdw-fnav-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #cccccc;
    flex-shrink: 0;
    transition: background .22s, transform .22s, box-shadow .22s;
}
.tdw-fnav-item:hover .tdw-fnav-dot { background: #2B2D6E; transform: scale(1.2); }
.tdw-fnav-item.active .tdw-fnav-dot {
    background: #F05A5B;
    transform: scale(1.35);
    box-shadow: 0 0 0 4px rgba(240,90,91,.18);
}

.tdw-fnav-item:not(:last-child) { position: relative; }
.tdw-fnav-item:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 4.5px;
    top: calc(100% + 4px);
    width: 1px;
    height: 8px;
    background: #dddddd;
    border-radius: 1px;
}

/* ── Scroll-in animation (shared with treatment page addon) ─────────────── */
.animate-fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity .5s ease, transform .5s ease;
}
.animate-fade-in.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ── Floating navigator — mobile ─────────────────────────────────────────── */
@media (max-width: 768px) {
    .tdw-floatnav {
        flex-direction: row;
        right: auto;
        left: 50%;
        top: auto;
        bottom: 24px;
        transform: translateX(-50%);
        background: #2B2D6E;
        border-radius: 40px;
        padding: 10px 16px;
        gap: 4px;
        box-shadow: 0 8px 28px rgba(27,29,110,.28);
    }
    .tdw-fnav-item {
        flex-direction: column;
        gap: 4px;
        padding: 4px 12px;
        border-radius: 28px;
        transition: background .2s;
    }
    .tdw-fnav-item.active { background: rgba(240,90,91,.15); }
    .tdw-fnav-item::after { display: none; }

    .tdw-fnav-label {
        background: none;
        box-shadow: none;
        padding: 0;
        font-size: 10px;
        color: rgba(255,255,255,.55);
        opacity: 1;
        transform: none;
        transition: color .2s;
    }
    .tdw-fnav-item:hover .tdw-fnav-label  { color: rgba(255,255,255,.85); transform: none; }
    .tdw-fnav-item.active .tdw-fnav-label { color: #F05A5B; }

    .tdw-fnav-dot { background: rgba(255,255,255,.3); width: 8px; height: 8px; }
    .tdw-fnav-item:hover .tdw-fnav-dot    { background: rgba(255,255,255,.7); }
    .tdw-fnav-item.active .tdw-fnav-dot   { background: #F05A5B; box-shadow: 0 0 0 3px rgba(240,90,91,.25); }
}

/* ── Grid responsive ─────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .tdw-grid    { grid-template-columns: repeat(2, 1fr); gap: 18px; }
    .tdw-section { padding: 56px 20px; }
}
@media (max-width: 540px) {
    .tdw-grid    { grid-template-columns: 1fr; gap: 16px; }
    .tdw-section { padding: 44px 16px; }
    .tdw-title   { font-size: 24px; }
}
