/* === BEGIN: Your original code (through PORTAL section) === */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', Arial, sans-serif;
}


/*
  SITE WIDE HEADER STYLING
*/

.header {
  background: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 25px 50px;
}

.header-logo {
  width: 150px;
}

.branding {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 50px;
}

.CHH-text {
  align-self: flex-end;
  font-size: 2.3rem;
  font-weight: 700;
  color: #1c3272;
  display: inline-block;
  padding-bottom: 3px;
  border-bottom: 2.5px solid #bae6c4;
}

nav {
  display: flex;
  gap: 16px;
  margin-left: auto;
}

.header-cta {
  font-family: Arial, sans-serif;
  font-size: 20px;
  color: #1B265F;
  text-decoration: none;
  padding: 8px 16px;
  border: 2px solid transparent;
  border-radius: 4px;
  transition: background-color 0.2s, color 0.2s;
  font-weight: 600;
}

.header-cta:hover {
  background-color: #1B265F;
  color: #ffffff;
}

/*
  SITE WIDE FOOTER STYLING
*/

.site-footer {
  background: #1B265F;
  color: #ffffff;
  text-align: center;
  padding: 20px 0;
  font-size: 14px;
  border-top: 5px solid black;
}

.site-footer p {
  margin: 0;
  font-weight: 400;
}

/*
  LANDING PAGE STYLING
*/

#landing-main {
  background: #D9D9D9;
  padding-bottom: 50px;
  display: flex;
  flex-direction: column;
}

.landing-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

#about-section {
  background: #1B265F;
  padding-bottom: 25px;
}

#how-to-section {
  background: #D9D9D9;
}

.landing-section-title {
  font-size: 40px;
  font-weight: 400;
  margin-bottom: 20px;
}

#about-section-title {
  color: white;
}

#how-to-section-title {
  color: #1B265F;
}

.landing-section-text {
  width: 885px;
}

.about-section-text {
  color: white;
}

.how-to-section-text {
  color: #1B265F;
}

#about-cta {
  margin: 20px 0 45px 0;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #1B265F;
  background: #D9D9D9;
  padding: 15px 50px;
  font-size: 20px;
  text-decoration: none;
  font-weight: 800;
  border-radius: 10px;
  transition: box-shadow 0.5s, color 0.5s;
}

#about-cta:hover {
  box-shadow: 3px 2px yellow;
}

/* 1. Container: line the cards up side‑by‑side */
#how-to-cards {
  margin-left: 250px;
  margin-right: 250px;
  display: flex;
  flex-direction: row;
  gap: 10px;
}

.how-to-card-container {
  width: 300px;
  height: 300px;
  perspective: 1000px;
}

.how-to-card-container:hover>.how-to-card {
  cursor: pointer;
  transform: rotateY(180deg);
}

.how-to-card {
  height: 100%;
  width: 100%;
  position: relative;
  transition: transform 1000ms;
  transform-style: preserve-3d;
}

.how-to-card-front,
.how-to-card-back {
  box-sizing: border-box;
  padding: 1rem;
  height: 100%;
  width: 100%;
  border-radius: 0.5rem;
  box-shadow: 0 0 5px 2px rgba(50, 50, 50, 0.25);
  position: absolute;
  background: white;
  backface-visibility: hidden;
}

/* ─── FRONT SIDE ─── */
.how-to-card-front {
  background: white;
  color: white;
  display: grid;
  grid-template-rows: auto 1fr;
  justify-items: center;
  align-items: center;
}

.how-to-card-front h2 {
  margin: 0;
  text-align: center;
  width: 100%;
  color: #1B265F;
}

.how-to-card-front img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* ─── BACK SIDE ─── */
.how-to-card-back {
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  background: white;
}

.how-to-card-title {
  color: #1B265F;
  font-size: 1.5rem;
  margin: 0 0 0.5rem 0;
  line-height: 1.2;
}

.how-to-card-text {
  width: 100%;
  height: auto;
  margin: 0;
  font-size: 1rem;
  line-height: 1.4;
  word-wrap: break-word;
}

/*
  PORTAL STYLING
*/

