/* 教學資源 — 左圖右文（版面共用 qna.css） */

.resource-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.resource-item {
  display: flex;
  align-items: stretch;
  border: 1px solid #e8ecef;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.resource-logo {
  flex: 0 0 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: #fafafa;
  border-right: 1px solid #eef1f3;
}

.resource-logo img {
  display: block;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.resource-body {
  flex: 1;
  min-width: 0;
  padding: 16px 18px 18px;
}

.resource-badge {
  display: inline-block;
  margin-bottom: 8px;
  padding: 2px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #1e7e34;
  background: #eaf7ec;
  border-radius: 999px;
  line-height: 1.5;
}

.resource-title {
  margin: 0 0 10px;
  font-size: 0.975rem;
  font-weight: 700;
  color: #222;
  line-height: 1.55;
}

.resource-desc-panel {
  margin: 0;
}

.resource-desc-wrap {
  position: relative;
}

.resource-desc {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.65;
  color: #555;
}

.resource-desc-wrap.is-collapsed .resource-desc {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.resource-desc-wrap.is-collapsed::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1.6em;
  background: linear-gradient(transparent, #fff);
  pointer-events: none;
}

.resource-desc-wrap.is-expanded .resource-desc {
  display: block;
}

.resource-desc-toggle {
  display: inline-block;
  margin-top: 8px;
  padding: 0;
  border: none;
  background: none;
  color: #28a745;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}

.resource-desc-toggle:hover,
.resource-desc-toggle:focus {
  color: #1e7e34;
  text-decoration: underline;
  outline: none;
}

.resource-desc-toggle::after {
  content: " \f078";
  font-family: FontAwesome;
  font-size: 0.7rem;
}

.resource-desc-wrap.is-expanded + .resource-desc-toggle::after {
  content: " \f077";
}

.resource-link-box {
  margin-top: 14px;
}

.resource-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid #28a745;
  border-radius: 6px;
  background: #fff;
  color: #28a745;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.resource-link:hover {
  background: #28a745;
  color: #fff;
  text-decoration: none;
}

.resource-empty {
  padding: 40px 20px;
  text-align: center;
  color: #999;
  background: #fafafa;
  border: 1px dashed #ddd;
  border-radius: 8px;
}

@media (max-width: 768px) {
  .resource-item {
    flex-direction: column;
  }

  .resource-logo {
    flex: none;
    border-right: none;
    border-bottom: 1px solid #eef1f3;
    padding: 14px 16px;
  }

  .resource-body {
    padding: 14px;
  }
}

@media (min-width: 992px) {
  .resource-logo {
    flex-basis: 220px;
  }
}
