/* ========================================
   Jamie Giddens — Rooted in Faith
   Earthy Catholic Garden Design System
   ======================================== */

/* ---------- Color Palette ----------
   #ddcecd  Soft warm beige/mauve — surfaces, backgrounds
   #eee5e5  Light cream — page background
   #70a288  Sage green — primary accent
   #4b3b40  Dark plum/brown — nav, headings, dark UI
   #654c4f  Muted dark mauve — secondary dark, text
   ------------------------------------ */

:root {
    /* Core palette */
    --jg-bg:          #eee5e5;
    --jg-surface:     #FFFFFF;
    --jg-surface-2:   #ddcecd;
    --jg-surface-alt: #f5efef;
    --jg-border:      #d4c3c1;

    /* Text */
    --jg-text:        #4b3b40;
    --jg-text-2:      #654c4f;
    --jg-text-3:      #9a8588;

    /* Primary accent — sage green */
    --jg-accent:       #70a288;
    --jg-accent-hover: #5d8f75;
    --jg-accent-soft:  rgba(112,162,136,.12);
    --jg-accent-deep:  #4a7a62;

    /* Warm tones (from palette) */
    --jg-warm:         #654c4f;
    --jg-warm-soft:    rgba(101,76,79,.08);
    --jg-warm-light:   #ddcecd;

    /* Navigation */
    --jg-nav:          #4b3b40;
    --jg-nav-text:     #ddcecd;
    --jg-nav-hover:    #FFFFFF;

    /* Status */
    --jg-danger:       #a04040;
    --jg-success:      #5d8f75;

    /* Spacing & effects */
    --jg-radius:       10px;
    --jg-radius-lg:    16px;
    --jg-shadow-sm:    0 1px 3px rgba(75,59,64,.06);
    --jg-shadow:       0 4px 20px rgba(75,59,64,.08);
    --jg-shadow-lg:    0 12px 40px rgba(75,59,64,.12);
    --jg-transition:   .2s cubic-bezier(.4,0,.2,1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Lora', Georgia, 'Times New Roman', serif;
    background: var(--jg-bg);
    color: var(--jg-text);
    line-height: 1.75;
    margin: 0;
    font-size: 16px;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', Georgia, serif;
    color: var(--jg-text);
    line-height: 1.3;
    margin-top: 0;
}

h1:focus { outline: none; }

p { margin-bottom: 1rem; }

a {
    color: var(--jg-accent-deep);
    text-decoration: none;
    transition: color var(--jg-transition);
}
a:hover {
    color: var(--jg-accent);
}

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

/* ---------- Buttons ---------- */
.btn {
    font-family: 'Lora', Georgia, serif;
    font-weight: 500;
    border-radius: var(--jg-radius);
    padding: .6rem 1.5rem;
    transition: all var(--jg-transition);
    letter-spacing: .01em;
    font-size: .92rem;
}

.btn-primary {
    color: #fff;
    background: var(--jg-accent);
    border-color: var(--jg-accent);
}
.btn-primary:hover, .btn-primary:focus {
    background: var(--jg-accent-hover);
    border-color: var(--jg-accent-hover);
    box-shadow: 0 4px 14px rgba(112,162,136,.3);
    transform: translateY(-1px);
}

.btn-outline-earth {
    color: var(--jg-text);
    background: transparent;
    border: 1.5px solid var(--jg-border);
}
.btn-outline-earth:hover {
    background: var(--jg-accent-soft);
    border-color: var(--jg-accent);
    color: var(--jg-accent-deep);
}

.btn-outline-dark {
    color: var(--jg-text);
    border: 1.5px solid var(--jg-text);
    background: transparent;
}
.btn-outline-dark:hover {
    background: var(--jg-text);
    color: #fff;
}

.btn-outline-danger {
    color: var(--jg-danger);
    border: 1.5px solid var(--jg-danger);
    background: transparent;
}
.btn-outline-danger:hover {
    background: var(--jg-danger);
    color: #fff;
}

.btn-outline-light {
    border-width: 1.5px;
}
.btn-outline-light:hover {
    background: rgba(255,255,255,.12);
}

.btn:focus, .btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 3px var(--jg-accent-soft);
}

