/* =========================================================
   BASE.CSS
   모바일 청첩장 전체 공통 레이아웃 / 컬러 / 타이포 / UI
========================================================= */


/* =========================================================
   1. Global Design Variables
========================================================= */

:root {

  /* =====================================================
   COLOR SYSTEM
   Yellow Main + Sky Blue Sub
===================================================== */

/* 청첩장 바깥 배경 */
--color-page: #f3f5f6;

/* 청첩장 기본 종이 배경 */
--color-paper: #fbfaf7;

/* 기본 글씨 */
--color-ink: #2d3140;

/* 연한 글씨 */
--color-muted: #8b8f96;

/* 메인 포인트 = 노랑 */
--color-accent: #e3c44f;

/* 서브 포인트 = 블루 */
--color-accent-blue: #9fbfdf;

/* 구분선 / 테두리 */
--color-line: #e3e2dc;


/* =====================================================
   SECTION BACKGROUND
===================================================== */

/* 기본 section */
--color-section-default: #fbfaf7;

/* 따뜻한 노랑빛 section */
--color-section-warm: #fbf7e8;

/* 연한 블루/아이보리 tint */
--color-section-tint: #f4f7f9;

/* 어두운 section */
--color-section-dark: #303744;

/* 어두운 section 글씨 */
--color-section-dark-text: #fbfaf7;


/* =====================================================
   OPTIONAL SOFT COLORS
===================================================== */

--color-yellow-soft: #f3e5a8;
--color-yellow-pale: #fdf8e6;

--color-blue-soft: #edf4f9;
--color-blue-pale: #f5f8fa;


  /* =====================================================
     LAYOUT
  ===================================================== */

  /* 모바일 청첩장 전체 최대 폭 */
  --invitation-width: 440px;

  /* 공통 좌우 여백 */
  --page-padding: clamp(24px, 7vw, 32px);

  /* 각 section 위아래 기본 여백 */
  --section-padding-y: clamp(72px, 18vw, 96px);


  /* =====================================================
     LETTER SPACING
  ===================================================== */

  --tracking-tight: -0.02em;
  --tracking-normal: 0;
  --tracking-wide: 0.025em;
  --tracking-wider: 0.05em;
  --tracking-widest: 0.1em;


  /* =====================================================
     MOTION
  ===================================================== */

  --motion-fast: 150ms;
  --motion-normal: 300ms;
  --motion-slow: 500ms;

  --ease-standard:
    cubic-bezier(0.4, 0, 0.2, 1);

  --ease-soft:
    cubic-bezier(0.22, 1, 0.36, 1);
}

/* =========================================================
   Intro Scroll Lock
========================================================= */

html.is-intro-locked,
body.is-intro-locked {
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}


/* =========================================================
   2. Reset
========================================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}


html {
  background: var(--color-page);

  scroll-behavior: smooth;

  -webkit-text-size-adjust: 100%;
}


body {
  margin: 0;

  background: var(--color-page);

  color: var(--color-ink);

  font-family: var(--font-body);
  font-weight: 300;

  line-height: 1.5;

  word-break: keep-all;

  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}


button,
input {
  font: inherit;
}


button,
a {
  -webkit-tap-highlight-color: transparent;
}


a {
  color: inherit;

  text-decoration: none;
}


button {
  border: 0;

  cursor: pointer;
}


/* =========================================================
   3. Main Layout
========================================================= */

.site-shell {
  min-height: 100vh;
}


/*
  모바일 청첩장 본체
*/
.invitation {
  width:
    min(
      100%,
      var(--invitation-width)
    );

  min-height: 100vh;

  margin: 0 auto;

  overflow: hidden;

  background:
    var(--color-paper);

  box-shadow:
    0 10px 30px
    rgba(0, 0, 0, 0.05);
}


/* =========================================================
   4. Section Layout
========================================================= */

