
/* Local Reset to prevent Bootstrap styles from bleeding into the new header */
.newspaper-header {
    box-shadow: none !important; /* Remove outer border/shadow */
    border-bottom: 1px solid #e2e2e2;
}
.newspaper-header button {
    border: none !important;
    outline: none !important;
}
.newspaper-header .icon-button {
    background: transparent !important;
}
.newspaper-header ul {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Search container styling - Premium V2 Clean Rectangular Border */
.search-container {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 5px 10px;
    transition: all 0.15s ease-in-out;
}
.search-container:focus-within {
    border-color: #4a6b82;
    box-shadow: 0 0 0 2px rgba(74, 107, 130, 0.1);
}
.search-container i {
    color: #9ca3af;
    margin-right: 8px;
    font-size: 13px;
}
.search-container input {
    border: none;
    background: transparent;
    outline: none;
    font-family: 'Libre Franklin', 'Noto Sans KR', sans-serif;
    font-size: 12.5px;
    color: #1f2937;
    width: 280px;
}
.search-container input::placeholder {
    color: #9ca3af;
}

/* Custom Dropdown Styling to bypass Bootstrap conflicts */
.newspaper-header .custom-dropdown {
    position: relative;
    display: inline-block;
}
.newspaper-header .custom-dropdown-toggle {
    border: none !important;
    background: transparent !important;
    font-family: 'Libre Franklin', 'Noto Sans KR', sans-serif !important;
    font-size: 13px;
    font-weight: 600;
    color: #333 !important;
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 4px 8px;
    user-select: none;
}
.newspaper-header .custom-dropdown-toggle:hover {
    color: #4a6b82 !important;
}
.newspaper-header .custom-dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    z-index: 1000;
    min-width: 110px;
    background-color: #fff !important;
    border: 1px solid rgba(0,0,0,0.1) !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
    padding: 5px 0 !important;
    margin-top: 5px;
}
.newspaper-header .custom-dropdown-menu.show {
    display: block !important;
}
.newspaper-header .custom-dropdown-item {
    color: #333 !important;
    padding: 8px 15px !important;
    display: flex !important;
    align-items: center !important;
    text-decoration: none !important;
    background: transparent !important;
    border: none !important;
    text-align: left;
    width: 100%;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}
.newspaper-header .custom-dropdown-item:hover {
    background-color: #f4f4f4 !important;
    color: #4a6b82 !important;
}

/* Nav alignment for vertical divider centering & V2 Precise Borders / Typography */
.main-nav {
    border-top: 0.5px solid #adb5bd !important;
    border-bottom: 0.5px solid #212529 !important;
}
.main-nav ul {
    align-items: center !important;
}
.main-nav li {
    display: inline-flex !important;
    align-items: center !important;
}
.main-nav a {
    font-family: 'Libre Franklin', 'Noto Sans KR', sans-serif !important;
}
.newspaper-header .stock-value {
    font-family: 'Source Serif 4', 'Noto Serif KR', Georgia, serif !important;
}

/* Subscribe & Login buttons styling (Rectangular 4px corners & Clean flat transition) */
.subscribe-button {
    background-color: #2e4a62 !important;
    color: white !important;
    padding: 8px 16px !important;
    border-radius: 4px !important;
    font-family: 'Libre Franklin', 'Noto Sans KR', sans-serif !important;
    font-size: 11.5px !important;
    font-weight: 600 !important;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
    border: 1px solid #2e4a62 !important;
    transition: all 0.2s ease !important;
}
.subscribe-button:hover {
    background-color: #213647 !important;
    border-color: #213647 !important;
}
.login-button {
    background-color: transparent !important;
    color: #4b5563 !important;
    border: 1px solid #d1d5db !important;
    padding: 8px 16px !important;
    border-radius: 4px !important;
    font-family: 'Libre Franklin', 'Noto Sans KR', sans-serif !important;
    font-size: 11.5px !important;
    font-weight: 600 !important;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
    transition: all 0.2s ease !important;
}
.login-button:hover {
    background-color: #f9fafb !important;
    color: #111827 !important;
    border-color: #9ca3af !important;
}

/* Ticker item fade transition */
.ticker-item {
    transition: opacity 0.3s ease !important;
}

/* Logo Image styling (80% size: 48px desktop, 32px mobile) */
.newspaper-header .logo-image {
    height: 48px !important;
    width: auto !important;
    max-width: 100%;
    display: inline-block;
    vertical-align: middle;
}
@media (max-width: 768px) {
    .newspaper-header .logo-image {
        height: 32px !important;
    }
}

