/* Custom Properties / Design Tokens */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f9f9f9;
    --bg-inverse: #000000;
    --text-primary: #111111;
    --text-secondary: #555555;
    --text-inverse: #ffffff;
    --border-color: #dddddd;
    --border-strong: #111111;
    --accent: #d9230f;

    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;

    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Base Setup */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    transition: background-color 0.3s, color 0.3s;
}

a {
    color: inherit;
    text-decoration: none;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

button {
    cursor: pointer;
    font-family: inherit;
}

/* =====================
   Navbar
   ===================== */
.navbar {
    border-bottom: 2px solid var(--border-strong);
    background-color: var(--bg-primary);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border-color);
}

.nav-left,
.nav-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex: 1;
}

.nav-right {
    justify-content: flex-end;
}

.brand-logo {
    font-family: var(--font-heading);
    font-size: 2.25rem;
    font-weight: 900;
    letter-spacing: -0.5px;
    text-align: center;
    flex: 1;
    white-space: nowrap;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    padding: 4px;
    flex-shrink: 0;
}

.icon-btn:hover {
    opacity: 0.6;
}

/* Hamburger Icon Animations */
#menuToggle svg line {
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: center;
}

#menuToggle.is-active svg line:nth-child(1) {
    opacity: 0;
    transform: scaleX(0);
}

#menuToggle.is-active svg line:nth-child(2) {
    transform: translateY(6px) rotate(45deg);
}

#menuToggle.is-active svg line:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

.search-container {
    display: flex;
    align-items: center;
    border-bottom: 1px solid transparent;
    transition: var(--transition);
}

.search-container:focus-within {
    border-bottom: 1px solid var(--text-primary);
}

.search-input {
    background: none;
    border: none;
    color: var(--text-primary);
    padding: 0.5rem;
    outline: none;
    font-size: 0.9rem;
    width: 200px;
    font-family: var(--font-body);
}

.nav-links {
    padding: 0.75rem 2rem;
    overflow-x: auto;
    scrollbar-width: none;
}

.nav-links::-webkit-scrollbar {
    display: none;
}

.nav-links ul {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    white-space: nowrap;
}

.nav-links a {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--text-primary);
    transition: var(--transition);
}

.nav-links a:hover::after {
    width: 100%;
}

/* =====================
   Typography & General Layout
   ===================== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.category {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-primary);
    display: inline-block;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--text-primary);
    padding-bottom: 2px;
}

.headline a {
    font-family: var(--font-heading);
    transition: var(--transition);
}

.headline a:hover {
    opacity: 0.7;
    text-decoration: underline;
}

.excerpt {
    color: var(--text-secondary);
    margin-top: 1rem;
    font-size: 1.1rem;
    line-height: 1.6;
}

.meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.image-wrapper {
    overflow: hidden;
    margin-bottom: 1rem;
}

.image-wrapper img {
    width: 100%;
    height: auto;
    transition: transform 0.5s ease;
}

.featured-article:hover .image-wrapper img,
.grid-card:hover .image-wrapper img {
    transform: scale(1.03);
}

/* =====================
   Featured Section (Bloomberg-style)
   ===================== */
.featured-section {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 0;
    margin-bottom: 2.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
}

.featured-main-area {
    border-right: 1px solid var(--border-color);
    padding-right: 1.5rem;
}

/* Main feature: horizontal layout (image left + text right) */
.main-feature {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
    align-items: start;
}

.main-feature .image-wrapper {
    margin-bottom: 0;
}

.main-feature .image-wrapper img {
    aspect-ratio: 4/3;
    object-fit: cover;
    width: 100%;
    height: 100%;
}

