/* ==========================================================================
   Newsletter Manager — Theme Stylesheet
   Matching the Phōtōnist WordPress Theme (v1.0.0)
   ========================================================================== */

/* --- CSS Custom Properties (Design Tokens) --- */
:root {
    /* Colors */
    --paper: #f5f0e8;
    --paper-dark: #ede6d6;
    --paper-mid: #f0ead8;
    --ink: #1a1208;
    --ink-light: #3d2f1a;
    --ink-faded: #6b5a3e;
    --rule: #8b7355;
    --accent: #8b2500;
    --accent-hover: #6b1c00;
    --page-bg: #cdc0a5;
    --white: #ffffff;

    /* Typography */
    --font-logo: 'UnifrakturMaguntia', 'Georgia', serif;
    --font-heading: 'Playfair Display', 'Georgia', 'Times New Roman', serif;
    --font-body: 'Libre Baskerville', 'Georgia', 'Times New Roman', serif;
    --font-italic: 'IM Fell English', 'Georgia', serif;
    --font-mono: 'Special Elite', 'Courier New', monospace;

    --body-size: 14px;
    --body-line-height: 1.6;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

    /* Layout */
    --content-max-width: 680px;
    --wrapper-padding: 20px;
}

/* --- Reset / Normalize --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    font-family: var(--font-body);
    font-size: var(--body-size);
    line-height: var(--body-line-height);
    color: var(--ink);
    background-color: var(--page-bg);
    min-height: 100vh;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover,
a:focus {
    color: var(--accent-hover);
    text-decoration: underline;
}

a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* --- Page Wrapper --- */
.page-wrapper {
    position: relative;
    min-height: 100vh;
    background-color: var(--page-bg);
}

/* Paper grain texture overlay */
.paper-grain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* Content wrapper (the newspaper look) */
.content-wrapper {
    position: relative;
    z-index: 1;
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: var(--wrapper-padding);
    background-color: var(--paper);
    min-height: 100vh;
    box-shadow:
        0 0 0 1px rgba(139, 115, 85, 0.15),
        0 4px 24px rgba(26, 18, 8, 0.12),
        0 1px 4px rgba(26, 18, 8, 0.06),
        inset 0 0 60px rgba(245, 240, 232, 0.5);
}

/* --- Masthead (Newspaper Header) --- */
.masthead {
    text-align: center;
    padding: var(--space-lg) 0 var(--space-md);
}

.masthead-rule {
    height: 2px;
    background: linear-gradient(
        to right,
        transparent,
        var(--rule) 15%,
        var(--rule) 85%,
        transparent
    );
}

.masthead-rule.top-rule {
    margin-bottom: var(--space-md);
}

.masthead-rule.bottom-rule {
    margin-top: var(--space-md);
}

.masthead-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    padding: var(--space-sm) 0;
}

.masthead-ornament {
    color: var(--rule);
    font-size: 18px;
    line-height: 1;
}

.site-logo {
    font-family: var(--font-logo);
    font-size: 42px;
    font-weight: 400;
    color: var(--ink);
    letter-spacing: 1px;
    line-height: 1.1;
}

.site-logo a {
    color: var(--ink);
    text-decoration: none;
}

.site-logo a:hover {
    color: var(--accent);
}

.masthead-tagline {
    font-family: var(--font-italic);
    font-style: italic;
    color: var(--ink-faded);
    font-size: 13px;
    margin-top: var(--space-sm);
}

/* --- Navigation Bar --- */
.nav-bar {
    background-color: var(--ink);
    margin: var(--space-md) 0 var(--space-xl);
    border-radius: 0;
    overflow: hidden;
}

.nav-list {
    list-style: none;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    margin: 0;
}

.nav-list li {
    margin: 0;
}

.nav-list a {
    display: block;
    padding: var(--space-sm) var(--space-lg);
    color: var(--paper);
    font-family: var(--font-mono);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.nav-list a:hover,
.nav-list a:focus {
    background-color: var(--accent);
    color: var(--white);
    text-decoration: none;
}

/* --- Main Content --- */
.main-content {
    padding: 0 0 var(--space-xl);
}

/* --- Section Headings --- */
.section-heading {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 700;
    color: var(--ink);
    text-align: center;
    margin-bottom: var(--space-md);
    line-height: 1.3;
}

/* --- Subscribe Section --- */
.subscribe-section {
    text-align: center;
    padding: var(--space-xl) 0;
}

.subscribe-intro {
    margin-bottom: var(--space-xl);
}

.subscribe-description {
    font-size: var(--body-size);
    color: var(--ink-light);
    max-width: 480px;
    margin: 0 auto;
    line-height: var(--body-line-height);
}

/* --- Subscribe Form --- */
.subscribe-form {
    max-width: 420px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: var(--space-md);
}

.form-label {
    display: block;
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--ink-light);
    text-align: left;
    margin-bottom: var(--space-xs);
    font-weight: 700;
}

.form-input {
    display: block;
    width: 100%;
    padding: 12px 16px;
    font-family: var(--font-body);
    font-size: 15px;
    color: var(--ink);
    background-color: var(--white);
    border: 1px solid var(--rule);
    border-radius: 0;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(139, 37, 0, 0.15);
}

