/* 要素の整列を妨げている余白を削除する。 */
.plugin-em-featured-topics > .panel-body {
  padding: 0 !important;
}

/* 見出し */
.plugin-em-featured-topics__heading {
  /* 他のプラグインの見出しのスタイルに倣う。 */
  align-items: center;
  background-color: #64b69a;
  border-bottom: 1px solid #ddd;
  border-radius: 4px;
  color: #fff;
  display: flex;
  justify-content: space-between;
  margin: 40px 0 10px;
  padding: 10px;
}

.plugin-em-featured-topics__heading:first-child,
script + .plugin-em-featured-topics__heading {
  margin-top: 0;
}

.plugin-em-featured-topics__heading h2 {
  color: inherit;
  flex-grow: 1;
  font-size: 21px;
  line-height: 1.3;
  margin: 0;
  width: 100%;
}

.plugin-em-featured-topics__heading div {
  flex-shrink: 0;
}

@media (max-width: 767px) {
  .plugin-em-featured-topics__heading {
    align-items: flex-end;
    flex-direction: column;
  }

  .plugin-em-featured-topics__heading > *:not(:last-child) {
    margin-bottom: 10px;
  }
}

.plugin-em-featured-topics__licenses {
  margin: -10px 0 0;
  text-align: right;
}

/* 記事一覧 */
.plugin-em-featured-topics__topics {
  column-gap: 15px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 30px;
  row-gap: 30px;
}

.plugin-em-featured-topics__topic,
.plugin-em-featured-topics__topic-repeat {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  overflow: hidden;
}

.plugin-em-featured-topics__topic--inactive {
  opacity: 0.4;
}

.plugin-em-featured-topics__more {
  grid-column-end: -1;
  grid-column-start: 1;
}

@media (max-width: 767px) {
  .plugin-em-featured-topics__topics {
    grid-template-columns: repeat(2, 1fr);
  }
}

.plugin-em-featured-topics__topic-title {
  flex: 0 0 auto;
  font-weight: bold;
  line-height: 1.5em;
  margin: 0.75em 0;
  max-height: calc(3 * 1.5em);
  overflow: hidden;
}

.plugin-em-featured-topics__topic-title a {
  color: inherit;
}

.plugin-em-featured-topics__topic-space {
  flex: 1 1 0;
}

.plugin-em-featured-topics__topic-thumbnail-container {
  position: relative;
  width: 100%;
}

.plugin-em-featured-topics__topic-thumbnail-container:before {
  content: '';
  display: block;
  padding-top: 56.25%;
}

.plugin-em-featured-topics__topic-thumbnail-inner {
  background-color: #e9ecef;
  border-radius: 4px;
  bottom: 0;
  left: 0;
  overflow: hidden;
  position: absolute;
  right: 0;
  top: 0;
}

.plugin-em-featured-topics__topic-thumbnail-inner a {
  align-items: center;
  display: flex;
  height: 100%;
  justify-content: center;
  width: 100%;
}

