/* ==========================================================
   BASE
   ========================================================== */

* { box-sizing: border-box; font-family: Arial, sans-serif;}
html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #e8eaec;
    color: #16191d;
    line-height: 1.5;
}

a { color: inherit; }


/* ==========================================================
   HEADER
   ========================================================== */

.site-header {
    background: #101820;
    border-bottom: 1px solid #29333c;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    max-width: 1180px;
    margin: 0 auto;
    padding: 22px 28px;
}

.brand-group {
    display: flex;
    align-items: center;
    gap: 18px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    text-decoration: none;
}

.brand-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    flex-shrink: 0;
}

.brand-name {
    color: white;
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 1px;
}

.brand-byline {
    color: #aab4bd;
    font-size: 13px;
}


.main-nav {
    display: flex;
    align-items: center;
    gap: 24px;
}

.main-nav a {
    position: relative;
    padding: 8px 0;
    color: #aab4bd;
    text-decoration: none;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 1px;
}

.main-nav a:hover,
.main-nav a.active { color: white; }

.main-nav a.active::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 2px;
    background: white;
}


/* ==========================================================
   CONTAINER / HERO
   ========================================================== */

.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 28px 80px;
}

.hero {
    max-width: 760px;
    padding: 64px 0 44px;
}

.eyebrow {
    margin: 0 0 10px;
    color: #68727c;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.5px;
}

.hero h1 {
    max-width: 720px;
    margin: 0;
    font-size: 42px;
    line-height: 1.12;
    letter-spacing: -1px;
}

.hero-description {
    max-width: 650px;
    margin: 18px 0 0;
    color: #66717b;
    font-size: 16px;
    line-height: 1.6;
}

.calendar-hero { padding-bottom: 26px; }


/* ==========================================================
   DAILY MARKET BRIEF
   ========================================================== */

.daily-brief {
    overflow: hidden;
    margin: -4px 0 36px;
    border: 1px solid #c8d0d7;
    border-radius: 10px;
    background: #f4f6f8;
    box-shadow: 0 3px 12px rgba(16, 24, 32, 0.05);
}

.daily-brief-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 20px 26px;
    border-bottom: 1px solid #2d3943;
    background: #101820;
}

.daily-brief-brand {
    color: white;
    font-size: 20px;
    font-weight: 900;
    line-height: 1.15;
    letter-spacing: 1.4px;
}

.daily-brief-subtitle {
    margin-top: 5px;
    color: #aeb9c2;
    font-size: 11px;
    line-height: 1.4;
}

.daily-brief-date {
    flex-shrink: 0;
    color: #c4ccd3;
    font-size: 30px;
}

.daily-brief-body {
    padding: 25px 27px 21px;
}

.daily-brief-headline {
    max-width: 900px;
    margin: 0;
    color: #16191d;
    font-size: 24px;
    line-height: 1.32;
    letter-spacing: -0.35px;
}

.daily-brief-teaser {
    max-width: 920px;
    margin: 14px 0 0;
    color: #4e5b65;
    font-size: 14px;
    line-height: 1.7;
}

.daily-brief-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 17px;
}

.daily-brief-expanded {
    margin-top: 25px;
    padding-top: 23px;
    border-top: 1px solid #d6dce1;
}

.daily-brief-section {
    padding: 0 0 19px;
}

.daily-brief-section + .daily-brief-section {
    padding-top: 19px;
    border-top: 1px solid #dde2e6;
}

.daily-brief-section h3,
.daily-brief-watch h3 {
    margin: 0 0 8px;
    color: #25313a;
    font-size: 15px;
    font-weight: 800;
}

.daily-brief-section p {
    max-width: 930px;
    margin: 0;
    color: #56636d;
    font-size: 13px;
    line-height: 1.75;
}

.daily-brief-watch {
    margin-top: 2px;
    padding: 17px 19px;
    border: 1px solid #d7dde2;
    border-radius: 7px;
    background: white;
}

.daily-brief-watch ul {
    margin: 8px 0 0;
    padding-left: 19px;
}

