:root {
    --heading-font: "Lora";
    --body-font: "Roboto";
    --heading-font-weight: 700;
    --heading-font-size: 1.9rem;
    --heading-text-transform: uppercase;
    --font-size: 1rem;
    --font-family: "Roboto", "Lora", Arial;
    --font-weight: 400;
    --line-height: 1.5;
    --margin-bottom: 1.5rem;
    --margin-top: 1.5rem;
}

/*Global fix for padding/border overflow issues */

*,
*::before,
*::after {
    box-sizing: border-box;
}

.skip-link {
    position: absolute;
    /* Hides it way off to the left */
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
    /* Keeps it behind everything */
    z-index: -99;
    /* Dark bg for contrast when focused */
    background: #000;
    /* White text for readability */
    color: #fff;
    padding: 0.5rem 1rem;
    text-decoration: none;
    font-family: var(--body-font);
    font-size: 1rem;
}

.skip-link:focus {
    /* Slides it back into view on the left */
    left: 1rem;
    /* Positions it near the top */
    top: 1rem;
    width: auto;
    height: auto;
    overflow: visible;
    /* Bumps it above other elements */
    z-index: 1000;
    /* Optional: Adds a border for extra visibility */
    border: 2px solid #fff;
    border-radius: 4px;
}

body {

    margin-top: var(--margin-top);
    margin-bottom: var(--margin-bottom);
    font-family: var(--font-family);
    background-color: #F09A3E;
}

header,
main,
section,
footer {
    max-width: 1024px;
    margin: 1rem auto;
    background-color: hsl(240, 25%, 97%);
    color: rgb(5, 5, 5);
    padding: 1.5rem;
}

header {
    display: flex;
    flex-direction: row-reverse;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.2rem;
    background-color: #FFFFFF;
    align-items: center;
}

h1,
h2,
h3 {
    font-family: var(--heading-font);
    font-weight: var(--heading-font-weight);
    font-size: var(--heading-font-size);
    text-align: center;
}


.logo {
    width: 50px;
    right: -15px;
}


.menu {
    padding-right: 1rem;
}

.menu::before {
    content: "☰";
    font-size: 1.5rem;
    color: rgb(0, 0, 0);
    cursor: pointer;
}

.navigation {
    display: none;
    list-style: none;
    flex-direction: column;
    position: absolute;
    top: 5rem;
    left: 0.7rem;
    padding: 1rem;
    border: none;
    transition: all 0.3s ease-in-out;
    background-color: rgb(37, 27, 1);
    z-index: 1000;
}

.navigation.open {
    display: flex;
}

.menu.open::before {
    content: "❎";
}

.navigation li {
    padding: 0.5rem 0;
}

.navigation a {
    text-decoration: none;
    color: white;
    font-weight: lighter;
    font-size: 1rem;
}

.navigation a:visited {
    color: lightgray;
}

.navigation a:hover {
    color: gold;
}

.navigation a:active {
    color: goldenrod;
}

.navigation a.active {
    font-weight: bold;
    background-color: #007bff;
    border-radius: 4px;
}

footer {
    text-align: center;
    font-size: 0.95rem;
    color: white;
    font-weight: var(--font-weight);
    background-color: hsla(240, 100%, 25%, 0.863);
}


/* the homepage styling */

.worship {
    margin-top: 1rem;
    width: 100%;
    position: relative;
}

.home {
    text-align: center;
    font-size: var(--heading-font-size);
    font-weight: var(--heading-font-weight);
    position: absolute;
    top: 270px;
    padding: 0.5rem;
    color: black;
    left: 50%;
    transform: translateX(-50%);
    background-color: #FFFFFF;
}

.warm {
    position: absolute;
    top: 440px;
    color: black;
    text-align: center;
    font-family: var(--font-family);
    font-weight: var(--font-weight);
    font-size: var(--font-size);
    overflow-wrap: break-word;
    padding: 0 1rem;
    left: 50%;
    transform: translateX(-50%);
    background-color: #FFFFFF;
}

.butt,
.give {
    display: inline-block;
    /* Button-like block without full width */
    text-decoration: none;
    font-family: var(--body-font);
    font-size: var(--font-size);
    font-weight: var(--font-weight);
    color: #FFFFFF;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    margin: 1rem 0;
    text-align: center;
    width: fit-content;
}

.butt {
    background-color: hsla(240, 100%, 25%, 0.863);
    padding: 0.5rem;
    top: 510px;
    /* Remove old fixed top */
}

.give {
    top: 550px;
    background-color: hsla(240, 100%, 25%, 0.863);
    padding: 0.5rem;
    margin-top: 1rem;
    /* Replaces old margin-top */
}

