/* SLNTV - Somaliland National Television */

:root {
    --slntv-green: #006400;
    --slntv-green-dark: #004d00;
    --mobile-nav-height: 4.25rem;
}

@keyframes ticker {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.ticker-content {
    animation: ticker 30s linear infinite;
}

.ticker-wrap:hover .ticker-content {
    animation-play-state: paused;
}

@keyframes pulse-live {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.animate-pulse-live {
    animation: pulse-live 2s ease-in-out infinite;
}

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

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

.article-content p {
    margin-bottom: 1rem;
    line-height: 1.75;
    color: #374151;
}

.article-content h2,
.article-content h3 {
    color: var(--slntv-green);
    font-weight: 700;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.hero-swiper .swiper-pagination-bullet-active {
    background: var(--slntv-green);
}

[dir="rtl"] .border-l-4 {
    border-left: none;
    border-right: 4px solid var(--slntv-green);
}

[dir="rtl"] .pl-3 {
    padding-left: 0;
    padding-right: 0.75rem;
}

/* Pagination */
.pagination {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination a,
.pagination span {
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pagination a {
    background: white;
    border: 1px solid #e5e7eb;
    color: var(--slntv-green);
}

.pagination a:hover {
    background: #f0fdf4;
}

.pagination .active span {
    background: var(--slntv-green);
    color: white;
    border-color: var(--slntv-green);
}

/* Accessibility */
.skip-link {
    position: absolute;
    left: -9999px;
    top: auto;
    z-index: 100;
    padding: 0.75rem 1rem;
    background: var(--slntv-green);
    color: #fff;
    font-weight: 600;
    border-radius: 0 0 0.375rem 0;
}

.skip-link:focus {
    left: 0;
    top: 0;
}

.touch-target {
    min-height: 44px;
    min-width: 44px;
}

[x-cloak] {
    display: none !important;
}

/* Mobile body padding for bottom nav */
@media (max-width: 1023px) {
    .mobile-body {
        padding-bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0px));
    }

    .mobile-body.mobile-menu-open {
        overflow: hidden;
        touch-action: none;
    }

    #main-header {
        padding-top: env(safe-area-inset-top, 0px);
    }

    .top-bar .flex.items-center.gap-3:last-child {
        gap: 0.25rem;
    }

    .page-hero h1 {
        line-height: 1.2;
    }

    /* Horizontal scroll tables */
    .overflow-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-left: -1rem;
        margin-right: -1rem;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    table {
        min-width: 100%;
    }

    /* Hero slider mobile */
    .hero-swiper .swiper-button-prev,
    .hero-swiper .swiper-button-next {
        display: none;
    }

    .hero-swiper .swiper-pagination {
        bottom: 0.5rem !important;
    }

    .article-content {
        font-size: 1.0625rem;
    }

    .article-content img {
        max-width: 100%;
        height: auto;
    }

    /* Footer extra space above bottom nav */
    footer {
        margin-bottom: 0;
    }
}

/* Bottom navigation */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 60;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: stretch;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    min-height: var(--mobile-nav-height);
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.125rem;
    padding: 0.375rem 0.25rem;
    font-size: 0.625rem;
    font-weight: 600;
    color: #6b7280;
    text-align: center;
    line-height: 1.2;
    border: none;
    background: transparent;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.mobile-nav-item span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 2px;
}

.mobile-nav-item.active {
    color: var(--slntv-green);
}

.mobile-nav-item.mobile-nav-live {
    color: #dc2626;
    position: relative;
}

.mobile-nav-item.mobile-nav-live.active {
    color: #dc2626;
}

.mobile-nav-live-dot {
    position: absolute;
    top: 0.35rem;
    right: calc(50% - 1.25rem);
    width: 6px;
    height: 6px;
    background: #dc2626;
    border-radius: 50%;
    animation: pulse-live 2s ease-in-out infinite;
}

/* Mobile slide-out menu */
.mobile-menu-root {
    position: fixed;
    inset: 0;
    z-index: 70;
}

.mobile-menu-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.mobile-menu-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(100%, 20rem);
    max-width: 100%;
    background: #fff;
    display: flex;
    flex-direction: column;
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.15);
}

[dir="rtl"] .mobile-menu-panel {
    right: auto;
    left: 0;
    box-shadow: 8px 0 30px rgba(0, 0, 0, 0.15);
}

.mobile-menu-link {
    display: block;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    font-weight: 500;
    color: #374151;
    border-radius: 0.5rem;
    min-height: 48px;
}

.mobile-menu-link:hover,
.mobile-menu-link.active {
    background: #f0fdf4;
    color: var(--slntv-green);
}

/* Mobile category pills */
.mobile-category-scroll {
    -webkit-overflow-scrolling: touch;
}

.mobile-category-scroll::-webkit-scrollbar {
    display: none;
}

.category-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
    background: #f3f4f6;
    color: #374151;
    min-height: 44px;
}

.category-pill.active {
    background: var(--slntv-green);
    color: #fff;
}

@media (prefers-reduced-motion: reduce) {
    .ticker-content,
    .animate-pulse-live,
    .mobile-nav-live-dot {
        animation: none;
    }
}
