/* Moodle システム側のスタイル上書き */
.course-section .section-item {
  padding: 0 !important;
  border: none !important;
}

[data-for="sectioninfo"] {
  margin-top: 0 !important;
}

:root {
  /* blue (お知らせ / メンテナンス) */
  --portal-blue: #1a6cb3;
  --portal-blue-deep: #15568f;
  --portal-blue-soft: #cfe3f4;
  --portal-blue-bg: #eaf3fb;
  /* teal (学生向け) */
  --portal-teal: #16998c;
  --portal-teal-deep: #0f7d72;
  --portal-teal-soft: #cbeae5;
  --portal-teal-bg: #eef8f6;
  /* purple (教職員向け) */
  --portal-purple: #7d6bb3;
  --portal-purple-deep: #67569c;
  --portal-purple-soft: #ddd6ee;
  --portal-purple-bg: #f2effa;

  --portal-ink: #1f2733;
  --portal-ink-soft: #5b6573;
  --portal-line: #e6e9ee;
  --portal-radius: 18px;
}

.portal-wrap * {
  box-sizing: border-box;
}

.portal-wrap img {
  display: block;
  max-width: 100%;
}

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

/* ============ LAYOUT ============ */
.portal-wrap {
  max-width: 1024px;
  margin: 0 !important;
  padding: 0 !important;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  color: var(--portal-ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ============ HERO ============ */
.portal-hero {
  position: relative;
  border-radius: var(--portal-radius);
  overflow: hidden;
  background: #cfe6fa;
  padding: 30px 26px;
  margin: 0;
  width: 100%;
  box-sizing: border-box;
}

.portal-hero__inner {
  position: relative;
  z-index: 2;
}

.portal-hero h1 {
  margin: 0 0 16px;
  font-weight: 900;
  font-size: clamp(16px, 2.5vw, 23px);
  letter-spacing: 0.01em;
  color: #1c2b3a;
}

/* ============ NOTICE BOX ============ */
.portal-notice {
  background: #ffffff;
  border-radius: 14px;
  padding: 18px 22px;
  display: flex;
  gap: 18px;
  align-items: center;
  box-shadow: 0 8px 24px rgba(30, 80, 140, 0.10);
}

.portal-notice__head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  width: auto;
}

.portal-notice__head img {
  width: 46px;
  height: 46px;
}

.portal-notice__head b {
  color: var(--portal-blue-deep);
  font-weight: 700;
  font-size: 14px;
  line-height: 1.45;
  white-space: nowrap;
  display: block;
}

.portal-notice__body {
  border-left: 1px solid #d8e4ef;
  padding-left: 18px;
  font-size: 13.5px;
  color: #3f4a57;
}

.portal-notice__body p {
  margin: 0 0 6px;
}

.portal-notice__body p:last-child {
  margin: 0;
}

.portal-notice__body a {
  color: var(--portal-blue);
  font-weight: 700;
}

/* ============ SECTION SHELL ============ */
.portal-section {
  margin-top: 16px;
}

.portal-section--plain {
  background: #fff;
  border: 1px solid var(--portal-line);
  border-radius: var(--portal-radius);
  padding: 24px 26px;
}

.portal-section--teal {
  background: linear-gradient(180deg, var(--portal-teal-bg), #f6fcfb);
  border: 1px solid #dcefeb;
  border-radius: var(--portal-radius);
  padding: 24px 26px 28px;
}

.portal-section--purple {
  background: linear-gradient(180deg, var(--portal-purple-bg), #f8f6fd);
  border: 1px solid #e6e0f3;
  border-radius: var(--portal-radius);
  padding: 24px 26px 28px;
}

/* ============ SECTION HEADER ============ */
.portal-sec-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 8px;
  margin-bottom: 0;
}

.portal-sec-head img {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  mix-blend-mode: multiply;
}

.portal-sec-head h2 {
  margin: 0;
  font-size: clamp(19px, 2.6vw, 23px);
  font-weight: 700;
}

.portal-sec-title {
  display: flex;
  align-items: center;
  gap: 14px;
}

.portal-section--plain .portal-sec-head h2 { color: var(--portal-blue-deep); }
.portal-section--teal .portal-sec-head h2  { color: var(--portal-teal-deep); }
.portal-section--purple .portal-sec-head h2 { color: var(--portal-purple-deep); }

/* ============ LINK CARD GRID ============ */
.portal-linkgrid {
  display: grid;
  gap: 14px;
  margin-bottom: 8px;
  width: 100%;
  min-width: 0;
}

.portal-linkgrid--4 { grid-template-columns: repeat(4, 1fr); }
.portal-linkgrid--3 { grid-template-columns: repeat(3, 1fr); }

.portal-linkcard {
  background: #fff;
  border: 1px solid var(--portal-line);
  border-radius: 14px;
  padding: 22px 16px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(20, 40, 70, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  min-width: 0;
  overflow: hidden;
}

.portal-linkcard:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 22px rgba(20, 40, 70, 0.10);
}

.portal-section--teal .portal-linkcard:hover   { border-color: var(--portal-teal-soft); }
.portal-section--purple .portal-linkcard:hover { border-color: var(--portal-purple-soft); }

.portal-linkcard__icon {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.portal-linkcard__icon img {
  width: 48px;
  height: 48px;
}

.portal-linkcard__icon svg {
  width: 48px;
  height: 48px;
  fill: none !important;
  stroke: #7d6bb3 !important;
  overflow: visible;
}

.portal-linkcard__label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.4;
}

.portal-chev {
  font-size: 15px;
  color: #9aa4b1;
  flex: 0 0 auto;
}

.portal-section--teal .portal-chev   { color: var(--portal-teal); }
.portal-section--purple .portal-chev { color: var(--portal-purple); }

/* ============ NEWS LIST ============ */
.portal-newslist {
  list-style: none;
  margin: 0;
  padding: 0;
}

.portal-section--teal .portal-newslist,
.portal-section--purple .portal-newslist {
  background: #fff;
  border-radius: 14px;
  padding: 4px 18px;
  box-shadow: 0 2px 8px rgba(20, 40, 70, 0.04);
}

.portal-newsitem {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 4px;
  border-bottom: 1px solid var(--portal-line);
}

.portal-newsitem:last-child {
  border-bottom: none;
}

.portal-badge {
  flex: 0 0 auto;
  width: 60px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 0;
  border-radius: 5px;
}

.portal-badge--important { color: #fff; }
.portal-badge--error { background: #f5c6c2; color: #c0392b; }
.portal-section--plain .portal-badge--important   { background: var(--portal-blue); }
.portal-section--teal .portal-badge--important    { background: var(--portal-teal); }
.portal-section--purple .portal-badge--important  { background: var(--portal-purple); }

.portal-section--plain .portal-badge--info   { background: var(--portal-blue-soft);   color: var(--portal-blue-deep); }
.portal-section--teal .portal-badge--info    { background: var(--portal-teal-soft);   color: var(--portal-teal-deep); }
.portal-section--purple .portal-badge--info  { background: var(--portal-purple-soft); color: var(--portal-purple-deep); }

.portal-newsitem__body {
  flex: 1 1 auto;
  min-width: 0;
}

.portal-newsitem__link {
  display: block;
}

.portal-newsitem__link:hover .portal-newsitem__title {
  text-decoration: underline;
}

.portal-newsitem__title {
  font-weight: 700;
  font-size: 15px;
  margin: 0 0 2px;
}

.portal-newsitem__title::before {
  content: "▶ ";
  font-size: 11px;
  color: #3a4654;
}

.portal-newsitem__excerpt {
  margin: 0;
  font-size: 13px;
  color: var(--portal-ink-soft);
}

.portal-newsitem__chev {
  flex: 0 0 auto;
  color: #b6bec9;
  font-size: 22px;
  line-height: 1;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 880px) {
  .portal-hero {
    padding: 24px 20px;
  }

  .portal-linkgrid--4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .portal-wrap {
    padding: 16px 12px 48px;
  }

  .portal-hero {
    padding: 20px 16px;
  }

  .portal-notice {
    flex-direction: column;
    gap: 12px;
    padding: 16px;
  }

  .portal-notice__head {
    width: auto;
  }

  .portal-notice__body {
    border-left: none;
    border-top: 1px solid #d8e4ef;
    padding-left: 0;
    padding-top: 12px;
  }

  .portal-section--plain,
  .portal-section--teal,
  .portal-section--purple {
    padding: 20px 16px;
  }

  .portal-sec-head {
    flex-wrap: wrap;
    gap: 10px;
  }

  .portal-linkgrid--3,
  .portal-linkgrid--4 {
    grid-template-columns: 1fr;
  }

  .portal-newsitem {
    flex-wrap: wrap;
    gap: 6px 12px;
    padding: 14px 2px;
    position: relative;
    padding-right: 20px;
  }

  .portal-newsitem__body {
    flex-basis: 100%;
    order: 3;
  }

  .portal-newsitem__chev {
    position: absolute;
    right: 0;
  }
}

