/* Somerville Council Digest - Civic Modernist Design */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700;800&family=Source+Sans+3:wght@400;500;600&display=swap');

:root {
    --navy: #0f1c2e;
    --navy-light: #1a2d47;
    --terracotta: #c75b39;
    --terracotta-dark: #a84a2d;
    --cream: #faf7f2;
    --cream-dark: #f0ebe3;
    --text: #2d3748;
    --text-muted: #5a6778;
    --border: #d4cdc3;
    --success: #2d6a4f;
    --success-bg: #d4edda;
    --error: #9b2c2c;
    --error-bg: #fde8e8;
    --info: #1e5c8a;
    --info-bg: #e3f0f8;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Source Sans 3', -apple-system, BlinkMacSystemFont, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.65;
    color: var(--text);
    background-color: var(--cream);
    min-height: 100vh;
}

main {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Typography */
h1, h2, h3 {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

h1 {
    font-size: clamp(2.5rem, 6vw, 3.5rem);
    color: var(--navy);
    margin: 0 0 0.5em;
}

h2 {
    font-size: clamp(1.5rem, 3.5vw, 2rem);
    color: var(--navy);
    margin: 0 0 1em;
}

h3 {
    font-size: 1.15rem;
    color: var(--navy);
    margin: 0 0 0.25em;
}

p {
    margin: 0 0 1em;
}

/* Hero Section */
.hero {
    padding: 80px 0 60px;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: 40px;
    right: -24px;
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, var(--terracotta) 0%, transparent 70%);
    opacity: 0.08;
    border-radius: 50%;
    pointer-events: none;
}

.hero-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--terracotta);
    background: rgba(199, 91, 57, 0.1);
    padding: 6px 14px;
    border-radius: 3px;
    margin-bottom: 24px;
    border: 1px solid rgba(199, 91, 57, 0.2);
}

.hero h1 .highlight {
    color: var(--terracotta);
    position: relative;
}

.hero h1 .highlight::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 0;
    right: 0;
    height: 6px;
    background: var(--terracotta);
    opacity: 0.2;
    z-index: -1;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 540px;
    margin-bottom: 36px;
    line-height: 1.7;
}

/* Hero Form */
.hero-form {
    max-width: 480px;
}

.form-row {
    display: flex;
    gap: 0;
    box-shadow: 0 4px 20px rgba(15, 28, 46, 0.1);
    border-radius: 6px;
    overflow: hidden;
}

.hero-form input[type="email"] {
    flex: 1;
    padding: 16px 20px;
    font-size: 1rem;
    font-family: inherit;
    border: 2px solid var(--border);
    border-right: none;
    border-radius: 6px 0 0 6px;
    background: white;
    color: var(--text);
    min-width: 0;
}

.hero-form input[type="email"]:focus {
    outline: none;
    border-color: var(--navy);
}

.hero-form input[type="email"]::placeholder {
    color: #9ca3af;
}

.hero-form button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 24px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    color: white;
    background: var(--terracotta);
    border: none;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    white-space: nowrap;
}

.hero-form button:hover {
    background: var(--terracotta-dark);
}

.hero-form button:active {
    transform: scale(0.98);
}

.hero-form button svg {
    flex-shrink: 0;
    transition: transform 0.2s;
}

.hero-form button:hover svg {
    transform: translateX(3px);
}

.form-note {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 14px 0 0;
}

/* Divider */
.divider {
    text-align: center;
    padding: 40px 0;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: var(--border);
}

.divider-icon {
    position: relative;
    display: inline-block;
    background: var(--cream);
    padding: 0 20px;
    color: var(--terracotta);
    font-size: 0.75rem;
}

/* How It Works */
.how-it-works {
    padding: 20px 0 60px;
}

.how-it-works h2 {
    text-align: center;
    margin-bottom: 48px;
}

