/* Site Styles for Newspaper System */

@font-face {
    font-family: 'Faruma';
    src: url('/fonts/Faruma.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Waheed';
    src: url('/fonts/Waheed.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Randhoo';
    src: url('/fonts/Randhoo.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

body {
    font-family: 'Faruma', sans-serif;
}

.thaana-text {
    font-family: 'Randhoo',  sans-serif;
    direction: rtl;
    text-align: right;
    line-height: 1.8;
    word-spacing: 0.2em;
    letter-spacing: 0.05em;
}

.english-text {
    direction: ltr;
}

.search-overlay {
    backdrop-filter: blur(10px);
    background: rgba(0, 0, 0, 0.5);
}

.search-container {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(20px);
}

.nav-link-hover {
    position: relative;
    transition: all 0.3s ease;
}

.nav-link-hover::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 50%;
    background: #FE0000;
    transition: all 0.3s ease;
}

.nav-link-hover:hover::after {
    width: 100%;
    left: 0;
}

.mobile-menu-slide {
    transform: translateY(-20px);
    opacity: 0;
    transition: all 0.3s ease;
}

.mobile-menu-slide.active {
    transform: translateY(0);
    opacity: 1;
}

.search-input-focus {
    box-shadow: 0 0 20px rgba(254, 0, 0, 0.3);
}

.category-hero {
    background: linear-gradient(135deg, #FE0000 0%, #CC0000 100%);
}

.article-card {
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: #FE0000;
}

.category-badge {
    background: linear-gradient(135deg, #FE0000, #CC0000);
}

.breadcrumb-item {
    position: relative;
}

.breadcrumb-item:not(:last-child)::after {
    content: '›';
    position: absolute;
    right: -20px;
    color: #6b7280;
}

/* Reduce desktop font size */
@media (min-width: 768px) {
    body {
        font-size: 14px;
    }
    
    .thaana-text {
        font-size: 14px;
    }
}

/* Fix mobile white space */
@media (max-width: 768px) {
    .flex.overflow-hidden.bg-white.rounded-lg.shadow-sm.h-35 {
        display: flex;
        width: 100%;
        flex-direction: column !important;
    }
    
    .flex.overflow-hidden.bg-white.rounded-lg.shadow-sm.h-35 img {
        width: 100% !important;
        height: auto !important;
        max-width: 100% !important;
    }
    
    .flex.overflow-hidden.bg-white.rounded-lg.shadow-sm.h-35 > div {
        width: 100% !important;
        flex: none !important;
    }
    
    /* Fix any empty white space on mobile */
    .flex.overflow-hidden.bg-white.rounded-lg.shadow-sm.h-35 > a > img {
        width: 100% !important;
        height: auto !important;
    }
}

/* Lazy loading for images */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Classified preview styles - limit images and content */
.classified-content-preview {
    max-height: 100%;
    overflow: hidden;
}

.classified-content-preview img {
    max-width: 100% !important;
    max-height: 180px !important;
    width: 100% !important;
    height: auto !important;
    object-fit: contain;
    display: block;
    margin: 0 auto 5px auto;
}

@media (min-width: 640px) {
    .classified-content-preview img {
        max-height: 200px !important;
    }
}

.classified-content-preview p {
    margin: 0.25rem 0;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.classified-content-preview p img {
    display: block;
    margin: 0 auto 5px auto;
}

.classified-preview {
    position: relative;
}

.classified-preview::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(to bottom, transparent, white);
    pointer-events: none;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Popup content - full size images */
#popupContent img {
    max-width: 100% !important;
    max-height: none !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain;
    margin: 10px auto;
    display: block;
}

/* Responsive navigation menu for tablet screens */
.desktop-nav-menu {
    flex-wrap: nowrap;
    justify-content: flex-end;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #FE0000 transparent;
    max-width: 100%;
}

.desktop-nav-menu::-webkit-scrollbar {
    height: 4px;
}

.desktop-nav-menu::-webkit-scrollbar-track {
    background: transparent;
}

.desktop-nav-menu::-webkit-scrollbar-thumb {
    background: #FE0000;
    border-radius: 2px;
}

/* Tablet responsive adjustments */
@media (min-width: 768px) and (max-width: 1024px) {
    .desktop-nav-menu {
        gap: 0.5rem !important;
        font-size: 1rem !important;
        max-width: 100%;
        overflow-x: auto;
    }
    
    .desktop-nav-menu a {
        padding: 0.25rem 0.5rem;
        font-size: 0.9rem;
    }
    
    .desktop-nav-menu img {
        width: 1.5rem !important;
        height: 1.5rem !important;
    }
}

/* Medium screens (tablets in portrait) */
@media (min-width: 768px) and (max-width: 900px) {
    .desktop-nav-menu {
        gap: 0.375rem !important;
        font-size: 0.875rem !important;
    }
    
    .desktop-nav-menu a {
        padding: 0.25rem 0.375rem;
        font-size: 0.85rem;
    }
}