/* Homepage Gallery: animated mosaic + full-screen viewer. Loaded by index.html. */
.gallery-section { background: #111; color: #f5f1e8; }
.gallery-section [hidden] { display: none !important; }
.gallery-section .section-label { color: #d9bc7e; }
.gallery-section h2 { color: #f5f1e8; }
.gallery-section .section-head p { color: rgba(245, 241, 232, 0.75); }

/* ---- filter chips ---- */
.gal-filters { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0 0 1.75rem; }
.gal-chip {
  background: transparent; color: #f5f1e8; border: 1px solid rgba(245, 241, 232, 0.35);
  border-radius: 999px; padding: 0.45rem 1.1rem; font: inherit; font-size: 0.9rem; cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}
.gal-chip:hover { border-color: #d9bc7e; transform: translateY(-2px); }
.gal-chip[aria-pressed="true"] { background: #d9bc7e; color: #111; border-color: #d9bc7e; font-weight: 600; }
.gal-chip:focus-visible, .gal-card:focus-visible { outline: 2px solid #d9bc7e; outline-offset: 3px; }

/* ---- mosaic ---- */
.gal-grid { list-style: none; margin: 0; padding: 0; column-width: 240px; column-gap: 1rem; }
.gal-item {
  break-inside: avoid; margin: 0 0 1rem; display: block;
  opacity: 0; transform: translateY(26px) scale(0.97);
  transition: opacity 0.7s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.gal-item.is-in { opacity: 1; transform: none; }
.gal-card {
  position: relative; display: block; width: 100%; padding: 0; border: 0; border-radius: 16px; overflow: hidden;
  background: #1c1c19; cursor: pointer; text-align: left; color: inherit; font: inherit;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.35s ease;
}
.gal-card:hover, .gal-card:focus-visible { transform: translateY(-5px); box-shadow: 0 16px 34px rgba(0, 0, 0, 0.5); }
.gal-media { position: relative; display: block; width: 100%; background: linear-gradient(110deg, #1c1c19 30%, #2a2a25 50%, #1c1c19 70%); background-size: 200% 100%; animation: gal-shimmer 1.6s linear infinite; }
.gal-media.is-ready { animation: none; background: #1c1c19; }
.gal-shape-0 .gal-media { aspect-ratio: 4 / 5; }
.gal-shape-1 .gal-media { aspect-ratio: 1 / 1; }
.gal-shape-2 .gal-media { aspect-ratio: 5 / 4; }
.gal-shape-3 .gal-media { aspect-ratio: 3 / 4; }
.gal-shape-4 .gal-media { aspect-ratio: 1 / 1; }
.gal-shape-5 .gal-media { aspect-ratio: 4 / 3; }
.gal-media img { width: 100%; height: 100%; max-width: none; object-fit: cover; display: block; opacity: 0; transition: opacity 0.6s ease, transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1); }
.gal-media.is-ready img { opacity: 1; }
.gal-card:hover .gal-media img, .gal-card:focus-visible .gal-media img { transform: scale(1.07); }
.gal-placeholder { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 2.4rem; color: rgba(245, 241, 232, 0.55); background: radial-gradient(circle at 30% 20%, #34342d, #1a1a17); }
.gal-badge { position: absolute; top: 0.7rem; left: 0.7rem; background: rgba(17, 17, 17, 0.72); color: #f5f1e8; border: 1px solid rgba(217, 188, 126, 0.55); border-radius: 999px; padding: 0.2rem 0.65rem; font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; backdrop-filter: blur(4px); }
.gal-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.gal-play span { width: 56px; height: 56px; border-radius: 50%; background: rgba(217, 188, 126, 0.92); color: #111; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; padding-left: 4px; box-shadow: 0 0 0 0 rgba(217, 188, 126, 0.6); animation: gal-pulse 2.4s ease-out infinite; }
.gal-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 2.5rem 1rem 0.9rem; background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent); transform: translateY(101%); transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1); }
.gal-card:hover .gal-cap, .gal-card:focus-visible .gal-cap { transform: none; }
.gal-cap strong { display: block; font-family: var(--font-serif); font-size: 1.05rem; color: #f5f1e8; }
.gal-cap span { display: block; font-size: 0.82rem; color: rgba(245, 241, 232, 0.8); margin-top: 0.15rem; }
@media (hover: none) { .gal-cap { transform: none; } }          /* touch screens: captions always visible */
.gal-more { text-align: center; margin-top: 1.5rem; }
.gallery-section .btn-outline { color: #f5f1e8; border-color: rgba(245, 241, 232, 0.5); }
.gallery-section .btn-outline:hover { background: #f5f1e8; color: #111; }

/* ---- full-screen viewer ---- */
html.gal-open { overflow: hidden; }
.gal-lb { position: fixed; inset: 0; z-index: 450; display: flex; align-items: center; justify-content: center; padding: clamp(0.75rem, 3vw, 2rem); animation: gal-fade 0.3s ease both; }
.gal-lb-backdrop { position: absolute; inset: 0; background: rgba(8, 8, 7, 0.92); backdrop-filter: blur(6px); }
.gal-lb-figure { position: relative; margin: 0; max-width: min(1100px, 100%); width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 0.9rem; animation: gal-zoom 0.4s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.gal-lb-stage { width: 100%; display: flex; align-items: center; justify-content: center; min-height: 120px; }
.gal-lb-stage.slide-next > * { animation: gal-in-right 0.4s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.gal-lb-stage.slide-prev > * { animation: gal-in-left 0.4s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.gal-lb-stage img, .gal-lb-stage video { max-width: 100%; max-height: 76vh; border-radius: 10px; background: #000; display: block; }
.gal-lb-stage iframe { width: min(100%, 960px); aspect-ratio: 16 / 9; border: 0; border-radius: 10px; background: #000; }
.gal-lb-file { width: min(100%, 520px); text-align: center; background: #1c1c19; border: 1px solid rgba(245, 241, 232, 0.18); border-radius: 18px; padding: 1.75rem 1.5rem; }
.gal-lb-file .gal-file-art { width: 100%; max-height: 38vh; object-fit: contain; border-radius: 10px; margin-bottom: 1rem; }
.gal-lb-file .gal-file-icon { font-size: 3.2rem; margin-bottom: 0.5rem; }
.gal-lb-file h3 { font-family: var(--font-serif); margin: 0 0 0.35rem; color: #f5f1e8; }
.gal-lb-file p { margin: 0 0 1rem; color: rgba(245, 241, 232, 0.75); }
.gal-lb-file .btn-group { justify-content: center; margin-top: 0.5rem; }
.gal-lb figcaption { text-align: center; color: #f5f1e8; max-width: 720px; }
.gal-lb figcaption strong { display: block; font-family: var(--font-serif); font-size: 1.15rem; }
.gal-lb figcaption span { display: block; color: rgba(245, 241, 232, 0.78); font-size: 0.92rem; margin-top: 0.2rem; }
.gal-lb-count { display: block; margin-top: 0.4rem; font-size: 0.78rem; letter-spacing: 0.1em; color: #d9bc7e; font-style: normal; }
.gal-lb-btn { position: absolute; z-index: 2; background: rgba(245, 241, 232, 0.12); color: #f5f1e8; border: 1px solid rgba(245, 241, 232, 0.3); border-radius: 50%; width: 46px; height: 46px; font-size: 1.6rem; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.2s ease, transform 0.2s ease; }
.gal-lb-btn:hover { background: #d9bc7e; color: #111; transform: scale(1.08); }
.gal-lb-btn:focus-visible { outline: 2px solid #d9bc7e; outline-offset: 2px; }
.gal-lb-close { top: 1rem; right: 1rem; }
.gal-lb-prev { left: 1rem; top: 50%; margin-top: -23px; }
.gal-lb-next { right: 1rem; top: 50%; margin-top: -23px; }
@media (max-width: 640px) { .gal-lb-prev, .gal-lb-next { top: auto; bottom: 1rem; margin-top: 0; } .gal-lb-prev { left: 1rem; } .gal-lb-next { right: 1rem; } .gal-lb-figure { padding-bottom: 3.5rem; } }

@keyframes gal-shimmer { to { background-position: -200% 0; } }
@keyframes gal-pulse { 0% { box-shadow: 0 0 0 0 rgba(217, 188, 126, 0.55); } 70%, 100% { box-shadow: 0 0 0 18px rgba(217, 188, 126, 0); } }
@keyframes gal-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes gal-zoom { from { opacity: 0; transform: scale(0.94) translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes gal-in-right { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes gal-in-left { from { opacity: 0; transform: translateX(-40px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .gal-item { opacity: 1; transform: none; transition: none; }
  .gal-card, .gal-media img, .gal-cap, .gal-chip, .gal-lb, .gal-lb-figure, .gal-lb-stage > *, .gal-play span, .gal-media { animation: none !important; transition: none !important; }
  .gal-card:hover, .gal-card:hover .gal-media img { transform: none; }
}

/* ---------- Gallery page extras ---------- */
.gallery-page { padding-top: 2rem; }
.gal-empty, .gal-loading { text-align: center; color: rgba(245, 241, 232, 0.8); padding: 1.5rem 0; }
.gal-loading { color: var(--grey, #5a5a55); }
.gallery-page + .gal-loading { display: none; }
.gal-more-link { text-align: center; margin-top: 1rem; }
.gallery-section .gal-more-link a { color: #d9bc7e; text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Project pages ---------- */
.proj-meta { margin: 0.5rem 0 0; }
.proj-meta span { display: inline-block; background: rgba(17, 17, 17, 0.07); border-radius: 999px; padding: 0.25rem 0.8rem; font-size: 0.82rem; }
.proj-tabs { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0 0 1.5rem; }
.proj-tabs a { display: inline-block; padding: 0.5rem 1.15rem; border-radius: 999px; border: 1px solid rgba(17, 17, 17, 0.25); color: var(--charcoal, #111); text-decoration: none; font-size: 0.92rem; transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease; }
.proj-tabs a:hover { transform: translateY(-2px); border-color: var(--gold, #b89a5e); }
.proj-tabs a[aria-current="page"] { background: var(--charcoal, #111); color: var(--ivory, #f5f1e8); border-color: var(--charcoal, #111); }
.proj-actions { margin-bottom: 1.5rem; }
.proj-cover { width: 100%; max-height: 420px; object-fit: cover; border-radius: 16px; margin: 0 0 2rem; }
.proj-updates-title { font-family: var(--font-serif); margin: 1rem 0 1.25rem; }
.proj-feed { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); padding-bottom: 3rem; }
.proj-post { background: var(--white, #fff); border: 1px solid rgba(17, 17, 17, 0.08); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; opacity: 0; transform: translateY(22px); transition: opacity 0.6s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.3s ease; }
.proj-post.is-in { opacity: 1; transform: none; }
.proj-post:hover { box-shadow: 0 14px 30px rgba(17, 17, 17, 0.1); }
.proj-media { position: relative; display: block; width: 100%; padding: 0; border: 0; cursor: pointer; background: #1c1c19; aspect-ratio: 16 / 10; overflow: hidden; }
.proj-media img { width: 100%; height: 100%; max-width: none; object-fit: cover; display: block; transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1); }
.proj-media:hover img, .proj-media:focus-visible img { transform: scale(1.06); }
.proj-media:focus-visible { outline: 2px solid var(--gold, #b89a5e); outline-offset: -4px; }
.proj-media .gal-placeholder { font-size: 2.6rem; }
.proj-body { padding: 1.1rem 1.3rem 1.4rem; }
.proj-body h3 { font-family: var(--font-serif); margin: 0 0 0.25rem; font-size: 1.2rem; }
.proj-date { display: block; font-size: 0.8rem; color: var(--grey, #5a5a55); margin-bottom: 0.7rem; }
.proj-body p { margin: 0 0 0.75rem; color: var(--charcoal-soft, #333); }
.proj-body p:last-child { margin-bottom: 0; }
.proj-empty, .proj-state { text-align: center; color: var(--grey, #5a5a55); padding: 2.5rem 0; }
@media (prefers-reduced-motion: reduce) { .proj-post { opacity: 1; transform: none; transition: none; } .proj-media img, .proj-tabs a { transition: none; } .proj-media:hover img { transform: none; } }