.main-feature .headline {
    font-size: 1.5rem;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

.main-feature .excerpt {
    font-size: 0.95rem;
    margin-top: 0.5rem;
    line-height: 1.5;
}

.main-feature .category {
    margin-bottom: 0.5rem;
}

/* Mid-column stories */
.mid-stories {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.mid-story {
    padding: 0 1.5rem 0 0;
    border-right: 1px solid var(--border-color);
}

.mid-story:last-child {
    border-right: none;
    padding-right: 0;
    padding-left: 1.5rem;
}

.mid-story .image-wrapper {
    margin-bottom: 0.75rem;
}

.mid-story .image-wrapper img {
    aspect-ratio: 16/9;
    object-fit: cover;
    width: 100%;
}

.mid-story .headline {
    font-size: 1rem;
    line-height: 1.3;
    margin-bottom: 0.25rem;
}

.mid-story .excerpt {
    font-size: 0.85rem;
    margin-top: 0.4rem;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mid-story .category {
    font-size: 0.65rem;
    margin-bottom: 0.4rem;
}

.mid-story .meta {
    margin-top: 0.5rem;
    font-size: 0.75rem;
}

/* Latest Sidebar */
.latest-sidebar {
    padding-left: 1.5rem;
}

.sidebar-header {
    padding-bottom: 0.75rem;
    margin-bottom: 0;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h2 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
}

.latest-list {
    display: flex;
    flex-direction: column;
}

.latest-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--border-color);
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
    align-items: flex-start;
}

.latest-item:hover {
    background-color: var(--bg-secondary);
}

.latest-item:last-child {
    border-bottom: none;
}

.latest-time {
    font-size: 0.7rem;
    color: var(--text-secondary);
    white-space: nowrap;
    min-width: 42px;
    padding-top: 2px;
    font-weight: 600;
}

.latest-headline {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.3;
}

/* =====================
   News Grid Section (Bloomberg-style)
   ===================== */
.news-grid-section {
    margin-bottom: 2.5rem;
}

.section-header {
    border-top: 2px solid var(--border-strong);
    border-bottom: none;
    margin-bottom: 1.5rem;
    padding-top: 0.75rem;
    padding-bottom: 0;
}

.section-header h2 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
}

.grid-card {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 1rem;
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--border-color);
    align-items: start;
}

.grid-card:nth-child(odd) {
    padding-right: 1.5rem;
    border-right: 1px solid var(--border-color);
}

.grid-card:nth-child(even) {
    padding-left: 1.5rem;
}

.grid-card .image-wrapper {
    margin-bottom: 0;
}

.grid-card .image-wrapper img {
    aspect-ratio: 4/3;
    object-fit: cover;
    width: 100%;
}

.grid-card .headline {
    font-size: 0.95rem;
    line-height: 1.3;
}

.grid-card .category {
    font-size: 0.65rem;
    margin-bottom: 0.4rem;
}

.grid-card .excerpt {
    font-size: 0.85rem;
    margin-top: 0.4rem;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 0;
}

.grid-card .meta {
    font-size: 0.7rem;
    margin-top: 0.4rem;
}

.grid-card.text-only {
    grid-template-columns: 1fr;
    border-top: 2px solid var(--text-primary);
    padding-top: 1rem;
}

/* =====================
   Newsletter Section
   ===================== */
.newsletter-section {
    background-color: var(--bg-secondary);
    padding: 3rem 2rem;
    text-align: center;
    border: 1px solid var(--border-color);
    margin-bottom: 3rem;
}

.newsletter-content {
    max-width: 600px;
    margin: 0 auto;
}

.newsletter-content h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.newsletter-content p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.newsletter-form {
    display: flex;
    gap: 0;
    max-width: 100%;
}

.newsletter-form input {
    flex: 1;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border-strong);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    border-right: none;
    font-family: var(--font-body);
    min-width: 0;
}

.newsletter-form button {
    padding: 0.85rem 1.5rem;
    background-color: var(--bg-inverse);
    color: var(--text-inverse);
    border: 1px solid var(--border-strong);
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    white-space: nowrap;
    flex-shrink: 0;
}

.newsletter-form button:hover {
    background-color: #333;
    color: var(--bg-primary);
}

/* =====================
   Footer
   ===================== */
.footer {
    background-color: var(--bg-inverse);
    color: var(--text-inverse);
    padding: 4rem 2rem 2rem;
    font-family: var(--font-body);
}

.footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.footer-top {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 4rem;
}

.footer-brand-zone {
    max-width: 450px;
}

