/* Announcement banner styles extracted from `main.css` */

.announcement-banner {
    position: fixed;
    top: 66px; /* anchored 66px from the top edge */
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    align-items: flex-start; /* ensure content top-aligns so expansion grows downward */
    gap: 12px;
    width: 319px; /* Figma frame width */
    padding: 12px;
    background: rgba(17,17,17,0.9); /* dark shell to contrast cream button */
    color: var(--color-accent-cream);
    border: 1px solid #FFFEF2; /* outer surround color per request */
    border-radius: 0; /* sharp edges per request */
}

.announcement-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* left align title, text and button */
    gap: 8px; /* tighten spacing so label and first line feel visually grouped */
    width: auto; /* allow content to size naturally */
}

.announcement-label {
    font-weight: 700;
    font-size: 14px;
    text-decoration: underline;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.announcement-message {
    font-size: 14px;
    margin-top: 4px;
    text-transform: uppercase;
}

.announcement-message-line {
    display: block; /* ensure stacked lines */
}

/* Ensure consistent letter-spacing for announcement text and CTA */
.announcement-message,
.announcement-access {
    letter-spacing: 0.0em;
}

.announcement-actions {
    /* left-aligned actions to match label and message */
    margin-left: 0;
    display: flex;
    align-items: center;
}

.announcement-access {
    width: 121px; /* Figma button width */
    height: 29px; /* Figma button height */
    background: var(--color-accent-cream);
    color: var(--color-primary-dark);
    border: 1px solid #FFFEF2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* Match Figma: semi-bold */
    font-weight: 600;
    font-size: 14px;
    /* Force font family, spacing and height to avoid inheritance differences */
    font-family: var(--font-family);
    letter-spacing: 0.06em;
    line-height: 14px;
    cursor: pointer;
    text-transform: uppercase;
}

.announcement-close {
    position: absolute;
    right: 8px;
    top: 8px;
    background: transparent;
    color: var(--color-accent-cream);
    border: none;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

/* Toggle button (replace close): same positioning and visuals */
.announcement-toggle {
    position: absolute;
    /* align the toggle inside the announcement padding so it's visually centered
       with the announcement content */
    right: 12px;
    top: 12px;
    background: transparent;
    color: var(--color-accent-cream);
    border: none;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

/* Announcement body reveal: animate vertical expansion while keeping width constant */
.announcement-body {
    max-height: none; /* default expanded */
    opacity: 1;
    overflow: hidden;
    /* much faster expand/collapse so content appears effectively
       immediately after the container finishes expanding */
    transition: max-height 80ms cubic-bezier(0.2, 0, 0, 1), opacity 80ms cubic-bezier(0.2, 0, 0, 1);
    will-change: max-height, opacity;
}

/* Keep 20px spacing between the message and CTA inside the reveal body */
.announcement-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Inner-body children fade behavior: when contents are hidden, remove
   transitions and hide instantly to avoid flicker; when class is removed
   they will fade in via the transition defined here. */
.announcement-body > .announcement-message,
.announcement-body > .announcement-actions {
    /* visible by default with no transition so they appear instantly */
    opacity: 1;
    visibility: visible;
}

.announcement-body.contents-hidden > .announcement-message,
.announcement-body.contents-hidden > .announcement-actions {
    /* hide instantly while container animates (no transition) */
    transition: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none;
}

.announcement-toggle-icon {
    display: block;
    /* reduce icon size by 20% (both expanded and collapsed states) */
    width: calc(18px * 0.9);
    height: calc(18px * 0.9);
    transition: transform 240ms ease, opacity 180ms ease;
    transform-origin: center center;
    /* keep a uniform scale so we don't rely on layout-changing width/height */
    transform: scale(0.9);
}


/* Collapsed state: shrink to a compact bar but remain visible (not dismissible) */
.announcement-banner {
    /* Only animate non-layout properties to avoid layout jumps during
       inner max-height transitions. Avoid animating height or padding. */
    transition: width var(--motion-fast) var(--easing-sharp),
                opacity var(--motion-fast) var(--easing-sharp),
                transform var(--motion-fast) var(--easing-sharp);
}

.announcement-banner.collapsed {
    height: auto; /* let body control vertical size */
    width: 319px; /* keep fixed width when collapsed */
    /* keep same vertical padding as expanded to avoid layout shift */
    padding: 12px;
}

/* When collapsed, hide non-label message blocks and remove gaps so the
   visible label has equal padding above and below inside the banner. */
.announcement-banner.collapsed .announcement-content {
    gap: 0; /* remove internal spacing so label sits with equal padding */
}

/* Hide the direct-message placeholder (and any other message blocks) when
   collapsed so they don't contribute to layout/gap spacing. */
.announcement-banner.collapsed > .announcement-content > .announcement-message {
    display: none;
}

/* collapsed state hides the body via max-height; label remains visible */
.announcement-banner.collapsed .announcement-body {
    max-height: 0px;
    opacity: 0;
}

.announcement-banner .announcement-label {
    /* ensure label stays visible and aligned when collapsed */
    display: block;
    align-self: flex-start;
}

.announcement-banner.collapsed .announcement-toggle-icon {
    /* rotate but maintain the same 0.8 scale used in the default state */
    transform: rotate(180deg) scale(0.8);
}

/* Toggle icon larger on desktop to match visual scale */
@media (min-width: 1024px) {
    .announcement-toggle {
        font-size: 28px;
        right: 36px;
        top: 36px;
    }
}

/* Force mobile announcement appearance across all viewports
   This override makes the announcement banner use the compact mobile
   sizing and layout even on desktop. Use sparingly; remove if a
   larger desktop design is desired. */
@media (min-width: 1024px) {
    .announcement-banner {
        width: 319px !important;
        padding: 12px !important;
        background: rgba(17,17,17,0.9) !important;
        border: 1px solid #FFFEF2 !important;
        border-radius: 0 !important;
        box-sizing: content-box !important;
    }

    .announcement-label {
        font-size: 14px !important;
        line-height: 1 !important;
        margin-bottom: 0 !important;
        text-decoration-thickness: initial !important;
    }

    .announcement-message {
        font-size: 14px !important;
        line-height: 1.2 !important;
        margin-top: 4px !important;
        letter-spacing: 0.0em !important;
        max-width: none !important;
    }

    .announcement-actions {
        margin-top: 0 !important;
        display: flex !important;
        gap: 8px !important;
    }

    .announcement-access {
        width: 121px !important;
        height: 29px !important;
        font-size: 14px !important;
        padding: 0 8px !important;
        line-height: 29px !important;
    }

    .announcement-close,
    .announcement-toggle {
        right: 8px !important;
        top: 8px !important;
        font-size: 18px !important;
    }
}

@media (min-width: 768px) {
    .announcement-banner {
        width: 319px; /* keep fixed width on larger screens too */
    }
}

/* Desktop adjustments */
@media (min-width: 1024px) {
    .announcement-banner {
        width: calc(100% - 96px); /* hug viewport with side gutters */
        left: 50%;
        transform: translateX(-50%);
        padding: 40px 48px;
        background: var(--color-primary-dark);
        border: 4px solid var(--color-accent-cream);
        border-radius: 4px;
        box-sizing: border-box;
    }

    .announcement-content {
        width: auto; /* allow message to span */
    }

    .announcement-label {
        font-size: 36px;
        line-height: 1;
        margin-bottom: 18px;
        text-decoration-thickness: 3px;
        letter-spacing: 0.02em;
    }

    .announcement-message {
        font-size: 48px;
        line-height: 1.08;
        margin-top: 8px;
        max-width: 100%;
        white-space: normal;
        letter-spacing: 0.06em;
    }

    .announcement-actions {
        margin-left: 0;
        margin-top: 32px;
        display: block;
    }

    .announcement-access {
        width: 231px; /* larger desktop CTA */
        height: 54px;
        font-size: 28px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0 18px;
    }

    .announcement-close {
        right: 36px;
        top: 36px;
        font-size: 28px;
        color: var(--color-accent-cream);
    }
}
