/* /css/gallery.css */

/* =========================
   ACCESSIBILITY: Focus States
   ========================= */
a:focus,
button:focus,
[tabindex="0"]:focus,
input:focus { /* Added input for future forms if any */
  outline: 3px solid var(--color-text); /* Using a slightly thicker outline for better visibility */
  outline-offset: 2px;
  box-shadow: 0 0 0 3px var(--color-bg); /* Creates a border around the outline for better contrast on complex backgrounds */
}

/* Specific adjustment for elements that might be on dark backgrounds, like navbar or custom dark sections */
/* This assumes var(--color-light) is a light color suitable for outlines on dark backgrounds */
.navbar a:focus, /* Example: If navbar has dark background */
.series-billboard__title:focus, /* Updated class name */
.carousel-control:focus { /* Carousel controls are on semi-transparent dark bg */
  outline-color: var(--color-light);
  box-shadow: 0 0 0 3px var(--color-dark); /* Adjust shadow for dark mode elements */
}

.gallery-landing h1 {
  text-align: center;
  margin-top: 2rem;
  margin-bottom: 2rem;
  font-family: var(--font-heading);
}

/* New Billboard Styles */
.series-billboard {
  display: block;
  position: relative;
  background-color: #ddd; /* Fallback background color */
  background-size: cover;
  background-position: center;
  padding-top: 75%; /* 4:3 Aspect Ratio (3 / 4 = 0.75) */
  margin-bottom: 2rem;
  text-decoration: none;
  color: inherit;
  overflow: hidden; /* Ensures title's background doesn't overflow on rounded corners if any */
}

.series-billboard__title {
  font-family: var(--font-heading);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  position: absolute;
  top: 1rem; /* Adjust as needed */
  right: 1rem; /* Position to the right */
  background-color: rgba(0, 0, 0, 0.6); /* Semi-transparent background */
  color: var(--color-light);
  padding: 0.75rem 0.5rem; /* Padding: vertical then horizontal for vertical text */
  font-size: 1.5rem; /* Adjust as needed */
  z-index: 10;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
  max-height: calc(100% - 2rem); /* Prevent title from overflowing billboard height */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap; /* Important for vertical text handling with overflow */
}

/* Responsive styles for billboards */
@media (min-width: 769px) { /* Desktop */
  .gallery-landing {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Two columns */
    gap: 2rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 2rem;
  }

  .gallery-landing h1 {
    grid-column: 1 / -1; /* Span both columns */
  }
  /* No need to adjust .series-billboard padding-top here as it's percentage based */
}

@media (max-width: 768px) { /* Mobile */
  .series-billboard__title {
    font-size: 1.2rem;
    writing-mode: horizontal-tb;
    position: absolute; /* Re-assert for override if needed, though static might be better for full width */
    top: auto; /* Remove vertical positioning */
    bottom: 0; /* Position at the bottom */
    left: 0;
    right: 0;
    text-align: center;
    padding: 0.75rem;
    background-color: rgba(0, 0, 0, 0.7); /* Slightly more opaque for readability */
    text-shadow: none;
    white-space: normal; /* Allow wrapping for horizontal text */
    max-height: none; /* Reset max-height */
  }
  /* On mobile, billboards will stack due to block display and default flow */
}

/* /css/gallery.css - Appended styles */

/* Series Header */
.series-header {
  text-align: center;
  padding: 1rem 2rem;
  margin-bottom: 2rem;
  max-width: 800px; /* Max width for readability */
  margin-left: auto;
  margin-right: auto;
}

.series-header h1 {
  font-family: var(--font-heading);
  margin-bottom: 0.5rem;
}

/* Artwork Grid */
.artwork-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); /* Responsive grid */
  gap: 1.5rem;
  padding: 0 1rem; /* Padding on the sides */
  max-width: 1200px;
  margin: 0 auto 2rem auto; /* Centered with bottom margin */
}

.artwork-thumbnail {
  text-decoration: none;
  color: var(--color-text);
  border: 1px solid #ddd;
  transition: box-shadow 0.3s ease;
}

.artwork-thumbnail:hover {
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.artwork-thumbnail figure {
  margin: 0;
}

.artwork-thumbnail img {
  width: 100%;
  height: 100%; /* Make height 100% of parent for aspect-ratio to work well */
  aspect-ratio: 4 / 3; /* 4:3 aspect ratio */
  object-fit: cover; /* Cover the area without distortion */
  display: block;
}

.artwork-thumbnail figcaption {
  padding: 0.75rem;
  text-align: center;
  background-color: #f9f9f9;
  font-size: 0.9rem;
}

/* Responsive adjustments for series page if needed */
@media (max-width: 768px) {
  .series-header {
    padding: 1rem;
  }
  .artwork-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
  }
}

/* /css/gallery.css - Appended styles */

.artwork-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
}

.back-to-collection {
  display: inline-block;
  margin: 1rem 0;
  text-decoration: none;
  color: var(--color-text);
  font-weight: bold;
}

.back-to-collection:hover {
  text-decoration: underline;
}

.back-to-collection--bottom {
    margin-top: 2rem;
}

.artwork-display-area {
  display: grid;
  grid-template-columns: 1fr; /* Single column for mobile */
  gap: 2rem;
  margin-top: 1.5rem;
}

/* Image Carousel Styles */
.artwork-image-carousel {
  position: relative;
  /* max-width: 700px; /* Max width for the carousel */
  /* margin: 0 auto; /* Center the carousel if it's narrower than its container */
}

.carousel-viewport {
  overflow: hidden;
  position: relative;
  border: 1px solid #ddd;
  background-color: #f9f9f9;
}

.carousel-slide {
  display: none; /* Hidden by default, JS will show active slide */
  margin: 0;
  text-align: center; /* Center image within slide */
}