#portal-main {
  display: flex;
  flex-direction: column;
  max-width: 1200px;
  margin: 0 auto;
  gap: 24px;
  padding-bottom: 50px;
  min-height: 110vh;
}

.top-controls {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  gap: 20px;
  padding: 0 32px;
  background: white;
  padding: 10px 0;
  border-radius: 100px;
}

.top-controls button {
  flex: 1 1 0;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px 0;
  border: none;
  border-radius: 20px;
  font-size: 1.2rem;
  font-weight: 100;
  color: #fff;
  background: #1B265F;
  cursor: pointer;
  box-shadow: 0 4px 16px #0001;
  transition: background 0.15s;
}


#consumer-filter {
  background: #4CAF50;
  color: #FFFFFF;
}

#consumer-filter:hover {
  background: #3D8C40;
}

#cultivation-filter {
  background: #6B8E23;
  color: #FFFFFF;
}

#cultivation-filter:hover {
  background: #56721C;
}

#recovery-filter {
  background: #5DADE2;
  color: #FFFFFF;
}

#recovery-filter:hover {
  background: #4A8AB5;
}

#consumer-filter.active,
#cultivation-filter.active,
#recovery-filter.active {
  background: #1B265F;
  color: #E5E5E5;
}

#toggle-filters {
  background: white;
  border: 1px solid black;
  color: black;
  gap: 24px;
}

#toggle-filters img {
  width: 30px;
}

#sort-menu {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 1rem;
  max-width: 180px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}



.filters-panel-and-cards {
  display: flex;
  gap: 24px;
  padding: 0 32px;
}

.filters-panel {
  display: none;
  background: #fff;
  border: 1px solid #000;
  border-radius: 18px;
  padding: 24px 18px;
  box-shadow: 0 4px 16px #0001;
  width: 225px;
  transition: all 0.3s;
  position: sticky;
  top: 80px;
  align-self: flex-start;
  max-height: calc(100vh - 100px);
  /* tweak “100px” to match your header + padding */
  overflow-y: auto;
  /* enable mouse‑wheel (and swipe) scrolling */
  overscroll-behavior-y: contain;
}

.filters-panel.active {
  display: block;
}

.filter-section {
  margin-bottom: 26px;
}

.filter-section.collapsed label {
  display: none;
}

.filters-panel h3 {
  font-size: 1.08rem;
  font-weight: 600;
  color: #1B265F;
  margin: 10px 0;
  cursor: pointer;
  position: relative;
  padding-right: 1.5em;
}

.filters-panel h3::after {
  content: "▼";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%) rotate(0deg);
  transition: transform 0.2s ease;
}

.filter-section:not(.collapsed) h3::after {
  transform: translateY(-50%) rotate(-180deg);
}

.filters-panel label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 1rem;
  margin-bottom: 6px;
  cursor: pointer;
}

.filters-panel input[type="checkbox"] {
  accent-color: #36b363;
  width: 1.1em;
  height: 1.1em;
  cursor: pointer;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  flex: 1;
}

.card {
  background: #D9D9D9;
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 2px 8px #1828481a;
  transition: box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.card img {
  width: 90%;
  height: auto;
  object-fit: contain;
  border-radius: 20%;
}

.card--article img,
.card--study img {
  width: 80%;
  height: auto;
  border-radius: 5%;
}

.card:hover {
  box-shadow: 0 4px 18px #223b6e33;
}

.card h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #223b6e;
}

.store-links {
  display: flex;
  align-self: flex-start;
  align-items: center;
  gap: 0.5em;
}

.store-links a {
  display: flex;
  align-items: center;
  gap: 4px;
  border: none;
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.15s;
  font-size: 0.99rem;
  text-decoration: none;
}

.play-store {
  background: #A4C639;
}

.app-store {
  background: #2E2C2F;
}

.store-links a img {
  width: 19px;
  height: 19px;
  border-radius: 6px;
}

.store-rating {
  margin-left: auto;
  padding: 4px 8px;
  background: #FFE066;
  color: #333;
  font-weight: bold;
  border-radius: 12px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 4px;
}