.section-frame {
  position: relative;

  padding:
    var(--section-padding-y)
    var(--page-padding);

  overflow: hidden;

  /*
    별도 색상 class가 없는 section의 기본 배경
  */
  background:
    var(--color-section-default);
}


/* 연한 핑크 section */
.section-frame--warm {
  background:
    var(--color-section-warm);
}


/* 연한 아이보리 / 틴트 section */
.section-frame--tint {
  background:
    var(--color-section-tint);
}


/* 어두운 section */
.section-frame--dark {
  background:
    var(--color-section-dark);

  color:
    var(--color-section-dark-text);
}


/* =========================================================
   5. Section Heading
========================================================= */

.section-heading {
  margin-bottom:
    clamp(28px, 7vw, 34px);

  text-align: center;
}


.section-heading--left {
  text-align: left;
}


/*
  WEDDING DAY
  GALLERY
  LOCATION
  등 영문 제목
*/
.eyebrow {
  margin: 0;

  font-family:
    "Sometimestimes",
    serif;

  font-size:
    clamp(24px, 7vw, 28px);

  font-weight: 600;

  font-style: normal;

  line-height: 1;

  letter-spacing: 0.08em;

  color:
    var(--color-accent);

  padding-bottom: 10%;
}


/*
  한글 섹션 제목
*/
.section-title {
  margin: 0;

  font-family:
    "SUIT-Light",
    sans-serif;

  font-size:
    clamp(18px, 4vw, 20px);

  font-weight: 300;

  line-height: 1.6;

  letter-spacing:
    var(--tracking-tight);
}


/*
  제목 아래 설명
  영어 날짜
  부가 문구
*/
.section-lead {
  margin: 4px 0 0;

  font-family:
    "SUIT-ExtraLight",
    sans-serif;

  color:
    var(--color-ink);

  font-size:
    clamp(17px, 3.7vw, 19px);

  font-weight: 200;

  line-height: 1.7;

  letter-spacing: -0.01em;
}


/* =========================================================
   6. Common Buttons
========================================================= */

.outline-button,
.solid-button {
  display: inline-flex;

  min-height: 42px;

  align-items: center;
  justify-content: center;

  padding: 0 18px;

  border-radius: 999px;

  font-size: 16px;
  font-weight: 300;

  letter-spacing:
    var(--tracking-wider);

  transition:
    transform
    var(--motion-fast)
    var(--ease-standard),

    opacity
    var(--motion-fast)
    var(--ease-standard),

    background-color
    var(--motion-fast)
    var(--ease-standard),

    color
    var(--motion-fast)
    var(--ease-standard),

    border-color
    var(--motion-fast)
    var(--ease-standard),

    box-shadow
    var(--motion-fast)
    var(--ease-standard);
}


.outline-button {
  border:
    1px solid
    var(--color-line);

  color:
    var(--color-ink);

  background:
    transparent;
}


.solid-button {
  background:
    var(--color-ink);

  color:
    var(--color-paper);
}


/* 마우스를 사용하는 환경에서만 hover */
@media (hover: hover) {

  .outline-button:hover,
  .solid-button:hover {
    transform:
      translateY(-2px);
  }

}


/* 모바일 클릭 효과 */
.outline-button:active,
.solid-button:active {
  transform:
    translateY(1px)
    scale(0.99);
}


/* =========================================================
   7. Signature
========================================================= */

.signature {
  margin:
    60px 0 0;

  color:
    var(--color-accent);

  font-family:
    var(--font-intro-script);

  font-size: 26px;

  line-height: 1.2;
}




/* =========================================================
   8. Hidden Elements
========================================================= */

.gallery-modal[hidden],
.settings-panel[hidden],
.music-toggle[hidden] {
  display: none;
}


body.modal-open {
  overflow: hidden;
}


/* =========================================================
   9. Gallery Modal
========================================================= */


img,
[role="img"],
.soft-oval,
.about-card__photo,
.gallery-item,
.photo-moment__image {
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: pan-y;
}


