/* Root colors and base styles */
:root {
  --primary-color: #0069d9;
  --text-color: #212529;
  --bg-color: #ffffff;
  --secondary-color: #f8f9fa;
  --accent-color: #e9ecef;
}

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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text-color);
  background-color: var(--secondary-color);
  line-height: 1.6;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
}

/* Navbar */

header.navbar {
  background-color: var(--primary-color);
  padding: 1rem 0;
  color: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-left: 25px;
  padding-right: 25px;
}

.navbar-left-link {
  text-decoration: none;
  color: inherit;
  display: inline-block;
}

.navbar-left {
  display: flex;
  align-items: center;
}

.logo {
  width: 64px;
  height: 64px;
  margin-right: 0.5rem;
}

.brand-link {
  font-size: 2rem;
  line-height: 1;
  color: #fff;
  text-decoration: none;
}

.navbar-right ul {
  display: flex;
  gap: 1.25rem;
  list-style: none;
}

.navbar-right a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  font-size: 1.1rem;
  transition: color 0.3s ease;
}

.navbar-right a:hover {
  color: #cce6ff;
}

/* Hero section */

.hero {
  background-color: var(--accent-color);
  padding: 2rem;
  border-radius: 0.5rem;
  text-align: center;
  margin-bottom: 2rem;
}

.hero h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

.btn-primary {
  background-color: var(--primary-color);
  color: #fff;
  padding: 0.5rem 1.25rem;
  border-radius: 0.3rem;
  text-decoration: none;
  font-weight: 600;
  display: inline-block;
  transition: background-color 0.3s ease;
  cursor: pointer;
  border: none;
  text-align: center;
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: #0056b3;
  outline: none;
}

/* Yield table styles */

.table-container {
  overflow-x: auto;
}

.yield-table {
  width: 100%;
  border-collapse: collapse;
  background-color: #fff;
  border-radius: 0.4rem;
  overflow: hidden;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
  margin-top: 0.5rem;
}

.yield-table th,
.yield-table td {
  padding: 0.75rem 1rem;
  border: 1px solid #dee2e6;
  text-align: left;
}

.cta-row {
  display: flex;
  justify-content: flex-end;
  padding-top: 1rem;
}

/* Page container layout: left + right sidebar */

.page-container {
  display: flex;
  gap: 2rem;
  margin-top: 2rem;
  margin-bottom: 2rem;
  flex-wrap: wrap; /* Optional: allows wrapping on smaller screens */
}

/* Left content */

.left-content {
  flex: 2 1 0; /* grow:2, shrink:1, basis:0 — takes two parts */
  background: #f5f5f5;
  padding: 1rem;
  border-radius: 0.5rem;
  min-width: 280px; /* optional to keep it usable on narrow screens */
}

/* Right sidebar (recommend section) */

#recommend {
  flex: 1 1 0; /* takes 1 part of flex space */
  padding: 1rem;
  border-left: 1px solid #ddd;
  background: #fff;
  border-radius: 0.5rem;
  min-width: 0; /* ✅ Prevents overflow in some browsers */
}

/* Responsive: stack vertically on small screens */
@media (max-width: 768px) {
  .page-container {
    flex-direction: column;
  }
  #recommend {
    border-left: none;
    border-top: 1px solid #ddd;
    margin-top: 2rem;
    padding-top: 2rem;
  }
}

/* Quiz form */

#quiz-form {
  max-width: 300px;
  margin: 0 auto;
}

#quiz-form label {
  display: flex;
  flex-direction: column;
  margin-bottom: 1em;
  font-weight: 600;
  font-size: 1rem;
}

#quiz-form select {
  margin-top: 0.5em;
  padding: 0.4em;
  font-size: 1rem;
  border-radius: 0.3rem;
  border: 1px solid #ccc;
}

#quiz-form button {
  margin-top: 1em;
  padding: 0.5em 1em;
  font-size: 1rem;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 0.3rem;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.3s ease;
  width: 100%;
}

#quiz-form button:hover,
#quiz-form button:focus {
  background-color: #0056b3;
  outline: none;
}

@media (max-width: 768px) {
  #blog h3 {
    text-align: center;
  }
}


/* Blog list */

.blog-list article {
  margin-bottom: 1rem;
  background-color: #fff;
  padding: 1rem;
  border-radius: 0.5rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.blog-list h4 {
  margin-bottom: 0.5rem;
}

#blog .blog-list {
  margin-top: 0.5rem;
}


.blog-list a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.blog-list a:hover,
.blog-list a:focus {
  color: #0056b3;
  outline: none;
}

/* Subscribe section */

#subscribe {
  margin-top: 2rem;
}

#subscribe form {
  margin-top: 0.5rem;
}

