@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700&display=swap');

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

body {
  font-family: 'Cinzel', serif;
  background-color: #c8c8c8;
  color: #5c4033;
  line-height: 1.6;
  min-height: 100vh;
  padding: 0;
  margin: 0;
}

:root {
  --top-bar-sticky-offset: 150px;
}

a {
  color: inherit;
}

/* Top Navigation Bar */
.top-bar {
  background-color: #ffffff;
  padding: 30px 36px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: 150px;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  justify-self: start;
}

.top-bar .logo {
  height: 108px;
  width: auto;
}

.brand-link h1 {
  font-size: 2.8rem;
  color: #4f4f4f;
  margin: 0;
  line-height: 1;
}

.top-nav {
  margin-bottom: 0;
  justify-self: center;
}

.top-nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
}

.top-nav a {
  color: #4f4f4f;
  text-decoration: none;
  font-weight: 600;
  padding: 18px 22px;
  border: 1px solid rgba(79, 79, 79, 0.35);
  border-radius: 999px;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  font-size: 1.15rem;
}

.top-nav a:hover,
.top-nav a:focus-visible {
  background: #4f4f4f;
  color: #ffffff;
  border-color: #4f4f4f;
}

.container {
  max-width: 1200px;
  margin: 20px auto;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
  padding: 40px;
  position: relative;
}

.container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text fill="%23d2b48c" font-size="20" y="50%">✦</text></svg>') repeat;
  opacity: 0.1;
  pointer-events: none;
}

/* Typography */
h1, h2, h3 {
  font-weight: 700;
  color: #8b4513;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

p {
  margin-bottom: 15px;
  font-size: 1.1em;
}

.page-header {
  margin-bottom: 32px;
}

.page-header p:last-child {
  margin-bottom: 0;
}

.faction-banner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 20px;
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 12px;
  background: #ffffff;
  border-top: 1px solid rgba(139, 69, 19, 0.08);
  border-bottom: 1px solid rgba(139, 69, 19, 0.12);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  position: sticky;
  top: var(--top-bar-sticky-offset);
  z-index: 90;
}

.faction-banner-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 84px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(139, 69, 19, 0.14);
  background: #ffffff;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.faction-banner-link img {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.faction-banner-link:hover,
.faction-banner-link:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.14);
  border-color: rgba(139, 69, 19, 0.45);
}

.faction-banner-link.is-active {
  border-color: #8b4513;
  border-width: 3px;
}

.home-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  align-items: stretch;
  gap: 24px;
  margin: 36px 0;
  padding: 24px;
  background: rgba(245, 236, 220, 0.78);
  border: 1px solid rgba(139, 69, 19, 0.18);
  border-radius: 18px;
  overflow: hidden;
}

.home-split-image-right {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
}

.home-split-media {
  min-height: 320px;
}

.home-split-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid rgba(139, 69, 19, 0.22);
}

.home-split-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8px 6px;
}

.home-split-copy h3 {
  font-size: 2rem;
  margin-bottom: 16px;
}

.home-split-copy p {
  font-size: 1.12rem;
  max-width: 60ch;
}

.home-links {
  margin-top: 12px;
  grid-column: 1 / -1;
}

.home-links ul {
  list-style: none;
  padding-left: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 16px;
}

.home-links li {
  margin: 0;
}

.faction-quick-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 76px;
  padding: 14px 16px;
  text-decoration: none;
  color: #5c4033;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(139, 69, 19, 0.18);
  border-radius: 12px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.faction-quick-link img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
}

.faction-quick-link span {
  font-size: 1rem;
  line-height: 1.3;
}

