/*
Theme Name: Daily Reflection
Author: Bendigital
Description: Mobile-responsive theme with WhatsApp sharing and mobile button fixes.
Version: 1.4.1
*/

/* ---------------------------------------------------------
   1. GLOBAL VARIABLES & RESET
--------------------------------------------------------- */
:root { 
    --dr-primary: #2c3e50; 
    --dr-accent: #e74c3c; 
    --dr-light: #ecf0f1; 
    --dr-bg: #fff;
    --dr-whatsapp: #25D366; /* Official WhatsApp Green */
}

* { box-sizing: border-box; } 

body { 
    margin: 0; 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; 
    background: var(--dr-bg); 
    color: #333; 
    line-height: 1.6; 
    font-size: 16px; 
}

a { text-decoration: none; color: inherit; transition: 0.2s; }
img { max-width: 100%; height: auto; display: block; }

.container { 
    max-width: 1000px; 
    margin: 0 auto; 
    padding: 0 20px; 
}

/* ---------------------------------------------------------
   2. HEADER
--------------------------------------------------------- */
.site-header { 
    border-bottom: 2px solid #f4f4f4; 
    padding: 15px 0; 
    margin-bottom: 30px; 
}

.header-inner { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}

.site-logo { 
    font-size: 22px; 
    font-weight: 700; 
    color: var(--dr-primary); 
}

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

.main-nav a { 
    font-weight: 600; 
    text-transform: uppercase; 
    font-size: 13px; 
    color: #555; 
    padding: 5px 0;
}
.main-nav a:hover { color: var(--dr-accent); }

/* ---------------------------------------------------------
   3. HERO SECTION (Homepage & Single)
--------------------------------------------------------- */
.hero-devotion { 
    background: #f9f9f9; 
    padding: 40px; 
    border-radius: 8px; 
    text-align: center; 
    margin-bottom: 40px;
}

.hero-devotion img { 
    max-height: 350px; 
    margin: 0 auto 20px; 
    border-radius: 4px; 
}

.meta { 
    color: #888; 
    font-size: 0.85em; 
    text-transform: uppercase; 
    letter-spacing: 1px; 
}

h1.entry-title { 
    font-size: 2.2em; 
    margin: 10px 0 20px; 
    color: var(--dr-primary); 
    line-height: 1.2;
}

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

.btn { 
    padding: 12px 25px; 
    border-radius: 4px; 
    font-weight: 600; 
    cursor: pointer; 
    border: none; 
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary { background: var(--dr-primary); color: #fff; }
.btn-outline { border: 2px solid var(--dr-primary); color: var(--dr-primary); background: transparent; }
.btn:active { transform: scale(0.98); }

/* WhatsApp Button Style */
.btn-whatsapp {
    background-color: var(--dr-whatsapp);
    color: #fff;
}
.btn-whatsapp:hover {
    background-color: #1ebc57;
    color: #fff;
}

/* Toggles (Hidden Content) */
.content-toggle { 
    display: none; 
    text-align: left; 
    background: #fff; 
    padding: 25px; 
    margin-top: 20px; 
    border: 1px solid #eee; 
    border-radius: 4px; 
}
.content-toggle.active { display: block; animation: fadeIn 0.4s; }

/* ---------------------------------------------------------
   4. ARCHIVE & GRIDS
--------------------------------------------------------- */
.grid-title { 
    margin-top: 50px; 
    border-bottom: 1px solid #eee; 
    padding-bottom: 10px; 
    font-size: 1.5em;
}

/* Homepage Mini Grid */
.devotion-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
    gap: 20px; 
    margin-top: 25px; 
}

.devotion-card-mini { 
    border: 1px solid #eee; 
    padding: 15px; 
    border-radius: 6px; 
    display: flex; 
    align-items: center; 
    gap: 15px; 
    background: #fff;
}
.devotion-card-mini img { 
    width: 70px; 
    height: 70px; 
    object-fit: cover; 
    border-radius: 4px; 
    flex-shrink: 0; 
}

/* Archive Page Large Grid */
.archive-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); 
    gap: 30px; 
    margin-bottom: 40px; 
}

.archive-card { 
    border: 1px solid #eee; 
    border-radius: 8px; 
    overflow: hidden; 
    background: #fff;
}

.card-image { height: 180px; background: #f4f4f4; }
.card-image img { width: 100%; height: 100%; object-fit: cover; }
.card-content { padding: 20px; }
.card-title { margin: 5px 0 0; font-size: 1.2em; color: var(--dr-primary); }

.series-tag { 
    display: inline-block; 
    margin-top: 10px; 
    font-size: 0.75em; 
    background: #eef2f5; 
    color: var(--dr-primary); 
    padding: 4px 8px; 
    border-radius: 4px; 
}

/* ---------------------------------------------------------
   5. BIBLE PAGE
--------------------------------------------------------- */
.bible-wrapper { 
    background: #fffbe6; 
    padding: 30px; 
    border-left: 4px solid var(--dr-accent); 
    font-size: 1.1em;
}
.bible-form input[type="text"] { 
    padding: 12px; 
    width: 60%; 
    font-size: 16px; 
    border: 1px solid #ccc; 
    border-radius: 4px; 
}

/* ---------------------------------------------------------
   6. FOOTER
--------------------------------------------------------- */
.site-footer { 
    margin-top: 60px; 
    padding: 40px 0; 
    background: #f9f9f9; 
    text-align: center; 
    color: #888; 
    font-size: 0.9em; 
}

/* ---------------------------------------------------------
   7. MOBILE RESPONSIVE (Strict Rules)
--------------------------------------------------------- */
@media screen and (max-width: 768px) {
    
    /* Header: Stack Logo and Menu */
    .header-inner { 
        flex-direction: column; 
        gap: 15px; 
    }
    .main-nav ul { 
        gap: 15px; 
        flex-wrap: wrap; 
        justify-content: center; 
    }
    .main-nav a { font-size: 14px; }

    /* Hero: Reduce Padding */
    .hero-devotion { 
        padding: 20px 10px; 
    }
    h1.entry-title { 
        font-size: 1.6em; 
    }

    /* BUTTONS FIX: Force Stack */
    .action-buttons { 
        display: flex !important;
        flex-direction: column !important; /* Forces Vertical Stack */
        gap: 10px !important;
        width: 100% !important;
    }

    .btn { 
        display: flex !important;
        width: 100% !important; /* Full width */
        justify-content: center !important;
        margin: 0 !important;
        padding: 15px !important; /* Easy to tap */
    }

    /* Bible Search */
    .bible-form input[type="text"] { 
        width: 100%; 
        margin-bottom: 10px; 
    }
    .bible-form button {
        width: 100%;
    }

    /* Grids */
    .devotion-grid, .archive-grid { 
        grid-template-columns: 1fr; 
    }
    
    .container { padding: 0 15px; }
}

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