.daily-brief-watch li {
    margin: 6px 0;
    color: #505c66;
    font-size: 13px;
    line-height: 1.55;
}

.daily-brief-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    margin-top: 21px;
    padding-top: 15px;
    border-top: 1px solid #d6dce1;
}

.daily-brief-disclosure {
    color: #818c95;
    font-size: 10px;
}

.daily-brief-toggle {
    flex-shrink: 0;
    padding: 9px 4px;
    border: 0;
    background: transparent;
    color: #244f73;
    font-family: inherit;
    font-size: 25px;
    font-weight: 800;
    cursor: pointer;
}

.daily-brief-toggle:hover {
    text-decoration: underline;
}

@media (max-width: 700px) {
    .daily-brief-banner,
    .daily-brief-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .daily-brief-banner {
        padding: 18px;
    }

    .daily-brief-body {
        padding: 20px 18px;
    }

    .daily-brief-brand {
        font-size: 18px;
    }

    .daily-brief-headline {
        font-size: 20px;
    }
}


/* ==========================================================
   SEARCH / NEWS FILTERS
   ========================================================== */

.search-section { margin-bottom: 32px; }

.search-form {
    display: flex;
    gap: 10px;
}

.search-input {
    flex: 1;
    min-width: 0;
    padding: 14px 16px;
    border: 1px solid #d8dde2;
    border-radius: 6px;
    outline: none;
    background: white;
    color: #16191d;
    font-family: inherit;
    font-size: 14px;
}

