/**
 * 푸터 전용 스타일 (footer/footer.html / footer-include.js 와 함께 사용)
 * — 장미 버튼 → 상점·블로그(한 줄) → 약관·개인정보 → 사업자 정보
 */

/* ===== 푸터 (전체 내용 항상 노출) ===== */
.footer {
  padding: 1.5rem 1.25rem 2rem;
  text-align: center;
  border-top: 1px solid var(--border, rgba(255, 255, 255, 0.12));
  background: rgba(15, 10, 10, 0.6);
  display: block !important;
  visibility: visible !important;
  overflow: visible !important;
}

.footer-inner {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: visible !important;
}

.footer-inner .footer-line:not(.footer-rose-buttons),
.footer-inner .footer-legal-links {
  display: block !important;
  visibility: visible !important;
  overflow: visible !important;
}
.footer-inner .footer-rose-buttons {
  display: grid !important;
  visibility: visible !important;
  overflow: visible !important;
}

.footer-inner .footer-legal-links {
  display: flex !important;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

/* 순서: 장미 → 상점/블로그 텍스트 → 약관 → 사업자 */
.footer-rose-buttons { order: 0; }
.footer-promo-links { order: 1; }
.footer-legal-links { order: 2; }
.footer-inner .footer-company-line,
.footer-inner .footer-line:not(.footer-rose-buttons):not(.footer-legal-links):not(.footer-promo-links) {
  order: 3;
}

.footer-line {
  font-size: 0.75rem;
  line-height: 1.6;
  margin: 0 0 0.2rem 0;
}

/* 1행: 장미 버튼 3열 */
.footer-rose-buttons {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
  margin: 0 0 0.55rem 0;
  padding: 0 0.1rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.footer-rose-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 4.25rem;
  padding: 0.35rem 0.25rem;
  border-radius: 12px;
  border: 1px solid rgba(212, 175, 55, 0.55);
  text-decoration: none;
  color: #faf6ef;
  font-family: 'Gowun Batang', 'Nanum Myeongjo', 'Noto Serif KR', serif;
  font-size: clamp(0.65rem, 2.6vw, 0.8rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: center;
  line-height: 1.32;
  word-break: keep-all;
  overflow-wrap: break-word;
  position: relative;
  overflow: hidden;
  background-color: #0d0a08;
  background-image: url('../assets/footer-rose-line.png');
  background-size: auto 118%;
  background-position: center bottom;
  background-repeat: no-repeat;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 4px 14px rgba(0, 0, 0, 0.45);
  transition:
    border-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
}

.footer-rose-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.42) 0%, rgba(0, 0, 0, 0.58) 100%);
  pointer-events: none;
}

.footer-rose-btn .footer-rose-btn__inner {
  position: relative;
  z-index: 1;
  display: block;
}

.footer-rose-btn:hover,
.footer-rose-btn:focus-visible {
  border-color: rgba(232, 213, 168, 0.88);
  color: #fffdf8;
  outline: none;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.1),
    0 0 0 2px rgba(212, 175, 55, 0.35),
    0 4px 16px rgba(0, 0, 0, 0.5);
}

/* 세 번째 버튼: 공식 사이트(다음 시리즈 안내 문구 유지) — 링크이므로 동일 호버 */
.footer-rose-btn--series::before {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0.6) 100%);
}

/* 장미 아래: 노란색 상점·블로그(한 줄) */
.footer .footer-promo-links {
  margin: 0 0 0.45rem 0;
}
.footer .footer-highlight {
  font-size: 0.9rem;
  font-weight: 700;
  color: #ffd700;
  text-decoration: none;
}
.footer .footer-highlight:hover,
.footer .footer-highlight:focus {
  color: #ffe44d;
  text-decoration: underline;
}
.footer-sep--promo {
  margin: 0 0.5rem;
  color: rgba(255, 215, 0, 0.55);
}

