/* Custom fonts for use on h1 and h2 */
@font-face {
  font-family: 'MoreSugar';
  src: url('../fonts/MoreSugarRegular.woff2') format('woff2'),
       url('../fonts/MoreSugarRegular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'MoreSugar';
  src: url('../fonts/MoreSugarThin.woff2') format('woff2'),
       url('../fonts/MoreSugarThin.woff') format('woff');
  font-weight: 100;
  font-style: normal;
}

/* Font and text related - set as Poppins globally */

.body, form, button, h1, h2, h3, h4, p, span, input  {
    font-family: 'Poppins', sans-serif;
}


/* General reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
}

.screen-reader-text {
  position: absolute; /*Positions the link absolutely on the page, allowing it to be placed anywhere. */
  left: -9999px; /* Moves the link far off-screen to the left, making it invisible to sighted users. */
  z-index: 999; /* Sets a high z-index, ensuring that the link will be on top of other page elements if it becomes visible. */
  padding: 1em;
  background-color: black;
  color: white;
  opacity: 0; /* Sets the link's opacity to 0, making it fully transparent and invisible.*/
}

.screen-reader-text:focus {
  left: 50%; /* When the link receives focus (e.g., when a keyboard user tabs to it), it is repositioned horizontally to the centre of the screen. */
  top: 50%;
  transform: translateX(-50%); /*This centres the link horizontally by moving it back to the left by 50% of its own width. */
  opacity: 1; /*The link's opacity is set to 1, making it fully visible. */
}

body {
    background-color: #f9f8f6;
    color: #224862;
    line-height: 1.6;
    margin: 0;
}

a {
    color: #224862;
    text-decoration: none;
}

/* Header */
.index-hero {
    background-image: url('../images/hero_img.jpg');
    width: 100%;
    height: 700px;
    background-size: cover;
    background-repeat:no-repeat;
    background-color: #fff;
}

header {
    background-color: #224862;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    color: #f9f8f6;
    height: 100px;
}

#index{
    background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.01));
    background-color: transparent;
}

header img {
    height: 60px;
    margin-right: 1rem;
}
    
header a {
    line-height: 0;
}

/* Home page */

.hero-items {
    display: flex;
    flex-direction: row;
    gap: 4rem;
}

.english-text {
    background-color: #F6F6F4;
    width: fit-content;
    color: #224862;
    border-radius: 10px;
    margin: 2rem;
    margin-top: 15rem;
}

.welsh-text {
    background-color: #224862;
    width: fit-content;
    color: #F6F6F4;
    border-radius: 10px;
    margin: 2rem;
}

.english-text h1, .welsh-text h1 {
    font-family: 'MoreSugar', cursive, 'sans-serif';
    padding: 0px 10px;
    font-size: 3rem;
}

.search-div {
    margin-top: 15rem;
    margin-left: 12rem;
}

.search-box {
    background-color: #F1F1E4;
    width: auto;
    height: auto;
    border-radius: 10px;
    border: 1.5px solid #224862;
}

.search-box h3 {
    padding: 0.5rem 2rem;
    font-size: 1.5rem;
}

.search-box hr {
    width: 100%;
    border: 1px dashed #224862;
}

.search-box p {
    font-size: 0.9rem;
    padding: 0 0rem 1rem 1rem;
    margin-bottom: 0rem;
}

.search-function {
    padding: 1rem 1rem;
    height: fit-content;
}

.search-function form {
    flex-direction: row;
}

.search-function button {
    padding: 0.5rem 1rem;
    font-size: 1rem;
    border: none;
    background: #224862;
    color: #fff;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    margin-top: 0rem;
}

.search-function input {
    margin-bottom: 0rem;
    border-radius: 4px 0 0 4px;
    margin-right: 0px;
}

.info-container {
    background-color: #F6F6F4;
    display: flex;
    justify-content: center;
    margin-top: 6rem;
    margin-bottom: 4rem;
    border: 1.5px solid #000000;
    width: fit-content;
    gap: 3rem;
    border-radius: 10px;
    margin-left: auto;
    margin-right: auto;
}

.info-items {
    display: flex;
    flex-direction: row;
      
}

.text-section {
    padding: 2rem;
}

.text-section hr {
    border-bottom: #000000;
    width: 6rem;
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
}

.text-section button {
    padding: 0.4rem;
}

.text-section h3 {
    font-size: 1.5rem;
}

.image-section {
    background-color: #224862;
    padding: 1rem;
    border-radius: 0 8px 8px 0;
}

