/* ============================================
   タレント年鑑 Web - CSS (Mobile-First)
   ============================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@300;400;500;700&display=swap');

/* --- Design Tokens --- */
:root {
  --color-primary: #D4588A;
  --color-primary-light: #DE7FA3;
  --color-primary-dark: #B14470;
  --color-primary-bg: #FFCCE6;
  --color-search-btn: #4FC3F7;
  --color-search-btn-hover: #29B6F6;
  --color-body-bg: #FBDCE9;
  --color-border: #D4588A;
  --color-border-light: #F8BBD0;
  --color-card-bg: #FFFFFF;
  --color-photo-placeholder: #BDBDBD;
  --color-text: #333333;
  --color-text-light: #666666;
  --color-text-muted: #999999;
  --color-white: #FFFFFF;
  --color-reset-btn: #9E9E9E;
  --color-reset-btn-hover: #757575;
  --font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --border-radius: 4px;
  --border-radius-lg: 8px;
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.08);
  --max-width: 900px;
}

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

html {
  font-size: 13px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  background-color: var(--color-body-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
}

/* --- Header --- */
.header {
  background: none;
  padding: 0;
}

.header__logo-area {
  display: none;
}

.header__logo {
  display: inline-block;
  text-decoration: none;
}

.header__logo-img {
  height: 24px;
  width: auto;
  display: block;
}

.header__nav {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 10px 0;
}

/* Inline logo: always shown on left */
.header__logo--inline {
  display: flex;
  align-items: center;
  padding: 0 8px;
  background: none;
  text-decoration: none;
}

.header__logo--inline img {
  width: 100px;
  height: auto;
}

.header__title {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  color: var(--color-primary);
  font-size: 1rem;
  font-weight: 700;
  padding: 0 16px;
  letter-spacing: 0.05em;
}

.header__contact {
  margin-left: auto;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary);
  color: var(--color-white);
  padding: 6px 16px;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}

.header__contact:hover {
  background: var(--color-primary-dark);
}

/* Logout button in header */
.header__logout {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #6c757d;
  color: var(--color-white);
  padding: 6px 16px;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  margin-left: 8px;
  transition: background 0.2s;
}

.header__logout:hover {
  background: #555;
  color: var(--color-white);
  text-decoration: none;
}

/* Hamburger menu button (visible on mobile, hidden on tablet+) */
.header__hamburger {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin-left: auto;
}

.header__hamburger-icon {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 22px;
}

.header__hamburger-icon span {
  display: block;
  height: 2px;
  background: var(--color-primary);
  border-radius: 1px;
  transition: transform 0.3s, opacity 0.3s;
}

/* Hamburger active state (X shape) */
.header__hamburger.is-active .header__hamburger-icon span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.header__hamburger.is-active .header__hamburger-icon span:nth-child(2) {
  opacity: 0;
}

.header__hamburger.is-active .header__hamburger-icon span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* Mobile: hide nav buttons (shown via hamburger menu instead) */
.header__nav > .header__contact {
  display: none;
}

.header__nav > .header__logout {
  display: none;
}

/* Mobile menu */
.header__mobile-menu {
  display: none;
  flex-direction: column;
  background: var(--color-white);
  border-top: 1px solid #eee;
}

.header__mobile-menu.is-open {
  display: flex;
}

.header__mobile-menu a,
.header__mobile-menu div {
  padding: 12px 16px;
  font-size: 0.9rem;
  color: var(--color-text);
  text-decoration: none;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
}

.header__mobile-menu a:hover,
.header__mobile-menu div:hover {
  background: #f9f9f9;
}

.header__mobile-menu .header__logout {
  display: block;
  background: none;
  color: var(--color-text);
  font-weight: normal;
  border-radius: 0;
  margin-left: 0;
  padding: 12px 16px;
  font-size: 0.9rem;
}

/* --- Main content area --- */
.main {
  background: var(--color-body-bg);
  padding: 0;
  min-height: 500px;
}

