/* Deep Sea Diaries main stylesheet */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(to bottom, #0a1929, #1a3a52);
    min-height: 100vh;
}

/* Navigation Bar */
nav {
    background-color: #001e3c;
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 3rem;
    align-items: flex-start;
}

nav a {
    color: white;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    transition: color 0.3s;
}

nav a:hover {
    color: #ffd700;
}

nav ul li {
    position: relative;
}

.nav-list>li {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.nav-list>li>a,
.nav-list>li>button {
    color: white;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    transition: color 0.3s;
    background: none;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0;
}

.nav-list>li>a:hover,
.nav-list>li>button:hover {
    color: #ffd700;
}

.nav-dropdown>a,
.nav-accordion-toggle {
    position: relative;
    padding-right: 1.5rem;
}

.nav-dropdown>a::after,
.nav-accordion-toggle::after {
    content: '\25BC';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    color: #ffd700;
    pointer-events: none;
    transition: transform 0.3s ease;
}

.nav-dropdown.is-open .nav-accordion-toggle::after {
    transform: translateY(-50%) rotate(180deg);
}

.nav-submenu {
    display: none;
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    min-width: 220px;
    list-style: none;
    background-color: #001e3c;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    padding: 0.75rem 0;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    z-index: 200;
}

.nav-list>li.nav-dropdown:hover>.nav-submenu,
.nav-list>li.nav-dropdown:focus-within>.nav-submenu {
    display: block;
}

.nav-submenu li {
    width: 100%;
}

.nav-submenu a {
    display: block;
    padding: 0.5rem 1.25rem;
    color: white;
    font-size: 0.95rem;
    white-space: nowrap;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.nav-submenu a:hover,
.nav-submenu a:focus {
    background-color: rgba(255, 215, 0, 0.15);
    color: #ffd700;
}

.nav-submenu button {
    display: block;
    width: 100%;
    padding: 0.5rem 1.25rem;
    color: white;
    font-size: 0.95rem;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.nav-dropdown--accordion>.nav-accordion-toggle {
    padding-right: 1.5rem;
}

.nav-submenu button:hover,
.nav-submenu button:focus {
    background-color: rgba(255, 215, 0, 0.15);
    color: #ffd700;
}

.nav-dropdown.nav-dropdown--accordion>.nav-submenu {
    position: static;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    margin-top: 0.25rem;
    display: none;
}

.nav-submenu--accordion[hidden] {
    display: none !important;
}

.nav-dropdown.nav-dropdown--accordion>.nav-submenu li a {
    padding-left: 1.75rem;
}

.nav-dropdown.nav-dropdown--accordion.is-open>.nav-submenu {
    display: block;
}

/* Banner */
.banner {
    width: 100%;
    height: 300px;
    background: linear-gradient(rgba(0, 30, 60, 0.4), rgba(0, 30, 60, 0.6)),
        url('/assets/img/banner.jpg') no-repeat center/cover;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.banner h1 {
    font-size: 3.5rem;
    font-weight: 700;
}

/* Main Content */
.container {
    max-width: 1400px;
    margin: 3rem auto;
    padding: 0 2rem;
}

.section-title {
    color: white;
    font-size: 2rem;
    margin-bottom: 2rem;
    text-align: center;
}

/* News Grid */
.news-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
}

.empty-state {
    grid-column: 1 / -1;
    color: #fff;
    text-align: center;
    font-size: 1.1rem;
}

/* News Card */
.news-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s, box-shadow 0.3s;
    border: 3px solid #001e3c;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.card-image-container {
    position: relative;
    width: 100%;
    height: 450px;
    overflow: hidden;
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-title {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 30, 60, 0.85);
    color: white;
    padding: 1rem;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
}

.card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 30, 60, 0.7);
    color: white;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.card-text {
    font-size: 0.95rem;
    line-height: 1.4;
    margin-bottom: 1rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

@supports (-webkit-line-clamp: 2) or (line-clamp: 2) {
    .card-text {
        display: -webkit-box;
        -webkit-line-clamp: 5;
        line-clamp: 5;
        -webkit-box-orient: vertical;
    }
}

.card-text::after {
    content: '...';
}

.details-button {
    display: inline-block;
    background-color: #ffd700;
    color: #001e3c;
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.3s;
    cursor: pointer;
}

.details-button:hover {
    background-color: #ffed4e;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.card-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.card-type {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #fffbcc;
}

.card-date {
    font-size: 0.85rem;
    font-weight: 600;
    color: #ffd700;
    white-space: nowrap;
}

/* Modal */
#news-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
    animation: fadeIn 0.3s ease-in;
}

.modal-container {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border: 1px solid #888;
    width: 90%;
    max-width: 800px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease-out;
}

.modal-header {
    background: linear-gradient(135deg, #001e3c, #003d5c);
    color: white;
    padding: 1.5rem 2rem;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    position: relative;
}

#modal-title {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 600;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 20px;
    color: white;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.3s;
}

.modal-close:hover {
    opacity: 0.7;
}

.modal-body {
    padding: 2rem;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-section {
    margin-bottom: 2rem;
}

.modal-heading {
    color: #001e3c;
    font-size: 1.4rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid #ffd700;
    padding-bottom: 0.5rem;
}

.modal-summary {
    font-size: 1rem;
    line-height: 1.6;
    color: #333;
    margin: 0;
}

.modal-link {
    color: #003d5c;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    display: block;
    word-break: break-all;
}

.modal-link:hover {
    color: #ffd700;
}

.modal-location {
    margin: 0 0 1rem 0;
}

.modal-coordinates {
    color: #333;
}

.modal-button {
    display: inline-block;
    background-color: #ffd700;
    color: #001e3c;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.3s ease;
    margin-top: 0.5rem;
}

.modal-button:hover {
    background-color: #ffed4e;
    color: #003d5c;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive tweaks */
@media (max-width: 1200px) {
    .news-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .news-grid {
        grid-template-columns: 1fr;
    }

    .banner h1 {
        font-size: 2rem;
    }

    nav ul {
        gap: 1.5rem;
    }

    nav a {
        font-size: 0.9rem;
    }

    .modal-container {
        width: 95%;
        margin: 10% auto;
    }

    .modal-header {
        padding: 1rem;
    }

    #modal-title {
        font-size: 1.4rem;
    }
}