/* =====================================================
   FUNDING PAGE CLEAN, RATIONALISED CSS (SINGLE SOURCE)
   + Media queries grouped at bottom
   ===================================================== */

/* -----------------------------
   Global / shared
----------------------------- */

section { margin-top: 20px !important; }

h4 { color: #592d06 !important; }

p a { border: none; }

.trfundadd { background-color : #EE7B18}

/* Standard section width */
#fundintro,
#fundnav,
#fundexplained,
#fundoptions,
#fundalternative,
#fundregister,
#fundroutes,
#fundvoluntary,
#fundapply,
#fundsessions,
#fundtandc{
  width: 80%;
  margin: 0 auto;
  text-align: center;
}

/* Specific spacing */
#fundintro { margin-top: 75px !important; }
#fundalternative { margin-top: 20px; }
#fundtandc { text-align: center; }
#fundsessions { margin-top: 20px !important; }

/* Routes highlight bar */
#fundroutes{
  background-color: #fcecdf;
  padding: 20px;
  font-size: 20px;
  margin-top: 40px !important;
  border-radius: 20px;
}

/* Headings */
#fundexplained h2,
#fundusing h2,
#fundsessions h2,
#fundhelp h2,
#fundvoluntary h2{
  color: #592d06;
  font-weight: 900;
}

#fundapply h2  { color : #DB2164}
#fundadditional h2 { color : #DB2164}
/* Voluntary table */
.tblvoluntary{
  background-color: #f7e588 !important;
  /* padding: 10px; */
}

/* -----------------------------
   FULL-WIDTH SECTION: FUND USING
----------------------------- */

#fundusing{
  width: 100vw;
  position: relative;
  left: 50%;
  margin-left: -50vw;
  background-color: #EE7B18 !important;
  padding-top: 40px;
  padding-bottom: 40px;
  text-align: center;
  overflow-x: clip;
}

/* Keep the *content inside* fundusing aligned to your normal width */
#fundusing > *{
  max-width: 80%;
  margin-left: auto;
  margin-right: auto;
}

/* -----------------------------
   HERO + BUBBLES (WORKING)
----------------------------- */

.fund-hero{
  position: relative;
  width: 100%;
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: url("/images/Funding/Funding-Hero1.jpg") center / cover no-repeat;
  margin: 30px 0;
  padding: 80px 0;
  overflow: visible;
  isolation: isolate;
}

/* subtle dark overlay */
.fund-hero::before{
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.25);
  z-index: 1;
}

/* bubbles */
.fund-bubbles-bottom{
  position: absolute;
  left: 50%;
  width: 100%;
  max-width: 1920px;
  height: 160px;
  background: url("/images/Home/circles.png") center / contain no-repeat;
  z-index: 2;
  pointer-events: none;
}

/* Top (not flipped) */
.fund-bubbles-top{
  top: -80px;
  transform: translateX(-50%);
}

/* Bottom flipped vertically */
.fund-bubbles-bottom{
  bottom: -80px;
  transform: translateX(-50%) scaleY(-1);
}

/* hero content */
.fund-content{
  position: relative;
  z-index: 3;
  text-align: center;
  padding: 0 18px;
  max-width: 980px;
}

.fund-content h1{
  color: #fff;
  text-align: center;
  text-shadow: 0 2px 18px rgba(0,0,0,0.35);
}

/* -----------------------------
   FUND NAV BUTTONS
----------------------------- */

#fund-nav-wrapper.fund-nav-buttons{
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin: 20px auto 0;
}

#fund-nav-wrapper.fund-nav-buttons a {font-size : 18px;}
#fundexplore { color : #f6a019 !important }

#fund-nav-wrapper .fund-nav-btn{
  width: 250px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 18px 18px;
  border-radius: 16px;
  text-decoration: none;
  font-weight: 700;
  font-size: 16px;
  transition: 0.25s ease;
}

#fund-nav-wrapper .nav-apply{
  background: #DB2164;
  color: #ffffff;
}

#fund-nav-wrapper .nav-about{
  background: #f6a019;
  color: #3b2b15;
}

#fund-nav-wrapper .nav-using{
  background: #ffde33;
  color: #3b2b15;
}

#fund-nav-wrapper .fund-nav-btn:hover{
  transform: translateY(-3px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.15);
  background: #593606;
  color: #fff;
}

#fund-nav-wrapper .fund-nav-btn.is-active{
  background: #17b6a6;
  color: #fff;
}

/* -----------------------------
   USING FUND TABLE
----------------------------- */

.tblusing{
  width: 70%;
  margin: auto;
  border-radius: 20px !important;
  padding: 10px !important;
  border: 2px solid lightgrey;
  box-shadow: 5px 15px 15px grey;
  background-color: #fcecdf;
}

.tblusing th,
.table-bordered td{
  border: none !important;
}

.usingfund{ width: 85%; margin: auto; }

