/* ============================================================
   HAMASTA MEDIA — COMPREHENSIVE RESPONSIVE SYSTEM
   Mobile-first design. Covers 320px → 1440px+
   Breakpoints:
     xs:  320px  (small phones)
     sm:  480px  (phones)
     md:  768px  (tablets)
     lg:  1024px (laptops)
     xl:  1200px (desktops)
     2xl: 1440px (large screens)
   ============================================================ */

/* ── 1. BASE GLOBAL RESETS FOR MOBILE ─────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    overflow-x: hidden;
    min-width: 320px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    width: 100%;
    position: relative;
}

img,
video,
iframe,
embed,
object {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Lazy loading */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img[loading="lazy"].loaded,
img:not([loading]) {
    opacity: 1;
}

/* ── 2. FLUID TYPOGRAPHY ──────────────────────────────────── */
/* clamp(min, preferred, max) for fluid scaling */
h1 {
    font-size: clamp(1.6rem, 4vw, 2.8rem);
    line-height: 1.2;
}

h2 {
    font-size: clamp(1.3rem, 3vw, 2.2rem);
    line-height: 1.25;
}

h3 {
    font-size: clamp(1.1rem, 2.5vw, 1.8rem);
    line-height: 1.3;
}

h4 {
    font-size: clamp(1rem, 2vw, 1.4rem);
}

h5 {
    font-size: clamp(0.9rem, 1.8vw, 1.2rem);
}

h6 {
    font-size: clamp(0.85rem, 1.5vw, 1rem);
}

p {
    font-size: clamp(0.9rem, 1.5vw, 1rem);
}

/* ── 3. CONTAINER RESPONSIVE PADDING ─────────────────────── */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding-left: 16px;
    padding-right: 16px;
}

@media (min-width: 768px) {
    .container {
        padding-left: 24px;
        padding-right: 24px;
    }
}

@media (min-width: 1200px) {
    .container {
        padding-left: 32px;
        padding-right: 32px;
    }
}

/* ── 4. HEADER RESPONSIVE ────────────────────────────────── */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    height: 56px;
    padding: 0 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 4px;
}

@media (min-width: 360px) {
    .header-inner {
        padding: 0 0.75rem;
        gap: 8px;
    }
}

@media (min-width: 992px) {
    .header-inner {
        height: 80px;
        display: grid;
        grid-template-columns: auto 1fr auto;
        gap: 20px;
        padding: 0;
    }
}

@media (min-width: 1200px) {
    .header-inner {
        padding: 0;
    }
}

/* Logo scaling */
.logo-img {
    height: 28px;
}

@media (min-width: 360px) {
    .logo-img {
        height: 32px;
    }
}

@media (min-width: 480px) {
    .logo-img {
        height: 36px;
    }
}

@media (min-width: 768px) {
    .logo-img {
        height: 42px;
    }
}

@media (min-width: 1024px) {
    .logo-img {
        height: 48px;
    }
}

@media (min-width: 1200px) {
    .logo-img {
        height: 52px;
    }
}

/* Brand text */
.brand-name {
    font-size: clamp(11px, 2.5vw, 22px);
    letter-spacing: -0.2px;
}

.brand-tagline {
    font-size: 8px; /* Standardize with main.css */
    font-weight: 500;
    color: var(--medium-grey);
    display: none;
    /* Hide on mobile to save space */
}

@media (min-width: 480px) {
    .brand-tagline {
        display: block;
    }
}

/* Search bar: hide on small, show on desktop */
.search-bar-desktop {
    display: none;
}

@media (min-width: 992px) {
    .search-bar-desktop {
        display: flex;
        flex: 1;
        max-width: 300px;
    }

    .search-bar-desktop input {
        width: 100%;
    }
}

/* header-actions: ensure touch targets */
.header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

@media (min-width: 992px) {
    .header-actions {
        gap: 12px;
    }
}

