/* css/blog.css - Core Styling (Bright Professional Light Theme) */

/* --- GLOBAL RESET & VARIABLES --- */
:root {
  /* --- BACKGROUNDS --- */
  --bg-body: #fdfefe;
  /* Bright off-white */
  --bg-card: #ffffff;
  /* Pure White */
  --bg-header: #ffffff;
  --bg-input: #f8f9fa;
  --bg-secondary: #f1f5f9;
  /* Light blue-grey for secondary sections */

  /* --- ACCENT COLORS --- */
  --primary-blue: #004d99;
  --primary-glow: rgba(0, 77, 153, 0.15);

  /* --- TEXT COLORS --- */
  --text-main: #1a1a1a;
  --text-muted: #5c6773;

  /* --- BORDERS & SHADOWS --- */
  --border-color: #e2e8f0;
  /* Standardized border color */
  --border-highlight: #004d99;

  /* --- DATA COLORS --- */
  --success-green: #10b981;
  /* Modern Emerald Green */
  --danger-red: #ef4444;
  /* Modern Red */

  /* --- SHADOWS --- */
  --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-glow: 0 0 10px rgba(0, 77, 153, 0.15);
}

/* GLOBAL RESET for sizing stability */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  /* Prevent horizontal page scroll */
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* --- ANIMATIONS --- */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- HEADER SECTION --- */
.top-bar {
  background: linear-gradient(90deg, #0f172a 0%, #1e293b 100%);
  border-bottom: 1px solid var(--border-color);
  color: #cbd5e1;
  /* Lightened text for dark bg */
  padding: 8px 20px;
  display: flex;
  flex-wrap: wrap;
  /* Allows wrapping on small screens */
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  font-size: 0.85rem;
  gap: 10px;
}

.trading-tools-btn {
  background-color: var(--primary-blue);
  border: none;
  padding: 6px 14px;
  border-radius: 4px;
  font-weight: 600;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.trading-tools-btn a {
  text-decoration: none;
  color: #fff;
}

.trading-tools-btn:hover {
  background-color: #2563eb;
  box-shadow: 0 0 10px var(--primary-glow);
}

.utility-nav {
  display: flex;
  gap: 15px;
}

.utility-nav a {
  color: #cbd5e1;
  text-decoration: none;
  transition: color 0.2s;
  white-space: nowrap;
  margin: 5px;
}

.utility-nav a:hover {
  color: #fff;
}

/* --- MAIN NAV HEADER --- */
.header-main {
  background-color: var(--bg-header);
  padding: 3px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.logo a {
  display: block;
}

.logo img {
  height: 100px;
  /* Adjusted for better proportion */
  width: auto;
  display: block;
}

.main-nav {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.main-nav a {
  text-decoration: none;
  color: var(--text-main);
  font-weight: 600;
  font-size: 1rem;
  padding-bottom: 5px;
  border-bottom: 2px solid transparent;
  transition: all 0.3s ease;
  margin: 5px;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--primary-blue);
  border-bottom: 2px solid var(--primary-blue);
}

/* --- TICKER BAR --- */
#stock-ticker-container {
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 8px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.stock-header-container {
  flex-grow: 1;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  /* Firefox */
  -ms-overflow-style: none;
  /* IE */
  mask-image: linear-gradient(to right, transparent, black 2%, black 98%, transparent);
  /* Fade effect edges */
}

.stock-header-container::-webkit-scrollbar {
  display: none;
  /* Chrome/Safari */
}

.ticker-row {
  display: inline-block;
  margin-right: 20px;
}

.stock-item {
  margin-right: 15px;
  font-family: 'Consolas', monospace;
  /* Monospace for numbers aligns better */
}

.stock-item.ticker-positive {
  color: var(--success-green);
}

.stock-item.ticker-negative {
  color: var(--danger-red);
}

.ticker-show-more-btn {
  background: #fff;
  color: var(--primary-blue);
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  margin-left: 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: bold;
  white-space: nowrap;
}

#tickerShowMoreBtn a {
  color: inherit;
  text-decoration: none;
}

/* --- MAIN LAYOUT (RESPONSIVE GRID) --- */
.content-wrapper {
  display: grid;
  /* Desktop Default: 3 Columns (Content takes 9 cols, Sidebar 3 cols) */
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 30px;
  max-width: 1200px;
  margin: 30px auto;
  padding: 0 20px;
  align-items: start;
  animation: fadeIn 0.6s ease-out;
}

/* Main Content Box */
#html-box-main {
  background: var(--bg-card);
  padding: 30px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  min-height: 500px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  /* Prevents internal content from breaking layout */
}

#html-box-main h1 {
  margin-top: 0;
  color: var(--text-main);
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 15px;
  font-size: 1.8rem;
  line-height: 1.2;
}