/* Market Indices Bar styling */
.newspaper-header .market-bar {
    border-bottom: 1px solid #e9e9e9;
    padding: 6px 0;
    display: flex;
    align-items: center;
    font-family: 'Source Serif 4', 'Noto Serif KR', Georgia, serif;
    background-color: transparent;  /* D-fix2 — was #f8f9fa */
}

.newspaper-header .market-bar-container {
    display: flex;
    align-items: center;
    width: 100%;
    overflow: hidden;
    position: relative;
}

.newspaper-header .market-chevron-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    color: #555;
    padding: 0 8px 0 0;
    display: flex;
    align-items: center;
    font-size: 12px;
    flex-shrink: 0;
}

.newspaper-header .market-indices {
    display: flex;
    align-items: center;
    gap: 20px;
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE/Edge */
    width: 100%;
}

.newspaper-header .market-indices::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.newspaper-header .market-index {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11.5px;
    font-weight: 500;
    white-space: nowrap;
}

.newspaper-header .market-index .index-name {
    font-weight: 700;
    color: #333333;
    margin-right: 2px;
}

.newspaper-header .market-index .index-value {
    font-weight: 600;
}

.newspaper-header .market-index .index-change {
    font-weight: 600;
}

.newspaper-header .market-index .index-arrow {
    font-size: 9px;
    margin-left: 1px;
}

/* Color Coding for Up/Down - Premium Emerald and Crimson */
.newspaper-header .market-index .positive {
    color: #059669 !important; /* Premium Emerald green */
}

.newspaper-header .market-index .negative {
    color: #dc2626 !important; /* Premium Crimson red */
}

/* Market bar horizontal scroll gradient fade for mobile */
@media (max-width: 992px) {
    .newspaper-header .market-bar-container {
        position: relative !important;
    }
    .newspaper-header .market-bar-container::after {
        content: '' !important;
        position: absolute !important;
        top: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 30px !important;
        background: linear-gradient(to right, rgba(255,255,255,0), rgba(255,255,255,0.95)) !important;
        pointer-events: none !important;
        z-index: 5 !important;
    }
    .newspaper-header .market-indices {
        padding-right: 30px !important;
    }
}

/* Mobile optimizations */
@media (max-width: 992px) {
    .main-nav {
        position: relative !important;
    }
    /* Subtle white gradient overlay at the right edge to indicate scrollability */
    .main-nav::after {
        content: '' !important;
        position: absolute !important;
        top: 1px !important;
        right: 0 !important;
        bottom: 1px !important;
        width: 45px !important;
        background: linear-gradient(to right, rgba(255,255,255,0), rgba(255,255,255,0.95)) !important;
        pointer-events: none !important;
        z-index: 5 !important;
    }
    .main-nav ul {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        padding-bottom: 8px !important;
        padding-right: 45px !important; /* Spacing so last item isn't hidden under gradient */
        scrollbar-width: none !important; /* Hide scrollbar for Firefox */
    }
    .main-nav ul::-webkit-scrollbar {
        display: none !important; /* Hide scrollbar for Chrome/Safari */
    }
    .main-nav li {
        flex: 0 0 auto !important; /* Prevent shrinking */
    }
    .main-nav a {
        white-space: nowrap !important; /* Prevent link text wrapping */
    }
}

