/******************************************************************
  Base
******************************************************************/
:root {
  --portal-header-h: 77px;
  --portal-sidebar-w: 300px;
  --portal-bg: #f9f9f9;
  --portal-border: #e4e4e4;
  --portal-text: #333;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  color: #333;
}

a {
  text-decoration: none;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

li {
  list-style: none;
}

body.portal {
  color: var(--portal-text);
}

/******************************************************************
  Header
******************************************************************/
.portal-header {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 999;
  width: 100%;
  height: var(--portal-header-h);
  padding: 15px 1%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  box-shadow: 0 0 2px #838383;
  font-size: 12px;
}

.portal-header__nav {
  width: 150px;
}

.portal-header__sidebar-toggle {
  margin-left: 10px;
  background: none;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

.portal-header__sidebar-toggle i {
  font-size: 16px;
  line-height: 1;
  margin-right: 5px;
}

.portal-header__logo {
  width: 100%;
  max-width: 225px;
}

.portal-header__logo img {
  width: 100%;
  display: block;
  filter: brightness(0);
}

.portal-header__user {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100px;
}

.portal-header__lang-toggle,
.portal-header__logout {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  width: 100px;
}

.portal-header__lang-switch {
  font-size: 14px;
  display: flex;
  gap: 15px;
}

.portal-header__lang {
  text-decoration: none;
  color: #555;
  cursor: pointer;
}

.portal-header__lang.is-active {
  font-weight: bold;
  color: #000;
  pointer-events: none;
}

.portal-header__logout i {
  font-size: 16px;
}

/* Header: small */
@media screen and (max-width: 498px) {
  .portal-header {
    padding: 15px 10px;
  }

  .portal-header__nav {
    width: 35px;
  }

  .portal-header__logo {
    max-width: 175px;
  }

  .portal-header__user {
    width: auto;
  }
}

/******************************************************************
  Layout (PC: grid, fixed header 고려)
******************************************************************/
.portal-layout {
  display: grid;
  grid-template-columns: max-content 1fr;
  background-color: var(--portal-bg);
  /* min-height: calc(100vh - var(--portal-header-h)); */
  height: 100vh;
  padding: 0 0 25px;
}

.portal-layout.single {
  background-color: #fff;
}

.portal-main {
  margin-top: 77px;
}

/* sidebar collapsed (PC/共通) */
.portal-layout.is-sidebar-closed {
  grid-template-columns: 0px 1fr;
}

.portal-sidebar {
  background-color: #fff;
  border-right: 1px solid var(--portal-border);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

@media screen and (max-width: 1023px) {
  .portal-layout.is-sidebar-closed {
    grid-template-columns: 1fr;
  }

  .portal-card-list {
    grid-template-columns: repeat(auto-fill, 1fr);
  }
}

/******************************************************************
  Main
******************************************************************/
.portal-main {
  padding: 2rem 3rem;
}

/* Cards */
.portal-card-list {
  margin: 15px 0 50px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
  gap: 16px;
}

.portal-card {
  display: block;
  background-color: #fff;
  border: 2px solid #c2c2c2;
  padding: 27px 25px;
  border-radius: 15px;
  transition: 0.4s;
  letter-spacing: 0.05rem;
}

.portal-card__title {
  font-size: 21px;
}

.portal-card__subtitle {
  letter-spacing: 0;
}

.portal-card:hover {
  background-color: rgb(0, 0, 141);
  text-decoration: none;
  border-color: rgb(0, 0, 141);
  box-shadow: 0 0 3px #000;
}

.portal-card:hover p {
  color: #fff;
}

/* Main: small */
@media screen and (max-width: 498px) {
  .portal-layout {
    display: block;
    /* スマホは押し出し型にするため grid を解除 */
    min-height: auto;
  }

  .portal-main {
    padding: 15px;
  }

  .portal-card-list {
    display: block;
    margin: 15px 0 35px;
  }

  .portal-card {
    padding: 10px 15px;
    margin-bottom: 15px;
  }
}

/******************************************************************
  Sidebar menu
******************************************************************/
.portal-sidebar__menu {
    padding: 15px 25px 15px 15px;
    margin-top: 77px;
}

.portal-sidebar__group {
  margin-bottom: 25px;
}

.portal-sidebar__item {
  margin-bottom: 10px;
}

.portal-sidebar__item p {
  font-weight: bold;
  margin-bottom: 15px;
}

.portal-sidebar__heading {
  margin-bottom: 10px;
}

.portal-sidebar__item li {
  font-size: 14px;
  font-weight: initial;
  padding-left: 10px;
  margin-bottom: 10px;
  cursor: pointer;
}

.portal-sidebar__link {
  font-size: 14px;
}

.portal-sidebar__item li:last-child {
  margin-bottom: 0;
}

.portal-sidebar__en {
  display: block;
  font-size: 12px;
}

/* Backdrop */
.portal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .35);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}

/* スクロールロック */
body.portal.is-scroll-locked {
  overflow: hidden;
}

/* タブレット以下のみ有効 */
@media screen and (max-width: 1023px) {

  /* sidebar を画面内に固定表示（既存実装がある場合は統一してください） */
  .portal-sidebar {
    position: fixed;
    top: var(--portal-header-h, 77px);
    left: 0;
    height: calc(100dvh - var(--portal-header-h, 77px));
    width: var(--portal-sidebar-w, 300px);
    z-index: 9999;
    background: #fff;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateX(0);
    transition: transform .25s ease;
  }

  /* 閉じたら左へ退避 */
  .portal-layout.is-sidebar-closed .portal-sidebar {
    transform: translateX(-100%);
  }

  /* 開いている時だけ backdrop を有効化 */
  .portal-layout:not(.is-sidebar-closed)~.portal-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
}



/* Sidebar: small (fixed drawer like) */
@media screen and (max-width: 498px) {
  .portal-sidebar {
    position: fixed;
    top: var(--portal-header-h);
    left: 0;
    height: calc(100vh - var(--portal-header-h));
    width: var(--portal-sidebar-w);
    z-index: 9999;
    padding: 10px 10px 0 10px;
    transition: transform 0.4s;
    transform: translateX(0);
  }

  .portal-layout.is-sidebar-closed .portal-sidebar {
    transform: translateX(-100%);
  }

  .portal-sidebar__menu {
    margin-top: 0;
    padding: 0;
  }

  .portal-sidebar__heading {
    font-size: 16px;
    font-weight: 700;
    margin: 24px 0 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e0e0e0;
  }

  .portal-sidebar__link {
    display: block;
    padding: 5px 0px;

  }

}

/******************************************************************
  News
******************************************************************/
.portal-news-list-wrap {
  padding: 1% 15px 0 0;
}

.portal-news-item {
  position: relative;
  border-bottom: 1px solid #c0c0c0;
  margin-bottom: 15px;
  padding: 0 15px 7px 5px;
  font-size: 14px;
}

.portal-news-item::after {
  position: absolute;
  content: ">";
  right: 15px;
  top: 0;
}

.portal-news-item__date {
  color: #0545a5;
  margin-right: 15px;
}

.post-label--important {
  background-color: #a80000;
  color: #fff;
  padding: 2px 5px;
  /*   border-radius: 7px; */
  margin-right: 5px;
}

.portal-news-item__author {
  margin-right: 10px;
}

.portal-news-item__viewmore {
  display: block;
  margin: 25px auto 0;
  width: max-content;
}

.portal-news-item__viewmore a {
  display: block;
  text-align: center;
  padding: 7px 25px;
  border: #0545a5 solid 1px;
  border-radius: 15px;
  color: #0545a5;
  font-size: 14px;
}

.portal-news-item__viewmore a span {
  margin-right: 5px;
}

@media screen and (max-width: 498px) {
  .portal-news-item {
    display: flex;
    flex-direction: column;
  }

  .portal-news-item__text {
    padding-right: 0;
    display: block;
  }

  .portal-news-item::after {
    display: none;
  }
}



@media (max-width: 1023px) {
  .portal-sidebar__en {
    display: none;
  }
}



/******************************************************************
 投稿
******************************************************************/
.portal-post p {
    margin: 1rem 0;
}