:root {
  --color-primary: #bc6741;
  --color-bg-dark: #333333;
  --color-text: #444444;
  --color-text-light: #999999;
  --color-link: #bc6741;
  --color-bg-light: #ffffff;
  --color-bg-offwhite: #fdfaf7;
  --font-body: "Work Sans", sans-serif;
  --font-accent: "Kalam", cursive;
  --border-radius: 8px;
  --header-height: 4.5rem;
}

/* 1. Base & Reset */
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--color-text);
  font-family: var(--font-body);
  background-color: var(--color-bg-light);
  line-height: 1.6;
}
main {
  flex: 1;
  position: relative;
}
h1,
h2,
h3,
h4,
h5,
h6,
p,
ul {
  margin: 0;
  padding: 0;
  font-weight: normal;
}
img,
video {
  max-width: 100%;
  height: auto;
  display: block;
}
a {
  color: var(--color-link);
  text-decoration: none;
  transition: 0.2s;
}
a:hover {
  text-decoration: underline;
}

 *:focus-visible {
  outline-color: var(--color-primary);
}


/* 2. Header */
.page-header {
  background: white;
  border-bottom: 1px solid #eee;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  height: var(--header-height);
  display: flex;
  align-items: center;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.page-header a.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--color-bg-dark);
  font-family: var(--font-accent);
  font-size: 1.5rem;
}
.page-header a.logo img {
  height: 2.5rem;
  width: auto;
}

.main-nav ul {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}
.main-nav ul li a {
  color: var(--color-bg-dark);
  font-weight: 500;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.main-nav ul li.active > a {
  color: var(--color-primary);
  font-weight: bold;
}

/* Dropdown */
.main-nav ul li {
  position: relative;
}
.sub-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  border: 1px solid #eee;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  padding: 0.5rem 0;
  min-width: 180px;
  z-index: 1100;
}
.main-nav ul li:hover .sub-nav {
  display: block;
}
.sub-nav li a {
  padding: 0.5rem 1rem;
  display: block;
  text-transform: none;
  font-size: 0.85rem;
  font-weight: normal;
  color: var(--color-bg-dark);
}
.sub-nav li a:hover {
  background: var(--color-bg-offwhite);
  color: var(--color-primary);
}

/* 3. Page Hero (internal pages) */
body:not(.template-homepage) main {
  padding-top: var(--header-height);
}
.page-hero {
  background-size: cover;
  background-position: center;
  padding: 8rem 2.5rem;
  text-align: center;
  color: white;
  background-color: var(--color-bg-dark);
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.page-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1;
}
.page-hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  text-shadow: 0 2px 15px rgba(0, 0, 0, 0.6);
  position: relative;
  z-index: 2;
}

/* 4. Homepage Hero */
.intro {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background-size: cover;
  background-position: center;
  padding: 2rem;
  position: relative;
}
.intro::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.2);
}
.intro .logo {
  position: relative;
  z-index: 10;
  background: rgba(255, 255, 255, 0.9);
  padding: 4rem 3rem;
  border-radius: var(--border-radius);
  max-width: 550px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.intro .logo img {
  margin: 0 auto 1.5rem;
  border-radius: 50%;
  display: block;
}
.intro .logo h1 {
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-family: var(--font-accent);
  line-height: 1.1;
  margin: 0 0 1rem;
}
.intro .logo h2 {
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--color-text);
}

/* 5. Content Blocks (Homepage & Articles) */
.wrapper {
  width: 100%;
}
.even.wrapper {
  background-color: var(--color-bg-offwhite);
}
.wrapper section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 5rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 4rem;
  align-items: center;
}
.odd.wrapper section {
  flex-direction: row-reverse;
}
.wrapper section .image,
.wrapper section .content {
  flex: 1 1 400px;
}
.wrapper section .content h2 {
  font-size: 2.25rem;
  margin-bottom: 1.5rem;
  color: var(--color-bg-dark);
}

/* Video Specific Block Styles */
.block-video section {
  justify-content: center;
  text-align: center;
}
.block-video video {
  border-radius: var(--border-radius);
  max-width: 850px;
  width: 100%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  margin-top: 1rem;
}

.template-homepage .block-video video {
  max-width: unset;
}

/* 6. General Content (Article Body) */
.content-wrapper {
  max-width: 850px;
  margin: 4rem auto;
  padding: 0 1.5rem;
  font-size: 1.15rem;
}
.content-wrapper p {
  margin-bottom: 1.5rem;
}
.content-wrapper .date {
  color: var(--color-text-light);
  text-align: center;
  margin-top: -3rem;
  margin-bottom: 4rem;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.9rem;
}

/* Article-specific block spacing */
.template-article .block-video {
  padding: 2rem 0;
}
.template-article .block-sections section {
  padding: 3rem 0;
}

/* 7. Overview & Search Listings */
.items {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  margin-top: 3rem;
}
.list-item {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 3rem;
  background: white;
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s;
}
.list-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}
.list-item img {
  width: 100%;
  max-width: 280px;
  height: auto;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}
.list-item .info h2 {
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
  font-family: var(--font-accent);
}
.list-item .info .teaser {
  color: var(--color-text);
  margin-bottom: 1.5rem;
  font-size: 1rem;
  opacity: 0.8;
}
.list-item .info .view {
  font-weight: 700;
  color: var(--color-primary);
  text-transform: uppercase;
  font-size: 0.85rem;
}

