/* SDS Student Portal — Stylesheet
   Brand: Chiba Tech School of Design & Science
   Identity by Pentagram Design */

/* ── Reset & Base ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Core palette */
  --black: #000000;
  --white: #FFFFFF;
  --blue: #2C40D3;

  /* Secondary palette */
  --light-blue: #BFE2FE;
  --dark-grey: #5A5A5A;
  --rose: #7E6D6D;
  --dark-ocean: #253E4D;
  --faded-ink: #262D3C;
  --midnight: #212337;
  --gold: #C08000;
  --dark-yellow: #876714;

  /* Typography scale (body 17px) */
  --body-size: 17px;
  --body-leading: 20px;      /* body + 3 */
  --h3-size: 34px;            /* body x 2 */
  --h2-size: 48px;            /* ~body x 2.8 */
  --h1-size: 68px;            /* body x 4 */
  --header-tracking: -0.05em; /* -5% */
  --header-leading: 0.9;

  /* Layout */
  --max-width: 960px;
  --gutter: 24px;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Finder', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  font-size: var(--body-size);
  line-height: var(--body-leading);
  color: var(--black);
  background: var(--white);
}

/* Japanese text uses Now Gothic */
:lang(ja) {
  font-family: 'Now Gothic GB', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', sans-serif;
}

/* ── Typography ── */

h1, h2, h3 {
  font-weight: 700;
  letter-spacing: var(--header-tracking);
}

h1 {
  font-size: var(--h1-size);
  line-height: calc(var(--h1-size) * var(--header-leading));
  margin-bottom: 24px;
}

h2 {
  font-size: var(--h2-size);
  line-height: calc(var(--h2-size) * var(--header-leading));
  margin-bottom: 20px;
}

h3 {
  font-size: var(--h3-size);
  line-height: calc(var(--h3-size) * var(--header-leading));
  margin-bottom: 16px;
}

p {
  margin-bottom: 1em;
}

a {
  color: var(--blue);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

strong, .subheader {
  font-weight: 700;
}

/* ── Layout ── */

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ── Header ── */

.site-header {
  background: var(--black);
  color: var(--white);
  padding: 20px 0;
  position: relative;
  z-index: 10;
  box-shadow: 0 1px 0 rgba(255,255,255,0.08);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-header .logo {
  height: 40px;
  width: auto;
}

.site-header nav {
  display: flex;
  gap: 24px;
  align-items: center;
}

.site-header nav a {
  color: var(--white);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.site-header nav a:hover {
  opacity: 0.7;
  text-decoration: none;
}

/* Language toggle */
.lang-toggle {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.3);
  color: var(--white);
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}
.lang-toggle:hover {
  border-color: var(--white);
}

/* ── Hero ── */

.hero {
  background: var(--black);
  color: var(--white);
  padding: 80px 0 60px;
}

.hero h1 {
  font-size: clamp(36px, 6vw, var(--h1-size));
  line-height: 1;
  margin-bottom: 16px;
}

.hero .subtitle {
  font-size: 20px;
  line-height: 28px;
  opacity: 0.8;
  max-width: 600px;
}

/* ── Section ── */

.section {
  padding: 48px 0;
}

.section + .section {
  border-top: 1px solid #E0E0E0;
}

.section-title {
  font-size: var(--h2-size);
  margin-bottom: 24px;
}

/* ── Cards ── */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.card {
  display: block;
  border: 1px solid #E0E0E0;
  padding: 24px;
  transition: border-color 0.15s;
}

.card:hover {
  border-color: var(--blue);
}

.card h3 {
  font-size: 20px;
  line-height: 1.2;
  margin-bottom: 8px;
  letter-spacing: normal;
}

.card p {
  font-size: 15px;
  color: var(--dark-grey);
  margin-bottom: 12px;
}

.card a {
  font-size: 14px;
  font-weight: 700;
}

/* ── Schedule table ── */

.schedule-table {
  width: 100%;
  border-collapse: collapse;
}

.schedule-table th,
.schedule-table td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid #E0E0E0;
  vertical-align: top;
}

.schedule-table th {
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--dark-grey);
  background: #F8F8F8;
}

.schedule-table .time {
  font-weight: 700;
  white-space: nowrap;
  width: 100px;
}

/* ── Info box ── */

.info-box {
  background: var(--light-blue);
  padding: 20px 24px;
  margin: 20px 0;
}

.info-box.warning {
  background: #FFF3E0;
}

.info-box strong {
  display: block;
  margin-bottom: 4px;
}

/* ── Auth ── */

.auth-bar {
  font-size: 14px;
}

.auth-bar .user-name {
  font-weight: 700;
}

.login-btn, .logout-btn {
  background: var(--blue);
  color: var(--white);
  border: none;
  padding: 6px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.login-btn:hover, .logout-btn:hover {
  opacity: 0.85;
}

.logout-btn {
  background: transparent;
  color: var(--white);
  border: 1px solid rgba(255,255,255,0.3);
}

/* ── Protected content ── */

.protected {
  display: none;
}

.protected.visible {
  display: block;
}

.login-prompt {
  background: #F8F8F8;
  padding: 32px;
  text-align: center;
  margin: 20px 0;
}

.login-prompt p {
  color: var(--dark-grey);
  margin-bottom: 16px;
}

/* ── Footer ── */

.site-footer {
  background: var(--black);
  color: var(--white);
  padding: 32px 0;
  font-size: 14px;
}

.site-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-footer a {
  color: var(--white);
  opacity: 0.6;
}
.site-footer a:hover {
  opacity: 1;
}

/* ── Bilingual ── */

.jp {
  display: none !important;
}

body.lang-ja .en {
  display: none !important;
}

body.lang-ja .jp {
  display: revert !important;
}

body.lang-ja span.jp {
  display: inline !important;
}

body.lang-ja table.jp {
  display: table !important;
}

body.lang-ja div.jp {
  display: block !important;
}

body.lang-ja p.jp {
  display: block !important;
}

/* Inline bilingual: show JP below EN by default */
.bilingual .jp {
  display: block;
  color: var(--dark-grey);
  font-size: 0.9em;
  margin-top: 4px;
}

body.lang-ja .bilingual .en {
  display: none;
}

body.lang-ja .bilingual .jp {
  color: inherit;
  font-size: inherit;
  margin-top: 0;
}

/* ── Faculty grid ── */

.faculty-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.faculty-card {
  text-align: center;
  padding: 24px 16px;
  border: 1px solid #E0E0E0;
  transition: border-color 0.15s;
}

.faculty-card:hover {
  border-color: var(--blue);
}

.faculty-card img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 20%;
  margin-bottom: 12px;
  background: #F0F0F0;
}

.faculty-card .name {
  font-weight: 700;
  font-size: 16px;
}

.faculty-card .role {
  font-size: 14px;
  color: var(--dark-grey);
  margin-bottom: 8px;
}

.faculty-card .bio {
  font-size: 14px;
  line-height: 1.5;
  color: var(--dark-grey);
  margin-top: 8px;
}

/* ── Responsive ── */

@media (max-width: 768px) {
  :root {
    --h1-size: 40px;
    --h2-size: 32px;
    --h3-size: 24px;
  }

  .hero {
    padding: 48px 0 36px;
  }

  .site-header .container {
    flex-wrap: wrap;
    gap: 12px;
  }

  .site-footer .container {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .schedule-table {
    font-size: 14px;
  }

  .schedule-table th,
  .schedule-table td {
    padding: 8px 10px;
  }
}
