/* ==========================================================
   OOHWEE — brand stylesheet
   Torn-paper / street-market visual system, extending the
   existing OOHWEE logo, poster and business-card identity.
   ========================================================== */

:root {
  color-scheme: light only;
  --paper: #f5f1e7;
  --paper-dim: #ece5d3;
  --ink: #17140f;
  --ink-soft: #4a453c;
  --orange: #ed7d21;
  --orange-deep: #c2540f;
  --line: #ddd3bd;
  --white: #ffffff;

  --font-display: "Pretendard", "Noto Sans KR", sans-serif;
  --font-mono: "IBM Plex Mono", "Noto Sans KR", monospace;

  --maxw: 1120px;
}

* { box-sizing: border-box; }

/* ── 어떤 기기에서도 요소가 화면 폭을 넘지 않도록 하는 전역 안전장치 ── */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}
body {
  overflow-wrap: break-word;
  word-break: keep-all;
}
img, svg, video, iframe, table {
  max-width: 100%;
  height: auto;
}
/* flex/grid 자식이 내용 길이 때문에 부모보다 넓어지는 것 방지 (가장 흔한 원인) */
.wrap, section, div, form, .pillar-grid, .pillar, .event-list, .event-card,
.event-header, .event-detail, .foot-grid, .form-row, .form-row-2,
.consent-block, .gallery, .gallery figure {
  min-width: 0;
  max-width: 100%;
}
input, select, textarea, button {
  max-width: 100%;
}
input:focus, select:focus, textarea:focus, button:focus {
  outline-offset: -2px;
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; text-decoration: none; }

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--orange-deep);
  font-weight: 600;
}

/* ---------- torn-paper edges (signature motif) ---------- */
.torn-bottom {
  clip-path: polygon(
    0% 0%, 100% 0%, 100% 92%,
    97% 100%, 93% 90%, 89% 100%, 85% 91%, 81% 100%,
    77% 92%, 73% 100%, 69% 90%, 65% 100%, 61% 93%,
    57% 100%, 53% 91%, 49% 100%, 45% 92%, 41% 100%,
    37% 90%, 33% 100%, 29% 93%, 25% 100%, 21% 91%,
    17% 100%, 13% 92%, 9% 100%, 5% 91%, 1% 100%, 0% 94%
  );
}
.torn-top {
  clip-path: polygon(
    0% 8%, 3% 0%, 7% 9%, 11% 1%, 15% 8%, 19% 0%, 23% 9%,
    27% 1%, 31% 8%, 35% 0%, 39% 9%, 43% 1%, 47% 8%, 51% 0%,
    55% 9%, 59% 1%, 63% 8%, 67% 0%, 71% 9%, 75% 1%, 79% 8%,
    83% 0%, 87% 9%, 91% 1%, 95% 8%, 100% 0%,
    100% 100%, 0% 100%
  );
}

/* ---------- nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(245, 241, 231, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-logo img { height: 34px; width: auto; }
.nav-logo span {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
}
.nav-links {
  display: flex;
  gap: 32px;
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.04em;
}
.nav-links a { margin-right: 32px; }
.nav-links a:last-child { margin-right: 0; }
.nav-links a {
  position: relative;
  padding: 4px 0;
}
.nav-links a.active { color: var(--orange-deep); }
.nav-links a:hover { color: var(--orange-deep); }
.nav-toggle { display: none; }

@media (max-width: 680px) {
  .nav-links {
    position: fixed;
    inset: 76px 0 auto 0;
    background: var(--paper);
    flex-direction: column;
    gap: 0;
    border-bottom: 1px solid var(--line);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }
  .nav-links.open { max-height: 320px; }
  .nav-links a {
    padding: 16px 28px;
    border-bottom: 1px solid var(--line);
  }
  .nav-toggle {
    display: block;
    background: none;
    border: 2px solid var(--ink);
    width: 40px;
    height: 40px;
    font-family: var(--font-mono);
    font-size: 16px;
  }
}

/* ---------- hero band ---------- */
.hero {
  background: var(--ink);
  color: var(--paper);
  padding: 96px 0 130px;
  position: relative;
}
.hero .wrap { text-align: center; }
.hero-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.16em;
  color: var(--orange);
  background: rgba(237, 125, 33, 0.12);
  border: 1px solid var(--orange);
  padding: 6px 16px;
  margin-bottom: 28px;
}
.hero-logo { width: min(340px, 60vw); margin: 0 auto 20px; }
.hero h1 {
  font-size: clamp(22px, 3.4vw, 30px);
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 14px;
}
.hero p {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.06em;
  color: #c9c3b6;
  margin: 0;
}

