:root{
    --bg:#f5efe4;
    --surface:#fffdf8;
    --surface-2:#faf5ea;
    --primary:#1f5f3f;
    --primary-light:#2f7a57;
    --gold:#c8a96b;
    --text:#1f2937;
    --muted:#6b7280;
    --border:#e8dcc8;
    --shadow:0 15px 40px rgba(0,0,0,.06);
}

[data-theme="dark"]{
    --bg:#000000;
    --surface:#0c0c0c;
    --surface-2:#111111;
    --primary:#2f7a57;
    --primary-light:#3f9a70;
    --gold:#d4b67a;
    --text:#f3f4f6;
    --muted:#9ca3af;
    --border:#1f1f1f;
    --shadow:0 15px 40px rgba(0,0,0,.4);
}

*{
    transition:background .25s,color .25s,border .25s,transform .25s;
}

body{
    font-family:'Inter',sans-serif;
    background:var(--bg);
    color:var(--text);
    overflow-x:hidden;
}



.icon-btn{
    width:42px;
    height:42px;
    border-radius:14px;
    border:1px solid var(--border);
    background:var(--surface);
    color:var(--text);
}

.user-btn{
    background:linear-gradient(135deg,var(--primary),var(--primary-light));
    color:#fff;
    border:none;
    padding:12px 18px;
    border-radius:14px;
    font-weight:600;
}

/* HERO */
.hero{
    padding:90px 0 70px;
    position:relative;
}

.hero::before{
    content:'';
    position:absolute;
    inset:0;
    background:
    radial-gradient(circle at top right, rgba(47,122,87,.12), transparent 30%),
    radial-gradient(circle at left, rgba(200,169,107,.12), transparent 35%);
}

.hero-content{
    position:relative;
    z-index:2;
}

.hero-badge{
    display:inline-flex;
    align-items:center;
    gap:10px;
    background:var(--surface);
    border:1px solid var(--border);
    padding:10px 16px;
    border-radius:999px;
    margin-bottom:26px;
    box-shadow:var(--shadow);
}

.hero h1{
    font-size:68px;
    line-height:1.05;
    font-weight:800;
    max-width:950px;
}

.gradient-text{
    background:linear-gradient(135deg,var(--primary),var(--gold));
    -webkit-background-clip:text;
    -webkit-text-fill-color:transparent;
}

.hero p{
    font-size:20px;
    color:var(--muted);
    max-width:760px;
    margin-top:24px;
}

/* SEARCH */
.search-wrapper{
    margin-top:40px;
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:30px;
    padding:16px;
    box-shadow:var(--shadow);
}

.search-wrapper .form-control,
.search-wrapper .form-select{
    border:none;
    background:transparent;
    color:var(--text);
    box-shadow:none!important;
    padding:18px;
}

.search-btn{
    background:linear-gradient(135deg,var(--primary),var(--primary-light));
    border:none;
    color:#fff;
    width:100%;
    border-radius:18px;
    padding:18px;
    font-weight:700;
}

.search-tags{
    margin-top:24px;
}

.search-tags span{
    display:inline-block;
    padding:10px 16px;
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:999px;
    margin:6px;
    font-size:13px;
}

/* FEATURE CARDS */
.section-space{
    padding:80px 0;
}

.feature-card{
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:30px;
    padding:36px;
    height:100%;
    box-shadow:var(--shadow);
}