/* ---------- Forms ---------- */
.form-control {
    font-family: 'Lora', Georgia, serif;
    border: 1.5px solid var(--jg-border);
    border-radius: var(--jg-radius);
    padding: .65rem 1rem;
    background: var(--jg-surface);
    transition: border-color var(--jg-transition), box-shadow var(--jg-transition);
}
.form-control:focus {
    border-color: var(--jg-accent);
    background: var(--jg-surface);
    box-shadow: 0 0 0 3px var(--jg-accent-soft);
}
.form-label {
    font-weight: 500;
    font-size: .9rem;
    color: var(--jg-text-2);
    margin-bottom: .35rem;
}

/* ---------- Cards ---------- */
.card {
    border: 1px solid var(--jg-border);
    background: var(--jg-surface);
    border-radius: var(--jg-radius-lg);
    box-shadow: var(--jg-shadow-sm);
    transition: box-shadow var(--jg-transition), transform var(--jg-transition);
    overflow: hidden;
}
.card:hover {
    box-shadow: var(--jg-shadow);
    transform: translateY(-2px);
}

/* ---------- Badges ---------- */
.badge-earth {
    display: inline-block;
    background: var(--jg-accent-soft);
    color: var(--jg-accent-deep);
    font-weight: 600;
    font-size: .75rem;
    padding: .25em .7em;
    border-radius: 50px;
    letter-spacing: .02em;
    border: none;
    cursor: pointer;
    transition: all var(--jg-transition);
}
.badge-earth:hover {
    background: rgba(112,162,136,.2);
}
.badge-earth-active {
    background: var(--jg-accent);
    color: #fff;
}
.badge-earth-active:hover {
    background: var(--jg-accent-hover);
}

/* Subscriber badge */
.subscriber-badge {
    display: inline-block;
    background: var(--jg-warm-soft);
    color: var(--jg-warm);
    font-weight: 600;
    font-size: .72rem;
    padding: .2em .65em;
    border-radius: 50px;
    letter-spacing: .02em;
}

/* ---------- Hero ---------- */
.hero {
    position: relative;
    background: linear-gradient(160deg, #4b3b40 0%, #654c4f 30%, #70a288 70%, #5d8f75 100%);
    color: #fff;
    text-align: center;
    padding: 5rem 2rem 5.5rem;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(112,162,136,.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(221,206,205,.15) 0%, transparent 40%);
    pointer-events: none;
}
.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to top, var(--jg-bg), transparent);
    pointer-events: none;
}
.hero-content {
    position: relative;
    z-index: 1;
    max-width: 1100px;
    margin: 0 auto;
}

/* Hero two-column layout */
.hero-layout {
    display: flex;
    align-items: center;
    gap: 3.5rem;
    justify-content: center;
}

/* Author card inside hero */
.hero-author-card {
    flex-shrink: 0;
    background: rgba(255,255,255,.1);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 20px;
    padding: 2.2rem 2rem 1.8rem;
    width: 280px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,.15);
    transition: transform var(--jg-transition), box-shadow var(--jg-transition);
}
.hero-author-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 44px rgba(0,0,0,.22);
}

/* Photo frame */
.hero-photo-frame {
    width: 140px;
    height: 140px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,.35);
    box-shadow: 0 4px 20px rgba(0,0,0,.2);
    overflow: hidden;
    background: var(--jg-surface-2);
}
.hero-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Author card text */
.hero-author-name {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: .15rem;
}
.hero-author-role {
    font-family: 'Lora', Georgia, serif;
    font-size: .82rem;
    color: rgba(255,255,255,.7);
    letter-spacing: .02em;
}
.hero-author-divider {
    width: 40px;
    height: 2px;
    background: rgba(255,255,255,.25);
    margin: .9rem auto;
    border-radius: 2px;
}
.hero-author-bio {
    font-family: 'Lora', Georgia, serif;
    font-size: .85rem;
    line-height: 1.6;
    color: rgba(255,255,255,.85);
    margin-bottom: .8rem;
}
.hero-author-verse {
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
    font-size: .78rem;
    color: rgba(255,255,255,.55);
    line-height: 1.5;
}
.hero-author-verse span {
    display: block;
    font-style: normal;
    font-family: 'Lora', Georgia, serif;
    font-size: .72rem;
    margin-top: .15rem;
    opacity: .7;
}

