/*
Theme Name: Marqzy Premium
Theme URI: https://marqzy.in
Author: Marqzy Team
Author URI: https://marqzy.in
Description: Strategic Global Trade Intelligence — Premium Financial News Layout for WordPress. Dark header, gold accents, breaking-news ticker, market overview sidebar, and a responsive article grid.
Version: 2.1.0
Requires at least: 5.9
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: marqzy
*/

/* =========================================================
   RESET & BASE
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --dark:          #0b2e21;   /* deep header green/black */
    --dark-2:        #0f3a2a;
    --gold:          #c9a227;
    --gold-light:    #e3c65a;
    --gold-text:     #6e5915;   /* darker gold for text on light backgrounds — must clear 4.5:1 against BOTH #ffffff and --bg-light (#f6f7f5); #8c711b passed white (4.67:1) but failed bg-light (4.35:1), so this is set with real margin (6.3–6.8:1 on both) */
    --red:           #c0392b;
    --green-up:      #1b7f47;  /* darkened from #1e8e4f: 4.17:1 on white failed the 4.5:1 small-text threshold */
    --red-down:      #c0392b;
    --text:          #16211c;
    --text-light:    #4c5a53;
    --text-muted:    #636c66;  /* darkened from #7c8880: 3.4–3.7:1 on white/bg-light failed the 4.5:1 small-text threshold */
    --bg-white:      #ffffff;
    --bg-light:      #f6f7f5;
    --bg-card:       #ffffff;
    --border:        #e3e6e2;
    --shadow:        0 2px 14px rgba(0,0,0,0.06);
    --shadow-hover:  0 10px 30px rgba(0,0,0,0.12);
    --radius:        8px;
    --font-body:     'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-heading:  'Georgia', 'Times New Roman', serif;
    --max-width:     1240px;
    --transition:    0.2s ease;
}

html { scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    background: var(--bg-light);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold); }

/* Hard image-size limits: nothing overflows its container, ever */
img, video, iframe { max-width: 100%; height: auto; display: block; }
img { object-fit: cover; }

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

h1, h2, h3, h4 { font-family: var(--font-heading); line-height: 1.25; color: var(--text); }

/* =========================================================
   TOP BAR
   ========================================================= */
.top-bar {
    background: var(--dark);
    color: rgba(255,255,255,0.75);
    font-size: 0.78rem;
    padding: 6px 0;
}
.top-bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
}
.top-bar-inner a { color: rgba(255,255,255,0.75); }
.top-bar-inner a:hover { color: var(--gold-light); }

/* =========================================================
   HEADER
   ========================================================= */
.main-header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.logo h1 {
    font-size: 1.7rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--dark);
    display: flex;
    align-items: baseline;
    gap: 10px;
}
.logo h1 a { color: var(--dark); }
.logo h1 span { color: var(--gold-text); }
.logo small {
    font-family: var(--font-body);
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* =========================================================
   NAV BAR — horizontal menu fix
   Menus must always render as a single row on desktop; the
   old build let <ul> wrap/stack vertically. This forces a
   proper flex row, with wrapping only as a last resort on
   very small screens (handled in the mobile breakpoint).
   ========================================================= */
.nav-bar {
    background: var(--dark-2);
}
.nav-bar .container { display: flex; }
.nav-links {
    display: flex;
    flex-direction: row;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }
.nav-links li { flex: 0 0 auto; }
.nav-links li a {
    display: block;
    white-space: nowrap;
    padding: 12px 18px;
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: rgba(255,255,255,0.85);
    border-bottom: 3px solid transparent;
}
.nav-links li a:hover,
.nav-links li.current-menu-item a,
.nav-links li.current-cat a {
    color: var(--gold-light);
    border-bottom-color: var(--gold);
    background: rgba(255,255,255,0.03);
}

/* =========================================================
   BREAKING NEWS TICKER
   ========================================================= */
.ticker-wrap {
    background: var(--dark);
    border-top: 1px solid rgba(255,255,255,0.08);
    border-bottom: 2px solid var(--gold);
    overflow: hidden;
}
.ticker-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    height: 38px;
}
.ticker-label {
    flex-shrink: 0;
    background: var(--red);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 12px;
    border-radius: 3px;
    white-space: nowrap;
}
.ticker-text {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    display: block;
}
.ticker-text-inner {
    display: inline-block;
    animation: ticker-scroll 26s linear infinite;
    padding-left: 100%;
}
.ticker-text a {
    color: #fff;
    font-size: 0.85rem;
    margin-right: 40px;
}
.ticker-text a:hover { color: var(--gold-light); text-decoration: underline; }

