/* ============================================================
   KyotoTech Newsletter Styles
   Web display + Print/PDF optimization
   ============================================================ */

/* ---- Page wrapper ---- */
.newsletter-page {
    padding-top: calc(var(--nav-height, 80px) + 1rem);
    padding-bottom: 4rem;
    background: #f0f0f2;
    min-height: 100vh;
}

/* ---- Actions bar (share / PDF) ---- */
.newsletter-actions {
    max-width: 680px;
    margin: 0 auto 1rem;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.newsletter-actions-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.newsletter-actions-left a {
    font-size: 0.82rem;
    color: var(--text-muted, #6a6a6a);
    text-decoration: none;
    transition: color 0.2s;
}

.newsletter-actions-left a:hover {
    color: var(--text-color, #1a1a1a);
}

.newsletter-actions-right {
    display: flex;
    gap: 0.75rem;
}

.nl-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    font-size: 0.78rem;
    font-weight: 500;
    font-family: inherit;
    color: var(--text-muted, #6a6a6a);
    background: #ffffff;
    border: 1px solid #d4d4d8;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    letter-spacing: 0.2px;
}

.nl-btn:hover {
    color: var(--text-color, #1a1a1a);
    border-color: #a1a1aa;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.nl-btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* ---- Newsletter frame (the "paper") ---- */
.newsletter-frame {
    max-width: 680px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 6px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.03);
    overflow: hidden;
}

/* ---- Newsletter header ---- */
.nl-header {
    background: #1a1a1a;
    padding: 1.75rem 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nl-header-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.nl-header-logo {
    width: 26px;
    height: 26px;
    filter: brightness(0) invert(1);
}

.nl-header-name {
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.nl-header-meta {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.72rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* ---- Hero section ---- */
.nl-hero {
    padding: 3rem 2.5rem 2.5rem;
    border-bottom: 1px solid #e4e4e7;
}

.nl-edition-badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #0d9488;
    background: rgba(13, 148, 136, 0.08);
    padding: 0.3rem 0.75rem;
    border-radius: 4px;
    margin-bottom: 1.25rem;
}

.nl-hero h1 {
    font-size: 2rem;
    font-weight: 300;
    color: #1a1a1a;
    line-height: 1.25;
    margin-bottom: 0.65rem;
    letter-spacing: -0.3px;
}

.nl-hero-subtitle {
    font-size: 1.1rem;
    color: #6a6a6a;
    font-weight: 300;
    line-height: 1.55;
}

/* ---- Content sections ---- */
.nl-section {
    padding: 2.25rem 2.5rem;
    border-bottom: 1px solid #e4e4e7;
}

.nl-section:last-child {
    border-bottom: none;
}

.nl-section-label {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    color: #0d9488;
    margin-bottom: 0.85rem;
}

.nl-section h2 {
    font-size: 1.35rem;
    font-weight: 500;
    color: #1a1a1a;
    margin-bottom: 0.65rem;
    line-height: 1.3;
}

.nl-section p {
    font-size: 0.95rem;
    color: #3f3f46;
    line-height: 1.7;
    margin-bottom: 1rem;
}

.nl-section p:last-child {
    margin-bottom: 0;
}

.nl-lead {
    font-size: 1.02rem;
    color: #3f3f46;
    line-height: 1.75;
}

/* ---- Feature grid (2×2) ---- */
.nl-feature-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-top: 1.25rem;
}

.nl-feature-card {
    padding: 1.25rem;
    border: 1px solid #e4e4e7;
    border-radius: 6px;
    transition: border-color 0.2s;
}

.nl-feature-card:hover {
    border-color: #d4d4d8;
}

.nl-feature-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(13, 148, 136, 0.08);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    color: #0d9488;
}

.nl-feature-icon svg {
    width: 18px;
    height: 18px;
}

.nl-feature-card h3 {
    font-size: 0.88rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 0.35rem;
}

.nl-feature-card p {
    font-size: 0.82rem;
    color: #6a6a6a;
    line-height: 1.55;
    margin-bottom: 0;
}

/* ---- Use-case list ---- */
.nl-usecase-list {
    margin-top: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.nl-usecase-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1rem 1.25rem;
    background: #fafafa;
    border-radius: 6px;
    border-left: 3px solid #0d9488;
}

.nl-usecase-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0d9488;
}

.nl-usecase-icon svg {
    width: 20px;
    height: 20px;
}

.nl-usecase-content h3 {
    font-size: 0.88rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 0.2rem;
}

.nl-usecase-content p {
    font-size: 0.82rem;
    color: #6a6a6a;
    line-height: 1.55;
    margin-bottom: 0;
}

/* ---- SDK tags ---- */
.nl-sdk-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.nl-sdk-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.85rem;
    font-size: 0.78rem;
    font-weight: 500;
    color: #3f3f46;
    background: #f4f4f5;
    border: 1px solid #e4e4e7;
    border-radius: 20px;
    letter-spacing: 0.2px;
}

.nl-sdk-tag .sdk-lang {
    color: #a1a1aa;
    font-weight: 400;
    font-size: 0.72rem;
}

/* ---- Deployment comparison ---- */
.nl-deploy-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-top: 1.25rem;
}

.nl-deploy-card {
    padding: 1.5rem;
    border: 1px solid #e4e4e7;
    border-radius: 6px;
}

.nl-deploy-card.featured {
    border-color: #0d9488;
    background: rgba(13, 148, 136, 0.02);
}

.nl-deploy-card h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 0.45rem;
}