/* Hero Figcaption: New styling for the wrapped caption */
.hero figcaption {
    font-family: var(--body-font);
    font-size: 1rem;
    /* Smaller than heading */
    font-style: italic;
    color: #666;
    text-align: center;
    margin-top: 0.5rem;
    padding: 0.5rem;
}

/* Optional: Ensure figure fits in grid */
.hero figure {
    /* Keeps image in right column */
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
}

.hero,
#vision,
#history {
    border: 2px solid #F09A3E;
}

.hero,
#history,
#vision {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    justify-content: center;
    align-items: start;
    grid-template-rows: auto auto;
    /*Ensures grid fills the section */
    width: 100%;

}

.hero h3,
#history h3,
#vision h3 {
    font-size: var(--heading-font-size);
    text-align: center;
}

.hero p,
#history p,
#vision p {
    font-family: var(--body-font);
    font-size: var(--font-size);
    text-align: center;
    margin: 0;
    overflow-wrap: break-word;
    hyphens: auto;
}

.hero picture img {
    max-width: 100%;
    margin: 0 auto;
    display: block;
    justify-content: center;
    align-items: center;
}

img {
    animation: fade 10s;
}

@keyframes fade {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* styling the about page */

.church {
    width: 100%;
    position: relative;
}

.bus {
    position: absolute;
    top: 210px;
    background-color: white;
    color: black;
    left: 50%;
    transform: translate(-50%);
    width: 80%;
    border-radius: 10px;
}

.first,
.second {
    text-align: center;
    font-size: 0.7rem;

}


.bold {
    font-weight: var(--heading-font-weight);
}

/* styling the donation page */

#support {
    color: #000;
    background-color: #FFFFFF;
    padding: 0.5rem;
    border-radius: 6px;
}

#support-note {
    background-color: navy;
    color: hsl(0, 0%, 99%);
    font-size: var(--font-size);
    font-family: var(--body-font);
    text-align: center;
    font-weight: var(--font-weight);
    padding: 0.5rem;
    border-radius: 6px;
}

#donation-form {

    margin: 2rem 0;
    border: 1px solid lightgray;
    border-radius: 6px;
    padding: .5rem 2%;

}

#donation-form legend {

    color: blue;
    padding: 0 .5rem;
}

#donation-form label {

    display: block;
    padding-top: 1rem;
    color: hsl(240, 97%, 15%);
    font-size: var(--font-size);
    font-weight: var(--font-weight);
}

#donation-form div {
    padding-top: 1rem;
    color: blue;
    font-size: .9rem;
}

#donation-form input[type="text"],
#donation-form textarea,
#donation-form input[type="number"] {
    background-color: hsl(0, 18%, 93%);
    display: block;
    border: solid #999;
    border-radius: 6px;
    padding: .75rem;
    color: hsl(0, 0%, 2%);
    width: 100%;
    max-width: 400px;
    appearance: none;
}

#donation-form input[type="radio"] {
    margin-right: 6px;
    cursor: pointer;
}

[role="group"] input[type="radio"]:focus+span,
[role="group"] label:focus-within {
    outline: 2px solid #007bff;
    border-radius: 4px;
}

.sr-only {
    position: absolute;
    height: 1px;
    width: 1px;
    overflow: hidden;
}

#donation-form input[type="submit"] {

    font-weight: var(--heading-font-weight);
    font-size: var(--font-size);
    border: none;
    background-image: linear-gradient(hsl(251, 70%, 27%), hsl(243, 64%, 11%));
    color: hsl(0, 0%, 100%);
    border-radius: 10px;
    padding: .8rem;
    width: 96%;
    max-width: 400px;
    margin: 1rem 2% 2rem 2%;
    box-shadow: 1px 1px 4px gray;
    cursor: pointer;

}

#donation-form input:required {
    border-bottom: solid 8px #cf200e;
}

#donation-form input:required:valid {
    border-bottom: solid 8px green;
}

/* styling the thanks.html page */

#gratitude,
.thanks-page h2,
.thanks-page p {
    text-align: center;
    font-weight: var(--font-weight);
    font-size: var(--font-size);
    font-family: var(--body-font);
    margin: var(--margin-bottom);
    padding: 1rem;
    max-width: 100%;
}

#gratitude h2,
.thanks-page h2 {
    font-size: var(--heading-font-size);
    font-family: var(--heading-font);
    font-weight: var(--heading-font-weight);
    text-transform: var(--heading-text-transform);
    color: black;
    background-color: white;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(240, 154, 62, 0.2);
}