/* Hero text column */
.hero-text {
    text-align: left;
    flex: 1;
    min-width: 0;
}

.hero .hero-pre {
    font-family: 'Lora', Georgia, serif;
    font-size: 1rem;
    opacity: .8;
    letter-spacing: .04em;
    margin-bottom: .3rem;
    font-style: italic;
}
.hero h1 {
    font-family: 'Playfair Display', Georgia, serif;
    color: #fff;
    font-size: clamp(2.4rem, 5vw, 3.6rem);
    font-weight: 700;
    margin-bottom: .6rem;
}
.hero .hero-subtitle {
    font-family: 'Lora', Georgia, serif;
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    opacity: .88;
    max-width: 560px;
    margin: 0 0 2rem;
    line-height: 1.7;
}
.hero .hero-cta {
    display: inline-flex;
    gap: .8rem;
    flex-wrap: wrap;
}
.hero .btn-hero {
    font-family: 'Lora', Georgia, serif;
    font-weight: 600;
    padding: .65rem 1.8rem;
    border-radius: 50px;
    font-size: .95rem;
    transition: all var(--jg-transition);
    text-decoration: none;
}
.hero .btn-hero-primary {
    background: #fff;
    color: var(--jg-accent-deep);
    border: 2px solid #fff;
}
.hero .btn-hero-primary:hover {
    background: transparent;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,.2);
}
.hero .btn-hero-outline {
    background: transparent;
    color: #fff;
    border: 2px solid rgba(255,255,255,.4);
}
.hero .btn-hero-outline:hover {
    border-color: #fff;
    background: rgba(255,255,255,.08);
    transform: translateY(-2px);
}

/* Responsive: stack on smaller screens */
@media (max-width: 768px) {
    .hero-layout {
        flex-direction: column;
        gap: 2rem;
    }
    .hero-text {
        text-align: center;
    }
    .hero .hero-subtitle {
        margin-left: auto;
        margin-right: auto;
    }
    .hero .hero-cta {
        justify-content: center;
    }
    .hero-author-card {
        width: 260px;
    }
    .hero-photo-frame {
        width: 120px;
        height: 120px;
    }
}

/* ---------- Scripture Banner ---------- */
.scripture-banner {
    background: var(--jg-surface);
    padding: 2.5rem 1.5rem;
    border-bottom: 1px solid var(--jg-border);
}
.scripture-icon {
    font-size: 1.4rem;
    color: var(--jg-accent);
    margin-bottom: .5rem;
}
.scripture-quote {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(1.1rem, 2.5vw, 1.35rem);
    font-style: italic;
    color: var(--jg-text);
    max-width: 600px;
    margin: 0 auto .5rem;
    line-height: 1.6;
    border: none;
    padding: 0;
}
.scripture-cite {
    color: var(--jg-text-3);
    font-size: .9rem;
    font-style: normal;
}

/* ---------- Section Spacing ---------- */
.section-spacing {
    padding-top: 4rem;
    padding-bottom: 4rem;
}

/* ---------- Sections ---------- */
.section-title {
    font-family: 'Playfair Display', Georgia, serif;
    color: var(--jg-text);
    font-size: 1.65rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    padding-bottom: .6rem;
    border-bottom: 3px solid var(--jg-accent);
    display: inline-block;
}

.section-intro {
    color: var(--jg-text-2);
    font-size: 1.05rem;
    max-width: 640px;
}

/* ---------- Page Headers ---------- */
.page-header {
    background: var(--jg-surface-2);
    padding: 2.5rem 0 2rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--jg-border);
}
.page-header h1 {
    font-size: 2rem;
    margin-bottom: .3rem;
}
.page-header p {
    color: var(--jg-text-2);
    margin-bottom: 0;
}

