/* =========================================================
   Grants / Opportunities Listing Page
   Brand colors: navy #0d1b3e, gold #d99a1b
   (matches scholarships.css so the pages look consistent)
========================================================= */

:root{
  --navy: #0d1b3e;
  --navy-dark: #091329;
  --gold: #d99a1b;
  --gold-light: #f0a500;
  --gold-soft: #fdf1d8;
  --text-dark: #1c1c1c;
  --text-muted: #6b7280;
  --border-light: #e7e7ec;
  --bg-cream: #faf9f7;
  --transition: 0.2s ease;
}

.container{
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Page Banner ---------- */
.page-banner{
  position: relative;
  background-color: var(--navy);
  color: #fff;
  padding: 48px 0 40px;
  overflow: hidden;
  /* put your coins-jar banner image here */
  background-image: url('../images/hero/grantopp-hero.jpeg');
  background-repeat: no-repeat;
  background-position: right center;
  background-size: cover;
}

.page-banner::before{
  /* dark fade on the left so the text stays readable */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, var(--navy) 35%, rgba(13,27,62,0.6) 65%, rgba(13,27,62,0) 100%);
  pointer-events: none;
}

.page-banner-content{
  position: relative;
  z-index: 1;
}

.page-banner-content h1{
  font-size: 2.1rem;
  letter-spacing: 1px;
  margin: 0 0 6px;
  font-weight: 800;
  color: #fff;
}

.page-banner-sub{
  color: var(--gold);
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 18px;
}

.breadcrumb{
  font-size: 0.9rem;
  color: #d7dae5;
}

.breadcrumb a{
  color: #d7dae5;
  text-decoration: none;
}

.breadcrumb a:hover{
  text-decoration: underline;
}

.breadcrumb span{
  margin: 0 6px;
}

.breadcrumb .current{
  color: var(--gold);
}

/* ---------- Section Layout ---------- */
.opportunities-section{
  background: var(--bg-cream);
  padding: 36px 0 60px;
}

.opportunities-layout{
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 28px;
  align-items: start;
}

.opportunities-list{
  min-width: 0;
}

/* ---------- Toolbar ---------- */
.list-toolbar{
  display: flex;
  align-items: center;
  gap: 16px;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 18px;
}

.view-toggle{
  display: flex;
  gap: 6px;
}

