/*
Theme Name: Novel Editor Theme
Theme URI: https://example.com/
Author: ??????
Author URI: https://example.com/
Description: ???????????
Version: 1.0
License: GPLv2 or later
*/

/* style.css
   レイアウト系（大きさ・余白・フォントサイズ・配置など）だけ */

/* --- 全体レイアウト --- */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  position: relative;
}

body * {
    box-sizing: border-box;
}

a {
  text-decoration: none
}

ul, li {
  list-style: none;
}

.container {
  max-width: 960px;
  margin: auto;
  padding: 2rem;
  border-radius: 16px;
}

/* コンテナの基本レイアウト */
.container {
  max-width: 960px;
  margin: auto;
  padding: 2rem;
  border-radius: 16px;
}

h3, h4 {
  font-weight: 600;
  padding-bottom: 0.3em;
  margin-bottom: 1em;
}

/* 見出しの基本レイアウト */
h3, h4 {
  font-weight: 600;
  padding-bottom: 0.3em;
  margin-bottom: 1em;
}


/* --- カルーセル設定 --- */
.custom-carousel-container {
    width: 100%;
    overflow: hidden;
    position: relative;
    padding: 1rem 0;
    border-radius: 15px;
}

.custom-carousel-track {
    display: flex;
    transition: transform 0.7s ease;
    will-change: transform;
}

.custom-slide {
    flex: 0 0 auto;
    width: 90%;
    max-width: 640px;
    margin: 0 8px;
}

.custom-slide img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    object-fit: cover;
}

.custom-slide .overlay {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 1rem;
    box-sizing: border-box;
}

.custom-slide .overlay h3 {
    font-size: 1rem;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* --- トップページ --- */
.novel-section {
  margin: 2rem auto;
  padding: 1rem;
  max-width: 800px;
  width: 100%;
  border-radius: 15px;
}

.section-title {
  position: relative;
  font-size: 1.4rem;
  margin-bottom: 1rem;
  padding-left: 1rem;
  font-weight: bold;
}

.howto-title {
	position: relative;
}

.howto-title::after {
	content: "";
	position: absolute;
	right: 0;
	bottom: -12px;
	left: 0;
	width: 170px;
	height: 7px;
	margin: 0 auto;
	border-radius: 25px;
}

.howto-section {
  padding: 3rem 1rem;
  text-align: center;
  border-radius: 15px;
  margin: 2rem auto;
  max-width: 1200px;
  width: 100%;
}

.howto-title {
  font-size: 1.8rem;
  font-weight: bold;
  margin-bottom: 2.5rem;
}

.howto-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.howto-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 140px;
}

.howto-number {
  margin: 0;
  margin-right: auto;
  margin-left: 15px;
  font-size: 2.25rem;
  font-weight: bold;
}

.howto-step img {
  width: 100%;
  height: auto;
}

.howto-step p {
  margin: 0;
  margin-top: -10px;
  margin-bottom: 15px;
  font-size: 0.95rem;
  line-height: 1.4;
  white-space: pre-line;
}

.howto-arrow {
  font-size: 1.8rem;
  font-weight: bold;
}

@media (max-width: 768px) {
  .howto-steps {
    flex-wrap: wrap;
  }

  .howto-step {
    width: 45%;
  }

  .howto-arrow {
    display: none;
  }
}

@media (max-width: 480px) {
  .howto-step {
    width: 100%;
  }
	.howto-step img {
  	width: 70%;
	}
}

.section-title-test {
	text-align: center;
	padding-left: 0;
	border-left: none;
}

.section-title-text {
    position: relative;
}

.section-title-text::before,
.section-title-text::after {
    content: "";
    position: absolute;
    top: 13px;
    width: 30px;
    height: 5px;
}

.section-title-text::before {
    left: -40px;
}

.section-title-text::after {
    right: -40px;
}

.form-row {
	max-width: 800px;
	margin: auto;
}

.ai-short-generator {
    max-width: 1200ox;
    width: 100%;
    margin: 0 auto;
}

.ai-short-generator .btn-submit {
	display: grid;
	max-width: 800px;
	margin: 15px auto;
}

.news-section {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  margin-top: 50px;
  padding: 15px;
}

.news-section .section-title {
  font-size: 1.6rem;
  margin-bottom: 1rem;
}