/* ---------- pillars ---------- */
.pillars {
  margin-top: -64px;
  position: relative;
  z-index: 5;
}
.pillar-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}
.pillar-grid .pillar {
  flex: 1 1 280px;
}
@media (max-width: 780px) {
  .pillar-grid .pillar { flex: 1 1 100%; }
}
.pillar {
  background: var(--white);
  border: 2px solid var(--ink);
  padding: 32px 26px;
}
.pillar .tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  background: var(--ink);
  color: var(--paper);
  padding: 3px 10px;
  margin-bottom: 18px;
}
.pillar h3 {
  font-size: 21px;
  margin: 0 0 10px;
}
.pillar p {
  color: var(--ink-soft);
  font-size: 14.5px;
  margin: 0;
}

/* ---------- section headers ---------- */
.section {
  padding: 96px 0;
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}
.section-head h2 {
  font-size: clamp(24px, 3vw, 32px);
  margin: 6px 0 0;
}
.section-head a.more {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  border-bottom: 2px solid var(--orange);
  padding-bottom: 2px;
  white-space: nowrap;
}

/* ---------- gallery ---------- */
.gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.gallery figure { flex: 1 1 300px; max-width: calc(33.333% - 10px); }
@media (max-width: 780px) {
  .gallery figure { max-width: calc(50% - 7px); }
}
.gallery figure {
  margin: 0;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--paper-dim);
  border: 1px solid var(--line);
  position: relative;
}
.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.gallery a:hover img { transform: scale(1.05); }
.gallery figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--white);
  background: linear-gradient(to top, rgba(0,0,0,0.65), transparent);
}
.gallery-empty {
  border: 2px dashed var(--line);
  padding: 60px 24px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--ink-soft);
  grid-column: 1 / -1;
}

.filter-row {
  display: flex;
  gap: 10px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.filter-btn {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  background: var(--white);
  border: 1.5px solid var(--ink);
  padding: 7px 16px;
  cursor: pointer;
}
.filter-btn.active {
  background: var(--ink);
  color: var(--paper);
}

/* ---------- event list (셀러 모집, 아코디언) ---------- */
.event-list { display: flex; flex-direction: column; gap: 14px; }
.event-card {
  background: var(--white);
  border: 2px solid var(--ink);
}
.event-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 26px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-display);
}
.event-main { flex: 1 1 auto; }
.event-status {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  padding: 3px 10px;
  margin-bottom: 10px;
}
.event-status.open { background: var(--orange); color: var(--white); }
.event-status.upcoming { background: var(--ink); color: var(--paper); }
.event-status.closed { background: var(--line); color: var(--ink-soft); }
.event-main h3 { font-size: 19px; margin: 0 0 6px; }
.event-meta-inline {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-soft);
}
.event-chevron {
  font-size: 22px;
  color: var(--orange-deep);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.event-header[aria-expanded="true"] .event-chevron { transform: rotate(45deg); }

.event-detail {
  display: none;
  padding: 0 26px 26px;
  border-top: 1px solid var(--line);
}
.event-detail.open { display: block; padding-top: 20px; }
.event-meta {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.9;
  margin-bottom: 10px;
}
.event-meta .k { color: var(--orange-deep); margin-right: 8px; }
.event-note { font-size: 13.5px; color: var(--ink-soft); margin-bottom: 18px; }
.events-empty {
  border: 2px dashed var(--line);
  padding: 50px 24px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--ink-soft);
}
.cta-band {
  background: var(--orange);
  color: var(--white);
  padding: 70px 0;
  text-align: center;
}
.cta-band .eyebrow { color: var(--ink); }
.cta-band h2 {
  font-size: clamp(24px, 3.6vw, 34px);
  margin: 10px 0 22px;
}
.btn {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.06em;
  background: var(--ink);
  color: var(--paper);
  padding: 14px 30px;
  border: 2px solid var(--ink);
}
.btn:hover { background: transparent; color: var(--ink); }
.btn-outline {
  background: transparent;
  color: var(--white);
  border: 2px solid var(--white);
}
.btn-outline:hover { background: var(--white); color: var(--orange-deep); }

