/*
Theme Name: Missionary Field Notes
Theme URI: https://example.com/missionary-field-notes
Author: GitHub Copilot
Description: A warm, modern WordPress theme for missionaries sharing field updates and collecting financial support.
Version: 1.0.0
Requires at least: 6.4
Tested up to: 6.5
Requires PHP: 7.4
Text Domain: missionary-blowsite
*/

:root {
    --color-ink: #21313d;
    --color-ink-soft: #4e6671;
    --color-cream: #fcf8f2;
    --color-sky: #d8e9e5;
    --color-sea: #3f7c76;
    --color-sea-deep: #2d5d58;
    --color-clay: #d5835b;
    --color-border: rgba(33, 49, 61, 0.12);
    --color-shadow: rgba(24, 39, 52, 0.12);
    --font-heading: "Fraunces", Georgia, Cambria, serif;
    --font-body: "Source Sans 3", "Segoe UI", sans-serif;
    --container: 1140px;
    --radius-lg: 24px;
    --radius-md: 18px;
    --radius-sm: 12px;
    --shadow-lg: 0 24px 70px var(--color-shadow);
    --shadow-sm: 0 14px 32px rgba(24, 39, 52, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at top left, rgba(216, 233, 229, 0.55), transparent 34%),
        linear-gradient(180deg, #fffdf9 0%, #f8f2e8 100%);
    color: var(--color-ink);
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.7;
}

a {
    color: var(--color-sea-deep);
    text-decoration: none;
}

a:hover,
a:focus {
    color: var(--color-clay);
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.site-shell {
    min-height: 100vh;
}

.wrap {
    width: min(calc(100% - 2rem), var(--container));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    backdrop-filter: blur(18px);
    background: rgba(252, 248, 242, 0.9);
    border-bottom: 1px solid rgba(33, 49, 61, 0.08);
}

.header-inner,
.footer-inner,
.hero-inner,
.content-grid,
.intro-grid,
.post-grid,
.page-grid,
.give-grid,
.story-grid,
.contact-grid {
    display: grid;
    gap: 1.5rem;
}

.header-inner {
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "branding nav cta";
    align-items: center;
    min-height: 84px;
}

.site-branding {
    grid-area: branding;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.site-title {
    font-family: var(--font-heading);
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.site-title a {
    color: var(--color-ink);
}

.site-description {
    color: var(--color-ink-soft);
    font-size: 0.95rem;
}

.main-navigation {
    grid-area: nav;
}

.menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    color: var(--color-ink);
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1;
    padding: 0.65rem 0.95rem;
    cursor: pointer;
}

.menu-toggle-lines,
.menu-toggle-lines::before,
.menu-toggle-lines::after {
    display: block;
    width: 1.1rem;
    height: 2px;
    background: currentColor;
    border-radius: 999px;
    transition: transform 0.2s ease, opacity 0.2s ease;
    content: "";
}

.menu-toggle-lines {
    position: relative;
}

.menu-toggle-lines::before {
    position: absolute;
    top: -0.35rem;
    left: 0;
}

.menu-toggle-lines::after {
    position: absolute;
    top: 0.35rem;
    left: 0;
}

.main-navigation ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.1rem;
    padding: 0;
    margin: 0;
    list-style: none;
}

.main-navigation a {
    font-weight: 600;
    color: var(--color-ink);
}

.header-cta {
    grid-area: cta;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.6rem;
}

.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.social-link-item a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 999px;
    border: 1px solid var(--color-border);
    background: rgba(255, 255, 255, 0.78);
    color: var(--color-ink);
    padding: 0;
}

.social-link-item a:hover,
.social-link-item a:focus {
    border-color: rgba(63, 124, 118, 0.3);
    background: rgba(216, 233, 229, 0.9);
    color: var(--color-sea-deep);
}

.social-link-item svg {
    width: 1.15rem;
    height: 1.15rem;
    fill: currentColor;
}

.social-links-footer {
    margin: 0.8rem 0 1rem;
}

.button,
.wp-block-button__link,
button,
input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    border: 0;
    border-radius: 999px;
    background: var(--color-sea);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    line-height: 1;
    padding: 1rem 1.4rem;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 12px 28px rgba(63, 124, 118, 0.24);
}