.novel-list-icon {
  width: 24px;
  height: 24px;
  background-size: contain;
  flex-shrink: 0;
}

input[type="text"],
textarea {
  width: 100%;
  padding: 0.6em;
  border-radius: 6px;
  margin-top: 0.5em;
}

input[type="text"]:focus,
textarea:focus {
  outline: none;
}

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-thumb {
  border-radius: 4px;
}

.toggle-status-btn {
  padding: 0.4em 1em;
  border-radius: 6px;
  font-size: 0.9rem;
}

.site-header {
  padding: 1rem 0;
  position: relative;
  z-index: 1000; /* ヘッダーのz-indexを設定 */
}

.header-container {
  max-width: 960px;
  margin: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-title {
  margin-left: 15px;
  font-weight: bold;
  font-size: 1.2rem;
}

.site-nav-container {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
}

.hd-btn {
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: bold;
  cursor: pointer;
  letter-spacing: 1px;
  transition: all 0.3s ease;
}

.hd-btn a {
  text-decoration: none;
  color: inherit;
}

.site-footer {
  text-align: center;
  padding: 1.5rem 0;
  margin-top: 4rem;
}

.novel-container {
  max-width: 820px;
  margin: 0 auto;
  padding: 2rem;
  border-radius: 1rem;
  font-family: "Helvetica Neue", sans-serif;
}

.novel-container h1 {
  text-align: center;
  font-size: 1.8rem;
  margin-bottom: 2rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: bold;
}

select {
  width: 100%;
  padding: 0.75rem;
  margin-bottom: 1.5rem;
  border-radius: 0.5rem;
  font-size: 1rem;
}

select:focus {
  outline: none;
}

button {
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-primary {
  margin-left: 0.5rem;
}

.btn-submit {
  width: 100%;
  font-size: 1.1rem;
  margin-top: 2rem;
}

#revise-body {
  min-width: 100px;
}

/* TOP page carousel */
.novel-swiper {
  width: 100%;
  padding: 1rem 0;
}

.novel-swiper .swiper-slide {
  width: auto;
  max-width: 640px;
  flex-shrink: 0;
}

.novel-swiper .novel-card {
  position: relative;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  flex-shrink: 0;
  border-radius: 10px;
  overflow: hidden;
}

.novel-swiper .novel-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.novel-swiper .novel-card .overlay {
  position: absolute;
  bottom: 0;
  padding: 1rem;
  width: 100%;
  box-sizing: border-box;
}

.login-container,
.register-container,
.mypage-container,
.novel-post-container,
.novel-single-container {
  max-width: 600px;
  margin: 2rem auto;
  padding: 2rem;
  border-radius: 8px;
  font-size: 1rem;
}

.login-container h2,
.register-container h2,
.mypage-container h2,
.mypage-container h3,
.novel-post-container h2,
.novel-single-container h1 {
  text-align: center;
  margin-bottom: 1rem;
}

.login-container form p,
.register-container form p,
.novel-post-container form p {
  margin-bottom: 1rem;
}

.login-container input[type="text"],
.login-container input[type="password"],
.register-container input[type="text"],
.register-container input[type="email"],
.register-container input[type="password"] {
  width: 100%;
  padding: 0.5rem;
  font-size: 1rem;
}

.login-container button,
.register-container button {
  width: 100%;
  padding: 0.5rem;
  font-size: 1rem;
  border-radius: 4px;
  cursor: pointer;
}

.login-container p a,
.register-container p a {
  display: block;
  text-align: center;
  margin-top: 0.5rem;
}

.logout-button {
  display: block;
  width: 100%;
  padding: 0.5rem;
  font-size: 1rem;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 1rem;
}

.novel-meta {
  text-align: left;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.novel-content,
.novel-share {
  margin-top: 1rem;
}

.novel-share {
  text-align: center;
}

.novel-share a {
  text-decoration: none;
}


/* Episode create page */
.pisode-create-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 15px;
}

.pisode-create-container textarea {
    resize: vertical;
}

.episode-container {
    position: relative;
    margin-top: 10px;
}

.episode-ai-button {
    position: absolute;
    top: 0;
    right: 0;
    padding: 0.4em 1em;
    cursor: pointer;
}

.generate-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.4s ease;
    opacity: 0;
}