.search-input:focus { border-color: #67798a; }

.search-button {
    padding: 0 22px;
    border: 0;
    border-radius: 6px;
    background: #101820;
    color: white;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
}

.search-button:hover { background: #26333e; }

.active-filters {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 12px;
    padding: 10px 13px;
    border: 1px solid #dce1e5;
    border-radius: 5px;
    background: #eef1f3;
    color: #59636c;
    font-size: 12px;
}

.active-filters a {
    font-weight: 700;
    text-decoration: none;
}

.filter-section {
    padding: 18px 0;
    border-top: 1px solid #dde1e5;
}

.filter-section:last-of-type {
    border-bottom: 1px solid #dde1e5;
}

.filter-label {
    margin-bottom: 10px;
    color: #747e87;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.3px;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.filter-chip {
    padding: 7px 11px;
    border: 1px solid #d9dee3;
    border-radius: 5px;
    background: white;
    color: #4f5963;
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
}

.filter-chip:hover {
    border-color: #9aa6b1;
    color: #16191d;
}

.filter-chip.active {
    border-color: #101820;
    background: #101820;
    color: white;
}

.filter-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 15px 0;
}

.filter-actions span {
    color: #747e87;
    font-size: 12px;
}

.clear-button {
    border: 0;
    background: transparent;
    color: #315a7d;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}


/* ==========================================================
   RESULTS / NEWS
   ========================================================== */

.results-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin: 42px 0 20px;
}

.results-header h2 {
    margin: 0;
    font-size: 27px;
    letter-spacing: -0.4px;
}

.result-count {
    color: #737d86;
    font-size: 13px;
}

.article-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.article-card {
    padding: 22px 24px;
    border: 1px solid #dfe3e6;
    border-radius: 7px;
    background: white;
}

.article-card:hover { border-color: #b9c1c8; }

.article-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 10px;
}

.article-source {
    color: #44505a;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.article-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.article-date {
    color: #89929a;
    font-size: 11px;
    white-space: nowrap;
}

.article-card h3 {
    max-width: 900px;
    margin: 0 0 11px;
    font-size: 20px;
    line-height: 1.38;
}

.article-card h3 a { text-decoration: none; }
.article-card h3 a:hover { text-decoration: underline; }

.article-description {
    max-width: 900px;
    margin: 0 0 15px;
    color: #626c75;
    font-size: 13px;
    line-height: 1.6;
}

.tag-row,
.region-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.topic-tag {
    padding: 4px 8px;
    border-radius: 4px;
    background: #eaf0f6;
    color: #294d70;
    font-size: 10px;
    font-weight: 700;
}


/* ==========================================================
   TOPIC COLOR SYSTEM
   Same identity is used in filters and article tags.
   ========================================================== */

.filter-chip[data-filter-type="topic"],
.topic-tag {
    border: 1px solid transparent;
    font-weight: 700;
}

.topic-rates {
    background: #e9f1fb !important;
    border-color: #b9cee8 !important;
    color: #285b91 !important;
}

.topic-inflation {
    background: #fbecec !important;
    border-color: #e8bcbc !important;
    color: #983f3f !important;
}

.topic-jobs {
    background: #eaf6ef !important;
    border-color: #b9ddc7 !important;
    color: #34724e !important;
}

.topic-growth {
    background: #f1ecf8 !important;
    border-color: #d1c1e5 !important;
    color: #65488c !important;
}

.topic-fiscal {
    background: #fbf2df !important;
    border-color: #e7cf9e !important;
    color: #8b641d !important;
}

.topic-trade {
    background: #e7f5f4 !important;
    border-color: #acd8d5 !important;
    color: #28736f !important;
}

.topic-fx {
    background: #eceefa !important;
    border-color: #c2c8e7 !important;
    color: #4d5d9b !important;
}

.topic-bonds {
    background: #f3e7da !important;
    border-color: #b88a5a !important;
    color: #70451f !important;
}

.topic-commodities {
    background: #fbefe3 !important;
    border-color: #e8c7a4 !important;
    color: #9a5a20 !important;
}

.topic-general {
    background: #eef1f3 !important;
    border-color: #ccd3d9 !important;
    color: #56636e !important;
}

.topic-theory {
    background: #f2eef5 !important;
    border-color: #d4c7dc !important;
    color: #6d557a !important;
}

/* Selected topic filters remain visibly selected while retaining
   a small trace of their topic identity through the border. */
.filter-chip[data-filter-type="topic"].active {
    background: #101820 !important;
    color: white !important;
}

.region-tag {
    padding: 4px 8px;
    border: 1px solid #e0e4e7;
    border-radius: 4px;
    color: #626d76;
    font-size: 10px;
    font-weight: 600;
}


/* ==========================================================
   REGION + SOURCE VISUAL SYSTEM
   ========================================================== */

.filter-chip[data-filter-type="region"],
.filter-chip[data-filter-type="source"] {
    position: relative;
    min-height: 38px;
    padding: 9px 14px 9px 46px;
    border-color: #d3d9de;
    background: white;
    color: #44505a;
    font-size: 12px;
    font-weight: 700;
    text-align: left;
}

.region-tag {
    position: relative;
    min-height: 31px;
    padding: 7px 11px 7px 40px;
    display: inline-flex;
    align-items: center;
    color: #4b5660;
    font-size: 11px;
    font-weight: 700;
}

/* Asset appears as a contained icon at the left, never behind text. */
.region-visual::before,
.source-visual::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 50%;
    width: 28px;
    height: 24px;
    transform: translateY(-50%);
    border-radius: 3px;
    background-image: var(--watermark-image);
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.82;
    pointer-events: none;
}

.source-visual::before {
    width: 30px;
    height: 26px;
    opacity: 0.88;
}

/* Selected filters use the existing dark MacroDrive state. */
.filter-chip[data-filter-type="region"].active,
.filter-chip[data-filter-type="source"].active {
    border-color: #101820;
    background: #101820;
    color: white;
}

.filter-chip[data-filter-type="region"].active::before,
.filter-chip[data-filter-type="source"].active::before {
    opacity: 1;
}

/* Sources without a mapped logo remain normal compact text chips. */
.filter-chip[data-filter-type="source"]:not(.source-visual) {
    padding-left: 14px;
}

/* Regions without a mapped asset also fall back cleanly. */
.filter-chip[data-filter-type="region"]:not(.region-visual),
.region-tag:not(.region-visual) {
    padding-left: 14px;
}

.article-source.source-visual {
    position: relative;
    min-height: 34px;
    padding: 7px 11px 7px 47px;
    display: inline-flex;
    align-items: center;
    border: 1px solid #e0e4e7;
    border-radius: 5px;
    background: #fafbfc;
    font-size: 11px;
}

