/* =========================================================
   Granting Agencies Page
   Brand colors: navy #0d1b3e, gold #d99a1b
   (matches grants.css / scholarships.css)
========================================================= */

:root{
  --navy: #0d1b3e;
  --navy-dark: #091329;
  --gold: #d99a1b;
  --gold-light: #f0a500;
  --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 world-globe banner image here */
  background-image: url('../images/hero/grantagencies-hero.jpeg');
  background-repeat: no-repeat;
  background-position: right center;
  background-size: cover;
}

.page-banner::before{
  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;
}

/* ---------- Agencies panel ---------- */
.agencies-panel{
  min-width: 0;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 0 18px 22px;
}

.agencies-header{
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-light);
}

.agencies-header-left{
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
}

.agencies-header-left h2{
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
}

.agencies-header-icon{
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.results-count{
  margin: 0;
  color: var(--navy);
  font-size: 0.8rem;
  font-weight: 600;
}

.sort-select{
  font-size: 0.82rem;
  color: var(--navy);
  font-weight: 600;
  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.85rem;
  color: var(--text-dark);
  cursor: pointer;
  background: #fff;
}

.sort-select select:focus{
  outline: 2px solid var(--gold-light);
  outline-offset: 2px;
}

/* ---------- Agency rows ---------- */
.agency-list{
  display: flex;
  flex-direction: column;
}

.agency-row{
  display: grid;
  grid-template-columns: 130px 1.3fr 1fr 1.2fr auto;
  gap: 18px;
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid var(--border-light);
}

.agency-row:last-child{
  border-bottom: none;
}

.agency-row[hidden]{
  display: none;
}

.agency-logo{
  width: 130px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.agency-logo img{
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.agency-name{
  margin: 0 0 6px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.3;
}

.agency-url{
  font-size: 0.78rem;
  color: #2a5db0;
  text-decoration: none;
  word-break: break-all;
}

.agency-url:hover{
  text-decoration: underline;
}

.agency-col h4{
  margin: 0 0 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--navy);
}

.agency-col p{
  margin: 0;
  font-size: 0.74rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.btn-visit{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--navy);
  color: #fff;
  text-decoration: none;
  padding: 9px 14px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.2s ease;
}

.btn-visit:hover{
  background: var(--gold);
  color: #fff;
}

.btn-visit:focus-visible{
  outline: 2px solid var(--gold-light);
  outline-offset: 2px;
}

.no-results{
  text-align: center;
  color: var(--text-muted);
  padding: 30px 0;
}

/* ---------- Pagination (1 2 3 + arrows, centered) ---------- */
.pagination{
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.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{
  outline: 2px solid var(--gold-light);
  outline-offset: 2px;
}

/* ---------- Sidebar ---------- */
.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 ---------- */
.agencies-commitment-box{
  position: relative;
  background-color: var(--navy);
  border-radius: 10px;
  padding: 24px 20px 28px;
  width: 100%;
  box-sizing: border-box;
  min-height: 190px;
  overflow: hidden;
}

.agencies-commitment-title{
  color: #d4a24c;
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 8px;
  padding-bottom: 10px;
  position: relative;
}

.agencies-commitment-title::after{
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 28px;
  height: 2px;
  background: #d4a24c;
}

.agencies-commitment-text{
  color: #fff;
  font-size: 14px;
  line-height: 1.7;
  margin: 12px 0 0;
  padding-right: 70px;
}

.agencies-commitment-icon{
  position: absolute;
  right: 22px;
  bottom: 20px;
  color: #d4a24c;
  font-size: 64px;
  line-height: 1;
}

/* ---------- Need Assistance ---------- */
.agencies-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;
}

.agencies-assistance-title{
  color: var(--navy);
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 8px;
}

.agencies-assistance-text{
  color: #444;
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 18px;
  padding-right: 50px;
}

.agencies-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;
}

.agencies-contact-button:hover{
  background-color: var(--navy);
  color: #fff;
}

.agencies-contact-arrow{
  font-size: 18px;
  line-height: 1;
}

.agencies-assistance-icon{
  position: absolute;
  right: 18px;
  top: 28px;
  opacity: 0.8;
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px){
  .agency-row{
    grid-template-columns: 110px 1.2fr 1fr 1fr;
  }
  .agency-action{
    grid-column: 2 / -1;
  }
}

@media (max-width: 960px){
  .opportunities-layout{
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px){
  .agencies-header{
    flex-wrap: wrap;
  }

  .results-count{
    order: 3;
    width: 100%;
  }

  .agency-row{
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .agency-logo{
    width: 100%;
    justify-content: flex-start;
  }

  .agency-action{
    grid-column: auto;
  }

  .btn-visit{
    width: 100%;
    justify-content: center;
  }
}