html {
  font-size: 1rem;
}

body {
  font-family: 'Baloo 2', sans-serif;
  background-color: #fff6ea;
  /* matches popup body */
  margin: 0;
  padding: 0;
}

.header-container {
  background-color: #941b1b;
  justify-content: center;
}

#header {
  color: #fff;
  max-width: 1280px;
  padding-left: 2rem;
  /* Already set */
  padding-right: 2rem;
}

#header h1 {
  margin: 0;
  font-size: 3rem;
  font-weight: 900;
  /* Optional: make it bold */
  letter-spacing: 0.05em;
  /* Optional: add some spacing */
}

#header h1 span.align-start {
  font-size: inherit;
  /* matches the h1 size */
  font-weight: 900;
}

nav a {
  color: #d9ba57;
  margin-left: 16px;
  text-decoration: none;
  font-weight: bold;
  font-size: 1.25rem;
}




nav a:hover {
  color: #ffe28a;
  /* lighter yellow on hover */
}

/* Active link styling */
nav a.active {
  color: #ffffff;
  /* white when active */
  font-weight: bold;

  /* bigger */
  pointer-events: none;
  cursor: default;
  text-decoration: none;
}

.nav-link.disabled {
  pointer-events: none;
  color: #d9ba57;
  opacity: 0.6;
  text-decoration: none;
}

.grid-wrapper {
  display: grid;
  grid-template-columns: 1.5fr 3fr 1.5fr;
  gap: 1rem;
  max-width: 1280px;
  margin: 0 auto;

  box-sizing: border-box;
  align-items: start;
  align-self: flex-start;
}

.column {
  padding: 0rem;
  display: flex;
  flex-grow: 1;
  /* Allow column to grow */
  min-width: 0;
  /* Prevent flexbox shrinking issues */
  flex-direction: column;
  justify-content: flex-start;
}

.grid-wrapper>.column:first-child {
  padding-right: 0rem;
  /* add some padding to right of left column */
}

.grid-wrapper>.column:nth-child(2) {
  padding-left: 1rem;
  /* add left padding inside middle column */
  padding-right: 1rem;
  /* add right padding inside middle column */
  width: 100%;
  /* ensure it fills the grid cell */
  box-sizing: border-box;
  margin-top: 0;
  /* or margin-top: 5px; for a little spacing */
}

.grid-wrapper>.column:last-child {
  border: 2px solid red;
  display: flex;
  flex-direction: column;
  padding-left: 1rem;
  /* or any color you like */
  /* or use outline if you don't want to affect layout */
  /* outline: 2px solid red; */
}

.poll-header-style {
  color: #bb322a;
  /* matches #pollTitle color */
  font-size: 2rem;
  /* matches #pollTitle font size */
  font-weight: bold;
  /* matches #pollTitle weight */
  font-family: 'Baloo 2', sans-serif;
  margin-bottom: 1rem;
  /* optional, for all caps style */
}

.column h3 {
  margin-top: 20px;
  text-align: center;
}

ul.recent-polls {
  list-style: none;
  padding: 0;
}

ul.recent-polls li {
  margin: 10px 0;
}

.poll-box {
  width: 100%;
  /* force poll box to fill the column */
  box-sizing: border-box;
  background: #fff8f2;
  /* same as trending items */
  border-radius: 12px;
  padding: .5rem 1.25rem;
  margin-top: 0;
  padding-top: 1rem;
  /* optional, to add some breathing room */
  margin-bottom: 0;
  /* remove bottom margin so box wraps content tightly */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
  border-bottom: 1px solid #ddd;
  transition: box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  /* make sure it aligns to the top inside the grid cell */
  align-self: start;
  justify-content: flex-start;
  /* Push content apart vertically */
  height: auto;
  /* Make sure the box can stretch fully */
}

.poll-box .show-more-link {
  display: block;
  text-align: center;
  margin-top: 1rem;
  font-weight: bold;
  color: #bb322a;
  cursor: pointer;
  text-decoration: none;
  margin-left: auto;
  /* or use text-align:right if you want */
  margin-bottom: 0.25rem;
  /* reduce bottom space */
  display: block;
  /* ensure block to respect margins */
}