#subscribe input[type="email"] {
  padding: 0.5rem;
  width: 60%;
  max-width: 400px;
  margin-right: 0.5rem;
  font-size: 1rem;
  border-radius: 0.3rem;
  border: 1px solid #ccc;
}

@media (max-width: 768px) {
  #subscribe-form {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    max-width: 100%;
  }

  #subscribe-form input[type="email"] {
    flex: 2;
    min-width: 0;
  }

  #subscribe-form button {
    flex: 1;
    min-width: 0;
  }
}



#subscribe button {
  padding: 0.5rem 1rem;
  background-color: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: 0.3rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  transition: background-color 0.3s ease;
}

#subscribe button:hover,
#subscribe button:focus {
  background-color: #0056b3;
  outline: none;
}

/* Footer */

footer {
  background-color: #343a40;
  color: #fff;
  text-align: center;
  padding: 1rem;
  margin-top: 2rem;
  font-size: 0.9rem;
}

/* Responsive adjustments */

@media (max-width: 768px) {

  /* Yield table: responsive block rows */
  .yield-table thead {
    display: none;
  }

  .yield-table tr {
    display: block;
    margin-bottom: 1rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 0.5rem;
  }

  .yield-table td {
    display: block;
    width: 100%;
    border: none;
    padding: 0.3rem 0;
  }

  .yield-table td:nth-child(1)::before {
    content: "Platform: ";
    font-weight: bold;
  }

  .yield-table td:nth-child(2)::before {
    content: "Type: ";
    font-weight: bold;
  }

  .yield-table td:nth-child(3)::before {
    content: "Yield: ";
    font-weight: bold;
  }

  .yield-table td:nth-child(4)::before {
    content: "Risk: ";
    font-weight: bold;
  }

  .yield-table td:nth-child(5) {
    text-align: center;
    padding-top: 0.5rem;
  }

  /* Right sidebar full width */
  #recommend {
    width: 100%;
    border-left: none;
    border-top: 1px solid #ddd;
    margin-top: 2rem;
    padding-top: 2rem;
  }

  #subscribe input[type="email"] {
    width: 100%;
    margin-right: 0;
  }

.related-news {
  background: #fff;
  padding: 1.5rem 2rem;
  border-radius: 0.5rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  font-size: 1rem;
  width: 100%; /* ✅ allow flexbox to control width */
}


.related-news h2 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 0.25rem;
}

.related-news-list {
  list-style: none;
  padding-left: 0;
}

.related-news-item {
  margin-bottom: 1rem;
  border-bottom: 1px solid #eee;
  padding-bottom: 0.5rem;
}

.related-news-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.related-news-link {
  font-weight: 600;
  font-size: 1rem;
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.3s ease;
  display: block;
  margin-bottom: 0.25rem;
}

.related-news-link:hover,
.related-news-link:focus {
  color: #004a99;
  text-decoration: underline;
  outline: none;
}

.related-news-date {
  font-size: 0.8rem;
  color: #666;
  font-style: italic;
}

/* Reuse your existing blog-list styles, but add slight margin tweaks */
.blog-list-article {
  margin-bottom: 1.25rem;
  background-color: #fff;
  padding: 1rem 1.25rem;
  border-radius: 0.5rem;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.3s ease;
}

.blog-list-article:hover,
.blog-list-article:focus-within {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  outline: none;
}

.blog-list-article h4 {
  margin-bottom: 0.3rem;
  font-size: 1.1rem;
}

.blog-list-article h4 a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.blog-list-article h4 a:hover,
.blog-list-article h4 a:focus {
  color: #0056b3;
  text-decoration: underline;
  outline: none;
}

.blog-list-article small {
  display: block;
  color: #666;
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
  font-style: italic;
}

.btn-mobile-chg {
}

@media (max-width: 768px) {
  .btn-mobile-chg {
    display: block;
    width: 100%;
  }
}

.blog-list-article p {
  font-size: 0.95rem;
  color: #444;
  line-height: 1.4;
  margin: 0;
}

  #subscribe-form {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    max-width: 100%;
  }

  #subscribe-form input[type="email"] {
    min-width: 0;
    padding: 8px;
    font-size: 1rem;
  }

  #subscribe-form button {
    padding: 8px 16px;
    font-size: 1rem;
    white-space: nowrap;
    cursor: pointer;
  }

  #subscribe h3 {
    text-align: center;
  }

  @media (max-width: 768px) {
  #recommend-heading {
    text-align: center;
  }
  #top-yields h3 {
    text-align: center;
  }
}


@media (max-width: 768px) {
  .left-content.related-news h2 {
    text-align: center;
  }

  #recommend-heading {
    text-align: center;
  }

  #top-yields h3 {
    text-align: center;
  }
}

/* ✅ Place global rule outside media query */
#news-section {
  max-width: 800px;
  margin: 0 auto;
}
}
