:root{
    --bg:#f6efe2;
    --card:#fffaf2;
    --ink:#191714;
    --muted:#736b60;
    --brand:#08755f;
    --brand2:#0fa184;
    --line:#e6d9c8;
}

*{
    box-sizing:border-box;
}

html,
body{
    overflow-x:hidden;
}

body{
    margin:0;
    font-family:Inter,system-ui,Arial;
    background:radial-gradient(circle at top left,#fffaf2,#f4ecd9 48%,#efe3cc);
    color:var(--ink);
}

a{
    color:inherit;
    text-decoration:none;
}

.wrap{
    max-width:1320px;
    margin:auto;
    padding:28px;
}

.nav{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:16px;
    position:sticky;
    top:0;
    background:#fff8edcc;
    backdrop-filter:blur(14px);
    z-index:5;
    border:1px solid #ffffff70;
    border-radius:22px;
    padding:12px 16px;
    box-shadow:0 12px 35px #00000010;
}

.brand{
    display:flex;
    align-items:center;
    gap:12px;
    font-weight:900;
    font-size:22px;
}

.brand img{
    height:auto;
    max-height:90px;
    width:auto;
    max-width:260px;
    object-fit:contain;
    display:block;
}

.menu{
    display:flex;
    gap:14px;
    flex-wrap:wrap;
}

.menu a{
    padding:10px 12px;
    border-radius:12px;
}

.menu a:hover{
    background:#08755f12;
}

.btn,
button{
    background:linear-gradient(135deg,var(--brand),var(--brand2));
    color:white;
    border:0;
    border-radius:14px;
    padding:12px 18px;
    font-weight:800;
    cursor:pointer;
    box-shadow:0 10px 25px #08755f25;
}

.btn.secondary,
button.secondary{
    background:white;
    color:var(--brand);
    border:1px solid #b7d5ce;
    box-shadow:none;
}

.hero{
    display:grid;
    grid-template-columns:1.2fr .8fr;
    gap:40px;
    align-items:center;
    padding:55px 0 35px;
}

.hero h1{
    font-size:clamp(42px,7vw,82px);
    line-height:.95;
    margin:12px 0 20px;
    letter-spacing:-2px;
}

.hero p{
    font-size:22px;
    color:var(--muted);
}

.badge{
    display:inline-block;
    background:#08755f13;
    color:var(--brand);
    padding:8px 14px;
    border-radius:999px;
    font-weight:800;
}

.note,
.card{
    background:#fffaf2cc;
    border:1px solid var(--line);
    border-radius:28px;
    padding:24px;
    box-shadow:0 20px 60px #0001;
}

.reader{
    display:grid;
    grid-template-columns:350px 1fr;
    gap:24px;
}

.sidebar{
    max-height:72vh;
    overflow:auto;
}

.search,
input,
select,
textarea{
    width:100%;
    padding:14px;
    border:1px solid var(--line);
    border-radius:14px;
    background:white;
    font-size:16px;
    margin:6px 0;
}

textarea.code-mode{
    font-family:ui-monospace,Consolas,monospace;
    background:#111;
    color:#e8ffe8;
}

.chapter{
    padding:14px;
    border:1px solid var(--line);
    border-radius:18px;
    margin:10px 0;
    background:white;
    cursor:pointer;
    display:grid;
    grid-template-columns:45px 1fr auto;
    gap:10px;
    align-items:center;
    transition:.2s;
}

.chapter:hover{
    transform:translateY(-2px);
    box-shadow:0 12px 30px #0000000d;
}

.chapter.active{
    border-color:var(--brand);
    box-shadow:0 0 0 2px #08755f22;
}

.arabic{
    font-family:'Amiri Quran','Scheherazade New',serif;
    font-size:38px;
    line-height:2.35;
    direction:rtl;
    text-align:right;
}

.translation{
    font-size:19px;
    line-height:1.8;
}

.verse{
    margin:18px 0;
}

.verse h3{
    color:var(--brand);
}

audio{
    width:min(360px,100%);
    margin-top:10px;
}

.full-surah-audio{
    margin-bottom:24px;
}

.full-surah-audio h3{
    margin:0 0 14px;
    color:var(--brand);
}

.full-surah-audio audio{
    width:100%;
}

.controls{
    display:grid;
    grid-template-columns:repeat(5,1fr);
    gap:10px;
    margin:14px 0;
}

.toprow{
    display:flex;
    justify-content:space-between;
    gap:10px;
    align-items:center;
}

/* BLOG GRID VIEW */
.blog-grid,
.blog-list,
.posts-grid,
.grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(280px,1fr));
    gap:28px;
    margin-top:30px;
}

.post,
.blog-card,
.post-card,
.blog-list .card,
.posts-grid .card{
    background:#fffaf2cc;
    border:1px solid var(--line);
    border-radius:26px;
    overflow:hidden;
    box-shadow:0 18px 45px #00000012;
    transition:.3s ease;
    display:block;
}

.post:hover,
.blog-card:hover,
.post-card:hover{
    transform:translateY(-6px);
    box-shadow:0 24px 60px #00000018;
}