.poll-box>*:first-child {
  margin-top: 0;
}

/* Make sure form fills the container */
.poll-box form#pollForm {
  width: 100%;

  /* add some spacing above form */
  box-sizing: border-box;
}

.poll-box:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.poll-option {
  background-color: #fcd28c;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin: .25rem 0;
  font-weight: bold;
  align-items: center;
  gap: 1rem;
  display: flex;
  gap: 12px;
  /* space between radio button and label */
}

.poll-option label {
  font-weight: 700;
  font-size: 1.1rem;
  color: black;
  /* make text black */
  cursor: pointer;
  user-select: none;
}

.poll-results {
  width: 100%;
  box-sizing: border-box;
  margin-top: 1rem;
  filter: blur(6px);
  pointer-events: none;
  transition: filter 0.3s ease;
}

.poll-results.revealed {
  filter: none;
  pointer-events: auto;
}

.poll-winners-header {
  font-size: 2rem;
  /* Example size smaller than .poll-header-style */
  color: #bb322a;
  /* Same theme color */
  margin-bottom: 1rem;
  /* Spacing below */
  font-weight: 600;
  /* Slightly lighter than bold */
  /* Add or adjust other styles as you want */
}

/* Other header styles above */
.poll-header-style,
.poll-header-text,
.poll-winners-header {
  font-size: 2rem !important;
  font-weight: bold !important;
  margin-bottom: 1rem !important;
}

/* More styles below */
.poll-footer {
  text-align: center;
  margin-top: 1rem;
  font-style: italic;
  color: #333;
}


.divider {
  border: none;
  border-top: 1px solid #ddd;
  margin: 1rem 0;
}

.bar {
  position: relative;
  background-color: #fcfffb;
  /* Brand red background */
  padding: 0.75rem 1rem;
  margin: 0.5rem 0;
  font-weight: bold;
  border-radius: 8px;
  overflow: visible;
  white-space: nowrap;
  max-width: 100%;
  box-sizing: border-box;
  border: 1px solid #fcd28c;
  /* same brand red border */
  color: black;
  /* Text color */
}

.bar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  /* darker border */
  border-radius: 8px;
  pointer-events: none;
  box-sizing: border-box;
  z-index: 0;
}

.bar-fill {
  display: inline-block;
  background-color: #fcd28c;
  /* Peach fill color */
  border-radius: 6px;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  white-space: nowrap;
  transition: width 0.5s ease;
  pointer-events: none;
  /* So it doesn't interfere with text selection */
}

/* Make sure text inside bar is above the fill */
.bar>span.bar-label {
  position: relative;
  z-index: 1;
}

.bar-label {
  position: relative;
  z-index: 1;
  padding-left: 0.75rem;
  /* padding so text doesn't touch left edge */
  color: #000;
  /* black text */
  white-space: nowrap;
}



#overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.4);
  /* black with 40% opacity */
  z-index: 1000;
  /* just under popup */
  display: none;
  /* hide by default */
}


.popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1002;
  background-color: #fff6ea;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  font-family: 'Baloo 2', cursive, sans-serif;
  width: 90%;
  max-width: 460px;
  text-align: center;
  white-space: normal !important;
  /* allow wrap properly */
}

/* Header section */
.popup-header {
  background-color: #941b1b;
  color: white;
  font-size: 2rem;
  font-weight: 900;
  padding: 1.25rem 1rem;
  margin: 0;
  border-radius: 12px 12px 0 0;
  /* Rounded top corners */
  border: 3px solid #fff6ea;
  /* example border color and thickness */
  user-select: none;
}

/* Subheader text */
.popup-subheader {
  font-size: 1.25rem;
  color: #333;
  padding: 1rem 1.5rem 0.5rem;
  font-weight: 600;
  word-wrap: break-word;
  /* break long words if needed */
  word-break: break-word;
  /* good fallback */
  white-space: normal;
  /* allow normal wrapping */
  max-width: 350px;
  /* temporary test */
  margin: 0 auto;
  overflow-wrap: break-word;
  hyphens: auto;
  text-align: center;
}