/* Shared Buttons/Inputs for Gallery & Media */

#grid-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    justify-content: center;
    align-items: start;
    grid-template-rows: auto;
    /*Ensures grid fills the section */
    width: 100%;
    margin-bottom: 2rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border: 1px solid rgb(243, 7, 7);
    border-radius: 6px;
}


.media-post {
    overflow: hidden;
    margin: 2rem 0;
    border: 1px solid rgb(243, 7, 7);
    border-radius: 6px;
    padding: 2.5rem 2%;
    max-width: 96%;
    position: relative;
}

.media-post h3,
.media-post p {
    text-align: center;
    font-family: var(--body-font);
    font-size: var(--font-size);
    font-weight: var(--font-weight);
}

.media-post audio,
.media-post video {
    max-width: 100%;
    display: block;
    margin: 0.5rem auto;
}

label[for="search-input"],
label[for="search-media-input"] {
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 1rem auto;
    text-align: center;
}

#search-input,
#search-media-input {
    background-color: hsl(0, 18%, 93%);
    border: solid #999;
    border-radius: 6px;
    padding: 0.75rem;
    color: hsl(0, 0%, 2%);
    font-family: var(--body-font);
    font-size: 0.9rem;
    width: 100%;
}

#search-btn,
#add-gallery-btn,
#add-media-btn {
    font-size: var(--font-size);
    border: none;
    background-image: linear-gradient(#F09A3E, #E68A2F);
    /* Orange gradient to match theme */
    color: white;
    border-radius: 10px;
    padding: 0.8rem 1.5rem;
    margin: 0.5rem auto;
    display: block;
    box-shadow: 1px 1px 4px rgba(240, 154, 62, 0.3);
    cursor: pointer;
    transition: background-image 0.3s ease, transform 0.3s ease;
}

#search-btn:hover,
#add-gallery-btn:hover,
#add-media-btn:hover {
    background-image: linear-gradient(#E68A2F, #D47A1F);
    /* Subtle pop on hover */
    transform: scale(1.05);

}

#search-btn:focus,
#add-gallery-btn:focus,
#add-media-btn:focus {
    outline: 2px solid #007bff;
    border-radius: 4px;
}

/* Delete Button (shared for both pages) */
.delete-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    /* Red for delete */
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease, transform 0.3s ease;
    z-index: 1;
}

.delete-btn:hover {
    background-color: #c82333;
    transform: scale(1.1);
}

.delete-btn:focus {
    outline: 2px solid #007bff;
    border-radius: 50%;
}

img,
video,
audio {
    max-width: 100%;
    object-fit: cover;
    display: block;
    margin: 0 auto;
}


/* designing and styling the contact Us page with its form */

#contact-heading {

    color: #000;
    padding: 0.5rem;
    border-radius: 6px;
}

#contact-note {
    background-color: navy;
    color: hsl(0, 0%, 99%);
    font-size: var(--font-size);
    font-family: var(--body-font);
    text-align: center;
    font-weight: var(--font-weight);
    padding: 0.5rem;
    border-radius: 6px;
}

#contact-form {
    margin: 2rem 0;
    border: 1px solid lightgray;
    border-radius: 6px;
    padding: 1rem 2%;
}

#contact-form legend {
    font-size: var(--font-size);
    font-weight: var(--font-weight);
    font-family: var(--heading-font);
    color: blue;
    padding: 0 0.5rem;
}

#contact-form label {
    display: block;
    padding-top: 1rem;
    color: hsl(240, 97%, 15%);
    font-size: 0.9rem;
    font-weight: var(--font-weight);
}

#contact-form input[type="text"],
#contact-form input[type="email"],
#contact-form textarea {
    background-color: hsl(0, 18%, 93%);
    display: block;
    border: solid #999;
    border-radius: 6px;
    padding: 0.75rem;
    color: hsl(0, 0%, 2%);
    width: 100%;
    max-width: 400px;
    appearance: none;
}

#contact-form input[type="submit"] {
    font-size: var(--font-size);
    font-weight: var(--heading-font-weight);
    border: none;
    /* Orange gradient to match theme */
    background-image: linear-gradient(#F09A3E, #E68A2F);
    color: hsl(0, 0%, 2%);
    border-radius: 10px;
    padding: 0.8rem;
    width: 96%;
    max-width: 400px;
    margin: 1rem 2% 2rem 2%;
    box-shadow: 1px 1px 4px rgba(240, 154, 62, 0.3);
    cursor: pointer;
}

#contact-form input:required {
    border-bottom: solid 8px #cf200e;
}

#contact-form input:required:valid {
    border-bottom: solid 8px green;
}