/* ========================================
   LOCAL FONTS
======================================== */

@font-face {
  font-family: "Cardo";
  src: url("fonts/Cardo-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Cardo";
  src: url("fonts/Cardo-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}


/* ========================================
   BASIC RESET
======================================== */

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  background: #ffffff;
  color: #181818;
  font-family: "Cardo", Georgia, serif;
  font-size: 16px;
}

button,
a {
  color: inherit;
  font: inherit;
}

button {
  border: 0;
}


/* ========================================
   PAGE
======================================== */

.topic-page {
  position: relative;
  min-height: 100vh;
  background: #ffffff;
}


/* ========================================
   TOP HEADER
======================================== */

.topic-header {
  position: sticky;
  z-index: 20;
  top: 0;

  display: flex;
  align-items: center;
  justify-content: space-between;

  min-height: 42px;
  padding: 8px 22px;

  border-bottom: 1px solid #9b9b95;
  background: #eef0e8;
}

.back-link {
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
}

.breadcrumb {
  margin: 0;
  font-size: 13px;
  text-transform: uppercase;
}


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

.topic-layout {
  display: grid;
  grid-template-columns:
    minmax(280px, 0.8fr)
    minmax(520px, 1.6fr);

  gap: clamp(40px, 6vw, 110px);

  width: 100%;
  padding:
    clamp(46px, 6vw, 90px)
    clamp(28px, 5vw, 80px)
    70px;
}


/* 세로 구분선 없음 */
.topic-introduction {
  min-width: 0;
  padding: 0;
  border-right: 0;
}

.topic-eyebrow {
  margin: 0 0 18px;
  color: #666660;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.topic-title {
  max-width: 500px;
  margin: 0 0 38px;

  font-size: clamp(40px, 4.5vw, 70px);
  font-weight: 400;
  line-height: 0.96;
}

.topic-description {
  max-width: 470px;
  font-size: 18px;
  line-height: 1.35;
}

.topic-description p {
  margin: 0 0 24px;
}


/* ========================================
   WRITING LIST
======================================== */

.writing-section {
  min-width: 0;
}

.writing-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.writing-heading h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.writing-heading p {
  margin: 0;
  color: #666660;
  font-size: 13px;
}

.writing-list {
  display: grid;
  gap: 16px;
}


/* ========================================
   WRITING CARD
======================================== */

.writing-card {
  display: grid;
  grid-template-columns:
    minmax(170px, 30%)
    minmax(0, 1fr);

  width: 100%;
  min-height: 170px;
  padding: 0;

  overflow: hidden;
  border: 1px solid #8d8d87;
  background: #ffffff;

  text-align: left;
  cursor: pointer;
}

.writing-card.image-right {
  grid-template-columns:
    minmax(0, 1fr)
    minmax(170px, 30%);
}

.writing-card.image-right .writing-thumbnail {
  grid-column: 2;
  grid-row: 1;
}

.writing-card.image-right .writing-information {
  grid-column: 1;
  grid-row: 1;
}

.writing-card:hover {
  background: #f4f4ef;
}

.writing-card:focus-visible {
  outline: 2px solid #181818;
  outline-offset: 3px;
}

.writing-thumbnail {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 170px;
  object-fit: cover;
}

.writing-information {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px 30px;
}

.writing-meta {
  margin-bottom: 18px;
  color: #666660;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.writing-title {
  display: block;
  margin-bottom: 12px;
  font-size: clamp(25px, 2.3vw, 38px);
  font-weight: 400;
  line-height: 1;
}

.writing-summary {
  display: block;
  max-width: 570px;
  font-size: 16px;
  line-height: 1.25;
}

.empty-message {
  margin: 0;
  padding: 30px 0;
  border-top: 1px solid #aaa;
}


/* ========================================
   ARTICLE DRAWER
======================================== */

.article-drawer {
  position: fixed;
  z-index: 50;

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

  width: min(64vw, 1050px);

  overflow-y: auto;
  overscroll-behavior: contain;

  background: #eef0e8;

  transform: translateX(100%);
  transition: transform 450ms ease;

  scrollbar-width: none;
}

.article-drawer::-webkit-scrollbar {
  display: none;
}

.article-drawer.is-open {
  transform: translateX(0);
}

.drawer-header {
  position: sticky;
  z-index: 2;
  top: 0;

  display: flex;
  align-items: center;
  justify-content: space-between;

  min-height: 42px;
  padding: 8px 22px;

  border-bottom: 1px solid #9b9b95;
  background: #eef0e8;
}

.drawer-header p {
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
}

.drawer-close {
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.drawer-close:hover {
  text-decoration: underline;
}


/* ========================================
   SIMPLE ARTICLE CONTENT
======================================== */

.drawer-content {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding:
    clamp(28px, 4vw, 48px)
    clamp(26px, 5vw, 64px)
    55px;
}

.drawer-article-title {
  margin: 0 0 28px;
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 700;
  line-height: 1.1;
}

.article-heading {
  margin: 28px 0 12px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
}

.article-paragraph {
  margin: 0 0 18px;
  font-size: 17px;
  line-height: 1.48;
}

.article-figure {
  width: 100%;
  margin: 75px 0;
}

.article-figure img {
  display: block;
  width: 100%;
  height: auto;
}

.article-figure figcaption {
  margin-top: 8px;
  color: #666660;
  font-size: 13px;
  line-height: 1.3;
}


/* ========================================
   OVERLAY
======================================== */

.drawer-overlay {
  position: fixed;
  z-index: 40;
  inset: 0;

  visibility: hidden;
  background: rgba(0, 0, 0, 0.08);
  opacity: 0;

  transition:
    opacity 300ms ease,
    visibility 300ms ease;
}

.drawer-overlay.is-visible {
  visibility: visible;
  opacity: 1;
}


/* ========================================
   TABLET
======================================== */

@media (max-width: 900px) {
  .topic-layout {
    grid-template-columns: 1fr;
    gap: 45px;
  }

  .topic-description {
    max-width: 650px;
  }

  .article-drawer {
    width: 78vw;
  }
}


/* ========================================
   MOBILE
======================================== */

@media (max-width: 650px) {
  .topic-header {
    padding: 8px 15px;
  }

  .breadcrumb {
    max-width: 65%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .topic-layout {
    padding: 34px 18px 50px;
  }

  .topic-title {
    margin-bottom: 28px;
    font-size: 42px;
  }

  .writing-card,
  .writing-card.image-right {
    grid-template-columns: 1fr;
  }

  .writing-card.image-right .writing-thumbnail,
  .writing-card.image-right .writing-information {
    grid-column: auto;
    grid-row: auto;
  }

  .writing-thumbnail {
    height: 190px;
    min-height: 0;
  }

  .writing-information {
    padding: 22px;
  }

  .article-drawer {
    width: 100%;
  }

  .drawer-content {
    padding: 28px 20px 45px;
  }

  .article-figure {
    margin: 50px 0;
  }
}