/* ════════════════════════════════════════════════════════
   portfolio.css  —  page-specific styles for portfolio.html
   Theme variables, resets, and header come from theme.css
════════════════════════════════════════════════════════ */

/* ════════════════════════════════
   HERO
════════════════════════════════ */
#hero {
  background: var(--blue);
  color: #fff;
  height: calc(100vh - 54px);
  height: calc(100svh - 54px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 40px 20px 80px;
  position: relative;
  overflow: hidden;
}

#hero::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(45deg,  rgba(255,255,255,0.045) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255,255,255,0.045) 25%, transparent 25%),
    linear-gradient(45deg,  transparent 75%, rgba(255,255,255,0.045) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255,255,255,0.045) 75%);
  background-size: 40px 40px;
  background-position: 0 0, 0 20px, 20px -20px, -20px 0;
  pointer-events: none; z-index: 0;
}

#hero .container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: calc(100% - 40px);
  padding: 40px 32px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
}

.hero-eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.65);
  margin-bottom: 18px;
  animation: fadeUp 0.6s ease both 0.1s;
}

/* ── Header social links ── */
.header-socials {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-right: 10px;
}
.header-social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--text-muted);
  transition: color 0.2s;
  border-radius: 2px;
}
.header-social-link svg {
  width: 16px;
  height: 16px;
}
.header-social-link:hover { color: var(--blue); }

#hero p {
  font-size: clamp(0.95rem, 2.5vw, 1.1rem);
  color: rgba(255,255,255,0.65);
  max-width: 480px;
  margin: 24px auto 0;
  position: relative; z-index: 1;
  animation: fadeUp 0.6s ease both 0.35s;
}

.hero-scroll {
  position: absolute;
  bottom: 28px; left: 0; right: 0;
  display: flex; flex-direction: column;
  align-items: center; gap: 10px;
  color: rgba(255,255,255,0.50);
  font-family: 'BBHBartle', 'Noto Sans SC', sans-serif;
  font-size: 0.7rem; letter-spacing: 0.2em; text-transform: uppercase;
  z-index: 1;
  animation: fadeUp 0.6s ease both 0.7s;
}
.hero-scroll span {
  display: block; width: 1px; height: 32px;
  background: rgba(255,255,255,0.2);
  position: relative; overflow: hidden;
}
.hero-scroll span::after {
  content: '';
  position: absolute; top: -100%; left: 0;
  width: 100%; height: 100%;
  background: var(--yellow);
  animation: scrollLine 2s ease-in-out infinite;
}
@keyframes scrollLine { 0% { top: -100%; } 100% { top: 100%; } }

/* ════════════════════════════════
   FILTER BAR — dual filter (type + tag)
════════════════════════════════ */
#filter-bar {
  background: var(--bg);
  border-bottom: 1.5px solid var(--border);
  position: sticky; top: var(--header-h, 54px); z-index: 100;
  transition: background 0.3s, border-color 0.3s;
}

#filter-bar .container {
  padding: 0 20px;
}

.filter-bar-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  min-height: 48px;
}

/* Filter toggle button */
.filter-toggle-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: 'BBHBartle', 'Noto Sans SC', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: none;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  padding: 6px 14px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.filter-toggle-btn svg {
  width: 14px; height: 14px;
  stroke: currentColor;
  flex-shrink: 0;
}
.filter-toggle-btn:hover,
.filter-toggle-btn.active {
  color: var(--blue);
  border-color: var(--blue);
  background: rgba(0,123,255,0.06);
}

/* Active filter chips */
.filter-chips {
  display: flex;
  flex: 1;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  min-width: 0;
}
.filter-chips::-webkit-scrollbar { display: none; }

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: 'BBHBartle', 'Noto Sans SC', sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: rgba(0,123,255,0.12);
  color: var(--blue);
  padding: 3px 8px 3px 10px;
  white-space: nowrap;
  animation: fadeUp 0.2s ease both;
}

.filter-chip--tag {
  background: rgba(255,214,0,0.18);
  color: #8a7000;
}
[data-theme="dark"] .filter-chip--tag { color: var(--yellow); }

.chip-remove {
  background: none;
  border: none;
  color: inherit;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  opacity: 0.7;
  font-family: sans-serif;
}
.chip-remove:hover { opacity: 1; }