@media (max-width: 768px) {
    /* Utility bar mobile view layout - double row */
    .utility-bar {
        flex-wrap: wrap !important;
        gap: 8px !important;
        padding: 8px 0 !important;
    }
    .left-controls {
        flex: 1 !important;
        max-width: 70% !important;
        gap: 10px !important;
    }
    .search-container {
        flex-grow: 1 !important;
        max-width: 240px;
    }
    .search-container input {
        width: 100% !important;
        font-size: 12px;
    }
    .language-options {
        flex: 0 0 auto !important;
    }
    .account-controls {
        order: 3 !important;
        width: 100% !important;
        margin-top: 4px !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        border-top: 1px dashed #e2e2e2 !important;
        padding-top: 6px !important;
    }

    /* Masthead container Grid layout to reduce vertical stacking */
    .masthead-container {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        grid-template-rows: auto auto !important;
        grid-template-areas: 
            "title title"
            "date weather" !important;
        gap: 8px 12px !important;
        padding: 10px 0 !important;
        border-bottom: none !important;
    }
    .newspaper-title {
        grid-area: title !important;
        text-align: center !important;
        border-bottom: 1px solid #e2e2e2 !important;
        padding-bottom: 8px !important;
    }
    .newspaper-title h1 {
        font-size: 28px !important;
    }
    .date-info {
        grid-area: date !important;
        text-align: left !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        flex: none !important;
        width: auto !important;
    }
    .date-info .current-date {
        font-size: 11px !important;
    }
    .date-info .paper-info {
        font-size: 10px !important;
        margin-top: 1px !important;
    }
    .weather-info {
        grid-area: weather !important;
        text-align: right !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: flex-end !important;
        flex: none !important;
        width: auto !important;
    }
    .weather-info .temperature {
        margin-bottom: 2px !important;
        font-size: 11px !important;
        display: flex !important;
        align-items: center !important;
        gap: 4px !important;
    }
    .weather-info .temp-main {
        font-size: 11px !important;
        margin-right: 0 !important;
    }
    .weather-info .temp-range {
        font-size: 10px !important;
    }
    .weather-info .stock-info {
        font-size: 11px !important;
    }
}

@media (max-width: 576px) {
    .subscribe-button {
        padding: 5px 10px !important;
        font-size: 11px !important;
    }
    .login-button {
        padding: 5px 10px !important;
        font-size: 11px !important;
    }
    .custom-dropdown-toggle {
        font-size: 11px !important;
        padding: 4px 6px !important;
    }
    .search-container {
        max-width: 180px;
        padding: 4px 8px;
    }
    .search-container input {
        font-size: 11px;
    }
    .newspaper-title h1 {
        font-size: 24px !important;
    }
}
/* Header container */
.newspaper-header {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 10px;
    background-color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Logo Image scaling (80% size: 48px desktop, 32px mobile) */
.newspaper-header .logo-image {
    height: 48px !important;
    width: auto !important;
    max-width: 100%;
    display: inline-block;
    vertical-align: middle;
}
@media (max-width: 768px) {
    .newspaper-header .logo-image {
        height: 32px !important;
    }
}

/* Market Indices Bar styling */
.newspaper-header .market-bar {
    border-bottom: 1px solid #e9e9e9;
    padding: 6px 0;
    display: flex;
    align-items: center;
    font-family: 'Source Serif 4', 'Noto Serif KR', Georgia, serif;
    background-color: transparent;  /* D-fix2 — was #f8f9fa */
}

.newspaper-header .market-bar-container {
    display: flex;
    align-items: center;
    width: 100%;
    overflow: hidden;
    position: relative;
}

.newspaper-header .market-chevron-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    color: #555;
    padding: 0 8px 0 0;
    display: flex;
    align-items: center;
    font-size: 12px;
    flex-shrink: 0;
}

.newspaper-header .market-indices {
    display: flex;
    align-items: center;
    gap: 20px;
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE/Edge */
    width: 100%;
}

.newspaper-header .market-indices::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.newspaper-header .market-index {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11.5px;
    font-weight: 500;
    white-space: nowrap;
}

.newspaper-header .market-index .index-name {
    font-weight: 700;
    color: #333333;
    margin-right: 2px;
}

.newspaper-header .market-index .index-value {
    font-weight: 600;
}

.newspaper-header .market-index .index-change {
    font-weight: 600;
}

.newspaper-header .market-index .index-arrow {
    font-size: 9px;
    margin-left: 1px;
}

/* Color Coding for Up/Down */
.newspaper-header .market-index .positive {
    color: #059669 !important; /* Premium Emerald green */
}

.newspaper-header .market-index .negative {
    color: #dc2626 !important; /* Premium Crimson red */
}

/* Market bar horizontal scroll gradient fade for mobile */
@media (max-width: 992px) {
    .newspaper-header .market-bar-container {
        position: relative !important;
    }
    .newspaper-header .market-bar-container::after {
        content: '' !important;
        position: absolute !important;
        top: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 30px !important;
        background: linear-gradient(to right, rgba(255,255,255,0), rgba(255,255,255,0.95)) !important;
        pointer-events: none !important;
        z-index: 5 !important;
    }
    .newspaper-header .market-indices {
        padding-right: 30px !important;
    }
}

/* Utility bar */
.utility-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid #e2e2e2;
}

.left-controls {
    display: flex;
    gap: 15px;
}

.icon-button {
    font-size: 18px;
    color: #555;
    padding: 5px;
}

.language-options {
    display: flex;
    gap: 10px;
}