.button:hover,
.button:focus,
.wp-block-button__link:hover,
.wp-block-button__link:focus,
button:hover,
button:focus,
input[type="submit"]:hover,
input[type="submit"]:focus {
    background: var(--color-sea-deep);
    color: #fff;
    transform: translateY(-2px);
}

.button-secondary {
    background: rgba(255, 255, 255, 0.75);
    color: var(--color-ink);
    box-shadow: none;
}

.hero {
    position: relative;
    padding: 5rem 0 4rem;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(140deg, rgba(33, 49, 61, 0.68), rgba(45, 93, 88, 0.42)),
        var(--hero-image, linear-gradient(135deg, #547f88 0%, #b7d4c3 100%));
    background-size: cover;
    background-position: center;
    transform: scale(1.03);
}

.hero::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 120px;
    background: linear-gradient(180deg, transparent 0%, rgba(248, 242, 232, 0.98) 100%);
}

.hero-inner {
    position: relative;
    z-index: 1;
    grid-template-columns: minmax(0, 1fr);
    align-items: end;
}

.hero-copy,
.hero-card,
.panel,
.post-card,
.story-card,
.sidebar-card,
.give-card,
.contact-card {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.hero-copy {
    color: #fff;
    padding: 2rem 0;
}

.eyebrow {
    display: inline-block;
    margin-bottom: 0.9rem;
    padding: 0.3rem 0.8rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero h1,
.section-title,
.entry-title,
.page-title {
    font-family: var(--font-heading);
    letter-spacing: -0.04em;
    line-height: 1.08;
}

.hero h1 {
    max-width: 12ch;
    margin: 0 0 1rem;
    font-size: clamp(2.4rem, 6vw, 5rem);
}

.hero p {
    max-width: 38rem;
    margin: 0 0 1.4rem;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
}

.hero-card,
.panel,
.post-card,
.story-card,
.sidebar-card,
.give-card,
.contact-card {
    background: rgba(252, 248, 242, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.section {
    padding: 4.5rem 0;
}

.section-title {
    margin: 0 0 0.8rem;
    font-size: clamp(2rem, 3vw, 3rem);
}

.section-copy {
    max-width: 42rem;
    margin: 0 0 2rem;
    color: var(--color-ink-soft);
}

.intro-grid,
.page-grid,
.story-grid,
.give-grid,
.contact-grid {
    grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
    align-items: start;
}

.panel,
.post-card,
.story-card,
.sidebar-card,
.give-card,
.contact-card {
    padding: 1.75rem;
}

.panel-muted {
    background: linear-gradient(180deg, rgba(216, 233, 229, 0.58), rgba(255, 255, 255, 0.92));
}

.mission-statement {
    font-size: 1.2rem;
    color: var(--color-ink);
}

.post-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.post-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 100%;
    box-shadow: var(--shadow-sm);
}

.post-card-thumbnail {
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 16 / 10;
    background: linear-gradient(135deg, rgba(216, 233, 229, 0.8), rgba(213, 131, 91, 0.35));
}

.post-card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-meta,
.entry-meta,
.widget-title,
.sidebar-list time {
    color: var(--color-ink-soft);
    font-size: 0.95rem;
}

.post-card h3,
.entry-title,
.page-title {
    margin: 0;
    font-size: clamp(1.65rem, 2vw, 2.35rem);
}

.post-card h3 {
    font-size: 1.45rem;
}

.content-grid {
    grid-template-columns: minmax(0, 2fr) minmax(280px, 0.95fr);
    align-items: start;
}

.entry-content,
.page-content {
    color: var(--color-ink);
}

.entry-content > *:first-child,
.page-content > *:first-child,
.panel > *:first-child,
.story-card > *:first-child,
.give-card > *:first-child,
.contact-card > *:first-child,
.sidebar-card > *:first-child {
    margin-top: 0;
}

.entry-content > *:last-child,
.page-content > *:last-child,
.panel > *:last-child,
.story-card > *:last-child,
.give-card > *:last-child,
.contact-card > *:last-child,
.sidebar-card > *:last-child {
    margin-bottom: 0;
}

.sidebar-stack {
    display: grid;
    gap: 1.25rem;
}

.sidebar-list {
    padding: 0;
    margin: 1rem 0 0;
    list-style: none;
}

.sidebar-list li + li {
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--color-border);
}

.donation-ask {
    background: linear-gradient(180deg, rgba(63, 124, 118, 0.1), rgba(213, 131, 91, 0.08));
}

.archive-header,
.page-header,
.single-header {
    padding: 4rem 0 2rem;
}

.archive-header .page-title,
.page-header .page-title,
.single-header .entry-title {
    margin-bottom: 0.75rem;
}

.entry-thumbnail,
.page-hero-media {
    margin-bottom: 1.5rem;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.site-footer {
    margin-top: 4rem;
    border-top: 1px solid rgba(33, 49, 61, 0.08);
    background: rgba(255, 255, 255, 0.62);
}

.footer-inner {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 2.25rem 0;
    align-items: start;
}

.footer-note {
    color: var(--color-ink-soft);
    font-size: 0.95rem;
}

.footer-menu {
    padding: 0;
    margin: 0;
    list-style: none;
}

.footer-menu li + li {
    margin-top: 0.45rem;
}

.search-form,
.wp-block-search {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

input[type="text"],
input[type="email"],
input[type="url"],
textarea,
select {
    width: 100%;
    border: 1px solid rgba(33, 49, 61, 0.14);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.86);
    color: var(--color-ink);
    font: inherit;
    padding: 0.9rem 1rem;
}

.wp-block-quote,
blockquote {
    margin: 2rem 0;
    padding: 1rem 1.25rem;
    border-left: 4px solid var(--color-clay);
    background: rgba(255, 255, 255, 0.68);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.wp-block-gallery,
.wp-block-image,
.wp-block-video,
.wp-block-embed {
    margin-bottom: 1.5rem;
}

.empty-state {
    padding: 2rem;
    border: 1px dashed rgba(33, 49, 61, 0.18);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.58);
}

@media (max-width: 1160px) {
    .header-inner {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "branding cta"
            "nav nav";
        gap: 0.9rem 1rem;
        min-height: 0;
        padding: 0.95rem 0;
    }

    .main-navigation ul {
        justify-content: flex-start;
        gap: 0.9rem;
    }

    .hero {
        padding: 4.25rem 0 3.4rem;
    }

    .section {
        padding: 3.75rem 0;
    }
}

@media (max-width: 960px) {
    .header-inner,
    .hero-inner,
    .content-grid,
    .intro-grid,
    .page-grid,
    .post-grid,
    .story-grid,
    .give-grid,
    .contact-grid,
    .footer-inner {
        grid-template-columns: 1fr;
    }

    .header-inner {
        grid-template-areas:
            "branding"
            "cta"
            "toggle"
            "nav";
        padding: 0.95rem 0;
    }

    .menu-toggle {
        display: inline-flex;
        grid-area: toggle;
        justify-self: flex-start;
    }

    .header-cta {
        align-items: flex-start;
        width: 100%;
    }

    .main-navigation ul {
        justify-content: flex-start;
        gap: 0.7rem;
    }

    .has-js .main-navigation {
        display: block;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: max-height 0.25s ease, opacity 0.2s ease;
    }

    .site-header.nav-open .main-navigation {
        max-height: 420px;
        opacity: 1;
    }

    .site-header.nav-open .menu-toggle-lines {
        background: transparent;
    }

    .site-header.nav-open .menu-toggle-lines::before {
        top: 0;
        transform: rotate(45deg);
    }

    .site-header.nav-open .menu-toggle-lines::after {
        top: 0;
        transform: rotate(-45deg);
    }

    .section {
        padding: 3.2rem 0;
    }

    .site-header {
        position: static;
    }
}

@media (max-width: 640px) {
    body {
        font-size: 17px;
    }

    .wrap {
        width: min(calc(100% - 1.25rem), var(--container));
    }

    .hero h1 {
        max-width: none;
    }

    .menu-toggle {
        font-size: 1rem;
        padding: 0.8rem 1.15rem;
        min-height: 48px;
        gap: 0.75rem;
    }

    .menu-toggle-lines,
    .menu-toggle-lines::before,
    .menu-toggle-lines::after {
        width: 1.25rem;
    }

    .main-navigation ul {
        gap: 0.35rem;
    }

    .main-navigation li {
        width: 100%;
    }

    .main-navigation a {
        display: block;
        width: 100%;
        font-size: 1.03rem;
        padding: 0.72rem 0.85rem;
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.76);
    }

    .button,
    .button-secondary,
    .wp-block-button__link,
    button,
    input[type="submit"] {
        width: 100%;
    }

    .header-cta .button {
        width: auto;
        min-width: 10rem;
    }

    .hero-actions {
        flex-direction: column;
    }

    .social-links {
        width: 100%;
    }

    .footer-inner {
        gap: 1.1rem;
        padding: 1.6rem 0;
    }

    .panel,
    .post-card,
    .story-card,
    .sidebar-card,
    .give-card,
    .contact-card,
    .hero-card {
        padding: 1.2rem;
    }

}

/* Contact Form Styles */
.contact-form {
    display: grid;
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.form-group {
    display: grid;
    gap: 0.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--color-ink);
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea {
    border: 1px solid rgba(33, 49, 61, 0.16);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--color-ink);
    font: inherit;
    padding: 0.85rem 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-sea);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(63, 124, 118, 0.12);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(33, 49, 61, 0.45);
}

.contact-form button {
    margin-top: 0.5rem;
}

.contact-form-message {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.contact-form-success {
    background: rgba(76, 175, 80, 0.08);
    border: 1px solid rgba(76, 175, 80, 0.25);
    color: #2e7d32;
}

.contact-form-success p {
    margin: 0;
    font-weight: 600;
}

.contact-form-errors {
    background: rgba(211, 47, 47, 0.08);
    border: 1px solid rgba(211, 47, 47, 0.25);
    color: #c62828;
}

.contact-form-errors p {
    margin: 0 0 0.5rem;
    font-weight: 600;
}

.contact-form-errors ul {
    margin: 0;
    padding-left: 1.5rem;
}

.contact-form-errors li {
    margin: 0.3rem 0;
}

/* Loading Animation & Form States */
@keyframes spinLoader {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.button-loader {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #fff;
    border-radius: 50%;
    animation: spinLoader 0.8s linear infinite;
}

button[type="submit"]:disabled,
input[type="submit"]:disabled {
    opacity: 0.85;
    cursor: not-allowed;
}

button.is-loading,
input.is-loading {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
}

.contact-form-message {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.contact-form-success {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.12), rgba(56, 142, 60, 0.08));
    border-left: 4px solid #4caf50;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.15);
}

.contact-form-success p {
    color: #2e7d32;
    font-weight: 600;
    font-size: 1.05rem;
}

.contact-form-errors {
    background: linear-gradient(135deg, rgba(244, 67, 54, 0.12), rgba(211, 47, 47, 0.08));
    border-left: 4px solid #f44336;
    box-shadow: 0 2px 8px rgba(244, 67, 54, 0.15);
}


