@import url("../styles.css");

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

body {
   color: #222;
   padding: 1rem;
}

h1 {
   font-family: "Times New Roman", Times, serif;
   text-align: center;
   margin: 1rem 0 0.25rem;
   font-size: 2rem;
}

.subtitle {
   max-width: 900px;
   margin: 0 auto 1.5rem;
   text-align: center;
   font-size: 1.05rem;
}

.gallery {
   display: grid;
   grid-template-columns: repeat(3, 1fr);
   gap: 1rem;
   max-width: 1100px;
   margin: 0 auto 2rem;
}

.gallery--few {
   grid-template-columns: repeat(auto-fit, minmax(220px, 450px));
   justify-content: center;
}

.gallery-item,
.folder-card {
   overflow: hidden;
   position: relative;
   margin: 0;
   text-align: center;
}

.gallery-item {
   cursor: pointer;
}

.gallery-item img,
.folder-card img {
   width: 100%;
   height: auto;
   display: block;
   border: 1px solid #aaa;
   transition: transform 0.2s ease;
}

.gallery-item:hover img,
.folder-card:hover img {
   transform: scale(1.03);
}

.gallery-item figcaption,
.folder-card figcaption {
   padding: 0.35rem 0.25rem;
   font-size: 1rem;
   text-align: center;
   color: #222;
}

.caption-detail {
   display: block;
   margin-top: 0.3em;
   font-size: 0.9em;
   line-height: 1.4;
}

.folder-card {
   display: block;
   color: #222;
   text-decoration: none;
}

.folder-card:hover {
   color: #222;
   background: transparent;
}

.folder-card figure {
   margin: 0;
}

nav {
   text-align: center;
   margin: 1.5rem 0;
}

.video-table {
   margin: 0 auto 1.5rem;
   border-collapse: collapse;
}

.video-table th,
.video-table td {
   padding: 0.4rem 1rem;
   border: 1px solid #ccc;
   text-align: left;
}

.video-table th {
   background: #f0f0f0;
}

.lightbox-overlay {
   display: none;
   position: fixed;
   inset: 0;
   background: rgba(0, 0, 0, 0.9);
   z-index: 1000;
   justify-content: center;
   align-items: center;
   flex-direction: column;
}

.lightbox-overlay.active {
   display: flex;
}

.lightbox-overlay img {
   max-width: 95vw;
   max-height: 95vh;
   object-fit: contain;
}

.lightbox-caption {
   color: #ddd;
   margin-top: 0.75rem;
   font-size: 1rem;
   text-align: center;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
   position: absolute;
   z-index: 10;
   color: white;
   cursor: pointer;
   background: rgba(0, 0, 0, 0.22);
   border: none;
   border-radius: 50%;
   user-select: none;
   transition: opacity 0.3s;
}

.lightbox-overlay.idle,
.lightbox-overlay.idle img {
   cursor: none !important;
}

.lightbox-overlay.idle .lightbox-close,
.lightbox-overlay.idle .lightbox-prev,
.lightbox-overlay.idle .lightbox-next {
   opacity: 0;
}

.lightbox-close {
   top: 1rem;
   right: 1.5rem;
   font-size: 2rem;
   line-height: 1;
}

.lightbox-prev,
.lightbox-next {
   top: 50%;
   transform: translateY(-50%);
   width: 3rem;
   height: 3rem;
   font-size: 2.5rem;
   line-height: 1;
   padding: 0;
}

.lightbox-prev { left: max(0.5rem, env(safe-area-inset-left)); }
.lightbox-next { right: max(0.5rem, env(safe-area-inset-right)); }

.lightbox-prev:hover,
.lightbox-next:hover,
.lightbox-close:hover {
   color: #ccc;
}

@media (hover: none) {
   .lightbox-prev,
   .lightbox-next {
      display: none;
   }
}

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

   h1 {
      font-size: 1.5rem;
   }

   .lightbox-prev,
   .lightbox-next {
      font-size: 1.8rem;
   }
}
