/* ===== CSS Variables ===== */
:root {
    --primary-color: #d7dbe0;
    --accent-color: #007aff;
    --text-light: #fff;
    --text-dark: #333;
    --bg-light: #f2f2f7;
    --border-light: #c8c7cc;
    --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
    --nav-height: 70px;
}

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--bg-light);
}

/* ===== Navigation (Old iOS Gradient Header) ===== */
nav {
    height: var(--nav-height);
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(to bottom, #fefefe 0%, #d7dbe0 100%);
    border-bottom: 1px solid var(--border-light);
    padding: 0 2rem;
    box-shadow: inset 0 1px 0 #fff, 0 1px 3px rgba(0, 0, 0, 0.1);
}
nav .logo{
    display: flex;
    align-items: center;
    justify-content: center;
}
nav .logo img{
    height: 60px;
    width: 60px;
    filter: drop-shadow(0.1rem 0.1rem 0.01rem rgb(0, 0, 0));
}

nav .logo h1 {
    color: #111;
    font-size: 1.5rem;
    font-weight: 600;
    text-shadow: 0 1px 0 #fff;
}

nav ul {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    list-style: none;
}

nav ul li a {
    text-decoration: none;
    color: #007aff;
    font-size: 1rem;
    font-weight: 500;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    transition: background 0.2s;
}

nav ul li a:hover {
    background: rgba(0, 122, 255, 0.1);
}

nav #menu_bar {
    color: #333;
    font-size: 1.5rem;
    display: none;
    cursor: pointer;
}

/* ===== Main Content ===== */
main {
    margin-top: var(--nav-height);
    padding: 3rem 1.5rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* ===== Hero Section ===== */
.hero {
    text-align: center;
    padding: 2rem 1rem;
    background: linear-gradient(to bottom, #fefefe 0%, #e2e3e4 100%);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: inset 0 1px 0 #fff, var(--card-shadow);
}

.hero h2 {
    font-size: 1.8rem;
    color: #222;
    margin-bottom: 0.5rem;
    text-shadow: 0 1px 0 #fff;
}

.hero p {
    color: #666;
    font-size: 1rem;
}

/* ===== News Grid ===== */
.news-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 1.5rem;
}

/* ===== News Card (Old iOS Style) ===== */
.news-card {
    background: linear-gradient(to bottom, #ffffff 0%, #f4f4f4 100%);
    border: 1px solid var(--border-light);
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15), inset 0 1px 0 #fff;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    cursor: pointer;
}

.news-card:hover {
    transform: scale(1.01);
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
}

.news-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 1px solid #ddd;
    background: #f9f9f9;
    transition: transform 0.3s ease;
}

.news-card:hover img {
    transform: scale(1.03);
}

.news-card-content {
    height: auto;
    padding: 1.25rem;
}

/* TITLE */
.news-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: #000;
    text-shadow: 0 1px 0 #fff;
    font-weight: 600;
    /* Make sure title doesn't overflow */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* DESCRIPTION */