.popup-image-container {
  display: flex;
  justify-content: center;
  /* centers horizontally */
  align-items: center;
  /* centers vertically */
  margin: 1rem 0;
  /* spacing above and below */
}

.popup-image-container img {
  max-width: 200px;
  /* or whatever fits nicely */
  height: auto;
  display: block;
}


/* CTA text */
.popup-cta {
  font-size: 1.25rem;
  /* better break for long words */
  color: #555;
  padding: 0 1.5rem 1.5rem;
  word-wrap: break-word;
  /* break long words if needed */
  word-break: break-word;
  /* good fallback */
  white-space: normal;
  /* allow normal wrapping */
  max-width: 300px;
  /* temporary test */
  margin: 0 auto;
  overflow-wrap: break-word;
  hyphens: auto;
  text-align: center;
  font-weight: 600;
}

.popup-header h3 {
  margin: 0;
  /* 🔥 THIS is what’s probably pushing it */
}

.popup-buttons {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  max-width: 360px;
  margin: 0 auto;
  padding: 0 1rem;
  /* ✅ Adds space on the sides */
  box-sizing: border-box;
  padding-bottom: 1rem;

}

.popup-buttons button {
  flex: 1;
  padding: 0.75rem;
  border-radius: 8px;
  font-weight: bold;
  font-size: 1rem;
  cursor: pointer;
}

.popup,
#emailPopup {
  background-color: #fff6ea;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  color: #333;
  font-family: 'Baloo 2', sans-serif;
  max-width: 420px;
  width: 90%;
  text-align: center;
  z-index: 1002;
}

.popup input[type="email"] {
  width: 100%;
  max-width: 300px;
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 1rem;
  box-sizing: border-box;
}

/* Form */
#emailCaptureForm {
  padding: 0 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  max-width: 360px;
  /* ✅ Added */
  width: 100%;
  margin: 0 auto;
  /* ✅ Optional: centers it horizontally */
}


/* Email input */
#emailCaptureInput {
  width: 100%;
  max-width: 320px;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border-radius: 8px;
  border: 1.5px solid #ccc;
  transition: border-color 0.3s ease;
}

#emailCaptureInput:focus {
  outline: none;
  border-color: #bb322a;
  box-shadow: 0 0 6px rgba(187, 50, 42, 0.5);
}

.button-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

#submitEmailBtn,
#noThanksBtn {

  padding: 0.75rem 1.25rem;
  font-size: 1rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: bold;
}

#submitEmailBtn {
  background-color: #bb322a;
  color: white;
  font-weight: bold;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1rem;
  flex: 1;
}

#submitEmailBtn:hover {
  background-color: #a02a23;
  /* slightly darker on hover */
}


#noThanksBtn {
  background-color: #ccc;
  color: #333;
}

button {
  background: #d1382f;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  margin-top: 1rem;
}

button:hover {
  background: #a62620;
}

.checkmark {
  display: inline-block;
  width: 1em;
  height: 1em;
  margin-right: 0.5em;
  background-color: #bb322a;
  /* Dark red color */
  mask: url('data:image/svg+xml;utf8,<svg fill="white" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M6.173 13.727L1.146 8.7l1.414-1.414 3.613 3.613 7.613-7.613 1.414 1.414z"/></svg>') no-repeat center;
  -webkit-mask: url('data:image/svg+xml;utf8,<svg fill="white" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M6.173 13.727L1.146 8.7l1.414-1.414 3.613 3.613 7.613-7.613 1.414 1.414z"/></svg>') no-repeat center;
  mask-size: contain;
  -webkit-mask-size: contain;
}

.finished-header {
  text-align: center;
  margin-top: 0rem;
}

.finished-header p {
  font-size: 1rem;
  color: #333;
  margin-top: 0;
}

#pollHeader {
  font-size: 2rem;
  color: #bb322a;
  /* match your theme */
  margin-bottom: 0;
  font-family: 'Baloo 2', cursive;
}