.nl-deploy-card p {
    font-size: 0.82rem;
    color: #6a6a6a;
    line-height: 1.55;
    margin-bottom: 0.75rem;
}

.nl-deploy-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nl-deploy-list li {
    font-size: 0.8rem;
    color: #3f3f46;
    padding: 0.25rem 0;
    padding-left: 1.1rem;
    position: relative;
}

.nl-deploy-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.6rem;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #0d9488;
}

/* ---- CTA section ---- */
.nl-cta {
    text-align: center;
    padding: 2.5rem 2.5rem;
    background: linear-gradient(135deg, #f7f9fb 0%, #ffffff 100%);
    border-top: 1px solid #e4e4e7;
    border-bottom: 1px solid #e4e4e7;
}

.nl-cta h2 {
    font-size: 1.3rem;
    font-weight: 500;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
}

.nl-cta p {
    font-size: 0.9rem;
    color: #6a6a6a;
    margin-bottom: 1.5rem;
}

.nl-cta-btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    font-size: 0.88rem;
    font-weight: 500;
    color: #ffffff;
    background: #0d9488;
    border-radius: 6px;
    text-decoration: none;
    letter-spacing: 0.3px;
    transition: background 0.2s, box-shadow 0.2s;
}

.nl-cta-btn:hover {
    background: #0f766e;
    box-shadow: 0 2px 8px rgba(13, 148, 136, 0.25);
}

/* ---- Cross-sell section ---- */
.nl-crosssell-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
    margin-top: 1.25rem;
}

