/*
 * Rabex news — responsive fixes, loaded AFTER style.css (which we do not edit).
 * Everything here is scoped to mobile/tablet breakpoints so the desktop layout
 * is untouched. See docs/WORK-2026-10.md "news responsive".
 */

/* --- Single-article title: the <h1> sits directly in .nirweb_post_box and has
       NO theme rule, so it falls back to the browser default (2em = 32px,
       line-height:normal) -> four very tall, loosely-spaced lines at 412px.
       Nothing in style.css targets it, so .nirweb_post_box > h1 wins without
       !important. Only touched below 991px; desktop keeps its 32px. --- */
@media screen and (max-width: 991px) {
    .nirweb_post_box > h1 { font-size: 24px; line-height: 1.5; }
}
@media screen and (max-width: 575px) {
    .nirweb_post_box > h1 { font-size: 20px; line-height: 1.5; }
}

/* --- Logo clipped on phones: the header is a fixed height:60px (<=991) and a
       taller logo overflows/gets cut. Cap the logo so it fits inside it. --- */
@media screen and (max-width: 991px) {
    header a img {
        max-height: 40px;
        width: auto;
        height: auto;
    }
}

/* --- Goftino chat button overlaps article text on phones: the widget injects
       a fixed 80x80 #goftino_w in the bottom corner. Scale it down on phones
       (keep it, don't hide it) so it covers less content. Scaling the element
       shrinks its icon too, so nothing is clipped. --- */
@media screen and (max-width: 575px) {
    #goftino_w.goftino-wakeup,
    #goftino_w {
        transform: scale(0.65) !important;
        transform-origin: bottom left !important;
    }
}

/* --- Desktop category bar (.nirweb_cat_list): it is display:flex, so when the
       chips don't all fit the container they shrink (flex-shrink:1) and each
       title wraps to two lines. Keep every chip at its natural width on ONE
       line, and when they overflow, scroll horizontally like the mobile
       carousel instead of wrapping. 'safe center' stays centered when they fit
       and falls back to start (so the active chip stays visible) when they
       don't. Only this bar is affected; the mobile swiper is a different
       element (.nirweb_cats_carousel). --- */
.nirweb_cat_list {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: safe center;
    scrollbar-width: none;                 /* hide the bar; still scrolls (shift+wheel / drag) */
}
.nirweb_cat_list::-webkit-scrollbar { display: none; }
.nirweb_cat_list li { flex-shrink: 0; }
.nirweb_cat_list li a { white-space: nowrap; }

/* Make the category bar draggable: grab cursor, no text selection, and stop the
   links' native drag so dragging scrolls the bar instead of lifting a chip.
   (Drag-to-scroll itself is in assets/js/rabex-fixes.js.) */
.nirweb_cat_list { cursor: grab; user-select: none; -webkit-user-select: none; }
.nirweb_cat_list.is-dragging { cursor: grabbing; }
.nirweb_cat_list li a { -webkit-user-drag: none; user-drag: none; }

/* ==== Inline SVG icons (replace Font Awesome on the news front-end) ============
   Each icon is <svg class="rbx-icon"><use href="#i-NAME"></use></svg>. Sized by
   the surrounding font-size (1em square; the symbol viewBox keeps the natural
   proportions), coloured by the surrounding 'color' via fill:currentColor — so
   the theme's existing size/colour rules keep working. */
