/* ═══════════════════════════════════════════════
   CLOVER OOC — OUTFITS STYLES
   Image + 'clothes:' card library, accordion sections.
   Adapts patterns from catalogue.css + scenes.css.
   aceenvw
   ═══════════════════════════════════════════════ */

/* ═══ PAGE HEADER ═══ */
.outfits-header {
  padding: 120px 0 24px;
  text-align: center;
}

.outfits-title {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-weight: 400;
  margin: 0 0 0.4rem;
  letter-spacing: -0.02em;
}

.outfits-subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 640px;
  margin: 0 auto 1.5rem;
  line-height: 1.55;
}

.outfits-subtitle code,
.outfits-hint-text code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--code-bg);
  padding: 0.08em 0.4em;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* ═══ HOW-TO HINT ═══ */
.outfits-hint {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.95rem 1.1rem;
  margin: 0 auto 1.25rem;
  max-width: 720px;
  text-align: left;
}

.outfits-hint-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.45rem;
}

.outfits-hint-text {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

/* ═══ WARDROBE CROSS-LINK STRIP ═══ */
.outfits-promo {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  max-width: 720px;
  margin: 0 auto 1.25rem;
  padding: 0.85rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  text-align: left;
  transition: border-color 0.18s, background-color 0.18s, transform 0.18s;
}

.outfits-promo:hover {
  border-color: var(--accent);
  background: var(--accent-faint);
  transform: translateY(-1px);
}

.outfits-promo-icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--accent-faint);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.outfits-promo-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.outfits-promo-text strong {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.outfits-promo-sub {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.outfits-promo-cta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  flex-shrink: 0;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .outfits-promo { flex-wrap: wrap; }
  .outfits-promo-cta { width: 100%; text-align: right; }
}

/* ═══ SEARCH BAR (sticky) ═══ */
.outfits-search-wrap {
  position: sticky;
  top: var(--nav-height);
  z-index: 50;
  padding: 0.75rem 0;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  margin: 0 auto;
  max-width: 720px;
  transition: border-color 0.2s;
}

.outfits-search-wrap.is-stuck {
  border-bottom-color: var(--border);
}

.outfits-search-row {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.2s;
}

.search-box:focus-within {
  border-color: var(--accent);
}

.search-box svg {
  color: var(--text-dim);
  flex-shrink: 0;
}

.search-box input {
  flex: 1;
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--text);
  outline: none;
  min-width: 0;
}

.search-box input::placeholder {
  color: var(--text-dim);
}

.outfits-random-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.65rem 0.9rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.85rem;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.18s, background-color 0.18s;
  -webkit-tap-highlight-color: transparent;
}

.outfits-random-btn:hover { border-color: var(--accent); }
.outfits-random-btn:active { background: var(--accent-faint); }
.outfits-random-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.outfits-random-btn.is-spun svg { animation: outfitsDiceSpin 0.4s ease; }

@keyframes outfitsDiceSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(180deg); }
}

.outfits-meta {
  display: flex;
  justify-content: flex-end;
  padding: 0.4rem 0.25rem 0;
  min-height: 1.2rem;
}

.outfits-result-count {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

/* ═══ LOADING / ERROR ═══ */
.outfits-loading,
.outfits-loading-error {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--text-dim);
}
.outfits-loading-error {
  color: var(--accent);
}

/* ═══ SECTIONS (accordion) ═══ */
.outfits-section {
  margin-top: 1.5rem;
}

.outfits-sections {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 4rem;
}

.outfit-section {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.outfit-section-header {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  padding: 1rem 1.1rem;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: var(--text);
  transition: background-color 0.15s;
}

.outfit-section-header:hover {
  background: var(--accent-faint);
}

.outfit-section-chevron {
  width: 18px;
  height: 18px;
  color: var(--text-dim);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.outfit-section.is-open .outfit-section-chevron {
  transform: rotate(90deg);
  color: var(--accent);
}

.outfit-section-title {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.outfit-section-name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.2;
}

.outfit-section-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
  line-height: 1.35;
}

.outfit-section-count {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  padding: 0.18rem 0.55rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  flex-shrink: 0;
}

.outfit-section-count.has-matches {
  color: var(--accent);
  border-color: var(--accent);
}

.outfit-section-body {
  display: none;
  padding: 0 1rem 1.1rem;
  border-top: 1px dashed var(--border);
}

.outfit-section.is-open .outfit-section-body {
  display: block;
}

.outfit-section-body.is-empty {
  padding: 1rem;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
}

/* ═══ CARDS GRID ═══ */
.outfit-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  padding-top: 0.95rem;
}

