:root {
  --main-bg-color: rgb(255, 255, 255);
  --card-bg-cream: #f5f5dc;

  /* Card background colors from mockup-1.png */
  --card-bg-gray: #b8a9c9;
  --card-bg-orange: #ffb366;
  --card-bg-pink: #ff6b9d;
  --card-bg-salmon: #ff8c94;
  --card-bg-teal: #4dbaad;
  --color-charcoal: #2b2b2b;

  /* Category/Navigation colors from mockup-2.png */
  --color-coral: #ff6b7a;
  --color-cyan: #5fe9e6;
  --color-dark-gray: #3d3d3d;
  --color-lavender: #e6d4f5;
  --color-light-gray: #e8e8e8;
  --color-medium-gray: #d0d0d0;
  --color-mint-green: #c7f0d8;
  --main-text-color: rgba(0, 0, 0, 0.87);
  --color-white: #ffffff;
  --color-yellow: #f9f871;
}

html {
  display: block;
  width: 100%;
}

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

body {
  align-items: center;
  background-color: var(--main-bg-color);
  color: var(--main-text-color);
  display: flex;
  flex-flow: column;
  font-family: "Arial Narrow", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  font-size: 12px;
  width: 100%;
}

h1, h2, h3, h4, h5, h6 {
  font-style: normal;
  text-wrap-style: balance;
}

header {
  align-items: center;
  background: var(--color-light-gray);
  bottom: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  justify-content: space-between;
  position: fixed;
  width: 100%;
  z-index: 999;
}

header * {
  color: var(--color-charcoal);
  font-family: "Arial Narrow", Arial, sans-serif;
  font-size: 1.5em;
  font-weight: 600;
}

header h2 {
  text-align: right;
}

header a {
  text-decoration: none;
}

.site-navi {
  align-items: center;
  bottom: 20px;
  display: grid;
  grid-template-columns: 1fr;
  justify-content: center;
  position: fixed;
  width: 100%;
  z-index: 999;
}

.site-navi .level {
  align-items: center;
  background-color: var(--color-medium-gray);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  justify-content: center;
  position: relative;
  width: 100%;
}

.site-navi .level a {
  margin: 0 auto;
  text-decoration: none;
}

.view-buttons-container {
  bottom: 72px;
  position: fixed;
  right: 12px;
  z-index: 999;
}

.view-buttons-container button {
  cursor: pointer;
  padding: 2px;
}

/* Gallery Container */
.gallery-container {
  display: flex;
  width: 100%;
}

/* Gallery Container - Card */
.gallery-container.card .gallery {
  display: grid;
  grid-template-rows: repeat(auto-fill, 300px);
  margin: 12px 16px;
  width: 100%;
}

.gallery-container ul.gallery {
  list-style: none;
}

.gallery-container:not(.index) .gallery figure {
  display: block;
}

.gallery-container:not(.index) .gallery .index-item {
  display: none;
}

.gallery-container.index .gallery-item figure {
  display: none;
}

.gallery-container.index .gallery .index-item {
  display: block;
}

/* Gallery Item - Card */
.gallery-container.card .gallery-item {
  align-items: center;
  background-color: var(--color-light-gray);
  box-sizing: border-box;
  display: flex;
  height: 100%;
  justify-content: center;
  padding: 4px 6px;
  width: 100%;
}

.gallery-container.card .gallery-item figure {
  display: block;
  height: 100%;
  width: auto;
}

.gallery-container.card .gallery-item img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

/* Gallery Container - Index */
.gallery-container.index {
  margin: 24px 2px;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: repeat(auto-fill, 1fr);
  width: 100vw;
  box-sizing: border-box;
}

.gallery-container.index li{
  margin: 4px auto;
  padding: 2px 6px;
}

.gallery-container.index li:nth-child(even) {
  background-color: var(--color-light-gray);
}

.gallery-container.index li:nth-child(odd) {
  background-color: var(--color-medium-gray);
}