.view-btn{
  width: 34px;
  height: 34px;
  border: 1px solid var(--border-light);
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.view-btn:hover{
  border-color: var(--navy);
  color: var(--navy);
}

.view-btn.active{
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.view-btn svg{
  display: block;
  pointer-events: none;
}

.results-count{
  flex: 1;
  margin: 0;
  color: var(--navy);
  font-size: 0.88rem;
  font-weight: 600;
}

.sort-select{
  font-size: 0.9rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.sort-select select{
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 0.9rem;
  color: var(--text-dark);
  cursor: pointer;
  background: #fff;
}

.sort-select select:focus,
.view-btn:focus-visible{
  outline: 2px solid var(--gold-light);
  outline-offset: 2px;
}

/* ---------- Opportunity Cards ---------- */
.opportunity-cards{
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.opportunity-card{
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 14px;
  display: grid;
  grid-template-columns: 175px 1fr auto;
  gap: 20px;
  align-items: center;
  transition: box-shadow 0.15s ease;
}

.opportunity-card[hidden]{
  display: none;
}

.opportunity-card:hover{
  box-shadow: 0 4px 14px rgba(13, 27, 62, 0.08);
}

.opportunity-thumb{
  width: 175px;
  height: 100px;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
  background: #eef0f5;
}

.opportunity-thumb img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.opportunity-tag{
  display: inline-block;
  color: #b9770e;
  background: var(--gold-soft);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 3px;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.opportunity-title{
  font-size: 1.08rem;
  color: var(--navy);
  margin: 0 0 10px;
  font-weight: 700;
  line-height: 1.3;
}

.opportunity-meta{
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.opportunity-meta li{
  font-size: 0.84rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.meta-icon{
  flex-shrink: 0;
  color: var(--navy);
}

.opportunity-action{
  align-self: end;
}

.btn-toggle{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--navy);
  color: #fff;
  border: none;
  cursor: pointer;
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.2s ease;
}

.btn-toggle:hover{
  background: var(--gold-light);
}

.btn-toggle .arrow{
  transition: transform 0.2s ease;
  display: inline-block;
}

.btn-toggle.is-open .arrow{
  transform: rotate(90deg);
}

/* ---------- List view (compact rows) ---------- */
.opportunity-cards.is-list-view .opportunity-card{
  grid-template-columns: 90px 1fr auto;
  padding: 10px 14px;
  gap: 14px;
}

.opportunity-cards.is-list-view .opportunity-thumb{
  width: 90px;
  height: 64px;
}

.opportunity-cards.is-list-view .opportunity-title{
  font-size: 0.98rem;
  margin-bottom: 6px;
}

.opportunity-cards.is-list-view .opportunity-meta{
  flex-direction: row;
  flex-wrap: wrap;
  gap: 4px 18px;
}

.no-results{
  text-align: center;
  color: var(--text-muted);
  padding: 30px 0;
}

/* ---------- Expanded details panel ---------- */
.opportunity-details{
  grid-column: 1 / -1;
  margin-top: 6px;
  padding-top: 16px;
  border-top: 1px dashed var(--border-light);
  font-size: 0.92rem;
  color: var(--text-dark);
  line-height: 1.65;
}

.opportunity-details[hidden]{
  display: none;
}

.opportunity-details h4{
  color: var(--navy);
  margin: 16px 0 6px;
  font-size: 0.98rem;
}

.opportunity-details p{
  margin: 0 0 10px;
}

.opportunity-details ul,
.opportunity-details ol{
  margin: 0 0 12px;
  padding-left: 20px;
}

.opportunity-details li{
  margin-bottom: 4px;
}

.opportunity-details a{
  color: #b9770e;
  font-weight: 600;
  text-decoration: underline;
  word-break: break-word;
}

.opportunity-details q{
  font-style: italic;
}

.opportunity-details table{
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 14px;
  font-size: 0.88rem;
}

.opportunity-details table th,
.opportunity-details table td{
  border: 1px solid var(--border-light);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.opportunity-details table th{
  background: var(--navy);
  color: #fff;
  font-weight: 600;
}

/* ---------- Pagination (1 2 3 4  + arrows) ---------- */
.pagination{
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.pagination[hidden]{
  display: none;
}

.page-num,
.page-prev,
.page-next{
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  background: #fff;
  color: var(--text-dark);
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.page-num{
  width: 34px;
}

.page-prev,
.page-next{
  padding: 0 14px;
}

.page-num:hover:not(.active),
.page-prev:hover:not(:disabled),
.page-next:hover:not(:disabled){
  border-color: var(--navy);
  color: var(--navy);
}

.page-num.active{
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
  cursor: default;
}

.page-prev:disabled,
.page-next:disabled{
  opacity: 0.45;
  cursor: not-allowed;
}

.page-dots{
  color: var(--text-muted);
  padding: 0 2px;
}

.page-num:focus-visible,
.page-prev:focus-visible,
.page-next:focus-visible,
.btn-toggle:focus-visible{
  outline: 2px solid var(--gold-light);
  outline-offset: 2px;
}

.opportunities-sidebar{
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-menu{
  background: #fff;
  border: 1px solid #eee;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: 0 6px 18px rgba(0,0,0,.05);
}

.sidebar-menu h3{
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  padding: 16px 20px;
  background: var(--navy);
  margin: 0;
}

.sidebar-menu ul{
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-menu ul li a{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  color: var(--navy);
  font-size: 14px;
  font-weight: 500;
  background: #fff;
  border-top: 1px solid #f0f0f0;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}

.sidebar-menu ul li a i:first-child{
  color: var(--navy);
  width: 18px;
  text-align: center;
  transition: color var(--transition);
}

.sidebar-menu ul li a:hover{
  background: #f5f7fb;
  color: var(--navy);
}

.sidebar-menu ul li.active a{
  background: var(--navy);
  color: var(--gold);
  font-weight: 700;
}

.sidebar-menu ul li.active a i:first-child{
  color: var(--gold);
}

.sidebar-menu ul li a .arrow{
  margin-left: auto;
  font-size: 11px;
  color: var(--gold);
}



/* ---------- Our Commitment ---------- */
.grants-commitment-box{
  background-color: var(--navy);
  border-radius: 10px;
  padding: 24px 20px;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.grants-commitment-content{
  flex: 1;
}

.grants-commitment-title{
  color: #d4a24c;
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 8px;
}

.grants-commitment-text{
  color: #fff;
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
}

.grants-commitment-icon{
  flex-shrink: 0;
  color: #d4a24c;
  font-size: 56px;
  line-height: 1;
}

/* ---------- Need Assistance ---------- */
.grants-assistance-box{
  position: relative;
  background-color: #fdf6ea;
  border: 1px solid #f3e4c4;
  border-radius: 10px;
  padding: 24px 22px;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.grants-assistance-title{
  color: var(--navy);
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 8px;
}

.grants-assistance-text{
  color: #444;
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 18px;
  padding-right: 50px;
}

.grants-contact-button{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  background-color: var(--gold);
  padding: 10px 18px;
  border-radius: 5px;
  transition: 0.3s ease;
}

.grants-contact-button:hover{
  background-color: var(--navy);
  color: #fff;
}

.grants-contact-arrow{
  font-size: 18px;
  line-height: 1;
}

.grants-assistance-icon{
  position: absolute;
  right: 18px;
  bottom: 22px;
  opacity: 0.8;
}


/* ==============================
   GRANT IMAGE LIGHTBOX
============================== */

.opportunity-thumb img,
.opportunity-details img {
    cursor: zoom-in;
}

.img-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 25px;
    background: rgba(4, 12, 30, 0.90);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.img-lightbox.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.img-lightbox-inner {
    position: relative;
    max-width: 1100px;
    max-height: 90vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.img-lightbox-img {
    display: block;
    max-width: 100%;
    max-height: 82vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.35);
    cursor: default;
}

.img-lightbox-close {
    position: absolute;
    top: -42px;
    right: 0;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: #ffffff;
    color: #0b2352;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease;
}

.img-lightbox-close:hover {
    background: #e1a80b;
    color: #0b2352;
}

.img-lightbox-caption {
    margin-top: 12px;
    color: #ffffff;
    font-size: 14px;
    text-align: center;
    line-height: 1.5;
}

body.lightbox-open {
    overflow: hidden;
}

@media (max-width: 600px) {
    .img-lightbox {
        padding: 15px;
    }

    .img-lightbox-img {
        max-height: 75vh;
    }

    .img-lightbox-close {
        top: -45px;
    }
}


/* ---------- Responsive ---------- */
@media (max-width: 960px){
  .opportunities-layout{
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px){
  .opportunity-card,
  .opportunity-cards.is-list-view .opportunity-card{
    grid-template-columns: 1fr;
  }

  .opportunity-thumb,
  .opportunity-cards.is-list-view .opportunity-thumb{
    width: 100%;
    height: 160px;
  }

  .opportunity-action{
    width: 100%;
  }

  .btn-toggle{
    width: 100%;
    justify-content: center;
  }

  .list-toolbar{
    flex-wrap: wrap;
  }

  .results-count{
    order: 3;
    width: 100%;
  }

  .pagination{
    justify-content: center;
  }

  .opportunity-details table{
    display: block;
    overflow-x: auto;
  }
}