/* --- Demo Toggle --- */
.demo-toggle {
  position: fixed;
  top: 10px;
  right: 12px;
  z-index: 999;
  background: rgba(0, 0, 0, 0.75);
  color: var(--color-white);
  border: none;
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 0.65rem;
  font-family: var(--font-family);
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.demo-toggle:hover {
  background: rgba(0, 0, 0, 0.9);
}

/* --- Search Section --- */
.search-section {
  background: var(--color-card-bg);
  border-bottom: 1px solid #ddd;
  margin: 0;
  padding: 16px;
}

.search-section__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--color-border-light);
}

/* Guest search */
.search-guest {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}

.search-guest .btn--search {
  align-self: flex-end;
}

.search-guest__input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #aaa;
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-family: var(--font-family);
  background: var(--color-white);
}

.search-guest__input::placeholder {
  color: #999;
}

.search-guest__input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(212, 88, 138, 0.15);
}

.search-hint {
  font-size: 0.8rem;
  color: var(--color-text);
  margin-top: 8px;
}

/* Form elements */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-text-light);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #ccc;
  border-radius: var(--border-radius);
  font-size: 0.85rem;
  font-family: var(--font-family);
  transition: border-color 0.2s;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--color-primary-light);
  box-shadow: 0 0 0 2px rgba(212, 88, 138, 0.1);
}

input[type="number"] {
  width: 70px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 24px;
  border: none;
  border-radius: var(--border-radius);
  font-size: 0.9rem;
  font-weight: 500;
  font-family: var(--font-family);
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  white-space: nowrap;
  text-decoration: none;
}

.btn:hover {
  text-decoration: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn--search {
  background: var(--color-search-btn);
  color: var(--color-white);
  padding: 10px 28px;
  font-size: 1rem;
  font-weight: 700;
  border-radius: var(--border-radius);
}

.btn--search:hover {
  background: var(--color-search-btn-hover);
}

.btn--reset {
  background: var(--color-reset-btn);
  color: var(--color-white);
}

.btn--reset:hover {
  background: var(--color-reset-btn-hover);
}

.btn--primary {
  background: var(--color-primary);
  color: var(--color-white);
}

.btn--primary:hover {
  background: var(--color-primary-dark);
}

.btn--login {
  background: var(--color-primary);
  color: var(--color-white);
  padding: 10px 36px;
  font-size: 1rem;
}

.btn--login:hover {
  background: var(--color-primary-dark);
}

.btn--block {
  width: 100%;
}

.search-actions {
  display: flex;
  flex-direction: row-reverse;
  justify-content: center;
  gap: 12px;
  margin-top: 10px;
  padding-top: 0;
}

.search-section:not(.search-section--advanced) .no-results {
  border-top: 1px solid #ddd;
}

/* --- Advanced Search (logged-in) --- */
.search-section--advanced {
  padding: 20px 16px;
  background: #f0eff0;
}

/* Accordion */
.search-accordion {
  margin: 0;
}

.search-accordion__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 16px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--color-white);
  background: var(--color-primary);
  border-radius: 30px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  width: fit-content;
  margin: 12px auto 0;
}

.search-accordion__toggle::-webkit-details-marker {
  display: none;
}

.search-accordion__toggle::after {
  content: "－";
  font-size: 0.8rem;
  font-weight: 700;
}

.search-accordion:not([open]) .search-accordion__toggle::after {
  content: "＋";
}

.search-accordion__body {
  margin-top: 20px;
}

/* Collapsible subsection */
.search-subsection {
  margin-top: 24px;
}

.search-subsection summary {
  list-style: none;
}

.search-subsection summary::-webkit-details-marker {
  display: none;
}

.search-subsection__toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-primary);
  padding: 8px 0;
  border-bottom: 2px solid var(--color-primary);
  cursor: pointer;
  user-select: none;
}

.search-subsection__toggle::before {
  content: "\FF0B";
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-white);
  background: var(--color-primary);
  border-radius: 50%;
  flex-shrink: 0;
}

.search-subsection[open] > .search-subsection__toggle::before {
  content: "\FF0D";
}

.search-subsection__body {
  margin-top: 8px;
}

/* Section group title */
.search-group__title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-primary);
  padding: 4px 0;
  border-bottom: 2px solid var(--color-primary);
  margin-top: 10px;
}

.search-group__title:first-child {
  margin-top: 0;
}

/* Field rows container */
.search-group {
  border-bottom: 1px solid #ddd;
}

