/* Minimal theme CSS to complement Tailwind CDN.
   For production use: generate a compiled Tailwind CSS and replace this file.
*/

/* Tailwind core layers */
@tailwind base;
@tailwind components;
@tailwind utilities;


html {
  direction: rtl;
  unicode-bidi: isolate;
  scrollbar-gutter: stable both-edges;
}

body {
  direction: rtl;
}

body::-webkit-scrollbar {
  direction: ltr; /* fixes scrollbar position */
}

.english {
  direction: ltr !important;
  text-align: left !important;
  font-family: Arial, sans-serif;
}


@font-face {
  font-family: 'NafeesWebNaskh';
  src: url('../fonts/nafees/NafeesWeb.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
body {
  font-family: 'NafeesWebNaskh', serif;
}


/* FORCE HORIZONTAL DESKTOP MENU */
.tws-desktop-menu {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
}

.tws-desktop-menu li {
    display: inline-flex !important;
    white-space: nowrap;
}

/* RTL enforcement */
html[dir="rtl"] .tws-desktop-menu {
    flex-direction: row-reverse !important;
}

html[dir="rtl"] .tws-desktop-menu li {
    margin-right: 0.5rem;
}

/* Desktop menu horizontal */
.tws-desktop-menu {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    justify-content: center;
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Top-level menu items */
.tws-desktop-menu > li {
    position: relative;
}

/* Top-level links */
.tws-desktop-menu > li > a {
    padding: 0.5rem 1rem;
    font-weight: 500;
    color: #ffffff; /* white for contrast on blue header */
    transition: all 0.2s;
    border-radius: 0.25rem;
}

/* Hover effect for top-level links */
.tws-desktop-menu > li > a:hover {
    color: #ffffff;
    background-color: #4742a0; /* slightly lighter blue */
}

/* Nested dropdown menu */
.tws-desktop-menu li ul.sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0; /* RTL: align to right */
    background: #2b286f; /* match header */
    border: 1px solid #4742a0; /* subtle border */
    min-width: 200px;
    z-index: 50;
    padding: 0.5rem 0;
    border-radius: 0.25rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Dropdown items */
.tws-desktop-menu li ul.sub-menu li {
    display: block;
    padding: 0;
}

/* Links inside dropdown */
.tws-desktop-menu li ul.sub-menu li a {
    display: block;
    padding: 0.5rem 1rem;
    white-space: nowrap;
    text-align: right; /* RTL */
    color: #ffffff; /* white text */
    font-weight: 400;
    transition: background 0.2s;
}

/* Hover effect for dropdown links */
.tws-desktop-menu li ul.sub-menu li a:hover {
    background-color: #4742a0; /* lighter blue hover */
    color: #ffffff;
}

/* Show dropdown on hover */
.tws-desktop-menu li:hover > ul.sub-menu {
    display: block;
}

/* Mobile menu */
#tws-mobile-nav {
    background-color: #2b286f;
    color: #ffffff;
    padding: 0.5rem 0;
}

#tws-mobile-nav a {
    color: #ffffff;
    display: block;
    padding: 0.5rem 1rem;
    transition: background 0.2s;
}

#tws-mobile-nav a:hover {
    background-color: #4742a0;
    color: #ffffff;
    border-radius: 0.25rem;
}

#tws-mobile-nav .sub-menu {
    display: none;
    padding-right: 1rem; /* RTL */
}

#tws-mobile-nav .menu-item-has-children > a:after {
    content: " ▾"; /* arrow for submenu */
}

#tws-mobile-nav .menu-item-has-children.open > ul.sub-menu {
    display: block;
}




/* RTL headings for single post content */
body.single-post article h1,
body.single-post article h2,
body.single-post article h3,
body.single-post article h4,
body.single-post article h5,
body.single-post article h6 {
    direction: rtl;
    text-align: right;
}




/* * Apply this class 'custom-three-column' to your SiteOrigin ROW settings.
 * This rule ensures the three columns are side-by-side ABOVE 1000px.
 */
.custom-three-column .panel-grid-cell {
    /* SiteOrigin usually handles this, but we ensure columns float left 
       (or right in RTL if you adjust float property) and are inline. */
    float: right; /* Use 'right' for RTL alignment */
    padding-right: 15px; /* Adjust padding as needed */
    padding-left: 15px;
}

/* * === CUSTOM 1000px COLLAPSE LOGIC ===
 * This media query targets screens between SiteOrigin's typical tablet break (~776px) and 1000px.
 * This is where we force the collapse.
 */
@media (min-width: 776px) and (max-width: 1000px) {
    
    /* 1. Force the first two columns to expand to 50% each */
    .custom-three-column > .panel-grid-cell:nth-child(1),
    .custom-three-column > .panel-grid-cell:nth-child(2) {
        width: 50% !important; /* Forces 50/50 split on the remaining two */
        float: right !important; /* Keep them inline for the remaining width */
    }

    /* 2. Force the third column to drop below (stack) and take full width */
    .custom-three-column > .panel-grid-cell:nth-child(3) {
        width: 100% !important; /* Takes full width of the container */
        float: none !important; /* Forces it to stack below the first two */
        clear: both !important; /* Ensures it starts on a new line */
    }
}

/* Force SiteOrigin columns to behave like flex items */
.grid-wrapper,
.grid-wrapper .panel-grid,
.grid-wrapper .panel-grid-cell {
    display: block !important;       /* override table/table-cell */
    float: none !important;          /* override floats */
    width: auto !important;
}

/* Wrap children properly */
.grid-wrapper {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 1.5rem;
}

/* Default (desktop) — your plugin controls width */
.grid-wrapper .grid-item {
    display: block;
}

/* Below 1000px — collapse to 2 columns */
@media (max-width: 1000px) {
    .grid-wrapper .grid-item {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }
}

/* Below 700px — collapse to 1 column */
@media (max-width: 700px) {
    .grid-wrapper .grid-item {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
}




/* option for single template */

/* Full-content layout: images full width, text constrained */
body.single-post.layout-full_content article {
    max-width: 100%; /* allow article to expand */
    margin: 0 auto;
    padding: 1.5rem;
}




/* Full-content layout: limit paragraphs to 700px, center them */
body.single-post article.layout-full_content p {
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* Optionally center headings as well */
body.single-post article.layout-full_content h1,
body.single-post article.layout-full_content h2,
body.single-post article.layout-full_content h3 {
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* Images full width */
body.single-post article.layout-full_content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1rem 0;
}


#reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    width: 0%;
    background: #3b82f6; /* blue-500 */
    z-index: 9999;
    transition: width 0.15s ease-out;
}



/* Dark mode styles */
html.dark body {
  background-color: #111827; /* dark background */
  color: #f9fafb;           /* light text */
}

html.dark .site-header {
  background-color: #1f2937; /* dark header */
  color: #f9fafb;
}

html.dark .site-footer {
  background-color: #1f2937;
  color: #f9fafb;
}

html.dark a {
  color: #3b82f6; /* light links in dark mode */
}

html.dark .primary-menu > li > a:hover {
  background-color: #374151;
}
body, header, footer, a {
  transition: background-color 0.3s, color 0.3s;
}

.widget-title {
    font-size: 1.8rem; /* adjust size as needed */
    font-weight: bold;  /* optional */
}