.generate-container.open {
    max-height: 300px; /* 必要に応じて高さを調整 */
    padding: 15px 0;
    opacity: 1;
}

.generate-container textarea,
.generate-container button {
    width: 100%;
    margin: 0;
}

.generate-container.open textarea {
    padding: 0.65em;
    margin-bottom: 0; /* 下のボタンと隙間なくする */
    border-radius: 6px 6px 0 0;
}

.generate-container button {
    border-radius: 0 0 6px 6px;
}

.char-counter {
  text-align: right;
  font-size: 0.85em;
  margin-bottom: 0.5em;
}

.episode-create-btnContainer {
    display: flex;
    justify-content: center;
    max-width: 800px;
    margin: 0 auto;
}
.episode-create-btnContainer button {
    max-width: 250px;
    width: 100%;
    font-size: 1rem;
}

/* 小説一覧リンク用スタイル */
.novels-link-section {
  margin: 2rem 0;
  padding: 2rem;
  background: rgba(0, 0, 0, 0.8);
  border-radius: 15px;
  border: 1px solid rgba(0, 255, 255, 0.3);
}

.novels-link-container {
  text-align: center;
  margin-top: 1rem;
}

.novels-link-btn {
  display: inline-block;
  padding: 1.5rem 2rem;
  background: linear-gradient(135deg, rgba(0, 255, 255, 0.8) 0%, rgba(0, 150, 255, 0.8) 100%);
  border: 1px solid rgba(0, 255, 255, 0.5);
  border-radius: 0.5rem;
  color: #000;
  text-decoration: none;
  font-weight: bold;
  text-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  min-width: 300px;
}

.novels-link-btn:hover {
  background: linear-gradient(135deg, rgba(255, 0, 255, 0.8) 0%, rgba(0, 150, 255, 0.8) 100%);
  box-shadow: 0 0 20px rgba(255, 0, 255, 0.5);
  transform: translateY(-2px);
  text-decoration: none;
  color: #000;
}

.link-icon {
  display: block;
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.link-text {
  display: block;
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.link-desc {
  display: block;
  font-size: 0.9rem;
  opacity: 0.8;
}

/* ===== ヘッダーのレスポンシブ対応 ===== */
@media (max-width: 768px) {
  .site-header {
    padding: 0.5rem 0;
  }

  .header-container {
    padding: 0 10px;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
  }

  .site-title {
    margin-left: 0;
    flex-shrink: 0;
  }

  /* 中画面でのロゴサイズ調整 */
  .header-logo img {
    width: 50px !important;
    height: auto;
  }

  .site-nav {
    flex-shrink: 0;
  }

  .site-nav-container {
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
    margin-left: auto;
    flex-wrap: nowrap;
  }

  .hd-btn {
    font-size: 0.8rem;
    flex-shrink: 0;
  }

  .hd-btn a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    min-width: 40px;
  }

  /* SP表示時はアイコンのみ表示 */
  .hd-btn a .btn-text {
    display: none;
  }

  .hd-btn a i {
    font-size: 16px;
    margin: 0;
    display: block;
  }

  /* 認証ページ用のレスポンシブ対応 */
  .header-container[style*="justify-content: center"] {
    justify-content: center !important;
  }

  .header-container[style*="justify-content: center"] .site-title {
    margin: 0;
  }
}

@media (max-width: 480px) {
  .site-header {
    padding: 0.3rem 0;
  }

  .header-container {
    padding: 0 8px;
    gap: 6px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
  }

  /* 小画面でのロゴサイズ調整 */
  .header-logo img {
    width: 45px !important;
    height: auto;
  }

  .site-nav {
    flex-shrink: 0;
  }

  .site-nav-container {
    gap: 6px;
    align-items: center;
    justify-content: flex-end;
    margin-left: auto;
    flex-wrap: nowrap;
  }

  .hd-btn a {
    width: 36px;
    height: 36px;
    min-width: 36px;
  }

  .hd-btn a i {
    font-size: 14px;
  }

  /* 認証ページ用のレスポンシブ対応（小画面） */
  .header-container[style*="justify-content: center"] {
    justify-content: center !important;
  }

  .header-container[style*="justify-content: center"] .site-title {
    margin: 0;
  }
}

