/* style.css - Premium Frontend Styles for Notícias Cristã */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@500;700;900&display=swap');

:root {
    --primary-color: #dc2626; 
    --primary-light: #ef4444;
    --accent-color: #d69e2e; 
    --accent-hover: #b7791f;
    --text-main: #1f2937;
    --text-light: #6b7280;
    --bg-main: #f8fafc;
    --bg-glass: rgba(255, 255, 255, 0.85);
    --bg-card: #ffffff;
    --border-color: rgba(226, 232, 240, 0.8);
    --header-height: 85px;
    --radius-lg: 20px;
    --radius-md: 12px;
    --shadow-soft: 0 10px 40px -10px rgba(0,0,0,0.08);
    --shadow-hover: 0 20px 40px -10px rgba(220, 38, 38, 0.15);
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    background-image: 
        radial-gradient(at 0% 0%, hsla(217,100%,94%,1) 0, transparent 50%), 
        radial-gradient(at 100% 0%, hsla(217,100%,94%,1) 0, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    line-height: 1.7;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; transition: var(--transition); }

/* Container */
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

/* Header & Top Bar */
.top-bar { background: linear-gradient(135deg, var(--primary-color), #7f1d1d); color: rgba(255,255,255,0.9); font-size: 0.85rem; padding: 10px 0; font-weight: 500; }
.top-bar .container { display: flex; justify-content: space-between; align-items: center; }

.language-selector select {
    appearance: none; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
    color: white; padding: 6px 28px 6px 12px; border-radius: 6px; font-size: 0.85rem; cursor: pointer; transition: var(--transition);
}
.language-selector select:hover { background: rgba(255,255,255,0.2); }
.language-selector select option { color: var(--text-main); }

header {
    background-color: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    position: sticky; top: 0; z-index: 1000;
    transition: var(--transition);
}

.main-header { display: flex; justify-content: space-between; align-items: center; height: var(--header-height); }

.logo h1 { font-family: 'Outfit', sans-serif; font-size: 2.2rem; color: var(--primary-color); font-weight: 900; letter-spacing: -1px; display:flex; align-items:center; gap:8px; }
.logo h1 span { color: var(--accent-color); position:relative; }
.logo h1 span::after { content:''; position:absolute; bottom:6px; left:0; width:100%; height:4px; background:var(--accent-color); opacity:0.3; border-radius:4px; }

nav ul { display: flex; list-style: none; gap: 32px; }
nav a { font-weight: 600; font-size: 1.05rem; color: var(--text-main); position: relative; padding: 8px 0; font-family:'Inter', sans-serif; }
nav a::after { content:''; position:absolute; bottom:0; left:0; width:0; height:3px; background:var(--primary-color); border-radius:3px; transition:var(--transition); }
nav a:hover { color: var(--primary-color); }
nav a:hover::after, nav a.active::after { width:100%; }

/* Mobile Menu Styles */
.nav-search-wrap { display: flex; align-items: center; gap: 30px; }
.mobile-menu-btn { display: none; background: none; border: none; font-size: 1.8rem; color: var(--text-main); cursor: pointer; padding: 5px; }

/* Layout Grid */
.content-wrapper { display: grid; grid-template-columns: 1fr 340px; gap: 50px; padding: 60px 0; }

/* Hero Cards */
.hero-section { grid-column: 1 / -1; display: grid; grid-template-columns: 2fr 1fr; gap: 24px; margin-bottom: 40px; }
.hero-card { position: relative; border-radius: var(--radius-lg); overflow: hidden; height: 100%; min-height: 320px; background-color: #e2e8f0; box-shadow: var(--shadow-soft); transition: var(--transition); cursor: pointer; display:block; }
.hero-card.main { min-height: 520px; }
.hero-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1); }
.hero-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-hover); }
.hero-card:hover img { transform: scale(1.08); }
.hero-content {
    position: absolute; bottom: 0; left: 0; right: 0; padding: 40px 30px 30px;
    background: linear-gradient(to top, rgba(11,20,38,0.95) 0%, rgba(11,20,38,0.6) 50%, transparent 100%);
    color: white; z-index: 2;
}
.category-tag { background: var(--accent-color); color: white; padding: 6px 14px; border-radius: 30px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; display: inline-block; margin-bottom: 12px; box-shadow: 0 4px 10px rgba(214, 158, 46, 0.3); }
.hero-content h2 { font-size: 2.2rem; font-family: 'Outfit', sans-serif; line-height: 1.15; margin-bottom: 12px; font-weight: 700; text-shadow: 0 2px 4px rgba(0,0,0,0.3); }
.hero-card:not(.main) .hero-content h2 { font-size: 1.6rem; }

