/* TODO: Work in dark theme */

/* Definitions */
:root {
  /* Header settings */
  --header-height: 108px;
  --header-color-title: #fff;
  --header-color-menu: #fff;
  --header-color-hover: #555;
  --header-color-background: #333;
  /* Content settings */
  --content-spacing: 36px;
  --content-width: min(1100px, 100%);
  --content-line-height: 1.5;
}

/* General */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  display: flex;
  flex-direction: column;
}

html {
  scroll-padding-top: var(--header-height);
  scroll-behavior: smooth;
  font-size: 20px;
  overflow-x: hidden;
}

body {
  background-image: url('/images/banner-berezowskich-oblata-ad1754.png');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  font-family: 'EB Garamond', serif !important;
  line-height: var(--content-line-height);
}

/* Header */
header {
  display: flex;
  flex-direction: column;
  background-color: var(--header-color-background);
  padding: 0;
  align-items: center;
  position: fixed;
  top: 0;           /* Positions it at the top of the viewport */
  left: 0;          /* Aligns it to the left edge */
  width: 100%;      /* Makes it span the full width of the page */
  height: var(--header-height);
  z-index: 1000;    /* Ensures it stays above other content */
  opacity: 0.9;
}

header .logo {
  color: var(--header-color-title);
  font-size: clamp(1.25rem, 5vw, 2rem);
  font-weight: bold;
  font-variant-caps: small-caps;
  flex: 1;
  text-align: center;
  max-height: 60px;
}

/* Navigation */
header .menu {
  display: flex;
  color: var(--header-color-menu);
  font-size: 1rem;
  flex-direction: row;
}

nav ul {
  display: flex;
  gap: 12px;
  list-style: none;
}

nav ul li a {
  display: block;
  color: #fff;
  text-decoration: none;
  padding: 6px 12px;
  transition: background 0.3s;
  border-radius: 4px;
}

nav ul li a:hover {
  background-color: #555;
}

.menu-icon {
  color: var(--header-color-menu);
  display: none;
  font-size: 24px;
  cursor: pointer;
  padding: 1rem;
}

/* Hide checkbox */
#menu-hidden-checkbox {
  display: none;
}

/* Mobile Styles */
@media (max-width: 767px) {

  header {
    flex-direction: row;
    justify-content: right;
  }

  .menu-icon {
    display: block;
  }

  nav ul {
    display: none;
    position: absolute;
    top: var(--header-height);
    right: 0;
    flex-direction: column;
    background-color: #333;
    overflow: hidden;
    padding: 12px;
    gap: 10px;
    text-align: left;
  }

  /* Show menu when checkbox is checked */
  #menu-hidden-checkbox:checked ~ nav ul {
    display: flex;
  }
}

@media (max-width: 319px) {
  header .logo {
    display: none;
  }
}

/* Content */

main {
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  flex: 1;
}

main > *:first-child {
  padding-top: var(--header-height);
}

main > section, main > div {
  width: 100%;
  padding: var(--content-spacing) calc((100% - var(--content-width)) / 2 + var(--content-spacing));
  background-color: white;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.banner {
  background-color: transparent;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin-top: 0;
}

.banner-overlay {
  background: rgba(255,255,255,0.7);
  width: 100%;
  padding: var(--content-spacing);
  margin-top: auto;
  margin-bottom: auto;
  position: relative;
  top: calc(var(--header-height) / 2);
  line-height: var(--content-line-height);
  font-size: clamp(1rem, 5vw, 1.25rem);
  font-weight: bold;
  /* min-height: 50vh; */
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--content-spacing);
}

#about .banner-overlay {
  margin-bottom: var(--content-spacing);
  max-width: 25em;
  min-height: fit-content;
}

main h1, main h2, main h3 {
  text-align: center;
  font-variant-caps: small-caps;
  scroll-margin-top: var(--content-spacing);
  margin-top: var(--content-spacing);
  margin-bottom: var(--content-spacing);
}

main h1 {
  font-size: 2.0rem;
  font-weight: 800;
}

main h2 {
  font-size: 1.75rem;
  font-weight: 600;
}

main h3 {
  font-size: 1.25rem;
}

main p {
  text-align: justify;
}

/* TODO: Top margin for the first child and bottom for the last child only */