/* -----------------------------
   FUND OPTIONS "CARDS" (TABS)
----------------------------- */

#fund-tabs-wrapper .fund-tabs-row{
  display: flex;
  gap: 20px;
  width: 100%;
  align-items: flex-start;
}

#fund-tabs-wrapper .fund-tab-tile{
  flex: 1 1 25%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

#fund-tabs-wrapper .fund-tab-button{
  font-family: 'Alan Sans';
  width: 100%;
  border: 0 !important;
  border-radius: 20px !important;
  padding: 18px 16px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: normal;
  font-weight: 700;
  font-size: 18px;
  line-height: 1.3;
  background: #FFEEDC;
  color: #593606;
  cursor: pointer;
  height: 150px !important;
  transition: 0.25s ease;
}

#fund-tabs-wrapper .fund-tab-button.fund-active{
  background: orange;
  color: #fff;
  box-shadow: 0 8px 18px rgba(0,0,0,0.15);
}

#fund-tabs-wrapper .fund-tab-summary{ display: none; }

.fund-panel{
  display: none;
  background: #FFEEDC;
  padding: 15px;
  border-radius: 16px;
  margin-top: 8px;
  text-align: left;
}

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

/* -----------------------------
   FUND APPLY (TIMELINE)
----------------------------- */

.fund_apply{
  max-width: 980px;
  margin: 0 auto;
  padding: 10px 0;
}

.fund_apply h2{
  margin: 0 0 18px;
  font-size: 28px;
  line-height: 1.2;
  font-weight: 700;
  color: #0f172a;
}

#fundapply .fund_steps{
  list-style: none;
  padding: 0;
  margin: 0;
  position: relative;
}

#fundapply .fund_steps::before{
  content: "";
  position: absolute;
  left: 44px;
  top: 35px;
  bottom: 40px;
  width: 3px;
  background: #db2164;
  border-radius: 3px;
}

#fundapply .fund_step{
  display: grid;
  grid-template-columns: 70px 1fr;
  column-gap: 24px;
  align-items: start;
  min-height: 120px;
  padding: 2px 0 18px;
}

#fundapply .fund_step_rail{
  width: 90px;
  display: flex;
  justify-content: center;
}

#fundapply .fund_step_badge{
  width: 80px;
  height: 80px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #db2164;
  color: #ffde33;
  font-family: Alan sans, Helvetica, sans-serif !important;
  font-weight: 800 !important;
  font-size: 22px !important;
  line-height: 1 !important;
  position: relative;
  z-index: 2;
}

#fundapply .fund_step_content{ text-align: left !important; }

#fundapply .fund_step_content h3{
  text-align: left !important;
  margin: 0 0 6px 0;
  font-size: 24px;
  font-weight: 800;
  color: #db2164;
}

#fundapply .fund_step_content p{
  text-align: left !important;
  margin: 0;
  max-width: 900px;
  font-size: 20px;
  line-height: 1.5;
  color: #6b7280;
}

#fundapply .fund_step_content a{
  color: #db2164;
  text-decoration: underline;
  font-weight: 700;
}

/* -----------------------------
   ADDITIONAL HELP GRID
----------------------------- */

#fundadditional{
  margin: 0 auto;
  text-align: center;
}

.fund_additional{
  max-width: 1200px;
  margin: 20px auto;
  padding: 0 15px;
}

.fund_additional h2{
  font-size: 30px;
  font-weight: 800;
  margin-bottom: 30px;
  color: #0f172a;
}

.fund_additional_grid{
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 30px;
}

.fund_additional_card{
  padding: 25px;
  background: #f8fafc;
  border-radius: 12px;
  transition: 0.3s ease;
  display: flex;             /* suggestion: allows link pinning */
  flex-direction: column;    /* suggestion */
}

.fund_additional_card:hover{ transform: translateY(-4px); }

.fund_additional_card h3{
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 12px;
  color: #db2164;
}

.fund_additional_card p{
  font-size: 20px;
  color: #6b7280;
  margin-bottom: 1rem;
}

.fund_additional_card a{
  display: inline-block;
  font-weight: 700;
  color: #db2164;
  text-decoration: underline;
  margin-top: auto; /* suggestion: pushes link to bottom */
  word-break: break-all;
}

.fund_additional_card p a{ border-bottom: none; }

.viewadditional{ margin-bottom: 0px; }

/* -----------------------------
   HELP CTA
----------------------------- */

.fund_help{
  max-width: 1000px;
  margin: 70px auto 40px;
  padding: 40px 25px;
  text-align: center;
  background: #FFEEDC;
  border-radius: 16px;
}

.fund_help h2{
  font-size: 30px;
  font-weight: 800;
  margin-bottom: 15px;
  color: #0f172a;
}

.fund_help p{
  font-size: 20px;
  color: #6b7280;
  margin-bottom: 30px;
}

