/* =========================================
   1. THE DNA (Variables & Fonts)
   ========================================= */
/* Import Google Fonts: 'Lora' (Serif) and 'Inter' (Sans-Serif) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600&family=Lora:ital,wght@0,400;0,600;1,400&display=swap');

:root {
    /* Color Palette: "Warm Minimalism" */
    --bg-paper:      #F9F7F2;  /* The warm off-white page background */
    --card-bg:       #FFFFFF;  /* Pure white for cards so they "pop" */
    --text-main:     #2C2C2C;  /* Charcoal (softer than black) */
    --text-muted:    #666666;  /* For dates and secondary text */
    --accent:        #C5A065;  /* Muted Gold for highlights */
    --accent-hover:  #B08D55;  /* Slightly darker gold for hover states */
    
    /* Typography */
    --font-serif:    'Lora', serif;       /* For Verses & Headings */
    --font-sans:     'Inter', sans-serif; /* For UI & Reflections */
    
    /* Spacing & Shapes */
    --radius-card:   12px;     /* Soft corners for images/cards */
    --radius-pill:   50px;     /* Friendly "Pill" shape for buttons */
    --shadow-soft:   0 4px 20px rgba(0, 0, 0, 0.05); /* The "floating" feel */
    --shadow-hover:  0 8px 30px rgba(0, 0, 0, 0.12); /* Lift effect */
}

/* =========================================
   2. GLOBAL RESET & LAYOUT
   ========================================= */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth; /* Enables smooth jump to Subscribe */
}

body {
    background-color: var(--bg-paper);
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased; /* Makes fonts look crisp on Mac */
}

/* The Main Container */
main {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
    animation: fadeIn 0.8s ease-in-out; /* Gentle fade-in on load */
    min-height: 60vh; /* Ensures footer doesn't float up on empty pages */
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

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

/* =========================================
   3. TYPOGRAPHY
   ========================================= */
h1, h2, h3 {
    font-family: var(--font-serif);
    font-weight: 600;
    margin-bottom: 1rem;
    line-height: 1.3;
}

blockquote {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    font-style: italic;
    color: var(--text-main);
    border-left: 3px solid var(--accent); /* The Gold Accent Line */
    margin: 30px 0;
    padding-left: 25px;
}

/* =========================================
   4. NAVIGATION & HEADER
   ========================================= */
header {
    text-align: center;
    padding: 20px;
    
    /* Sticky Frost Effect */
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: rgba(249, 247, 242, 0.95); 
    backdrop-filter: blur(10px);
    
    border-bottom: 1px solid rgba(0,0,0,0.05); 
    transition: all 0.3s ease;
}

.logo-text {
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: 2.2rem;
    color: var(--text-main);
    letter-spacing: -0.5px;
    text-decoration: none;
}

.logo-text em {
    font-style: italic;
    font-weight: 400;
    color: var(--text-main);
}

.sub-nav {
    margin-top: 20px;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sub-nav a {
    margin: 0 15px;
    color: var(--text-muted);
    font-weight: 600;
    position: relative;
}

.sub-nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: -4px;
    left: 0;
    background-color: var(--accent);
    transition: width 0.3s ease;
}

.sub-nav a:hover::after { width: 100%; }

/* The Subtle Header "Follow" Button (Ghost Pill) */
.header-cta {
    border: 1px solid var(--accent);
    border-radius: 50px;
    padding: 6px 16px !important;
    color: var(--accent) !important;
    font-size: 0.75rem !important;
    transition: all 0.2s ease;
    margin-left: 10px !important;
}

.header-cta:hover {
    background-color: var(--accent);
    color: white !important;
}

.header-cta::after { display: none; }

/* =========================================
   5. THE GALLERY GRID (Homepage)
   ========================================= */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.gallery-card {
    background: var(--card-bg);
    border-radius: var(--radius-card);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid rgba(0,0,0,0.03);
}

/* The Lift Effect */
.gallery-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(197, 160, 101, 0.3);
}

