:root {
  --bg-top: #fef5e8;
  --bg-bottom: #e6f2f0;
  --ink: #1f2a2a;
  --muted: #5e6a6b;
  --card: #fffcf7;
  --accent: #0f766e;
  --accent-strong: #0a5b56;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /*font-family: 'Space Grotesk', 'Noto Sans KR', 'Pretendard', sans-serif;*/
  color: var(--ink);
  /*background: radial-gradient(circle at 20% 10%, #ffd8a8 0%, transparent 45%),
    linear-gradient(160deg, var(--bg-top), var(--bg-bottom));*/

    /*지애 수정*/
    background:#000000;
    font-family: "pretendard", sans-serif;
    font-weight: 400;
    font-style: normal;
}

.page {
  /*max-width: 820px;*/
  margin: 0 auto;
  padding: 48px 20px 64px;
}


.card {
  /*background: var(--card);
  border: 1px solid #d8e1dc;*/
  border-radius: 20px;
  padding: 28px;
  margin-top:7vh;
  /*box-shadow: 0 20px 50px rgba(15, 118, 110, 0.08);*/

  /*지애 수정*/
  text-align:center;


}
.card_letter{
  background-image:url(./assets/DabdaPostOffice_02.jpg);
  background-size: max(1300px, 100%);
  background-position: center top;
  background-repeat: no-repeat;
  margin-top: -7vh!important;
  padding: 50px;
  border-radius: 0;
}

  .card p, h1{
    font-family: "forevs", sans-serif;
    font-weight: 200;
    font-style: normal;
    letter-spacing: -0.5px;
    color:#e2dcc4;
  }
  .card p.subtitle{
    font-size:32pt;
    line-height:10pt;
  }
  .card h1{
    font-size:55pt;
    line-height:60pt;
    font-weight: 300;
    letter-spacing: -0.1px;
  }
   .card h2{
    color:#e2dcc4;
    font-weight: 100;
    font-size: 22px;
  }

  .card .house{
    margin-top:10vh;
    max-width:150px;
  }
  .card .postbox{
    margin-top:7vh;
    max-width:230px;
  }


  .card .house_text{
    margin:3vh 0;
  }

  .card label {color:#e2dcc4;}
  .card_letter label {color:#000000;}

  .card #entryForm, #letterVisibility{
    max-width:300px;
    margin: 0 auto;
  }

  .compose-meta-field,
  .compose-meta-field input,
  #letterVisibility {
    width: min(100%, 300px);
    margin-left: auto;
    margin-right: auto;
  }

  .compose-meta-field {
    display: grid;
    gap: 6px;
  }

  .card #composeForm button{
    margin: 0 auto;
    min-width:300px;
  }


  .card input{
    color:#e2dcc4;
    height:30px;
    background:none;
    border-radius: 0;
    border:none;
    border-bottom:1px dashed #e2dcc4;
  }
  .card_letter input{
    color:#000000;
    height:30px;
    background:none;
    border-radius: 0;
    border:none;
    border-bottom:1px solid #000000;
  }
  
  .card button.enter_btn{
      color:#000000;
      background:#e2dcc4;
      border-radius: 0;
      height:30px;
      line-height:10px;
  }
  .card button.enter_btn:hover{
      background:#ffbefe;
  }

  

.eyebrow {
  margin: 0;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  color: var(--muted);
}

h1,
h2,
h3 {
  margin: 12px 0 16px;
  line-height: 1.25;
}

.stack {
  display: grid;
  gap: 10px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

label {
  font-size: 0.92rem;
  color: var(--muted);
}

input,
textarea,
select,
button {
  font: inherit;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #b8c8c2;
  /*border-radius: 12px;
  padding: 10px 12px;*/
  padding: 5px 12px;
  background: #fff;
}

button {
  border: 0;
  border-radius: 12px;
  padding: 10px 16px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

button:hover {
  background: var(--accent-strong);
}

button.ghost {
  background: #edf5f3;
  color: var(--ink);
  border-radius: 0;
  height: 30px;
  line-height: 10px;
}

.mailbox-list,
.comment-list {
  list-style: none;
  padding: 0;
  margin: 16px auto;
  display: grid;
  gap: 10px;
  color: #2b2419;
}

.comment_Area{
    width: min(100%, 560px);
    margin: auto;
  }

#commentContent{
  background:none;
  border-color:#000000;
}

.letter-button {
  width: 100%;
  text-align: left;
  background: #eef8f6;
  color: var(--ink);
}

.letter-button span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.error {
  color: var(--danger);
  margin-top: 12px;
}

.success {
  /*color: var(--accent);*/
  color:#ffbefe;
  margin-top: 12px;
}

.muted {
  color: #ffbefe;
  margin-top: 10px;
}

.card .compose-loading {
  color: #ffbefe;
}

.letter-content {
  white-space: pre-wrap;
  background: #fffdf4;
  border-radius: 12px;
  padding: 12px;
}

.letter-paper-stage {
  width: min(100%, 560px);
  /*margin: 0 auto 8px;*/
  margin: 10% auto 8px;
  /*border-radius: 18px;
  background: #fffefb;
  border: 1px solid #dfe8e3;*/
  padding: 16px 16px 14px;
  overflow: hidden;
  /*box-shadow: 0 10px 30px rgba(31, 42, 42, 0.12);*/
  --text-size: 1.02rem;
  --line-step: 1.9rem;
  --guide-line-color: rgba(86, 95, 92, 0.4);
  --from-image-width: clamp(58px, 16vw, 84px);
}

.compose-paper-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.compose-dear-image {
  display: block;
  width: clamp(140px, 42vw, 220px);
  max-width: 100%;
  height: auto;
}

.compose-from-group {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 0;
  margin-top: 44px;
  margin-left: auto;
  flex: 0 0 auto;
  width: clamp(104px, 36%, 202px);
  min-width: 0;
}

.compose-from-image {
  display: block;
  width: var(--from-image-width);
  flex: 0 0 auto;
  height: auto;
}

.compose-author-input,
.letter-paper-content {
  border: 1px solid transparent;
  background-color: transparent;
  box-shadow: none;
  color: #2b2419;
  /*font-family: 'Noto Serif KR', 'Nanum Myeongjo', 'Apple SD Gothic Neo', serif;
  font-weight: 500;*/
  font-family: "pretendard", sans-serif;
  font-weight: 400;
  font-style: normal;
  text-align:left;
}

.compose-author-input {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  max-width: calc(100% - var(--from-image-width));
  border-radius: 0;
  border-bottom-color: var(--guide-line-color);
  padding: 2px 2px 1px;
  font-size: 0.95rem;
  line-height: 1.1;
}

.letter-paper-content {
  width: 100%;
  min-height: clamp(340px, 50vh, 490px);
  border-radius: 12px;
  /*border: 1px solid #eef2ef;*/
  padding: 3px 2px 0;
  resize: none;
  font-size: var(--text-size);
  line-height: var(--line-step);
  letter-spacing: 0.002em;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0 calc(var(--line-step) - 2px),
    var(--guide-line-color) calc(var(--line-step) - 2px) calc(var(--line-step) - 1px),
    transparent calc(var(--line-step) - 1px) var(--line-step)
  );
  background-size: 100% var(--line-step);
}