.plugin-em-featured-topics__topic-thumbnail {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.plugin-em-featured-topics__topic-thumbnail-badge {
  border-radius: 4px;
  max-height: 48px;
  max-width: 48px;
}

topic-thumbnail-map {
  border-radius: 4px;
  border: 1px solid #dee2e6;
  box-sizing: border-box;
  height: 100%;
  width: 100%;
}

.plugin-em-featured-topics__topic-footer {
  column-gap: 5px;
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: min-content 1fr;
}

.plugin-em-featured-topics__topic-footer:not(:last-child) {
  margin-bottom: 10px;
}

.plugin-em-featured-topics__topic-badge {
  align-self: center;
  display: inline-block;
  grid-column: 1;
  grid-row: 1 / 3;
  user-select: none;
}

.plugin-em-featured-topics__topic-badge img {
  background-color: #ffffff;
  border-radius: 0.25em;
  border: 1px solid #dee2e6;
  height: 32px;
  object-fit: contain;
  width: 32px;
}

.plugin-em-featured-topics__topic-school-name {
  font-size: 0.85em;
  grid-column: 2;
  grid-row: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plugin-em-featured-topics__topic-school-name a {
  color: inherit;
}

.plugin-em-featured-topics__topic-date {
  color: #6c757d;
  font-size: 0.85em;
  grid-column: 2;
  grid-row: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* もっと見る */
.plugin-em-featured-topics__emergency-map-container {
  height: 400px;
  margin-bottom: 30px;
  position: relative;
}

#plugin-em-featured-topics__emergency-map {
  border-radius: 4px;
  border: 1px solid #dee2e6;
  box-sizing: border-box;
  height: 400px;
  z-index: 0;
}

.plugin-em-featured-topics__emergency-map-button {
  left: 50%;
  position: absolute;
  top: 10px;
  transform: translate(-50%, 0);
}

/* お気に入り学校 ヘッダ */
.plugin-em-featured-topics__favorite-schools {
  margin-bottom: 40px;
}

.plugin-em-featured-topics__favorite-schools-body {
  align-items: center;
  display: flex;
  margin: 10px 0;
}

.plugin-em-featured-topics__favorite-schools-body-ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plugin-em-featured-topics__favorite-schools-body-ellipsis > span {
  margin-right: 0.25em;
}

.plugin-em-featured-topics__favorite-schools-body-ellipsis a {
  color: inherit;
}

.plugin-em-featured-topics__favorite-schools-body-ellipsis img {
  background-color: #ffffff;
  border-radius: 0.25em;
  border: 1px solid #dee2e6;
  height: 24px;
  object-fit: contain;
  width: 24px;
}

/* お気に入り学校・学校検索 学校一覧 */
.plugin-em-featured-topics__school-list-item {
  align-items: center;
  display: flex;
}

.plugin-em-featured-topics__school-list-item > *:not(:last-child) {
  margin-right: 10px;
}

.plugin-em-featured-topics__school-list-badge {
  flex: 0 0;
  user-select: none;
}

.plugin-em-featured-topics__school-list-badge img {
  background-color: #ffffff;
  border-radius: 0.25em;
  border: 1px solid #dee2e6;
  height: 32px;
  object-fit: contain;
  width: 32px;
}

.plugin-em-featured-topics__school-list-name {
  flex: 1 1 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plugin-em-featured-topics__school-list-button {
  flex: 0 0;
}

/* 学校検索 */
.plugin-em-featured-topics__school-search-map {
  border-radius: 4px;
  border: 1px solid #dee2e6;
  box-sizing: border-box;
  height: 325px;
  margin-bottom: 10px;
  width: 100%;
}

/* 広告 */
.plugin-em-featured-topics__ad,
.plugin-em-featured-topics__ad-repeat {
	display: flex;
	flex-direction: column;
	flex-grow: 1;
	overflow: hidden;
}

.plugin-em-featured-topics__ad {
	border-radius: 4px;
	border: 1px solid #ddd;
	box-sizing: border-box;
	position: relative;
	user-select: none;
}

.plugin-em-featured-topics__ad-label {
	background-color: #fff;
	border-bottom-left-radius: 2px;
	font-size: 78%;
	padding: 0 2px;
	pointer-events: none;
	position: absolute;
	right: 0;
	top: 0;
	user-select: none;
	z-index: 1;
}

.plugin-em-featured-topics__ad-url {
	box-sizing: border-box;
	display: block;
	height: 100%;
	left: 0;
	padding: 5px;
	position: absolute;
	top: 0;
	width: 100%;
}

.plugin-em-featured-topics__ad-url img {
	display: block;
	height: 96%;
	object-fit: contain;
	width: 96%;
}

/* 広告設定一覧のサムネイル */
.featured-topics-ads-list-thumbnail {
  max-height: 60px;
  max-width: 60px;
}
/* 広告設定一覧の名称 */
.featured-topics-ads-list-name {
  max-height: 60px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  text-overflow: ellipsis;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
}
