/*
 * Location: css/components.css
 * Pieces shared by the public site and the admin dashboard.
 */

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 2.75rem;
  padding: 0.6rem 1.25rem;
  border: 2px solid var(--palm);
  border-radius: var(--radius);
  background: var(--palm);
  color: #fff;
  font-family: var(--font-display);
  font-size: var(--step-0);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.button:hover {
  background: var(--palm-deep);
  border-color: var(--palm-deep);
  color: #fff;
}

.button--gold {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--palm-deep);
}

.button--gold:hover {
  background: #f0b94a;
  border-color: #f0b94a;
  color: var(--palm-deep);
}

.button--outline-light {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.55);
  color: #fff;
}

.button--outline-light:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #fff;
}

.button--quiet {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.button--quiet:hover {
  background: var(--palm-tint);
  border-color: var(--palm);
  color: var(--palm-deep);
}

/* Loading, empty and error states */
.state {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-5) 0;
}

.state--empty,
.state--error {
  justify-items: start;
  padding: var(--space-5);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
}

.state--error {
  border-color: #e3b8b4;
  color: var(--danger);
}

.state__note {
  color: var(--muted);
  font-size: var(--step--1);
}

.skeleton {
  display: block;
  height: 1.1rem;
  border-radius: 3px;
  background: linear-gradient(90deg, #e8ebe5 0%, #f2f4ef 50%, #e8ebe5 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

.skeleton:first-child {
  height: 1.6rem;
  width: 60%;
}

.skeleton:last-of-type {
  width: 80%;
}

@keyframes shimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

/* Date badge: the day and month of an event, read first */
.date-badge {
  display: grid;
  align-content: center;
  justify-items: center;
  width: 4.5rem;
  min-height: 4.5rem;
  padding: var(--space-2);
  border-radius: var(--radius);
  background: var(--gold);
  color: var(--palm-deep);
  font-family: var(--font-display);
  line-height: 1;
  flex-shrink: 0;
}

.date-badge__day {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.date-badge__month {
  margin-top: 0.2rem;
  font-size: var(--step--1);
  font-weight: 600;
}

/* Post entry: image, title, date, summary */
.entry {
  display: grid;
  gap: var(--space-3);
  align-content: start;
}

.entry__media {
  display: block;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--palm-tint);
}

.entry__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.entry__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-3);
  color: var(--muted);
  font-family: var(--font-display);
  font-size: var(--step--1);
}

.entry__category {
  color: var(--palm);
  font-weight: 600;
  text-decoration: none;
}

.entry__title {
  font-size: var(--step-1);
}

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

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

.entry__summary {
  color: var(--muted);
  max-width: var(--measure);
}

/* Section heading row: title on the left, "see all" link on the right */
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-3);
  border-bottom: 2px solid var(--ink);
}

.section-head h2 {
  font-size: var(--step-3);
}

.section-head a {
  font-family: var(--font-display);
  font-weight: 600;
}

/* Pagination (public lists and admin tables) */
.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  margin-top: var(--space-7);
}

.pagination:empty {
  display: none;
}

.pagination__list {
  display: flex;
  gap: var(--space-1);
}

.pagination__link,
.pagination__step {
  display: inline-grid;
  place-items: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding-inline: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
  text-decoration: none;
}

.pagination__link:hover,
.pagination__step:hover {
  border-color: var(--palm);
  color: var(--palm-deep);
}

.pagination__link.is-current {
  border-color: var(--palm);
  background: var(--palm);
  color: #fff;
}

.pagination__step.is-disabled {
  color: var(--line);
  pointer-events: none;
}

.pagination__gap {
  display: grid;
  place-items: center;
  min-width: 1.5rem;
  color: var(--muted);
}

@media (max-width: 480px) {
  .pagination__list {
    display: none;
  }
}
