body {
  background-color: var(--paper);
}

/* Padding lives here, not on body — .page-content is a sibling of the navbar (see
   layouts/application.html.erb), so the navbar itself stays flush with the true top of the
   viewport regardless of how much inset any given page's content wants. */
.page-content {
  padding: 3rem 1.5rem 5rem;
}

.wrap {
  max-width: 40rem;
  margin: 0 auto;
}

a.back {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.95rem;
}

a.back:hover {
  text-decoration: underline;
}

h1 {
  font-size: 2.2rem;
  letter-spacing: -0.02em;
  margin: 1.5rem 0 0.3rem;
}

.trip-intro {
  color: #555;
  line-height: 1.6;
  margin-bottom: 3rem;
  white-space: pre-line;
}

.translation-notice {
  color: #999;
  font-size: 0.85rem;
  font-style: italic;
  margin: 0.75rem 0;
}

.translation-notice a {
  color: var(--accent);
  text-decoration: underline;
}

.translation-notice a:hover {
  color: var(--ink);
}

.trip-map-wrap {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding: 0 1.5rem;
  box-sizing: border-box;
}

.trip-distance {
  text-align: center;
  color: #999;
  font-size: 0.85rem;
  margin: 0.6rem 0 0;
}

.trip-map {
  position: relative;
  max-width: 72rem;
  height: 22rem;
  margin: 0 auto;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0.3rem 1rem rgba(0, 0, 0, 0.08);
  z-index: 0;
}

.trip-map-canvas {
  width: 100%;
  height: 100%;
}

.trip-map:fullscreen,
.trip-map:-webkit-full-screen {
  max-width: 100vw;
  height: 100vh;
  border-radius: 0;
}

.trip-map-hint {
  position: absolute;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.4);
  color: white;
  font-size: 0.95rem;
  font-weight: 500;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.trip-map-hint.visible {
  opacity: 1;
}

.trip-map-fullscreen {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  z-index: 1001;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  background: white;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.4);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.trip-map-fullscreen:hover {
  background: #f4f4f4;
}

.trip-map .leaflet-popup-content a {
  color: var(--accent);
  text-decoration: underline;
}

.trip-grid-wrap {
  /* Same full-bleed trick as the postcard gallery: break out of .wrap's narrow text
     column so the card grid has real room, then cap+center it at a wider max-width. */
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding: 0 1.5rem;
  box-sizing: border-box;
}

.trip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.75rem;
  max-width: 72rem;
  margin: 1rem auto 0;
}

.trip-card {
  display: block;
  color: var(--ink);
  text-decoration: none;
  border-radius: 6px;
  overflow: hidden;
  background: #fafafa;
  box-shadow: 0 0.3rem 1rem rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.trip-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 0.6rem 1.75rem rgba(0, 0, 0, 0.15);
}

.trip-card-image {
  aspect-ratio: 3 / 2;
  overflow: hidden;
}

.trip-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.trip-card:hover .trip-card-image img {
  transform: scale(1.05);
}

.trip-card-image--placeholder {
  background-image: radial-gradient(circle at 30% 20%, var(--panel-soft), var(--panel));
  display: flex;
  align-items: center;
  justify-content: center;
}

.trip-card-image--placeholder::before {
  content: "✎";
  font-size: 2rem;
  color: rgba(255, 255, 255, 0.25);
}

.trip-card-body {
  padding: 0.9rem 1rem 1.1rem;
}

.trip-card-date {
  font-size: 0.75rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.3rem;
}

.trip-card-title {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
}

.trip-card-photo-count {
  font-size: 0.75rem;
  color: #999;
  margin-top: 0.4rem;
}

.trip-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid #eee;
  font-size: 0.95rem;
}

.trip-nav a {
  color: var(--accent);
  text-decoration: none;
  max-width: 35%;
}

.trip-nav a:hover {
  text-decoration: underline;
}

.trip-nav .next {
  text-align: right;
}

.shortcuts {
  text-align: center;
  margin-top: 2rem;
}

.shortcuts-toggle {
  background: none;
  border: none;
  color: #999;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0.25rem;
  margin: 0 0.4rem;
}

.trip-share {
  display: block;
  margin: 1rem auto 0;
  background: none;
  border: none;
  color: #999;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0.25rem;
}

.trip-share:hover {
  color: var(--accent);
}

.shortcuts-toggle:hover {
  color: var(--accent);
}

.shortcuts-panel {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: #777;
}

.shortcuts-panel p {
  margin: 0.3rem 0;
}

.shortcuts-panel kbd {
  display: inline-block;
  min-width: 1.4rem;
  padding: 0.1rem 0.4rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #f7f7f7;
  font-family: inherit;
  font-size: 0.75rem;
  color: #555;
  margin: 0 0.1rem;
}

@media (max-width: 468px) {
  h1 {
    font-size: 1.8rem;
  }
}