/* ---------- footer ---------- */
footer {
  background: var(--ink);
  color: var(--paper);
  padding: 56px 0 32px;
}
.foot-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  align-items: flex-end;
}
.foot-grid > div { flex: 1 1 320px; }
footer .foot-logo { width: 130px; margin-bottom: 10px; display: block; }
footer .foot-tagline { color: #c9c3b6; font-size: 14px; margin: 0; }
.foot-row {
  display: flex;
  gap: 18px;
  padding: 10px 0;
  border-top: 1px solid rgba(245,241,231,0.15);
  font-size: 14.5px;
}
.foot-row:last-child { border-bottom: 1px solid rgba(245,241,231,0.15); }
.foot-row .label {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--orange);
  width: 26px;
  flex-shrink: 0;
}
.foot-bottom {
  margin-top: 24px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #8a8378;
  letter-spacing: 0.04em;
}

/* ---------- generic page hero (sub pages) ---------- */
.page-hero {
  background: var(--ink);
  color: var(--paper);
  padding: 64px 0 90px;
}
.page-hero .eyebrow { color: var(--orange); }
.page-hero h1 {
  font-size: clamp(28px, 4vw, 40px);
  margin: 14px 0 12px;
}
.page-hero p {
  color: #c9c3b6;
  max-width: 560px;
  font-size: 15px;
}
.page-body { margin-top: -50px; position: relative; z-index: 5; }
.card-panel {
  background: var(--white);
  border: 2px solid var(--ink);
  padding: 40px;
}
@media (max-width: 680px) {
  .card-panel { padding: 26px 20px; }
}

/* ---------- apply form ---------- */
.info-list { list-style: none; margin: 0 0 40px; padding: 0; }
.info-list li {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  font-size: 14.5px;
}
.info-list li:last-child { border-bottom: 1px solid var(--line); }
.info-list .k {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  color: var(--orange-deep);
  width: 96px;
  flex-shrink: 0;
  padding-top: 2px;
}

form.apply-form { display: grid; gap: 18px; min-width: 0; }
.form-row { display: grid; gap: 6px; min-width: 0; }
.form-row label {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}
.form-row input,
.form-row select,
.form-row textarea {
  font-family: var(--font-display);
  font-size: 15px;
  padding: 12px 14px;
  border: 1.5px solid var(--ink);
  background: var(--paper) !important;
  color: var(--ink) !important;
  color-scheme: light only;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.form-row select {
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}
.form-row textarea { min-height: 110px; resize: vertical; }
.form-row-2 { display: flex; flex-wrap: wrap; gap: 18px; }
.form-row-2 .form-row { flex: 1 1 220px; min-width: 0; }
@media (max-width: 560px) {
  .form-row-2 .form-row { flex: 1 1 100%; }
}
.form-submit {
  font-family: var(--font-mono);
  font-size: 15px;
  letter-spacing: 0.06em;
  background: var(--orange);
  color: var(--white);
  border: none;
  padding: 16px 20px;
  cursor: pointer;
  margin-top: 6px;
}
.form-submit:hover { background: var(--orange-deep); }
.form-note {
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: -4px;
}
.form-success {
  display: none;
  background: #eef6ec;
  border: 2px solid #3f7a3d;
  color: #234f22;
  padding: 20px;
  font-size: 14.5px;
}

/* ---------- consent blocks ---------- */
.consent-block {
  border: 1.5px solid var(--line);
  padding: 18px 20px;
}
.consent-title {
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--orange-deep);
  margin: 0 0 10px;
}
.consent-text {
  max-height: 140px;
  overflow-y: auto;
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 12px 14px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink-soft);
  margin-bottom: 12px;
}
.consent-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}
.consent-check input { margin-top: 3px; }

/* ---------- mobile hardening ---------- */
html, body { overflow-x: hidden; }

@media (max-width: 560px) {
  .wrap { padding: 0 18px; }
  .hero { padding: 64px 0 90px; }
  .hero-tag { font-size: 11px; padding: 5px 12px; }
  .page-hero { padding: 48px 0 70px; }
  .card-panel { padding: 22px 16px; }
  .pillar { padding: 24px 18px; }
  .event-header {
    padding: 16px 16px;
    flex-wrap: wrap;
  }
  .event-main { flex: 1 1 100%; }
  .event-chevron { align-self: flex-start; }
  .event-detail { padding: 0 16px 20px; }
  .event-detail.open { padding-top: 16px; }
  .event-meta div { line-height: 1.6; }
  .btn { width: 100%; text-align: center; }
  .form-submit { width: 100%; }
  .consent-block { padding: 14px 14px; }
  .consent-text { max-height: 110px; font-size: 12px; }
  .info-list li { flex-direction: column; gap: 4px; }
  .info-list .k { width: auto; }
  footer { padding: 44px 0 28px; }
}
