:root {
  --bg-dark: #101518;
  --bg-darker: #14181c;
  --accent-green: #00aa76;
  --accent-yellow: #ffd400;
  --text-white: #ffffff;
  --text-gray: #ccc;
  --font-primary: 'DM Sans', sans-serif;
  --header-bg: rgb(16, 21, 24);
  --input-text: rgb(240, 243, 245);
  --nav-link-color: rgb(203, 213, 225);
  --mail-btn-color: rgb(159, 215, 255);
}

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,wght@0,400;0,500;0,700;1,400&display=swap');

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-white);
  font-family: var(--font-primary);
  line-height: 1.6;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
header {
  background-color: var(--header-bg);
  padding: 0;
  border-bottom: 1px solid #333;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100px;
  max-width: 1260px;
  /* Reduced from 1400px for tighter feel */
  margin: 0 auto;
  padding: 0 20px;
}

.left-section {
  display: flex;
  align-items: center;
  flex: 1;
  /* Allow to grow */
}

/* Replaced .finance-logo with text styles in HTML but kept generic fallback if needed */
/* Logo image is styled inline in HTML or via generic img rules */

.search-bar-container {
  display: flex;
  align-items: center;
  margin-left: 20px;
  position: relative;
  max-width: 400px;
  /* Reduced max-width */
  width: 100%;
}

.search-input {
  background-color: #1e2429;
  /* Explicit dark color */
  border: 1px solid #333;
  /* Subtle border */
  color: var(--input-text);
  padding: 8px 15px;
  padding-right: 60px;
  border-radius: 4px;
  width: 100%;
  /* Fill container */
  height: 32px;
  /* Slightly smaller height */
  font-size: 13px;
  outline: none;
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;
  border-top-right-radius: 100px;
  border-bottom-right-radius: 100px;
}

.search-button {
  background-color: var(--accent-green);
  border: none;
  width: 40px;
  /* Smaller button */
  height: 32px;
  border-top-right-radius: 100px;
  border-bottom-right-radius: 100px;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  position: absolute;
  right: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-button svg {
  fill: white;
  width: 14px;
  /* Smaller icon */
  height: 14px;
}

.nav-links {
  display: flex;
  gap: 15px;
  /* Increased gap */
  margin-left: 20px;
}

.nav-links a {
  color: var(--nav-link-color);
  font-weight: 700;
  font-size: 13px;
  /* Smaller font */
  padding: 6px 8px;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
}

.nav-links a:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
}

.right-section {
  display: flex;
  align-items: center;
  gap: 15px;
}

.icon-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.bell-icon svg {
  fill: white;
  width: 20px;
  height: 20px;
}

.mail-btn {
  color: var(--mail-btn-color);
  border: 1px solid var(--mail-btn-color);
  background: transparent;
  padding: 5px 15px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  text-decoration: none;
}

.mail-btn svg {
  fill: var(--mail-btn-color);
  width: 14px;
  height: 14px;
}

.signin-btn {
  color: white;
  border: 1px solid white;
  background: transparent;
  padding: 5px 15px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

/* Main Content */
main {
  padding: 40px 0;
}

.headline {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 20px;
  line-height: 1.2;
}

.subheadline {
  font-size: 1.2rem;
  color: var(--text-gray);
  margin-bottom: 30px;
}

.hero-section {
  margin-bottom: 40px;
}

.article-body {
  max-width: 800px;
  margin: 0 auto;
}

h2 {
  font-size: 1.8rem;
  margin-top: 40px;
  margin-bottom: 20px;
  color: var(--accent-yellow);
}

.cta-button {
  display: inline-block;
  background-color: #d32f2f;
  color: white;
  padding: 15px 30px;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: 5px;
  margin: 20px 0;
  transition: opacity 0.3s;
  width: 100%;
  text-align: center;
}

.cta-button:hover {
  opacity: 0.9;
}

/* Comments */
.comments-section {
  margin-top: 60px;
  background-color: var(--bg-darker);
  padding: 30px;
  border-radius: 10px;
}

.comment {
  display: flex;
  margin-bottom: 20px;
  border-bottom: 1px solid #333;
  padding-bottom: 20px;
}

.avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  margin-right: 15px;
  background-color: #333;
}

.comment-content h4 {
  color: var(--accent-green);
  margin-bottom: 5px;
}

.comment-meta {
  font-size: 0.9rem;
  color: #666;
  margin-top: 5px;
}

/* Mobile Optimization */
@media screen and (max-width: 768px) {
  .header-inner {
    height: auto !important;
    flex-wrap: wrap;
    padding: 10px;
  }

  /* Left section needs to wrap its contents */
  .left-section {
    flex-wrap: wrap;
    justify-content: space-between;
    width: 100%;
  }

  .finance-logo img {
    height: 40px !important;
    /* Resize for mobile */
  }

  /* Force search bar to new line full width */
  .search-bar-container {
    order: 3;
    /* Push to bottom of flex container */
    max-width: 100%;
    margin-left: 0;
    margin-top: 15px;
  }

  /* Hide regular nav links on mobile to save space */
  .nav-links {
    display: none;
  }

  /* Right section optimization */
  .right-section {
    position: absolute;
    top: 25px;
    /* Align with reduced logo height */
    right: 15px;
  }

  .bell-icon,
  .mail-btn {
    display: none;
    /* Hide extra icons on small screens */
  }
}