/* Each field row: stacked on mobile */
.field-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 5px 0;
  border-top: 1px solid #ddd;
}

.field-row__label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-text);
  padding-top: 4px;
}

.field-row__body {
  flex: 1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.field-row__body input[type="text"],
.field-row__body input[type="date"],
.field-row__body select {
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.85rem;
  font-family: var(--font-family);
  background: var(--color-white);
}

.field-row__body input[type="text"] {
  width: 100%;
}

.field-row__body select {
  appearance: auto;
}

/* Medium-width input */
.input--mid {
  width: 100% !important;
  max-width: 100%;
}

/* Short inputs for range fields */
.input--short {
  width: 80px !important;
  flex: 0 0 auto;
}

/* Range: from ~ to */
.field-row__body--range {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.field-row__body--range input[type="text"],
.field-row__body--range input[type="date"] {
  width: auto;
}

.field-row__body--range span {
  font-size: 0.85rem;
  color: #999;
  flex-shrink: 0;
}

/* Unit label (cm, kg) */
.field-row__unit {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

/* Checkboxes inline */
.field-row__body--check {
  display: flex;
  align-items: center;
  gap: 8px 20px;
  flex-wrap: wrap;
}

.field-row__body--check label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.85rem;
  font-weight: 400;
  cursor: pointer;
  white-space: nowrap;
}

.field-row__body--check input[type="checkbox"] {
  width: auto;
  accent-color: var(--color-primary);
}

/* 2-column grid for body size fields (1-col on mobile) */
.search-group--2col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 24px;
}

.search-group--2col .field-row {
  border-top: 1px solid #ddd;
}

/* Note text */
.field-row__note {
  font-size: 0.75rem;
  color: #e06090;
  flex-basis: 100%;
}

/* Large action buttons */
.btn--search-lg {
  background: var(--color-primary);
  color: var(--color-white);
  padding: 8px 28px;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 30px;
  border: none;
}

.btn--search-lg:hover {
  background: var(--color-primary-dark);
}

.btn--search-lg .btn__icon {
  margin-left: 8px;
}

.btn--reset-lg {
  background: #ccc;
  color: var(--color-text);
  padding: 8px 28px;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 30px;
  border: none;
}

.btn--reset-lg:hover {
  background: #bbb;
}

/* --- Results area --- */
.results-section {
  margin: 0;
  padding: 16px;
  background: var(--color-card-bg);
}

.results-section .no-results {
  padding: 20px 0;
}

.results-header {
  margin-bottom: 14px;
}

.results-header__count {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
}

/* --- Login Prompt (guest) --- */
.login-prompt {
  text-align: center;
  padding: 30px 16px 40px;
}

.login-prompt__text {
  font-size: 1rem;
  color: var(--color-primary);
  font-weight: 500;
  margin-bottom: 8px;
}

.btn--login-prompt {
  display: inline-block;
  background: var(--color-primary);
  color: var(--color-white);
  padding: 10px 30px;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: 30px;
  text-decoration: none;
  transition: background 0.2s;
  white-space: normal;
}

.btn--login-prompt:hover {
  background: var(--color-primary-dark);
  color: var(--color-white);
  text-decoration: none;
}

/* Login prompt link (detail page) */
.login-prompt__link {
  display: inline-block;
  color: var(--color-primary);
  font-size: 0.9rem;
  text-decoration: underline;
}

.login-prompt__link:hover {
  color: var(--color-primary-dark);
}

/* --- Results --- */
.results-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 0.85rem;
  color: var(--color-text-light);
}

/* Results grid - guest (simple) */
.results-grid--guest {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

/* Results grid - logged in */
.results-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

/* Results empty */
.results-empty {
  font-size: 0.9rem;
  color: var(--color-text-light);
  padding: 20px 0;
  text-align: center;
  line-height: 1.8;
}

/* Card */
.talent-card {
  background: none;
  border: none;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: none;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}

.talent-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  text-decoration: none;
}

.talent-card__photo {
  position: relative;
  width: 100%;
  padding-top: 130%;
  background: var(--color-photo-placeholder);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid #ccc;
  border-radius: var(--border-radius);
}

.talent-card__photo-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #999;
  font-size: 0.8rem;
}

