/* =========================================================
   Scholarships / Opportunities Listing Page
   Brand colors: navy #0d1b3e, gold #d99a1b, maroon #7a1f1f
   (shared look so all opportunity pages stay consistent)
========================================================= */

:root{
  --navy: #0d1b3e;
  --navy-dark: #091329;
  --gold: #d99a1b;
  --gold-light: #f0a500;
  --maroon: #7a1f1f;
  --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;
    width: 100%;
    height: 315px;
    overflow: hidden;
    background: #0b2352;
}

.banner-flex {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 1300px;
    margin: 0 auto;
}

/* FULL HERO IMAGE */
.banner-media {
    position: absolute;
    top: 0;
    right: 0;
    width: 82%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.banner-photo {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* LEFT DARK / BLURRED AREA */
.banner-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 45%;
    height: 100%;
    z-index: 3;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px 40px 40px 70px;
    background: rgba(11, 35, 82, 0.88);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

/* Slanted transition */
.banner-text::after {
    content: "";
    position: absolute;
    top: 0;
    right: -100px;
    width: 150px;
    height: 100%;
    background: rgba(11, 35, 82, 0.88);
    clip-path: polygon(35% 0, 100% 0, 65% 100%, 0 100%);
    z-index: -1;
}

/* TITLE */
.banner-text h1 {
    margin: 0 0 22px 0;
    color: #ffffff;
    font-size: 36px;
    line-height: 1.35;
    font-weight: 800;
    letter-spacing: 1px;
}

/* BREADCRUMB */
.banner-text .breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 14px;
}

.banner-text .breadcrumb a {
    color: #ffffff;
    text-decoration: none;
}

.banner-text .breadcrumb a:hover {
    color: #e1a80b;
}

.banner-text .breadcrumb .sep {
    color: #ffffff;
}

.banner-text .breadcrumb .current {
    color: #e1a80b;
    font-weight: 600;
}

/* BANNER MOBILE */
@media (max-width: 768px) {
    .page-banner {
        height: 360px;
    }
    .banner-media {
        width: 100%;
    }
    .banner-text {
        width: 100%;
        height: 100%;
        padding: 30px;
        background: rgba(11, 35, 82, 0.85);
    }
    .banner-text::after {
        display: none;
    }
    .banner-text h1 {
        font-size: 30px;
    }
}

/* ---------- 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;
}

/* ---------- 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(--text-muted);
  font-size: 0.92rem;
}

.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;
}

.sort-select select:focus,
.view-btn:focus-visible{
  outline: 2px solid var(--gold-light);
  outline-offset: 2px;
}

/* ---------- Opportunity Cards (grid view = default stacked rows) ---------- */
.opportunity-cards{
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.opportunity-card{
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 16px;
  display: grid;
  grid-template-columns: 170px 1fr auto;
  gap: 20px;
  align-items: center;
  transition: box-shadow 0.15s ease;
}

.opportunity-card:hover{
  box-shadow: 0 4px 14px rgba(13, 27, 62, 0.08);
}

/* =========================================
   Thumbnail (portrait box, shows the whole flyer / logo)
   ========================================= */

.opportunity-thumb{
  position: relative;
  width: 170px;
  height: 230px;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
  background: #fff;
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
}

.opportunity-thumb img{
  width: 100%;
  height: 100%;
  object-fit: contain;         /* whole image visible, nothing cropped */
  object-position: center;
  display: block;
  font-size: 0;                /* hides broken-image alt text */
  color: transparent;
  transition: transform 0.2s ease;
}

/* Fallback when an image fails to load (class added by JS) */
.opportunity-thumb.img-error{
  background: linear-gradient(135deg, var(--navy) 0%, #1b2f63 100%);
}

.opportunity-thumb.img-error img{
  display: none;
}

.opportunity-thumb.img-error::after{
  content: "\f19d";            /* Font Awesome graduation cap */
  font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", sans-serif;
  font-weight: 900;
  font-size: 30px;
  color: var(--gold);
}

/* =========================================
   Image Lightbox (click thumbnail -> big image)
   ========================================= */

.opportunity-thumb:not(.img-error),
.opportunity-details img{
  cursor: zoom-in;
}

.opportunity-thumb:not(.img-error):hover img{
  transform: scale(1.05);
}

.img-lightbox{
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
  background: rgba(9, 19, 41, 0.88);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.img-lightbox.is-open{
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.img-lightbox-inner{
  position: relative;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.img-lightbox-img{
  display: block;
  max-width: min(92vw, 1100px);
  max-height: 85vh;
  width: auto;
  height: auto;
  object-fit: contain;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  transform: scale(0.95);
  transition: transform 0.25s ease;
}

.img-lightbox.is-open .img-lightbox-img{
  transform: scale(1);
}

.img-lightbox-caption{
  margin-top: 12px;
  color: #fff;
  font-size: 0.92rem;
  text-align: center;
  max-width: 90vw;
}

.img-lightbox-close{
  position: absolute;
  top: -14px;
  right: -14px;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: var(--gold-light);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  transition: background 0.2s ease;
}

.img-lightbox-close:hover{
  background: #fff;
  color: var(--navy);
}

body.lightbox-open{
  overflow: hidden;
}

/* =========================================
   Card text
   ========================================= */

.opportunity-tag{
  display: inline-block;
  color: var(--gold-light);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.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.86rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.meta-icon{
  flex-shrink: 0;
  color: var(--gold-light);
}

.opportunity-action{
  align-self: center;
}

.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.88rem;
  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, triggered by JS) ---------- */
.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: 120px;
}

.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: 14px;
  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: 18px 0 6px;
  font-size: 0.98rem;
  font-weight: 700;
}

.opportunity-details h4:first-child{
  margin-top: 0;
}

/* h5 headings used in some exchange write-ups */
.opportunity-details h5{
  color: var(--navy);
  margin: 14px 0 6px;
  font-size: 0.92rem;
  font-weight: 700;
}

.opportunity-details p{
  margin: 0 0 10px;
}

.opportunity-details ul,
.opportunity-details ol{
  margin: 0 0 12px;
  padding-left: 20px;
}

/* nested lists inside list items (Saitama, etc.) */
.opportunity-details li > ul,
.opportunity-details li > ol{
  margin: 6px 0 4px;
}

.opportunity-details li{
  margin-bottom: 4px;
}

.opportunity-details a{
  color: var(--gold-light);
  font-weight: 600;
  text-decoration: underline;
  word-break: break-word;
}

.opportunity-details img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 10px 0;
  display: block;
}

/* Embedded PDF factsheets (iframes) */
.opportunity-details iframe{
  display: block;
  width: 100%;
  height: 500px;
  margin: 10px 0 14px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: #fff;
}

.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 ---------- */
.pagination{
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
}

.page-num{
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  color: var(--text-dark);
  text-decoration: none;
  font-size: 0.9rem;
  background: #fff;
}

.page-num.active{
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.page-next{
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  height: 34px;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  background: #fff;
  color: var(--text-dark);
  text-decoration: none;
  font-size: 0.9rem;
}

/* ---------- 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);
}

/* =========================================
   Scholarships - Our Commitment
   ========================================= */

.scholarships-commitment-box {
    background-color: #001f3f;
    border-radius: 10px;
    padding: 22px 20px;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 16px;
}

.scholarships-commitment-icon {
    flex-shrink: 0;
    color: #d4a24c;
    font-size: 36px;
}

.scholarships-commitment-icon i {
    color: #d4a24c;
}

.scholarships-commitment-content {
    flex: 1;
}

.scholarships-commitment-title {
    color: #d4a24c;
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 7px 0;
}

.scholarships-commitment-text {
    color: #ffffff;
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
}

/* =========================================
   Scholarships - Need Assistance
   ========================================= */

.scholarships-assistance-box {
    position: relative;
    background-color: #001f3f;
    border-radius: 10px;
    padding: 25px 22px;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.scholarships-assistance-title {
    color: #d4a24c;
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 8px 0;
}

.scholarships-assistance-text {
    color: #ffffff;
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 18px 0;
    padding-right: 45px;
}

.scholarships-contact-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    background-color: #d4a24c;
    padding: 10px 16px;
    border-radius: 5px;
    transition: 0.3s ease;
}

.scholarships-contact-button:hover {
    background-color: #ffffff;
    color: #001f3f;
}

.scholarships-contact-arrow {
    font-size: 18px;
    line-height: 1;
}

.scholarships-assistance-icon {
    position: absolute;
    right: 20px;
    bottom: 20px;
}

.scholarships-assistance-icon svg {
    stroke: #d4a24c;
}

/* =========================================
   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: 280px;
  }

  .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;
    flex-wrap: wrap;
  }

  .opportunity-details table{
    display: block;
    overflow-x: auto;
  }

  .opportunity-details iframe{
    height: 360px;
  }

  .img-lightbox-close{
    top: -10px;
    right: -6px;
  }
}

/* =========================================
   Pagination (rendered by JS)
   ========================================= */

/* a [hidden] card/nav must really disappear (display:grid/flex would override it) */
.opportunity-card[hidden],
.pagination[hidden]{
  display: none;
}

.pagination{
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.pagination button{
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.page-prev{
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  background: #fff;
  color: var(--text-dark);
  font-size: 0.9rem;
}

.page-num:hover:not(.active),
.page-prev:hover:not(:disabled),
.page-next:hover:not(:disabled){
  border-color: var(--navy);
  color: var(--navy);
}

.page-prev:disabled,
.page-next:disabled{
  opacity: 0.4;
  cursor: not-allowed;
}

.page-dots{
  color: var(--text-muted);
  padding: 0 4px;
}

.pagination button:focus-visible{
  outline: 2px solid var(--gold-light);
  outline-offset: 2px;
}