.steps {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.step {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.step-number {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--navy);
    background: white;
    border: 2px solid var(--navy);
    border-radius: 50%;
}

.step-content h3 {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.step-content p {
    color: var(--text-muted);
    margin: 0;
    font-size: 0.95rem;
}

/* What You Get */
.what-you-get {
    background: white;
    margin: 0 -24px;
    padding: 60px 24px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.what-you-get h2 {
    text-align: center;
    margin-bottom: 40px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    max-width: 700px;
    margin: 0 auto;
}

.feature {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 20px;
    background: var(--cream);
    border-radius: 8px;
    border: 1px solid var(--cream-dark);
}

.feature-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    color: white;
    background: var(--terracotta);
    border-radius: 50%;
}

.feature-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.feature-text strong {
    font-weight: 600;
    color: var(--navy);
}

.feature-text span {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* CTA Section */
.cta-section {
    padding: 80px 0;
    text-align: center;
}

.cta-content {
    max-width: 500px;
    margin: 0 auto;
}

.cta-content h2 {
    margin-bottom: 16px;
}

.cta-content > p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 32px;
}

.cta-form {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.cta-form input[type="email"] {
    flex: 1;
    min-width: 220px;
    max-width: 300px;
    padding: 14px 18px;
    font-size: 1rem;
    font-family: inherit;
    border: 2px solid var(--border);
    border-radius: 6px;
    background: white;
    color: var(--text);
}

.cta-form input[type="email"]:focus {
    outline: none;
    border-color: var(--navy);
}

.cta-form button {
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    color: white;
    background: var(--navy);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.cta-form button:hover {
    background: var(--navy-light);
}

.cta-sample {
    margin-top: 16px;
    font-size: 0.9rem;
}

/* Alerts */
.alert {
    padding: 14px 18px;
    border-radius: 6px;
    margin: 24px 0;
    font-size: 0.95rem;
    border-left: 4px solid;
}

.alert-success {
    background-color: var(--success-bg);
    color: var(--success);
    border-left-color: var(--success);
}

.alert-error {
    background-color: var(--error-bg);
    color: var(--error);
    border-left-color: var(--error);
}

.alert-info {
    background-color: var(--info-bg);
    color: var(--info);
    border-left-color: var(--info);
}

/* Footer */
footer {
    text-align: center;
    padding: 40px 24px;
    border-top: 1px solid var(--border);
    background: white;
    margin: 0 -24px;
}

footer p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Links */
a {
    color: var(--terracotta);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--terracotta-dark);
    text-decoration: underline;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 24px;
    font-weight: 500;
}

/* Subscribe page specific */
.subscribe-section {
    padding: 60px 0;
}

.subscribe-form {
    max-width: 400px;
}

.subscribe-form input[type="email"] {
    width: 100%;
    padding: 14px 18px;
    font-size: 1rem;
    font-family: inherit;
    border: 2px solid var(--border);
    border-radius: 6px;
    background: white;
    color: var(--text);
    margin-bottom: 16px;
}

.subscribe-form input[type="email"]:focus {
    outline: none;
    border-color: var(--navy);
}

.subscribe-form button {
    width: 100%;
    padding: 14px 24px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    color: white;
    background: var(--terracotta);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.subscribe-form button:hover {
    background: var(--terracotta-dark);
}

/* Simple content pages (unsubscribe, etc.) */
.simple-content {
    padding: 80px 0;
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
}

.simple-content h1 {
    font-size: 2rem;
    margin-bottom: 0.75em;
}

.simple-content p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Responsive */
@media (max-width: 600px) {
    main {
        padding: 0 20px;
    }

    .hero {
        padding: 50px 0 40px;
    }

    .hero::before {
        display: none;
    }

    .form-row {
        flex-direction: column;
        box-shadow: none;
    }

    .hero-form input[type="email"] {
        border-right: 2px solid var(--border);
        border-radius: 6px;
        margin-bottom: 12px;
    }

    .hero-form button {
        border-radius: 6px;
        justify-content: center;
    }

    .step {
        gap: 16px;
    }

    .step-number {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .what-you-get {
        padding: 40px 20px;
    }

    .cta-section {
        padding: 50px 0;
    }

    .cta-form {
        flex-direction: column;
        align-items: stretch;
    }

    .cta-form input[type="email"] {
        max-width: none;
    }

    footer {
        margin: 0 -20px;
    }
}

/* Animation on load */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-badge {
    animation: fadeUp 0.5s ease-out;
}

.hero h1 {
    animation: fadeUp 0.5s ease-out 0.1s both;
}

.hero-subtitle {
    animation: fadeUp 0.5s ease-out 0.2s both;
}

.hero-form {
    animation: fadeUp 0.5s ease-out 0.3s both;
}

.step {
    animation: fadeUp 0.5s ease-out both;
}

.step:nth-child(1) { animation-delay: 0.1s; }
.step:nth-child(2) { animation-delay: 0.2s; }
.step:nth-child(3) { animation-delay: 0.3s; }

.feature {
    animation: fadeUp 0.4s ease-out both;
}

.feature:nth-child(1) { animation-delay: 0.1s; }
.feature:nth-child(2) { animation-delay: 0.15s; }
.feature:nth-child(3) { animation-delay: 0.2s; }
.feature:nth-child(4) { animation-delay: 0.25s; }

/* Sample link */
.sample-link {
    display: inline-block;
    margin-top: 8px;
    font-weight: 500;
}

/* Summary page styles */
.summary {
    padding: 40px 0 80px;
}

.summary-header {
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--border);
}

.summary-header .back-link {
    display: inline-block;
    margin-bottom: 24px;
    font-size: 0.9rem;
}

.summary-meta {
    margin-bottom: 16px;
}

.summary-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: white;
    background: var(--terracotta);
    padding: 4px 10px;
    border-radius: 3px;
}

.summary-header h1 {
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    margin-bottom: 8px;
}

.summary-date {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin: 0;
}

.summary-section {
    margin-bottom: 40px;
}

.summary-section h2 {
    font-size: 1.4rem;
    margin-bottom: 20px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.summary-section h3 {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    margin-top: 24px;
    margin-bottom: 12px;
}

.summary-section ul {
    margin: 0 0 16px 0;
    padding-left: 24px;
}

.summary-section li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.summary-section p {
    line-height: 1.7;
}

.summary-footer {
    margin-top: 48px;
    padding: 24px;
    background: var(--cream-dark);
    border-radius: 8px;
    text-align: center;
}

.summary-footer p {
    margin: 0;
    color: var(--text-muted);
}
