/* ======================================================
   [연남랩 >> 매거진 검색 / 카드 스타일]

   기능:
   - 검색 결과 페이지 상단 검색폼
   - 검색 결과 헤더
   - 매거진 카드 그리드
   - 페이지네이션

   출력 개수:
   - PC: PHP에서 16개
   - 모바일: PHP에서 8개

   레이아웃:
   - PC: 4열
   - 태블릿: 2열
   - 모바일: 2열
====================================================== */


/* =========================
   Search Page
========================= */

.yn-magazine-search-page {
  --yn-magazine-primary: var(--e-global-color-primary, #222);
  width: 100%;
  background: #fff;
}

.yn-magazine-search-result-wrap {
  width: 100%;
  margin: 0 auto;
  padding: 80px 50px;
  box-sizing: border-box;
}


/* =========================
   Search Form
   결과 페이지 상단 검색 인풋
========================= */

.yn-magazine-search-top {
  width: 100%;
  margin-bottom: 56px;
}

.yn-magazine-search-form {
  width: 100%;
  margin: 0;
  padding: 0;
}

.yn-magazine-search-form-inner {
  display: flex;
  align-items: center;
      width: 500px;
      margin: 0 auto;
  gap: 16px;
  border-bottom: 2px solid var(--yn-magazine-primary);
  box-sizing: border-box;
}

.yn-magazine-search-form input[type="search"] {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  height: 50px;

  margin: 0;
  padding: 0;

  border: 0;
  border-radius: 0;
  outline: 0;
  box-shadow: none;

  background: transparent;
  color: var(--yn-magazine-primary);

  font-family: "Libre Baskerville", serif;
  font-size: 25px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0;

  -webkit-appearance: none;
  appearance: none;
}

.yn-magazine-search-form input[type="search"]::placeholder {
  color: #5b6169;
  opacity: 1;
}

.yn-magazine-search-form input[type="search"]:focus {
  border: 0;
  outline: 0;
  box-shadow: none;
}

.yn-magazine-search-form input[type="search"]::-webkit-search-decoration,
.yn-magazine-search-form input[type="search"]::-webkit-search-cancel-button,
.yn-magazine-search-form input[type="search"]::-webkit-search-results-button,
.yn-magazine-search-form input[type="search"]::-webkit-search-results-decoration {
  -webkit-appearance: none;
  appearance: none;
}

.yn-magazine-search-form button {
  flex: 0 0 auto;

  width: 22.5px;
  height: 72px;

  margin: 0;
  padding: 0;

  border: 0;
  border-radius: 0;
  outline: 0;
  box-shadow: none;

  background: transparent;
  color: var(--yn-magazine-primary);
  cursor: pointer;

  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.yn-magazine-search-form button:hover,
.yn-magazine-search-form button:focus,
.yn-magazine-search-form button:active {
  background: transparent;
  color: var(--yn-magazine-primary);
  border: 0;
  outline: 0;
  box-shadow: none;
}

.yn-magazine-search-form button svg {
  width: 54px;
  height: 54px;
  display: block;
}


/* =========================
   Search Result Header
========================= */

.yn-magazine-search-result-header {
  margin-bottom: 50px;
}



.yn-magazine-search-result-title {
  margin: 0;
  padding: 0;

  font-family: "Playfair Display", serif;
  font-size: 56px;
  font-weight: 400;
  line-height: 1.1;

  color: var(--yn-magazine-primary);
}


/* =========================
   Grid
========================= */

.yn-magazine-grid {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;

  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: 30px;
  row-gap: 30px;
}

/* =========================
   Card
========================= */

.yn-magazine-card {
  width: 100%;
  padding: 0;
  margin: 0;

  border: none;
  box-sizing: border-box;
  background: #fff;
}

.yn-magazine-link {
  display: block;
  width: 100%;
  height: 100%;

  color: inherit;
  text-decoration: none !important;
}

.yn-magazine-link:hover,
.yn-magazine-link:focus,
.yn-magazine-link:active {
  color: inherit;
  text-decoration: none !important;
}


/* =========================
   Thumbnail
========================= */

.yn-magazine-thumb {
  width: 100%;
  aspect-ratio: 385.5 / 410;

  margin: 0 0 30px 0;
  overflow: hidden;

  background: #f5f5f5;
  border: none;
  box-sizing: border-box;
}

.yn-magazine-thumb img {
  width: 100%;
  height: 100%;

  display: block;
  object-fit: cover;
}

.yn-magazine-thumb-empty {
  width: 100%;
  height: 100%;

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

  background: #f5f5f5;
  color: #999;

  font-family: "Pretendard", sans-serif;
  font-size: 14px;
  line-height: 1.4;
}


/* =========================
   Content
========================= */

.yn-magazine-content {
  width: 100%;
  height: 92px;

  padding: 0;
  margin: 0;
  box-sizing: border-box;

  display: flex;
  flex-direction: column;
  gap: 15px;
}

.yn-magazine-category,
.yn-magazine-title,
.yn-magazine-date {
  margin: 0 !important;
  padding: 0;
  box-sizing: border-box;
}


/* Category */

.yn-magazine-category {
  height: 20px;

  font-family: "Playfair Display", serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 20px;

  color: #222;
  letter-spacing: 0;
  text-transform: uppercase;

  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}


/* Title */

.yn-magazine-title {
  height: 24px;

  font-family: "Pretendard", sans-serif;
  font-size: 20px;
  font-weight: 500;
  line-height: 24px;

  color: #222;
  letter-spacing: 0;
  word-break: keep-all;

  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}


/* Date */

.yn-magazine-date {
  height: 18px;

  font-family: "Inter", "Pretendard", sans-serif;
  font-size: 15px;
  font-weight: 500;
  line-height: 18px;

  color: #999;
  letter-spacing: 0;

  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}


/* =========================
   Pagination
========================= */

.yn-magazine-pagination {
  display: flex;
  justify-content: center;
  align-items: center;

  gap: 18px;
  margin-top: 80px;
}

.yn-page-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.yn-page-item a,
.yn-page-item span {
  color: #999;
  text-decoration: none !important;

  font-family: "Playfair Display", serif;
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
}

.yn-page-item .current {
  color: #222;
}


/* =========================
   Empty
========================= */

.yn-magazine-empty {
  margin: 0;
  padding: 40px 0;

  color: #999;

  font-family: "Pretendard", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}


/* =========================
   Tablet
========================= */

@media (max-width: 1024px) {
  .yn-magazine-search-result-wrap {
    padding: 60px 20px;
  }

  .yn-magazine-search-top {
    margin-bottom: 44px;
  }

  .yn-magazine-search-result-header {
    margin-bottom: 44px;
  }

  .yn-magazine-search-result-title {
    font-size: 42px;
  }

  .yn-magazine-search-form input[type="search"] {
    height: 88px;
    font-size: 23px;
  }

  .yn-magazine-search-form button {
    width: 66px;
    height: 66px;
  }

  .yn-magazine-search-form button svg {
    width: 48px;
    height: 48px;
  }

  .yn-magazine-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 20px;
    row-gap: 50px;
  }
}


/* =========================
   Mobile
   요구사항:
   - 모바일 총 8개 출력은 PHP에서 처리
   - 화면은 2열 x 4줄 기준
========================= */

@media (max-width: 767px) {
  .yn-magazine-search-result-wrap {
    padding: 40px 16px;
  }

  .yn-magazine-search-top {
    margin-bottom: 32px;
  }

  .yn-magazine-search-result-header {
    margin-bottom: 32px;
  }


  .yn-magazine-search-result-title {
    font-size: 32px;
  }

  .yn-magazine-search-form-inner {
    gap: 10px;
    border-bottom-width: 2px;
  }

  .yn-magazine-search-form input[type="search"] {
    height: 72px;
    font-size: 18px;
  }

  .yn-magazine-search-form button {
    width: 56px;
    height: 56px;
  }

  .yn-magazine-search-form button svg {
    width: 40px;
    height: 40px;
  }

  .yn-magazine-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 12px;
    row-gap: 34px;
  }

  .yn-magazine-thumb {
    margin-bottom: 16px;
  }

  .yn-magazine-content {
    height: auto;
    gap: 8px;
  }

  .yn-magazine-category {
    height: 18px;

    font-size: 12px;
    line-height: 18px;
  }

  .yn-magazine-title {
    height: 40px;

    font-size: 15px;
    line-height: 20px;

    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .yn-magazine-date {
    height: 17px;

    font-size: 12px;
    line-height: 17px;
  }

  .yn-magazine-pagination {
    margin-top: 50px;
    gap: 14px;
  }

  .yn-page-item a,
  .yn-page-item span {
    font-size: 16px;
  }
}