.read-more {
  margin-top: 8px;
  align-self: flex-start;
  background: #1B265F;
  color: #fff;
  padding: 6px 14px;
  border-radius: 16px;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background 0.15s;
}

.read-more:hover {
  background: #374785;
}

.description {
  margin-top: 0;
  font-size: 1rem;
  color: black;
  line-height: 1.45;
}


#faq-main {
  min-height: 100vh;
  padding-bottom: 100px;
}

#faq-section-title {
  text-align: center;
  font-size: 60px;
}

.faq-item {
  width: 1000px;
  margin: 10px auto;
  text-align: left;
}

.faq-question {
  width: 100%;
  font-size: 20.5px;
  padding: 12px;
  background: white;
  border: none;
  border-top: 1px solid rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
  cursor: pointer;
  color: #1c3272;
  text-align: left;
}

.faq-category {
  max-width: 1000px;
  margin: 40px auto 10px;
  font-size: 3rem;
  font-weight: bold;
  color: #1c3272;
  text-align: left;
  border-bottom: 1px solid #ddd;
  padding-bottom: 6px;
}

.faq-answer {
  display: none;
  padding: 10px;
  background: #f9f9f9;
  border-left: 3px solid #1c3272;
  font-size: 0.95em;
}

.faq-item.open .faq-answer {
  display: block;
}

.faq-item.open .faq-arrow {
  transform: rotate(180deg);
}

#faq-body {
  color: #1c3272;
}

.faq-p {
  color: #1c3272;
}

/*
  CONTACT STYLING
*/

#contact-nameSection,
#contact-emailSection {
  width: 123%;
}

#contact-send-message-btn {
  font-weight: bold;
  color: white;
  width: 170px;
  height: 50px;
  background-color: rgb(100, 215, 85);
  border: none;
  font-size: 16px;
}

.contact-form-row {
  display: flex;
  gap: 23px;
  align-items: flex-start;
}

.contact-form-group {
  display: flex;
  flex-direction: column;
  margin-right: 10px;
}

#contact-phoneNumber {
  width: 200px;
}

#contact-reason {
  width: 250px;
}

#contact-body {
  font-size: 20px;
  color: #1c3272;
  margin: 0;
}

#contact-heading {
  font-size: 67px;
  border-bottom: 8.5px solid #bae6c4;
}

#contact-container {
  display: flex;
  gap: 0;
  /* no space between the two boxes */
  margin: 0;
  /* no top/bottom white margin */
  width: 100%;
  /* fill the viewport */
}

#contact-details,
#contact-form {
  margin: 0;
  /* kill those auto margins */
  flex: 1;
  /* each takes up half the width */
  box-sizing: border-box;
}

#contact-users-message {
  height: 250px;
  margin-top: 5px;
  width: 90%;
}

#contactUS-header {
  font-weight: bold;
  font-size: 50px;
  color: White;
  margin-top: auto;
  margin-bottom: auto;
}

/* Contact info section (left side) */
#contact-details {
  width: 600px;
  display: flex;
  flex-direction: column;
  padding: 30px;
  box-sizing: border-box;
  gap: 30px;
  background-color: rgb(217, 217, 217);
  margin: 0 auto;
}

/* Form area (right side) */
#contact-form {
  margin: 0 auto;
  display: flex;
  font-weight: bold;
  background-color: #1c3272;
  padding: 30px;
  box-sizing: border-box;
  height: auto;
  color: white;
  margin-left: auto;
}

.contact-textfield {
  width: 50%;
  box-sizing: border-box;
  height: 50px;
  font-size: 18px;
  padding: 10px;
  margin-top: 5px;
  margin-bottom: 15px;
}

.contact-input::placeholder {
  font-size: 18px;
}

#contact-send-message-btn:hover {
  box-shadow: 2px 3px rgb(255, 255, 153);
}

/* Green underlines */
.green-underline {
  display: inline-block;
  padding-bottom: 5px;
  border-bottom: 2.5px solid rgb(100, 215, 85);
  width: auto;
  margin-bottom: 10px;
}

/* Contributors section */

#contributors-main {
  min-height: 100vh;
}

#contributors-header {
  font-size: 60px;
  text-align: center;
  color: #1c3272;
}