/* 8. Gallery & Dialog */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  padding: 2rem 0;
}
.gallery .image {
  display: flex;
}
.gallery .image img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: 0.3s;
}
.gallery .image img:hover {
  filter: brightness(0.9);
}

dialog {
  background: transparent;
  border: none;
  padding: 0;
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
}
dialog::backdrop {
  background: rgba(0, 0, 0, 0.95);
}
.dialog-content {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}
dialog img {
  max-width: 90%;
  max-height: 80%;
  object-fit: contain;
}
dialog .close {
  position: absolute;
  top: 1.5rem;
  right: 2rem;
  font-size: 4rem;
  color: white;
  cursor: pointer;
  background: none;
  border: none;
  z-index: 100;
}
dialog .nav {
  position: absolute;
  top: 50%;
  color: white;
  font-size: 5rem;
  cursor: pointer;
  opacity: 0.5;
  transition: 0.2s;
  padding: 2rem;
  z-index: 90;
}
dialog .nav:hover {
  opacity: 1;
  text-decoration: none;
}
dialog .nav.prev {
  left: 1rem;
}
dialog .nav.next {
  right: 1rem;
}
dialog .caption {
  margin-top: 2rem;
  font-size: 1.5rem;
  font-family: var(--font-accent);
  color: white;
}

/* 9. Footer */
footer {
  background: var(--color-bg-dark);
  color: #ccc;
  padding: 6rem 1.5rem;
  text-align: center;
}
.footer-pages {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4rem;
  border-bottom: 1px solid #444;
  padding-bottom: 4rem;
}
.footer-item {
  display: flex;
  flex-direction: column;
  text-align: left;
  min-width: 160px;
}
.footer-item .title {
  color: white;
  font-weight: bold;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  font-size: 0.85rem;
  border-bottom: 2px solid var(--color-primary);
  display: inline-block;
  padding-bottom: 0.25rem;
  align-self: flex-start;
}
.footer-item a {
  color: #aaa;
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}
.footer-content {
  padding-top: 3rem;
  margin-top: 2rem;
  text-align: center;
  font-size: 0.9rem;
}

/* 10. Search Page Specific */
form.search {
  max-width: 800px;
  margin: 0 auto 4rem auto;
  text-align: center;
}
form.search input {
  width: 100%;
  padding: 1.25rem 2rem;
  font-size: 1.25rem;
  border: 2px solid #ddd;
  border-radius: 50px;
  font-family: var(--font-body);
}

/* 11. Responsive */
@media (max-width: 900px) {
  .page-header {
    position: relative;
    height: auto;
    min-height: 0;
  }
  body {
    padding-top: 0 !important;
  }
  body:not(.template-homepage) main {
    padding-top: 0;
  }

  .header-container {
    flex-direction: column;
    padding: 0.75rem 0;
  }
  .page-header a.logo {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
  }
  .main-nav {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .main-nav::-webkit-scrollbar {
    display: none;
  }
  .main-nav ul {
    width: max-content;
    margin: 0 auto;
    padding: 0 1.5rem 0.5rem;
    gap: 1rem;
  }
  .sub-nav {
    display: flex !important;
    position: static;
    box-shadow: none;
    border: none;
    gap: 1rem;
    padding: 0.25rem 0 !important;
  }
  .sub-nav li a {
    padding: 0.25rem 0 !important;
    font-size: 0.75rem !important;
  }

  .intro {
    min-height: calc(100vh - 6rem);
  }
  .intro .logo {
    padding: 2.5rem 1.5rem;
  }

  .wrapper section {
    flex-direction: column !important;
    text-align: center;
    gap: 2rem;
    padding: 2.5rem 1rem;
  }
  .wrapper section .image,
  .wrapper section .content {
    flex: 1 1 100%;
  }
  .wrapper section .image {
    order: 1;
  }
  .wrapper section .content {
    order: 2;
  }

  .block-video video {
    margin-top: 1rem;
    border-radius: 0;
    box-shadow: none;
  }

  .list-item {
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
    text-align: center;
    padding: 1.5rem;
  }
  .list-item img {
    max-width: 100%;
    height: auto;
  }

  dialog .nav {
    font-size: 3rem;
    padding: 1rem;
  }
  dialog .close {
    top: 1rem;
    right: 1.5rem;
    font-size: 3rem;
  }
  dialog .caption {
    font-size: 1.1rem;
    margin-top: 1rem;
    padding: 0 1rem;
  }
}

@media (max-width: 600px) {
  .footer-pages {
    flex-direction: column;
    align-items: center;
    gap: 2.5rem;
  }
  .footer-item {
    text-align: center;
    align-items: center;
  }
  .footer-item .title {
    align-self: center;
  }
}

/* Accessibility */
.skip-link {
  position: fixed;
  top: 0;
  left: 1rem;
  transform: translateY(-100%);
  background: var(--color-primary);
  color: white;
  padding: 0.75rem 1.5rem;
  z-index: 10000;
  transition: transform 0.3s;
  border-radius: 0 0 8px 8px;
}
.skip-link:focus {
  transform: translateY(0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
