/*
Theme Name: Monghaerok
Theme URI: https://monghaerok.com
Author: Monghaerok
Description: 몽해록 전용 경량 블록 테마. 메인 꿈 검색, 12개 꿈 카테고리 탐색, 꿈 해석과 문화 전문영역, 긴 꿈해몽 글의 가독성을 중심으로 설계되었습니다.
Version: 1.11.0
Requires at least: 6.6
Requires PHP: 7.4
Text Domain: monghaerok
*/

/* v1.6: keep Monghaerok in its intended light appearance even when the device uses dark mode. */
:root,
html {
  color-scheme: only light !important;
  background: #F7F4ED !important;
}

body,
.wp-site-blocks {
  background-color: #F7F4ED !important;
  color: #20263B !important;
}

/* Explicit form colors help mobile browsers avoid automatic dark recoloring. */
input,
textarea,
select {
  color-scheme: only light !important;
}

html {
  scroll-behavior: smooth;
}

body {
  word-break: keep-all;
}

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

.mh-hero {
  position: relative;
  overflow: hidden;
}

.mh-hero::before,
.mh-hero::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.mh-hero::before {
  width: 260px;
  height: 260px;
  right: -110px;
  top: -120px;
  background: rgba(126, 112, 191, .10);
}

.mh-hero::after {
  width: 190px;
  height: 190px;
  left: -90px;
  bottom: -100px;
  background: rgba(45, 59, 93, .06);
}