/* Photo image (View uses talent-card__img, Mock uses talent-card__photo-img) */
.talent-card__img,
.talent-card__photo-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Copyright image on card (View uses talent-card__copyright as img) */
.talent-card__copyright {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  max-width: 80%;
  height: auto;
}

.talent-card__copyright-img {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  max-width: 80%;
  height: auto;
}

.no-results {
  font-size: 0.9rem;
  color: var(--color-text-light);
  padding: 2px 0;
  text-align: center;
  white-space: nowrap;
  grid-column: 1 / -1;
  margin-top: 0;
}

.talent-card__info {
  padding: 10px 12px;
  text-align: left;
}

.talent-card__name {
  font-size: 0.95rem;
  font-weight: 700;
}

.talent-card__furigana {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.talent-card__meta {
  font-size: 0.75rem;
  color: var(--color-text-light);
  margin-top: 1px;
}

/* View-specific: kanji name and details on card */
.talent-card__name-kanji {
  font-size: 0.8rem;
  color: var(--color-text-light);
  margin-top: 1px;
}

.talent-card__details {
  font-size: 0.75rem;
  color: var(--color-text-light);
  margin-top: 2px;
}

.talent-card__age,
.talent-card__pref {
  display: inline;
}

/* --- Pagination --- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.pagination__btn {
  padding: 5px 8px;
  border: 1px solid var(--color-border-light);
  background: var(--color-card-bg);
  border-radius: var(--border-radius);
  font-size: 0.7rem;
  font-family: var(--font-family);
  cursor: pointer;
  color: var(--color-text);
  transition: background 0.2s;
  text-decoration: none;
}

.pagination__btn:hover {
  background: #f0f0f0;
  text-decoration: none;
}

.pagination__btn--disabled {
  opacity: 0.4;
  cursor: default;
}

.pagination__current {
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-primary);
}

.pagination__total {
  font-size: 0.8rem;
  color: var(--color-text-light);
  margin-left: 10px;
}

/* --- Detail Page --- */
.detail-page {
  max-width: var(--max-width);
  margin: 20px auto;
  padding: 0 16px;
}

/* Photo carousel */
.detail-photo {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.detail-photo__main {
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
  aspect-ratio: 3/4;
  background: var(--color-photo-placeholder);
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 0.9rem;
  position: relative;
  overflow: hidden;
}

.detail-photo__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-photo__copyright {
  position: absolute;
  top: 6px;
  left: 6px;
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(0, 0, 0, 0.4);
  padding: 2px 6px;
  border-radius: 2px;
}

.detail-photo__dots {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.detail-photo__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-border-light);
  cursor: pointer;
  transition: background 0.2s;
}

.detail-photo__dot--active {
  background: var(--color-primary);
}

.detail-photo__date {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 8px;
}

/* Detail profile */
.detail-profile {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.detail-profile__name {
  font-size: 1.5rem;
  font-weight: 700;
}

.detail-profile__furigana {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.detail-profile__table {
  width: 100%;
  border-collapse: collapse;
}

.detail-profile__table th,
.detail-profile__table td {
  padding: 6px 10px;
  font-size: 0.85rem;
  border-bottom: 1px solid #f0f0f0;
  text-align: left;
}

.detail-profile__table th {
  width: 120px;
  font-weight: 500;
  color: var(--color-text-light);
  background: #fdf0f4;
  white-space: nowrap;
}

.detail-profile__table td {
  color: var(--color-text);
}

/* Section titles */
.section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-primary);
  padding-bottom: 6px;
  border-bottom: 2px solid var(--color-border-light);
  margin-bottom: 12px;
}

/* Career tabs */
.career-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--color-border-light);
  margin-bottom: 12px;
}

.career-tab {
  padding: 8px 16px;
  font-size: 0.8rem;
  font-family: var(--font-family);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.2s, border-color 0.2s;
}

.career-tab--active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  font-weight: 700;
}

.career-tab:hover {
  color: var(--color-primary-light);
}

.career-content {
  font-size: 0.85rem;
  line-height: 1.8;
  white-space: pre-line;
}

/* Career panel (View uses panel divs instead of textContent swap) */
.career-panel {
  font-size: 0.85rem;
  line-height: 1.8;
  white-space: pre-line;
}

