:root {
    --text: #111;
    --border: #ddd;
    --surface: #f5f5f5;
    --link: #005bb5;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #fff;
    color: var(--text);
    line-height: 1.5;
}

img {
    max-width: 100%;
}

a {
    color: inherit;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible {
    outline: 3px solid #005fcc;
    outline-offset: 3px;
}

.skip-link {
    position: absolute;
    top: -50px;
    left: 12px;
    z-index: 2000;
    padding: 10px 14px;
    background: #111;
    color: #fff;
    text-decoration: none;
}

.skip-link:focus {
    top: 12px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

/* HEADER */

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    width: 100%;
    padding: 15px 40px;
}

.logo {
    display: flex;
    flex-shrink: 0;
    align-items: center;
}

.logo img {
    display: block;
    border-radius: 50%;
}

.date,
.weather {
    margin: 0;
    font-weight: bold;
    white-space: nowrap;
}

.social-links,
.auth-actions,
.user-area {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 12px;
}

.social-links img {
    display: block;
}

.user-area {
    margin-left: 0;
}

/* BUTTONS */

.btn {
    padding: 8px 16px;
    border: 1px solid #111;
    border-radius: 4px;
    font-size: 15px;
    font-weight: bold;
    text-decoration: none;
}

.btn-dark {
    background: #111;
    color: #fff;
}

.btn-light {
    background: #fff;
    color: #111;
}

.btn:hover {
    background: #111;
    color: #fff;
}

/* PROFILE */

.profile-menu {
    position: relative;
}

.profile-menu summary {
    padding: 5px;
    border-radius: 50%;
    color: #111;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    list-style: none;
}

.profile-menu summary::-webkit-details-marker {
    display: none;
}

.profile-menu summary:hover {
    background: #eee;
}

.profile-dropdown {
    position: absolute;
    top: 45px;
    right: 0;
    z-index: 1000;
    min-width: 200px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.profile-email {
    margin: 0 0 8px;
    padding: 0 8px 8px;
    border-bottom: 1px solid #ddd;
    color: #555;
    font-size: 13px;
    overflow-wrap: anywhere;
}

.profile-dropdown a,
.profile-dropdown button {
    display: block;
    width: 100%;
    padding: 10px 8px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: #111;
    font: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.profile-dropdown a:hover,
.profile-dropdown button:hover {
    background: #f0f0f0;
}

.profile-dropdown form {
    margin: 0;
}

/* SEARCH */

.menu-icon {
    padding: 8px;
    border: none;
    background: transparent;
    color: #111;
    font-size: 20px;
    cursor: pointer;
}

.search-bar {
    display: none;
    padding: 10px 20px;
    text-align: center;
}

.search-bar.show {
    display: block;
}

.search-bar input {
    width: min(60%, 500px);
    padding: 8px 15px;
    border: 1px solid #111;
    border-radius: 25px;
    font-size: 16px;
}

.search-bar button {
    padding: 8px 15px;
    margin-left: 10px;
    border: 1px solid #111;
    border-radius: 25px;
    background: #111;
    color: #fff;
    cursor: pointer;
}

/* NAVIGATION */

.nav-menu {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 30px;
    margin: 0;
    padding: 10px 20px;
    list-style: none;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.nav-menu a {
    font-weight: bold;
    text-decoration: none;
}

.nav-menu a:hover,
.nav-menu a[aria-current="page"] {
    color: var(--link);
}

/* MAIN CONTENT */

.content {
    display: flex;
    align-items: flex-start;
    gap: 30px;
    max-width: 1440px;
    margin: 30px auto;
    padding: 0 30px;
}

.main-left {
    flex: 3;
    min-width: 0;
}

.main-left > h1 {
    margin: 0 0 20px;
    font-size: 32px;
}

.category-section {
    margin-top: 30px;
    padding: 20px;
    border-left: 4px solid #111;
    border-radius: 4px;
    background: var(--surface);
}

.category-section h2 {
    margin: 0 0 12px;
    padding-bottom: 5px;
    border-bottom: 1px solid #ccc;
    font-size: 22px;
}

.news-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.news-list li {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    transition: 0.2s;
}

.news-list li:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.news-item {
    height: 100%;
}

.news-link {
    display: block;
    height: 100%;
    text-decoration: none;
}

.news-item img {
    display: block;
    width: 100%;
    height: 140px;
    object-fit: cover;
}

.news-item h3 {
    margin: 0;
    padding: 10px 10px 6px;
    color: #111;
    font-size: 15px;
    line-height: 1.4;
}

.news-date {
    display: block;
    padding: 0 10px 12px;
    color: #666;
    font-size: 13px;
}

.see-more {
    display: inline-block;
    margin-top: 12px;
    color: var(--link);
    font-weight: bold;
    text-decoration: none;
}

.see-more:hover {
    text-decoration: underline;
}

/* SIDEBAR */

.sidebar {
    flex: 1;
    min-width: 240px;
    padding: 20px;
    border-left: 2px solid #e0e0e0;
    background: #f9f8f8;
}

.sidebar h2 {
    margin: 0 0 15px;
    padding-bottom: 5px;
    border-bottom: 2px solid #ccc;
    font-size: 20px;
}

.sidebar ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.sidebar li {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ccc;
}

.sidebar a {
    color: #333;
    font-weight: 600;
    text-decoration: none;
}

.sidebar a:hover {
    color: var(--link);
    text-decoration: underline;
}

.sidebar-date {
    display: block;
    margin-top: 4px;
    color: #666;
    font-size: 12px;
    font-weight: normal;
}

/* CURRENCY */

.currency-box {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #111;
    font-size: 14px;
    font-weight: bold;
    white-space: nowrap;
}

.currency-box p {
    margin: 0;
    padding: 7px 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: #f5f5f5;
    white-space: nowrap;
}

/* FOOTER */

footer {
    padding: 14px;
    background: #000;
    color: #fff;
    text-align: center;
}

footer p {
    margin: 0;
}


@media (max-width: 1200px) {
    .top-header {
        justify-content: center;
        flex-wrap: wrap;
    }

    .content {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

    .news-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}



@media (max-width: 600px) {
    .top-header,
    .content {
        padding-right: 16px;
        padding-left: 16px;
    }

    .top-header {
        justify-content: center;
    }

    .date,
    .weather,
    .currency-box,
    .social-links,
    .user-area {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .search-bar input {
        width: 70%;
    }

    .news-list {
        grid-template-columns: 1fr;
    }

    .category-section {
        padding: 14px;
    }
}