/* arpapin.us — Global Styles */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #f7f5f2;
  --card-bg: #ffffff;
  --text: #2c2c2c;
  --text-muted: #888;
  --border: #e8e5e0;
  --accent: #2c2c2c;
  --accent-hover: #555;
  --radius: 14px;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --max-width: 1100px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

html { font-size: 16px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* Layout */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  padding: 32px 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.site-header .admin-link {
  font-size: 13px;
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.site-header .admin-link:hover {
  border-color: var(--accent);
  color: var(--text);
}

/* Trip Cards Grid */
.trip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  padding-bottom: 60px;
}

.trip-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  border: 1px solid var(--border);
}

.trip-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.09);
}

.trip-card .cover {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  background: linear-gradient(135deg, #e0dcd5, #d5cfc5);
}

.trip-card .cover-placeholder {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, #e0dcd5, #d5cfc5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: #bbb8b0;
}

.trip-card .info {
  padding: 16px 18px;
}

.trip-card .info h2 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 4px;
}

.trip-card .info .date {
  font-size: 13px;
  color: var(--text-muted);
}

.trip-card .info .photo-count {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}

.empty-state .icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h3 { font-size: 18px; margin-bottom: 8px; color: var(--text); }
.empty-state p { font-size: 14px; }

/* Trip Detail Page */
.trip-detail-header {
  padding: 24px 0 20px;
}

.back-link {
  font-size: 14px;
  color: var(--text-muted);
  display: inline-block;
  margin-bottom: 8px;
  transition: color 0.2s;
}

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

.trip-detail-header h1 {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.trip-detail-header .meta {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

.trip-detail-header .description {
  font-size: 15px;
  color: #666;
  margin-top: 8px;
  line-height: 1.6;
}

/* Photo Gallery */
.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 8px;
  padding-bottom: 60px;
}

.photo-gallery .photo-frame {
  position: relative;
}

.photo-gallery .photo-item {
  position: relative;
  cursor: pointer;
  border-radius: 6px;
  overflow: hidden;
  aspect-ratio: 1;
  background: #f0eee8;
}

.photo-gallery .photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s;
}

.photo-gallery .photo-item:hover img {
  transform: scale(1.03);
}

/* Wide photo (spans 2 cols) */
.photo-gallery .photo-frame.wide {
  grid-column: span 2;
  grid-row: span 2;
}

.photo-gallery .photo-frame.wide .photo-item {
  aspect-ratio: auto;
  height: calc(100% - 38px);
  min-height: 250px;
}

.photo-gallery figcaption {
  padding: 8px 2px 0;
  color: #5f5f5f;
  font-size: 14px;
  line-height: 1.4;
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.92);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.lightbox.open { display: flex; }

.lightbox img {
  max-width: 92vw;
  max-height: 92vh;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: none;
  border: none;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  padding: 8px;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.lightbox-close:hover { opacity: 1; }

.lightbox-prev, .lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  font-size: 32px;
  padding: 16px 12px;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.2s;
  line-height: 1;
}

.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }
.lightbox-prev:hover, .lightbox-next:hover { background: rgba(255,255,255,0.25); }

.lightbox-counter {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.6);
  font-size: 14px;
}

.lightbox-caption {
  position: absolute;
  left: 50%;
  bottom: 52px;
  transform: translateX(-50%);
  width: min(720px, 84vw);
  color: rgba(255,255,255,0.88);
  font-size: 15px;
  line-height: 1.45;
  text-align: center;
}

/* Loading */
.loading {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
  font-size: 15px;
}

/* Responsive */
@media (max-width: 640px) {
  .trip-grid { grid-template-columns: 1fr; gap: 16px; }
  .photo-gallery { grid-template-columns: repeat(2, 1fr); gap: 4px; }
  .photo-gallery .photo-frame.wide { grid-column: span 2; grid-row: span 2; }
  .photo-gallery .photo-frame.wide .photo-item { min-height: 180px; }
  .photo-gallery figcaption { font-size: 12px; padding: 6px 2px 8px; }
  .site-title { font-size: 18px; }
  .trip-detail-header h1 { font-size: 22px; }
}
