:root {
    --primary-color: #2c3e50;
    --accent-color: #8e44ad;
    --bg-color: #f8f9fa;
    --text-color: #4a4a4a;
    --light-text: #ffffff;
    --card-bg: #ffffff;
    --border-radius: 4px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    line-height: 1.8;
    color: var(--text-color);
    background-color: var(--bg-color);
    margin: 0;
    padding: 0;
    font-weight: 300;
}

header {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1.2rem 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid #eee;
    transition: box-shadow 0.3s ease, padding 0.3s ease;
}

/* Sticky state (added by JS once the page is scrolled):
   a subtle tinted background with a faint dot pattern, so the bar reads as "pinned". */
header.scrolled {
    padding-top: 0.9rem;
    padding-bottom: 0.9rem;
    box-shadow: 0 2px 16px rgba(0,0,0,0.12);
    background-color: #f3f0f7;
    background-image: radial-gradient(rgba(142, 68, 173, 0.08) 1px, transparent 1px);
    background-size: 16px 16px;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

nav .logo {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.8rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--primary-color);
    letter-spacing: 1px;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 30px;
    margin: 0;
    padding: 0;
}

nav ul li a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.3s ease;
}

nav ul li a:hover {
    color: var(--accent-color);
}

/* Hamburger toggle (hidden on desktop) */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    line-height: 0;
}

.nav-toggle span {
    display: block;
    width: 26px;
    height: 2px;
    background: var(--primary-color);
    margin: 6px 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Animate to an X when open */
.nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Hero & Banners */
.hero {
    background: linear-gradient(rgba(44, 62, 80, 0.85), rgba(44, 62, 80, 0.85)), url('images/funeral-photo-magnets-tributemagnets-com.jpg') center/cover no-repeat;
    color: var(--light-text);
    text-align: center;
    padding: 8rem 1rem;
}

.hero2 {
    background: linear-gradient(rgba(44, 62, 80, 0.85), rgba(44, 62, 80, 0.85)), url('images/in-memory-of-magnets-c.jpg') center/cover no-repeat;
    color: var(--light-text);
    text-align: center;
    padding: 8rem 1rem;
}

.page-banner {
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    padding: 8rem 1rem;
}

.hero-content h1, .page-banner h1 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 600;
    letter-spacing: 1px;
}

.hero-content p, .page-banner p {
    font-size: 1.1rem;
    font-weight: 300;
    max-width: 600px;
    margin: 0 auto 2rem auto;
    opacity: 0.9;
}

#emailCapture {
    margin-top: 2rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    border-radius: var(--border-radius);
}

/* Honeypot: visually hidden, off-screen, skipped by keyboard/AT. Bots still fill it. */
.hp-field {
    position: absolute !important;
    left: -9999px !important;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
}

/* Cloudflare Turnstile widget spacing */
.cf-turnstile {
    flex-basis: 100%;
    display: flex;
    justify-content: center;
    margin-top: 14px;
}

#emailCapture input {
    padding: 15px 20px;
    font-size: 1rem;
    border: none;
    flex-grow: 1;
    font-family: 'Montserrat', sans-serif;
    border-radius: var(--border-radius) 0 0 var(--border-radius);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

#emailCapture button {
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

#emailCapture button {
    padding: 15px 30px;
    font-size: 0.9rem;
    background-color: var(--accent-color);
    color: white;
    border: none;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    transition: background 0.3s ease;
}

#emailCapture button:hover {
    background-color: #732d91;
}

#formMessage {
    color: var(--light-text);
    font-weight: 500;
}

#contactMessage {
    color: var(--primary-color);
    font-weight: 500;
    margin-top: 1rem;
}

.usa-badge {
    display: inline-block;
    font-size: 0.85rem !important;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin: 0 auto 1.5rem auto !important;
    opacity: 1 !important;
}

/* Reusable inline US flag (SVG data URI) */
.flag-usa {
    display: inline-block;
    width: 1.3em;
    height: 0.87em;
    vertical-align: -0.14em;
    margin-right: 0.45em;
    border-radius: 1px;
    background-size: cover;
    box-shadow: 0 0 0 0.5px rgba(0,0,0,0.15);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 38 20'%3E%3Crect width='38' height='20' fill='%23b22234'/%3E%3Cg fill='%23fff'%3E%3Crect y='1.54' width='38' height='1.54'/%3E%3Crect y='4.62' width='38' height='1.54'/%3E%3Crect y='7.69' width='38' height='1.54'/%3E%3Crect y='10.77' width='38' height='1.54'/%3E%3Crect y='13.85' width='38' height='1.54'/%3E%3Crect y='16.92' width='38' height='1.54'/%3E%3C/g%3E%3Crect width='15.2' height='10.77' fill='%233c3b6e'/%3E%3Cg fill='%23fff'%3E%3Ccircle cx='1.9' cy='1.5' r='0.6'/%3E%3Ccircle cx='4.9' cy='1.5' r='0.6'/%3E%3Ccircle cx='7.9' cy='1.5' r='0.6'/%3E%3Ccircle cx='10.9' cy='1.5' r='0.6'/%3E%3Ccircle cx='13.3' cy='1.5' r='0.6'/%3E%3Ccircle cx='3.4' cy='4.2' r='0.6'/%3E%3Ccircle cx='6.4' cy='4.2' r='0.6'/%3E%3Ccircle cx='9.4' cy='4.2' r='0.6'/%3E%3Ccircle cx='12.1' cy='4.2' r='0.6'/%3E%3Ccircle cx='1.9' cy='6.9' r='0.6'/%3E%3Ccircle cx='4.9' cy='6.9' r='0.6'/%3E%3Ccircle cx='7.9' cy='6.9' r='0.6'/%3E%3Ccircle cx='10.9' cy='6.9' r='0.6'/%3E%3Ccircle cx='13.3' cy='6.9' r='0.6'/%3E%3Ccircle cx='3.4' cy='9.3' r='0.6'/%3E%3Ccircle cx='6.4' cy='9.3' r='0.6'/%3E%3Ccircle cx='9.4' cy='9.3' r='0.6'/%3E%3Ccircle cx='12.1' cy='9.3' r='0.6'/%3E%3C/g%3E%3C/svg%3E");
}

