html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-size: 100%;
}

body {
  background-image: url(../images/bg.jpg);
  background-attachment: fixed;
  color: #fff;
  font-family: "Lato", sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  padding-top: 100px;
  flex: 1;
}
@media screen and (min-width: 41em) {
  main {
    padding-top: 100px;
  }
}

*, *::after, *::before {
  box-sizing: border-box;
}

h1, h2 {
  margin: 0;
}

img {
  max-width: 100%;
  height: auto;
}

a, a:visited {
  text-decoration: none;
  color: #8d53ea;
}

a:focus,
a:active,
a:visited,
a:hover {
  outline: none !important;
  border: none !important;
  text-decoration: none !important;
  box-shadow: none !important;
}

a img:focus,
a img:active {
  outline: none !important;
  border: none !important;
  box-shadow: none !important;
}

strong {
  color: #966bdb;
}

em {
  color: #bbbaf7;
}

/* --- Layout Wrappers --- */
.wrapper, .block {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 10px;
}
@media (max-width: 700px) {
  .wrapper, .block {
    padding: 0 5px;
  }
}

.block {
  position: relative;
  max-width: 1200px;
  background-color: rgba(0, 0, 0, 0.75);
  margin: auto;
  padding: 20px 10px;
  border-radius: 20px;
  border: 2px solid silver;
}
@media screen and (min-width: 50em) {
  .block.-fullwidth {
    max-width: 900px;
  }
}

/* --- Text Utilities --- */
.text-center {
  text-align: center;
}

.text-white {
  color: #fff;
}

/* --- Header --- */
.header {
  position: fixed;
  width: 100%;
  padding: 5px 0;
  background-image: url(../images/header.png);
  box-shadow: 0px 5px 5px rgba(0, 0, 0, 0.726);
  z-index: 10;
}
.header .wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.header__image {
  flex: 0 1 auto;
  height: 60px;
}
@media screen and (min-width: 41em) {
  .header__image {
    height: 80px;
  }
}
.header__nav {
  display: none;
  flex: 0 1 auto;
  gap: 1.5rem;
  transition: color 150ms ease-in-out;
}
@media (min-width: 700px) {
  .header__nav {
    display: flex;
    gap: 1.5rem;
  }
  #offcanvas {
    display: none;
  }
}
@media (max-width: 699px) {
  .header__nav {
    display: none;
  }
  #offcanvas {
    display: block;
  }
}
.header__nav-item {
  font-size: 1.125rem;
  color: #8d53ea;
  padding: 0 15px;
  transition: color 150ms ease-in-out;
}
.header__nav-item:hover {
  color: #6135a7;
}

/* --- Offcanvas Navigation --- */
.offcanvas {
  position: fixed;
  width: 100%;
  height: 100vh;
  background-color: #36384c;
  transform: translateX(100%);
  transition: transform 400ms ease-in-out;
  z-index: 10;
  padding: 10px;
}
.offcanvas.open {
  transform: translateX(0%);
}
.offcanvas__content {
  padding: 2rem 1rem;
}
.offcanvas__item {
  font-size: 1.2rem;
  margin-bottom: 1rem;
}
.offcanvas__image {
  margin-bottom: 20px;
}

/* --- Intro Section --- */
.intro {
  display: flex;
  margin-left: 75px;
  flex-direction: row;
  align-items: flex-start;
  gap: 2rem;
}
.intro__figure {
  float: left;
  margin: 15px 10px 10px 0;
  max-width: 200px;
  height: auto;
  border-radius: 12px;
}
.intro__text {
  flex: 1 1 300px;
  min-width: 220px;
  max-width: 1000px;
}
.intro__text p {
  text-align: justify;
}
@media (max-width: 700px) {
  .intro {
    flex-direction: column;
    align-items: center;
    margin-left: 0;
  }
  .intro__figure {
    max-width: 25%;
  }
}

/* --- Podcast Carousel --- */
.podcast-carousel {
  position: relative;
  max-width: 700px;
  margin: 0 auto;
}
.podcast-carousel .swiper-slide {
  display: flex;
  justify-content: center;
  align-items: center;
}
.podcast-carousel iframe {
  display: block;
  margin: 0 auto;
}
.podcast-carousel .swiper-button-next,
.podcast-carousel .swiper-button-prev {
  top: auto;
  bottom: 10px;
  transform: translateY(0);
  z-index: 2;
}
.podcast-carousel .swiper-pagination {
  position: relative;
  margin-top: 20px;
  text-align: center;
  z-index: 1;
  font-size: 16px;
  color: #fff;
}
@media (max-width: 700px) {
  .podcast-carousel .swiper-button-next,
  .podcast-carousel .swiper-button-prev {
    bottom: -20px;
  }
  .podcast-carousel .swiper-pagination {
    margin-top: 10px;
  }
}