/* --- SIDEBAR --- */
#sidebar-container {
  position: sticky;
  top: 110px;
  /* Clears sticky header */
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: fit-content;
}

.sidebar-box {
  background: var(--bg-card);
  padding: 20px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-card);
}

.sidebar-box h4 {
  margin-top: 0;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
  margin-bottom: 15px;
  color: var(--primary-blue);
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 1px;
}

/* --- FEATURED CONTENT (Sidebar) --- */
.featured-card {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
  border-bottom: 1px solid var(--bg-secondary);
  padding-bottom: 15px;
  align-items: flex-start;
}

.featured-card:last-child {
  border-bottom: none;
}

.featured-thumb {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--bg-secondary);
  flex-shrink: 0;
}

.featured-info h5 {
  margin: 0 0 5px 0;
  font-size: 0.95rem;
  line-height: 1.4;
}

.featured-info h5 a {
  text-decoration: none;
  color: var(--text-main);
  transition: color 0.2s;
}

.featured-info h5 a:hover {
  color: var(--primary-blue);
}

.featured-tag {
  font-size: 0.7rem;
  color: var(--primary-blue);
  background: rgba(0, 77, 153, 0.08);
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
  display: inline-block;
}

/* --- FOOTER --- */
.bottom-cta-box {
  background: #0f172a;
  /* Dark Footer */
  border-top: 1px solid var(--border-color);
  color: #94a3b8;
  padding: 60px 20px;
  margin-top: 60px;
  text-align: center;
}

.footer-description {
  max-width: 600px;
  margin: 0 auto 25px;
  font-size: 1rem;
  line-height: 1.6;
}

.telegram-link {
  background: #229ED9;
  color: white;
  padding: 14px 30px;
  border-radius: 50px;
  text-decoration: none;
  display: inline-block;
  margin-top: 10px;
  font-weight: bold;
  box-shadow: 0 4px 15px rgba(34, 158, 217, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}

.telegram-link:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(34, 158, 217, 0.6);
}

.footer-bottom {
  margin-top: 40px;
  font-size: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 20px;
}

/* --- MOBILE MENU --- */
#mobile-menu-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--bg-body);
  /* Fixed contrast */
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
}

#mobile-menu-overlay {
  position: fixed;
  top: 0;
  right: -100%;
  width: 280px;
  height: 100vh;
  background-color: var(--bg-card);
  box-shadow: -5px 0 25px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 25px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

#mobile-menu-overlay.open {
  right: 0;
}

#close-menu-btn {
  align-self: flex-end;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  margin-bottom: 20px;
}

.mobile-nav-links a {
  display: block;
  padding: 15px 0;
  color: var(--text-main);
  text-decoration: none;
  border-bottom: 1px solid var(--border-color);
  font-size: 1.1rem;
  font-weight: 500;
}

/* Helpers */
.mobile-only {
  display: none;
}

.desktop-only {
  display: block;
}

/* --- RESPONSIVE BREAKPOINTS --- */

/* Tablet & Smaller Desktop (Max 1024px) */
@media (max-width: 1024px) {
  .content-wrapper {
    gap: 20px;
    grid-template-columns: 1fr 260px;
    /* Slightly narrower sidebar */
  }
}

/* Mobile & Small Tablet (Max 900px) */
@media (max-width: 900px) {
  .desktop-only {
    display: none;
  }



  .mobile-only {
    display: block;
  }

  /* Stack layout vertically */
  .content-wrapper {
    grid-template-columns: 1fr;
    margin: 20px auto;
    padding: 0 15px;
  }

  /* Sidebar moves to bottom */
  #sidebar-container {
    order: 2;
    position: static;
    /* No longer sticky */
    margin-top: 20px;
  }

  #html-box-main {
    order: 1;
    padding: 20px;
  }

  .header-main {
    flex-wrap: wrap;
    gap: 15px;
    padding: 15px;
  }

  .logo img {
    height: 50px;
  }

  .trading-tools-btn {
    width: 100%;
    margin-top: 5px;
    text-align: center;
  }
}

/* Small Mobile (Max 480px) */
@media (max-width: 480px) {
  #html-box-main h1 {
    font-size: 1.5rem;
  }

  .top-bar {
    justify-content: center;
    position: sticky;
  }

  /* Fix ticker text size */
  #stock-ticker-container {
    font-size: 0.75rem;
  }
}