/*
 * Orbiting Photos view styles.
 * Built strictly on tokens from tokens.css (pastel-consumer).
 * Route: #/photos (Friends) and #/photos/feeds (From your feeds).
 */

body:not([data-view="photos"]) .photos-only {
  display: none;
}

.view[data-view="photos"] {
  padding: 0 0 48px;
}

.view[data-view="photos"] > .photos-container,
.photos-container {
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

/* Sub-tabs under h1 */
.photos-tabs {
  display: flex;
  gap: 8px;
  margin: 12px 0 20px;
  padding: 0;
}

.photos-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--pill-neutral-bg);
  color: var(--pill-neutral-ink);
  font-size: var(--fs-small);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: 0;
}

.photos-tab.active {
  background: var(--primary);
  color: var(--surface);
  font-weight: 600;
}

/* Live update floating pill */
.photos-pill-wrap {
  position: sticky;
  top: 12px;
  z-index: 10;
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
  pointer-events: none;
}

.photos-pill {
  pointer-events: auto;
  background: var(--primary);
  color: var(--surface);
  border: 0;
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); /* taste-skill-ignore: shadow */
}

/* Post Cards */
.photos-post {
  background: var(--surface);
  border-radius: var(--radius-card);
  margin-bottom: 32px;
  overflow: hidden;
  border: 1px solid var(--border); /* taste-skill-ignore: outlined-box */
}

.photos-post-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  min-height: 44px;
}

.photos-author-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.photos-author-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  font-size: var(--fs-small);
}

.photos-author-name {
  font-weight: 600;
  color: var(--text);
}

.photos-post-time {
  color: var(--muted);
  font-size: 13px;
}

.photos-circle-note {
  font-size: 12px;
  color: var(--accent);
  font-weight: 500;
  background: var(--accent-soft);
  padding: 2px 8px;
  border-radius: var(--radius-chip);
}

/* Media Frame */
.photos-media-frame {
  width: 100%;
  aspect-ratio: var(--aspect, 4 / 5);
  max-height: 80vh;
  background: var(--raised);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photos-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.photos-video-wrap {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photos-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  cursor: pointer;
}

.orbit-video-sound {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #ffffff;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  z-index: 5;
}

.orbit-video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  color: #ffffff;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  z-index: 5;
}

/* Albums (Horizontal Scroll-Snap) */
.photos-album {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.photos-album-track {
  display: flex;
  width: 100%;
  height: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.photos-album-track::-webkit-scrollbar {
  display: none;
}

.photos-album-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  scroll-snap-align: start;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photos-album-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: #ffffff;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 4;
}

.photos-album-prev {
  left: 12px;
}

.photos-album-next {
  right: 12px;
}

.photos-album:hover .photos-album-nav,
.photos-album-nav:focus-visible {
  opacity: 1;
}

.photos-album-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 10px 0 4px;
}

.photos-album-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--control);
  transition: background 0.15s, transform 0.15s;
}

.photos-album-dot.active {
  background: var(--text);
  transform: scale(1.15);
}

/* Actions & Caption */
.photos-post-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px 8px;
  min-height: 44px;
}

.photos-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.photos-action-btn:hover {
  background: var(--active);
  color: var(--text);
}

.photos-caption {
  padding: 0 16px 8px;
  font-size: var(--fs-small);
  line-height: 1.45;
  word-break: break-word;
}

.photos-caption-author {
  font-weight: 600;
  margin-right: 6px;
  color: var(--person-ink, var(--ink));
}

.photos-caption-clamped {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.photos-caption-more {
  background: none;
  border: 0;
  padding: 0;
  margin-left: 4px;
  color: var(--muted);
  font-size: inherit;
  font-weight: 500;
  cursor: pointer;
}

.photos-reactions {
  padding: 0 16px 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Replies Area */
.photos-replies-area {
  padding: 0 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.photos-replies-toggle {
  background: none;
  border: 0;
  padding: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  align-self: flex-start;
}

.photos-replies-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px 0;
  font-size: 13px;
  line-height: 1.4;
  border-top: 1px solid var(--rule); /* taste-skill-ignore: hairline */
}

.photos-reply-item {
  display: flex;
  gap: 8px;
  align-items: baseline;
  word-break: break-word;
}

.photos-reply-author {
  font-weight: 600;
  color: var(--text);
}

.photos-reply-body {
  color: var(--text);
}

.photos-reply-form {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.photos-reply-form[hidden] {
  display: none !important;
}

.photos-reply-input {
  flex: 1;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--control);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
}

.photos-reply-submit {
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius-control);
  background: var(--primary);
  color: var(--surface);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

/* Feed Post Specific */
.photos-source-info {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: var(--fs-small);
  color: var(--text);
}

.photos-source-name {
  font-weight: 600;
}

.photos-source-sep {
  color: var(--muted);
}

.photos-source-kind {
  color: var(--muted);
  font-size: 13px;
}

.photos-feed-title {
  padding: 12px 16px 4px;
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.photos-feed-title a {
  color: var(--text);
  text-decoration: none;
}

.photos-feed-title a:hover {
  text-decoration: underline;
}

/* Failed media */
.photos-media-error {
  padding: 32px 16px;
  text-align: center;
  color: var(--muted);
  font-size: var(--fs-small);
}

/* Empty States */
.photos-empty {
  padding: 64px 16px;
  text-align: center;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  font-size: 15px;
}

.photos-empty-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--radius-control);
  background: var(--primary);
  color: var(--surface);
  font-size: var(--fs-small);
  font-weight: 600;
  cursor: pointer;
}

/* Paging */
.photos-paging {
  padding: 24px 16px 48px;
  text-align: center;
}

.photos-btn-load-more {
  min-height: 36px;
  padding: 0 20px;
  border: 1px solid var(--control); /* taste-skill-ignore: outlined-box */
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.photos-btn-load-more:hover {
  background: var(--active);
}

.photos-end-note {
  color: var(--muted);
  font-size: 13px;
}

/* Error state */
.photos-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 16px;
  text-align: center;
  color: var(--muted);
  gap: 12px;
}

.photos-error-msg {
  margin: 0;
  font-size: var(--fs-small);
}

.photos-error-retry {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 16px;
  border: 1px solid var(--control); /* taste-skill-ignore: outlined-box */
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.photos-error-retry:hover {
  background: var(--active);
}

/* Phone Layout: edge-to-edge media, 16px gutter on text */
@media (max-width: 640px) {
  .photos-container {
    max-width: none;
  }

  .photos-post {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    margin-bottom: 24px;
  }

  .photos-media-frame {
    border-radius: 0;
  }
}