.image-wrapper {
    width: 100%;
    aspect-ratio: 1 / 1; /* Forces perfect square */
    background-color: #eee;
    border-bottom: 1px solid #f0f0f0;
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Card Info Layout */
.card-info {
    padding: 25px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-grow: 1;
}

/* Theme Tag */
.theme-tag {
    font-family: var(--font-sans);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-bottom: 12px;
    background-color: #F4F4F4;
    padding: 4px 10px;
    border-radius: 20px;
}

/* Reference (Heading) */
.card-info h3 {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    margin: 0 0 10px 0;
    color: var(--text-main);
}

/* Verse Snippet (The Fade Out) */
.verse-snippet {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 0.95rem;
    color: #666;
    line-height: 1.6;
    margin: 0 0 20px 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Call to Action */
.card-cta {
    margin-top: auto;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: transform 0.2s ease;
}

.gallery-card:hover .card-cta {
    transform: translateX(5px);
    color: var(--accent-hover);
}

/* =========================================
   6. SINGLE VERSE PAGE
   ========================================= */
.verse-container {
    max-width: 650px;
    margin: 0 auto;
}

.verse-container img {
    width: 100%;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-soft);
    margin-bottom: 30px;
}

.verse-container h1 {
    font-size: 2rem;
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.reflection {
    margin-top: 40px;
    font-size: 1.1rem;
    color: #444;
}

.reflection h3 {
    font-family: var(--font-sans);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    color: var(--accent);
    margin-bottom: 20px;
}

/* =========================================
   7. BUTTONS
   ========================================= */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 30px 0;
}

.action-btn, button[type="submit"], #share-btn {
    background-color: transparent;
    border: 1px solid var(--text-main);
    color: var(--text-main);
    padding: 10px 24px;
    font-family: var(--font-sans);
    font-weight: 600;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.action-btn:hover, button[type="submit"]:hover, #share-btn:hover {
    background-color: var(--text-main);
    color: white;
    transform: scale(1.02);
}

.copied-state {
    background-color: #4CAF50 !important;
    border-color: #4CAF50 !important;
    color: white !important;
}

/* =========================================
   8. COMPONENTS (Subscribe & Footer)
   ========================================= */
.subscribe-box {
    background-color: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.05);
    padding: 40px 30px;
    border-radius: var(--radius-card);
    text-align: center;
    margin: 60px auto;
    
    /* Compact Desktop Layout */
    max-width: 480px; 
    width: 100%; 
}

.subscribe-box h3 {
    font-family: var(--font-serif);
    margin-top: 0;
    margin-bottom: 10px;
    color: var(--text-main);
}

.subscribe-box p {
    font-family: var(--font-sans);
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 25px;
    line-height: 1.5;
}

/* Form Layout */
.form-row {
    display: flex;
    gap: 10px;
    width: 100%;
}

.subscribe-box input {
    flex: 1;
    padding: 12px 20px;
    border: 1px solid #ddd;
    border-radius: var(--radius-pill);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.subscribe-box input:focus {
    border-color: var(--accent);
}

.subscribe-box button {
    background-color: var(--accent);
    border-color: var(--accent);
    color: white;
    white-space: nowrap;
    flex-shrink: 0;
    padding: 12px 24px;
}

.subscribe-box button:hover {
    background-color: var(--accent-hover);
}

footer {
    text-align: center;
    padding: 40px 20px;
    border-top: 1px solid #EAEAEA;
    margin-top: 60px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* =========================================
   9. ABOUT PAGE
   ========================================= */
.about-container {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
    padding: 20px 0;
}

.about-container h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-main);
    font-family: var(--font-serif);
}

.intro-text {
    font-size: 1.2rem;
    line-height: 1.6;
    color: var(--text-muted);
}

.divider {
    border: 0;
    height: 1px;
    background: #ddd;
    margin: 40px auto;
    width: 50%;
}

.mission-section h3 {
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.9rem;
    color: var(--accent);
    margin-bottom: 20px;
    font-family: var(--font-sans);
}

.mission-section p {
    text-align: left;
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 20px;
    color: #444;
}

.cta-section {
    margin-top: 50px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    font-style: italic;
    font-family: var(--font-serif);
}

/* =========================================
   10. ANIMATIONS
   ========================================= */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* =========================================
   11. MOBILE POLISH
   ========================================= */