@keyframes ticker-scroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* =========================================================
   LAYOUT — main content + sidebar
   ========================================================= */
main.container { padding-top: 24px; padding-bottom: 40px; }
.site-layout {
    display: grid;
    grid-template-columns: 2.5fr 1fr;
    gap: 30px;
    align-items: start;
}
.site-layout.full-width-layout { grid-template-columns: 2.5fr 1fr; }

/* =========================================================
   HERO SECTION
   ========================================================= */
.hero-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 18px;
    margin-bottom: 32px;
}
.hero-big {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-card);
    box-shadow: var(--shadow);
}
.hero-big img { width: 100%; height: 360px; object-fit: cover; background: var(--bg-light); }
.hero-big-content {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 20px 22px 22px;
    background: linear-gradient(180deg, rgba(11,46,33,0) 0%, rgba(11,46,33,0.92) 78%);
}
.hero-big-content h2 a { color: #fff; }
.hero-big-content h2 a:hover { color: var(--gold-light); }
.hero-big-content .meta-text { color: rgba(255,255,255,0.75); }

.hero-side-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.hero-small {
    display: flex;
    gap: 12px;
    background: var(--dark);
    border-radius: var(--radius);
    overflow: hidden;
    flex: 1;
    align-items: stretch;
}
.hero-small a:first-child { flex-shrink: 0; width: 120px; align-self: stretch; }
.hero-small a:first-child img { display: block; width: 120px; height: 100%; min-height: 100px; object-fit: cover; }
.hero-small > div { padding: 10px 12px 10px 0; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.hero-small h2 a { color: #fff; }
.hero-small h2 a:hover { color: var(--gold-light); }

.badge {
    display: inline-block;
    background: var(--gold);
    color: var(--dark);
    font-size: 0.62rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 9px;
    border-radius: 3px;
}

.meta-text { font-size: 0.75rem; color: var(--text-muted); }

/* =========================================================
   BREADCRUMBS
   ========================================================= */
.breadcrumbs {
    background: var(--bg-light);
    border-bottom: 1px solid var(--border);
    padding: 10px 0;
}
.breadcrumbs .container {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}
.breadcrumbs a { color: var(--text-light); }
.breadcrumbs a:hover { color: var(--gold); text-decoration: underline; }
.breadcrumbs span[aria-current="page"] {
    color: var(--text);
    font-weight: 600;
}
.breadcrumbs-sep {
    margin: 0 8px;
    color: var(--text-muted);
}

/* =========================================================
   SECTION TITLES
   ========================================================= */
.section-title-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border);
}
.section-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--dark);
    position: relative;
    padding-left: 14px;
}
.section-title::before {
    content: "";
    position: absolute;
    left: 0; top: 3px; bottom: 3px;
    width: 4px;
    background: var(--gold);
    border-radius: 2px;
}

/* =========================================================
   ARTICLE GRID / CARDS
   ========================================================= */
