/*
Theme Name: EvanPhoto
Theme URI: https://evan.xin
Author: Evan
Author URI: https://evan.xin
Description: Evan Photo — 极简沉浸式画廊主题。为纯视觉叙事而生。零冗余元素，让每一张照片都成为页面的绝对主角。可作为独立站点运行，也能作为专属相册或作品集展区。
Version: 2.4.0
License: MIT
Text Domain: evanphoto
*/

/* ─────────────────────────────────────────
   Hero share button — absolute top-left corner of hero card
   ───────────────────────────────────────── */
.evanphoto-hero-share-topleft {
  position: absolute !important;
  top: 14px;
  left: 14px;
  z-index: 20;
}
/* ─────────────────────────────────────────
   Footer copyright link
   ───────────────────────────────────────── */
.footer-link {
  color: rgba(255,255,255,.65);
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,.2);
  transition: color .15s;
}
.footer-link:hover { color: rgba(255,255,255,1); }

/* ─────────────────────────────────────────
   Hero: Home link (bottom of hero card)
   ───────────────────────────────────────── */
.evanphoto-home-link {
  font-size: 13px;
  color: rgba(255,255,255,.60);
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,.18);
  padding-bottom: 1px;
  transition: color .15s;
}
.evanphoto-home-link:hover { color: rgba(255,255,255,1); }

/* ─────────────────────────────────────────
   Share trigger pill  (hero top-left + any standalone use)
   Modal icon-only override is in gallery.js injected CSS
   ───────────────────────────────────────── */
.evanphoto-share-trigger {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: rgba(255,255,255,.70);
  background: rgba(0,0,0,.38);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 9999px;
  padding: 5px 12px 5px 10px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background .15s, color .15s, border-color .15s;
  line-height: 1;
}
.evanphoto-share-trigger:hover {
  background: rgba(255,255,255,.14);
  color: rgba(255,255,255,1);
  border-color: rgba(255,255,255,.28);
}

.nextjsconf-pagination {
  margin-top: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  font-size: 14px;
  line-height: 1;
  color: rgba(255,255,255,.6);
}
.nextjsconf-pagination a,
.nextjsconf-pagination span {
  color: rgba(255,255,255,.75);
  text-decoration: none !important;
  padding: 4px 2px;
}
.nextjsconf-pagination a:hover { color: rgba(255,255,255,1); }
.nextjsconf-pagination .is-current {
  color: rgba(255,255,255,1);
  font-weight: 700;
}
.nextjsconf-pagination .is-disabled { color: rgba(255,255,255,.25); }

/* ─────────────────────────────────────────
   Copyright
   ───────────────────────────────────────── */
.nextjsconf-copyright {
  margin-top: 18px;
  margin-bottom: 26px;
  text-align: center;
  color: rgba(255,255,255,.45);
  font-size: 13px;
  line-height: 1.6;
}
.nextjsconf-copyright a { color: rgba(255,255,255,.65); text-decoration: none; }
.nextjsconf-copyright a:hover { color: rgba(255,255,255,1); }

/* ─────────────────────────────────────────
   Thumbnail grid cells
   Grid shows every photo in a 3:2 box.
   The <a> is the fixed-ratio container; <img> fills it with object-fit:cover.
   A loading skeleton is rendered first and hidden once the image fires onload.
   ───────────────────────────────────────── */
.grid a.evanphoto-thumb-link {
  display: block;
  position: relative;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border-radius: 0.5rem;
}
.grid a.evanphoto-thumb-link img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  object-position: center top; /* keep faces/subjects near top for portrait shots */
  border-radius: 0 !important;
  display: block;
}

/* Skeleton shimmer placeholder */
.evanphoto-skeleton {
  display: block;
  position: absolute;
  inset: 0;
  border-radius: 0.5rem;
  background: linear-gradient(
    90deg,
    rgba(255,255,255,.05) 25%,
    rgba(255,255,255,.12) 50%,
    rgba(255,255,255,.05) 75%
  );
  background-size: 200% 100%;
  animation: evanphoto-shimmer 1.4s ease-in-out infinite;
}
@keyframes evanphoto-shimmer {
  0%   { background-position: 200% center; }
  100% { background-position: -200% center; }
}

