/*
 * Site chrome only. Every rule is namespaced so the uploaded newsletter's own
 * formatting is left untouched: there are deliberately no bare h1/p/ul rules.
 */

:root {
    --brand: #0f766e;
    --brand-dark: #115e59;
    --ink: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --surface: #ffffff;
    --canvas: #f1f5f9;
    --radius: 14px;
    --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--canvas);
    color: var(--ink);
    font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans Sinhala", sans-serif;
    font-size: 16px;
    line-height: 1.6;
    overflow-wrap: break-word;
}

.site-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

.site-skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--brand);
    color: #fff;
    padding: 10px 16px;
    z-index: 100;
}

.site-skip-link:focus {
    left: 8px;
    top: 8px;
    border-radius: 8px;
}

/* Header */

.site-header {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    color: #fff;
    padding: 18px 0;
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.site-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.site-brand__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.16);
    flex: 0 0 auto;
}

.site-brand__mark svg {
    width: 24px;
    height: 24px;
}

.site-brand__text {
    display: flex;
    flex-direction: column;
}

.site-brand__title {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.site-brand__tagline {
    font-size: 0.82rem;
    opacity: 0.85;
}

/* Main */

.site-main {
    padding: 28px 0 44px;
}

.newsletter-container {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.newsletter-header {
    padding: 22px 24px;
    border-bottom: 1px solid var(--line);
    background: #f8fafc;
}

.newsletter-header__title {
    margin: 0;
    font-size: 1.4rem;
    line-height: 1.3;
    color: var(--brand-dark);
}

.newsletter-header__meta {
    margin: 6px 0 0;
    font-size: 0.85rem;
    color: var(--muted);
}

/* Uploaded newsletter. Only layout containment is applied here so the
   newsletter's own styles keep control of typography and colour. */

.newsletter-content {
    padding: 24px;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.newsletter-content img,
.newsletter-content video,
.newsletter-content iframe {
    max-width: 100%;
    height: auto;
}

.newsletter-content table {
    max-width: 100%;
    border-collapse: collapse;
}

.newsletter-content pre {
    white-space: pre-wrap;
    word-break: break-word;
}

/* Unavailable message */

.newsletter-container--message .site-message {
    padding: 48px 24px 56px;
    text-align: center;
}

.site-message__icon {
    display: inline-flex;
    color: var(--brand);
}

.site-message__icon svg {
    width: 46px;
    height: 46px;
}

.site-message__title {
    margin: 14px 0 6px;
    font-size: 1.15rem;
    color: var(--ink);
}

.site-message__text {
    margin: 0;
    color: var(--muted);
}

/* Footer */

.site-footer {
    background: #0f172a;
    color: #cbd5e1;
    padding: 22px 0;
    font-size: 0.85rem;
}

.site-footer__note {
    margin: 0 0 6px;
    color: #94a3b8;
}

.site-footer__copyright {
    margin: 0;
}

/* Responsive */

@media (max-width: 640px) {
    body {
        font-size: 15px;
    }

    .site-container {
        padding: 0 14px;
    }

    .newsletter-container {
        border-radius: 10px;
    }

    .newsletter-header,
    .newsletter-content {
        padding: 16px 14px;
    }

    .newsletter-header__title {
        font-size: 1.2rem;
    }
}

@media print {
    .site-header,
    .site-footer,
    .site-skip-link {
        display: none;
    }

    .newsletter-container {
        border: 0;
        box-shadow: none;
    }
}
