/* News Styles - Compact Version */
.hero-section {
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.hero-section>* {
    position: relative;
    z-index: 2;
}

/* Featured News Card */
.featured-news-card {
    position: relative;
    overflow: hidden;
}

.featured-news-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(22, 101, 52, 0.02) 0%, rgba(22, 101, 52, 0.05) 100%);
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.featured-news-card:hover::before {
    opacity: 1;
}

.featured-news-card>* {
    position: relative;
    z-index: 2;
}

/* News Cards */
.news-card {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(22, 101, 52, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.news-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(22, 101, 52, 0.02) 0%, rgba(34, 197, 94, 0.05) 100%);
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.news-card:hover::before {
    opacity: 1;
}

.news-card:hover {
    border-color: rgba(22, 101, 52, 0.2);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.news-card>* {
    position: relative;
    z-index: 2;
}

/* Image Hover Effects - Reduced scaling for compact design */
.news-card img,
.featured-news-card img {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.news-card:hover img {
    transform: scale(1.03);
}

.featured-news-card:hover img {
    transform: scale(1.02);
}

.hover\:scale-102:hover {
    transform: scale(1.02);
}

.hover\:scale-103:hover {
    transform: scale(1.03);
}

/* Text Line Clamp - Fixed with standard property */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    line-clamp: 3;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Fallback for browsers that don't support line-clamp */
@supports not (-webkit-line-clamp: 2) {
    .line-clamp-2 {
        display: block;
        max-height: calc(1.2em * 2);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .line-clamp-3 {
        display: block;
        max-height: calc(1.2em * 3);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* Loading and Loaded states for images */
.loading {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    background-color: #f3f4f6;
}

.loaded {
    animation: fadeIn 0.5s ease-in-out;
}

/* Pagination Styles */
.pagination-wrapper .pagination {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.pagination-wrapper .pagination li {
    margin: 0;
}

.pagination-wrapper .pagination a,
.pagination-wrapper .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0.5rem;
    text-decoration: none;
    font-weight: 500;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.pagination-wrapper .pagination a {
    background-color: white;
    color: #059669;
    border: 1px solid #d1d5db;
}

.pagination-wrapper .pagination a:hover {
    background-color: #059669;
    color: white;
    border-color: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.pagination-wrapper .pagination .active span {
    background-color: #059669;
    color: white;
    border: 1px solid #059669;
}

.pagination-wrapper .pagination .disabled span {
    background-color: #f3f4f6;
    color: #9ca3af;
    border: 1px solid #e5e7eb;
    cursor: not-allowed;
}

/* Back to top button styling */
#back-to-top {
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#back-to-top.show {
    opacity: 1;
    pointer-events: auto;
}

#back-to-top:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* Animations */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced focus styles for accessibility */
.news-card:focus-within,
.featured-news-card:focus-within {
    outline: 2px solid #059669;
    outline-offset: 2px;
}

a:focus,
button:focus {
    outline: 2px solid #059669;
    outline-offset: 2px;
    border-radius: 0.25rem;
}

/* Responsive Adjustments - Updated for compact design */
@media (max-width: 768px) {
    .hero-section {
        padding: 2.5rem 0;
    }

    .hero-section h1 {
        font-size: 2rem;
        margin-bottom: 0.75rem;
    }

    .hero-section p {
        font-size: 1rem;
    }

    .featured-news-card .grid {
        grid-template-columns: 1fr;
    }

    .featured-news-card img {
        height: 200px;
    }

    .news-card {
        margin-bottom: 1rem;
    }

    .news-card img {
        height: 160px;
    }

    /* Adjust line-clamp for mobile */
    .line-clamp-2 {
        -webkit-line-clamp: 3;
        line-clamp: 3;
    }

    #back-to-top {
        bottom: 1rem;
        right: 1rem;
        padding: 0.65rem;
    }

    #back-to-top svg {
        width: 1.125rem;
        height: 1.125rem;
    }
}

@media (max-width: 480px) {
    .hero-section h1 {
        font-size: 1.75rem;
    }

    .featured-news-card .p-6 {
        padding: 1rem;
    }

    .news-card h3 {
        font-size: 1rem;
    }

    .news-card .p-5 {
        padding: 1rem;
    }

    .pagination-wrapper .pagination a,
    .pagination-wrapper .pagination span {
        min-width: 2rem;
        height: 2rem;
        font-size: 0.875rem;
    }

    .grid.gap-6 {
        gap: 1rem;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .news-card {
        background-color: #1f2937;
        border-color: #374151;
    }

    .featured-news-card {
        background-color: #1f2937;
    }

    .pagination-wrapper .pagination a {
        background-color: #1f2937;
        color: #10b981;
        border-color: #374151;
    }

    .pagination-wrapper .pagination a:hover {
        background-color: #10b981;
        color: #1f2937;
    }

    .loading {
        background-color: #374151;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .news-card {
        border: 2px solid;
    }

    .news-card:hover {
        border-width: 3px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {

    .news-card,
    .featured-news-card,
    .news-card img,
    .featured-news-card img,
    #back-to-top {
        transition: none;
        animation: none;
    }

    .loading {
        animation: none;
    }

    .hover\:scale-102:hover,
    .hover\:scale-103:hover {
        transform: none;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

/* Print Styles */
@media print {

    .hero-section,
    .pagination-wrapper,
    nav,
    #back-to-top {
        display: none;
    }

    .news-card,
    .featured-news-card {
        box-shadow: none;
        border: 1px solid #000;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .news-card img {
        max-width: 100%;
        height: auto;
    }

    body {
        font-size: 12pt;
        line-height: 1.4;
    }
}