body {
  margin: 0;
  font-family: 'Lexend', sans-serif;
  background: #222;
  color: #ffffff;
}

/* Container side padding variable (easy global control) */
:root {
  --container-pad: 20px; /* default left/right padding for main containers */
  --stocks-offset: 40px; /* default right shift for .stocks (increased to separate from last-updated) */
  --last-updated-offset: 80px;
  --market-clock-offset: 120px;
  --content-max: 1200px; /* central content max width used by .blog and single article */
}

nav {
  background: #222;
  padding: 12px;
  text-align: center;
}

nav a {
  color: white;
  text-decoration: none;
  margin: 0 15px;
  font-weight: 500;
}

nav a:hover {
  color: #ffffff;
}

header {
  background: linear-gradient(135deg, #ffffff, #737373, #676767, #d6d6d6);
  background-size: 400% 400%; /* bigger size for smoother movement */
  color: white;
  text-align: center;
  padding: 40px 20px;
  animation: gradientShift 8s linear infinite; /* linear for steady motion */
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}


#search {
  width: 100%;
  max-width: 400px;
  padding: 10px 15px;
  margin: 20px auto 0 auto;
  display: block;
  border: none;
  border-radius: 10px;
  font-family: 'Lexend', sans-serif;
  font-size: 1rem;
}

.blog {
  max-width: var(--content-max);
  margin: 60px;
  display: grid;

  /* Use a CSS variable to control number of columns. Default to 3. */
  --cols: 3;
  gap: 25px 25px; /* vertical and horizontal gap between posts */
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
}

/* When on the single-article page, treat the `.blog#article` as a normal centered block instead of a grid */
#article.blog, #article {
  display: block;
  max-width: var(--content-max);
  margin: var(--container-top-pad,60px) auto;
  padding: 30 var(--container-pad);
}



.post {
  padding: 25px;
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}


.post a {
  text-decoration: none;
  font-weight: 600;
  color: #ffffff;
}

.post-image {
  width: 100%;
  height: auto;         /* fixed height for uniform cards */
  object-fit: fill;      /* scales and crops image nicely */
  border-radius: 10px;
  margin-bottom: 15px;
}

.post {
  background: #1a1a1a;
  padding: 25px;
  border-radius: 14px;
   box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease; /* smooth animation */
}




/* Single-article page: make post full-width, remove hover lift and grid-height rules */
#article .post {
  max-width: var(--content-max, 900px);
  margin: 40px auto;
  padding: 40px;
  height: auto; /* allow content to size naturally on article page */
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}



.info-section {
  max-width: 900px;
  margin: 40px auto;
  padding: 0 var(--container-pad);
}

/* Responsive container padding */
@media (max-width: 900px) {
  :root { --container-pad: 12px; }
}
@media (max-width: 600px) {
  :root { --container-pad: 8px; }
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Container */
.stocks {
  max-width:400px;
  /* place beside `.last-updated` */
  display: inline-block;
  vertical-align: top;
  width: calc(65% - var(--container-pad));
  margin: 40px 0 0 calc(var(--container-pad) + var(--stocks-offset));
  padding: 20px;
  background: #1a1a1a;  /* dark background */
  color: #fff;           /* white text */
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  font-family: 'Arial', sans-serif;
}


/* Each stock row */
.stock {
  display: flex;
  justify-content: space-between;
  padding: 5px 10px;
  margin-bottom: 5px;
  background: #333;          /* slightly lighter row */
  border-radius: 8px;
  transition: transform 0.1s, background 0.1s;
}



/* Stock name */
.stock-name {
  font-family: 'Lexend', sans-serif;
  font-weight: bold;
  font-size: 1rem;
}

/* Stock price */
.stock-price {
  font-size: 1rem;
  font-weight: bold;
  font-family: 'Lexend', sans-serif;
  color: #00FF00; /* green for prices */
}

.last-updated {
  
  max-width: 400px;
  /* place beside `.stocks` */
  display: inline-block;
  vertical-align: top;
  width: calc(35% - var(--container-pad));
  margin: 40px 0 0 var(--container-pad);
  padding: 10px;
  background: #1a1a1a;  /* dark background */
  color: #fff;           /* white text */
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  font-family: 'lexend', sans-serif;
  font-weight: bold;
    font-size: 0.9rem;


}
.market-clock {
  max-width: 400px;
  display: inline-block;          
  vertical-align: top;
  width: calc(35% - var(--container-pad));
  margin: 15px 0 0 var(--container-pad); /* smaller top margin so it sits under */
  padding: 10px;
  background: #1a1a1a;
  color: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  font-family: 'Lexend', sans-serif;
}

.clock-title {
  font-weight: bold;
  font-size: 1rem;
  color: #ffffff;
  margin-bottom: 8px;
}

#market-time {
  font-size: 0.9rem;
}

#market-status {
  font-size: 0.9rem;
  margin-top: 5px;
}

/* === MARKET LAYOUT === */
.market-row {
  display: flex;
  align-items: flex-start;
  gap: 25px;
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 var(--container-pad);
}

/* LEFT: stocks */
.market-row .stocks {
  flex: 2;
  margin: 0 !important;
}

/* RIGHT: stacked widgets */
.market-row .right-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* clean spacing */
.market-row .last-updated,
.market-row .market-clock {
  margin: 0 !important;
  width: 100%;
}

/* mobile stack */
@media (max-width: 800px) {
  .market-row {
    flex-direction: column;
  }
}
.right-column {
  display: flex;
  flex-direction: column;
}

.last-updated,
.market-clock {
  min-height: 50px;  /* pick the height you want */
}