.fund_help_actions{
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.fund_help_btn{
  padding: 14px 26px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 999px;
  text-decoration: none;
  transition: 0.3s ease;
}

.fund_help_primary{
  background: #EE7B18;
  color: #fff;
}
.fund_help_primary:hover{
  background: #593606;
  color: #ffffff;
}

.fund_help_secondary{
  background: #DB2164;
  color: #ffffff;
}
.fund_help_secondary:hover{
  background-color: #593606;
  color: #fff;
}

/* -----------------------------
   DECORATIVE CIRCLES
   (deduped: single base rule; adjustments in media below)
----------------------------- */

.fundedcircles{
  position: absolute;
  float: right;
  width: 20%;
  top: 250px;
  left: 580px;
}

/* =====================================================
   MEDIA QUERIES (GROUPED AT BOTTOM)
   ===================================================== */

/* 1) Mobile widths (Bootstrap sm and below) */
@media (max-width: 575.98px){

  /* Make inner widths full on very small screens */
  .usingfund{ width: 100%; margin: auto; }

  /* fundusing inner width */
  #fundusing > *{ max-width: 95%; }

  /* nav buttons full width */
  .fund-nav-btn.nav-apply,
  .fund-nav-btn.nav-about,
  .fund-nav-btn.nav-using{ width: 100% !important; }

  /* funded circles positioning for small screens */
  .fundedcircles{
    width: 40%;
    top: 660px;
    left: 220px;
  }

  /* FUND APPLY: keep circles left, content right */
  #fundapply .fund_step{
    display: grid !important;
    grid-template-columns: 60px 1fr !important;
    column-gap: 18px;
    align-items: start;
  }

  #fundapply .fund_steps::before{
    left: 30px !important;
    transform: none !important;
  }

  #fundapply .fund_step_rail{
    width: 60px !important;
    display: flex !important;
    justify-content: center !important;
  }

  #fundapply .fund_step_badge{
    width: 50px;
    height: 50px;
    font-size: 16px;
  }

  #fundapply .fund_step_content{
    text-align: left !important;
  }
}

/* 2) Mobile/tablet widths (Bootstrap md and below) */
@media (max-width: 767.98px){

  /* Standard section width on mobile */
  #fundintro,
  #fundnav,
  #fundexplained,
  #fundoptions,
  #fundalternative,
  #fundregister,
  #fundroutes,
  #fundvoluntary,
  #fundapply,
  #fundsessions,
  #fundtandc{
    width: 95%;
  }

  /* Tabs stack */
  #fund-tabs-wrapper .fund-tabs-row{ flex-direction: column; }

  #fund-tabs-wrapper .fund-tab-button{
    height: auto;
    width: 100% !important;
    font-size: 20px;
  }

  #fund-tabs-wrapper .fund-tab-summary{
    text-align: left;
    padding: 0 4px;
  }

  .fund-panel{ text-align: left; }

  /* MOBILE TABLE LAYOUT */
  .table-responsive thead{ display: none; }

  .table-responsive table,
  .table-responsive tbody,
  .table-responsive tr{
    display: block;
    width: 100%;
  }

  .table-responsive tr{
    margin-bottom: 20px;
    border: 1px solid #ddd;
    padding: 15px;
    background: #fff;
  }

  .table-responsive td{
    display: block;
    width: 100% !important;
    border: 0 !important;
    padding: 8px 0;
  }

  .table-responsive td:first-child{
    font-weight: 600;
    margin-bottom: 12px;
  }

  .table-responsive td:nth-child(2)::before{
    content: "Under 3s";
    display: block;
    font-weight: 700;
    margin-bottom: 5px;
  }

  .table-responsive td:nth-child(3)::before{
    content: "3 Year Funded";
    display: block;
    font-weight: 700;
    margin-bottom: 5px;
  }
}

/* 3) Additional Help grid breaks */
@media (max-width: 991.98px){
  .fund_additional_grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 575.98px){
  .fund_additional_grid{ grid-template-columns: 1fr; }
  .fund_additional h2{ font-size: 24px; }
}

/* 4) Desktop-ish tweak you had */
@media (min-width: 768px){
  #fund-tabs-wrapper .fund-tab-button{ height: 100px; }
}

/* 5) iPhone / Mobile LANDSCAPE (recommended catch-all) */
@media (max-width: 991.98px) and (orientation: landscape){

  /* Example safe tweaks: tighten vertical spacing a bit */
  #fundintro{ margin-top: 40px !important; }

  /* If circles overlap in landscape, adjust them here */
  .fundedcircles{
    width: 40%;
    top: 540px;
    left: 400px;
  }

  /* Optional: reduce hero padding in landscape */
  .fund-hero{ padding: 50px 0; }

  #fund-nav-wrapper .fund-nav-btn { width : 200px;}

}

#fundboyimage { width : 65% !important; }
#fund-tabs-wrapper .fund-tab-button:hover { color : #ffffff; background-color : #593606 }