/* ─────────────────────────────────────────
   Modal main image — show full image (contain, not crop)
   Portrait images will appear tall inside the modal.
   ───────────────────────────────────────── */
#nextjsconf-modal-root img {
  object-fit: contain;
  object-position: center;
}

/* Portrait modal container: allow taller aspect ratio */
#nextjsconf-modal-root .evanphoto-modal-portrait-img {
  max-height: 90vh;
  width: auto;
  max-width: 100%;
}

/* ─────────────────────────────────────────
   PC: few-image single-row hero alignment
   ───────────────────────────────────────── */
@media (min-width: 1280px) {
  .evanphoto-fewrow .evanphoto-hero {
    grid-row: span 1 / span 1 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    justify-content: center !important;
  }
}

/* ─────────────────────────────────────────
   Album filter bar
   ───────────────────────────────────────── */
.evanphoto-album-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.evanphoto-album-bar button {
  padding: 6px 14px;
  border-radius: 9999px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.07);
  color: rgba(255,255,255,.75);
  font-size: 13px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.evanphoto-album-bar button:hover {
  background: rgba(255,255,255,.15);
  color: #fff;
}
.evanphoto-album-bar button.is-active {
  background: rgba(255,255,255,.22);
  color: #fff;
  border-color: rgba(255,255,255,.40);
  font-weight: 600;
}

/* ─────────────────────────────────────────
   Mobile: floating add button & modal
   ───────────────────────────────────────── */
#evanphoto-mobile-add-btn {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 60;
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.9);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
}
@media (max-width: 767px) {
  #evanphoto-mobile-add-btn { display: flex; }
}

#evanphoto-mobile-add-modal.hidden { display: none; }
#evanphoto-mobile-add-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
}
#evanphoto-mobile-add-modal .overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(14px);
}
#evanphoto-mobile-add-modal .panel {
  position: absolute;
  left: 16px;
  right: 16px;
  top: 70px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(20,20,20,.9);
  color: rgba(255,255,255,.92);
  overflow: hidden;
}
#evanphoto-mobile-add-modal .panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,.10);
}
#evanphoto-mobile-add-modal .panel header .title { font-weight: 700; font-size: 14px; }
#evanphoto-mobile-add-modal .panel header button {
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.75);
  font-size: 18px;
}
#evanphoto-mobile-add-modal .panel .body { padding: 12px 14px 14px; }
#evanphoto-mobile-add-modal label { display:block; font-size:12px; color:rgba(255,255,255,.65); margin:10px 0 6px; }
#evanphoto-mobile-add-modal input[type="text"],
#evanphoto-mobile-add-modal input[type="url"] {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.35);
  color: rgba(255,255,255,.92);
  outline: none;
}
#evanphoto-mobile-add-modal .seg {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
#evanphoto-mobile-add-modal .seg button {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.25);
  color: rgba(255,255,255,.85);
}
#evanphoto-mobile-add-modal .seg button.active {
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.20);
}
#evanphoto-mobile-add-modal .actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
}
#evanphoto-mobile-add-modal .actions button {
  flex: 1;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.12);
  color: #fff;
  font-weight: 700;
}
#evanphoto-mobile-add-modal .actions button.secondary {
  background: rgba(0,0,0,.2);
  color: rgba(255,255,255,.85);
  font-weight: 600;
}
#evanphoto-mobile-add-modal .hint {
  margin-top: 10px;
  font-size: 12px;
  color: rgba(255,255,255,.55);
}

/* Progress bar (absolute positioned, doesn't affect panel height) */
#evanphoto-mobile-add-modal .progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255,255,255,.10);
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
#evanphoto-mobile-add-modal .progress .bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, rgba(255,255,255,.35), rgba(255,255,255,.95), rgba(255,255,255,.35));
  transition: width .15s ease;
}
#evanphoto-mobile-add-modal .progress.is-active { opacity: 1; }
#evanphoto-mobile-add-modal .progress.is-indeterminate .bar {
  width: 35%;
  animation: evanphoto-progress 1.1s ease-in-out infinite;
}
@keyframes evanphoto-progress {
  0%   { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}
