:root {
    --primary-color: #00303f;
    --secondary-color: #f6e7d8;
    --accent-color: #b86b3a;
    --text-dark: #2c2c2c;
    --text-light: #555555;
    --white: #ffffff;
}

body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    background-color: var(--secondary-color);
    color: var(--text-dark);
    position: relative;
    overflow-x: hidden;
}

/* --- Hero Section --- */
.header-image {
    background-image: url('https://images.unsplash.com/photo-1473625345758-55a045183863?q=80&w=2070&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    position: relative;
    padding: 100px 20px 80px;
    text-align: center;
    color: var(--white);
    border-bottom-left-radius: 30px;
    border-bottom-right-radius: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.header-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 48, 63, 0.7);
    /* Darker overlay for better text contrast */
    border-bottom-left-radius: 30px;
    border-bottom-right-radius: 30px;
    z-index: 1;
}

.header-image h1,
.header-image p,
.header-image form {
    position: relative;
    z-index: 2;
}

.header-image h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 0.5em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.header-image p {
    font-size: 1.25rem;
    margin-bottom: 2.5em;
    opacity: 0.95;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* --- Search Form --- */
.search-form {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 10px;
    border-radius: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    max-width: 800px;
    margin: 0 auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.search-form select {
    flex: 1;
    padding: 15px 25px;
    border: none;
    background: transparent;
    font-size: 1rem;
    color: var(--text-dark);
    cursor: pointer;
    border-right: 1px solid #ddd;
}

.search-form select:last-of-type {
    border-right: none;
}

.search-form select:focus {
    outline: none;
}

.search-form button {
    background: var(--accent-color);
    color: var(--white);
    border: none;
    padding: 15px 40px;
    border-radius: 40px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-form button:hover {
    background: #a35d32;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(184, 107, 58, 0.3);
}

/* --- Grid Section --- */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: -60px auto 60px;
    /* Overlap hero section */
    padding: 0 20px;
    position: relative;
    z-index: 3;
}

.news-card {
    background: var(--white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    border: 2px solid transparent;
    position: relative;
}

.news-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 20px;
    padding: 2px;
    background: linear-gradient(135deg, transparent 0%, #ffa726 50%, transparent 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.news-card:hover::before {
    opacity: 1;
}

.news-card:hover {
    transform: translateY(-12px) rotateX(2deg);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15), 0 0 40px rgba(255, 167, 38, 0.2);
    border-color: rgba(255, 167, 38, 0.3);
}

.news-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.news-card:hover img {
    transform: scale(1.1) rotate(1deg);
}

.news-card-content {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.news-card-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--accent-color);
    font-weight: 700;
    margin-bottom: 10px;
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(255, 255, 255, 0.95);
    padding: 6px 14px;
    border-radius: 20px;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.news-card-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 0 12px;
    color: var(--primary-color);
    line-height: 1.4;
    transition: all 0.3s ease;
}

.news-card:hover .news-card-title {
    background: linear-gradient(135deg, #00303f 0%, #004d66 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.news-card-description {
    font-size: 0.95rem;
    color: var(--text-light);
    margin-bottom: 20px;
    flex-grow: 1;
    line-height: 1.6;
}

.news-card-meta {
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.modern-detail-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #ffa726 0%, #ff7043 100%);
    color: var(--white);
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(255, 167, 38, 0.3);
    position: relative;
    overflow: hidden;
}

.modern-detail-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.modern-detail-btn:hover::before {
    width: 300px;
    height: 300px;
}

.modern-detail-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 24px rgba(255, 167, 38, 0.4);
}

.modern-detail-btn svg {
    width: 18px;
    height: 18px;
    margin-left: 8px;
    transition: transform 0.3s ease;
}

.modern-detail-btn:hover svg {
    transform: translateX(4px);
}

/* --- Responsive Adjustments --- */
@media (max-width: 900px) {
    .header-image h1 {
        font-size: 2.2rem;
    }
}

@media (max-width: 768px) {
    .header-image {
        padding: 80px 20px 60px;
        border-radius: 0 0 20px 20px;
    }

    .header-image h1 {
        font-size: 1.8rem;
    }

    .search-form {
        flex-direction: column;
        background: var(--white);
        border-radius: 20px;
        padding: 15px;
        gap: 10px;
    }

    .search-form select {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #eee;
        padding: 12px 10px;
    }

    .search-form button {
        width: 100%;
        padding: 12px;
    }

    .news-grid {
        margin-top: -30px;
        gap: 20px;
    }

    .news-card img {
        height: 180px;
    }
}

@media (max-width: 480px) {
    .header-image {
        padding: 60px 20px 50px;
    }

    .news-card-content {
        padding: 20px;
    }

    .news-card-title {
        font-size: 1.1rem;
    }
}

/* --- Load More Button --- */
.load-more-container {
    text-align: center;
    margin: 40px 0;
    display: flex;
    justify-content: center;
}

.load-more-btn {
    background: linear-gradient(135deg, #00303f 0%, #004d5f 100%);
    color: white;
    padding: 14px 40px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(0, 48, 63, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 200px;
}

.load-more-btn:hover {
    background: linear-gradient(135deg, #004d5f 0%, #00303f 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 48, 63, 0.25);
}

.load-more-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Spinner Animation */
.spinner {
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    display: inline-block;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}