/* --- Footer --- */
footer {
  margin-top: 0;
  padding: 24px 0 12px 0;
  text-align: center;
  background-image: url(../images/footer.png);
  background-repeat: no-repeat;
  background-position: bottom;
  font-size: 1rem;
}
footer img {
  vertical-align: middle;
  margin: 0 5px;
  height: 45px;
}
@media (max-width: 700px) {
  footer p {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }
  footer img {
    height: 35px;
  }
}

/* --- Gallery Grids --- */
#gallery .grid {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start; /* Align items to the start vertically */
}
#gallery .grid p {
  width: 100%; /* Allow the paragraph to take up the full width of its container */
  margin: 0 auto; /* Center the paragraph */
  text-align: center; /* Center-align the text */
  margin-bottom: 0.5em; /* Add spacing below the paragraph */
}
#gallery .grid h1 {
  margin-top: 0;
}
#gallery .grid p:last-child {
  margin-bottom: 0;
}
#gallery .grid__item {
  background: rgba(0, 0, 0, 0.7); /* Slightly darker background for gallery items */
  border-radius: 8px;
  padding: 1rem;
  flex: 1 1 calc(33.33% - 2rem); /* 3 items per row */
  max-width: calc(33.33% - 2rem); /* Ensure items don't exceed their allocated width */
  margin-bottom: 1rem;
}
#gallery .grid__image {
  width: 100%; /* Allow the image to fill the grid item */
  height: auto; /* Maintain aspect ratio */
  border-radius: 8px; /* Optional: Add rounded corners */
  display: block;
  margin: 0 auto; /* Center align the image */
}
#gallery .grid__content h1 {
  text-align: center;
  color: #966bdb;
}
#gallery .grid__content p {
  width: 100%; /* Allow the paragraph to take up the full width of its container */
  margin: 0 auto; /* Center the paragraph */
  text-align: center; /* Center-align the text */
  margin-bottom: 0.5em; /* Add spacing below the paragraph */
}
@media (max-width: 700px) {
  #gallery .grid__item {
    flex: 1 1 100%; /* Each item takes the full width */
    max-width: 100%;
  }

  #gallery .grid__image {
    height: auto; /* Adjust height for smaller screens */
  }
    #gallery .grid p {
    font-size: 0.9rem; /* Adjust font size for smaller screens */
    margin-bottom: 1rem; /* Add more spacing for readability */
  }
}
/* --- Charity Gallery Grids --- */
.grid {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  justify-content: center;
}
.grid p {
  text-align: justify;
  min-width: 220px;
  max-width: 1000px;
  overflow: hidden;
  margin-bottom: 0.5em;
}
.grid h1 {
  margin-top: 0;
}
.grid p:last-child {
  margin-bottom: 0;
}
.grid__item {
  background: rgba(0, 0, 0, 0.7);
  border-radius: 8px;
  padding: 1rem;
  max-width: 320px;
  flex: 1 1 220px;
  margin-bottom: 1rem;
}
.grid__image {
  max-width: 320px;
  height: 195px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  border-radius: 6px;
  margin-bottom: 1rem;
}
.grid__content h1 {
  text-align: center;
  color: #966bdb;
}
.grid__content p {
  text-align: center;
  min-width: 220px;
  max-width: 1000px;
  overflow: hidden;
  margin-bottom: 0.05em;
}

/* --- Accessibility Improvements --- */
.header__open:focus,
.offcanvas__close:focus {
  outline: 2px solid #8d53ea;
  outline-offset: 2px;
}

.block__content img.about-header,
.block__content img.charity-header,
.block__content img.podcast-header, 
.block__content img.magick-header {
  display: block;
  margin: 0 auto;
}

/* --- Section Specific Spacing --- */
#about .block,
#about .block__content.-text {
  padding-top: 10px;
  padding-bottom: 10px;
}
#about .block__content .intro {
  margin-bottom: 0;
}
#home .block {
  position: relative;
  max-width: 1200px;
  margin: auto;
  padding: 20px 10px;
  text-align: center;
}
#blog .block {
  text-align: center;
}

/* Home header image */
.home-header {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}

.tumblr-post {
  max-width: 100%;
  margin: 0 auto;
  padding: 20px;
  background-color: rgba(0, 0, 0, 0.75); /* Match your website's block background */
  border: 2px solid silver; /* Optional border */
  border-radius: 12px; /* Rounded corners */
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.5); /* Subtle shadow for depth */
}

.tumblr-post a {
  color: #8d53ea; /* Match your link color */
  text-decoration: none;
  font-weight: bold;
}

.tumblr-post a:hover {
  color: #6135a7; /* Darker hover color */
  text-decoration: underline;
}