.mh-category-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.mh-category-card {
  display: block;
  padding: 20px 18px;
  min-height: 96px;
  border: 1px solid #e7e3dc;
  border-radius: 16px;
  background: #fff;
  color: #20263b;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(36, 43, 68, .04);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.mh-category-card:hover,
.mh-category-card:focus-visible {
  transform: translateY(-2px);
  border-color: #b8afd9;
  box-shadow: 0 10px 26px rgba(36, 43, 68, .08);
}

.mh-category-card strong {
  display: block;
  font-size: 1.02rem;
  margin-bottom: 6px;
}

.mh-category-card span {
  display: block;
  color: #6a7080;
  font-size: .88rem;
  line-height: 1.5;
}

.mh-section-kicker {
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: .76rem;
  font-weight: 700;
  color: #756aa7;
}

.mh-reading-note {
  border-left: 4px solid #8c80bd;
  background: #f7f4ed;
  padding: 16px 18px;
  border-radius: 10px;
}

.mh-culture-panel {
  border: 1px solid #ddd7ee;
  border-radius: 18px;
  background: linear-gradient(180deg, #fbfaff 0%, #f3effb 100%);
  padding: 32px;
}

.mh-culture-panel p:last-child {
  margin-bottom: 0;
}

.mh-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.wp-block-post-content {
  line-height: 1.85;
}

.wp-block-post-content p {
  margin-top: 0;
  margin-bottom: 1.25em;
}

.wp-block-post-content h2 {
  margin-top: 2.25em;
  margin-bottom: .75em;
}

.wp-block-post-content h3 {
  margin-top: 1.8em;
  margin-bottom: .65em;
}

.wp-block-post-content ul,
.wp-block-post-content ol {
  padding-left: 1.35em;
}

.wp-block-search__inside-wrapper {
  border-radius: 14px;
  overflow: hidden;
}

.wp-block-search__input {
  min-height: 54px;
}

.wp-block-search__button {
  min-height: 54px;
  padding-left: 22px;
  padding-right: 22px;
}

.wp-block-navigation .wp-block-navigation-item__content {
  text-decoration: none;
}

@media (max-width: 900px) {
  .mh-category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .mh-category-grid {
    grid-template-columns: 1fr;
  }

  .mh-category-card {
    min-height: auto;
  }

  .wp-block-post-title {
    font-size: clamp(2rem, 9vw, 2.7rem) !important;
  }
}


.mh-hero-subtitle {
  text-align: center;
  color: #6a7080;
  font-size: clamp(1.25rem, 2.6vw, 1.8rem);
  line-height: 1.75;
  margin: 0;
}

.mh-hero-search {
  max-width: 760px;
  margin: 28px auto 0;
}

.mh-hero-search form {
  display: flex;
  width: 100%;
  gap: 8px;
}

.mh-hero-search input[type="search"] {
  flex: 1;
  min-width: 0;
  min-height: 58px;
  padding: 0 18px;
  border: 1px solid #d8d4cc;
  border-radius: 14px;
  background: #fff;
  color: #20263b;
  font: inherit;
}

.mh-hero-search button {
  min-height: 58px;
  padding: 0 26px;
  border: 0;
  border-radius: 14px;
  background: #20263b;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 560px) {
  .mh-hero-subtitle br {
    display: none;
  }

  .mh-hero-search form {
    gap: 6px;
  }

  .mh-hero-search button {
    padding-left: 18px;
    padding-right: 18px;
  }
}


/* v1.5: single-post featured image — preserve original aspect ratio */
.single .wp-block-post-featured-image {
  margin-top: 0;
  margin-bottom: 0;
}

.single .wp-block-post-featured-image img {
  display: block;
  width: 100%;
  height: auto;
}


/* v1.7: stronger light-mode lock for mobile browsers that auto-darken pages. */
html,
body,
.wp-site-blocks {
  color-scheme: light !important;
  background-color: #F7F4ED !important;
  background-image: linear-gradient(#F7F4ED, #F7F4ED) !important;
  color: #20263B !important;
}

header > .wp-block-group,
footer > .wp-block-group,
.has-paper-background-color {
  background-color: #FFFFFF !important;
  background-image: linear-gradient(#FFFFFF, #FFFFFF) !important;
}

.has-ivory-background-color {
  background-color: #F7F4ED !important;
  background-image: linear-gradient(#F7F4ED, #F7F4ED) !important;
}

.has-mist-background-color {
  background-color: #EEEAF7 !important;
  background-image: linear-gradient(#EEEAF7, #EEEAF7) !important;
}

.mh-category-card {
  background-color: #FFFFFF !important;
  background-image: linear-gradient(#FFFFFF, #FFFFFF) !important;
}

.mh-culture-panel {
  background-color: #F3EFFB !important;
  background-image: linear-gradient(180deg, #FBFAFF 0%, #F3EFFB 100%) !important;
}

.mh-reading-note {
  background-color: #F7F4ED !important;
  background-image: linear-gradient(#F7F4ED, #F7F4ED) !important;
}

input,
textarea,
select,
button {
  color-scheme: light !important;
}

.mh-hero-search input[type="search"] {
  background-color: #FFFFFF !important;
  background-image: linear-gradient(#FFFFFF, #FFFFFF) !important;
  color: #20263B !important;
  -webkit-text-fill-color: #20263B !important;
}

.mh-hero-search button {
  background-color: #20263B !important;
  background-image: linear-gradient(#20263B, #20263B) !important;
  color: #FFFFFF !important;
  -webkit-text-fill-color: #FFFFFF !important;
}

@media (prefers-color-scheme: dark) {
  :root,
  html,
  body,
  .wp-site-blocks,
  main {
    color-scheme: light !important;
    background-color: #F7F4ED !important;
    background-image: linear-gradient(#F7F4ED, #F7F4ED) !important;
    color: #20263B !important;
  }

  header > .wp-block-group,
  footer > .wp-block-group,
  .has-paper-background-color,
  .mh-category-card {
    background-color: #FFFFFF !important;
    background-image: linear-gradient(#FFFFFF, #FFFFFF) !important;
    color: #20263B !important;
  }

  .has-ivory-background-color,
  .mh-reading-note {
    background-color: #F7F4ED !important;
    background-image: linear-gradient(#F7F4ED, #F7F4ED) !important;
    color: #20263B !important;
  }

  .has-mist-background-color {
    background-color: #EEEAF7 !important;
    background-image: linear-gradient(#EEEAF7, #EEEAF7) !important;
    color: #20263B !important;
  }

  h1, h2, h3, h4, h5, h6,
  p, li, .wp-block-site-title, .wp-block-post-title,
  .wp-block-navigation-item__content {
    color: #20263B !important;
  }

  a {
    color: #514879 !important;
  }

  .has-muted-color,
  .mh-category-card span,
  .mh-hero-subtitle {
    color: #6A7080 !important;
  }

  .mh-section-kicker,
  .has-violet-color {
    color: #756AA7 !important;
  }
}

/* v1.8: clickable header brand image */
.mh-logo-home-link {
	display: inline-flex;
	align-items: center;
	text-decoration: none;
	cursor: pointer;
}
.mh-logo-home-link img {
	display: block;
}


.mh-footer-brand {
  margin-bottom: 10px;
  margin-left: -34px;
}

.mh-footer-brand a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.mh-footer-brand img {
  display: block;
  max-width: min(188px, 56vw);
  height: auto;
}

.mh-scroll-top {
  position: fixed;
  right: 20px;
  bottom: 24px;
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 999px;
  background: #20263B;
  color: #FFFFFF;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 12px 28px rgba(32, 38, 59, .22);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
  z-index: 9999;
}

.mh-scroll-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.mh-scroll-top:hover,
.mh-scroll-top:focus-visible {
  background: #514879;
}

@media (max-width: 782px) {
  .mh-scroll-top {
    right: 16px;
    bottom: 18px;
    width: 48px;
    height: 48px;
  }
}
