/* ==========================================================================
   TechCapsules — "get the app" banner
   Bottom-docked so it never pushes content down or shifts layout (CLS).
   Shown only after js/app-banner.js confirms the device + dismissal state.
   ========================================================================== */

.tc-app-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;

    display: flex;
    align-items: center;
    gap: 12px;

    padding: 10px 12px;
    /* Clear the iPhone home indicator. */
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));

    background: #fff;
    border-top: 1px solid #e3e3e3;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, .12);

    font-family: inherit;

    /* Slide-in; the .is-visible class is added a beat after unhiding. */
    transform: translateY(100%);
    transition: transform .28s ease-out;
}

.tc-app-banner.is-visible {
    transform: translateY(0);
}

/* Must outrank .tc-app-banner{display:flex} above — a bare [hidden] from the UA
   stylesheet has the same specificity as a class and loses to it, which would
   flash the banner on desktop before JS runs and break dismissal. */
.tc-app-banner[hidden] {
    display: none;
}

@media (prefers-reduced-motion: reduce) {
    .tc-app-banner {
        transition: none;
    }
}

.tc-app-banner__close {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #888;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.tc-app-banner__close:hover,
.tc-app-banner__close:focus {
    color: #000;
}

.tc-app-banner__icon {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 10px;
}

.tc-app-banner__text {
    flex: 1 1 auto;
    min-width: 0;              /* lets the subtitle ellipsis instead of overflowing */
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tc-app-banner__title {
    /* 14px keeps "Download TechCapsules App" on one line down to ~375px wide
       (iPhone SE); it wraps to two lines below that rather than truncating,
       since the word that would get cut is "App". */
    font-size: 14px;
    font-weight: 700;
    color: #000;
    line-height: 1.2;
}

.tc-app-banner__subtitle {
    font-size: 12px;
    color: #666;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tc-app-banner__cta {
    flex: 0 0 auto;
    padding: 8px 18px;
    border-radius: 999px;
    background: #0073aa;       /* theme accent */
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.tc-app-banner__cta:hover,
.tc-app-banner__cta:focus {
    background: #005d88;
    color: #fff;
    text-decoration: none;
}

/* Very narrow phones — drop the subtitle rather than crush the button. */
@media (max-width: 340px) {
    .tc-app-banner__subtitle {
        display: none;
    }
}