.post img,
.blog-card img,
.post-card img,
.blog-list img,
.posts-grid img{
    width:100%;
    height:230px;
    object-fit:cover;
    object-position:center;
    display:block;
    border-radius:0;
    margin-bottom:0;
}

.post h2,
.post h3,
.blog-card h2,
.blog-card h3,
.post-card h2,
.post-card h3{
    font-size:26px;
    line-height:1.3;
    margin:20px 22px 12px;
}

.post p,
.blog-card p,
.post-card p{
    color:var(--muted);
    font-size:16px;
    line-height:1.7;
    margin:0 22px 24px;
}

.blog-content{
    padding:0 0 22px;
}

.read-more{
    display:inline-block;
    margin:0 22px 22px;
    color:var(--brand);
    font-weight:900;
}

/* SINGLE BLOG POST */
.single-post{
    max-width:980px;
    margin:32px auto;
    background:#fffaf2cc;
    border:1px solid var(--line);
    border-radius:28px;
    padding:30px;
    box-shadow:0 20px 60px #0001;
    line-height:1.8;
}

.single-post-img,
.single-post .featured-image{
    width:100%;
    height:420px;
    max-height:420px;
    object-fit:cover;
    object-position:center;
    border-radius:24px;
    margin-bottom:30px;
    display:block;
    box-shadow:0 20px 60px #00000012;
}

.single-post-content h1,
.single-post h1{
    font-size:clamp(32px,5vw,52px);
    line-height:1.18;
    margin:0 0 22px;
}

.single-post-content,
.single-post .content{
    font-size:19px;
    line-height:1.9;
}

.single-post-content p,
.single-post .content p{
    margin-bottom:18px;
}

.single-post-content img,
.single-post .content img{
    max-width:100%;
    height:auto;
    border-radius:18px;
}

.admin{
    display:grid;
    grid-template-columns:250px 1fr;
    min-height:100vh;
}

.admin aside{
    background:#111;
    color:white;
    padding:24px;
}

.admin aside a{
    display:block;
    padding:12px;
    border-radius:10px;
    color:white;
}

.admin aside a:hover{
    background:#ffffff18;
}

.admin main{
    padding:28px;
}

.table{
    width:100%;
    border-collapse:collapse;
    background:white;
    border-radius:16px;
    overflow:hidden;
}

.table th,
.table td{
    padding:12px;
    border-bottom:1px solid #eee;
    text-align:left;
}

.toolbar{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
    background:#fff;
    border:1px solid var(--line);
    padding:10px;
    border-radius:16px;
    margin:10px 0;
}

.toolbar button,
.smallbtn{
    background:#f3fbf8;
    color:var(--brand);
    border:1px solid #cfe7df;
    border-radius:10px;
    padding:9px 12px;
    font-weight:800;
    box-shadow:none;
}

.success{
    background:#effff8;
    color:#075b47;
}

.error{
    background:#fff0f0;
    color:#a10000;
}

footer{
    margin:40px 0;
    text-align:center;
    color:var(--muted);
}

footer a{
    margin:0 8px;
    color:var(--brand);
    font-weight:800;
}

.skeleton{
    animation:pulse 1.2s infinite alternate;
}

@keyframes pulse{
    from{opacity:.55}
    to{opacity:1}
}

.hero.compact{
    grid-template-columns:1fr;
    padding:18px 0 34px;
}

.hero.compact h1,
.hero.compact p{
    display:none;
}

.audio-error{
    display:block;
    margin-top:8px;
    color:#a33;
}

@media(max-width:900px){
    .hero,
    .reader,
    .admin{
        grid-template-columns:1fr;
    }

    .controls{
        grid-template-columns:1fr 1fr;
    }

    .wrap{
        padding:18px;
    }

    .sidebar{
        max-height:none;
    }

    .menu{
        display:flex;
    }

    .hero h1{
        letter-spacing:-1px;
    }

    .brand img{
        max-height:60px;
        max-width:200px;
    }

    .blog-grid,
    .blog-list,
    .posts-grid,
    .grid{
        grid-template-columns:repeat(auto-fit,minmax(260px,1fr));
        gap:22px;
    }

    .single-post-content h1,
    .single-post h1{
        font-size:34px;
    }

    .single-post-img,
    .single-post .featured-image{
        height:280px;
        max-height:280px;
    }
}

@media(max-width:520px){
    .nav{
        align-items:flex-start;
        flex-direction:column;
    }

    .brand img{
        max-height:48px;
        max-width:170px;
    }

    .menu{
        gap:6px;
    }

    .menu a{
        padding:8px 9px;
    }

    .blog-grid,
    .blog-list,
    .posts-grid,
    .grid{
        grid-template-columns:1fr;
    }

    .post img,
    .blog-card img,
    .post-card img,
    .blog-list img,
    .posts-grid img{
        height:210px;
    }

    .post h2,
    .post h3,
    .blog-card h2,
    .blog-card h3,
    .post-card h2,
    .post-card h3{
        font-size:22px;
    }

    .single-post{
        padding:20px;
    }

    .single-post-content h1,
    .single-post h1{
        font-size:28px;
    }

    .single-post-img,
    .single-post .featured-image{
        height:220px;
        max-height:220px;
    }
}