.faction-quick-link:hover,
.faction-quick-link:focus-visible {
  background: #ffffff;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

.faction-title {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.faction-title img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.faction-title h2 {
  margin-bottom: 0;
}

.downloads-list {
  list-style: none;
  display: grid;
  gap: 16px;
}

.downloads-list a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 220px;
  padding: 14px 18px;
  border: 2px solid #8b4513;
  border-radius: 999px;
  color: #8b4513;
  text-decoration: none;
  font-weight: 600;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.downloads-list a:hover,
.downloads-list a:focus-visible {
  background: #8b4513;
  color: #f4e4bc;
}

/* Navigation */
nav {
  margin-bottom: 40px;
}

nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 20px;
}

nav a {
  color: #8b4513;
  text-decoration: none;
  font-weight: 600;
  padding: 10px 20px;
  border: 2px solid #8b4513;
  border-radius: 5px;
  transition: all 0.3s ease;
}

nav a:hover {
  background: #8b4513;
  color: #f4e4bc;
}

/* Banner */
.banner {
  text-align: center;
  font-size: 3em;
  font-weight: bold;
  color: #8b4513;
  padding: 20px 0;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 10px;
  margin-bottom: 30px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

/* Details/Summary for collapsible content */
details {
  margin: 20px 0;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid #d2b48c;
  border-radius: 5px;
  padding: 10px;
}

summary {
  font-size: 1.2em;
  font-weight: bold;
  cursor: pointer;
  color: #8b4513;
}

details ul {
  margin-top: 10px;
  padding-left: 20px;
}

details li {
  margin: 5px 0;
}

details a {
  color: #0066cc;
  text-decoration: none;
}

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

/* Image Viewer */
.image-viewer {
  background: rgba(255, 255, 255, 0.8);
  border: 20px solid #d2b48c;
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
  text-align: center;
}

.image-viewer-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin: 20px 0;
}
.card-gallery {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.card-gallery img {
  width: 100%;
  height: auto;
  border: 1px solid #d2b48c;
  border-radius: 5px;
  cursor: pointer;
  transition: transform 0.2s ease-in-out;
}

.card-gallery img:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

@media (max-width: 1100px) {
  .card-gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .card-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .card-gallery {
    grid-template-columns: 1fr;
  }
}

.image-viewer-image {
  width: 75%;
  max-width: 800px;
  height: auto;
  border: 1px solid #d2b48c;
  border-radius: 5px;
  background: white;
  object-fit: contain;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  margin-top: 20px;
}

.contact-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #5c4033;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #d2b48c;
  border-radius: 10px;
  padding: 12px;
  width: 120px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.contact-link img {
  width: 48px;
  height: 48px;
}

.contact-link:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

@media (max-width: 600px) {
  .contact-link {
    width: 100%;
  }
}
.image-viewer button {
  background-color: #8b4513;
  color: white;
  border: none;
  padding: 10px 15px;
  font-size: 1.2em;
  cursor: pointer;
  border-radius: 5px;
  transition: all 0.3s ease;
  font-family: 'Cinzel', serif;
}

.image-viewer button:hover {
  background-color: #d2b48c;
  color: #8b4513;
}

.image-viewer button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.image-counter {
  margin-top: 10px;
  font-weight: bold;
  color: #8b4513;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 20px;
  }
  
  nav ul {
    flex-direction: column;
    align-items: center;
  }
  
  .banner {
    font-size: 2em;
  }

  .top-bar {
    display: flex;
    flex-direction: column;
    text-align: center;
    justify-content: center;
    min-height: auto;
    padding: 24px 20px;
  }

  :root {
    --top-bar-sticky-offset: 198px;
  }

  .brand-link {
    justify-content: center;
  }

  .top-bar .logo {
    height: 72px;
  }

  .brand-link h1 {
    font-size: 2.2rem;
  }

  .top-nav ul {
    flex-direction: row;
    justify-content: center;
  }

  .faction-banner {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 0 12px;
    padding: 14px;
  }

  .image-viewer-container {
    flex-direction: column;
    gap: 10px;
  }

  .image-viewer button {
    width: 100%;
  }

  .faction-title {
    flex-direction: column;
    text-align: center;
  }

  .home-split,
  .home-split-image-right {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 18px;
  }

  .home-split-media,
  .home-split-image-right .home-split-media,
  .home-split-image-right .home-split-copy {
    grid-column: auto;
  }

  .home-split-media {
    min-height: 220px;
  }

  .home-split-copy h3 {
    font-size: 1.6rem;
  }

  .home-links ul {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  :root {
    --top-bar-sticky-offset: 214px;
  }

  .faction-banner {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

  .faction-banner-link {
    min-height: 70px;
  }

  .faction-banner-link img {
    width: 46px;
    height: 46px;
  }

  .home-links ul {
    grid-template-columns: 1fr;
  }
}