.news-description {
    color: #444;
    font-size: 0.97rem;
    margin-bottom: 0.85rem;
    line-height: 1.5;
    white-space: normal;
    word-break: break-word;
    /* Clamp to 3 lines for long descriptions */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-meta {
    border-top: 1px solid #e5e5e5;
    padding-top: 0.75rem;
    color: #999;
    font-size: 0.8rem;
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}

/* ===== Category Badge ===== */
.category-badge {
    display: inline-block;
    background: linear-gradient(to bottom, #fefefe 0%, #d7dbe0 100%);
    border: 1px solid #c7c7cc;
    border-radius: 10px;
    padding: 0.2rem 0.6rem;
    color: #007aff;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: inset 0 1px 0 #fff;
    margin-bottom: 0.6rem;
}

/* ===== Loading & Empty States ===== */
.loading, .no-news {
    text-align: center;
    padding: 3rem;
    font-size: 1rem;
    color: #777;
}

/* ===== Full Article ===== */
.article-full {
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 14px;
    padding: 2rem;
    box-shadow: inset 0 1px 0 #fff, var(--card-shadow);
    max-width: 900px;
    margin: 2rem auto;
}

.article-full img.article-image {
    width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 1rem 0;
    border: 1px solid #ccc;
}

/* ===== Back Button ===== */
.back-btn {
    background: linear-gradient(to bottom, #fefefe 0%, #d7dbe0 100%);
    border: 1px solid var(--border-light);
    color: #007aff;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
    box-shadow: inset 0 1px 0 #fff;
}

.back-btn:hover {
    background: linear-gradient(to bottom, #fff 0%, #cdd1d5 100%);
}

/* ===== Article Header ===== */
.article-header {
    width: 40rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.article-header h1 {
    font-size: 1.75rem;
    color: #111;
    margin-bottom: 0.75rem;
    text-shadow: 0 1px 0 #fff;
}

.article-meta {
    display: flex;
    gap: 1.5rem;
    color: #777;
    font-size: 0.9rem;
}

/* ===== Article Content ===== */
.article-content {
    color: #333;
    line-height: 1.7;
    font-size: 1rem;
}

.article-content p {
    margin-bottom: 1rem;
}

.article-content h2 {
    font-size: 1.3rem;
    margin: 1.2rem 0 0.5rem;
}

/* ===== Share Buttons ===== */
.share-buttons {
    margin-top: 2rem;
}

.share-icons {
    display: flex;
    gap: 0.8rem;
}

.share-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid #ccc;
    background: linear-gradient(to bottom, #fff 0%, #d9dadb 100%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #007aff;
    cursor: pointer;
    transition: background 0.2s;
}

.share-btn:hover {
    background: linear-gradient(to bottom, #fefefe 0%, #cfd1d3 100%);
}

/* ===== Image Modal ===== */
.image-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 10, 10, 0.9);
    align-items: center;
    justify-content: center;
}

.modal-content {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 25px;
    color: #fff;
    font-size: 35px;
    cursor: pointer;
}

/* ===== About Section (Old iOS Look) ===== */
.about-section {
    background: linear-gradient(to bottom, #ffffff 0%, #f2f2f7 100%);
    border: 1px solid var(--border-light);
    border-radius: 14px;
    box-shadow: inset 0 1px 0 #fff, var(--card-shadow);
    padding: 2rem;
    max-width: 900px;
    margin: 3rem auto;
    text-align: center;
}

.about-section h2 {
    font-size: 1.8rem;
    color: #111;
    text-shadow: 0 1px 0 #fff;
    margin-bottom: 1rem;
}

.about-section p {
    color: #555;
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 1rem;
}

.about-card {
    background: linear-gradient(to bottom, #fff 0%, #e7e8eb 100%);
    border: 1px solid #c7c7cc;
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    text-align: left;
    box-shadow: inset 0 1px 0 #fff, 0 2px 5px rgba(0, 0, 0, 0.1);
}

.about-card h3 {
    color: #007aff;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 1px 0 #fff;
}

.about-card p {
    color: #444;
    font-size: 0.95rem;
    line-height: 1.6;
}

.about-footer {
    margin-top: 2rem;
    color: #777;
    font-size: 0.9rem;
}
.news-sort-selector {
    position: relative;
    top: 70px;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-radius: 10px;
    padding: 0.75rem 1.5rem;
}

.news-sort-selector select {
    font-size: 1rem;
    border: 1px solid #c8c7cc;
    border-radius: 8px;
    background: #fff;
    padding: 0.5rem 1.2rem;
    color: #333;
    outline: none;
    transition: border 0.2s;
}

.news-sort-selector select:focus {
    border-color: #007aff;
}

.news-sort-selector input[type="text"] {
    font-size: 1rem;
    border: 1px solid #c8c7cc;
    border-radius: 8px;
    background: #fff;
    padding: 0.5rem 1.2rem;
    color: #333;
    outline: none;
    transition: border 0.2s;
    min-width: 160px;
    display: inline-block;
}

.news-sort-selector input[type="text"]:focus {
    border-color: #007aff;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    nav {
        padding: 0 1.2rem;
    }

    nav #menu_bar {
        display: block;
    }

    nav #nav_bar {
        position: fixed;
        top: var(--nav-height);
        right: 0;
        width: 240px;
        height: calc(100vh - var(--nav-height));
        flex-direction: column;
        align-items: flex-start;
        background: #f9f9f9;
        border-left: 1px solid #ccc;
        display: none;
        opacity: 0;
        transform: translateX(100%);
        transition: all 0.3s ease;
        box-shadow: -3px 0 10px rgba(0,0,0,0.2);
    }

    nav #nav_bar.active {
        display: flex;
        opacity: 1;
        transform: translateX(0);
    }

    nav #nav_bar li a {
        color: #007aff;
        width: 100%;
        padding: 1rem 1.5rem;
    }

    .news-container {
        grid-template-columns: 1fr;
    }

    .hero h2 {
        font-size: 1.5rem;
    }

    .about-section {
        padding: 1.5rem;
    }

    .about-card {
        padding: 1rem;
    }

    .about-section h2 {
        font-size: 1.5rem;
    }
}
@media (max-width: 600px) {
    .news-sort-selector {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.5rem 0.8rem;
    }
    .news-sort-selector input[type="text"] {
        min-width: 100px;
    }
}
/* ===== Responsive: Full Article Layout ===== */
@media (max-width: 900px) {
    .article-full {
        padding: 1.5rem;
        margin: 1.5rem 1rem;
    }

    .article-header {
        width: 100%;
        padding-bottom: 0.8rem;
    }

    .article-header h1 {
        font-size: 1.4rem;
        line-height: 1.3;
    }

    .article-meta {
        flex-wrap: wrap;
        gap: 0.8rem;
        font-size: 0.85rem;
    }

    .article-full img.article-image {
        border-radius: 8px;
        margin: 0.75rem 0 1rem;
    }

    .back-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }

    .share-buttons {
        margin-top: 1.5rem;
    }

    .share-icons {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.6rem;
    }

    .share-btn {
        width: 38px;
        height: 38px;
        font-size: 0.9rem;
    }
}

@media (max-width: 600px) {
    .article-full {
        padding: 1.2rem;
        border-radius: 10px;
    }

    .article-header h1 {
        font-size: 1.2rem;
    }

    .article-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
        font-size: 0.8rem;
    }

    .article-content {
        font-size: 0.95rem;
        line-height: 1.6;
    }

    .share-buttons h4 {
        font-size: 1rem;
        text-align: center;
    }

    .share-icons {
        justify-content: center;
    }

    .back-btn {
        width: 100%;
        display: block;
        margin-bottom: 1rem;
        text-align: center;
    }
}

@media (max-width: 400px) {
    .article-header h1 {
        font-size: 1.05rem;
    }

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

    .share-btn {
        width: 34px;
        height: 34px;
        font-size: 0.85rem;
    }
}