.outfit-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.outfit-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

.outfit-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ─ Image area ─ */
.outfit-card-image {
  aspect-ratio: 4 / 5;
  background: linear-gradient(135deg, var(--accent-faint), var(--bg-surface));
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  position: relative;
}

.outfit-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.outfit-card:hover .outfit-card-image img {
  transform: scale(1.02);
}

/* ─ Placeholder (clover SVG) ─ */
.outfit-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.outfit-placeholder svg {
  width: 38%;
  max-width: 90px;
  opacity: 0.25;
  color: var(--accent);
}

/* ─ Content ─ */
.outfit-card-content {
  padding: 0.95rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.55rem;
}

.outfit-card-head {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.outfit-card-num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  padding: 0.1rem 0.45rem;
  background: var(--bg-surface);
  border-radius: 4px;
  flex-shrink: 0;
}

.outfit-card-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
  word-break: break-word;
}

.outfit-card-body {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--text);
  background: var(--code-bg);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 0.65rem 0.8rem;
  white-space: pre-wrap;
  word-break: break-word;
  cursor: copy;
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.outfit-card-body:hover {
  border-color: var(--accent);
}

.outfit-card-body.is-copied {
  background: var(--accent-faint);
  border-color: var(--accent);
}

.outfit-card-hint {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
}

/* ═══ MODAL (lifted from catalogue.css) ═══ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.modal.active {
  display: flex;
  animation: modalFadeIn 0.25s ease;
}

@keyframes modalFadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal.active .modal-content {
  animation: modalSlideUp 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  width: 100%;
  max-width: 760px;
  max-height: 90vh;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow-y: auto;
  z-index: 1;
}

.modal-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  padding: 0.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
  z-index: 2;
}

.modal-close:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.modal-header {
  padding: 1.75rem 1.75rem 1.25rem;
}

.modal-title-row {
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.modal-number {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--text-dim);
}

.modal-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.5vw, 2.25rem);
  font-weight: 400;
  color: var(--text);
  margin: 0;
}

.modal-image-container {
  width: 100%;
  aspect-ratio: 4 / 5;
  max-height: 70vh;
  background: linear-gradient(135deg, var(--accent-faint), var(--bg-surface));
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.modal-image-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--bg);
}

.modal-body {
  padding: 1.75rem;
}

.modal-prompt-text {
  padding: 1.25rem;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--code-text);
  white-space: pre-wrap;
  margin: 0 0 1.25rem;
  word-break: break-word;
}

.modal-actions {
  display: flex;
  gap: 1rem;
}

.modal-copy-btn {
  flex: 1;
  padding: 0.85rem 1.4rem;
  background: var(--bg);
  border: 1px solid var(--accent);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--accent);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
}

.modal-copy-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ═══ SCROLL TO TOP ═══ */
.scroll-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  z-index: 50;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.scroll-to-top:hover {
  background: var(--bg-surface);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* ═══ TOAST ═══ */
.clover-toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%) translateY(20px);
  padding: 0.7rem 1.2rem;
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--accent);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  z-index: 9999;
  max-width: calc(100% - 2rem);
  text-align: center;
}

.clover-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ═══ RESPONSIVE ═══ */
@media (min-width: 640px) {
  .outfit-cards { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 960px) {
  .outfit-cards { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1280px) {
  .outfit-cards { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 480px) {
  .outfits-header { padding: 100px 0 20px; }
  .outfits-search-row { align-items: stretch; }
  .outfits-random-btn { padding-inline: 0.7rem; }
  .outfit-section-header { padding: 0.85rem 0.9rem; }
  .outfit-section-body { padding: 0 0.7rem 0.9rem; }
  .outfit-card-content { padding: 0.85rem 0.9rem 0.95rem; }
  .modal { padding: 0.75rem; }
  .modal-header { padding: 1.25rem 1.25rem 0.95rem; }
  .modal-body { padding: 1.25rem; }
}