/* ---------- Post / Content Cards ---------- */
.post-card {
    border: 1px solid var(--jg-border);
    background: var(--jg-surface);
    border-radius: var(--jg-radius-lg);
    padding: 1.8rem;
    box-shadow: var(--jg-shadow-sm);
    transition: all var(--jg-transition);
}
.post-card:hover {
    box-shadow: var(--jg-shadow);
    transform: translateY(-3px);
}
.post-card h2, .post-card h5 {
    margin-bottom: .4rem;
}
.post-card h2 a, .post-card h5 a {
    color: var(--jg-text);
    transition: color var(--jg-transition);
}
.post-card h2 a:hover, .post-card h5 a:hover {
    color: var(--jg-accent-deep);
}
.post-meta {
    color: var(--jg-text-3);
    font-size: .85rem;
    margin-bottom: .7rem;
}

/* Read more link */
.read-more {
    font-weight: 600;
    font-size: .9rem;
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    color: var(--jg-accent-deep);
}
.read-more::after {
    content: '\2192';
    transition: transform var(--jg-transition);
}
.read-more:hover::after {
    transform: translateX(4px);
}

/* Back link */
.back-link {
    font-weight: 600;
    font-size: .9rem;
    color: var(--jg-accent-deep);
    transition: color var(--jg-transition);
}
.back-link:hover {
    color: var(--jg-accent);
}

/* Article content */
.article-title {
    font-size: 2.2rem;
}
.article-content {
    white-space: pre-line;
    line-height: 1.9;
    font-size: 1.05rem;
}

/* ---------- Subscriber Gate ---------- */
.subscriber-gate {
    text-align: center;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, var(--jg-accent-soft), var(--jg-warm-soft));
    border-radius: var(--jg-radius-lg);
    border: 1px solid var(--jg-border);
}
.subscriber-gate-icon {
    font-size: 2.5rem;
    margin-bottom: .5rem;
}
.subscriber-gate h4 {
    margin-bottom: .5rem;
}
.subscriber-gate p {
    color: var(--jg-text-2);
    max-width: 400px;
    margin: 0 auto 1.5rem;
}

/* ---------- Media Cards ---------- */
.media-card {
    border-radius: var(--jg-radius-lg);
    overflow: hidden;
    border: 1px solid var(--jg-border);
    background: var(--jg-surface);
    box-shadow: var(--jg-shadow-sm);
    transition: all var(--jg-transition);
}
.media-card:hover {
    box-shadow: var(--jg-shadow);
    transform: translateY(-3px);
}
.media-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 140px;
    background: var(--jg-surface-2);
    font-size: 2.8rem;
}
.media-embed {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    background: var(--jg-surface-2);
}
.media-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
.media-card .card-body { padding: 1.2rem; }
.media-card h5 { font-size: 1.05rem; margin-bottom: .3rem; }

/* ---------- Forum ---------- */
.forum-card {
    border: 1px solid var(--jg-border);
    border-left: 4px solid var(--jg-accent);
    background: var(--jg-surface);
    border-radius: var(--jg-radius);
    padding: 1.2rem 1.5rem;
    box-shadow: var(--jg-shadow-sm);
    transition: all var(--jg-transition);
}
.forum-card:hover {
    box-shadow: var(--jg-shadow);
    border-left-color: var(--jg-warm);
}
.comment-card {
    background: var(--jg-surface-alt);
    border-radius: var(--jg-radius);
    padding: 1rem 1.2rem;
    border: 1px solid var(--jg-border);
}
.comment-count {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .85rem;
    color: var(--jg-text-3);
    font-weight: 500;
}

/* ---------- Auth Cards ---------- */
.auth-card {
    max-width: 440px;
    margin: 2rem auto;
    padding: 2.5rem;
    border-radius: var(--jg-radius-lg);
    background: var(--jg-surface);
    border: 1px solid var(--jg-border);
    box-shadow: var(--jg-shadow);
}
.auth-card h2 {
    text-align: center;
    margin-bottom: 1rem;
}

/* ---------- Newsletter Section ---------- */
.newsletter-section {
    background: linear-gradient(135deg, var(--jg-accent-soft), var(--jg-warm-soft));
    border-radius: var(--jg-radius-lg);
    padding: 2.5rem;
    text-align: center;
    border: 1px solid var(--jg-border);
}
.newsletter-section h3 {
    margin-bottom: .5rem;
}
.newsletter-icon {
    font-size: 2rem;
    margin-bottom: .3rem;
}

