:root {
  --ink: #0b1f33;
  --muted: #3c5872;
  --bg: #f1f5fb;
  --panel: #ffffff;
  --accent: #2563eb;
  --accent-2: #0ea5b7;
  --sand: #dbe7f6;
  --shadow: 0 18px 36px rgba(11, 31, 51, 0.16);
  --radius: 18px;
  --font-body: 'Plus Jakarta Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background: radial-gradient(circle at 12% 18%, rgba(37, 99, 235, 0.08), transparent 32%),
              radial-gradient(circle at 80% 10%, rgba(14, 165, 183, 0.12), transparent 32%),
              linear-gradient(180deg, var(--bg), #e9f1fb);
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

main { padding-top: 88px; }
.shell { width: min(1180px, 100%); margin: 0 auto; padding: 0 22px; }

.eyebrow { font-size: 0.82rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.lead { font-size: clamp(1.05rem, 2.6vw, 1.25rem); line-height: 1.8; color: var(--muted); }
.label { font-size: 0.88rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
.hint { color: var(--muted); margin: 10px 0 0; font-size: 0.95rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; font-weight: 700; letter-spacing: 0.01em;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.3s ease, color 0.3s ease;
  cursor: pointer; border: none; background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: #fff; box-shadow: var(--shadow);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 20px 32px rgba(14, 165, 183, 0.24); }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid rgba(14, 165, 183, 0.26); box-shadow: none; }
.btn.ghost:hover { box-shadow: 0 12px 24px rgba(8, 26, 38, 0.12); color: var(--accent-2); }

.admin-logout.hidden { display: none; }

/* Header */
.header { position: fixed; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; background: linear-gradient(135deg, rgba(13, 44, 85, 0.95), rgba(25, 78, 140, 0.92)); padding: 12px 22px; border-bottom: 2px solid rgba(243, 201, 106, 0.3); backdrop-filter: blur(10px); box-shadow: 0 12px 26px rgba(11, 31, 51, 0.32); z-index: 1000; }
.logo { display: flex; align-items: center; gap: 10px; }
.logo img { height: 46px; width: auto; border-radius: 12px; box-shadow: 0 8px 16px rgba(0,0,0,0.14); }
.navbar { display: flex; align-items: center; }
.navbar ul { display: flex; list-style: none; margin: 0; padding: 0; align-items: center; }
.navbar li { margin: 0 8px; }
.navbar a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; color: #fdf7ef; border-radius: 999px; font-weight: 700; letter-spacing: 0.02em; transition: all 0.2s ease; position: relative; }
.navbar a:hover { background: rgba(243, 201, 106, 0.18); color: #fff; transform: translateY(-1px); }
.navbar .nav-item.active a { background: linear-gradient(135deg, rgba(37, 99, 235, 0.25), rgba(14, 165, 183, 0.25)); border: 1px solid rgba(242, 176, 90, 0.25); }
.icon { width: 1.6rem; height: 1.6rem; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: rgba(243, 201, 106, 0.2); color: #fff; font-size: 0.9rem; border: 1px solid rgba(243, 201, 106, 0.3); }
.nav-toggle { display: none; flex-direction: column; justify-content: space-between; width: 28px; height: 20px; cursor: pointer; }
.nav-toggle span { display: block; height: 3px; width: 100%; background-color: white; border-radius: 3px; }
.admin-only { display: none; }
.admin-only:not(.hidden) { display: block; }
.admin-logout { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: white; border: none; padding: 10px 18px; border-radius: 999px; cursor: pointer; font-size: 1rem; font-weight: 600; transition: background 0.3s, transform 0.2s; }
.admin-logout:hover { background: linear-gradient(135deg, var(--accent-2), var(--accent)); transform: scale(1.04); }

/* Hero */
.photos-hero { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 28px; align-items: center; padding: 110px 0 70px; position: relative; }
.photos-hero::before { content: ''; position: absolute; inset: -30% 30% 10% -10%; background: radial-gradient(circle, rgba(37, 99, 235, 0.22), transparent 60%); z-index: -2; }
.photos-hero::after { content: ''; position: absolute; inset: 10% 8% -12% 8%; background: linear-gradient(135deg, rgba(232, 215, 196, 0.5), transparent); z-index: -1; }
.hero__text h1 { font-family: var(--font-display); font-size: clamp(2.6rem, 5vw, 3.6rem); margin: 0 0 12px; letter-spacing: -0.02em; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 20px 0 10px; }
.hero__card { position: relative; background: linear-gradient(145deg, #ffffff, #f2f7ff); border-radius: 18px; padding: 18px; box-shadow: var(--shadow); border: 1px solid rgba(243, 201, 106, 0.22); overflow: hidden; }
.hero__card::before { content: ''; position: absolute; width: 180px; height: 180px; border-radius: 50%; right: -60px; top: -70px; background: radial-gradient(circle, rgba(14, 165, 183, 0.25), transparent 70%); }
.hero__card ul { margin: 8px 0 0 18px; color: var(--muted); line-height: 1.6; }

/* Gallery */
.photos-gallery { padding: 30px 0 120px; position: relative; }
.photos-gallery::before { content: ''; position: absolute; inset: 10% 0 -10% 0; background: radial-gradient(circle at 15% 40%, rgba(14, 165, 183, 0.14), transparent 40%), radial-gradient(circle at 80% 20%, rgba(37, 99, 235, 0.12), transparent 45%); z-index: -1; }
.section-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.section-header h2 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin: 0; font-family: var(--font-display); }
.section-pill { display: inline-block; padding: 6px 12px; border-radius: 999px; background: linear-gradient(135deg, rgba(37, 99, 235, 0.18), rgba(14, 165, 183, 0.18)); color: var(--accent-2); font-weight: 700; font-size: 0.9rem; letter-spacing: 0.02em; border: 1px solid rgba(14, 165, 183, 0.2); }

.photos-categories { display: flex; flex-direction: column; gap: 28px; }
.category-section { background: rgba(255, 255, 255, 0.82); border-radius: 20px; padding: 22px; border: 1px solid rgba(37, 99, 235, 0.16); box-shadow: 0 16px 30px rgba(8, 26, 38, 0.12); position: relative; overflow: hidden; }
.category-section::after { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), transparent 55%); pointer-events: none; }
.category-header { display: grid; gap: 8px; margin-bottom: 16px; }
.category-header h3 { margin: 0; font-size: clamp(1.4rem, 3vw, 1.9rem); font-family: var(--font-display); }
.category-description { margin: 0; color: var(--muted); line-height: 1.6; }
.category-grid, .gallery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.category-empty { margin: 0; padding: 14px; border: 1px dashed #e8d9c3; border-radius: 12px; color: var(--muted); font-weight: 600; background: #fff7ef; text-align: center; }
.photo-card { margin: 0; background: linear-gradient(180deg, #ffffff, #f5f9ff); border-radius: 18px; overflow: hidden; border: 1px solid rgba(37, 99, 235, 0.18); box-shadow: 0 16px 28px rgba(8, 26, 38, 0.12); transition: transform 0.3s ease, box-shadow 0.3s ease; position: relative; }
.photo-card::after { content: ''; position: absolute; inset: 0; background: linear-gradient(160deg, rgba(255, 255, 255, 0.2), transparent 55%); pointer-events: none; }
.photo-card img { width: 100%; height: clamp(210px, 26vw, 280px); object-fit: cover; transition: transform 0.4s ease, filter 0.4s ease; }
.photo-card figcaption { padding: 12px 14px; font-weight: 600; color: var(--muted); background: #f9f3e8; border-top: 1px solid rgba(243, 201, 106, 0.2); min-height: 60px; display: flex; align-items: center; justify-content: center; text-align: center; }
.photo-card:hover { transform: translateY(-6px); box-shadow: 0 22px 36px rgba(8, 26, 38, 0.18); }
.photo-card:hover img { transform: scale(1.04); filter: saturate(1.08); }
.photo-card:nth-child(3n) img { height: clamp(240px, 30vw, 320px); }
.photo-card:nth-child(4n + 1) img { height: clamp(230px, 28vw, 300px); }
.photo-actions { position: absolute; top: 10px; right: 10px; display: flex; gap: 8px; z-index: 2; }
.photo-action { border: none; border-radius: 999px; padding: 6px 12px; font-size: 0.78rem; font-weight: 700; cursor: pointer; color: #fff; background: rgba(11, 31, 51, 0.85); box-shadow: 0 6px 14px rgba(8, 26, 38, 0.2); transition: transform 0.2s ease, box-shadow 0.2s ease; }
.photo-action.edit { background: rgba(37, 99, 235, 0.92); }
.photo-action.remove { background: rgba(14, 165, 183, 0.92); }
.photo-action:hover { transform: translateY(-1px); box-shadow: 0 10px 18px rgba(8, 26, 38, 0.24); }

/* Lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(7, 18, 30, 0.72); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px; z-index: 1200; }
.lightbox.hidden { display: none; }
.lightbox img { max-width: min(960px, 92vw); max-height: 72vh; border-radius: 18px; box-shadow: 0 22px 40px rgba(8, 26, 38, 0.35); border: 1px solid rgba(255, 255, 255, 0.25); background: #0b1f33; }
.lightbox-caption { margin: 0; color: #f8fafc; font-weight: 600; text-align: center; max-width: min(860px, 92vw); }
.lightbox-close { position: absolute; top: 20px; right: 22px; border: none; background: rgba(15, 23, 42, 0.8); color: #fff; font-size: 2rem; line-height: 1; width: 44px; height: 44px; border-radius: 50%; cursor: pointer; box-shadow: 0 12px 24px rgba(8, 26, 38, 0.3); }
.lightbox-close:hover { transform: scale(1.05); }
.empty-state { margin: 0 0 18px; padding: 14px; border: 1px dashed #e8d9c3; border-radius: 12px; color: var(--muted); font-weight: 600; background: #fff7ef; text-align: center; }
.empty-state.hidden { display: none; }
.add-photo-btn { margin-top: 18px; padding: 12px 20px; background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: white; border: none; border-radius: 999px; cursor: pointer; font-size: 1rem; font-weight: 700; transition: background 0.3s, transform 0.2s; }
.add-photo-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 20px rgba(14, 165, 183, 0.22); }
.category-link { border-color: rgba(37, 99, 235, 0.35); color: #1d4ed8; }
.category-link:hover { color: #0f172a; border-color: rgba(14, 165, 183, 0.4); }

/* Focus */
.btn:focus-visible, .navbar a:focus-visible, .nav-toggle:focus-visible { outline: 3px solid rgba(14, 165, 183, 0.6); outline-offset: 3px; }

/* Responsive */
@media (max-width: 900px) {
  .photos-hero { padding: 100px 0 60px; }
}

@media (max-width: 768px) {
  main { padding-top: 76px; }
  .nav-toggle { display: flex; z-index: 1001; }
  .navbar ul { display: none; position: fixed; top: calc(70px + env(safe-area-inset-top)); left: 0; right: 0; width: 100%; max-height: calc(100vh - 70px - env(safe-area-inset-top)); overflow-y: auto; flex-direction: column; align-items: center; padding: 18px 0; background: rgba(13, 44, 85, 0.96); box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25); transform: translateY(-100%); opacity: 0; transition: all 0.3s ease; z-index: 1002; }
  .navbar ul.active { display: flex; transform: translateY(0); opacity: 1; }
  .navbar li { margin: 10px 0; width: 100%; text-align: center; }
  .navbar a, .admin-logout { width: 100%; justify-content: center; padding: 12px 20px; }
  .hero__actions { flex-direction: column; }
  .btn { width: 100%; justify-content: center; }
}

@media (max-width: 520px) {
  .gallery-grid { grid-template-columns: 1fr; }
  .photo-card img { height: 200px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .btn, .navbar a, .photo-card { transition: none !important; }
}

.header.scrolled { background: rgba(13, 44, 85, 0.96); box-shadow: 0 14px 32px rgba(11, 31, 51, 0.4); }