.piece-count {
  font-size: 0.72rem; color: var(--text-muted);
  white-space: nowrap; flex-shrink: 0;
  border-left: 1.5px solid var(--border);
  padding-left: 14px;
  margin-left: auto;
  letter-spacing: 0.04em;
}
#count {
  font-family: 'BBHBartle', 'Noto Sans SC', sans-serif;
  font-size: 0.88rem; color: var(--blue); font-weight: 700;
}

/* ── Filter dropdown panel ── */
.filter-panel {
  background: var(--bg);
  border-bottom: 1.5px solid var(--border);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.28s ease, padding 0.28s ease;
  position: sticky;
  top: calc(var(--header-h, 54px) + 48px);
  z-index: 99;
}
.filter-panel.open {
  max-height: 280px;
  padding: 14px 0 18px;
}

.filter-panel .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.fp-section {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  justify-content: center;
}
.fp-section:last-child { margin-bottom: 0; }

.fp-label {
  font-family: 'BBHBartle', 'Noto Sans SC', sans-serif;
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  white-space: nowrap;
  min-width: 36px;
  text-align: right;
  flex-shrink: 0;
}

.fp-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.fp-btn {
  font-family: 'BBHBartle', 'Noto Sans SC', sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: none;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  padding: 5px 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.18s, background 0.18s, border-color 0.18s;
}
.fp-btn:hover {
  color: var(--blue);
  border-color: rgba(0,123,255,0.4);
  background: rgba(0,123,255,0.05);
}
.fp-btn.active {
  color: var(--blue);
  border-color: var(--blue);
  background: rgba(0,123,255,0.10);
}

.fp-btn--tag.active {
  background: rgba(255,214,0,0.18);
  border-color: var(--yellow);
  color: #8a7000;
}
[data-theme="dark"] .fp-btn--tag.active { color: var(--yellow); }


/* ════════════════════════════════
   GALLERY
════════════════════════════════ */
#gallery {
  background: var(--bg);
  padding: 60px 0 100px;
  transition: background 0.3s;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* ── Card ── */
.art-card {
  background: var(--bg-alt);
  border: 1.5px solid var(--border);
  overflow: hidden; cursor: pointer;
  animation: fadeUp 0.45s ease both;
  transition: transform 0.25s ease, box-shadow 0.25s ease,
              border-color 0.25s ease, background 0.3s;
}
.art-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(0,123,255,0.14);
  border-color: var(--blue);
}

/* ── Thumb ── */
.card-thumb {
  aspect-ratio: 4 / 3;
  position: relative; overflow: hidden;
}

.card-thumb-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}

/* yellow hover bar */
.card-thumb::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 3px; background: var(--yellow);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.3s ease; z-index: 3;
}
.art-card:hover .card-thumb::after { transform: scaleX(1); }

/* card number watermark */
.card-num {
  position: absolute; bottom: 12px; left: 14px;
  font-family: 'BBHBartle', 'Noto Sans SC', sans-serif;
  font-size: 2rem; font-weight: 700;
  color: #003f9e;
  text-shadow: none;
  line-height: 1; z-index: 2;
  user-select: none;
  opacity: 0.25;
  transition: opacity 0.3s;
}
.art-card:hover .card-num { opacity: 0; }