.image-section img {
    width: 340px;
    height: 360px;
    object-fit: cover;
    border-radius: 20px;
    margin: -3rem 0 0 0;
}

.recent-opportunities {
    background-color: #fff;
    padding-top: 3rem;
    padding-bottom: 1rem;
}

.recent-opportunities-title {
    margin-left: auto;
    margin-right: auto;
    width: fit-content;
    margin-bottom: 3rem;
}

.recent-opportunities-title h1 {
    font-family: 'MoreSugar', cursive, sans-serif;
    font-size: 3rem;
}

.title {
    width: 100%;
    height: auto;
    max-height: 300px;
    background-color: #F6F6F4;
}

.title h1, h2 {
    font-family: 'MoreSugar', cursive, sans-serif;
    font-size: 3rem;
    padding: 2rem 16rem;
    color: #224862;
}

.title h2 {
    font-weight: 100;
}

.opportunity-title h1, h2 {
    font-family: 'MoreSugar', cursive, sans-serif;
    font-size: 3rem;
    padding: 0rem 16rem;
    color: #224862;
}

.opportunity-title h2 {
    font-weight: 100;
    margin-top: 0rem;
}

/* Registration container */
.registration_container {
    max-width: 700px;
    margin: 0rem auto;
    padding: 2rem;
    background-color: #fff;
}

.container h2 {
    font-family: 'MoreSugar', cursive, sans-serif;
    margin-bottom: 1rem;
    font-size: 3rem;
}

p {
    margin-bottom: 1rem;
    font-size: 0.95rem;
    color: #224862;
}

/* Opportunities on home page styling */

/* Slider */
.slider-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 90%;
    margin: 30px auto;
    position: relative;
}

/* Arrows */
.arrow.left {
    position: absolute;
    left: -0px;
    top: 50%;
    transform: translateY(-50%);
}

.arrow.right {
    position: absolute;
    right: -0px;
    top: 50%;
    transform: translateY(-50%);
}

.arrow:hover {
    background:#21354E;
    color:#fff;
}

/* Slider */
.slider {
    display: flex;
    overflow-x: auto;
    width: 80%;
    scroll-behavior: smooth;
    gap:30px;
    -ms-overflow-style: none;
    scrollbar-width: none;
    padding-bottom: 1rem;
    padding-left: 1rem;
    padding-right: 1rem;
}

.slider::-webkit-scrollbar {
    display: none;
}

/* Opportunity cards */
.card {
    min-width: 300px;
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow:0 0 10px rgba(0,0,0,0.08);
    height: fit-content;
}

.card img {
    width:100%;
    height:200px;
    object-fit: cover;
}

.card-content {
    padding:18px;
    text-align:left;
}

.card h3 {
    font-size:1.2rem;
    margin:0 0 8px;
    color:#21354E;
}

.card p {
    font-size:0.9rem;
    margin:5px 0;
}

.card button {
    margin-top:12px;
    width:100%;
    padding:10px;
    border:none;
    border-radius:8px;
    background:#21354E;
    color:white;
    cursor:pointer;
}

.card button:hover {
    opacity:0.9;
}


/* Register a new opportunity form style */
form {
    display: flex;
    flex-direction: column;
}

label {
    margin: 0.5rem 0 0.2rem;
    font-weight: bold;
}

input,
select,
textarea {
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-size: 1rem;
    width: 100%;
}

textarea {
    resize: vertical;
    min-height: 150px;
}

button {
    background-color: #224862;
    color: #fff;
    padding: 0.75rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 0.5rem;
}

button:hover {
    background-color: #16314a;
}

.privacy {
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

/* Register a new opportunity form error styling */
input.error,
textarea.error,
select.error {
    border: 2px solid red;
    background-color: #ffe6e6;
}

.error_message {
    color: red;
    font-size: 0.9em;
}

/* Footer */
footer {
    background-color: #224862;
    color: #ffffff;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: auto;
}

footer img {
    height: 100px;
    margin-right: 1rem;
    margin-top: 2.5rem;
    margin-bottom: 2.5rem;
}

footer div {
    font-size: 0.8rem;
    max-width: 400px;
    margin-top: 5.2rem;
    margin-right: 5rem;
}

footer a {
    line-height: 0;
}

/* Media queries for responsiveness */

@media (max-width: 650px) {
    .container {
    margin: 1rem;
    padding: 1rem;
}
      
footer {
    flex-direction: column;
    text-align: center;
}

footer div {
    text-align: center;
    margin-top: 0.5rem;
}

.slider-container {
    width: 100%;
    gap: 15px;
}

.card {
    min-width: 220px;
}

.arrow {
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
}

}