/* Resource navigation uses native links, so the whole card supports touch,
   keyboard activation, opening a new tab, and copying the destination. */
.resource-link {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  color: inherit;
  text-decoration: none;
  border-radius: var(--senren-radius);
}

.resource-card[data-senren-component="card"] {
  min-width: 0;
  height: 100%;
  transition: border-color .18s, background-color .18s, box-shadow .18s, transform .18s;
}

.resource-link-content {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.resource-link-main {
  flex: 1;
  min-width: 0;
}

.resource-link-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem .75rem;
  min-width: 0;
}

.resource-link-title {
  min-width: 0;
  max-width: 100%;
  color: hsl(var(--senren-secondary-foreground));
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.6;
  white-space: normal;
  overflow-wrap: anywhere;
}

.resource-link-metadata {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .4rem;
  min-width: 0;
  max-width: 100%;
}

.resource-link-description, .resource-link-detail {
  margin-top: .4rem;
  color: hsl(var(--senren-muted-foreground));
  overflow-wrap: anywhere;
  white-space: normal;
}

.resource-link-description {
  font-size: .875rem;
  line-height: 1.6;
}

.resource-link-detail {
  font-size: .75rem;
  line-height: 1.6;
}

.resource-link-trailing {
  flex-shrink: 0;
  max-width: 35%;
  text-align: right;
  font-size: .875rem;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.resource-link-action {
  display: block;
  margin-top: .4rem;
  color: hsl(var(--senren-secondary-foreground));
  font-size: .8rem;
}

.resource-link-arrow {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: .6rem;
  background: hsl(var(--senren-secondary));
  color: hsl(var(--senren-secondary-foreground));
  transition: transform .18s;
}

.resource-link:hover .resource-card {
  border-color: hsl(var(--senren-ring));
  background: hsl(var(--senren-secondary) / .5);
  box-shadow: 0 5px 0 hsl(var(--senren-border) / .7);
  transform: translateY(-1px);
}

.resource-link:hover .resource-link-arrow {
  transform: translateX(3px);
}

.resource-link:active .resource-card {
  transform: translateY(2px);
  box-shadow: none;
}

.resource-link:focus-visible {
  outline: 3px solid hsl(var(--senren-ring));
  outline-offset: 4px;
}

.resource-link--compact .resource-card[data-senren-component="card"] {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.resource-link--compact .resource-card > div {
  padding: .8rem;
}

.resource-link--compact .resource-link-content {
  gap: .65rem;
}

.resource-link--compact .resource-link-title {
  font-size: .9rem;
}

.resource-link--compact:hover .resource-card {
  border-color: hsl(var(--senren-border));
  background: hsl(var(--senren-secondary));
}

.resource-link--compact .resource-link-arrow {
  width: 1.5rem;
  height: 1.5rem;
}

/* Long titles elsewhere must also wrap instead of inheriting fixed-height,
   single-line button styling. Action labels retain a comfortable hit area. */
a[data-senren-component="button"] {
  min-width: 0;
  max-width: 100%;
  height: auto;
  white-space: normal;
  overflow-wrap: anywhere;
}

.teacher-detail-layout > * {
  min-width: 0;
}

@media (max-width: 379px) {
  .app-brand {
    font-size: .8rem;
    gap: .4rem;
    min-height: 2.75rem;
  }
  .app-brand-mark {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: .8rem;
    font-size: .8rem;
  }
}

@media (max-width: 639px) {
  .resource-card > div {
    padding: 1rem;
  }
  .resource-link-content {
    flex-wrap: wrap;
    gap: .75rem;
  }
  .resource-link-main {
    flex-basis: calc(100% - 3rem);
  }
  .resource-link-trailing {
    order: 1;
    max-width: 100%;
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
  }
  .resource-link-action {
    margin-top: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .resource-card, .resource-link-arrow {
    transition: none;
  }
}