.rbx-icon {
    width: 1em; height: 1em;
    fill: currentColor;
    display: inline-block;
    vertical-align: -0.125em;
    flex-shrink: 0;
}
/* keep the small gaps the old <i> rules gave these icons */
.nirweb_read_more .rbx-icon { margin-right: 5px; margin-bottom: 2px; }
.nirweb_pagination .rbx-icon { color: #7E8B9A; }
/* Keep the inline menu dropdown arrow in flow: the theme's "ul.nirweb_main_menu
   > li svg" rule (meant for the absolutely-positioned PRO badge) would otherwise
   position our arrow absolutely at left:-39px. */
.nirweb_main_menu li a .rbx-icon { margin-right: 9px; position: static; left: auto; top: auto; }

/* Rating stars: outline when empty (grey), filled when hovered/selected (orange).
   The JS toggles .selected on the .ratings_stars element as before. */
.nirweb_star_rating .ratings_stars {
    font-size: 20px;
    fill: none;
    stroke: #BBC3CD;
    stroke-width: 34;
    cursor: pointer;
    outline: none;
}
/* .on is set by the rating JS (cumulative 1..N); .selected is the server-rendered
   fallback shown until the JS runs. Both = filled orange. */
.nirweb_star_rating .ratings_stars.on,
.nirweb_star_rating .ratings_stars.selected {
    fill: #FFA200;
    stroke: none;
}
.nirweb_star_rating .ratings_stars:focus-visible {
    outline: 2px solid #0052FF;
    outline-offset: 2px;
    border-radius: 3px;
}

/* Breadcrumb separator: was a Font Awesome glyph (content:"\f053"); redraw it as
   an SVG mask so it needs no icon font. */
.nirweb_breadcrumb li::after {
    content: "";
    width: 7px;
    height: 12px;
    background-color: #7D8998;
    -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 512"><path d="M31.7 239l136-136c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9L127.9 256l96.4 96.4c9.4 9.4 9.4 24.6 0 33.9L201.7 409c-9.4 9.4-24.6 9.4-33.9 0l-136-136c-9.5-9.4-9.5-24.6-.1-34z"/></svg>') no-repeat center / contain;
    mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 512"><path d="M31.7 239l136-136c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9L127.9 256l96.4 96.4c9.4 9.4 9.4 24.6 0 33.9L201.7 409c-9.4 9.4-24.6 9.4-33.9 0l-136-136c-9.5-9.4-9.5-24.6-.1-34z"/></svg>') no-repeat center / contain;
}

/* Load-more chevron: flip the angle-down to an angle-up when expanded
   (JS toggles .rbx-flipped). Replaces the old fa-angle-down <-> fa-angle-up swap. */
.rbx-flip-ic { transition: transform .15s ease; }
.rbx-flip-ic.rbx-flipped { transform: rotate(180deg); }

/* Short-link box holds an LTR URL inside the RTL page, so it was clipping the
   start ("...calhost:8190..."). Force LTR + left align so it reads from the
   beginning and, if too long, clips from the END; cap its width so a long URL
   can't push the page wider. */
.nirweb_copy_link input {
    direction: ltr;
    text-align: left;
    min-width: 0;
    max-width: 240px;
}

/* Stop decorative / off-canvas elements (e.g. the single-page .nirweb_svg dots
   graphic at right:90px, and the closed off-canvas menu) from creating a
   horizontal scrollbar at narrow widths. overflow-x:clip (not hidden) does not
   create a scroll container, so sticky/fixed positioning is unaffected. */
body { overflow-x: clip; }

/* Header switching by viewport width (the template previously switched by
   wp_is_mobile(), so a desktop browser narrowed to <=991 got the desktop header,
   whose Bootstrap col-lg stacks below 992px). Show the mobile header - with the
   hamburger - at <=991 for everyone; the desktop header above it. */
.rbx-header-m { display: none; }
@media screen and (max-width: 991px) {
    .rbx-header-m { display: flex; }
    .rbx-header-d { display: none; }
}

/* Mobile off-canvas submenu arrow: flip the (now SVG) dropdown chevron when its
   submenu is open. The old rule targeted <i>; this targets our .rbx-icon. */
@media screen and (max-width: 991px) {
    .rbx-header-m .nirweb_main_menu .menu-item-has-children > a .rbx-icon { transition: transform .15s ease; }
    .rbx-header-m .nirweb_main_menu .menu-item-has-children > a .rbx-icon.open { transform: rotate(180deg); }
}

/* Rating: show the 1-5 value under each star so the score is clear on mobile
   (no hover there). The cell stacks the star over its number. */
.nirweb_star_rating .rbx-rate-cell {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    margin-left: 8px;
    cursor: pointer;
}
.nirweb_star_rating .rbx-rate-num {
    font-size: 11px;
    line-height: 1;
    margin-top: 3px;
    font-weight: bold;
    color: #BBC3CD;
    user-select: none;
}
/* the number turns orange together with its filled star (JS sets .on / .selected) */
.nirweb_star_rating .rbx-rate-cell:has(.ratings_stars.on) .rbx-rate-num,
.nirweb_star_rating .rbx-rate-cell:has(.ratings_stars.selected) .rbx-rate-num {
    color: #FFA200;
}

/* Read-more ("ادامه") button: style.css makes it a fixed 209px pill centered at
   <=991. On the stacked mobile/tablet cards make it fill its container (full width)
   so it reads as a proper card action. The container is already a flex row. */
@media screen and (max-width: 991px) {
    .nirweb_read_more {
        width: 100%;
        box-sizing: border-box;
    }
}

/* Header account name (shown instead of the login/signup button when signed in via
   SSO). Keep it on one line; the mobile signup slot is a fixed 80px box, so size the
   name variant to its content with an ellipsis for very long names. */
.nirweb_account_name { white-space: nowrap; }
.nirweb_signup_link.nirweb_account_name {
    display: inline-block;
    width: auto;
    max-width: 150px;
    height: 36px;
    line-height: 36px;
    padding: 0 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
}

/* Live crypto-price widget (sidebar): show skeleton placeholders until the
   websocket delivers a finite price/percent, instead of the old "NaN"/"-%NaN".
   The skeleton <li> reuses the widget's own two-column layout; only the price
   and percent are replaced by shimmer bars (the coin name + logo stay visible). */
.response_digital_currencies_nirweb .rbx-coin-skel { pointer-events: none; }
.response_digital_currencies_nirweb .rbx-skel {
    display: block;
    height: 14px;
    border-radius: 5px;
    background: #e9eef4;
    background-image: linear-gradient(90deg, #e9eef4 0%, #f4f7fb 45%, #e9eef4 80%);
    background-size: 300% 100%;
    animation: rbx-skel-shimmer 1.3s ease-in-out infinite;
}
.response_digital_currencies_nirweb .rbx-skel-price { width: 70px; }
.response_digital_currencies_nirweb .rbx-skel-pct   { width: 44px; height: 11px; margin-top: 7px; }
@keyframes rbx-skel-shimmer {
    0%   { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}
@media (prefers-reduced-motion: reduce) {
    .response_digital_currencies_nirweb .rbx-skel { animation: none; }
}