/* Guide links block */
.guide-links {
    margin-top: 3rem;
}

.guide-links h2 {
    font-family: 'Cormorant Garamond', serif;
    color: var(--primary-color);
    font-size: 2.2rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.guide-links ul {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.guide-links li a {
    display: block;
    background: var(--card-bg);
    padding: 1rem 1.25rem;
    border: 1px solid #eee;
    border-radius: var(--border-radius);
    box-shadow: 0 3px 10px rgba(0,0,0,0.04);
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: transform 0.2s ease, color 0.2s ease;
}

.guide-links li a:hover {
    transform: translateY(-3px);
    color: var(--accent-color);
}

/* Contact Section */
.contact-section {
    background: var(--card-bg);
    padding: 3rem;
    border-radius: var(--border-radius);
    margin-top: 4rem;
    border: 1px solid #eee;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    text-align: center;
}

.contact-section h2 {
    font-family: 'Cormorant Garamond', serif;
    color: var(--primary-color);
    font-size: 2.2rem;
    margin-top: 0;
    margin-bottom: 1rem;
    font-weight: 600;
}

.contact-email {
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.contact-email a {
    color: var(--accent-color);
    text-decoration: none;
    border-bottom: 1px solid var(--accent-color);
}

#contactForm {
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#contactForm input,
#contactForm textarea {
    padding: 14px 18px;
    font-size: 1rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-family: 'Montserrat', sans-serif;
    width: 100%;
}

#contactForm button {
    padding: 15px 30px;
    font-size: 0.9rem;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    transition: background 0.3s ease;
}

#contactForm button:hover {
    background-color: #732d91;
}

/* Content Layout */
.container {
    max-width: 900px;
    margin: 4rem auto;
    padding: 0 2rem;
}

article h2 {
    font-family: 'Cormorant Garamond', serif;
    color: var(--primary-color);
    font-size: 2.2rem;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

/* First heading right after the article image should sit closer to it */
article img + h2,
article img + h3 {
    margin-top: 0.5rem;
}

article h3 {
    font-family: 'Montserrat', sans-serif;
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

article p {
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
    color: #555;
}

article a {
    color: var(--accent-color);
    text-decoration: none;
    border-bottom: 1px solid var(--accent-color);
}

article a:hover {
    color: #732d91;
}

/* SVG Image Styling */
.content-image {
    width: 100%;
    max-width: 800px;
    margin: 2rem auto;
    display: block;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

/* Feature Cards (Premium Touch) */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.feature-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    border: 1px solid #eee;
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-card svg {
    width: 50px;
    height: 50px;
    margin-bottom: 1rem;
    fill: var(--accent-color);
}

.feature-card h4 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.4rem;
    color: var(--primary-color);
    margin: 0.5rem 0;
}

.feature-card p {
    font-size: 0.9rem;
    color: #666;
    margin: 0;
}

/* FAQ */
.faq-section {
    background-color: #fff;
    padding: 2.5rem;
    border-radius: var(--border-radius);
    margin-top: 3rem;
    border: 1px solid #eee;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.faq-section h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.breadcrumbs {
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.breadcrumbs a {
    color: #ccc;
    text-decoration: none;
    border-bottom: none;
}

.breadcrumbs a:hover {
    color: #fff;
}

footer {
    background-color: var(--primary-color);
    color: var(--light-text);
    text-align: center;
    padding: 3rem 1rem;
    margin-top: 4rem;
}

footer p {
    opacity: 0.7;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    nav {
        flex-wrap: wrap;
    }
    .nav-toggle {
        display: block;
    }
    nav ul {
        flex-basis: 100%;
        flex-direction: column;
        gap: 0;
        display: none;
        margin-top: 1rem;
    }
    nav ul.open {
        display: flex;
    }
    nav ul li {
        border-top: 1px solid #eee;
    }
    nav ul li a {
        display: block;
        padding: 14px 4px;
        font-size: 1rem;
    }
    .hero-content h1, .page-banner h1 {
        font-size: 2.2rem;
    }
    #emailCapture {
        flex-direction: column;
        box-shadow: none;
    }
    #emailCapture button {
        margin-top: 10px;
    }
    .container {
        padding: 0 1.5rem;
    }
}