* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #fff;
    color: #222;
    line-height: 1.6;
}

img {
    max-width: 100%;
}

a {
    color: inherit;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible {
    outline: 3px solid #ffcc00;
    outline-offset: 3px;
}

.skip-link {
    position: absolute;
    top: -50px;
    left: 15px;
    z-index: 2000;
    padding: 10px 15px;
    background: #fff;
    color: #111;
    font-weight: bold;
    text-decoration: none;
}

.skip-link:focus {
    top: 15px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 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;
    padding: 15px 30px;
    background: #111;
    color: #fff;
}

.logo {
    flex-shrink: 0;
}

.logo img {
    display: block;
    border-radius: 50%;
}

.date,
.weather {
    margin: 0;
    color: #fff;
    font-weight: bold;
    white-space: nowrap;
}

.social-links,
.auth-actions,
.user-area {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 12px;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid #fff;
    border-radius: 50%;
    color: #fff;
    font-size: 17px;
    text-decoration: none;
    transition: 0.2s;
}

.social-links a:hover {
    background: #fff;
    color: #111;
}

/* REGISTER / LOGIN */

.btn {
    padding: 8px 16px;
    border: 1px solid #fff;
    border-radius: 4px;
    font-weight: bold;
    text-decoration: none;
}

.btn-dark {
    background: #111;
    color: #fff;
}

.btn-light {
    background: #fff;
    color: #111;
}

.btn:hover {
    background: #555;
    color: #fff;
}

/* PROFILE */

.profile-menu {
    position: relative;
}

.profile-menu summary {
    padding: 5px;
    border-radius: 50%;
    color: #fff;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    list-style: none;
}

.profile-menu summary::-webkit-details-marker {
    display: none;
}

.profile-menu summary:hover {
    background: #555;
}

.profile-dropdown {
    position: absolute;
    top: 45px;
    right: 0;
    z-index: 1000;
    min-width: 200px;
    padding: 10px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.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: #eee;
}

.profile-dropdown form {
    margin: 0;
}

/* SEARCH */

.menu-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid #fff;
    border-radius: 5px;
    background: transparent;
    color: #fff;
    cursor: pointer;
    font-size: 17px;
}

.menu-icon:hover {
    background: #fff;
    color: #111;
}

.search-bar {
    display: none;
    padding: 12px 20px;
    background: #111;
    text-align: center;
}

.search-bar.show {
    display: block;
}

.search-bar input {
    width: min(60%, 500px);
    padding: 9px 15px;
    border: 1px solid #fff;
    border-radius: 25px;
    font-size: 16px;
}

.search-bar button {
    padding: 9px 15px;
    margin-left: 10px;
    border: 1px solid #fff;
    border-radius: 25px;
    background: #555;
    color: #fff;
    cursor: pointer;
    font-size: 16px;
}

/* NAVIGATION */

.nav-menu {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px 30px;
    margin: 0;
    padding: 12px 20px;
    list-style: none;
    border-bottom: 1px solid #ddd;
}

.nav-menu a {
    color: #111;
    font-weight: bold;
    text-decoration: none;
}

.nav-menu a:hover {
    color: #0066cc;
}

/* ARTICLE */

.page-content {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(270px, 1fr);
    gap: 35px;
    max-width: 1300px;
    margin: 35px auto;
    padding: 0 30px;
}

.main-news {
    min-width: 0;
}

.category {
    margin: 0 0 8px;
    color: #0066cc;
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
}

.main-news h1 {
    margin: 0 0 10px;
    color: #111;
    font-size: clamp(28px, 4vw, 46px);
    line-height: 1.2;
}

.news-date {
    display: block;
    margin-bottom: 20px;
    color: #666;
    font-size: 14px;
}

.main-news-image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.news-content {
    max-width: 800px;
    margin-top: 25px;
    font-size: 18px;
    white-space: pre-line;
}

.save-news-form {
    margin-top: 25px;
}

.save-news-btn {
    padding: 11px 16px;
    border: 1px solid #111;
    border-radius: 5px;
    background: #fff;
    color: #111;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
}

.save-news-btn:hover {
    background: #111;
    color: #fff;
}

.login-to-save {
    margin-top: 25px;
}

.login-to-save a {
    color: #0066cc;
    font-weight: bold;
}

/* SIDEBAR */

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.up-next,
.most-read-sidebar {
    padding: 20px;
    border-radius: 8px;
    background: #f6f6f6;
}

.sidebar h2 {
    margin: 0 0 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #111;
    font-size: 22px;
}

.up-next ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.up-next li {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #ddd;
}

.up-next li:last-child {
    margin-bottom: 0;
}

.up-next a {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: bold;
    text-decoration: none;
}

.up-next a:hover,
.most-read-sidebar a:hover {
    color: #0066cc;
}

.up-next-image {
    width: 100px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

.most-read-sidebar ol {
    margin: 0;
    padding-left: 25px;
}

.most-read-sidebar li {
    margin-bottom: 12px;
    padding-left: 5px;
}

.most-read-sidebar a {
    font-weight: bold;
    text-decoration: none;
}

/* FOOTER */

.main-footer {
    margin-top: 50px;
    padding: 20px;
    background: #111;
    color: #fff;
    text-align: center;
}

.main-footer p {
    margin: 0;
}

/* TABLET */

@media (max-width: 1100px) {
    .top-header {
        justify-content: center;
        flex-wrap: wrap;
    }

    .page-content {
        grid-template-columns: 1fr;
    }
}

/* MOBILE */

@media (max-width: 600px) {
    .top-header,
    .page-content {
        padding-right: 15px;
        padding-left: 15px;
    }

    .top-header {
        justify-content: center;
    }

    .date,
    .weather,
    .social-links,
    .user-area {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .search-bar input {
        width: 65%;
    }

    .page-content {
        margin-top: 25px;
    }
}