.articles-grid-view {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.article-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow var(--transition), transform var(--transition);
    display: flex;
    flex-direction: column;
}
.article-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); }
/* Fixed, sane image size — prevents oversized/blown-out thumbnails */
.article-card img { width: 100%; height: 165px; object-fit: cover; background: var(--bg-light); }
.article-card-body { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.news-card-title { font-size: 1rem; font-family: var(--font-body); font-weight: 700; line-height: 1.35; }
.news-card-title a { color: var(--text); }
.news-card-title a:hover { color: var(--dark); text-decoration: underline; }

/* =========================================================
   SIDEBAR
   ========================================================= */
.content-sidebar { display: flex; flex-direction: column; gap: 20px; }
.sidebar-widget {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px 20px;
}
.widget-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--gold);
    display: inline-block;
    color: var(--dark);
}
.market-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.market-table td { padding: 8px 0; border-bottom: 1px solid var(--border); }
.market-table td:first-child { font-weight: 600; color: var(--text); }
.market-table td:last-child { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.up-trend { color: var(--green-up); }
.down-trend { color: var(--red-down); }

.content-sidebar ul { list-style: none; }
.content-sidebar ul li {
    padding: 7px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.88rem;
}
.content-sidebar ul li:last-child { border-bottom: none; }
.content-sidebar ul li a { color: var(--text); font-weight: 500; }
.content-sidebar ul li a:hover { color: var(--dark); }

/* =========================================================
   SINGLE POST
   ========================================================= */
.single-layout { background: var(--bg-card); border-radius: var(--radius); padding: 28px 30px 34px; border: 1px solid var(--border); }
.single-layout h2 { font-size: 2rem; margin-bottom: 6px; }
.single-featured-image { margin-bottom: 20px; border-radius: var(--radius); overflow: hidden; }
.single-featured-image img {
    display: block;
    width: 100%;
    height: auto;   /* paired with the img's own width/height attributes, this lets the browser reserve the correct aspect-ratio box before the file loads */
    max-height: 460px;
    object-fit: cover;
    background: var(--bg-light);
}
.single-content-body { font-size: 1.02rem; color: var(--text-light); line-height: 1.85; }
.single-content-body p { margin-bottom: 16px; }
.single-content-body img { border-radius: var(--radius); margin: 18px 0; }
.single-content-body h2, .single-content-body h3 { color: var(--text); margin: 26px 0 12px; }

/* Author box — fixed for legible contrast on dark backgrounds */
.author-box {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    background: var(--dark);
    color: #f2f5f3;              /* light text on dark bg — was dark-on-dark before */
    border-radius: var(--radius);
    padding: 18px 20px;
    margin-top: 26px;
}
.author-box img { border-radius: 50%; width: 56px; height: 56px; flex-shrink: 0; }
.author-box h3 { color: #ffffff; margin-bottom: 4px; }
.author-box p { color: rgba(255,255,255,0.78); font-size: 0.9rem; margin: 0; }

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
    background: var(--dark);
    color: rgba(255,255,255,0.72);   /* light-on-dark, readable throughout footer */
    margin-top: 44px;
    padding: 36px 0 0;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 28px;
    padding-bottom: 26px;
}
.footer-col h3 {
    color: #ffffff;
    font-family: var(--font-body);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}
.footer-col ul { list-style: none; }
.footer-col ul li { padding: 4px 0; }
.footer-col ul li a { color: rgba(255,255,255,0.68); font-size: 0.88rem; }
.footer-col ul li a:hover { color: var(--gold-light); }
.footer-brand p { font-size: 0.88rem; color: rgba(255,255,255,0.65); max-width: 320px; margin-top: 8px; line-height: 1.6; }

.copyright-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    border-top: 1px solid rgba(255,255,255,0.12);
    padding: 16px 0;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.6);
}

/* =========================================================
   MOBILE MENU TOGGLE (used by header.php + theme.js)
   ========================================================= */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    padding: 4px;
}
.menu-toggle span { width: 24px; height: 2.5px; background: var(--dark); border-radius: 2px; display: block; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1024px) {
    .site-layout { grid-template-columns: 1fr; }
    .hero-section { grid-template-columns: 1fr; }
    .hero-side-grid { flex-direction: row; }
    .articles-grid-view { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
    .header-inner { flex-wrap: wrap; }
    .menu-toggle { display: flex; }
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        left: 0; right: 0;
        background: var(--dark-2);
        z-index: 50;
    }
    .nav-links.open { display: flex; }
    .nav-links li a { border-bottom: 1px solid rgba(255,255,255,0.08); }
    .hero-side-grid { flex-direction: column; }
    .hero-small a:first-child { width: 100px; }
    .articles-grid-view { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; gap: 20px; }
    .single-layout { padding: 20px; }
    .author-box { flex-direction: column; align-items: center; text-align: center; }
}
@media (max-width: 480px) {
    .container { padding: 0 14px; }
    .hero-big img { height: 220px; }
}

.sr-only {
    position: absolute !important;
    width: 1px !important; height: 1px !important;
    padding: 0 !important; margin: -1px !important;
    overflow: hidden !important; clip: rect(0,0,0,0) !important; border: 0 !important;
}