.poll-header-container {
  padding-bottom: 0;
  /* Thick red underline for emphasis */
  text-align: center;
}

.poll-header-text {
  font-family: 'Baloo 2', cursive;
  font-size: 3rem;
  /* Big font size */
  font-weight: 900;
  /* Very bold */
  color: #bb322a;
  /* Your brand red */
  margin-bottom: 1rem;

}

.poll-title {
  font-size: 2.5rem;
  /* smaller than main header */
  font-weight: 700;
  color: #bb322a;
  font-family: 'Baloo 2', cursive;
  margin-top: 0.5rem;
  margin-bottom: 0rem;
  text-align: center;
}


#pollTitle,
#pollSubtitle {
  text-align: center;
  margin-left: 0;
  padding-left: 0;
}

#pollSubtitle {
  margin-top: 0rem;
  /* adjust as needed */
  margin-bottom: 1rem;
  /* optional */
  font-size: 1.25rem;
  /* Half of title size */
  color: #333;
}

.winner-bar {
  background-color: #ffe6e6;
  /* light red highlight */
  color: #b22222;
  font-weight: bold;
  border: 2px solid #b22222;
}

.winner-badge {
  margin-left: 10px;
  font-size: 0.85em;
  background-color: #fff5f5;
  color: #b22222;
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: 600;
  text-shadow: none;
}

/* Homepage-only New & Trending styles */
.trending-column h3 {
  margin-top: 1.5rem;
  /* add to push left box down */
}

.trending-column #trending {
  font-size: 0.95rem;
  line-height: 1.4;
}

.trending-column .trending-item {
  display: flex;
  align-items: center;
  background: #fff8f2;
  border-radius: 12px;
  padding: 0.5rem 1rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
  transition: box-shadow 0.3s ease;
  border-bottom: 1px solid #ddd;
  /* Adds a subtle line below each item */
}

.trending-column .trending-item-img {
  display: none !important;
  max-width: 150px;
  height: auto;
  margin-right: 1rem;
  border-radius: 8px;
}

.trending-column .trending-item:last-child {
  border-bottom: none;
}

.trending-column .trending-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.trending-column .trending-item-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #bb322a;
  margin-bottom: 0.5rem;
  font-family: 'Baloo 2', cursive;
}

.trending-column .trending-item-desc {
  font-size: 1rem;
  font-weight: normal;
  line-height: 1.5;
  color: #333;
  font-family: 'Baloo 2', sans-serif;
  margin-top: 0;
}

.trending-column .show-more-link {
  display: inline-block;
  margin: 0.5rem 0 1.5rem;
  color: #bb322a;
  font-weight: bold;
  cursor: pointer;
  text-decoration: none;
}

#trending-page #trending {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  /* two equal columns */
  gap: 1.5rem;
  max-width: 1100px;
  /* increase max width */
  margin: 0 auto;
  padding: 1rem;
  font-size: 1rem;
  line-height: 1.3;
}

#trending-page .trending-item {
  display: flex;
  align-items: flex-start;
  background: #fff8f2;
  border-radius: 12px;
  padding: 0.5rem 0.75rem;
  /* reduce vertical padding for shorter height */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
  border-bottom: 1px solid #ddd;
  transition: box-shadow 0.3s ease;
  height: auto;
  min-height: 120px;
  /* optionally set a min height */
  align-items: center;
  /* This vertically centers the image and text */
}

#trending-page .trending-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

#trending-page .trending-item-text {
  flex: 1;
  /* keep taking up remaining space */
  padding-right: 1rem;
  /* add right padding for spacing */
  /* Optional: add some left padding if needed */
  /* padding-left: 0.5rem; */
  height: auto;
  /* allow height to grow */
  overflow: visible;
  /* default, but make sure no 'hidden' */
}

#trending-page .trending-item-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #bb322a;
  margin-top: 0;
  margin-bottom: 0.3rem;
  /* reduce bottom margin */
  font-family: 'Baloo 2', cursive;
  height: auto;
  /* allow height to grow */
  overflow: visible;
  /* default, but make sure no 'hidden' */
}