main p:first-child, main aside:first-child {
  margin-top: calc((1.0 - var(--content-line-height)) * 1.0em);
}

main p:last-child, main aside:last-child {
  margin-bottom: calc((1.0 - var(--content-line-height)) * 1.0em);
}

main ul, main ol {
  padding-left: 2em;
}

main a {
  color: #444;
}

main a:hover {
  text-decoration: underline;
}

main aside {
  font-style: italic;
}

.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--content-spacing);
  margin-top: var(--content-spacing);
}

.split img {
  width: 100%;
  height: auto;
  display: block;
}

/* Zoom-in images */

.zoom-in {
  width: 100%;         /* fixed or responsive width */
  aspect-ratio: 1 / 1;
  overflow: hidden;     /* hides zoom overflow */
  display: inline-block; /* keeps multiple containers in line if needed */
}

.zoom-in img {
  width: 100%;
  height: 100%;
  object-fit: cover;          /* fill the container */
  transition: transform 0.4s ease;
  display: block;
}

.zoom-in:hover img {
  transform: scale(1.1);
}

/* Donation section */

.box-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  margin: var(--content-spacing) 0;
  gap: 20px;
}

.box-list > * {
  display: flex;
  flex-direction: column;
  border: 2px solid #ccc;
  border-radius: 6px;
  height: 100%;
  padding: 1em;
  transition: all 0.2s ease;
  min-height: 320px;
}

.box-list > *:hover {
  transform: translateY(-3px) translateX(-3px);
  box-shadow: 6px 6px 6px rgba(0, 0, 0, 0.15);
}

.box-list * {
  text-align: left;
}

.green-button {
  display: block;
  text-decoration: none;
  color: #fff;
  background-color: #55cc66;
  padding: 6px 12px;
  text-align: center;
  border-radius: 4px;
}

.green-button:hover {
  text-decoration: none;
  background-color: #6F7;
}

.box-list > * .green-button {
  align-self: flex-end;
  min-width: 50%;
  margin-top: auto;
  margin-bottom: 10px;
  margin-right: 10px;
}

main p > .green-button {
  margin: var(--content-spacing);
  align-self: center;
}

/* F.A.Q. section */

#faq {
  gap: 6px;
}

main details {
  border: 1px solid #ccc;
  border-radius: 6px;
  margin-bottom: 10px;
  background: #fff;
}

main summary {
  padding: 12px 16px 12px 36px;
  cursor: pointer;
  font-weight: 600;
  list-style: none; /* removes default marker */
  position: relative;
  margin-top: 3px;
  margin-bottom: 3px;
}

/* Custom arrow */
main summary::before {
  content: "\276F";
  position: absolute;
  left: 16px;
  transition: transform 0.25s ease;
}

/* Rotate arrow when open */
main details[open] summary::before {
  transform: rotate(90deg);
}

main details p {
  padding: 0 16px 14px 28px;
  margin: 0;
  color: #444;
}

/* Full height for "Contact Us" section */

.full-height {
  min-height: calc(100vh - var(--header-height));
  display: flex;
  justify-content: center;
  gap: 0;
}

/* Mailing address formatting */
.mailing-address {
  padding: 2em;
  white-space: pre;
  font-size: 0.8rem;
}

/* Footer style */
footer {
  width: 100%;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 8px;
  background-color: var(--header-color-background);
  color: var(--header-color-title);
  font-size: 0.8rem;
}

/* 404 Page */

.button {
  width: 50%;
  margin: auto;
  text-decoration: none;
  color: #fff;
  background-color: var(--header-color-background);
  /* margin-top: var(--content-spacing); */
  padding: 6px 12px;
  text-align: center;
  border-radius: 4px;
}

.button:hover {

  text-decoration: none;
  background-color: var(--header-color-hover);
}

/* Guide */

.lang-badge {
  display: inline-block;
  background-color: #ccc;
  color: gray;
  font-size: 0.5rem;
  margin-left: 5px;
  padding: 2px 5px;
  border-radius: 3px;
  text-decoration: none;
}

/* Collection */

.gallery {
  list-style: none;
}

.gallery li a {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--content-spacing);
  margin-top: var(--content-spacing);
}

.gallery a, .gallery a:hover {
  text-decoration: none;
}

.gallery img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
}