.article-source.source-visual::before {
    left: 8px;
    width: 30px;
    height: 24px;
}

.article-source > span {
    position: relative;
}

.article-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 17px;
    padding-top: 13px;
    border-top: 1px solid #eef0f2;
}

.article-footer a {
    color: #315a7d;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
}

.article-footer a:hover { text-decoration: underline; }

.empty-state {
    padding: 70px 20px;
    border: 1px solid #dfe3e6;
    border-radius: 7px;
    background: white;
    text-align: center;
}

.empty-state h3 { margin: 0 0 8px; }
.empty-state p { color: #737d86; }


/* ==========================================================
   CALENDAR LEGEND / TIMEZONE
   ========================================================== */

.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 14px;
}

.legend-item {
    padding: 5px 9px;
    border-left: 3px solid #8a949d;
    border-radius: 4px;
    background: white;
    color: #59636c;
    font-size: 15px;
    font-weight: 700;
}

.calendar-timezone {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 10px;
    color: #737d86;
    font-size: 10px;
}

.calendar-timezone span {
    font-weight: 800;
    letter-spacing: 0.8px;
}

.calendar-timezone strong {
    color: #4d5862;
    font-weight: 600;
}


/* ==========================================================
   MONTH CALENDAR
   ========================================================== */

.month-calendar {
    overflow: hidden;
    border: 1px solid #dfe3e6;
    border-radius: 8px;
    background: white;
}

.calendar-toolbar {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 42px auto;
    align-items: center;
    gap: 10px;
    padding: 18px 20px;
    border-bottom: 1px solid #e2e5e8;
}

.calendar-current-month { text-align: center; }
.calendar-current-month .eyebrow { margin-bottom: 2px; }

.calendar-current-month h2 {
    margin: 0;
    font-size: 23px;
}

.calendar-nav-button {
    width: 38px;
    height: 38px;
    border: 1px solid #d9dee3;
    border-radius: 5px;
    background: white;
    color: #39444e;
    font-family: inherit;
    font-size: 24px;
    cursor: pointer;
}

.calendar-nav-button:hover {
    border-color: #9aa6b1;
    background: #f7f8f9;
}

.calendar-today-button {
    padding: 8px 13px;
    border: 1px solid #d9dee3;
    border-radius: 5px;
    background: white;
    color: #39444e;
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-bottom: 1px solid #e2e5e8;
    background: #f7f8f9;
}