/* Media grid (video thumbnails) */
.media-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.media-thumb {
  aspect-ratio: 16/9;
  background: #e0e0e0;
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 0.75rem;
  position: relative;
  overflow: hidden;
}

.media-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-thumb__play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1rem;
}

/* Audio row */
.audio-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.audio-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: #f9f9f9;
  border-radius: var(--border-radius);
  font-size: 0.85rem;
}

.audio-item audio {
  width: 100%;
}

.audio-item__play {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--color-primary);
  color: var(--color-white);
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
}

.audio-item__play:hover {
  background: var(--color-primary-dark);
}

.audio-item__name {
  flex: 1;
}

.audio-item__duration {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* SNS account info */
.sns-account-list {
  border-top: 1px solid #e0e0e0;
}

.sns-account-row {
  display: flex;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #e0e0e0;
}

.sns-account-row__icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  margin-right: 8px;
  flex-shrink: 0;
}

.sns-account-row__label {
  flex: 0 0 100px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-text);
}

.sns-account-row__value {
  flex: 1;
  font-size: 0.85rem;
  color: var(--color-text-light);
}

.sns-icons {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

.sns-icons__link {
  display: block;
}

.sns-icons__img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

/* --- Login Page (portal site style) --- */
.body-login {
  background: var(--color-body-bg);
}

.login-header {
  text-align: center;
  padding: 16px 16px 0;
  background: none;
}

.login-header__logo {
  width: 30%;
  max-width: 160px;
  height: auto;
}

.login-system-logo {
  text-align: center;
  max-width: 490px;
  margin: 0 auto;
  padding: 100px 16px 30px;
}

.login-system-logo__title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: 0.1em;
}

.login-page {
  max-width: 420px;
  margin: 0 auto;
  padding: 0 16px 30px;
}

.login-box {
  background: var(--color-white);
  border: none;
  border-radius: 0;
  padding: 20px 24px;
  box-shadow: none;
}

.login-box .form-group {
  margin-bottom: 14px;
}

.login-box .form-group label {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 4px;
  display: block;
  color: var(--color-text);
}

.login-box .form-group input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: var(--border-radius);
  font-size: 0.95rem;
}

.login-box .form-group input:focus {
  border-color: var(--color-primary-light);
  box-shadow: 0 0 0 2px rgba(212, 88, 138, 0.1);
  outline: none;
}

.login-box__forgot {
  text-align: center;
  margin-top: 6px;
  margin-bottom: 16px;
  font-size: 0.85rem;
}

.login-box__forgot a {
  color: var(--color-primary);
  text-decoration: underline;
}

.login-box__forgot a:hover {
  color: var(--color-primary-dark);
}

.btn--login-portal {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  background: var(--color-primary);
  color: var(--color-white);
  padding: 10px 36px;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: background 0.2s;
}

.btn--login-portal:hover {
  background: var(--color-primary-dark);
}

.login-box__back {
  margin-top: 12px;
  display: flex;
  justify-content: center;
}

.btn--back {
  width: 75%;
  background-color: #6c757d;
  border-color: #6c757d;
  color: var(--color-white);
  padding: 10px 36px;
  font-size: 1rem;
}

.btn--back:hover {
  background-color: #5a6268;
  color: var(--color-white);
}

.login-box__subtitle {
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  color: var(--color-primary);
  margin-bottom: 12px;
}

.login-box__desc {
  font-size: 0.85rem;
  color: #666;
  text-align: center;
  margin-bottom: 24px;
  line-height: 1.7;
}

.login-box__actions {
  margin-top: 0;
}

/* Login footer */
.login-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #343a40;
  color: #ccc;
  text-align: center;
  padding: 12px 16px;
  font-size: 0.7rem;
}

.login-footer__inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

/* --- Guest detail (limited) --- */
.detail-guest {
  text-align: center;
  max-width: 400px;
  margin: 40px auto;
  background: #fff;
  padding: 30px;
  border-radius: 8px;
}

.loggedin-only .detail-guest,
.detail-page .detail-guest {
  max-width: 680px;
}

.detail-back {
  margin-top: 16px;
  text-align: left;
}

.btn--back-sm {
  display: inline-block;
  background-color: #6c757d;
  color: #fff;
  font-size: 0.8rem;
  padding: 6px 14px;
  border-radius: 4px;
  text-decoration: none;
}

