/* ============================================================
   QURAN SYSTEM v2 — Landing cards + view-specific styling
   UPDATED: Fixed mobile vertical text and card layout
============================================================ */

/* ============================================================
   LANDING — 4 VIEW CARDS
============================================================ */

.quran-landing {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 30px 16px 60px;
    box-sizing: border-box;
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
}

.quran-landing,
.quran-landing * {
    box-sizing: border-box;
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
}

.quran-landing-header {
    text-align: center;
    margin-bottom: 36px;
}

.quran-landing-header h1 {
    font-family: "AlQuranQalam", "Noto Naskh Arabic", serif;
    font-size: 52px;
    color: #0B6B3A;
    margin: 0 0 8px;
    line-height: 1.3;
}

.quran-landing-header p {
    margin: 0;
    font-size: 16px;
    color: #6b7280;
}

/* ============================================================
   CARDS GRID
============================================================ */

.quran-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    width: 100%;
    min-width: 0;
}

.quran-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;

    width: 100%;
    min-width: 0;
    min-height: 180px;

    background: #ffffff;
    border: 2px solid #dddddd;
    border-radius: 18px;

    padding: 26px 20px;

    text-decoration: none !important;
    color: #111111 !important;

    box-shadow: 0 3px 10px rgba(0,0,0,.08);
    transition: transform .25s, box-shadow .25s, border-color .25s;

    position: relative;
    overflow: hidden;
    cursor: pointer;

    text-align: left;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
}

.quran-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(0,0,0,.12);
    border-color: #0B6B3A;
    color: #111111 !important;
}

.quran-card::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: #0B6B3A;
}

/* Card accent colors */

.quran-card-full::after {
    background: #0B6B3A;
}

.quran-card-audio::after {
    background: #b45309;
}

.quran-card-urdu::after {
    background: #0f8b4c;
}

.quran-card-english::after {
    background: #1e5fbf;
}

/* ============================================================
   CARD CONTENT
============================================================ */

.quran-card-icon {
    font-size: 42px;
    margin-bottom: 14px;
    line-height: 1;
    display: block;
    flex-shrink: 0;
}

.quran-card-title {
    font-size: 19px;
    font-weight: 700;
    margin: 0 0 10px;
    color: #0B6B3A;
    display: block;
    width: 100%;
    line-height: 1.4;
}

.quran-card-desc {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.55;
    margin: 0 0 18px;
    display: block;
    width: 100%;
    flex: 1;
}

.quran-card-cta {
    font-weight: 700;
    font-size: 15px;
    color: #0B6B3A;
    display: block;
    width: 100%;
}

/* ============================================================
   TABLET / SMALL DESKTOP
============================================================ */

@media (min-width: 640px) {
    .quran-card {
        padding: 20px 16px;
        min-height: 165px;
    }

    .quran-card-icon {
        font-size: 36px;
        margin-bottom: 10px;
    }

    .quran-card-title {
        font-size: 17px;
        margin-bottom: 6px;
    }

    .quran-card-desc {
        font-size: 13px;
        line-height: 1.45;
        margin-bottom: 12px;
    }

    .quran-card-cta {
        font-size: 14px;
    }
}

/* ============================================================
   LARGE DESKTOP — 4 CARDS IN ONE ROW
============================================================ */