/* 약관·개인정보: 밝은 회색 링크 */
.footer .footer-legal-links {
  margin: 0 0 0.75rem 0;
  font-size: 0.75rem;
}
.footer .footer-legal-link {
  color: rgba(200, 200, 200, 0.88);
  text-decoration: none;
  font-weight: normal;
}
.footer .footer-legal-link:hover,
.footer .footer-legal-link:focus {
  color: rgba(230, 230, 230, 0.95);
  text-decoration: underline;
}
.footer-sep--legal {
  margin: 0 0.5rem;
  color: rgba(180, 180, 180, 0.65);
}

/* 사업자 정보 줄: 연한 회색 */
.footer .footer-company-line {
  color: rgba(200, 198, 198, 0.82);
  font-size: 0.75rem;
}

.footer .footer-contact-link {
  color: rgba(200, 198, 198, 0.95);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.footer .footer-contact-link:hover,
.footer .footer-contact-link:focus {
  color: #ffd700;
}

@media (max-width: 480px) {
  .footer {
    padding: 1.25rem 1rem 1.5rem;
    display: block !important;
    visibility: visible !important;
  }
  .footer-inner {
    padding: 0 0.25rem;
  }
  .footer-inner .footer-line:not(.footer-rose-buttons),
  .footer-inner .footer-legal-links {
    display: block !important;
    visibility: visible !important;
  }
  .footer-inner .footer-rose-buttons {
    display: grid !important;
    visibility: visible !important;
  }
  .footer-inner .footer-legal-links {
    display: flex !important;
  }
  .footer-line,
  .footer .footer-company-line {
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: keep-all;
    padding: 0 0.15rem;
  }
  .footer .legal-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem;
  }
}

.footer-links {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 0.8rem;
}

.footer-link {
  font-size: 0.75rem;
  color: rgba(201, 168, 168, 0.85);
  text-decoration: none;
}

.footer-link:hover {
  color: var(--accent, #c94b78);
  text-decoration: underline;
}

.footer-link-sep {
  margin: 0 0.5rem;
  color: rgba(201, 168, 168, 0.5);
  font-size: 0.7rem;
}

/* 레거시 .footer-sep (구분자 공통) */
.footer-sep {
  margin: 0 0.5rem;
}

/* 좁은 화면: safe-area·줄바꿈 */
@media (max-width: 768px) {
  .footer-inner .footer-rose-buttons {
    order: 0 !important;
    margin-bottom: 0.5rem;
  }
  .footer-inner .footer-promo-links {
    order: 1 !important;
    margin-bottom: 0.4rem;
  }
  .footer-inner .footer-legal-links {
    order: 2 !important;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
  }

  .footer {
    padding: 1.25rem 1rem max(1.5rem, env(safe-area-inset-bottom, 0px));
    text-align: center;
    overflow: visible;
    min-height: 0;
    display: block !important;
    visibility: visible !important;
  }
  .footer .footer-inner {
    padding: 0 0.25rem;
    max-width: 100%;
    overflow: visible;
  }
  .footer .footer-inner .footer-line:not(.footer-rose-buttons),
  .footer .footer-inner .footer-legal-links {
    display: block !important;
    visibility: visible !important;
  }
  .footer .footer-inner .footer-rose-buttons {
    display: grid !important;
    visibility: visible !important;
  }
  .footer .footer-inner .footer-legal-links {
    display: flex !important;
  }
  .footer .footer-line,
  .footer .legal-links {
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: keep-all;
    line-height: 1.6;
  }
}

/* m/index (body.m-mobile) */
.m-mobile .footer {
  padding: 1.25rem 1rem 1.5rem;
  text-align: center;
}
.m-mobile .footer .footer-inner {
  padding: 0 0.25rem;
  max-width: 100%;
}
.m-mobile .footer .footer-line,
.m-mobile .footer .legal-links {
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: keep-all;
  line-height: 1.6;
}