@media (max-width: 600px) {
    header { padding: 15px 10px; }
    .logo-text { font-size: 1.5rem; }
    .sub-nav { margin-top: 5px; font-size: 0.8rem; }
    .sub-nav a { padding: 10px 15px; margin: 0 5px; display: inline-block; }
    
    /* Stack the form on mobile */
    .form-row { flex-direction: column; }
    .subscribe-box input { width: 100%; font-size: 16px !important; margin-bottom: 0; }
    .subscribe-box button { width: 100%; }

    .gallery-card:active, .action-btn:active, #share-btn:active {
        transform: scale(0.98);
        background-color: rgba(0,0,0,0.05);
    }
    * { -webkit-tap-highlight-color: transparent; }
    .gallery-grid { grid-template-columns: 1fr; gap: 25px; }
    .gallery-card { border-radius: 0; box-shadow: none; border-bottom: 1px solid #eee; }
    .image-wrapper { aspect-ratio: 4/3; }
    .verse-container h1 { font-size: 1.5rem; }
    blockquote { font-size: 1.2rem; }
}

/* =========================================
   12. VIEW TRANSITIONS
   ========================================= */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.5s;
}
::view-transition-group(root) {
    animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

/* =========================================
   13. VISUAL PEACE (Blur-Up Loading)
   ========================================= */
.image-wrapper img, .verse-container img {
    opacity: 0;
    filter: blur(10px);
    transition: opacity 1s ease, filter 1s ease;
    transform: scale(1.02);
    will-change: opacity, filter;
}

.image-wrapper img.loaded, .verse-container img.loaded {
    opacity: 1;
    filter: blur(0);
}

/* =========================================
   14. MICRO-INTERACTIONS
   ========================================= */
.reflection {
    opacity: 0;
    transform: translateY(30px); 
    transition: all 0.8s ease-out;
}

.reflection.visible {
    opacity: 1;
    transform: translateY(0);
}

.amen-particle {
    position: absolute;
    pointer-events: none;
    font-size: 1.5rem;
    color: var(--accent);
    animation: floatUp 1s ease-out forwards;
}

@keyframes floatUp {
    0% { opacity: 1; transform: translateY(0) scale(0.5); }
    100% { opacity: 0; transform: translateY(-40px) scale(1.5); }
}

/* =========================================
   15. SOCIAL ICONS
   ========================================= */
.social-icons {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-top: 30px;
}

.social-icons a {
    display: block;
    width: 24px;
    height: 24px;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.social-icons svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.social-icons a:hover {
    color: var(--accent);
    transform: translateY(-3px);
}

/* =========================================
   16. SHARE BAR (Single Post)
   ========================================= */
.share-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(0,0,0,0.05); /* Subtle separator line */
    opacity: 0; /* Hidden initially, fades in via JS */
    animation: fadeIn 1s ease forwards 0.5s; /* Delays appearance slightly */
}

.share-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: transparent;
    color: var(--text-muted);
    border: 1px solid rgba(0,0,0,0.1);
    transition: all 0.2s ease;
    cursor: pointer;
}

.share-icon svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.share-icon:hover {
    background-color: var(--accent);
    border-color: var(--accent);
    color: white;
    transform: translateY(-2px);
}

.share-label {
    font-family: var(--font-sans);
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-right: 10px;
}

/* =========================================
   17. LINK IN BIO PAGE
   ========================================= */
.bio-container {
    max-width: 480px;
    margin: 0 auto;
    text-align: center;
    padding-bottom: 60px;
}

.bio-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--card-bg);
    box-shadow: var(--shadow-soft);
    margin-bottom: 20px;
}

.bio-header h1 {
    font-size: 1.5rem;
    margin-bottom: 5px;
    color: var(--text-main);
}

.bio-header p {
    font-family: var(--font-sans);
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 30px;
}

.bio-stack {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.bio-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: var(--card-bg);
    padding: 18px 20px;
    border-radius: var(--radius-pill); /* Full pill shape */
    text-decoration: none;
    font-family: var(--font-sans);
    font-weight: 600;
    color: var(--text-main);
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(0,0,0,0.02);
    transition: all 0.2s ease;
    font-size: 1rem;
}

.bio-btn:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: var(--shadow-hover);
    color: var(--text-main); /* Keeps text dark on hover */
}

/* The Featured "Latest Post" Button */
.bio-featured {
    background-color: var(--text-main);
    color: white;
    border: 1px solid var(--text-main);
}

.bio-featured:hover {
    background-color: #000;
    color: white;
}