/* gallery.css - grid layout (4 columns) for homepage folders and folder images
   Replace /assets/css/gallery.css with this file. */

/* Config variables */
:root {
  --tile-gap: 18px;
  --max-width: 1200px;
  --tile-radius: 8px;
  --thumb-radius: 6px;
  --thumb-height: 120px;   /* thumbnail height inside each tile */
  --accent: #0a84ff;
  --accent-dark: #0a72c8;
  --caption-color: #0a4d80;
}

/* Page basics */
body {
  font-family: "Segoe UI", Arial, sans-serif;
  background: #f4f8fb;
  color: #123;
  margin: 0;
  padding: 24px;
}
.page-title {
  text-align: center;
  color: var(--accent);
  margin: 8px 0 18px;
  font-size: 1.8rem;
}

/* ===========================
   FOLDER GRID - 4 COLUMNS
   =========================== */
/* Main folder grid (homepage) — 4 items per row, wrap to next row */
.folder-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 4 columns */
  gap: var(--tile-gap);
  max-width: var(--max-width);
  margin: 0 auto 24px;
  padding: 8px;
  box-sizing: border-box;
  align-items: start;
}

/* Card styling */
.folder-card {
  display: block;
  width: 100%;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border-radius: 10px;
  padding: 10px;
  box-shadow: 0 6px 18px rgba(10,132,255,0.06);
  transition: transform .15s ease, box-shadow .15s ease;
  box-sizing: border-box;
  text-align: center;
  border: 1px solid rgba(10,132,255,0.03);
}
.folder-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 36px rgba(10,132,255,0.12);
}

/* Thumbnail area inside each tile */
.folder-thumb {
  width: 100%;
  height: var(--thumb-height);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--thumb-radius);
  background: linear-gradient(180deg,#f6fbff,#fff);
}
.folder-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: var(--thumb-radius);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* Placeholder when folder has no preview image */
.folder-placeholder {
  padding: 6px;
  color: #6b7b88;
  font-weight: 600;
}

/* Folder name below thumb */
.folder-meta { margin-top: 8px; }
.folder-name {
  display: block;
  font-weight: 700;
  color: var(--accent-dark);
  font-size: 0.95rem;
  text-align: center;
}

/* ===========================
   IMAGE GRID (folder view & admin)
   4 columns by default
   =========================== */
.admin-image-grid, .public-image-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 4 columns */
  gap: var(--tile-gap);
  max-width: var(--max-width);
  margin: 0 auto 24px;
  padding: 8px;
  box-sizing: border-box;
}

.image-card {
  background: #fff;
  padding: 12px;
  border-radius: var(--tile-radius);
  box-shadow: 0 6px 18px rgba(10,132,255,0.06);
  box-sizing: border-box;
}
.image-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}

/* Caption centered + bold */
.gallery-caption {
  text-align: center;
  font-weight: 700;
  color: var(--caption-color);
  margin-top: 8px;
}

/* Dots (kept if slider re-enabled) */
.gallery-dots {
  text-align: center;
  padding-top: 12px;
}
.gallery-dot {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin: 0 6px;
  border-radius: 50%;
  background: #bcdffb;
  border: 2px solid var(--accent);
  cursor: pointer;
  transition: background 0.18s, transform 0.18s;
}
.gallery-dot.active {
  background: var(--accent);
  transform: scale(1.2);
}

/* Slider-safe rules (unchanged) */
.gallery-slider { position: relative; overflow: hidden; width: 100%; max-width: 1000px; margin: 0 auto; }
.gallery-slide-item { box-sizing: border-box; flex: 0 0 auto; }
.gallery-slide-item img, .gallery-slide { width: 100%; height: auto; object-fit: cover; display:block; }

/* ===========================
   RESPONSIVE BREAKPOINTS
   change columns at smaller widths
   =========================== */
/* 3 columns on medium-large tablets / small desktops */
@media (max-width: 1100px) {
  .folder-grid,
  .admin-image-grid,
  .public-image-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* 2 columns on tablets / large phones */
@media (max-width: 800px) {
  .folder-grid,
  .admin-image-grid,
  .public-image-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  :root { --thumb-height: 110px; }
}

/* 1 column on small phones */
@media (max-width: 480px) {
  .folder-grid,
  .admin-image-grid,
  .public-image-grid {
    grid-template-columns: 1fr;
  }
  :root { --thumb-height: 90px; --tile-gap: 12px; }
  body { padding: 14px; }
}

/* Accessibility and focus */
.folder-card:focus {
  outline: 3px solid rgba(10,132,255,0.16);
  outline-offset: 3px;
  transform: translateY(-4px);
}

/* Optional: center the grid content if you prefer */
.folder-grid.centered {
  justify-items: center;
}