.calendar-weekdays div {
    padding: 9px 10px;
    color: #78828b;
    text-align: center;
    font-size: 9px;
    font-weight: 800;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.calendar-day {
    position: relative;
    min-width: 0;
    min-height: 128px;
    padding: 9px;
    border: 0;
    border-right: 1px solid #e7e9eb;
    border-bottom: 1px solid #e7e9eb;
    background: white;
    color: inherit;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}

.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-day:nth-last-child(-n + 7) { border-bottom: 0; }
.calendar-day:hover { background: #f8f9fa; }

.calendar-day-outside {
    background: #fafbfb;
    color: #adb4ba;
}

.calendar-day-selected { background: #f0f4f7; }

.calendar-day-today .calendar-day-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 25px;
    height: 25px;
    padding: 0 5px;
    border-radius: 50%;
    background: #101820;
    color: white;
}

.calendar-day-number {
    margin-bottom: 7px;
    color: #3e4851;
    font-size: 12px;
    font-weight: 700;
}

.calendar-day-events {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.calendar-day-event {
    overflow: hidden;
    padding: 4px 5px;
    border-left: 3px solid #8a949d;
    border-radius: 3px;
    background: #eef2f5;
    color: #45525d;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-day-event span {
    margin-right: 4px;
    color: #75808a;
    font-weight: 700;
}

.calendar-day-more {
    padding-left: 4px;
    color: #6f7982;
    font-size: 9px;
    font-weight: 700;
}


/* ==========================================================
   CATEGORY COLORS
   ========================================================== */

.category-rates { border-left-color: #3976b8 !important; }
.category-inflation { border-left-color: #b84b4b !important; }
.category-labor { border-left-color: #438b62 !important; }
.category-growth { border-left-color: #7657a8 !important; }
.category-consumer { border-left-color: #c47a35 !important; }
.category-trade { border-left-color: #2f8b8b !important; }
.category-other { border-left-color: #8a949d !important; }

.calendar-day-event.category-rates { background: #edf4fb; }
.calendar-day-event.category-inflation { background: #faeeee; }
.calendar-day-event.category-labor { background: #edf7f1; }
.calendar-day-event.category-growth { background: #f3eff8; }
.calendar-day-event.category-consumer { background: #fbf2e8; }
.calendar-day-event.category-trade { background: #eaf6f6; }


/* ==========================================================
   SELECTED DAY DETAILS
   ========================================================== */

.calendar-day-details { margin-top: 36px; }

.selected-day-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 17px;
}

.selected-day-header h2 {
    margin: 0;
    font-size: 25px;
}

#selected-day-events {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.calendar-detail-card {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 22px;
    padding: 20px 22px;
    border: 1px solid #dfe3e6;
    border-left: 4px solid #8a949d;
    border-radius: 7px;
    background: white;
}

.calendar-detail-time {
    color: #20272d;
    font-size: 17px;
    font-weight: 700;
}

.calendar-detail-main { min-width: 0; }

.event-country {
    color: #68727c;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.7px;
    text-transform: uppercase;
}

.calendar-detail-main h3 {
    margin: 3px 0 0;
    font-size: 18px;
    line-height: 1.35;
}

.event-type {
    margin-top: 5px;
    color: #77818a;
    font-size: 11px;
}

.event-data {
    display: grid;
    grid-template-columns: repeat(2, minmax(120px, 180px));
    gap: 24px;
    margin-top: 17px;
}

.event-data > div {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.event-data-label {
    color: #89929a;
    font-size: 9px;
    font-weight: 800;
}

.event-data strong {
    color: #303942;
    font-size: 14px;
}

.event-source {
    margin-top: 14px;
    color: #89929a;
    font-size: 10px;
}

.event-source a {
    color: #526d84;
    text-decoration: none;
}

.event-source a:hover { text-decoration: underline; }
.calendar-day-empty { padding: 45px 20px; }


/* ==========================================================
   FOOTER / MOBILE
   ========================================================== */

.site-footer {
    border-top: 1px solid #dfe3e6;
    background: white;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    max-width: 1180px;
    margin: 0 auto;
    padding: 26px 28px;
    color: #747e87;
    font-size: 11px;
}

.footer-content strong {
    color: #303942;
    letter-spacing: 1px;
}

@media (max-width: 700px) {
    .header-content,
    .container,
    .footer-content {
        padding-left: 18px;
        padding-right: 18px;
    }

    .header-content,
    .brand-group {
        align-items: flex-start;
        flex-direction: column;
    }

    .brand {
        flex-direction: row;
        align-items: center;
    }

    .hero { padding-top: 42px; }
    .hero h1 { font-size: 33px; }

    .search-form { flex-direction: column; }
    .search-button { padding: 13px; }

    .article-top,
    .results-header,
    .filter-actions,
    .selected-day-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .calendar-timezone {
        justify-content: flex-start;
    }

    .month-calendar { overflow-x: auto; }

    .calendar-toolbar,
    .calendar-weekdays,
    .calendar-grid {
        min-width: 760px;
    }

    .calendar-day { min-height: 115px; }

    .calendar-detail-card {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .event-data {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .footer-content {
        flex-direction: column;
        gap: 5px;
    }
}


/* Source chips intentionally use clean text-only styling. */
.filter-chip[data-filter-type="source"] {
    min-height: 38px;
    padding: 9px 14px;
    background: white;
    color: #44505a;
    font-size: 12px;
    font-weight: 700;
}

.article-source {
    min-height: auto;
    padding: 0;
    border: 0;
    background: transparent;
}