.footer-brand {
    margin-bottom: 1rem;
}

.footer-brand-name {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 900;
    letter-spacing: -0.5px;
}

.footer-text {
    color: #999;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.footer-social {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.footer-social a {
    color: #fff;
    opacity: 0.6;
    transition: var(--transition);
}

.footer-social a:hover {
    opacity: 1;
}

.footer-clocks {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.clock {
    display: flex;
    flex-direction: column;
}

.clock-time {
    font-family: 'JetBrains Mono', monospace, sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.clock-city {
    font-size: 0.85rem;
    font-weight: 600;
    color: #ccc;
}

.clock-region {
    font-size: 0.75rem;
    color: #777;
}

.footer-nav {
    display: flex;
    gap: 4rem;
}

.footer-col {
    min-width: 120px;
}

.footer-heading {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
    color: #ccc;
}

.footer-links-list li {
    margin-bottom: 1rem;
}

.footer-links-list a {
    color: #999;
    font-size: 0.9rem;
    transition: var(--transition);
}

.footer-links-list a:hover {
    color: #fff;
}

.footer-status {
    border-top: 1px solid #333;
    padding-top: 2rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    font-size: 0.75rem;
    color: #777;
    letter-spacing: 0.5px;
}

.footer-status a {
    color: #777;
    transition: var(--transition);
}

.footer-status a:hover {
    color: #fff;
}

.dot-sep {
    opacity: 0.3;
}

.status-ok {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #fff;
    margin-left: auto;
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: #22c55e;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.4);
}

/* =====================
   Modal
   ===================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    padding: 1rem;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: var(--bg-primary);
    padding: 3rem;
    width: 100%;
    max-width: 400px;
    position: relative;
    transform: translateY(20px);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-primary);
    line-height: 1;
    padding: 4px 8px;
}

.modal-content h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.modal-content p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus {
    border-color: var(--border-strong);
}

.primary-btn {
    width: 100%;
    padding: 1rem;
    background-color: var(--bg-inverse);
    color: var(--text-inverse);
    border: none;
    font-weight: 600;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    transition: var(--transition);
}

.primary-btn:hover {
    background-color: #333;
}

.modal-footer {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
    font-size: 0.85rem;
}

.modal-footer a {
    font-weight: 600;
    text-decoration: underline;
}

/* =====================
   Responsive — Tablet (≤1024px)
   ===================== */
@media (max-width: 1024px) {
    /* Featured section: stack main area + sidebar */
    .featured-section {
        grid-template-columns: 1fr;
    }

    .featured-main-area {
        border-right: none;
        padding-right: 0;
        border-bottom: 1px solid var(--border-color);
        padding-bottom: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .latest-sidebar {
        padding-left: 0;
    }

    .latest-list {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0;
    }

    .latest-item {
        flex: 1 1 calc(50% - 0.75rem);
        border-bottom: 1px solid var(--border-color);
    }

    .latest-item:nth-child(odd) {
        border-right: 1px solid var(--border-color);
        padding-right: 0.75rem;
        margin-right: 0.75rem;
    }

    /* Main feature: keep horizontal but smaller headline */
    .main-feature .headline {
        font-size: 1.3rem;
    }

    /* News Grid: keep 2 columns */
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-card {
        grid-template-columns: 160px 1fr;
    }
}

/* =====================
   Responsive — Mobile (≤768px)
   ===================== */
@media (max-width: 768px) {
    /* Navbar */
    .nav-top {
        padding: 0.75rem 1rem;
    }

    .search-container {
        display: none;
    }

    .brand-logo {
        font-size: 1.4rem;
        letter-spacing: -0.2px;
    }

    .nav-left,
    .nav-right {
        gap: 0.5rem;
        flex: 0 0 auto;
    }

    /* Mobile Menu */
    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--bg-primary);
        border-bottom: 2px solid var(--border-strong);
        box-shadow: 0 8px 16px rgba(0,0,0,0.1);
        padding: 1.5rem 0;
        visibility: hidden;
        opacity: 0;
        transform: translateY(-15px) scaleY(0.95);
        transform-origin: top;
        transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 99;
    }

    .nav-links.mobile-active {
        visibility: visible;
        opacity: 1;
        transform: translateY(0) scaleY(1);
    }

    .nav-links ul {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
    }

    /* Container */
    .container {
        padding: 1rem;
    }

    /* Featured Section: stack everything vertically */
    .featured-section {
        grid-template-columns: 1fr;
        gap: 0;
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
    }

    .featured-main-area {
        border-right: none;
        padding-right: 0;
        border-bottom: 1px solid var(--border-color);
        padding-bottom: 1rem;
        margin-bottom: 1rem;
    }

    /* Main feature: stack vertically on mobile */
    .main-feature {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        padding-bottom: 1rem;
        margin-bottom: 1rem;
    }

    .main-feature .headline {
        font-size: 1.25rem;
    }

    .main-feature .excerpt {
        font-size: 0.9rem;
    }

    /* Mid stories: stack vertically */
    .mid-stories {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .mid-story {
        display: grid;
        grid-template-columns: 120px 1fr;
        gap: 0.75rem;
        padding: 0;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding-bottom: 1rem;
        align-items: start;
    }

    .mid-story:last-child {
        padding-left: 0;
        border-bottom: none;
        padding-bottom: 0;
    }

    .mid-story .image-wrapper {
        margin-bottom: 0;
    }

    .mid-story .image-wrapper img {
        aspect-ratio: 4/3;
    }

    .mid-story .headline {
        font-size: 0.9rem;
    }

    .mid-story .excerpt {
        display: none;
    }

    /* Latest sidebar: compact on mobile */
    .latest-sidebar {
        padding-left: 0;
    }

    .sidebar-header h2 {
        font-size: 1rem;
    }

    .latest-list {
        flex-direction: column;
    }

    .latest-item {
        padding: 0.65rem 0;
    }

    .latest-item:nth-child(odd) {
        border-right: none;
        padding-right: 0;
        margin-right: 0;
    }

    .latest-headline {
        font-size: 0.85rem;
    }

    /* News Grid: single column, horizontal cards */
    .news-grid {
        grid-template-columns: 1fr;
    }

    .grid-card {
        grid-template-columns: 120px 1fr;
        gap: 0.75rem;
        padding: 1rem 0;
    }

    .grid-card:nth-child(odd) {
        padding-right: 0;
        border-right: none;
    }

    .grid-card:nth-child(even) {
        padding-left: 0;
    }

    .grid-card .headline {
        font-size: 0.9rem;
    }

    .grid-card .excerpt {
        display: none;
    }

    .grid-card.text-only {
        grid-template-columns: 1fr;
    }

    /* Newsletter */
    .newsletter-section {
        padding: 2rem 1rem;
        margin-bottom: 2rem;
    }

    .newsletter-content h2 {
        font-size: 1.5rem;
    }

    .newsletter-form {
        flex-direction: column;
        gap: 0;
    }

    .newsletter-form input {
        border-right: 1px solid var(--border-strong);
        border-bottom: none;
        width: 100%;
    }

    .newsletter-form button {
        width: 100%;
        border-top: none;
    }

    /* Footer */
    .footer {
        padding: 2.5rem 1.5rem 1.5rem;
    }

    .footer-top {
        flex-direction: column;
        gap: 2.5rem;
    }

    .footer-clocks {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .footer-nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 2rem;
    }

    .footer-col {
        flex: 1 1 40%;
    }

    .footer-status {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .status-ok {
        margin-left: 0;
        margin-top: 0.5rem;
    }

    /* Modal */
    .modal-content {
        padding: 2rem 1.5rem;
    }
}

/* =====================
   Responsive — Small Mobile (≤480px)
   ===================== */
@media (max-width: 480px) {
    .brand-logo {
        font-size: 1.2rem;
    }

    .main-feature .headline {
        font-size: 1.1rem;
    }

    .newsletter-content h2 {
        font-size: 1.25rem;
    }

    .mid-story {
        grid-template-columns: 100px 1fr;
    }

    .grid-card {
        grid-template-columns: 100px 1fr;
    }
}