/* Sidebar */
.sidebar { display: flex; flex-direction: column; gap: 40px; }
.widget { background: var(--bg-glass); backdrop-filter: blur(10px); padding: 32px; border-radius: var(--radius-lg); box-shadow: var(--shadow-soft); border: 1px solid var(--border-color); }
.widget-title { font-family: 'Outfit', sans-serif; font-size: 1.4rem; color: var(--text-main); margin-bottom: 24px; padding-bottom: 15px; border-bottom: 2px solid rgba(220, 38, 38, 0.1); display: flex; align-items: center; gap: 10px; font-weight: 700; }
.widget-title::before { content: ''; display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--accent-color); box-shadow: 0 0 10px var(--accent-color); }

.most-read-list { list-style: none; }
.most-read-item { display: flex; gap: 20px; margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--border-color); align-items: center; transition: var(--transition); }
.most-read-item:hover { transform: translateX(8px); }
.most-read-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.most-read-number { font-size: 2.8rem; font-family: 'Outfit', sans-serif; font-weight: 900; color: transparent; -webkit-text-stroke: 1px rgba(220,38,38,0.3); line-height: 1; }
.most-read-title { font-weight: 600; font-size: 1.05rem; line-height: 1.4; color: var(--text-main); transition: var(--transition); }
.most-read-title:hover { color: var(--primary-light); }

/* Newsletter Widget */
.newsletter-widget { background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%); color: white; position: relative; overflow: hidden; border: none; }
.newsletter-widget::after { content:''; position:absolute; top:-50px; right:-50px; width:150px; height:150px; background:rgba(255,255,255,0.1); border-radius:50%; }
.newsletter-widget .widget-title { color: white; border-color: rgba(255,255,255,0.2); }
.newsletter-widget .widget-title::before { background: white; box-shadow: 0 0 10px white; }
.newsletter-widget p { font-size: 0.95rem; margin-bottom: 20px; color: rgba(255,255,255,0.9); line-height: 1.6; position:relative; z-index:2; }
.newsletter-form { position:relative; z-index:2; }
.newsletter-form input { width: 100%; padding: 14px 16px; border: 2px solid transparent; border-radius: var(--radius-md); margin-bottom: 12px; font-family: inherit; font-size: 1rem; transition: var(--transition); background: rgba(255,255,255,0.9); }
.newsletter-form input:focus { outline: none; border-color: var(--accent-color); background: white; box-shadow: 0 0 0 4px rgba(214, 158, 46, 0.2); }
.newsletter-form button { width: 100%; padding: 14px; background-color: var(--accent-color); color: white; border: none; border-radius: var(--radius-md); font-weight: 700; font-size: 1.05rem; cursor: pointer; transition: var(--transition); display:flex; justify-content:center; gap:10px; align-items:center; }
.newsletter-form button:hover { background-color: var(--accent-hover); transform: translateY(-2px); box-shadow: 0 10px 20px rgba(0,0,0,0.15); }

/* Footer */
footer { background: #0f172a; color: rgba(255,255,255,0.8); padding: 80px 0 30px; margin-top: 80px; position:relative; overflow:hidden; }
footer::before { content:''; position:absolute; top:0; left:0; width:100%; height:4px; background:linear-gradient(90deg, var(--primary-color), var(--accent-color)); }
.footer-content { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 50px; margin-bottom: 50px; }
.footer-section h3 { margin-bottom: 25px; font-size: 1.4rem; color: white; font-family: 'Outfit', sans-serif; font-weight: 700; position:relative; display:inline-block; }
.footer-section h3::after { content:''; position:absolute; left:0; bottom:-8px; width:30px; height:3px; background:var(--accent-color); border-radius:2px; }
.footer-section p { font-size: 0.95rem; line-height: 1.8; }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 12px; }
.footer-links a { font-size: 0.95rem; display:inline-block; transition:var(--transition); position:relative; }
.footer-links a::before { content:'\f105'; font-family:'Font Awesome 6 Free'; font-weight:900; position:absolute; left:0; opacity:0; transition:var(--transition); transform:translateX(-10px); color:var(--accent-color); }
.footer-links a:hover { color: white; transform:translateX(15px); }
.footer-links a:hover::before { opacity:1; transform:translateX(-15px); }
.footer-bottom { text-align: center; padding-top: 30px; border-top: 1px solid rgba(255,255,255,0.05); font-size: 0.9rem; }

/* Safety styles to prevent horizontal scroll on any element */
img, iframe, video, table, pre, code {
    max-width: 100%;
    height: auto;
    box-sizing: border-box;
}

.single-article, .post-content, .content-wrapper, main, header, footer, body {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-wrap: break-word;
}