.gallery-modal {
  position: fixed;

  z-index: 100;

  inset: 0;

  display: grid;

  place-items: center;

  padding: 24px;

  background:
    rgba(30, 21, 20, 0.9);
}


.gallery-modal img {
  max-width:
    min(
      100%,
      var(--invitation-width)
    );

  max-height: 82vh;

  object-fit: contain;

  border-radius: 8px;
}


.gallery-modal__close {
  position: absolute;

  top: 18px;
  right: 22px;

  color: #ffffff;

  background: transparent;

  font-size: 34px;
  font-weight: 200;

  line-height: 1;
}


.gallery-modal p {
  position: absolute;

  right: 0;
  bottom: 20px;
  left: 0;

  margin: 0;

  color: #ffffff;

  text-align: center;

  font-size: 11px;

  letter-spacing:
    var(--tracking-widest);
}


/* =========================================================
   10. Settings Panel
========================================================= */

.settings-panel {
  position: fixed;

  z-index: 120;

  top: 0;
  right: 0;
  bottom: 0;

  width:
    min(
      360px,
      92vw
    );

  padding: 24px;

  overflow-y: auto;

  background:
    var(--color-paper);

  box-shadow:
    -12px 0 40px
    rgba(45, 31, 30, 0.16);
}


.settings-panel__head {
  display: flex;

  align-items: flex-start;
  justify-content: space-between;

  gap: 20px;
}


.settings-panel__head h2 {
  margin: 0;

  font-family:
    var(--font-section-title);

  font-size: 30px;
  font-weight: 400;

  line-height: 1.2;
}


.settings-panel__head > button {
  color:
    var(--color-ink);

  background:
    transparent;

  font-size: 28px;

  line-height: 1;
}


.settings-panel__guide,
.settings-panel__note {
  color:
    var(--color-muted);

  font-size: 12px;

  line-height: 1.8;
}


.settings-panel code {
  padding: 2px 4px;

  border-radius: 4px;

  background:
    rgba(201, 136, 142, 0.14);

  color:
    var(--color-ink);

  font-size: 11px;
}


/* =========================================================
   11. Settings Form
========================================================= */

.settings-form {
  display: grid;

  gap: 14px;

  margin-top: 22px;
}


.settings-form label {
  display: grid;

  gap: 6px;

  color:
    var(--color-muted);

  font-size: 11px;
}


.settings-form input[type="text"] {
  width: 100%;
  height: 38px;

  padding: 0 12px;

  border:
    1px solid
    var(--color-line);

  border-radius: 8px;

  outline: 0;

  background:
    rgba(255, 255, 255, 0.6);

  color:
    var(--color-ink);

  font-size: 13px;

  transition:
    border-color
    var(--motion-fast)
    var(--ease-standard),

    box-shadow
    var(--motion-fast)
    var(--ease-standard);
}


.settings-form input[type="text"]:focus {
  border-color:
    var(--color-accent);
}


.settings-form input[type="color"] {
  width: 100%;
  height: 38px;

  padding: 4px;

  border:
    1px solid
    var(--color-line);

  border-radius: 8px;

  background:
    transparent;
}


.settings-check {
  display: flex !important;

  align-items: center;

  gap: 9px !important;

  color:
    var(--color-ink) !important;
}


.settings-check input {
  accent-color:
    var(--color-accent);
}


.settings-panel__actions {
  display: grid;

  grid-template-columns:
    1fr 1fr;

  gap: 8px;

  margin-top: 24px;
}


/* =========================================================
   12. Part Load Error
========================================================= */

.part-load-error {
  padding:
    48px 24px;

  color:
    #9d5757;

  background:
    #fff4f1;

  font-size: 12px;

  line-height: 1.8;

  text-align: center;
}


/* =========================================================
   13. Accessibility
========================================================= */

@media (prefers-reduced-motion: reduce) {

  html {
    scroll-behavior: auto;
  }


  .outline-button,
  .solid-button {
    transition: none;
  }

}