/* ─── Reset & Base ─── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #F8F6F3;
  --white: #FFFFFF;
  --text: #111111;
  --text-muted: #888888;
  --border: #E8E6E2;
  --tag-bg: #EDEAE5;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --radius-card: 12px;
  --radius-pill: 100px;
  --shadow-hover: 0 10px 28px rgba(0, 0, 0, 0.09);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ─── Header ─── */
header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 1.75rem 0 0;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.logo-link {
  display: inline-block;
  text-decoration: none;
}

.site-name {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.04em;
  color: var(--text);
  display: block;
}

.tagline {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: 0.4rem;
  font-weight: 400;
}

/* ─── Nav ─── */
.site-nav {
  display: flex;
  gap: 0;
  margin-top: 1.25rem;
  border-top: 1px solid var(--border);
  width: 100%;
  justify-content: center;
}

.nav-link {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.7rem 1.5rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  position: relative;
  transition: color 0.15s;
}

.nav-link:hover {
  color: var(--text);
}

.nav-link.active {
  color: var(--text);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--text);
}

/* ─── Search Bar ─── */
.search-bar-wrap {
  max-width: 1200px;
  margin: 2rem auto 0;
  padding: 0 2rem;
}

#searchInput {
  width: 100%;
  font-family: var(--font);
  font-size: 0.9rem;
  color: var(--text);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.7rem 1rem 0.7rem 2.5rem;
  outline: none;
  transition: border-color 0.15s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 0.75rem center;
}

#searchInput:focus {
  border-color: var(--text);
}

#searchInput::placeholder {
  color: var(--text-muted);
}

/* ─── Controls ─── */
.controls {
  max-width: 1200px;
  margin: 2rem auto 0.75rem;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  white-space: nowrap;
}

.filter-pills {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.pill {
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text);
  padding: 0.28rem 0.85rem;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  font-weight: 500;
}

.pill:hover {
  border-color: var(--text);
}

.pill.active {
  background: var(--text);
  color: var(--white);
  border-color: var(--text);
}

.sort-group select {
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text);
  padding: 0.28rem 2rem 0.28rem 0.75rem;
  border-radius: 8px;
  font-size: 0.78rem;
  font-family: var(--font);
  font-weight: 500;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  transition: border-color 0.15s;
}

.sort-group select:hover {
  border-color: var(--text);
}

/* ─── Stats ─── */
.stats {
  max-width: 1200px;
  margin: 0 auto 1.5rem;
  padding: 0 2rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ─── Grid ─── */
.grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem 5rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

/* ─── Card ─── */
.card {
  background: var(--white);
  border-radius: var(--radius-card);
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.card-photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  background: var(--tag-bg);
}

.card-photo-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: linear-gradient(145deg, #E8E2D9, #D4C9B5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  user-select: none;
}

.card-body {
  padding: 1.1rem 1.2rem 1.3rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.card-name {
  font-size: 0.975rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tag {
  background: var(--tag-bg);
  color: var(--text);
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-pill);
  letter-spacing: 0.01em;
}

.card-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.card-excerpt {
  font-size: 0.83rem;
  color: var(--text-muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 0.2rem;
}

/* ─── Empty State ─── */
.empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 5rem 2rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

/* ─── Modal ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: var(--white);
  border-radius: 16px;
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  border: none;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  font-size: 0.9rem;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.modal-close:hover {
  background: rgba(0, 0, 0, 0.7);
}

/* Modal gallery */
.modal-gallery {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--tag-bg);
  overflow: hidden;
  border-radius: 16px 16px 0 0;
}

.modal-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.modal-gallery-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  background: linear-gradient(145deg, #E8E2D9, #D4C9B5);
}

/* Photo thumbs */
.modal-thumbs {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 2rem 0;
  overflow-x: auto;
  scrollbar-width: none;
}

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

.modal-thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0.65;
  transition: opacity 0.15s;
  flex-shrink: 0;
  border: 2px solid transparent;
}

.modal-thumb.active,
.modal-thumb:hover {
  opacity: 1;
  border-color: var(--text);
}

/* Modal body */
.modal-info {
  padding: 1.5rem 2rem 2rem;
}

.modal-info h2 {
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin-bottom: 0.6rem;
}

.modal-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.modal-address {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.modal-description {
  font-size: 0.93rem;
  line-height: 1.78;
  color: #2A2A2A;
}

.modal-description p + p {
  margin-top: 0.9rem;
}

.modal-links {
  margin-top: 1.5rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.modal-link {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border-bottom: 1px solid var(--text);
  padding-bottom: 0.1rem;
  transition: opacity 0.15s;
}

.modal-link:hover {
  opacity: 0.5;
}

/* ─── Footer ─── */
footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 2rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-nav {
  display: flex;
  gap: 1.5rem;
}

.footer-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.78rem;
  transition: color 0.15s;
}

.footer-nav a:hover {
  color: var(--text);
}

/* ─── Static Pages (About, Contact) ─── */
.page-content {
  max-width: 1200px;
  margin: 3rem auto 5rem;
  padding: 0 2rem;
}

.page-body {
  max-width: 640px;
}

.page-title {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
}

.page-body h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.6rem;
}

.page-body p {
  font-size: 0.95rem;
  color: #2A2A2A;
  line-height: 1.8;
  margin-bottom: 1rem;
}

.page-body a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ─── Contact Form ─── */
.contact-form {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text);
  letter-spacing: 0.01em;
}

.form-group input,
.form-group select,
.form-group textarea {
  font-family: var(--font);
  font-size: 0.9rem;
  color: var(--text);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 0.9rem;
  transition: border-color 0.15s;
  outline: none;
  width: 100%;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--text);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.submit-btn {
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--text);
  color: var(--white);
  border: none;
  border-radius: 8px;
  padding: 0.75rem 1.75rem;
  cursor: pointer;
  align-self: flex-start;
  transition: opacity 0.15s;
  letter-spacing: 0.01em;
}

.submit-btn:hover {
  opacity: 0.75;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    padding: 0 1rem 4rem;
  }
  .controls { padding: 0 1rem; }
  .stats { padding: 0 1rem; }
  .header-inner { padding: 0 1rem; }
  .modal-info { padding: 1.25rem 1.25rem 1.75rem; }
  .modal-thumbs { padding: 0.6rem 1.25rem 0; }
  .modal-info h2 { font-size: 1.25rem; }
  .page-content { margin: 2rem auto 4rem; }
  .footer-inner { flex-direction: column; align-items: flex-start; }

}

@media (max-width: 480px) {
  .grid { grid-template-columns: 1fr; }
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal { border-radius: 16px 16px 0 0; max-height: 95vh; }
  .modal-gallery { border-radius: 16px 16px 0 0; }
  .nav-link { padding: 0.7rem 1rem; }
}