.carousel-slide.active-slide {
  display: block; /* JS will toggle this class */
}

.carousel-slide img {
  width: 100%;
  height: auto;
  max-height: 70vh; /* Limit image height to 70% of viewport height */
  object-fit: contain; /* Show whole image, letterbox if necessary */
  display: block;
}

.carousel-slide figcaption {
  padding: 0.5rem;
  font-size: 0.9rem;
  color: #555;
  background-color: #f0f0f0;
}

.carousel-control {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  font-size: 2rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
  z-index: 10;
  user-select: none; /* Prevent text selection */
}

.carousel-control.prev {
  left: 10px;
}

.carousel-control.next {
  right: 10px;
}

.carousel-control:hover {
  background-color: rgba(0, 0, 0, 0.8);
}

.carousel-indicators {
  text-align: center;
  margin-top: 0.5rem;
}

.carousel-indicators button {
  background-color: #ccc;
  border: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin: 0 5px;
  cursor: pointer;
  padding: 0;
}

.carousel-indicators button.active {
  background-color: #555;
}


/* Artwork Details Styles */
.artwork-details h2 {
  font-family: var(--font-heading);
  margin-bottom: 1rem;
}

.artwork-details ul {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem 0;
}

.artwork-details li {
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.artwork-details li strong {
  margin-right: 0.5em;
}

.artwork-description {
    line-height: 1.6;
}

/* Responsive layout for artwork page */
@media (min-width: 769px) {
  .artwork-display-area {
    grid-template-columns: 2fr 1fr; /* Two columns: image takes more space */
    align-items: flex-start; /* Align items to the top */
  }

  .artwork-image-carousel {
    /* margin: 0; /* Reset margin if it was centered before */
  }
}

@media (max-width: 768px) {
    .carousel-control {
        font-size: 1.5rem;
        padding: 0.3rem 0.8rem;
    }
    .carousel-slide img {
        max-height: 60vh; /* Adjust for smaller screens */
    }
    .artwork-details h2 {
        font-size: 1.8rem; /* Adjust heading for mobile */
    }
}

/* Model Viewer Styles */
.artwork-modelviewer {
  margin: 2rem 0;
  text-align: center; /* Center the heading and paragraph if they are part of it */
}

.artwork-modelviewer h3 {
  font-family: var(--font-heading);
  margin-bottom: 1rem;
  font-size: 1.5rem; /* Or match other subheadings */
}

model-viewer {
  width: 100%;
  height: 400px; /* Default height, adjust as needed */
  background-color: #f0f0f0; /* Placeholder background */
  border: 1px solid #ddd;
  border-radius: 4px; /* Optional: for slightly rounded corners */
}

.artwork-modelviewer p {
  font-size: 0.9rem;
  color: #555;
  margin-top: 0.5rem;
}

@media (min-width: 769px) {
  model-viewer {
    height: 500px; /* Larger height on desktop */
  }
}

.ar-model-container {
  position: relative;
}

.ar-button-custom {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  background: #fff;
  color: #222;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 0.4em 1em;
  font-family: inherit;
  font-size: 1em;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  cursor: pointer;
  transition: background 0.2s;
}
.ar-button-custom:hover {
  background: #f0f0f0;
}

/* =========================
   2D ARTWORK DISPLAY LAYOUT
   ========================= */
.artwork-2d-layout-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 1100px;
  margin: 2rem auto;
  padding: 1rem;
}
.artwork-2d-image-wrapper {
  width: 100%;
  max-width: 980px;
  aspect-ratio: 4/3;
  background: #f2f2f2;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 16px rgba(0,0,0,0.08);
  margin-bottom: 2rem;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}
.artwork-2d-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #fff;
}
.artwork-2d-details {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  font-family: "Roboto Mono", monospace;
  background: none;
  text-align: left;
}
.artwork-2d-details h2 {
  font-family: "Stardos Stencil", monospace;
  font-size: 2rem;
  margin: 0 0 1rem 0;
  letter-spacing: 1px;
}
.artwork-2d-details ul {
  padding: 0;
  margin: 0 0 1.5rem 0;
  list-style: none;
}
.artwork-2d-details li {
  margin-bottom: 0.5em;
  font-size: 1.1em;
}
.artwork-2d-details strong {
  font-weight: 700;
}
.artwork-2d-details .artwork-description {
  font-size: 1em;
  color: #333;
}
@media (max-width: 1100px) {
  .artwork-2d-layout-container {
    max-width: 100vw;
    padding: 0.5rem;
  }
  .artwork-2d-image-wrapper {
    max-width: 100vw;
  }
}
@media (max-width: 700px) {
  .artwork-2d-details {
    max-width: 98vw;
  }
}

.art-magnifier-lens {
  position: absolute;
  border: 2px solid #333;
  border-radius: 50%;
  width: 200px;
  height: 200px;
  overflow: hidden;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  z-index: 100;
  display: none;
}
.art-magnifier-lens img {
  position: absolute;
  pointer-events: none;
  user-select: none;
}
@media (pointer: coarse) {
  .art-magnifier-lens {
    display: none !important;
  }
  .zoomable-artwork {
    touch-action: pinch-zoom;
  }
}

/* Custom AR Button Style */
.ar-model-container {
	position: relative;
}
.ar-button-custom {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 2;
	background: #fff;
	color: #222;
	border: 1px solid #ccc;
	border-radius: 4px;
	padding: 0.4em 1em;
	font-family: inherit;
	font-size: 1em;
	box-shadow: 0 2px 8px rgba(0,0,0,0.08);
	cursor: pointer;
	transition: background 0.2s;
}
.ar-button-custom:hover {
	background: #f0f0f0;
}