/* ---------- CTA Strip ---------- */
.cta-strip {
    background: var(--jg-surface-2);
    padding: 3.5rem 1.5rem;
    text-align: center;
    border-top: 1px solid var(--jg-border);
    border-bottom: 1px solid var(--jg-border);
}
.cta-strip h3 {
    margin-bottom: .5rem;
}
.cta-strip p {
    color: var(--jg-text-2);
    max-width: 500px;
    margin: 0 auto 1.5rem;
}

/* ---------- Footer ---------- */
.footer {
    background: var(--jg-nav);
    color: var(--jg-nav-text);
    padding: 3rem 1.5rem;
    text-align: center;
    margin-top: 0;
    font-size: .9rem;
}
.footer a {
    color: var(--jg-accent);
}
.footer a:hover {
    color: #fff;
}
.footer p {
    margin: 0;
}
.footer-brand {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: .3rem !important;
}
.footer-tagline {
    color: var(--jg-nav-text);
    font-size: .85rem;
    margin-bottom: .8rem !important;
    opacity: .8;
}
.footer-copy {
    font-size: .82rem;
    opacity: .6;
    margin-bottom: .8rem !important;
}
.footer-verse {
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
    font-size: .85rem;
    opacity: .5;
    max-width: 400px;
    margin: 0 auto !important;
}

/* ---------- Nav Buttons ---------- */
.nav-user-name {
    color: var(--jg-nav-text);
    font-size: .85rem;
}
.nav-btn {
    font-size: .8rem !important;
}
.nav-btn-accent {
    font-size: .8rem;
    background: var(--jg-accent);
    color: #fff;
    border-color: var(--jg-accent);
    border-radius: var(--jg-radius);
    padding: .35rem 1rem;
    transition: all var(--jg-transition);
}
.nav-btn-accent:hover {
    background: var(--jg-accent-hover);
    border-color: var(--jg-accent-hover);
    color: #fff;
}

/* ---------- Background Surfaces ---------- */
.bg-surface-alt {
    background: var(--jg-surface-alt) !important;
}
.bg-surface-2 {
    background: var(--jg-surface-2) !important;
}

/* ---------- Alerts ---------- */
.alert-success {
    background: rgba(93,143,117,.1);
    border-color: rgba(93,143,117,.2);
    color: #3d6b50;
}
.alert-info {
    background: var(--jg-accent-soft);
    border-color: rgba(112,162,136,.2);
    color: var(--jg-accent-deep);
}
.alert-warning {
    background: rgba(160,64,64,.06);
    border-color: rgba(160,64,64,.15);
    color: var(--jg-danger);
}

/* ---------- Validation ---------- */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--jg-success);
}
.invalid {
    outline: 1px solid var(--jg-danger);
}
.validation-message {
    color: var(--jg-danger);
    font-size: .85rem;
    margin-top: .25rem;
}

/* ---------- Skeleton / Loading ---------- */
.loading-spinner {
    display: flex;
    align-items: center;
    gap: .6rem;
    color: var(--jg-text-3);
    padding: 2rem 0;
}
.loading-spinner::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2.5px solid var(--jg-border);
    border-top-color: var(--jg-accent);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Utility ---------- */
.text-accent { color: var(--jg-accent-deep) !important; }
.text-muted-custom { color: var(--jg-text-3) !important; }

/* ---------- Blazor plumbing ---------- */
#blazor-error-ui {
    color-scheme: light only;
    background: #f5efef;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(75,59,64,.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: .6rem 1.25rem .7rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    color: var(--jg-text);
}
#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: .75rem;
    top: .5rem;
}
.blazor-error-boundary {
    background: var(--jg-danger);
    padding: 1rem 1rem 1rem 1.5rem;
    color: white;
    border-radius: var(--jg-radius);
}
.blazor-error-boundary::after {
    content: "An error has occurred.";
}

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto;
}
.loading-progress circle {
    fill: none;
    stroke: var(--jg-border);
    stroke-width: .6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}
.loading-progress circle:last-child {
    stroke: var(--jg-accent);
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * .8), 500%;
    transition: stroke-dasharray .05s ease-in-out;
}
.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto .2rem;
    color: var(--jg-text-2);
}
.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Loading");
}

code {
    color: var(--jg-accent-deep);
}
