/*
Theme Name: Mevelly
Theme URI: https://blog.mevelly.com/
Author: Mevelly
Description: 생활정보 콘텐츠를 명료하고 친근하게 전달하는 Mevelly 전용 블록 테마입니다.
Requires at least: 6.6
Requires PHP: 7.4
Version: 1.2.18
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: mevelly
*/

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-wrap: break-word;
  text-rendering: optimizeLegibility;
  word-break: keep-all;
}

img {
  height: auto;
  max-width: 100%;
}

a {
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--wp--preset--color--mevelly-blue);
}

strong,
b {
  font-weight: 600;
}

:where(a, button, input, textarea, select, summary):focus-visible {
  border-radius: 4px;
  outline: 3px solid var(--wp--preset--color--mevelly-blue);
  outline-offset: 3px;
}

.mevelly-visually-hidden {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.mevelly-site-header-shell {
  background: color-mix(in srgb, #fff 94%, transparent);
  border-bottom: 1px solid var(--wp--preset--color--border);
  padding-block: 14px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.admin-bar .mevelly-site-header-shell {
  top: 32px;
}

.mevelly-site-header {
  min-height: 48px;
}

.mevelly-site-title {
  font-size: 1.08rem;
  font-weight: 780;
  letter-spacing: -0.025em;
  margin: 0;
}

.mevelly-site-title a {
  align-items: center;
  display: inline-flex;
  gap: 10px;
}

.mevelly-site-title a::before {
  background: url("assets/images/mevelly-mark.svg") center / contain no-repeat;
  content: "";
  display: block;
  flex: 0 0 36px;
  height: 36px;
  width: 36px;
}

.mevelly-primary-navigation {
  font-size: 0.94rem;
  font-weight: 600;
}

.mevelly-primary-navigation .wp-block-navigation-item__content {
  align-items: center;
  display: inline-flex;
  min-height: 44px;
  min-width: 44px;
  padding-block: 10px;
}

.mevelly-primary-navigation .wp-block-navigation__responsive-container-open,
.mevelly-primary-navigation .wp-block-navigation__responsive-container-close {
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
}

@media (min-width: 782px) {
  .mevelly-primary-navigation .wp-block-navigation__responsive-container-open {
    display: none;
  }
}

.mevelly-primary-navigation .wp-block-search__button {
  background: var(--wp--preset--color--surface);
  color: var(--wp--preset--color--ink);
}

.mevelly-header-search .wp-block-search__inside-wrapper {
  gap: 8px;
}

.mevelly-header-search .wp-block-search__input {
  border-color: var(--wp--preset--color--border);
  border-radius: 12px;
  min-height: 44px;
}

.mevelly-header-search .wp-block-search__button {
  border: 0;
  border-radius: 12px;
  min-height: 44px;
  min-width: 44px;
  padding: 10px;
}

.mevelly-main {
  min-height: 60vh;
}

.mevelly-home-intro {
  align-items: center;
  display: grid;
  gap: clamp(30px, 6vw, 72px);
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  padding-block: clamp(64px, 11vw, 128px) clamp(42px, 8vw, 84px);
}

.mevelly-home-intro__copy {
  margin: 0;
  max-width: 680px;
}

.mevelly-home-eyebrow,
.mevelly-section-label,
.mevelly-post-kicker {
  color: var(--wp--preset--color--mevelly-blue-text);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin-block: 0 14px;
}

.mevelly-home-title {
  font-size: clamp(2.5rem, 4.5vw, 4rem);
  font-weight: 780;
  letter-spacing: -0.055em;
  line-height: 1.08;
  margin-block: 0;
  max-width: 850px;
}

.mevelly-home-description {
  color: var(--wp--preset--color--muted);
  font-size: clamp(1.05rem, 1rem + 0.35vw, 1.3rem);
  line-height: 1.75;
  margin-block: 24px 0;
  max-width: 620px;
}

.mevelly-home-actions {
  margin-block-start: 30px;
}

.mevelly-home-cta .wp-block-button__link {
  align-items: center;
  box-shadow: 0 8px 20px color-mix(in srgb, #2f6fed 14%, transparent);
  display: inline-flex;
  height: 52px;
  min-height: 52px;
  padding-block: 0;
  padding-inline: 22px;
  transition:
    background-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.mevelly-home-cta .wp-block-button__link:hover {
  background: var(--wp--preset--color--mevelly-blue-text);
  box-shadow: 0 10px 24px color-mix(in srgb, #2f6fed 18%, transparent);
  color: var(--wp--preset--color--white);
  transform: translateY(-1px);
}

.mevelly-home-cta .wp-block-button__link:active {
  box-shadow: 0 4px 12px color-mix(in srgb, #2f6fed 12%, transparent);
  transform: translateY(1px);
}

.mevelly-home-cta .wp-block-button__link::after {
  content: "→";
  font-size: 1.1em;
  margin-left: 9px;
}

.mevelly-home-visual {
  aspect-ratio: 1080 / 608;
  min-width: 0;
  width: 100%;
}

.mevelly-home-visual img {
  display: block;
  height: auto;
  width: 100%;
}

.mevelly-home-section {
  padding-block: clamp(44px, 8vw, 88px);
}

.mevelly-section-heading {
  font-size: clamp(1.7rem, 1.4rem + 1.2vw, 2.45rem);
  font-weight: 700;
  margin-block: 0 clamp(24px, 5vw, 42px);
}

#mevelly-latest-posts {
  scroll-margin-top: 96px;
}

.mevelly-hero-query .wp-block-post-template,
.mevelly-card-query .wp-block-post-template {
  margin: 0;
  padding: 0;
}

.mevelly-post-card {
  background: #fff;
  border: 1px solid var(--wp--preset--color--border);
  border-radius: 24px;
  height: 100%;
  overflow: hidden;
}

.mevelly-post-card__media {
  background: var(--wp--preset--color--mevelly-blue-soft);
  min-height: 0;
  overflow: hidden;
}

.mevelly-post-card__media .wp-block-post-featured-image,
.mevelly-post-card__media .wp-block-post-featured-image a,
.mevelly-post-card__media .mevelly-card-picture,
.mevelly-post-card__media .wp-block-post-featured-image img {
  height: auto;
  margin: 0;
  width: 100%;
}

.mevelly-card-picture {
  display: block;
}

.mevelly-post-card__media .wp-block-post-featured-image a {
  display: block;
}

.mevelly-post-card__media .wp-block-post-featured-image img {
  display: block;
  object-fit: contain !important;
}

.mevelly-post-card__body {
  margin-block-start: 0 !important;
  padding: clamp(20px, 3vw, 28px);
}

/* 이미지가 없는 글에도 빈 높이와 배경을 남기지 않습니다. */
.mevelly-post-card:not(:has(.mevelly-post-card__media img))
  .mevelly-post-card__media {
  display: none;
}

.mevelly-hero-card:not(:has(.mevelly-post-card__media img)) {
  grid-template-columns: minmax(0, 1fr);
  min-height: 0;
}

.mevelly-article {
  font-size: 18px;
  line-height: 1.8;
}

.mevelly-article h2 {
  font-size: 30px;
  line-height: 1.4;
}

.mevelly-article h3 {
  font-size: 23px;
  line-height: 1.4;
}

.mevelly-single-title,
.mevelly-post-card__title {
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.mevelly-article .mevelly-table th,
.mevelly-article .mevelly-table td {
  font-size: 16px;
  line-height: 1.7;
  border: 1px solid var(--wp--preset--color--border);
  text-align: left;
}

.mevelly-article .mevelly-table th {
  background: var(--wp--preset--color--mevelly-blue-soft);
  color: var(--wp--preset--color--ink);
}

.mevelly-article .mevelly-table--compact table {
  table-layout: fixed;
}

.mevelly-article .mevelly-table--compact th,
.mevelly-article .mevelly-table--compact td {
  padding: 12px;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.mevelly-post-card__category {
  color: var(--wp--preset--color--mevelly-blue-text);
  font-size: 0.82rem;
  font-weight: 700;
  margin: 0;
}

.mevelly-post-card__category a {
  color: inherit;
}

.mevelly-post-card__title {
  font-size: clamp(1.15rem, 1.05rem + 0.35vw, 1.45rem);
  font-weight: 700;
  margin-block: 10px 0;
}

.mevelly-post-card__title a:hover {
  text-decoration: underline;
}

.mevelly-post-card__excerpt {
  color: var(--wp--preset--color--muted-strong);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-block: 12px 0;
}

.mevelly-post-card__date {
  color: #56616f;
  font-size: 0.82rem;
  margin-block: 18px 0;
}

.mevelly-hero-card {
  align-items: stretch;
  background: var(--wp--preset--color--mevelly-blue-soft);
  border: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.9fr);
  min-height: 460px;
}

.mevelly-hero-card .mevelly-post-card__body {
  align-self: center;
  display: grid;
  gap: 12px 16px;
  grid-template-columns: minmax(0, 1fr) auto;
  min-width: 0;
  padding: clamp(30px, 6vw, 68px);
  width: 100%;
}

.mevelly-hero-card .mevelly-post-card__body > *,
.mevelly-hero-card .wp-block-post-excerpt > p {
  margin: 0 !important;
}

.mevelly-hero-card .mevelly-post-card__category,
.mevelly-hero-card .mevelly-post-card__title,
.mevelly-hero-card .wp-block-post-excerpt__excerpt {
  grid-column: 1 / -1;
}

.mevelly-hero-card .mevelly-post-card__excerpt {
  display: contents;
}

.mevelly-hero-card .wp-block-post-excerpt__more-link {
  align-items: center;
  display: inline-flex;
  min-height: 44px;
  color: var(--wp--preset--color--mevelly-blue-text);
  font-weight: 600;
}

.mevelly-hero-card .mevelly-post-card__date {
  align-self: center;
  justify-self: end;
}

.mevelly-hero-card .mevelly-post-card__media {
  align-self: center;
  margin-block-start: 0 !important;
  max-width: none;
  min-height: 0;
  min-width: 0;
  order: 2;
  width: 100%;
}

.mevelly-hero-card .mevelly-post-card__title {
  font-size: clamp(1.8rem, 1.35rem + 1.8vw, 3rem);
  font-weight: 780;
  line-height: 1.22;
}

.mevelly-empty-hero {
  background: var(--wp--preset--color--surface);
  border-radius: 24px;
  padding: clamp(28px, 6vw, 64px);
}

.mevelly-empty-hero > * {
  max-width: 640px;
}

.mevelly-archive-header,
.mevelly-page-header,
.mevelly-search-header,
.mevelly-single-header {
  padding-block: clamp(68px, 11vw, 124px) clamp(34px, 7vw, 72px);
}

.mevelly-archive-title,
.mevelly-page-title,
.mevelly-search-title,
.mevelly-single-title {
  font-size: clamp(2.125rem, 1.8rem + 1.8vw, 3.25rem);
  font-weight: 780;
  margin-block: 0;
  max-width: 920px;
}

.mevelly-topics ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 24px 0;
  padding: 0;
}

.mevelly-topics a {
  align-items: center;
  background: var(--wp--preset--color--surface);
  border: 1px solid var(--wp--preset--color--border);
  border-radius: 999px;
  color: var(--wp--preset--color--ink);
  display: inline-flex;
  font-size: 0.94rem;
  font-weight: 600;
  min-height: 44px;
  padding: 8px 18px;
  text-decoration: none;
}

.mevelly-topics a:hover,
.mevelly-topics a[aria-current="page"] {
  background: var(--wp--preset--color--mevelly-blue-soft);
  border-color: var(--wp--preset--color--mevelly-blue-text);
  color: var(--wp--preset--color--mevelly-blue-text);
}

.mevelly-archive-description {
  color: var(--wp--preset--color--muted);
  line-height: 1.8;
  max-width: 720px;
}

.mevelly-archive-header {
  padding-block: clamp(48px, 7vw, 80px) 32px;
}

.mevelly-single-meta {
  align-items: center;
  color: var(--wp--preset--color--muted);
  font-size: 0.9rem;
  gap: 8px 12px;
  margin-block: 24px 0;
}

.mevelly-single-meta > * {
  margin-block: 0;
}

.mevelly-single-meta > *:not(:last-child)::after {
  color: var(--wp--preset--color--border);
  content: "·";
  margin-left: 12px;
}

.mevelly-single-meta a {
  color: var(--wp--preset--color--mevelly-blue-text);
  font-weight: 700;
}

.mevelly-single-featured-image {
  background: var(--wp--preset--color--surface);
  border-radius: 28px;
  margin-block: 0 clamp(46px, 8vw, 88px);
  overflow: hidden;
}

.mevelly-single-featured-image img {
  aspect-ratio: auto !important;
  display: block;
  height: auto !important;
  object-fit: contain;
  width: 100%;
}

.mevelly-single-layout {
  align-items: start;
  display: grid;
  gap: clamp(42px, 7vw, 80px);
  grid-template-columns: minmax(0, 720px) minmax(190px, 240px);
  justify-content: center;
}

.mevelly-single-content {
  margin: 0;
  min-width: 0;
}

.mevelly-toc {
  align-self: start;
  border-left: 1px solid var(--wp--preset--color--border);
  color: var(--wp--preset--color--muted);
  font-size: 0.86rem;
  padding-left: 20px;
  position: sticky;
  top: 104px;
}

.admin-bar .mevelly-toc {
  top: 136px;
}

.mevelly-toc__title {
  color: var(--wp--preset--color--ink);
  font-weight: 700;
  margin-block: 0 12px;
}

.mevelly-toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mevelly-toc li + li {
  margin-top: 9px;
}

.mevelly-toc__level-h3 {
  padding-left: 12px;
}

.mevelly-toc a {
  color: inherit;
  display: block;
  line-height: 1.45;
}

.mevelly-toc a:hover {
  color: var(--wp--preset--color--mevelly-blue);
}

.mevelly-page-content {
  padding-bottom: clamp(72px, 12vw, 140px);
}

.mevelly-page-content > .mevelly-article,
.mevelly-page-content > * {
  max-width: 820px;
}

.mevelly-page-content .mevelly-article {
  line-height: 1.85;
}

.mevelly-page-content .mevelly-article > .wp-block-heading {
  margin-block-start: clamp(3.4rem, 8vw, 5rem);
}

.mevelly-archive-grid,
.mevelly-search-grid {
  padding-bottom: clamp(72px, 12vw, 140px);
}

.mevelly-pagination {
  border-top: 1px solid var(--wp--preset--color--border);
  margin-top: 48px;
  padding-top: 24px;
}

.mevelly-no-results,
.mevelly-404 {
  background: var(--wp--preset--color--surface);
  border-radius: 28px;
  margin-block: clamp(64px, 12vw, 130px);
  padding: clamp(34px, 7vw, 74px);
}

.mevelly-no-results > *,
.mevelly-404 > * {
  max-width: 640px;
}

.mevelly-404__code {
  color: var(--wp--preset--color--mevelly-blue);
  font-size: 0.92rem;
  font-weight: 700;
  margin: 0;
}

.mevelly-related {
  border-top: 1px solid var(--wp--preset--color--border);
  margin-top: clamp(68px, 11vw, 120px);
  padding-block: clamp(48px, 8vw, 88px);
}

/* WordPress의 600px 단일 열 규칙보다 추천 영역의 열 배치를 우선합니다. */
.mevelly-related-query
  .mevelly-related-posts.wp-block-post-template.is-layout-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 600px) {
  .mevelly-related-query
    .mevelly-related-posts.wp-block-post-template.is-layout-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .mevelly-related-query
    .mevelly-related-posts.wp-block-post-template.is-layout-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.mevelly-404 h1 {
  font-weight: 780;
}

.mevelly-site-footer {
  background: var(--wp--preset--color--surface);
  color: var(--wp--preset--color--muted-strong);
  font-size: 0.88rem;
  margin-top: clamp(64px, 10vw, 112px);
  padding-block: clamp(42px, 8vw, 76px);
}

.mevelly-footer-title {
  color: var(--wp--preset--color--ink);
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
}

.mevelly-footer-copy {
  margin-block: 8px 0;
  max-width: 560px;
}

.mevelly-footer-links {
  gap: 10px 24px;
}

.mevelly-footer-links a {
  color: inherit;
}

.mevelly-footer-bottom {
  border-top: 1px solid var(--wp--preset--color--border);
  margin-top: 30px;
  padding-top: 24px;
}

@media (max-width: 960px) {
  .mevelly-home-intro {
    gap: 28px;
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  }

  .mevelly-single-layout {
    display: block;
  }

  .mevelly-toc {
    display: none;
  }
}

@media (max-width: 781px) {
  .admin-bar .mevelly-site-header-shell {
    top: 46px;
  }

  .mevelly-site-header-shell {
    padding-block: 9px;
  }

  .mevelly-primary-navigation
    .wp-block-navigation__responsive-container:not(.is-menu-open) {
    display: none;
  }

  .mevelly-primary-navigation .wp-block-navigation__responsive-container-open,
  .mevelly-primary-navigation
    .wp-block-navigation__responsive-container.is-menu-open
    .wp-block-navigation__responsive-container-close {
    display: inline-flex;
  }

  .mevelly-primary-navigation
    .wp-block-navigation__responsive-container.is-menu-open {
    display: flex;
    padding: 24px;
  }

  .mevelly-primary-navigation
    .wp-block-navigation__responsive-container.is-menu-open
    .wp-block-navigation-item__content {
    width: 100%;
  }

  .mevelly-home-intro {
    display: flex;
    flex-direction: column;
    gap: 34px;
    padding-block: 54px 42px;
  }

  .mevelly-home-intro__copy,
  .mevelly-home-visual {
    width: 100%;
  }

  .mevelly-home-visual {
    max-width: 560px;
    order: 2;
  }

  .mevelly-hero-card {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .mevelly-hero-card .mevelly-post-card__media {
    min-height: 0;
    order: 0;
  }

  .mevelly-hero-card .mevelly-post-card__body {
    padding: 26px;
  }

  .mevelly-post-card {
    border-radius: 20px;
  }

  .mevelly-latest-query .wp-block-post-template {
    gap: 0;
    grid-template-columns: minmax(0, 1fr);
  }

  .mevelly-latest-query .mevelly-post-card {
    --mevelly-thumbnail-size: 112px;
    align-items: center;
    border: 0;
    border-bottom: 1px solid var(--wp--preset--color--border);
    border-radius: 0;
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(0, 1fr) var(--mevelly-thumbnail-size);
    height: auto;
    padding-block: 12px;
  }

  .mevelly-latest-query .mevelly-post-card__body {
    grid-column: 1;
    grid-row: 1;
    padding: 0;
    margin: 0 !important;
    min-width: 0;
    width: 100%;
  }

  .mevelly-latest-query
    .mevelly-post-card:not(:has(.mevelly-post-card__media img)) {
    grid-template-columns: minmax(0, 1fr);
  }

  .mevelly-article h2 {
    font-size: 28px;
  }

  .mevelly-latest-query .mevelly-post-card__media {
    aspect-ratio: 1;
    border-radius: 10px;
    grid-column: 2;
    grid-row: 1;
    height: var(--mevelly-thumbnail-size);
    min-height: 0;
    width: var(--mevelly-thumbnail-size);
  }

  .mevelly-latest-query .mevelly-post-card__media img {
    aspect-ratio: 1 !important;
    object-fit: cover !important;
    object-position: center;
  }

  .mevelly-latest-query .mevelly-post-card__media .wp-block-post-featured-image,
  .mevelly-latest-query
    .mevelly-post-card__media
    .wp-block-post-featured-image
    a,
  .mevelly-latest-query .mevelly-post-card__media .mevelly-card-picture,
  .mevelly-latest-query .mevelly-post-card__media img {
    height: 100%;
  }

  .mevelly-latest-query .mevelly-post-card__title {
    font-size: 1.05rem;
    line-height: 1.4;
    margin-block-start: 6px;
  }

  .mevelly-latest-query .mevelly-post-card__excerpt {
    display: none;
  }

  .mevelly-latest-query .mevelly-post-card__date {
    margin-block-start: 8px;
  }

  .mevelly-single-featured-image {
    border-radius: 20px;
  }

  .mevelly-home-title {
    font-size: clamp(2.35rem, 11.75vw, 2.75rem);
  }

  .mevelly-archive-title,
  .mevelly-page-title,
  .mevelly-search-title,
  .mevelly-single-title {
    font-size: clamp(2rem, 9vw, 2.125rem);
  }

  .mevelly-footer-layout {
    align-items: flex-start !important;
    flex-direction: column;
  }
}

@media (max-width: 420px) {
  .mevelly-site-title a::before {
    flex-basis: 32px;
    height: 32px;
    width: 32px;
  }

  .mevelly-site-title {
    font-size: 1rem;
  }
}

@media (max-width: 359px) {
  .mevelly-latest-query .mevelly-post-card {
    --mevelly-thumbnail-size: 96px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .mevelly-site-header-shell,
  .mevelly-site-footer,
  .mevelly-toc,
  .mevelly-related {
    display: none;
  }

  body {
    color: #000;
  }
}