.btn--back-sm:hover {
  background-color: #5a6268;
  color: #fff;
}

/* --- Photo Carousel (portal site style) --- */
.photo-carousel {
  max-width: 280px;
  margin: 0 auto;
  text-align: center;
}

.photo-carousel__slides {
  position: relative;
}

.photo-carousel__slide {
  position: relative;
  height: 420px;
  overflow: hidden;
  background: var(--color-white);
  display: none;
  justify-content: center;
}

.photo-carousel__slide--active {
  display: flex;
}

.photo-carousel__img {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 100%;
  max-width: 280px;
  height: 100%;
  left: 0;
  right: 0;
  margin-left: auto;
  margin-right: auto;
  object-fit: cover;
}

.photo-carousel__copyright {
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
}

.photo-carousel__dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
}

.photo-carousel__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #999;
  cursor: pointer;
  transition: background 0.2s;
}

.photo-carousel__dot--active {
  background: #555;
}

.photo-carousel__date {
  color: #999;
  font-size: 11px;
  margin-top: 12px;
}

/* Previous period photos */
.photo-carousel--prev {
  margin-top: 20px;
}

.photo-carousel__label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 8px;
}

.detail-guest__name {
  font-size: 14px;
  color: #212529;
  font-weight: 700;
  margin-top: 8px;
  margin-bottom: 6px;
}

.detail-guest__date {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-bottom: 20px;
}

/* Logged-in detail */
.detail-loggedin__kanji {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 16px;
}

.detail-loggedin__section {
  width: 100%;
  max-width: 600px;
  margin: 20px auto 0;
  text-align: left;
}

.detail-guest__login-msg {
  font-size: 0.85rem;
  color: var(--color-text-light);
  margin-bottom: 14px;
}

/* --- Validation Error --- */
.field-row--error .field-row__body input,
.field-row--error .field-row__body select {
  border-color: #dc3545;
  background-color: #fff5f5;
}

.field-row__error {
  color: #dc3545;
  font-size: 0.75rem;
  margin-top: 4px;
}

.error-message {
  color: #dc3545;
  font-size: 0.8rem;
  margin-top: 4px;
}

.field-row__body > .error-message {
  flex-basis: 100%;
}

.input--error {
  border-color: #dc3545 !important;
  background-color: #fff5f5 !important;
}

/* --- Alert --- */
.alert {
  padding: 10px 14px;
  border-radius: var(--border-radius);
  font-size: 0.85rem;
  margin-bottom: 14px;
}

.alert--error {
  background: #fff5f5;
  color: #dc3545;
  border: 1px solid #f5c6cb;
}

.alert--success {
  background: #f0fff4;
  color: #28a745;
  border: 1px solid #c3e6cb;
}