.feature-icon{
    width:76px;
    height:76px;
    border-radius:24px;
    background:linear-gradient(135deg,#edf7f0,#f7f1e5);
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:34px;
    margin-bottom:24px;
}

.feature-card h4{
    font-weight:700;
    margin-bottom:16px;
}

.feature-card p{
    color:var(--muted);
    line-height:1.8;
}

/* TITLES */
.section-title{
    font-size:48px;
    font-weight:800;
    margin-bottom:14px;
}

.section-subtitle{
    color:var(--muted);
    font-size:18px;
    margin-bottom:40px;
}

/* COLLECTIONS */
.collection-card{
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:30px;
    overflow:hidden;
    height:100%;
    box-shadow:var(--shadow);
}

.collection-top{
    height:230px;
    background:linear-gradient(135deg,#dfece3,#f7eddc);
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:92px;
}

[data-theme="dark"] .collection-top{
    background:linear-gradient(135deg,#121212,#171717);
}

.collection-body{
    padding:30px;
}

.collection-body h5{
    font-size:24px;
    font-weight:700;
}

.badge-soft{
    display:inline-block;
    padding:8px 14px;
    background:#edf7f0;
    color:#14532d;
    border-radius:999px;
    margin:4px;
    font-size:12px;
    font-weight:600;
}

[data-theme="dark"] .badge-soft{
    background:#142018;
    color:#8ed5ad;
}

/* DAILY */
.daily-card{
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:34px;
    padding:42px;
    box-shadow:var(--shadow);
    height:100%;
}

.daily-card small{
    color:var(--gold);
    font-weight:700;
    letter-spacing:1px;
}

.arabic{
    font-family:'Amiri',serif;
    direction:rtl;
    text-align:right;
    font-size:46px;
    line-height:2;
    margin-top:22px;
}

.urdu{
    font-family:'Noto Nastaliq Urdu',serif;
    font-size:26px;
    line-height:2.3;
    margin-top:26px;
}

/* ARTICLE */
.article-card{
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:30px;
    overflow:hidden;
    height:100%;
    box-shadow:var(--shadow);
}

.article-image{
    height:240px;
    background:linear-gradient(135deg,#dfece3,#f7eddc);
}

.article-body{
    padding:30px;
}

.article-body h5{
    font-size:24px;
    font-weight:700;
    line-height:1.5;
}

.article-body p{
    color:var(--muted);
    line-height:1.8;
}

/* CTA */
.cta-banner{
    background:linear-gradient(135deg,var(--primary),#103826);
    border-radius:40px;
    padding:60px;
    color:#fff;
    position:relative;
    overflow:hidden;
}

.cta-banner::before{
    content:'';
    position:absolute;
    width:600px;
    height:600px;
    border-radius:50%;
    background:rgba(255,255,255,.05);
    top:-240px;
    right:-180px;
}

.cta-banner h2{
    font-size:52px;
    font-weight:800;
}

.cta-banner p{
    opacity:.8;
    margin-top:16px;
    line-height:1.9;
}

.cta-btn{
    background:#fff;
    color:#14532d;
    border:none;
    border-radius:20px;
    padding:18px 30px;
    font-weight:700;
}

/* MOBILE */
@media(max-width:992px){
    .hero h1{
        font-size:46px;
    }

    .section-title{
        font-size:34px;
    }

    .cta-banner h2{
        font-size:36px;
    }

    .arabic{
        font-size:34px;
    }

    .urdu{
        font-size:22px;
    }
}

@media(max-width:768px){
    .hero{
        padding:70px 0 40px;
    }

    .hero h1{
        font-size:38px;
    }

    .hero p{
        font-size:17px;
    }

    .section-space{
        padding:50px 0;
    }

    .search-wrapper{
        border-radius:24px;
    }

    .feature-card,
    .daily-card,
    .article-card,
    .collection-card{
        border-radius:24px;
    }
}
.expandable-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
}

.truncatable-content {
    position: relative;
    max-height: 90px; /* Capped short height per text field block */
    overflow: hidden;
    transition: max-height 0.35s ease-in-out;
}

/* Give Arabic font a bit more default space if needed */
.expandable-wrapper:has(.arabic) .truncatable-content {
    max-height: 110px; 
}

.fade-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    background: linear-gradient(to bottom, rgba(255,255,255,0), #fffdf8);
    pointer-events: none;
    z-index: 2;
}

[data-theme="dark"] .fade-overlay {
    background: linear-gradient(to bottom, rgba(0,0,0,0), #0c0c0c);
}

.read-more-btn {
    display: block; 
    background: transparent;
    border: none;
    color: #1f5f3f; 
    font-weight: 700;
    font-size: 0.75rem;
    padding: 4px 0;
    cursor: pointer !important;
    margin-top: 4px;
    position: relative;
    z-index: 5;
    text-align: left;
}

/* Expanded States targeted strictly at the local wrapper level */
.expandable-wrapper.expanded .truncatable-content {
    max-height: 1500px !important; 
}

.expandable-wrapper.expanded .fade-overlay {
    display: none !important; 
}