/* Gallery Container - Card */
.gallery-container.card .gallery {
  display: grid;
  grid-template-rows: repeat(auto-fill, 300px);
  margin: 12px 16px;
  width: 100%;
}

/* Gallery Item - Card */
.gallery-container.card .gallery-item {}

/* Gallery Container - Shelf */
.gallery-container.shelf {
  align-items: flex-end;
  box-sizing: border-box;
  display: flex;
  height: calc(100vh - 64px);
  justify-content: flex-end;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0;
  width: 100vw;
}

.gallery-container.shelf::-webkit-scrollbar {
  height: 0;
}

.gallery-container.shelf::-webkit-scrollbar-track {
  background: transparent;
}

.gallery-container.shelf::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 4px;
}

.gallery-container.shelf::-webkit-scrollbar-thumb:hover {
  background: #666666;
}

/* Gallery - Shelf */
.gallery-container.shelf .gallery {
  align-items: flex-end;
  display: flex;
  flex-flow: row;
  gap: 30px;
  height: 50vh;
  justify-content: flex-start;
  width: max-content;
}

/* Gallery Item - Shelf */
.gallery-container.shelf .gallery-item {
  flex-shrink: 0;
  position: relative;
}

.gallery-container.shelf .gallery-item img {
  display: block;
  height: 100%;
  object-fit: cover;
  width: auto;
}

.gallery-container.shelf .gallery-item:nth-child(1) img {
  background-color: var(--card-bg-orange);
}

.gallery-container.shelf .gallery-item:nth-child(2) img {
  background-color: var(--card-bg-teal);
}

.gallery-container.shelf .gallery-item:nth-child(3) img {
  background-color: var(--card-bg-cream);
}

.gallery-container.shelf .gallery-item:nth-child(4) img {
  background-color: var(--card-bg-pink);
}

.gallery-container.shelf .gallery-item:nth-child(5) img {
  background-color: var(--card-bg-gray);
}


/* old code */

/* Expanding Header System */
.header-system {
  position: relative;
  width: 100%;
}

.header-level {
  align-items: center;
  display: flex;
  flex-flow: row wrap;
  justify-content: space-around;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  width: 100%;
}

.header-level a {
  border: none;
  color: var(--main-text-color);
  flex: 1;
  font-size: 14px;
  padding: 12px 16px;
  text-align: center;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.header-level a:hover {
  opacity: 0.8;
}

/* Level 1: Main navigation (always visible) */
.header-level-1 {
  background: var(--color-charcoal);
  max-height: 50px;
  opacity: 1;
}

.header-level-1 a {
  color: white;
}

.header-level-1 a.active {
  text-decoration: underline;
}

/* Level 2: Index subcategories (hidden by default) */
.header-level-2 {
  max-height: 0;
  opacity: 0;
}

/* Level 3: Artwork subcategories (hidden by default) */
.header-level-3 {
  max-height: 0;
  opacity: 0;
}

/* Show Level 2 when hovering over index link */
.header-system:has(.header-level-1 a.has-submenu:hover) .header-level-2,
.header-level-2:hover,
.header-level-2.expanded {
  max-height: 50px;
  opacity: 1;
}

/* Show Level 3 when hovering over artwork link */
.header-system:has(.header-level-2 a.has-submenu:hover) .header-level-3,
.header-level-3:hover,
.header-level-3.expanded {
  max-height: 50px;
  opacity: 1;
}

/* Keep Level 2 visible when Level 3 is hovered */
.header-level-3:hover ~ .header-level-2,
.header-level-3.expanded ~ .header-level-2 {
  max-height: 50px;
  opacity: 1;
}

/* Old header styles (keeping for compatibility) */
.header {
  align-items: center;
  background: dimgray;
  display: flex;
  flex-flow: row wrap;
  justify-content: space-around;
  padding: 8px 0;
  width: 100%;
}

.header h1 {
  font-size: 48px;
  font-weight: 300;
  letter-spacing: -0.5px;
}
