/*
 * Amigoer theme extensions.
 * Project-specific CSS lives here so the compiled base stylesheet stays intact.
 */

/* Mobile sidebar: keep the page navigation complete, then show link blocks below it. */
.amigoer-mobile-sheet {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
}

.amigoer-mobile-nav-block,
.amigoer-mobile-links,
.amigoer-mobile-footer {
  flex: 0 0 auto;
  background: hsl(var(--background));
}

.amigoer-mobile-nav-block {
  min-height: 0;
}

.amigoer-mobile-nav-list {
  display: grid;
  gap: 0.25rem;
}

.amigoer-mobile-nav-item {
  min-height: 2.875rem;
}

/* Buttons and form actions. */
.amigoer-button,
.prose-amigoer .amigoer-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  min-height: 2.5rem;
  border: 1px solid hsl(var(--border));
  border-radius: 8px;
  background: hsl(var(--foreground));
  color: hsl(var(--background));
  padding: 0 1rem;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.amigoer-button:hover,
.prose-amigoer .amigoer-button:hover {
  opacity: 0.9;
  text-decoration: none;
}

.amigoer-button-secondary,
.prose-amigoer .amigoer-button-secondary {
  background: hsl(var(--card));
  color: hsl(var(--foreground));
}

.amigoer-button-secondary:hover,
.prose-amigoer .amigoer-button-secondary:hover {
  border-color: hsl(var(--foreground) / 0.3);
  background: hsl(var(--accent));
}

.amigoer-link-text {
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.amigoer-search-form {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.amigoer-search-actions .amigoer-button {
  height: 2.75rem;
  min-height: 2.75rem;
  white-space: nowrap;
}

.amigoer-view-image-target {
  cursor: zoom-in;
}

.amigoer-moment-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.875rem;
  padding-top: 0.75rem;
  border-top: 1px solid hsl(var(--border));
}

.amigoer-moment-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 2rem;
  border: 1px solid hsl(var(--border));
  border-radius: 999px;
  background: hsl(var(--background));
  color: hsl(var(--muted-foreground));
  padding: 0 0.75rem;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  line-height: 1;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease, opacity 0.15s ease;
}

.amigoer-moment-action:hover:not(:disabled) {
  border-color: hsl(var(--brand));
  color: hsl(var(--brand));
}

.amigoer-moment-action:disabled {
  opacity: 0.65;
  cursor: default;
}

.amigoer-moment-comments {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.875rem;
  padding-top: 0.875rem;
  border-top: 1px solid hsl(var(--border));
}

.amigoer-moment-comment {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  border-radius: 8px;
  background: hsl(var(--accent) / 0.35);
  padding: 0.75rem;
}

.amigoer-moment-comment-form {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.875rem;
  padding-top: 0.875rem;
  border-top: 1px solid hsl(var(--border));
}

.amigoer-moment-admin {
  margin-top: 0.875rem;
  padding-top: 0.875rem;
  border-top: 1px solid hsl(var(--border));
}

.amigoer-moment-admin > summary {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: hsl(var(--muted-foreground));
  font-size: 0.75rem;
  cursor: pointer;
}

.amigoer-moment-admin > summary:hover {
  color: hsl(var(--brand));
}

.amigoer-moment-edit-images {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.amigoer-moment-edit-images label {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid hsl(var(--border));
  border-radius: 8px;
  background: hsl(var(--muted));
  aspect-ratio: 1 / 1;
}

.amigoer-moment-edit-images input {
  position: absolute;
  z-index: 1;
  top: 0.4rem;
  left: 0.4rem;
}

.amigoer-moment-edit-images img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.is-pjax-loading #amigoer-pjax {
  opacity: 0.55;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

/* Shortcodes. */
.amigoer-sc {
  margin: 1.25rem 0;
}

.amigoer-sc-timeline {
  position: relative;
  display: grid;
  gap: 1rem;
  padding-left: 1.1rem;
  border-left: 1px solid hsl(var(--border));
}

.amigoer-sc-timeline-item {
  position: relative;
}

.amigoer-sc-timeline-item::before {
  content: "";
  position: absolute;
  left: -1.42rem;
  top: 0.4rem;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: hsl(var(--brand));
}

.amigoer-sc-timeline-time {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}