.form-input::placeholder {
    color: var(--ink-faded);
    font-style: italic;
}

.form-input.error {
    border-color: var(--accent);
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 12px 32px;
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    color: var(--white);
    background-color: var(--accent);
    border: none;
    border-radius: 0;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s ease, transform 0.1s ease;
    -webkit-appearance: none;
    appearance: none;
}

.btn:hover,
.btn:focus {
    background-color: var(--accent-hover);
    color: var(--white);
    text-decoration: none;
}

.btn:active {
    transform: translateY(1px);
}

.btn:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 2px;
}

.btn-subscribe {
    width: 100%;
    margin-top: var(--space-sm);
}

/* --- Privacy Note --- */
.privacy-note {
    font-size: 12px;
    color: var(--ink-faded);
    font-style: italic;
    margin-top: var(--space-md);
}

/* --- Messages / Alerts --- */
.message {
    max-width: 420px;
    margin: 0 auto var(--space-lg);
    padding: 12px 16px;
    font-size: 14px;
    font-family: var(--font-body);
    border: 1px solid;
    text-align: center;
}

.message-success {
    background-color: #f0f7f0;
    border-color: #4a7c4a;
    color: #2d5a2d;
}

.message-error {
    background-color: #fff0ee;
    border-color: var(--accent);
    color: var(--accent);
}

.message-info {
    background-color: #edeef6;
    border-color: #5a5e8b;
    color: #3d4170;
}

/* --- Verified / Unsubscribed Sections --- */
.verified-section,
.unsubscribed-section,
.error-section {
    text-align: center;
    padding: var(--space-2xl) 0;
}

.verified-icon,
.unsubscribed-icon {
    font-size: 48px;
    color: var(--accent);
    margin-bottom: var(--space-md);
    line-height: 1;
}

.unsubscribed-icon {
    color: var(--ink-faded);
}

.verified-description,
.unsubscribed-description,
.error-description {
    font-size: 15px;
    color: var(--ink-light);
    max-width: 480px;
    margin: 0 auto var(--space-lg);
    line-height: var(--body-line-height);
}

.verified-cta,
.unsubscribed-cta,
.error-cta {
    margin-top: var(--space-lg);
}

/* --- Unsubscribe Form --- */
.unsubscribe-form-section {
    text-align: center;
    padding: var(--space-xl) 0;
}

.unsubscribe-form-description {
    font-size: 15px;
    color: var(--ink-light);
    max-width: 480px;
    margin: 0 auto var(--space-xl);
}

.unsubscribe-form {
    max-width: 420px;
    margin: 0 auto;
}

.unsubscribe-note {
    font-size: 12px;
    color: var(--ink-faded);
    margin-top: var(--space-md);
}

/* --- Footer --- */
.site-footer {
    padding: var(--space-lg) 0 var(--space-md);
    text-align: center;
}

.footer-rule {
    height: 1px;
    background: linear-gradient(
        to right,
        transparent,
        var(--rule) 15%,
        var(--rule) 85%,
        transparent
    );
    margin-bottom: var(--space-lg);
}

.footer-inner {
    padding: var(--space-md) 0;
}

.footer-branding {
    font-family: var(--font-heading);
    font-size: 16px;
    color: var(--ink);
    margin-bottom: var(--space-sm);
}

.footer-tagline {
    font-family: var(--font-italic);
    font-style: italic;
    color: var(--ink-faded);
    font-size: 13px;
}

.footer-powered {
    font-size: 12px;
    color: var(--ink-faded);
    margin-bottom: var(--space-xs);
}

.footer-link {
    color: var(--ink-faded);
    text-decoration: underline;
}

.footer-link:hover {
    color: var(--accent);
}

.footer-copyright {
    font-size: 11px;
    color: var(--ink-faded);
}

/* --- Responsive --- */
@media (max-width: 900px) {
    .content-wrapper {
        max-width: 100%;
        padding: var(--space-md);
    }

    .site-logo {
        font-size: 34px;
    }

    .section-heading {
        font-size: 24px;
    }
}

@media (max-width: 700px) {
    .content-wrapper {
        padding: var(--space-sm);
    }

    .site-logo {
        font-size: 28px;
    }

    .masthead-ornament {
        font-size: 14px;
    }

    .masthead-inner {
        gap: var(--space-sm);
    }

    .section-heading {
        font-size: 22px;
    }

    .nav-list {
        flex-direction: column;
    }

    .nav-list a {
        padding: var(--space-sm) var(--space-md);
        text-align: center;
        width: 100%;
    }

    .subscribe-form,
    .unsubscribe-form {
        max-width: 100%;
    }
}

@media (max-width: 420px) {
    .content-wrapper {
        padding: var(--space-sm);
    }

    .site-logo {
        font-size: 24px;
    }

    .masthead-tagline {
        font-size: 11px;
    }

    .section-heading {
        font-size: 20px;
    }

    .btn {
        padding: 10px 24px;
        font-size: 14px;
    }

    .form-input {
        padding: 10px 14px;
        font-size: 14px;
    }

    .footer-branding {
        font-size: 14px;
    }
}