/* --- Logout Modal (View) --- */
.logout-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.logout-modal__content {
  background: #fff;
  border-radius: 10px;
  padding: 32px 40px;
  text-align: center;
  min-width: 300px;
  max-width: 400px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.logout-modal__content p {
  font-size: 1rem;
  color: #333;
  margin-bottom: 24px;
}

.logout-modal__actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* --- Modal (Mock) --- */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal-overlay.is-active {
  display: flex;
}

.modal {
  background: #fff;
  border-radius: 10px;
  padding: 32px 40px;
  text-align: center;
  min-width: 300px;
  max-width: 400px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.modal__message {
  font-size: 1rem;
  color: #333;
  margin-bottom: 24px;
}

.modal__actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.modal__btn {
  padding: 8px 28px;
  border-radius: 20px;
  border: none;
  font-size: 0.9rem;
  cursor: pointer;
}

.modal__btn--cancel {
  background: #ccc;
  color: #333;
}

.modal__btn--cancel:hover {
  background: #bbb;
}

.modal__btn--confirm {
  background: var(--color-primary);
  color: #fff;
}

.modal__btn--confirm:hover {
  background: #c04a7a;
}

/* --- Visibility helpers --- */
.guest-only {
  display: block;
}

.loggedin-only {
  display: none;
}

body.is-logged-in .guest-only {
  display: none !important;
}

body.is-logged-in .loggedin-only {
  display: block !important;
}

/* --- Footer --- */
.footer {
  text-align: center;
  padding: 16px;
  font-size: 0.7rem;
  color: var(--color-text-muted);
  background: var(--color-body-bg);
}

.footer--simple {
  border: none;
  border-radius: 0;
}

/* ============================================
   Responsive (Mobile-First: min-width queries)
   ============================================ */

/* --- Mobile → Standard Mobile (min-width: 481px) --- */
@media (min-width: 481px) {
  .results-grid,
  .results-grid--guest {
    gap: 10px;
  }

  .pagination {
    gap: 8px;
  }

  .pagination__btn {
    padding: 6px 14px;
    font-size: 0.8rem;
  }
}

/* --- Mobile → Tablet (min-width: 768px) --- */
@media (min-width: 768px) {
  html {
    font-size: 14px;
  }

  /* Header */
  .header__logo-img {
    height: 30px;
  }

  .header__logo--inline {
    padding: 0 12px 0 0;
  }

  .header__logo--inline img {
    width: 150px;
  }

  .header__title {
    font-size: 1.15rem;
  }

  /* Show nav buttons, hide hamburger */
  .header__hamburger {
    display: none;
  }

  .header__nav > .header__contact {
    display: flex;
  }

  .header__nav > .header__logout {
    display: flex;
  }

  /* Mobile menu always hidden on tablet+ */
  .header__mobile-menu,
  .header__mobile-menu.is-open {
    display: none !important;
  }

  /* Search */
  .search-section {
    padding: 24px 40px;
  }

  .search-section--advanced {
    padding: 16px 40px;
  }

  .field-row {
    flex-direction: row;
    align-items: flex-start;
    gap: 0;
  }

  .field-row__label {
    flex: 0 0 120px;
  }

  .input--mid {
    width: 280px !important;
  }

  .search-group--2col {
    grid-template-columns: 1fr 1fr;
  }

  .search-guest {
    flex-direction: row;
    align-items: center;
  }

  .search-guest .btn--search {
    align-self: auto;
  }

  .btn--search-lg,
  .btn--reset-lg {
    padding: 8px 40px;
  }

  /* Results */
  .results-section {
    padding: 10px 40px;
  }

  .results-grid--guest {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
  }

  .results-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
  }

  /* Detail page */
  .detail-photo__main {
    max-width: none;
    margin: 0;
  }

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

  /* Login page */
  .login-box {
    padding: 24px 40px;
  }

  .login-system-logo {
    padding: 100px 16px 30px;
  }

  .login-system-logo__title {
    font-size: 2.4rem;
  }

  .login-header__logo {
    width: 20%;
  }

  /* Login prompt */
  .login-prompt {
    padding: 40px 40px 50px;
  }

  /* Demo toggle */
  .demo-toggle {
    font-size: 0.75rem;
    padding: 6px 14px;
  }

  /* Centered container (tablet + desktop) */
  .header {
    max-width: var(--max-width);
    margin: 0 auto;
  }

  .main {
    max-width: var(--max-width);
    margin: 0 auto;
  }

  .footer {
    max-width: var(--max-width);
    margin: 0 auto;
  }
}

/* --- Desktop (min-width: 1024px) --- */
@media (min-width: 1024px) {
  .results-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* --- Loading Overlay --- */
.loading-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.7);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

.loading-overlay.is-active {
  display: flex;
}

.loading-overlay__spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #e0e0e0;
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============ Video Popup Modal ============ */
.media-thumb--clickable {
  cursor: pointer;
}

.media-thumb--clickable video {
  pointer-events: none;
}

.media-thumb__play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.media-thumb--clickable:hover .media-thumb__play-btn {
  background: rgba(0, 0, 0, 0.75);
}

.video-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.video-modal.is-open {
  display: flex;
}

.video-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
}

.video-modal__content {
  position: relative;
  z-index: 1;
  width: 90%;
  max-width: 720px;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
}

.video-modal__content video {
  width: 100%;
  display: block;
  max-height: 80vh;
  background: #000;
}

.video-modal__close {
  position: absolute;
  top: 8px;
  right: 12px;
  z-index: 2;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-modal__close:hover {
  background: rgba(0, 0, 0, 0.85);
}