.single-article h1 {
    font-size: 2.5rem;
    margin: 15px 0;
    line-height: 1.2;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    color: var(--text-main);
    word-wrap: break-word;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* Responsive */
@media (max-width: 1024px) {
    .content-wrapper { grid-template-columns: 1fr; gap: 40px; }
    .hero-section { grid-template-columns: 1fr; }
    .hero-card.main { min-height: 400px; }
}

@media (max-width: 768px) {
    /* Strict viewport confinement to prevent horizontal scroll */
    html, body {
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }
    .single-article, .post-content, .content-wrapper, main, header, footer {
        max-width: 100% !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }
    
    .container { padding: 0 16px !important; }
    
    /* Header layout correction to prevent stacking */
    .main-header { 
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        height: 70px !important; 
        padding: 0 16px !important; 
        box-sizing: border-box !important;
    }
    .logo h1 { 
        font-size: 1.5rem !important; 
        margin: 0 !important; 
    }
    .mobile-menu-btn { 
        display: block !important; 
        margin: 0 !important; 
    }
    
    /* Bulletproof navigation wrap display */
    .nav-search-wrap { 
        position: absolute !important; 
        top: 70px !important; 
        left: 0 !important; 
        right: 0 !important; 
        background: var(--bg-card) !important; 
        flex-direction: column !important; 
        align-items: stretch !important; 
        gap: 20px !important;
        padding: 20px !important; 
        border-bottom: 1px solid var(--border-color) !important; 
        box-shadow: var(--shadow-soft) !important;
        opacity: 0 !important; 
        visibility: hidden !important; 
        transform: translateY(-10px) !important;
        transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease !important;
        z-index: 1001 !important;
    }
    .nav-search-wrap.active { 
        opacity: 1 !important; 
        visibility: visible !important; 
        transform: translateY(0) !important;
    }
    
    nav ul { flex-direction: column; gap: 15px; align-items: center; }
    .header-search { justify-content: center; width: 100%; margin-top: 10px; }
    .header-search input { width: 100%; }
    
    .hero-content h2 { font-size: 1.6rem; }
    .hero-card.main { min-height: 350px; }
    .post-list-item { flex-direction: column; }
    .post-list-thumb { width: 100% !important; height: 200px !important; }
    
    /* Article top offset gap reduction and horizontal constraint */
    .content-wrapper {
        padding: 20px 0 !important;
        gap: 20px !important;
    }
    main.container {
        padding-top: 15px !important;
    }
    
    /* Title font size scale and break-all to prevent horizontal scroll */
    .single-article h1 { 
        font-size: 9.6vw !important; 
        max-width: 100% !important; 
        word-break: break-all !important;
        overflow-wrap: anywhere !important;
        margin: 10px 0 !important;
    }
}

/* Extra adjustments for 6.1‑6.9" devices (≈360‑420px) */
@media (max-width: 420px) {
    /* Reduce spacing and font sizes */
    .hero-content h2 { font-size: 1.4rem; }
    .hero-card { min-height: 250px; }
    .post-list-item { padding: 8px; }
    .post-list-body h3 { font-size: 0.95rem; }
    .post-list-body { font-size: 0.9rem; }
    .category-tag { font-size: 0.65rem; padding: 4px 8px; }
    .header-search input { font-size: 0.85rem; }
    .logo h1 { font-size: 1.8rem; }
    .single-article h1 { font-size: 9.6vw !important; max-width: 100% !important; word-break: break-all !important; }
    .top-bar .container { flex-direction: column; gap: 8px; text-align: center; }
    .posts-grid { grid-template-columns: 1fr; }
}

@media (min-width: 421px) and (max-width: 480px) {
    .hero-content h2 { font-size: 1.6rem; }
    .hero-card { min-height: 280px; }
    .post-list-body h3 { font-size: 1rem; }
    .single-article h1 { font-size: 9.6vw !important; max-width: 100% !important; word-break: break-all !important; }
    .top-bar .container { flex-direction: column; gap: 8px; text-align: center; }
    .posts-grid { grid-template-columns: 1fr; }
}

/* ── Post List (Últimas Publicações) ── */
.posts-list { display: flex; flex-direction: column; gap: 16px; }
.post-list-item { display: flex; gap: 16px; background: #fff; border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-soft); border: 1px solid var(--border-color); transition: var(--transition); }
.post-list-item:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); }
.post-list-thumb { flex-shrink: 0; width: 140px; height: 110px; overflow: hidden; display: block; }
.post-list-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.post-list-item:hover .post-list-thumb img { transform: scale(1.06); }
.post-list-body { padding: 14px; display: flex; flex-direction: column; justify-content: center; gap: 6px; flex: 1; }
.post-list-body h3 { font-family: 'Outfit', sans-serif; font-size: 1rem; line-height: 1.35; font-weight: 700; }
.post-list-body h3 a { color: var(--text-main); transition: var(--transition); }
.post-list-body h3 a:hover { color: var(--primary-color); }

/* ── Back to Top ── */
#back-to-top { position: fixed; bottom: 30px; right: 30px; width: 48px; height: 48px; border-radius: 50%; background: var(--primary-color); color: #fff; border: none; cursor: pointer; font-size: 1.2rem; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 20px rgba(220,38,38,0.4); opacity: 0; transform: translateY(20px); transition: opacity 0.3s, transform 0.3s; z-index: 9999; }
#back-to-top.visible { opacity: 1; transform: translateY(0); }
#back-to-top:hover { background: var(--primary-light); transform: translateY(-4px); }