/* ── Full-size button (top-right of thumb) ── */
.card-size-btn {
  position: absolute; top: 10px; right: 10px;
  z-index: 4;
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  background: rgba(0,0,0,0.50);
  border: 1.5px solid rgba(255,255,255,0.35);
  color: #fff; cursor: pointer;
  opacity: 0; transform: scale(0.85);
  transition: opacity 0.22s ease, transform 0.22s ease, background 0.2s;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.card-size-btn svg {
  width: 15px; height: 15px;
  stroke: #fff;
}
.art-card:hover .card-size-btn {
  opacity: 1; transform: scale(1);
}
.card-size-btn:hover {
  background: var(--blue) !important;
  border-color: var(--blue);
}

/* ── Card info strip ── */
.card-info {
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 5px;
  min-height: 0;
}

.card-info-top {
  display: flex; align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}

/* Tag label (left side — shows the tag: Practice/Commission/Gift) */
.card-cat-label {
  font-size: 0.62rem; letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue); font-weight: 700;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Category badge (right side — shows category: illustration/sketch/etc) */
.card-badge {
  font-family: 'BBHBartle', 'Noto Sans SC', sans-serif;
  font-size: 0.58rem; letter-spacing: 0.1em;
  text-transform: uppercase; font-weight: 700;
  padding: 2px 8px;
  flex-shrink: 0;
  white-space: nowrap;
}
.card-badge--practice     { background: rgba(0,123,255,0.12); color: var(--blue); }
.card-badge--commission   { background: rgba(255,214,0,0.20);  color: #8a7000; }
.card-badge--personal     { background: rgba(0,0,0,0.07);      color: var(--text-muted); }
.card-badge--gift         { background: rgba(255,100,180,0.14); color: #b0006a; }
.card-badge--wip          { background: rgba(255,140,0,0.14);   color: #9a5600; }
.card-badge--illustration { background: rgba(0,123,255,0.08);   color: var(--blue); }
.card-badge--sketch       { background: rgba(0,0,0,0.06);       color: var(--text-muted); }
.card-badge--digital      { background: rgba(0,180,120,0.12);   color: #0a7a50; }
.card-badge--character    { background: rgba(120,0,255,0.10);   color: #6600cc; }
.card-badge--animal       { background: rgba(255,90,0,0.12);    color: #b34000; }

[data-theme="dark"] .card-badge--commission   { color: var(--yellow); }
[data-theme="dark"] .card-badge--personal     { background: rgba(255,255,255,0.08); }
[data-theme="dark"] .card-badge--gift         { color: #ff80cc; }
[data-theme="dark"] .card-badge--wip          { color: #ffaa44; }
[data-theme="dark"] .card-badge--digital      { color: #40d9a0; }
[data-theme="dark"] .card-badge--character    { color: #bb88ff; }
[data-theme="dark"] .card-badge--animal       { color: #ff9955; }


.card-info h3 {
  font-family: 'BBHBartle', 'Noto Sans SC', sans-serif;
  font-size: 1rem; font-weight: 700;
  color: var(--text); letter-spacing: 0.02em;
  transition: color 0.3s;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}

.card-date {
  font-size: 0.68rem; color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* ════════════════════════════════
   DETAIL MODAL
════════════════════════════════ */
#art-modal {
  display: none;
  position: fixed; inset: 0; z-index: 900;
  align-items: center; justify-content: center;
  padding: 20px;
}
#art-modal.open { display: flex; }

.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-panel {
  position: relative; z-index: 1;
  background: var(--bg);
  width: 100%; max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  scrollbar-width: none;
  display: flex; flex-direction: column;
  animation: modalIn 0.28s ease both;
  border: 1.5px solid var(--border);
  box-sizing: border-box;
  transition: background 0.3s;
}

.modal-panel::-webkit-scrollbar {
  display: none;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-toolbar {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  gap: 6px;
  z-index: 3;
}

.modal-tool {
  width: 34px;
  height: 34px;
  background: var(--bg-alt);
  border: 1.5px solid var(--border);
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  font-family: 'BBHBartle', 'Noto Sans SC', sans-serif;
  border-radius: 0;
}
.modal-tool:hover {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

/* While image is loading — hide empty thumb, keep toolbar fixed at top-right */
#art-modal.image-pending .modal-thumb {
  display: none;
}

/* Modal thumb area */
.modal-thumb {
  width: 100%;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  max-height: 65vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--blue);
}
.modal-thumb.zoomed {
  overflow: auto;
  cursor: grab;
  max-height: none;
}
.modal-thumb.zoomed img {
  max-width: none;
  max-height: none;
  width: auto;
  height: auto;
}

#modalThumbImg {
  width: 100%;
  height: auto;
  max-height: 65vh;
  object-fit: contain;
  display: block;
  transition: transform 0.2s ease;
  transform-origin: center center;
  user-select: none;
  -webkit-user-drag: none;
}

/* Full-res: cap height so tall images fit on screen */
.modal-thumb.is-fullres {
  aspect-ratio: unset;
  height: auto;
  max-height: 65vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-thumb.is-fullres:not(.zoomed) #modalThumbImg {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 65vh;
  object-fit: contain;
}

/* Modal text body */
.modal-body {
  padding: 24px 28px 28px;
}

.modal-meta {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

/* Modal tag badges */
.modal-tag {
  font-family: 'BBHBartle', 'Noto Sans SC', sans-serif;
  font-size: 0.65rem; letter-spacing: 0.12em;
  text-transform: uppercase; font-weight: 700;
  padding: 3px 10px;
}
.modal-tag--practice   { background: rgba(0,123,255,0.12); color: var(--blue); }
.modal-tag--commission { background: rgba(255,214,0,0.20);  color: #8a7000; }
.modal-tag--personal   { background: rgba(0,0,0,0.07);      color: var(--text-muted); }

[data-theme="dark"] .modal-tag--commission { color: var(--yellow); }
[data-theme="dark"] .modal-tag--personal   { background: rgba(255,255,255,0.08); }

.modal-date {
  font-size: 0.72rem; color: var(--text-muted);
  letter-spacing: 0.06em;
}

.modal-title {
  font-family: 'BBHBartle', 'Noto Sans SC', sans-serif;
  font-size: clamp(1.4rem, 5vw, 2rem);
  color: var(--text); font-weight: 700;
  letter-spacing: 0.02em; margin-bottom: 10px;
  transition: color 0.3s;
  overflow-wrap: break-word;
  word-break: break-word;
}

.modal-desc {
  font-size: 0.95rem; color: var(--text-muted);
  line-height: 1.8; margin-bottom: 20px;
}

.modal-category {
  font-size: 0.62rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--text-muted);
  font-weight: 700; opacity: 0.7;
}

/* ════════════════════════════════
   CTA STRIP
════════════════════════════════ */
#cta {
  background: var(--blue); color: #fff;
  text-align: center; padding: 90px 20px;
  position: relative; overflow: hidden;
}
#cta::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(45deg,  rgba(255,255,255,0.045) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255,255,255,0.045) 25%, transparent 25%),
    linear-gradient(45deg,  transparent 75%, rgba(255,255,255,0.045) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255,255,255,0.045) 75%);
  background-size: 40px 40px;
  background-position: 0 0, 0 20px, 20px -20px, -20px 0;
  pointer-events: none;
}
#cta .container {
  display: flex; flex-direction: column;
  align-items: center; position: relative; z-index: 1;
}
#cta h2 {
  font-family: 'BBHBartle', 'Noto Sans SC', sans-serif;
  font-size: clamp(1.4rem, 4vw, 2.5rem); margin-bottom: 14px;
}
#cta p { color: rgba(255,255,255,0.65); font-size: 1rem; margin-bottom: 36px; }

.btn-white {
  display: inline-block; padding: 13px 36px;
  background: #fff; color: var(--blue);
  font-family: 'BBHBartle', 'Noto Sans SC', sans-serif;
  font-weight: 700; font-size: 1rem; text-decoration: none;
  transition: background 0.2s, transform 0.2s, color 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 16px rgba(0,0,0,0.14);
}
.btn-white:hover {
  background: var(--yellow); color: #0d0d0d;
  transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}

/* Footer is handled by theme.css */

/* ════════════════════════════════
   MOBILE FILTER BOTTOM-SHEET
════════════════════════════════ */
/* ════════════════════════════════
   MOBILE FILTER BOTTOM-SHEET (Sharp 0px edges)
════════════════════════════════ */
.filter-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 600;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  align-items: flex-end;
  justify-content: center;
}
.filter-modal-overlay.open {
  display: flex;
}

.filter-modal-card {
  background: var(--bg);
  width: 100%;
  max-height: 85vh;
  border-top: 2px solid var(--border);
  border-left: 1.5px solid var(--border);
  border-right: 1.5px solid var(--border);
  border-radius: 0 !important;
  overflow-y: auto;
  animation: slideUp 0.26s ease both;
  transition: background 0.3s;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.3);
}

@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0.6; }
  to   { transform: translateY(0);    opacity: 1; }
}

.filter-modal-handle {
  width: 36px;
  height: 3px;
  background: var(--yellow, #ffd600);
  border-radius: 0;
  margin: 14px auto 0;
}

.filter-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1.5px solid var(--border);
}

.filter-modal-title {
  font-family: 'BBHBartle', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
}

.filter-modal-close {
  width: 30px;
  height: 30px;
  background: var(--bg-alt);
  border: 1.5px solid var(--border);
  border-radius: 0;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'BBHBartle', sans-serif;
  transition: all 0.2s ease;
}
.filter-modal-close:hover {
  background: var(--border);
}

.filter-modal-body {
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.filter-modal-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.filter-modal-section-label {
  font-family: 'BBHBartle', sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
}

.filter-modal-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.filter-modal-row .fp-btn {
  width: 100%;
  text-align: left;
  padding: 12px 18px;
  font-family: 'BBHBartle', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1.5px solid var(--border);
  background: var(--bg-alt);
  color: var(--text);
  border-radius: 0;
  transition: all 0.18s ease;
}

.filter-modal-row .fp-btn.active {
  background: var(--blue, #007bff) !important;
  color: #ffffff !important;
  border-color: var(--blue, #007bff) !important;
}

.filter-modal-row .fp-btn--tag.active {
  background: var(--yellow, #ffd600) !important;
  color: #000000 !important;
  border-color: #000000 !important;
}

.filter-modal-done {
  margin: 10px 20px 24px;
  padding: 15px;
  background: var(--blue, #007bff);
  border: none;
  border-radius: 0;
  color: #fff;
  font-family: 'BBHBartle', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  width: calc(100% - 40px);
  box-shadow: 0 4px 16px rgba(0, 123, 255, 0.25);
  transition: background 0.2s ease, transform 0.15s ease;
}
.filter-modal-done:hover {
  background: var(--blue-d, #0060cc);
}

/* ════════════════════════════════
   ANIMATIONS
════════════════════════════════ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ════════════════════════════════
   RESPONSIVE
════════════════════════════════ */
@media (max-width: 1024px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
}

@media (max-width: 768px) {
  #hero { padding: 60px 20px 80px; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  #filter-bar { top: var(--header-h, 54px); }
  .filter-toggle-btn { padding: 5px 10px; font-size: 0.65rem; }
  .filter-panel { top: calc(var(--header-h, 54px) + 44px); }
  .filter-panel .container { align-items: center; padding: 0 20px; }
  .fp-section { flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
  .fp-label { min-width: unset; text-align: center; }
  .fp-row { width: 100%; justify-content: center; }
  .fp-btn { font-size: 0.62rem; padding: 4px 10px; }
  #cta { padding: 60px 20px; }
  .modal-body { padding: 18px 20px 22px; }
  .card-size-btn { opacity: 1; transform: scale(1); }
}

@media (max-width: 540px) {
  .gallery-grid { grid-template-columns: 1fr; gap: 12px; }
  .modal-panel { max-height: 95vh; }
  .card-info-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .card-cat-label {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
  }
}

/* ════════════════════════════════
   GALLERY EMPTY STATE
════════════════════════════════ */
.gallery-empty {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 0 100px;
  width: 100%;
}

.gallery-empty-text {
  font-family: 'BBHBartle', 'SourceHanSansSC', sans-serif;
  font-size: clamp(2.5rem, 8vw, 6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  white-space: nowrap;
  color: var(--blue);
  opacity: 0.18;
  user-select: none;
  display: inline-block;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease, filter 0.35s ease;
  will-change: transform, opacity;
}

.gallery-empty-text.slide-out {
  transform: translateY(-16px);
  opacity: 0;
  filter: blur(4px);
}

.gallery-empty-text.slide-prep {
  transform: translateY(16px);
  opacity: 0;
  filter: blur(4px);
  transition: none !important;
}

.gallery-empty-text.slide-in {
  transform: translateY(0);
  opacity: 0.18;
  filter: blur(0);
}

/* ── Hide broken image alt text & icon ── */
.card-thumb-img[alt=""],
.card-thumb-img:-moz-broken {
  color: transparent;
}

/* ── Modal loading progress bar ── */
.modal-progress {
  width: 100%;
  height: 3px;
  background: var(--border);
  overflow: hidden;
  flex-shrink: 0;
  order: -1;          /* always first in the flex column */
  transition: opacity 0.25s ease;
}
.modal-progress.hidden {
  opacity: 0;
  pointer-events: none;
  height: 0;
}
.modal-progress-bar {
  width: 40%;
  height: 100%;
  background: var(--blue, #007BFF);
  animation: modal-progress-anim 1s ease-in-out infinite alternate;
}
@keyframes modal-progress-anim {
  0%   { margin-left: 0%; }
  100% { margin-left: 60%; }
}
