/* Font Face Declarations */
@font-face {
    font-family: 'Iota';
    src: url('font/iota/iotaweb-book.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Iota';
    src: url('font/iota/iotaweb-bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
}

@font-face {
    font-family: 'Iota';
    src: url('font/iota/iotaweb-black.woff2') format('woff2');
    font-weight: 950;
    font-style: normal;
}

@font-face {
    font-family: 'Lora';
    src: url('font/Lora/static/Lora-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Lora';
    src: url('font/Lora/static/Lora-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: 'Lora';
    src: url('font/Lora/static/Lora-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
}

@font-face {
    font-family: 'Lora';
    src: url('font/Lora/static/Lora-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}

@font-face {
    font-family: 'Lora';
    src: url('font/Lora/static/Lora-Italic.ttf') format('truetype');
    font-weight: 400;
    font-style: italic;
}

/* CSS Variables */
:root {
    --blue: #1d2b5a;
    --white: #fafbfc;
    --paper: #f8f9fa;
    --red: #ff3131;
    --shadow: rgba(0, 0, 0, 0.1);
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    height: -webkit-fill-available;
    background: linear-gradient(135deg, #1d2b5a 0%, #2a3f7a 100%);
    background-attachment: fixed;
}

body {
    font-family: 'Iota', sans-serif;
    font-weight: 400;
    background: linear-gradient(135deg, #1d2b5a 0%, #2a3f7a 100%);
    background-attachment: fixed;
    color: var(--blue);
    line-height: 1.6;
    min-height: 100vh;
    min-height: 100%;
    min-height: -webkit-fill-available;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    /* Extend background into safe areas to cover browser chrome */
    padding-top: max(3rem, calc(env(safe-area-inset-top) + 3rem));
    padding-bottom: max(1rem, calc(env(safe-area-inset-bottom) + 1rem));
    padding-left: max(1rem, calc(env(safe-area-inset-left) + 1rem));
    padding-right: max(1rem, calc(env(safe-area-inset-right) + 1rem));
}

/* Envelope Container */
.envelope {
    max-width: 800px;
    width: 100%;
    padding: 0 1rem 5px 1rem;
}

/* Letter Box */
.letter {
    background: var(--paper);
    border-radius: 24px;
    padding: 2rem 3rem 3.5rem 3rem;
    border: 5px solid rgba(29, 43, 90, 0.2);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3),
                0 10px 30px rgba(0, 0, 0, 0.15);
    position: relative;
    animation: fadeIn 0.4s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Logo */
.logo-container {
    text-align: center;
    margin-bottom: 25px;
    padding-top: 0;
    height: 90px;
}

.logo-link {
    display: inline-block;
    text-decoration: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
    user-drag: none;
    cursor: pointer;
}

.logo {
    max-width: 275px;
    width: 100%;
    height: auto;
    display: inline-block;
    object-fit: contain;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    margin-top: 0;
    margin-bottom: 0;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
    user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -ms-user-drag: none;
}

/* Hero Section */
.hero-section {
    text-align: center;
    margin: 0 0 0 0;
}

/* Tagline below logo */
.tagline {
    text-align: center;
    line-height: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    margin-bottom: -10px;
}

.tagline-line1 {
    font-family: 'Lora', serif;
    font-weight: 400;
    font-size: 2.59rem;
    font-style: italic;
    color: var(--blue);
    display: block;
    line-height: 1;
}

.tagline-america {
    font-family: 'Iota', sans-serif;
    font-weight: 950;
    font-size: 6.47rem;
    color: var(--red);
    letter-spacing: 0.02em;
    text-transform: uppercase;
    display: block;
    line-height: 0.85;
    margin: 0.1rem 0;
}

.tagline-line3 {
    font-family: 'Lora', serif;
    font-weight: 700;
    font-size: 3.24rem;
    font-style: italic;
    color: var(--blue);
    display: block;
    line-height: 1;
}

/* Headings */
h1 {
    font-family: 'Iota', sans-serif;
    font-weight: 700;
    font-size: 2.5rem;
    color: var(--blue);
    text-align: center;
    margin-bottom: 2rem;
    letter-spacing: -0.02em;
    display: none; /* Hidden since logo contains text */
}

h2 {
    font-family: 'Iota', sans-serif;
    font-weight: 700;
    font-size: 1.6rem;
    color: var(--blue);
    text-align: center;
    margin-bottom: 1.5rem;
    letter-spacing: -0.01em;
}

/* Body Text */
.body-text {
    margin-bottom: 2rem;
    margin-top: -0.2rem;
    line-height: 1.8;
}

.body-text p {
    font-family: 'Iota', sans-serif;
    font-weight: 400;
    font-style: normal;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    color: var(--blue);
    text-align: left;
}

.greeting {
    font-size: 1.2rem;
    color: var(--blue);
    margin-bottom: 2rem;
    font-weight: 600;
}

.signature {
    margin-top: 2.5rem;
    font-style: normal;
    text-align: left;
}

.signature-name {
    display: block;
    margin-top: 0.75rem;
    font-weight: 700;
    font-style: normal;
    font-family: 'Iota', sans-serif;
    color: var(--blue);
}

/* Buttons */
.actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin: 1.5rem auto;
    padding: 0;
    text-align: center;
}

.btn-donate {
    display: inline-block;
    padding: 0.875rem 2.5rem;
    min-width: 180px;
    background-color: var(--red);
    color: white;
    font-family: 'Iota', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    border-radius: 50px;
    border: 2px solid var(--red);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.btn-donate:hover {
    background-color: #e02020;
    border-color: #e02020;
    transform: translateY(-2px);
}

.btn-text {
    position: relative;
    z-index: 1;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
}

.btn-donate givebutter-widget {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    opacity: 0.001;
    cursor: pointer;
    z-index: 10;
    pointer-events: auto;
    visibility: visible;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-donate givebutter-widget * {
    width: 100% !important;
    height: 100% !important;
    pointer-events: auto !important;
    cursor: pointer !important;
    margin: 0 auto;
}


.btn {
    font-family: 'Iota', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
    text-align: center;
    border: 2px solid transparent;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--red);
    color: var(--white);
    border-color: var(--red);
}

.btn-primary:hover {
    background-color: #e02020;
    border-color: #e02020;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 49, 49, 0.3);
}

.btn-secondary {
    background-color: transparent;
    color: var(--blue);
    border-color: var(--blue);
}

.btn-secondary:hover {
    background-color: var(--blue);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(29, 43, 90, 0.2);
}

/* Email Signup */
.email-signup {
    border-top: 2px solid rgba(29, 43, 90, 0.1);
    padding-top: 2rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
    padding-bottom: 0;
}

.email-signup h2 {
    margin-bottom: 1rem;
    font-size: 1.8rem;
    letter-spacing: -0.01em;
}

.email-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.email-form input[type="text"],
.email-form input[type="email"],
.email-form input[type="tel"] {
    width: 100%;
    padding: 1.1rem 1.75rem;
    border: 2px solid rgba(29, 43, 90, 0.2);
    border-radius: 50px;
    font-family: 'Iota', sans-serif;
    font-weight: 400;
    font-size: 1rem;
    color: var(--blue);
    background-color: #ffffff;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.form-row input[type="text"] {
    flex: 1;
}

.email-form input[type="text"]:focus,
.email-form input[type="email"]:focus,
.email-form input[type="tel"]:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(29, 43, 90, 0.1),
                0 4px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.email-form input::placeholder {
    color: rgba(29, 43, 90, 0.5);
    font-weight: 400;
    font-style: normal;
}

.btn-submit {
    font-family: 'Iota', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    padding: 1.2rem 2.5rem;
    background-color: var(--blue);
    color: var(--white);
    border: 2px solid var(--blue);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-submit:hover:not(:disabled) {
    background-color: #2a3f7a;
    border-color: #2a3f7a;
    transform: translateY(-2px);
}

.btn-submit:active:not(:disabled) {
    transform: translateY(0);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.form-message {
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-top: 1rem;
    margin-bottom: 0;
    font-family: 'Iota', sans-serif;
    font-weight: 400;
    font-size: 0.95rem;
    text-align: center;
}

.form-message.success {
    background-color: rgba(76, 175, 80, 0.1);
    color: #2e7d32;
    border: 2px solid rgba(76, 175, 80, 0.3);
}

.form-message.error {
    background-color: rgba(244, 67, 54, 0.1);
    color: #c62828;
    border: 2px solid rgba(244, 67, 54, 0.3);
}

/* Map Simple Section */
.map-simple-section {
    margin: -0.5rem auto 0 auto;
    padding: 0;
    text-align: center;
}

.map-container {
    position: relative;
    width: 100%;
    max-width: 570px;
    margin: 0 auto;
    display: inline-block;
}

.map-base {
    width: 100%;
    height: auto;
    display: block;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.map-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    animation: mapReveal 4s ease-in-out infinite;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

@keyframes mapReveal {
    0%, 100% {
        clip-path: inset(0 100% 0 0);
    }
    50% {
        clip-path: inset(0 0 0 0);
    }
}

/* Social Links */
.social-links {
    text-align: center;
    padding-top: 1.5rem;
    margin-top: 0;
    border-top: 2px solid rgba(29, 43, 90, 0.1);
}

.social-links p {
    font-family: 'Iota', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--blue);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.social-icons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    align-items: center;
}

.social-link {
    color: var(--blue);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-link:hover {
    color: var(--red);
    transform: translateY(-3px);
}

.social-link svg {
    width: 28px;
    height: 28px;
}

/* Copyright */
.copyright {
    text-align: center;
    padding-top: 1.5rem;
    margin-top: 1.5rem;
    border-top: 2px solid rgba(29, 43, 90, 0.1);
}

.copyright p {
    font-family: 'Iota', sans-serif;
    font-weight: 400;
    font-size: 0.85rem;
    color: rgba(29, 43, 90, 0.6);
    margin: 0;
}


/* Responsive Design */

/* Tablet (768px and below) */
@media (max-width: 768px) {
    .letter {
        padding: 2rem 1.5rem;
        border-radius: 20px;
    }

    .logo-container {
        margin-bottom: 0;
    }

    .logo {
        max-width: 199px;
    }

    .tagline {
        margin-top: 1.5rem;
        gap: 0.2rem;
        margin-bottom: -8px;
    }

    .tagline-line1 {
        font-size: 1.9rem;
    }

    .tagline-america {
        font-size: 4.8rem;
    }

    .tagline-line3 {
        font-size: 2.4rem;
    }

    .map-container {
        max-width: 410px;
    }

    .map-simple-section {
        margin: 2.5rem 0 2rem 0;
    }

    .map-simple {
        max-width: 100%;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    .body-text p {
        font-size: 1rem;
    }

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

    .btn-donate {
        min-width: 100%;
        width: 100%;
        padding: 1rem 2rem;
        position: relative;
    }

    .btn-donate givebutter-widget {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 100% !important;
        height: 100% !important;
        opacity: 0.001;
        z-index: 10;
        pointer-events: auto;
        visibility: visible;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .btn {
        width: 100%;
    }

    .email-signup h2 {
        font-size: 1.5rem;
    }

    .email-form {
        gap: 0.875rem;
    }

    .form-row {
        flex-direction: column;
        gap: 0.875rem;
    }

    .email-form input[type="text"],
    .email-form input[type="email"],
    .email-form input[type="tel"] {
        padding: 1rem 1.5rem;
        font-size: 0.95rem;
    }

    .btn-submit {
        width: 100%;
        padding: 1.1rem 2rem;
        font-size: 1rem;
    }

    .social-links {
        padding-top: 1.25rem;
    }

    .social-links p {
        font-size: 0.9rem;
    }

    .social-icons {
        gap: 1.25rem;
        flex-wrap: wrap;
    }

    .social-link svg {
        width: 24px;
        height: 24px;
    }
}

/* Mobile (480px and below) */
@media (max-width: 480px) {
    body {
        padding-top: max(1rem, env(safe-area-inset-top));
        padding-bottom: max(3rem, calc(env(safe-area-inset-bottom) + 2rem));
        padding-left: max(0.25rem, env(safe-area-inset-left));
        padding-right: max(0.25rem, env(safe-area-inset-right));
        min-height: 100vh;
        min-height: -webkit-fill-available;
        /* Ensure background covers entire viewport including safe areas */
        background-size: 100% 100%;
        background-position: center;
    }

    .envelope {
        padding: 1rem;
    }

    .letter {
        padding: 1.25rem 0.75rem;
    }

    .logo-container {
        margin-bottom: 0;
    }

    .logo {
        max-width: 187px;
    }

    .tagline {
        margin-top: 1rem;
        gap: 0.15rem;
        margin-bottom: -30px;
    }

    .tagline-line1 {
        font-size: 1.62rem;
    }

    .tagline-america {
        font-size: 4.04rem;
    }

    .tagline-line3 {
        font-size: 2.03rem;
    }

    .map-container {
        max-width: 310px;
    }

    h1 {
        font-size: 1.75rem;
    }
    
    .body-text {
        margin-top: -1.5rem;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .body-text p {
        font-size: 1rem;
    }

    .email-signup h2 {
        font-size: 1.4rem;
    }

    .email-form input[type="text"],
    .email-form input[type="email"],
    .email-form input[type="tel"] {
        padding: 0.95rem 1.4rem;
        font-size: 0.9rem;
    }

    .btn-submit {
        padding: 1rem 1.75rem;
        font-size: 0.95rem;
    }

    .btn-donate {
        min-width: 100%;
        width: 100%;
        padding: 1rem 2rem;
    }

    .btn-donate givebutter-widget {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 100% !important;
        height: 100% !important;
        opacity: 0.001;
        z-index: 10;
        pointer-events: auto;
        visibility: visible;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .social-links {
        padding-top: 1.25rem;
        margin-top: 1.5rem;
    }

    .social-links p {
        font-size: 0.85rem;
        margin-bottom: 0.75rem;
    }

    .social-icons {
        gap: 1rem;
        flex-wrap: wrap;
    }

    .social-link svg {
        width: 22px;
        height: 22px;
    }
}

