/* Leo's World — reusable components */

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px;
  border-radius: 999px; border: 1px solid transparent;
  font-size: 14px; font-weight: 700; line-height: 1;
  transition: transform .2s ease, background-color .2s ease,
              border-color .2s ease, box-shadow .2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--main); color: #fff; box-shadow: 0 6px 16px rgba(201, 139, 97, .25); }
.btn--primary:hover { background: var(--main-dark); }
.btn--outline { background: var(--card); border-color: var(--line); color: var(--ink); }
.btn--outline:hover { border-color: var(--main); background: #fffaf4; }
.btn--soft { background: var(--orange); color: var(--main-dark); }
.btn--soft:hover { background: #f1dcc9; }
.btn--small { min-height: 36px; padding: 0 14px; font-size: 13px; }

/* ---------- category cards ---------- */

.category-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.category-card {
  display: flex; flex-direction: column; align-items: flex-start;
  min-height: 190px; padding: 22px;
  border-radius: var(--radius-lg); border: 1px solid var(--line);
  background: var(--card); box-shadow: var(--shadow);
  transition: transform .22s ease, box-shadow .22s ease;
}
.category-card:hover { transform: translateY(-5px) rotate(-.4deg); box-shadow: var(--shadow-hover); }
.category-card__icon {
  width: 46px; height: 46px; border-radius: 14px;
  display: grid; place-items: center; font-size: 22px;
  background: var(--orange); margin-bottom: auto;
}
.category-card:nth-child(2) .category-card__icon { background: var(--green); }
.category-card:nth-child(3) .category-card__icon { background: var(--blue); }
.category-card:nth-child(4) .category-card__icon { background: var(--pink); }
.category-card h3 {
  margin: 18px 0 4px; font-family: var(--font-title);
  font-size: 17px; line-height: 1.25;
}
.category-card p { margin: 0; color: var(--muted); font-size: 13px; }
.category-card__arrow {
  align-self: flex-end; margin-top: -18px; color: var(--main-dark);
  font-size: 18px; font-weight: 700;
}

/* ---------- work cards ---------- */

.work-grid {
  columns: 3; column-gap: 18px;
}
.work-card {
  break-inside: avoid; margin: 0 0 18px;
  border-radius: var(--radius); overflow: hidden;
  background: var(--card); border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: transform .22s ease, box-shadow .22s ease;
}
.work-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.work-card__media {
  display: block; width: 100%; padding: 0; border: 0; background: transparent;
  overflow: hidden;
}
.work-card__media img { width: 100%; transition: transform .5s ease; }
.work-card:hover .work-card__media img { transform: scale(1.03); }
.work-card__body { padding: 16px 18px 18px; }
.work-card__title {
  margin: 0; font-family: var(--font-title);
  font-size: 17px; line-height: 1.3;
}
.work-card__meta {
  display: flex; align-items: center; gap: 8px;
  margin-top: 7px; color: var(--muted); font-size: 12px;
}
.work-card__meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--muted); }
.work-card__desc { margin: 10px 0 0; font-size: 13px; color: #6d6760; }
.work-card__more {
  display: inline-block; margin-top: 10px;
  color: var(--main-dark); font-size: 12px; font-weight: 700;
}

.creation-grid, .moment-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
.creation-card, .moment-card {
  display: flex; flex-direction: column; overflow: hidden;
  border-radius: var(--radius-lg); background: var(--card);
  border: 1px solid var(--line); box-shadow: var(--shadow);
  transition: transform .22s ease, box-shadow .22s ease;
}
.creation-card:hover, .moment-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.creation-card__media { aspect-ratio: 4 / 3; overflow: hidden; background: var(--orange); }
.creation-card__media img, .moment-card__media img {
  width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease;
}
.creation-card:hover .creation-card__media img,
.moment-card:hover .moment-card__media img { transform: scale(1.04); }
.creation-card__body, .moment-card__body { padding: 18px 20px 20px; }
.creation-card__body h3, .moment-card__body h3 {
  margin: 0; font-family: var(--font-title); font-size: 18px; line-height: 1.3;
}
.creation-card__body p, .moment-card__body p {
  margin: 8px 0 0; color: #6d6760; font-size: 13px;
}
.creation-card__count {
  align-self: flex-start; margin-top: 14px;
  padding: 4px 10px; border-radius: 999px;
  background: var(--blue); color: #4f5d8a;
  font-size: 11px; font-weight: 700;
}

.moment-card__media {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  background: var(--blue);
}
.play-badge {
  position: absolute; inset: 0; margin: auto;
  width: 62px; height: 62px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .7);
  background: rgba(255, 255, 255, .9);
  color: var(--main-dark); display: grid; place-items: center;
  font-size: 22px; padding-left: 4px;
  box-shadow: 0 8px 20px rgba(69, 65, 61, .18);
  transition: transform .2s ease;
}
.moment-card:hover .play-badge { transform: scale(1.08); }
.moment-card__media-button {
  position: absolute; inset: 0; width: 100%; height: 100%;
  border: 0; background: transparent;
}

