/* The recipient side of the newsletter, see _LayoutNewsletter.cshtml. */

/* A newsletter: the mail fills the window and scrolls inside its frame. */
.newsletter-frame {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: #fff;
}

.newsletter-concept {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 1030;
    padding: 4px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 999px;
    background: #fff;
    color: #333;
    font-size: 0.8rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

/* The round button in the corner that opens the earlier newsletters. It shows its label next to the
   icon while the pointer is on it or it has keyboard focus. */
.newsletter-archive-button {
    position: fixed;
    left: 20px;
    bottom: 20px;
    z-index: 1030;
    display: flex;
    align-items: center;
    height: 52px;
    min-width: 52px;
    padding: 0 16px;
    border: 0;
    border-radius: 26px;
    background: #379f92;
    color: #fff;
    font-size: 1.15rem;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.newsletter-archive-button:hover,
.newsletter-archive-button:focus-visible {
    background: #2e877c;
}

.newsletter-archive-button:focus-visible {
    outline: 3px solid #fff;
    box-shadow: 0 0 0 5px #2e877c, 0 3px 12px rgba(0, 0, 0, 0.3);
}

.newsletter-archive-button-label {
    max-width: 0;
    overflow: hidden;
    white-space: nowrap;
    font-size: 0.95rem;
    font-weight: 600;
    opacity: 0;
    transition: max-width 0.2s ease, opacity 0.2s ease, margin-left 0.2s ease;
}

.newsletter-archive-button:hover .newsletter-archive-button-label,
.newsletter-archive-button:focus-visible .newsletter-archive-button-label {
    max-width: 220px;
    margin-left: 10px;
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    .newsletter-archive-button,
    .newsletter-archive-button-label {
        transition: none;
    }
}

/* The panel with the earlier newsletters. */
.newsletter-archive {
    --bs-offcanvas-width: 340px;
    display: flex;
    flex-direction: column;
}

.newsletter-archive-year {
    margin: 1rem 0 0.25rem;
    color: #6c757d;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.newsletter-archive-year:first-child {
    margin-top: 0;
}

.newsletter-archive-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.newsletter-archive-list a {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 6px;
    color: #333;
    text-decoration: none;
}

.newsletter-archive-list a:hover,
.newsletter-archive-list a:focus-visible {
    background: #f1f3f3;
}

.newsletter-archive-list a.active {
    background: #e6f3f1;
    font-weight: 600;
}

.newsletter-archive-list small {
    flex-shrink: 0;
    color: #6c757d;
}

.newsletter-archive-footer {
    padding: 12px 1rem;
    border-top: 1px solid #e5e5e5;
    font-size: 0.875rem;
}

.newsletter-archive-footer a {
    color: #6c757d;
}

/* Every other page: a short message in the middle of the window. */
.newsletter-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 48px 16px 96px;
    background: #f4f6f6;
}

.newsletter-message-logo {
    height: 40px;
    margin-bottom: 32px;
}

.newsletter-message-card {
    width: 100%;
    max-width: 560px;
    padding: 32px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.newsletter-message-card > :last-child {
    margin-bottom: 0;
}