.compose-author-input:focus,
.letter-paper-content:focus {
  outline: 2px solid rgba(15, 118, 110, 0.4);
  border-radius: 8px;
}

.compose-author-readonly {
  flex: 1 1 auto;
  min-width: 0;
  max-width: calc(100% - var(--from-image-width));
  padding: 0 2px 1px;
  border-bottom: 1px solid var(--guide-line-color);
  font-family: 'Noto Serif KR', 'Nanum Myeongjo', 'Apple SD Gothic Neo', serif;
  font-size: 0.95rem;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.letter-read-stage .compose-from-group {
  position: absolute;
  top: 44px;
  right: 0;
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  max-width: none;
  margin-top: 0;
  margin-left: 0;
  justify-content: flex-end;
}

.letter-read-stage .compose-author-readonly {
  display: block;
  flex: 0 0 auto;
  min-width: 0;
  max-width: none;
  text-align: right;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: normal;
  word-break: keep-all;
  line-height: 1.2;
}

.letter-read-stage .compose-paper-header {
  position: relative;
  min-height: 112px;
}

.letter-paper-content-readonly {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.mailbox-list {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.mailbox-post-button {
  position: relative;
  width: 100%;
  max-width:350px;
  aspect-ratio: 1 / 1;
  /*border: 1px solid #dce7e2;
  border-radius: 16px;*/
  background:none;
  padding: 0;
  overflow: hidden;
}

.mailbox-post-button:hover {
  transform: translateY(-1px);
  background:none;
}

.mailbox-post-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 52%;
}

.mailbox-post-from {
  position: absolute;
  left: 50%;
  top: 64%;
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0;
  max-width: 36%;
  transform: translate(-50%, -50%);
}

.mailbox-post-author {
  display: inline-block;
  border-bottom: 0;
  padding-bottom: 0;
  font-size: 0.8rem;
  line-height: 1;
  /*color: rgba(49, 55, 53, 0.9);*/
  color:#e2dcc4;
  transform: translateY(-10px);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 640px) {
  .page {
    padding: 24px 14px 32px;
  }

  .card {
    padding: 20px;
  }


  .letter-paper-stage {
    border-radius: 14px;
    padding: 15% 12px 12px;
    --text-size: 0.98rem;
    --line-step: 1.82rem;
    --from-image-width: clamp(50px, 17vw, 74px);
  }

  .compose-dear-image {
    width: clamp(120px, 46vw, 190px);
  }

  .compose-author-input {
    max-width: calc(100% - var(--from-image-width));
  }

  .compose-paper .compose-author-input {
    margin-left: -2px;
    margin-right: 2px;
    max-width: none;
  }

  .compose-paper .compose-from-group {
    width: calc(clamp(104px, 36%, 202px) + 8px);
    transform: translateX(-8px);
  }

  .mailbox-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .letter-paper-stage {
    --text-size: 1rem;
    --line-step: 1.86rem;
    
  }
}

@media (max-width: 375px) {
  .letter-paper-stage {
    --text-size: 0.95rem;
    --line-step: 1.76rem;
    padding-top: 25%;
  }
  .card_letter{
        margin-top: -14vh !important;
  }
}

@media (min-width: 376px) and (max-width: 400px) {
  .letter-paper-stage {
    --text-size: 0.97rem;
    --line-step: 1.8rem;
    padding-top: 20%;
  }
}

@media (min-width: 401px) and (max-width: 430px) {
  .letter-paper-stage {
    --text-size: 0.99rem;
    --line-step: 1.84rem;
    padding-top: 20%;
  }
}
/*지애 반응형 추가*/
@media (max-width: 768px) {

  .card{
    margin-top:6vh;

  }
  .card p.subtitle{
    font-size:22pt;
    line-height:10pt;
  }
  .card h1{
    font-size:35pt;
    line-height:20pt;
  }
  .card .house{
    margin-top:10vh;
    max-width:100px;
  }

  .letter-paper-stage {
  margin: 15% auto 8px;

}
}