/* ---------- filters ---------- */

.filters {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin-bottom: 26px;
}
.chip {
  min-height: 36px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card);
  font-size: 13px; font-weight: 600; color: #6d6760;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.chip:hover { border-color: var(--main); }
.chip.is-active {
  background: var(--main); border-color: var(--main); color: #fff;
}
.filters__count { margin-left: auto; color: var(--muted); font-size: 13px; }

.filter-select {
  min-height: 38px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card);
  font-size: 13px; font-weight: 600;
}

/* ---------- demo banner ---------- */

.demo-banner {
  display: flex; align-items: flex-start; gap: 12px;
  margin-bottom: 26px; padding: 14px 18px;
  border-radius: var(--radius-sm);
  background: #FFF7EC; border: 1px dashed #e4c4a6;
  color: #7a6049; font-size: 13px;
}
.demo-banner strong { color: var(--main-dark); }
.demo-banner__mark {
  flex: none; padding: 2px 8px; border-radius: 999px;
  background: var(--main); color: #fff;
  font-size: 10px; font-weight: 800; letter-spacing: .1em;
}

.empty-state, .load-error {
  padding: 54px 24px; text-align: center;
  border: 1px dashed var(--line); border-radius: var(--radius-lg);
  background: var(--card); color: var(--muted);
}
.empty-state strong, .load-error strong { display: block; color: var(--ink); margin-bottom: 6px; }

/* ---------- lightbox / modal ---------- */

.lightbox, .modal {
  position: fixed; inset: 0; z-index: 100;
  display: none; align-items: center; justify-content: center;
  padding: 24px; background: rgba(38, 34, 30, .74);
  backdrop-filter: blur(4px);
}
.lightbox.is-open, .modal.is-open { display: flex; }
.lightbox__inner {
  position: relative; width: min(100%, 1000px);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.lightbox__image {
  max-width: 100%; max-height: min(74vh, 760px);
  border-radius: var(--radius); background: var(--bg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}
.lightbox__caption {
  color: #f7f1ea; font-size: 14px; text-align: center;
}
.lightbox__caption span { color: #c9c0b7; margin-left: 8px; font-size: 12px; }
.lightbox__close, .modal__close {
  position: absolute; top: -14px; right: -14px;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--card);
  font-size: 22px; line-height: 1; display: grid; place-items: center;
  box-shadow: var(--shadow);
}
.lightbox__nav {
  position: fixed; top: 50%; transform: translateY(-50%);
  width: 48px; height: 48px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .4);
  background: rgba(255, 255, 255, .16); color: #fff;
  font-size: 24px; display: grid; place-items: center;
}
.lightbox__nav:hover { background: rgba(255, 255, 255, .3); }
.lightbox__nav--prev { left: 20px; }
.lightbox__nav--next { right: 20px; }

.modal__panel {
  position: relative;
  width: min(100%, 760px); max-height: min(86vh, 860px);
  overflow-y: auto; padding: 28px;
  border-radius: var(--radius-lg); background: var(--card);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .28);
}
.modal__close { top: 14px; right: 14px; }
.modal__title {
  margin: 0 40px 4px 0; font-family: var(--font-title);
  font-size: 26px; line-height: 1.25;
}
.modal__meta { color: var(--muted); font-size: 12px; }
.modal__text { margin: 16px 0 0; color: #6d6760; font-size: 14px; }
.modal__section-title {
  margin: 24px 0 10px; font-size: 13px; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase; color: var(--main-dark);
}
.modal__gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.modal__gallery button {
  padding: 0; border: 1px solid var(--line); border-radius: var(--radius-sm);
  overflow: hidden; background: transparent;
}
.modal__gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.video-frame {
  margin-top: 18px; aspect-ratio: 16 / 9;
  border-radius: var(--radius); overflow: hidden; background: #211e1b;
}
.video-frame video { width: 100%; height: 100%; display: block; }
.video-placeholder {
  display: grid; place-items: center; gap: 8px; height: 100%;
  padding: 24px; text-align: center; color: #e8ded4; font-size: 14px;
}
.video-placeholder small { color: #b7aca2; }

/* ---------- back to top ---------- */

.back-to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 35;
  width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--card);
  color: var(--main-dark); font-size: 20px;
  box-shadow: var(--shadow-hover);
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
}
.back-to-top.is-on { opacity: 1; visibility: visible; transform: none; }