.auth-btn,
.hamburger-btn {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── 5. MOBILE NAV PANEL ─────────────────────────────────── */
.mobile-nav-panel {
    width: min(85%, 320px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.mobile-nav-list a,
.mobile-dropdown-trigger>span {
    min-height: 48px;
    display: flex;
    align-items: center;
    padding: 12px 0;
}

.mobile-search input,
.mobile-search button {
    min-height: 44px;
}

/* ── 6. BREAKING NEWS TICKER ─────────────────────────────── */
.breaking-news {
    overflow: hidden;
    padding: 6px 0;
}

.ticker-container {
    position: relative;
    overflow: hidden;
    height: 32px;
    align-items: center;
}

.ticker-label {
    font-size: clamp(9px, 1.5vw, 12px);
    padding: 3px 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

.ticker-content {
    overflow: hidden;
    white-space: nowrap;
    font-size: clamp(11px, 1.8vw, 14px);
    flex: 1;
}

/* ── 7. HERO CAROUSEL ────────────────────────────────────── */
.hero-carousel {
    width: 100%;
    overflow: hidden;
}

.carousel-slide {
    background-size: cover;
    background-position: center;
}

@media (max-width: 400px) {
    .carousel-slide {
        background-position: center center;
    }
}

.carousel-content {
    padding: 16px;
}

.slide-title {
    font-size: clamp(16px, 5.5vw, 44px);
    line-height: 1.15;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.slide-desc {
    font-size: clamp(11px, 2.2vw, 16px);
    -webkit-line-clamp: 2;
    line-clamp: 2;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 10px;
    line-height: 1.4;
}

@media (min-width: 768px) {
    .carousel-content {
        padding: 30px 40px;
    }

    .slide-desc {
        -webkit-line-clamp: unset;
        line-clamp: unset;
    }
}

@media (min-width: 1024px) {
    .slide-title {
        font-size: 44px;
    }
}

/* Carousel action buttons */
.carousel-content .btn {
    padding: 10px 18px;
    font-size: 13px;
}

@media (max-width: 479px) {
    .carousel-content>div {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

    .carousel-content .btn {
        padding: 8px 14px;
        font-size: 12px;
    }
}

/* ── 8. MAIN CONTENT GRID (Left + Sidebar) ───────────────── */
.main-content-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 16px 0;
}

@media (min-width: 768px) {
    .main-content-grid {
        gap: 30px;
        padding: 24px 0;
    }
}

@media (min-width: 1024px) {
    .main-content-grid {
        grid-template-columns: 2fr 1.1fr;
        gap: 40px;
        padding: 40px 0;
    }
}

/* The sidebar stacks below content on mobile */
.main-content-grid .sidebar {
    width: 100%;
    max-width: 100%;
}

@media (min-width: 1024px) {
    .main-content-grid .sidebar {
        position: sticky;
        top: 88px;
        max-height: calc(100vh - 100px);
        overflow-y: auto;
        scrollbar-width: thin;
    }
}

/* ── 9. NEWS GRID ────────────────────────────────────────── */
.news-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 640px) {
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

@media (min-width: 768px) {
    .news-grid {
        gap: 20px;
    }
}

@media (min-width: 1200px) {
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ── 10. NEWS CARD ───────────────────────────────────────── */
.news-card {
    width: 100%;
    overflow: hidden;
}

.news-card .news-image {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.card-img-container {
    height: clamp(160px, 30vw, 220px);
}

.card-title {
    font-size: clamp(15px, 2vw, 18px);
    overflow-wrap: break-word;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    font-weight: 800;
}

.card-excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: clamp(13px, 1.5vw, 14px);
}

/* news interactions wrap */
.news-interactions {
    flex-wrap: wrap;
    gap: 10px;
}

/* ── 11. CATEGORY TABS ───────────────────────────────────── */
.category-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar {
    display: none;
}

.category-tabs .btn {
    scroll-snap-align: start;
    white-space: nowrap;
    flex-shrink: 0;
    padding: 6px 14px;
    font-size: 12px;
}

/* ── 12. CATEGORY BLOCKS (Politics, Business etc.) ──────── */
.category-block-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 640px) {
    .category-block-grid {
        grid-template-columns: 1.5fr 1fr;
    }
}

.cat-main-card {
    height: clamp(200px, 40vw, 320px);
}

.cat-mini-item img {
    width: clamp(60px, 12vw, 80px);
    height: clamp(50px, 9vw, 65px);
}

/* ── 13. SERVICES GRID ───────────────────────────────────── */
.services-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 640px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .services-grid {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
        gap: 25px;
    }
}

.service-promo-card h3 {
    font-size: clamp(18px, 4vw, 22px);
    line-height: 1.3;
}

.service-card-inner {
    padding: clamp(16px, 4vw, 30px);
}

/* ── 14. EXECUTIVE GRID ──────────────────────────────────── */
.executive-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

@media (min-width: 480px) {
    .executive-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .executive-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

@media (min-width: 1200px) {
    .executive-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.executive-img {
    width: clamp(80px, 15vw, 120px);
    height: clamp(80px, 15vw, 120px);
}

/* ── 15. SIDEBAR WIDGETS ─────────────────────────────────── */
.sidebar-widget {
    padding: 16px;
    margin-bottom: 20px;
}

@media (min-width: 768px) {
    .sidebar-widget {
        padding: 22px;
        margin-bottom: 28px;
    }
}

.ad-container-sidebar-large {
    width: 100%;
    max-width: 300px;
    height: auto;
    margin: 0 auto;
}

/* ── 16. FORMS & INPUTS — TOUCH FRIENDLY ────────────────── */
input,
textarea,
select {
    font-size: 16px !important;
    /* prevents iOS zoom on focus */
    min-height: 44px;
    width: 100%;
    border-radius: 8px;
    padding: 10px 14px;
    border: 1px solid var(--border-color, #e0e0e0);
    font-family: inherit;
    transition: border-color 0.3s;
    -webkit-appearance: none;
    appearance: none;
}

input:focus,
textarea:focus,
select:focus {
    outline: 2px solid var(--maroon, #800000);
    outline-offset: 0;
    border-color: var(--maroon, #800000);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

/* Checkboxes and radios */
input[type="checkbox"],
input[type="radio"] {
    min-height: auto;
    width: auto;
    min-width: 20px;
    min-height: 20px;
}

/* ── 17. BUTTONS — TOUCH FRIENDLY ────────────────────────── */
.btn {
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    cursor: pointer;
    padding: 10px 18px;
    font-size: 14px;
    white-space: nowrap;
}

@media (max-width: 479px) {
    .btn {
        padding: 10px 14px;
        font-size: 13px;
    }
}

/* Full-width buttons on small screens when nested */
@media (max-width: 479px) {
    .btn-block-xs {
        width: 100%;
    }
}

/* ── 22. TOUCH DEVICE OPTIMIZATIONS ──────────────────────── */
@media (hover: none) and (pointer: coarse) {
    * {
        background-attachment: scroll !important;
    }

    .btn,
    .nav-link,
    .dropdown-item a,
    .social-icons a,
    input,
    textarea,
    select {
        cursor: default;
        -webkit-tap-highlight-color: transparent;
    }
}

/* ── 23. SPACING & OVERFLOW FIXES ────────────────────────── */
@media (max-width: 768px) {
    .section-padding {
        padding: 50px 0;
    }

    .gap-lg {
        gap: 30px !important;
    }

    .gap-xl {
        gap: 40px !important;
    }
}

/* Ensure no horizontal overflow from animations */
.animate-on-scroll {
    overflow: hidden;
}

/* ── 24. IMAGE OPTIMIZATION FOR MOBILE ───────────────────── */
img {
    height: auto;
    object-fit: cover;
}

.img-scale-hover:hover {
    transform: scale(1.02);
}

@media (max-width: 480px) {
    .img-scale-hover:hover {
        transform: none;
    }
}

/* ── 25. DROPDOWN & INTERACTIVE FIXES ────────────────────── */
/* Ensure dropdowns don't overflow screen horizontally */
.dropdown-menu {
    max-width: 90vw;
}

@media (max-width: 991px) {
    .dropdown-menu {
        position: static;
        width: 100%;
        box-shadow: none;
        padding-left: 20px;
        display: none;
    }

    .dropdown-item.active .dropdown-menu {
        display: block;
    }
}

    .table-responsive {
        overflow-x: auto;
    }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th,
td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
}

/* ── 19. ACTION BUTTONS / BT N-ACTION ───────────────────── */
.action-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.btn-action {
    min-width: 36px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid var(--border-color, #e0e0e0);
    background: var(--white, #fff);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.btn-action.edit:hover {
    background: #e3f2fd;
    color: #1565c0;
    border-color: #90caf9;
}

.btn-action.delete:hover {
    background: #ffebee;
    color: #c62828;
    border-color: #ef9a9a;
}

/* ── 20. FOOTER — RESPONSIVE ─────────────────────────────── */
/* (footer.css styles are used; these ensure proper stacking) */
.footer-grid-modern {
    display: grid;
    grid-template-columns: 1fr;
    gap: 28px;
}

@media (min-width: 640px) {
    .footer-grid-modern {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .footer-grid-modern {
        grid-template-columns: 2fr 1fr 1fr 1fr;
        gap: 40px;
    }
}

.footer-modern {
    padding: 40px 0 20px;
}

@media (min-width: 768px) {
    .footer-modern {
        padding: 60px 0 24px;
    }
}

.footer-socials {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

/* ── 21. EDITOR PAGE (create-news.html) ──────────────────── */
/* Two-column editor grid → single column on tablet/mobile */
#createNewsForm>div[style*="grid-template-columns"] {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 24px !important;
}

@media (min-width: 1024px) {
    #createNewsForm>div[style*="grid-template-columns"] {
        grid-template-columns: 2fr 1fr !important;
        gap: 40px !important;
    }
}

/* Right column border disappears on mobile */
#createNewsForm>div>div:last-child[style*="border-left"] {
    border-left: none !important;
    padding-left: 0 !important;
    border-top: 1px solid #eee;
    padding-top: 24px;
}

@media (min-width: 1024px) {
    #createNewsForm>div>div:last-child[style*="border-left"] {
        border-left: 1px solid #eee !important;
        padding-left: 40px !important;
        border-top: none;
        padding-top: 0;
    }
}

/* Action bar wraps on small */
#createNewsForm>div[style*="flex"] {
    flex-wrap: wrap;
}

@media (max-width: 639px) {
    #createNewsForm>div[style*="flex"] button {
        width: 100%;
    }
}

/* Quill editor min-height on mobile */
.ql-container.ql-snow {
    min-height: 250px !important;
}

@media (min-width: 768px) {
    .ql-container.ql-snow {
        min-height: 350px !important;
    }
}

@media (min-width: 1024px) {
    .ql-container.ql-snow {
        min-height: 450px !important;
    }
}

/* Editor form title input */
#newsTitle {
    font-size: clamp(16px, 3vw, 22px) !important;
}

/* data-card wrapper */
.data-card {
    padding: clamp(16px, 3vw, 25px);
    border-radius: clamp(12px, 2vw, 20px);
}

/* ── 22. ADMIN/EDITOR DASHBOARD (sidebar) ────────────────── */
@media (max-width: 767px) {
    .main-content {
        margin-left: 0 !important;
        padding: 16px !important;
    }

    .dashboard-header {
        flex-direction: column;
        gap: 12px;
        padding: 14px 16px;
        border-radius: 14px;
    }

    .header-meta h2 {
        font-size: 18px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-info h3 {
        font-size: 22px;
    }
}

@media (max-width: 479px) {
    .stats-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Users page search area */
.search-box input[type="text"] {
    width: 100% !important;
    max-width: 100%;
}

/* ── 23. SEARCH INPUT ON USERS PAGE ─────────────────────── */
@media (max-width: 767px) {

    /* Stack all header items in the users/manage page */
    .data-card>div[style*="space-between"] {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .data-card>div>.search-box {
        width: 100%;
    }

    .data-card>div>.search-box input {
        width: 100% !important;
    }

    .data-card>div>div[style*="add-user"],
    .data-card>div>div[style*="gap:20px"] {
        width: 100%;
        justify-content: space-between !important;
    }
}

/* ── 24. MODALS — RESPONSIVE ─────────────────────────────── */
.modal>.data-card,
[id$="Modal"]>.data-card {
    width: min(95vw, 500px);
    max-height: 90vh;
    overflow-y: auto;
    margin: 20px;
}

@media (max-width: 479px) {

    .modal>.data-card,
    [id$="Modal"]>.data-card {
        width: 95vw;
        margin: 10px;
        padding: 16px;
    }
}

/* previewModal full experience on desktop */
@media (min-width: 768px) {
    #previewModal>div {
        max-width: 800px;
    }
}

/* ── 25. ARTICLE PAGE ────────────────────────────────────── */
.article-hero {
    height: clamp(200px, 40vw, 500px);
}

.article-body {
    font-size: clamp(15px, 1.8vw, 18px);
    line-height: 1.8;
}

.article-content-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

@media (min-width: 1024px) {
    .article-content-grid {
        grid-template-columns: 2fr 1fr;
        gap: 40px;
    }
}

/* ── 26. NOTIFICATION TOAST ──────────────────────────────── */
.notification-toast {
    left: 50%;
    transform: translateX(-50%) translateY(150%);
    width: calc(100% - 32px);
    max-width: 420px;
    bottom: 16px;
}

.notification-toast.active {
    transform: translateX(-50%) translateY(0);
}

@media (min-width: 480px) {
    .notification-toast {
        left: auto;
        right: 20px;
        transform: translateY(150%);
        width: auto;
        max-width: 400px;
    }

    .notification-toast.active {
        transform: translateY(0);
    }
}

/* ── 27. BREAKING NEWS TICKER LINKS ──────────────────────── */
.ticker-link {
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
}

.ticker-link:hover {
    text-decoration: underline;
}

/* ── 28. PUBLICATION SIGNALS PANEL (create-news) ─────────── */
@media (max-width: 639px) {

    #breakingToggleContainer,
    #trendingToggleContainer {
        padding: 14px !important;
    }
}

/* ── 29. OVERFLOW & SCROLL FIXES ─────────────────────────── */
.ql-toolbar.ql-snow {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.content-stats {
    flex-wrap: wrap;
    gap: 10px;
}

/* ── 30. UTILITY HIDE/SHOW RESPONSIVE ───────────────────── */
.hide-xs {
    display: none !important;
}

@media (min-width: 480px) {
    .hide-xs {
        display: initial !important;
    }
}

.hide-sm {
    display: block;
}

@media (min-width: 768px) {
    .hide-sm {
        display: none !important;
    }
}

.show-md {
    display: none;
}

@media (min-width: 768px) {
    .show-md {
        display: block;
    }
}

/* ── 31. SECTION SPACING FLUID ───────────────────────────── */
section,
.section {
    padding: clamp(32px, 6vw, 80px) 0;
}

/* ── 32. LARGE DESKTOP ENHANCEMENTS (1440px+) ────────────── */
@media (min-width: 1440px) {
    .container {
        max-width: 1400px;
    }

    .main-content-grid {
        grid-template-columns: 2.2fr 1fr;
    }

    .hero-carousel {
        border-radius: 16px;
    }

    .news-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ── 33. PRINT ───────────────────────────────────────────── */
@media print {

    .sidebar,
    .mobile-nav-panel,
    .hamburger-btn,
    .ad-placeholder,
    .notification-toast,
    .breaking-news,
    .carousel-dots,
    .header-actions {
        display: none !important;
    }

    .main-content {
        margin: 0 !important;
        padding: 0 !important;
    }

    a {
        color: inherit;
        text-decoration: underline;
    }

    img {
        max-width: 100% !important;
    }
}

/* ── 34. REDUCED MOTION ──────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .ticker-content {
        animation: none;
    }
}

/* ── 35. ADVERT MODAL — FULL SCREEN ON PHONES ────────────── */
.modal-overlay {
    padding: 0;
}

@media (max-width: 599px) {
    .modal-content {
        max-width: 100% !important;
        width: 100% !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
        margin: 0;
    }

    .modal-overlay {
        align-items: flex-end;
    }
}

/* ── 36. LOGIN PAGE CARD — RESPONSIVE ───────────────────── */
.login-card,
.auth-card {
    width: min(95vw, 480px);
    padding: clamp(20px, 5vw, 40px);
    border-radius: clamp(12px, 3vw, 24px);
}

/* ── 37. STATUS BADGES & CARD HEADERS ────────────────────── */
@media (max-width: 599px) {
    .card-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px;
    }

    .card-header h3,
    .card-header h4 {
        font-size: 16px;
    }

    /* Status badge text smaller on xs */
    .status-badge {
        font-size: 10px;
        padding: 3px 8px;
    }
}

/* ── 38. ADMIN TABLE ACTION COLUMN ───────────────────────── */
@media (max-width: 599px) {
    .action-cell {
        white-space: nowrap;
    }

    /* Hide less important table columns on very small screens */
    .table-col-hide-xs {
        display: none;
    }
}

/* ── 39. SWIPE INDICATOR HINT (hero carousel) ────────────── */
.carousel-swipe-hint {
    position: absolute;
    bottom: 48px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 1px;
    pointer-events: none;
    animation: fadeOut 3s ease 2s forwards;
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@media (min-width: 768px) {
    .carousel-swipe-hint {
        display: none;
    }
}

/* ── 40. IMPROVED TOUCH TARGETS ──────────────────────────── */
@media (hover: none) and (pointer: coarse) {
    .btn-action {
        min-width: 44px;
        min-height: 44px;
    }

    .sidebar-menu a {
        min-height: 48px;
    }

    .dot {
        width: 14px !important;
        height: 14px !important;
    }
}

/* ── 41. SETTINGS FORM — MOBILE ──────────────────────────── */
@media (max-width: 599px) {
    #settingsForm .form-group {
        margin-bottom: 16px;
    }

    /* Toggle label + switch inline */
    .toggle-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
    }
}

/* ── 42. HOMEPAGE MOBILE REFINEMENTS ────────────────────── */
@media (max-width: 767px) {

    /* Advantage Section */
    .advantage-section {
        padding: 50px 0 !important;
    }

    .section-header-compact {
        margin-bottom: 30px !important;
    }

    .section-header-compact .section-title {
        font-size: 24px !important;
        letter-spacing: -0.5px !important;
    }

    .advantage-item {
        padding: 24px !important;
        border-radius: 16px !important;
    }

    .advantage-icon-box {
        width: 48px !important;
        height: 48px !important;
        font-size: 20px !important;
        margin-bottom: 16px !important;
        border-radius: 12px !important;
    }

    /* Executive Board Section */
    .executive-section {
        padding: 40px 0 !important;
    }

    .executive-card {
        padding: 24px 16px !important;
        border-radius: 20px !important;
    }

    .advantage-item {
        padding: 20px !important;
        border-radius: 16px !important;
    }

    /* Sidebar Widgets */
    .sidebar-widget {
        padding: 20px !important;
        margin-bottom: 20px !important;
    }

    .widget-title {
        font-size: 16px !important;
        margin-bottom: 16px !important;
    }

    /* Trending List on Mobile */
    .trend-rank {
        font-size: 18px !important;
        width: 24px !important;
        margin-right: 12px !important;
    }

    .trend-info h4 {
        font-size: 14px !important;
    }

    /* Newsletter Form */
    .newsletter-form input {
        height: 44px !important;
        font-size: 14px !important;
    }

    /* Footer Refinements */
    .footer-modern {
        padding: 40px 0 24px !important;
    }

    .footer-grid-modern {
        margin-bottom: 40px !important;
        gap: 24px !important;
    }

    .footer-brand {
        text-align: center;
    }

    .footer-logo-container {
        justify-content: center !important;
    }

    .footer-socials {
        justify-content: center !important;
        margin-top: 16px !important;
    }

    .footer-bottom-modern {
        margin-top: 40px !important;
        padding-top: 20px !important;
    }
}

/* ── 43. HORIZONTAL SCROLL FOR CATEGORY TABS ─────────────── */
@media (max-width: 767px) {
    .category-tabs {
        display: flex !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
        padding-bottom: 4px !important;
        /* Spacing for scrollbar */
        gap: 12px !important;
        scrollbar-width: none;
        /* Firefox */
        -ms-overflow-style: none;
        /* IE/Edge */
    }

    .category-tabs::-webkit-scrollbar {
        display: none;
        /* Chrome/Safari */
    }

    .category-tabs .tab,
    .category-tabs .btn {
        flex: 0 0 auto !important;
        scroll-snap-align: start;
    }
}

/* ── 44. SIDEBAR AD MOBILITY ────────────────────────────── */
@media (max-width: 1023px) {

    /* Don't show large sidebar ads on middle column if they break flow */
    .ad-container-sidebar-large {
        height: auto !important;
        min-height: 250px !important;
        width: 100% !important;
    }

    .ad-container-sidebar-large img {
        object-fit: cover !important;
        height: 250px !important;
    }
}

/* ══════════════════════════════════════════════════════════
   ── 45. GLOBAL TEXT OVERFLOW PREVENTION ─────────────────
   Prevents any text from overflowing horizontally beyond
   the browser viewport width on all screen sizes.
   ══════════════════════════════════════════════════════════ */
*,
*::before,
*::after {
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* Preserve nowrap for specific UI elements */
.ticker-link,
.ticker-label,
.filter-label,
.brand-name,
.btn,
.nav-link,
.footer-heading,
.category-tabs .btn,
th,
.sort-btn,
.period-btn,
.kpi-label,
.status-badge {
    word-break: normal;
    overflow-wrap: normal;
    white-space: nowrap;
}

/* Headings and news titles should break gracefully */
h1, h2, h3, h4, h5, h6,
.card-title,
.slide-title,
.executive-name,
.section-title,
.section-title-premium {
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* ══════════════════════════════════════════════════════════
   ── 46. ANALYTICS PAGE — MOBILE RESPONSIVE ───────────────
   Reduces chart & KPI card sizes on small screens so the
   analytics dashboard fits properly on mobile devices.
   ══════════════════════════════════════════════════════════ */

/* KPI grid: 2-col on tablet, 1-col on phone */
@media (max-width: 767px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    .kpi-card {
        padding: 14px 12px !important;
    }

    .kpi-value {
        font-size: 20px !important;
        letter-spacing: -0.5px !important;
    }

    .kpi-label {
        font-size: 9px !important;
        letter-spacing: 0.5px !important;
    }

    .kpi-icon {
        width: 34px !important;
        height: 34px !important;
        font-size: 14px !important;
    }

    /* Stack chart grids vertically */
    .chart-grid,
    .chart-grid-3 {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }

    .chart-card {
        padding: 16px !important;
        border-radius: 14px !important;
    }

    .chart-card h4 {
        font-size: 13px !important;
    }

    /* Cap canvas height to keep charts compact on mobile */
    #timelineChart {
        max-height: 180px !important;
    }

    #statusChart {
        max-height: 180px !important;
    }

    #categoryChart {
        max-height: 200px !important;
    }

    #authorsChart {
        max-height: 200px !important;
    }

    /* Spotlight cards: single column */
    #topSpotlight {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    /* Period filter wraps nicely */
    .period-filter {
        flex-wrap: wrap;
        gap: 5px;
    }

    /* Analytics header */
    .dashboard-header {
        gap: 10px;
    }

    .dashboard-header h2 {
        font-size: 16px !important;
    }

    /* Refresh button hidden on mobile (already desktop-only class) */
    .desktop-only {
        display: none !important;
    }
}

@media (max-width: 479px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .kpi-value {
        font-size: 18px !important;
    }

    /* Make canvas height smaller on very small phones */
    #timelineChart {
        max-height: 150px !important;
    }

    #statusChart {
        max-height: 150px !important;
    }

    #categoryChart {
        max-height: 170px !important;
    }

    #authorsChart {
        max-height: 170px !important;
    }

    /* Ensure table scrolls horizontally */
    .table-responsive {
        font-size: 11px !important;
    }

    .table-responsive table {
        min-width: 420px !important;
    }
}

/* ══════════════════════════════════════════════════════════
   ── 47. NEWS HEADLINES & BOLD TEXT WRAPPING ──────────────
   Forces ALL bold/headline content to wrap gracefully
   instead of overflowing the browser viewport.
   ══════════════════════════════════════════════════════════ */

/* Hero slide titles */
.slide-title,
.hero-title,
.headline-title {
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
    hyphens: auto;
}

/* Article card titles and news card headlines */
.card-title,
.news-card-title,
.article-title,
.article-headline,
.trending-title,
.grid-news-title,
.main-article-title,
.featured-title,
.related-title,
.news-title,
.breaking-item,
.item-title {
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
    max-width: 100%;
    hyphens: auto;
}

/* Ticker + breaking news text */
.ticker-content span,
.ticker-item,
.breaking-text {
    /* keep inline flow but allow line break in ticker container */
    white-space: nowrap; /* ticker must scroll; individual wrapping is handled by container */
}

/* Section headings */
.section-title,
.section-title-premium,
h1, h2, h3, h4, h5, h6 {
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
    max-width: 100%;
}

/* Bold/strong elements everywhere */
b, strong {
    word-break: break-word;
    overflow-wrap: break-word;
}

/* Long URLs inside article body */
.article-body a,
.article-body p,
p, li, td, th, span, label, cite, blockquote {
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 100%;
}

/* ══════════════════════════════════════════════════════════
   ── 48. MOBILE CENTER ALIGNMENT ──────────────────────────
   Centers text, headings, cards, and CTAs on phone screens
   for a cleaner single-column layout experience.
   ══════════════════════════════════════════════════════════ */
@media (max-width: 767px) {

    /* Section headers */
    .section-header,
    .section-header-compact {
        text-align: center !important;
    }

    .section-tag {
        display: inline-block !important;
        text-align: center !important;
    }

    .section-title,
    .section-title-premium,
    .section-subtitle {
        text-align: center !important;
    }

    /* Hero & Slide content */
    .slide-content,
    .hero-content,
    .hero-text {
        text-align: center !important;
        align-items: center !important;
    }

    .slide-title,
    .slide-meta,
    .slide-excerpt {
        text-align: center !important;
    }

    .slide-actions,
    .hero-actions {
        justify-content: center !important;
        flex-wrap: wrap;
        gap: 10px;
    }

    /* Stats cards center */
    .stat-card {
        text-align: center !important;
    }

    .stat-icon {
        margin: 0 auto 10px !important;
    }

    /* Feature/Advantage cards */
    .advantage-item,
    .feature-card,
    .service-card,
    .info-card {
        text-align: center !important;
    }

    .advantage-icon-box,
    .feature-icon,
    .service-icon {
        margin-left: auto !important;
        margin-right: auto !important;
    }

    /* Executive cards center on mobile */
    .executive-info {
        text-align: center !important;
    }

    .executive-socials {
        justify-content: center !important;
    }

    .executive-photo-wrap {
        margin-left: auto !important;
        margin-right: auto !important;
    }

    /* About / mission-vision */
    .mv-card {
        text-align: center !important;
    }

    .mv-icon {
        display: block;
        margin: 0 auto 12px !important;
    }

    /* Footer brand section */
    .footer-brand {
        text-align: center !important;
        align-items: center !important;
    }

    .footer-tagline {
        text-align: center !important;
    }

    /* Contact page items */
    .contact-item {
        justify-content: center !important;
        text-align: center !important;
    }

    /* CTA buttons centered */
    .cta-group,
    .btn-group,
    .action-row {
        justify-content: center !important;
        align-items: center !important;
        flex-wrap: wrap;
        gap: 10px;
    }

    /* Services page hero text */
    .service-hero-content,
    .page-hero-content {
        text-align: center !important;
        align-items: center !important;
    }

    /* News page filter bar centered */
    .filter-bar,
    .news-filter,
    .category-tabs {
        justify-content: center !important;
    }
}

@media (max-width: 479px) {
    /* Extra small phones: even tighter centering */
    .kpi-card {
        text-align: center !important;
    }

    .kpi-icon {
        margin: 0 auto 8px !important;
    }

    /* News article meta center on xs */
    .article-meta,
    .card-meta,
    .news-meta {
        justify-content: center !important;
        flex-wrap: wrap;
        gap: 6px;
    }
}

/* ══════════════════════════════════════════════════════════
   ── 49. ENABLED GRID BOXES (visible bordered grid cells) ─
   Adds subtle card-box effect to grid items: news cards,
   service boxes, executive cards, stat cards, kpi cards.
   ══════════════════════════════════════════════════════════ */

/* News grid cards — visible box */
.news-card,
.article-card,
.grid-news-card {
    border: 1px solid rgba(128, 0, 0, 0.12) !important;
    border-radius: 14px !important;
    overflow: hidden;
    background: var(--white, #fff);
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.news-card:hover,
.article-card:hover,
.grid-news-card:hover {
    border-color: rgba(128,0,0,0.3) !important;
    box-shadow: 0 6px 24px rgba(128,0,0,0.13) !important;
    transform: translateY(-3px);
}

/* Stat/KPI boxes */
.stat-card,
.kpi-card {
    border: 1px solid rgba(128,0,0,0.1) !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06) !important;
}

/* Service feature boxes */
.feature-box,
.feature-card,
.service-feature,
.advantage-item {
    border: 1px solid rgba(0,0,0,0.08) !important;
    border-radius: 16px !important;
}

/* Executive cards box */
.executive-card {
    border: 1px solid rgba(128,0,0,0.1) !important;
}

/* Analytics chart cards */
.chart-card {
    border: 1px solid rgba(128,0,0,0.08) !important;
}

/* Table rows visible alternating grid */
.data-table tbody tr:nth-child(even) {
    background: rgba(128,0,0,0.03) !important;
}

.data-table tbody tr {
    border-bottom: 1px solid rgba(0,0,0,0.05) !important;
}

/* Sidebar widget boxes */
.sidebar-widget {
    border: 1px solid rgba(128,0,0,0.08) !important;
}

/* Filter bar chips/tabs as boxes */
.category-tabs .btn-tab,
.category-tabs .btn,
.filter-btn,
.tab-btn {
    border: 1px solid rgba(128,0,0,0.2) !important;
    border-radius: 8px !important;
}

.category-tabs .btn-tab.active,
.category-tabs .btn.active,
.filter-btn.active,
.tab-btn.active {
    border-color: var(--maroon, #800000) !important;
    background: var(--maroon, #800000) !important;
    color: #fff !important;
}

/* ══════════════════════════════════════════════════════════
   ── 50. CONTAINER OVERFLOW HARD STOP ─────────────────────
   Last-resort rule: nothing inside .container should ever
   exceed 100% of the viewport width.
   ══════════════════════════════════════════════════════════ */
.container,
.main-content,
.page-wrapper,
main {
    max-width: 100vw;
    overflow-x: hidden;
}

/* Tables scroll horizontally instead of overflowing */
table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

/* Pre/code blocks scroll on overflow */
pre, code {
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
    max-width: 100%;
}

/* ── 8. MOBILE NAVIGATION (SIDEBAR & OVERLAY) ─────────── */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: 0.25s;
}

.mobile-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-nav-panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 320px;
    height: 100vh;
    background: white;
    z-index: 2100;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.2);
    transition: right 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.mobile-nav-panel.active {
    right: 0;
}

.mobile-nav-header {
    padding: 20px;
    background: var(--maroon);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-logo-text {
    font-size: 1.1rem;
    color: white;
    font-weight: 800;
}

.close-nav-btn {
    background: transparent;
    border: none;
    font-size: 1.3rem;
    color: white;
    cursor: pointer;
}

.mobile-search {
    padding: 16px;
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
}

.mobile-search input {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 40px;
    font-size: 0.85rem;
}

.mobile-search button {
    background: var(--maroon);
    border: none;
    width: 44px;
    border-radius: 40px;
    color: white;
    cursor: pointer;
}

.mobile-nav-list {
    list-style: none;
    padding: 8px 0;
    flex-grow: 1;
}

.mobile-nav-list>li>a {
    display: flex;
    justify-content: space-between;
    padding: 14px 20px;
    text-decoration: none;
    color: var(--dark);
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}

.mobile-submenu {
    list-style: none;
    background: #fbfbfc;
    display: none;
}

.mobile-submenu.active {
    display: block;
}

.mobile-submenu li a {
    padding: 12px 20px 12px 40px;
    display: block;
    text-decoration: none;
    color: var(--dark);
    font-size: 0.85rem;
}

.mobile-socials {
    padding: 24px 20px;
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
}

.mobile-socials a {
    color: var(--maroon);
    font-size: 1.3rem;
}