.language-options a {
    font-size: 12px;
    font-weight: 600;
    color: #555;
    transition: color 0.2s;
}

.language-options a.active {
    color: #000;
}

.language-options a:hover {
    color: #000;
}

.account-controls {
    display: flex;
    gap: 10px;
}

.subscribe-button {
    background-color: #2e4a62;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-family: 'Libre Franklin', 'Noto Sans KR', sans-serif;
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid #2e4a62;
    transition: all 0.2s ease;
}

.subscribe-button:hover {
    background-color: #213647;
    border-color: #213647;
}

.login-button {
    background-color: transparent;
    color: #4b5563;
    padding: 8px 16px;
    border-radius: 4px;
    border: 1px solid #d1d5db;
    font-family: 'Libre Franklin', 'Noto Sans KR', sans-serif;
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
}

.login-button:hover {
    background-color: #f9fafb;
    color: #111827;
    border-color: #9ca3af;
}

/* Masthead container */
.masthead-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: none !important;
}

.date-info {
    flex: 1;
}

.current-date {
    font-family: 'Source Serif 4', 'Noto Serif KR', Georgia, serif;
    font-weight: 600;
    font-size: 12px;
}

.paper-info {
    font-size: 10px;
    color: #666;
}

.newspaper-title {
    flex: 2;
    text-align: center;
}

.newspaper-title h1 {
    font-family: 'UnifrakturMaguntia', serif;
    font-size: 48px;
    font-weight: normal;
    letter-spacing: 1px;
    margin: 0;
    line-height: 1.2;
}

.weather-info {
    flex: 1;
    text-align: right;
}

.temperature {
    margin-bottom: 5px;
}

.temp-icon {
    font-size: 14px;
    margin-right: 5px;
}

.temp-main {
    font-weight: 600;
    font-size: 12px;
    margin-right: 10px;
}

.temp-range {
    color: #666;
    font-size: 11px;
}

.stock-info {
    font-size: 12px;
}

.stock-name {
    margin-right: 5px;
}

.stock-value {
    font-family: 'Source Serif 4', 'Noto Serif KR', Georgia, serif;
}

.stock-value.positive {
    color: #28a745;
}

.stock-value.negative {
    color: #dc3545;
}

/* Main navigation */
.main-nav {
    padding: 12px 0;
    border-top: 0.5px solid #adb5bd !important;
    border-bottom: 0.5px solid #212529 !important;
    margin: 8px 0;
}

.main-nav ul {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 5px 15px;
}

.main-nav li {
    position: relative;
}

.main-nav li:not(:last-child)::after {
    content: "";
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    height: 11px;
    width: 1px;
    background-color: #e5e7eb;
}

.main-nav a {
    font-family: 'Libre Franklin', 'Noto Sans KR', sans-serif;
    font-size: 12.5px;
    font-weight: 600;
    color: #1f2937;
    transition: color 0.15s ease;
}

.main-nav a:hover {
    color: #4a6b82;
    text-decoration: none;
}

/* News ticker */
.news-ticker {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e2e2e2;
    gap: 30px;
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.news-ticker::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.ticker-item {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.live-indicator {
    background-color: transparent !important;
    color: #dc2626 !important;
    font-family: 'Libre Franklin', 'Noto Sans KR', sans-serif !important;
    font-size: 13px;
    font-weight: 800;
    padding: 0 !important;
    margin-right: 4px;
    letter-spacing: 0.5px;
}

.ticker-title {
    font-family: 'Source Serif 4', 'Noto Serif KR', Georgia, serif;
    font-weight: 700;
    font-size: 13.5px;
    color: #111827;
}

.ticker-time {
    font-family: 'Libre Franklin', 'Noto Sans KR', sans-serif;
    font-size: 11px;
    color: #888888;
    margin-left: 4px;
    font-weight: 400;
}

/* Responsive styles */
@media (max-width: 992px) {
    .language-options a:not(.active) {
        display: none;
    }
    
    .newspaper-title h1 {
        font-size: 36px;
    }
    
    .main-nav ul {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 2px;
    }
}

@media (max-width: 768px) {
    .utility-bar {
        flex-wrap: wrap;
    }
    
    .account-controls {
        order: 3;
        width: 100%;
        margin-top: 5px;
        justify-content: space-between;
    }
    
    .masthead-container {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .date-info, .newspaper-title, .weather-info {
        flex: none;
        width: 100%;
    }
    
    .weather-info {
        text-align: center;
    }
}