#profile-container {
  display: flex;
  flex-wrap: wrap;
  gap: 50px;
  justify-content: center;
}

.profile-card {
  width: 350px;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 15px;
  text-align: center;
  background-color: #f9f9f9;
}

.profile-img {
  width: 75%;
  height: auto;
  border-radius: 50%;
}


@media (max-width: 768px) {

  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  /* Prevent horizontal scroll */
  html,
  body {
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden !important;
    width: 100% !important;
    margin: 0;
    padding: 0;
  }

  .header {
    display: flex;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
    padding: 8px !important;
  }

  .branding {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .header-logo {
    width: 110px !important;
    height: auto;
  }

  .CHH-text {
    font-size: 1.6rem !important;
    margin: 0;
  }

  nav {
    display: flex !important;
    flex-wrap: nowrap !important;
    /* Force single row */
    gap: 4px !important;
    padding-bottom: 4px !important;
    width: 100% !important;
    overflow-x: auto !important;
    /* Allow horizontal scroll if needed */
    justify-content: flex-start !important;
  }

  .header-cta {
    font-size: 11px !important;
    padding: 2px 6px !important;
    min-width: 60px !important;
    max-width: 80px !important;
    text-align: center !important;
    border-radius: 6px !important;
    white-space: nowrap !important;
    flex: 0 0 auto !important;
  }


  /* SECTION TEXT */
  .landing-section {
    padding: 24px 16px !important;
  }

  .landing-section-title {
    font-size: 1.8rem !important;
    margin: 0 0 12px !important;
    text-align: center !important;
    width: 100% !important;
  }

  .landing-section-text {
    width: 90% !important;
    max-width: none !important;
    margin: 0 0 16px !important;
    line-height: 1.5 !important;
  }

  /* GO TO PORTAL BUTTON */
  #about-cta {
    display: inline-block !important;
    margin: 0 auto 24px !important;
    padding: 12px 20px !important;
    font-size: 1rem !important;
    width: auto !important;
    max-width: none !important;
  }

  /* HOW‑TO CARDS WRAPPER */
  #how-to-cards {
    margin-left: 0;
    margin-right: 0;
    padding: 8px 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: center;
    width: 100vw;
    box-sizing: border-box;
  }

  .how-to-card-container {
    width: 94vw;
    max-width: 350px;
    min-width: 180px;
    height: 210px;
    perspective: 900px;
    margin: 0 auto;
  }

  .how-to-card-container:hover>.how-to-card {
    cursor: pointer;
    transform: rotateY(180deg);
  }

  .how-to-card {
    width: 100%;
    height: 100%;
    position: relative;
    transition: transform 800ms;
    transform-style: preserve-3d;
  }

  .how-to-card-front,
  .how-to-card-back {
    box-sizing: border-box;
    padding: 0.75rem;
    height: 100%;
    width: 100%;
    border-radius: 0.65rem;
    box-shadow: 0 0 5px 1.5px rgba(50, 50, 50, 0.15);
    position: absolute;
    background: white;
    backface-visibility: hidden;
    overflow: hidden;
  }

  /* ─── FRONT SIDE ─── */
  .how-to-card-front {
    background: white;
    color: white;
    display: grid;
    grid-template-rows: auto 1fr;
    justify-items: center;
    align-items: center;
  }

  .how-to-card-front h2 {
    margin: 0;
    text-align: center;
    width: 100%;
    color: #1B265F;
    font-size: 1.04rem;
  }

  .how-to-card-front img {
    max-width: 130vw;
    max-height: 180px;
    object-fit: contain;
  }

  /* ─── BACK SIDE ─── */
  .how-to-card-back {
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    background: white;
  }

  .how-to-card-title {
    color: #1B265F;
    font-size: 1.1rem;
    margin: 0 0 0.4rem 0;
    line-height: 1.2;
  }

  .how-to-card-text {
    width: 100%;
    height: auto;
    margin: 0;
    font-size: 0.96rem;
    line-height: 1.35;
    word-wrap: break-word;
  }

  /* ---------- Footer ---------- */
  .site-footer p {
    font-size: 0.8rem;
    text-align: center;
    margin: 24px 0 0;
  }

  /* ---------- Top Controls ---------- */

  #portal-main {
    display: block !important;
  }

  body {
    overflow: visible !important;
    /* makes sure that top controls and filters panel are able to stick to top of screen */
  }

  .top-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 16px;
    position: sticky;
    top: 0;
    z-index: 10;
    background: white;
  }

  .top-controls .main-filter {
    flex: 1 1 calc((100% - 16px) / 3) !important;
    min-width: 0;
  }

  .top-controls button,
  #sort-menu {
    flex: 1 1 calc(50% - 8px);
    font-size: 0.8rem;
    padding: 8px 6px;
    border-radius: 14px;
    min-width: 120px;
  }

  #toggle-filters img {
    width: 20px;
  }

  /* ---------- Filters + Cards Wrapper ---------- */
  .filters-panel-and-cards {
    display: flex !important;
    gap: 12px;
    padding: 0 12px;
  }

  /* ---------- Filters Panel ---------- */
  .filters-panel {
    position: sticky;
    top: 95px;
    z-index: 5;
    width: 200px;
    padding: 18px 14px;
    border-radius: 14px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    overscroll-behavior-y: contain;
  }

  .filters-panel h3 {
    font-size: 1rem;
  }

  .filter-section {
    margin-bottom: 20px;
  }

  .filters-panel label {
    font-size: 0.9rem;
    gap: 6px;
  }

  .filters-panel input[type="checkbox"] {
    flex: 0 0 1em;
    width: 1em;
    height: 1em;
  }

  .cards-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 12px;
  }

  .card {
    padding: 10px;
    gap: 8px;
    border-radius: 30px;
  }

  .card img {
    width: 100%;
    border-radius: 15%;
  }

  .card--article img,
  .card--study img {
    width: 90%;
  }

  .card h2 {
    font-size: 0.9rem;
    text-align: center;
  }

  .description {
    font-size: 0.75rem;
    line-height: 1.35;
    text-align: center;
  }

  .store-links {
    gap: 4px;
  }

  .store-links a {
    font-size: 0.7rem;
    padding: 4px 6px;
  }

  .store-rating {
    font-size: 0.7rem;
    padding: 2px 4px;
  }

  .read-more {
    font-size: 0.95rem !important;
    padding: 4px 12px !important;
  }

  #faq-section-title {
    font-size: 1.5rem;
    margin: 20px auto;
    text-align: center;
  }

  .faq-item {
    width: 80%;
    margin: 8px auto;
  }

  .faq-category {
    max-width: 80%;
    margin: 30px auto 8px;
    font-size: 1.5rem;
    padding-bottom: 4px;
  }

  .faq-question {
    font-size: 1.1rem;
    padding: 10px 12px;
  }

  .faq-answer {
    padding: 8px 12px;
    font-size: 0.9rem;
  }

  #contact-body {
    font-size: 16px;
  }

  #contact-container {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 0px;
  }

  #contact-details {
    width: 100%;
    padding: 20px;
  }

  #contact-form {
    width: 100%;
    padding: 30px 20px 100px 20px;
  }

  .contact-form-row {
    display: flex;
    flex-direction: column;
    gap: 15px;
  }

  .contact-form-group {
    width: 100%;
  }

  #contact-nameSection,
  #contact-emailSection {
    width: 100%;
  }

  .contact-textfield {
    width: 100%;
    height: 40px;
    font-size: 16px;
    padding: 8px;
  }

  #contact-phoneNumber,
  #contact-reason {
    width: 100%;
  }

  #contact-users-message {
    width: 100%;
    height: 200px;
  }

  #contact-heading {
    font-size: 32px;
    border-bottom-width: 5px;
  }

  #contactUS-header {
    font-size: 32px;
  }

  #contact-send-message-btn {
    width: 100%;
    height: 45px;
    font-size: 16px;
  }

  #contributors-header {
    font-size: 32px;
    margin: 20px 0 15px;
  }

  #profile-container {
    flex-direction: column;
    gap: 20px;
    padding: 0 10px 30px;
  }

  .profile-card {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
  }

}