.nl-crosssell-card {
    padding: 1rem;
    border: 1px solid #e4e4e7;
    border-radius: 6px;
    text-align: center;
    text-decoration: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.nl-crosssell-card:hover {
    border-color: #d4d4d8;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.nl-crosssell-card h3 {
    font-size: 0.82rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 0.25rem;
}

.nl-crosssell-card p {
    font-size: 0.72rem;
    color: #6a6a6a;
    line-height: 1.45;
    margin-bottom: 0;
}

.nl-crosssell-icon {
    width: 32px;
    height: 32px;
    margin: 0 auto 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #ffffff;
}

.nl-crosssell-icon svg {
    width: 16px;
    height: 16px;
}

.nl-crosssell-icon.saqura   { background: rgba(140, 80, 95, 0.09); color: #8c5060; }
.nl-crosssell-icon.logger   { background: rgba(70, 100, 140, 0.09); color: #5a7a9a; }
.nl-crosssell-icon.pn       { background: rgba(140, 115, 70, 0.09); color: #8a7550; }

/* ---- Newsletter footer ---- */
.nl-footer {
    padding: 2rem 2.5rem;
    background: #1a1a1a;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.75rem;
    line-height: 1.7;
}

.nl-footer-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.nl-footer-brand img {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
}

.nl-footer-brand span {
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.nl-footer p {
    margin-bottom: 0.35rem;
}

.nl-footer a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.2s;
}

.nl-footer a:hover {
    color: #ffffff;
}

.nl-footer-links {
    margin-top: 0.75rem;
    display: flex;
    gap: 1rem;
}

.nl-footer-divider {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 1rem 0;
}

/* ---- Divider ---- */
.nl-divider {
    border: none;
    border-top: 1px solid #e4e4e7;
    margin: 0;
}

/* ---- Archive page ---- */
.newsletter-archive {
    padding-top: calc(var(--nav-height, 80px) + 2rem);
    padding-bottom: 4rem;
    min-height: 100vh;
}

.newsletter-archive-header {
    max-width: 680px;
    margin: 0 auto 2rem;
    padding: 0 1rem;
}

.newsletter-archive-header h1 {
    font-size: 1.8rem;
    font-weight: 300;
    color: var(--primary-color, #1a1a1a);
    margin-bottom: 0.4rem;
}

.newsletter-archive-header p {
    font-size: 0.95rem;
    color: var(--text-muted, #6a6a6a);
}

.newsletter-archive-list {
    max-width: 680px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.newsletter-archive-card {
    display: flex;
    gap: 1.25rem;
    padding: 1.5rem;
    background: #ffffff;
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 6px;
    text-decoration: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.newsletter-archive-card:hover {
    border-color: #d4d4d8;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.newsletter-archive-accent {
    width: 4px;
    border-radius: 2px;
    flex-shrink: 0;
}

.newsletter-archive-accent.teal { background: #0d9488; }

.newsletter-archive-body {
    flex: 1;
}

.newsletter-archive-date {
    font-size: 0.72rem;
    font-weight: 500;
    color: #0d9488;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.35rem;
}

.newsletter-archive-body h2 {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--primary-color, #1a1a1a);
    margin-bottom: 0.3rem;
}

.newsletter-archive-body p {
    font-size: 0.85rem;
    color: var(--text-muted, #6a6a6a);
    line-height: 1.55;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 720px) {
    .nl-header {
        padding: 1.25rem 1.5rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
    }

    .nl-hero {
        padding: 2rem 1.5rem 1.75rem;
    }

    .nl-hero h1 {
        font-size: 1.55rem;
    }

    .nl-section {
        padding: 1.75rem 1.5rem;
    }

    .nl-feature-grid {
        grid-template-columns: 1fr;
    }

    .nl-deploy-grid {
        grid-template-columns: 1fr;
    }

    .nl-crosssell-grid {
        grid-template-columns: 1fr;
    }

    .nl-cta {
        padding: 2rem 1.5rem;
    }

    .nl-footer {
        padding: 1.5rem;
    }

    .newsletter-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
}

/* ============================================================
   Print / PDF
   ============================================================ */
@media print {
    /* Hide site chrome and interactive elements */
    .navbar,
    .footer,
    .newsletter-actions,
    #particleCanvas,
    #bgCanvas {
        display: none !important;
    }

    /* Reset page wrapper */
    .newsletter-page {
        padding: 0;
        background: #ffffff;
        min-height: auto;
    }

    /* Remove card effect */
    .newsletter-frame {
        max-width: 100%;
        box-shadow: none;
        border-radius: 0;
    }

    /* Page breaks */
    .nl-section {
        page-break-inside: avoid;
    }

    .nl-cta {
        page-break-inside: avoid;
    }

    .nl-feature-grid {
        page-break-inside: avoid;
    }

    /* Keep colors in print */
    .nl-header {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .nl-footer {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .nl-edition-badge {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .nl-usecase-item {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .nl-cta-btn {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .nl-crosssell-icon {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Ensure links are visible */
    .nl-cta-btn {
        border: 2px solid #0d9488;
    }

    /* Footer in print */
    .nl-footer {
        page-break-inside: avoid;
    }

    .newsletter-subscribe {
        display: none;
    }
}

/* ── Subscribe Form ──────────────────────────── */

.newsletter-subscribe {
    max-width: 680px;
    margin: 3rem auto 0;
    padding: 2.5rem;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
    text-align: center;
}

.newsletter-subscribe h2 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
}

.newsletter-subscribe > p {
    font-size: 0.95rem;
    color: #6a6a6a;
    margin-bottom: 1.5rem;
}

.subscribe-form {
    max-width: 440px;
    margin: 0 auto;
}

.subscribe-input-group {
    display: flex;
    gap: 0.5rem;
}

.subscribe-input-group input[type="email"] {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid #e4e4e7;
    border-radius: 6px;
    font-size: 0.95rem;
    color: #1a1a1a;
    outline: none;
    transition: border-color 0.2s;
}

.subscribe-input-group input[type="email"]:focus {
    border-color: #0d9488;
}

.subscribe-input-group button {
    padding: 0.75rem 1.5rem;
    background: #0d9488;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.subscribe-input-group button:hover:not(:disabled) {
    background: #0b7f74;
}

.subscribe-input-group button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.subscribe-message {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    min-height: 1.25rem;
}

.subscribe-message.success {
    color: #0d9488;
}

.subscribe-message.error {
    color: #ef4444;
}

.subscribe-note {
    margin-top: 1rem;
    font-size: 0.8rem;
    color: #a1a1aa;
}