@media (min-width: 1100px) {
    .quran-cards {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* ============================================================
   MOBILE — GRID-BASED CARD LAYOUT
   FIX: Icon in one column, all text in the other column
============================================================ */

@media (max-width: 639px) {

    .quran-landing {
        padding: 16px 12px 32px;
        width: 100%;
        max-width: 100%;
    }

    .quran-landing-header {
        margin-bottom: 18px;
    }

    .quran-landing-header h1 {
        font-size: 26px;
        line-height: 1.4;
        margin-bottom: 4px;
    }

    .quran-landing-header p {
        font-size: 12px;
        line-height: 1.5;
    }

    .quran-cards {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 12px;
        width: 100%;
    }

    /* Main card layout */
    .quran-card {
        display: grid !important;

        grid-template-columns: 44px minmax(0, 1fr) !important;
        grid-template-rows: auto auto auto !important;

        column-gap: 14px;
        row-gap: 3px;

        width: 100% !important;
        min-width: 0 !important;
        min-height: 100px !important;
        height: auto !important;

        padding: 16px !important;
        border-radius: 14px;

        align-items: center;
        justify-content: initial;

        text-align: left !important;
        overflow: hidden !important;

        white-space: normal !important;
        word-break: normal !important;
        overflow-wrap: break-word !important;

        flex-direction: unset !important;
        transform: none !important;
    }

    /* Icon occupies the complete first column */
    .quran-card-icon {
        grid-column: 1 !important;
        grid-row: 1 / 4 !important;

        display: flex !important;
        align-items: center;
        justify-content: center;

        width: 44px !important;
        max-width: 44px !important;

        font-size: 30px !important;
        line-height: 1.2 !important;

        margin: 0 !important;
        padding: 0 !important;

        flex-shrink: 0;
    }

    /* Title */
    .quran-card-title {
        grid-column: 2 !important;
        grid-row: 1 !important;

        display: block !important;
        width: 100% !important;
        min-width: 0 !important;

        font-size: 16px !important;
        line-height: 1.4 !important;

        margin: 0 0 3px !important;
        padding: 0 !important;

        white-space: normal !important;
        word-break: normal !important;
        overflow-wrap: break-word !important;
    }

    /* Description */
    .quran-card-desc {
        grid-column: 2 !important;
        grid-row: 2 !important;

        display: block !important;
        width: 100% !important;
        min-width: 0 !important;

        font-size: 12px !important;
        line-height: 1.5 !important;

        margin: 0 0 5px !important;
        padding: 0 !important;

        flex: none !important;

        white-space: normal !important;
        word-break: normal !important;
        overflow-wrap: break-word !important;
    }

    /* CTA */
    .quran-card-cta {
        grid-column: 2 !important;
        grid-row: 3 !important;

        display: block !important;
        width: 100% !important;
        min-width: 0 !important;

        font-size: 13px !important;
        line-height: 1.4 !important;
        font-weight: 700 !important;

        margin: 0 !important;
        padding: 0 !important;

        white-space: normal !important;
    }

    .quran-card:hover {
        transform: none !important;
    }

    .quran-card::after {
        height: 4px;
    }

    /* RTL layout: icon on right, text on left */
    [dir="rtl"] .quran-card,
    html[dir="rtl"] .quran-card {
        grid-template-columns: minmax(0, 1fr) 44px !important;
        text-align: right !important;
        direction: rtl;
    }

    [dir="rtl"] .quran-card-icon,
    html[dir="rtl"] .quran-card-icon {
        grid-column: 2 !important;
    }

    [dir="rtl"] .quran-card-title,
    [dir="rtl"] .quran-card-desc,
    [dir="rtl"] .quran-card-cta,
    html[dir="rtl"] .quran-card-title,
    html[dir="rtl"] .quran-card-desc,
    html[dir="rtl"] .quran-card-cta {
        grid-column: 1 !important;
        text-align: right !important;
    }
}

/* ============================================================
   VERY SMALL PHONES
============================================================ */

@media (max-width: 380px) {

    .quran-landing {
        padding-left: 10px;
        padding-right: 10px;
    }

    .quran-cards {
        gap: 9px;
    }

    .quran-card {
        grid-template-columns: 38px minmax(0, 1fr) !important;
        column-gap: 10px;
        padding: 13px !important;
        min-height: 90px !important;
    }

    .quran-card-icon {
        width: 38px !important;
        max-width: 38px !important;
        font-size: 26px !important;
    }

    .quran-card-title {
        font-size: 14px !important;
    }

    .quran-card-desc {
        font-size: 11px !important;
    }

    .quran-card-cta {
        font-size: 12px !important;
    }

    [dir="rtl"] .quran-card,
    html[dir="rtl"] .quran-card {
        grid-template-columns: minmax(0, 1fr) 38px !important;
    }
}

/* ============================================================
   VIEW-SPECIFIC TYPOGRAPHY
============================================================ */

/* English view */

.quran-wrapper[data-view="english"] .english {
    margin-top: 16px;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    font-size: 22px;
    line-height: 1.9;
    color: #222;
    direction: ltr;
    text-align: left;
}

.quran-wrapper[data-view="english"] .surah-title-en {
    font-size: 24px;
}

/* Urdu view */

.quran-wrapper[data-view="urdu"] .urdu {
    margin-top: 16px;
    font-family: "JameelNoori", "Noto Nastaliq Urdu", serif;
    font-size: 28px;
    line-height: 1.9;
    color: #222;
    direction: rtl;
    text-align: right;
}

/* Arabic-only view */

.quran-wrapper[data-view="arabic"] .arabic {
    margin-bottom: 8px;
}

/* ============================================================
   DARK MODE
============================================================ */

body.dark-mode .quran-card,
body.dark .quran-card {
    background: #1b1b1b;
    border-color: #333;
    color: #eee !important;
}

body.dark-mode .quran-card-title,
body.dark .quran-card-title {
    color: #a7f3d0;
}

body.dark-mode .quran-card-desc,
body.dark .quran-card-desc {
    color: #9ca3af;
}

body.dark-mode .quran-card-cta,
body.dark .quran-card-cta {
    color: #a7f3d0;
}

body.dark-mode .quran-landing-header h1,
body.dark .quran-landing-header h1 {
    color: #a7f3d0;
}

body.dark-mode .quran-landing-header p,
body.dark .quran-landing-header p {
    color: #9ca3af;
}

body.dark-mode .quran-wrapper[data-view="english"] .english,
body.dark .quran-wrapper[data-view="english"] .english {
    color: #e5e7eb;
}

body.dark-mode .quran-wrapper[data-view="urdu"] .urdu,
body.dark .quran-wrapper[data-view="urdu"] .urdu {
    color: #e5e7eb;
}

/* ============================================================
   RESPONSIVE — QURAN READER TYPOGRAPHY
============================================================ */

@media (max-width: 768px) {

    .quran-wrapper[data-view="english"] .english {
        font-size: 18px;
    }

    .quran-wrapper[data-view="urdu"] .urdu {
        font-size: 22px;
    }
}
/* ============================================================
   QURAN LANDING CARDS — INCREASE FONT SIZE
============================================================ */

/* Card titles */
.quran-card-title {
    font-size: 23px !important;
    font-weight: 700 !important;
    line-height: 1.5 !important;
}

/* Card descriptions */
.quran-card-desc {
    font-size: 17px !important;
    line-height: 1.7 !important;
}

/* Card buttons */
.quran-card-cta {
    font-size: 18px !important;
    font-weight: 700 !important;
}

/* Mobile */
@media (max-width: 639px) {
    .quran-card-title {
        font-size: 20px !important;
        line-height: 1.5 !important;
    }

    .quran-card-desc {
        font-size: 15px !important;
        line-height: 1.6 !important;
    }

    .quran-card-cta {
        font-size: 16px !important;
    }
}

/* Very small phones */
@media (max-width: 380px) {
    .quran-card-title {
        font-size: 18px !important;
    }

    .quran-card-desc {
        font-size: 14px !important;
    }

    .quran-card-cta {
        font-size: 15px !important;
    }
}