#trending-page .trending-item-desc {
  font-size: 1rem;
  color: #333;
  font-family: 'Baloo 2', sans-serif;
  margin: 0;
  /* limits description height roughly to 3 lines */
  overflow: hidden;
  text-overflow: ellipsis;
  padding-bottom: 1rem;
}

#trending-page .trending-item-img {
  display: block !important;
  min-width: 200px;
  max-width: 250px;
  /* slightly smaller image width */
  max-height: 300px;
  margin-right: 1rem;
  border-radius: 8px;
  padding: 0.2rem;
  flex-shrink: 0;
  object-fit: contain;
  /* keep aspect ratio */
}

.trending-item-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.trending-item-link .trending-item {
  cursor: pointer;
  transition: box-shadow 0.2s ease;
}

.trending-item-link .trending-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}


.closed-poll-link {
  font-weight: 700;
  /* Bold */
  color: #bb322a;
  /* Same accent color as trending titles */
  font-family: 'Baloo 2', cursive;
  /* Same font */
  font-size: 1.15rem;
  /* Same size as trending titles */
  text-decoration: none;
  /* Remove underline */
  margin-bottom: 0.5rem;
  display: inline-block;
  /* So margin-bottom works */
}

.closed-poll-link:hover {
  text-decoration: none;
  /* Optional hover effect */
}

#closedPollsList li {
  border-bottom: 1px solid #ddd;
  padding-bottom: 0.5rem;
  margin-bottom: 0.5rem;
}

#closedPollsList li:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

ul#closedPollsListRight {
  list-style-type: none;
  /* Removes bullets */
  padding-left: 0;
  /* Removes default left padding */
  margin: 0;
  /* Optional: reset margin if needed */
}

.poll-date {
  font-size: 1.5rem;
  font-weight: normal;
  display: block;
  margin-top: 0.3rem;
}

/* Base: Desktop & larger */
nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  /* Left-align on desktop */
  align-items: center;
  gap: 1rem;
  padding: 0.5rem;
  text-align: left;
  width: 100%;
  /* Ensure nav takes full width */
}

nav a {
  color: #d9ba57;
  text-decoration: none;
  font-weight: bold;
  font-size: 1.25rem;
  margin: 0;
  /* Remove all spacing that could shift links */
}

/* Desktop & Larger */
@media (min-width: 481px) {
  nav a:first-child {
    margin-left: 65px;
  }
}

/* Mobile: ≤480px */
@media (max-width: 480px) {
  nav {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
  }

  nav a {
    font-size: 1rem;
    margin: 0.25rem 0;
    /* Vertical spacing between links */
  }
}

/* Tablet: ≤900px */
@media (max-width: 900px) {
  .grid-wrapper {
    grid-template-columns: 1fr;
  }

  .column {
    border: none;
    margin-bottom: 2rem;
  }
}

/* ✅ Global mobile layout fixes */
body {
  overflow-x: hidden;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ✅ Trending layout fixes for mobile */
@media (max-width: 600px) {
  body {
    overflow-x: hidden;
    padding: 0;
    margin: 0;
  }

  #homepage-trending {
    display: none !important;
  }





  /* Hide trending section on mobile poll results page */
  body.finished-page .trending-column,
  body.finished-page #trending {
    display: none !important;
  }

  .grid-wrapper {
    grid-template-columns: 1fr;
    padding: 0;
  }

  .column {
    padding: 0 1rem;
    margin-bottom: 2rem;
  }

  .trending-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 1rem;
    margin: 0 auto 1.5rem;
  }

  .trending-item-img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
  }

  .trending-item-text {
    text-align: center;
    padding: 0.5rem 0;
  }

  #trending-page #trending {
    grid-template-columns: 1fr;
    padding: 0 1rem;
    max-width: 100%;
    overflow-x: hidden;
  }

  #trending-page .trending-item-img {
    min-width: unset;
    max-width: 100%;
    height: auto;
    padding: 0;
  }
}