/*
Theme Name: 프레스런 테마
Theme URI: https://presslearn.co.kr
Author: 로알남
Author URI: https://presslearn.co.kr
Description: 애드센스 블로그에 최적화된 쉬운 한국형 워드프레스 테마. 설정 페이지 하나로 디자인이 끝납니다.
Version: 1.3.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: roal
*/

:root {
  --roal-main: #0F6E56;
  --roal-main-dark: #085041;
  --roal-light: #E1F5EE;
  --roal-thumb-text: #9FE1CB;
  --roal-radius: 12px;
  --roal-font-base: 17px;
  --roal-line: 1.8;
  --roal-bg: #ffffff;
  --roal-bg-soft: #f7f7f5;
  --roal-text: #1c1c1a;
  --roal-text-sub: #6b6b66;
  --roal-border: #e6e6e2;
  --roal-max: 760px;
}
html[data-roal-theme="dark"] {
  --roal-bg: #17171a;
  --roal-bg-soft: #202024;
  --roal-text: #ececea;
  --roal-text-sub: #a0a09b;
  --roal-border: #34343a;
}
body.roal-corner-square { --roal-radius: 0px; }
body.roal-corner-soft { --roal-radius: 6px; }
body.roal-corner-xround { --roal-radius: 22px; }
body.roal-font-small { --roal-font-base: 15px; }
body.roal-font-big { --roal-font-base: 19px; }
body.roal-font-xl { --roal-font-base: 21px; }
body.roal-linehgt-wide { --roal-line: 2.0; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Helvetica Neue', 'Segoe UI', 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  font-size: var(--roal-font-base);
  line-height: var(--roal-line);
  color: var(--roal-text);
  background: var(--roal-bg);
  word-break: keep-all;
  overflow-wrap: break-word;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
.roal-wrap { max-width: var(--roal-max); margin: 0 auto; padding: 0 20px; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Header ---------- */
.roal-header { border-bottom: 1px solid var(--roal-border); background: var(--roal-bg); }
.roal-header.is-sticky { position: sticky; top: 0; z-index: 50; }
.roal-header-inner { display: flex; align-items: center; gap: 12px; padding: 18px 0; }
.roal-header-center .roal-header-inner { justify-content: center; position: relative; }
.roal-header-center .roal-header-tools { position: absolute; right: 0; }
.roal-header-right .roal-brand { order: 2; margin-left: auto; }
.roal-header-right .roal-header-tools { order: 1; margin-left: 0; }
.roal-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.roal-logo-img { height: 34px; width: auto; display: block; }
.roal-logo-letter {
  width: 36px; height: 36px; border-radius: 10px; flex: none;
  background: var(--roal-main); color: var(--roal-light);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px;
}
.roal-site-title { font-size: 21px; font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.roal-header-tools { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.roal-icon-btn {
  width: 40px; height: 40px; border: none; background: transparent; cursor: pointer;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: var(--roal-text-sub); font-size: 20px;
}
.roal-icon-btn:hover { background: var(--roal-bg-soft); }
.roal-icon-btn svg { width: 22px; height: 22px; }

/* 카테고리 알약 메뉴 */
.roal-catbar { border-bottom: 1px solid var(--roal-border); background: var(--roal-bg); }
.roal-catbar-inner { display: flex; gap: 8px; padding: 12px 0; overflow-x: auto; scrollbar-width: none; }
.roal-catbar-inner::-webkit-scrollbar { display: none; }
.roal-catbar-center .roal-catbar-inner { justify-content: center; }
.roal-catbar-right .roal-catbar-inner { justify-content: flex-end; }
.roal-pill {
  flex: none; font-size: 15px; padding: 7px 16px; border-radius: 999px;
  border: 1px solid var(--roal-border); color: var(--roal-text-sub); background: var(--roal-bg);
}
.roal-pill:hover { border-color: var(--roal-main); color: var(--roal-main); }
.roal-pill.is-active { background: var(--roal-light); color: var(--roal-main-dark); border-color: var(--roal-light); font-weight: 600; }

/* 소개 배너 */
.roal-tagline { background: var(--roal-light); color: var(--roal-main-dark); text-align: center; padding: 12px 20px; font-size: 16px; }

/* 검색 오버레이 */
.roal-search-panel { display: none; border-bottom: 1px solid var(--roal-border); background: var(--roal-bg-soft); }
.roal-search-panel.is-open { display: block; }
.roal-search-panel form { display: flex; gap: 8px; padding: 16px 0; }
.roal-search-panel input[type="search"] {
  flex: 1; font-size: 17px; padding: 12px 16px; border: 1px solid var(--roal-border);
  border-radius: var(--roal-radius); background: var(--roal-bg); color: var(--roal-text);
}
.roal-search-panel button { flex: none; }

/* ---------- 버튼 공통 ---------- */
.roal-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--roal-main); color: #fff; border: none; cursor: pointer;
  font-size: 16px; font-weight: 600; padding: 12px 22px; border-radius: var(--roal-radius);
  font-family: inherit;
}
.roal-btn:hover { background: var(--roal-main-dark); }
.roal-btn-ghost { background: transparent; color: var(--roal-text-sub); border: 1px solid var(--roal-border); }
.roal-btn-ghost:hover { background: var(--roal-bg-soft); color: var(--roal-text); }

/* ---------- 홈: 글 목록 ---------- */
.roal-main { padding: 8px 0 48px; }
.roal-section-title { font-size: 20px; font-weight: 700; margin: 32px 0 8px; display: flex; align-items: center; gap: 8px; }
.roal-section-title .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--roal-main); display: inline-block; }

.roal-thumb {
  display: flex; align-items: center; justify-content: center; text-align: center;
  background: var(--roal-main-dark); color: var(--roal-thumb-text);
  border-radius: var(--roal-radius); overflow: hidden; flex: none;
  font-weight: 600; line-height: 1.45; padding: 8px;
}
.roal-thumb span { overflow-wrap: anywhere; max-width: 100%; }
.roal-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.roal-thumb.has-img { padding: 0; background: var(--roal-bg-soft); }

/* 리스트형 */
.roal-list .roal-post { display: flex; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--roal-border); }
.roal-list .roal-thumb { width: 130px; height: 92px; font-size: 14px; }
.roal-post-body { min-width: 0; flex: 1; }
.roal-post-title { margin: 0 0 6px; font-size: 1.06em; font-weight: 700; line-height: 1.5; letter-spacing: -0.01em; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.roal-post:hover .roal-post-title { color: var(--roal-main); }
.roal-post-meta { font-size: 14px; color: var(--roal-text-sub); }
.roal-post-excerpt { margin: 6px 0 0; font-size: 15px; color: var(--roal-text-sub); line-height: 1.6; overflow-wrap: anywhere; word-break: break-all; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* 카드형 */
.roal-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; padding: 18px 0; }
.roal-cards .roal-post { border: 1px solid var(--roal-border); border-radius: var(--roal-radius); overflow: hidden; display: flex; flex-direction: column; }
.roal-cards .roal-thumb { width: 100%; height: 150px; border-radius: 0; font-size: 15px; }
.roal-cards .roal-post-body { padding: 14px 16px 16px; }
@media (max-width: 560px) { .roal-cards { grid-template-columns: 1fr; } }

/* 매거진형: 첫 글 크게 */
.roal-magazine .roal-post-hero { display: block; padding: 18px 0; border-bottom: 1px solid var(--roal-border); }
.roal-magazine .roal-post-hero .roal-thumb { width: 100%; height: 260px; font-size: 22px; margin-bottom: 14px; }
.roal-magazine .roal-post-hero .roal-post-title { font-size: 1.35em; }

/* 인기글 */
.roal-popular { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; padding: 10px 0 6px; }
.roal-popular .roal-post { display: flex; gap: 12px; align-items: center; }
.roal-popular .roal-rank { font-size: 22px; font-weight: 800; color: var(--roal-main); width: 26px; flex: none; text-align: center; }
.roal-popular .roal-post { min-width: 0; }
.roal-popular .roal-post-title { font-size: 16px; margin: 0; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 560px) { .roal-popular { grid-template-columns: 1fr; } }

/* 페이지네이션 */
.roal-pagination { margin: 28px 0 0; text-align: center; }
.roal-pagination .nav-links { display: inline-flex; gap: 6px; }
.roal-pagination a, .roal-pagination span {
  min-width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--roal-radius); border: 1px solid var(--roal-border); font-size: 16px; padding: 0 10px;
}
.roal-pagination .current { background: var(--roal-main); border-color: var(--roal-main); color: #fff; font-weight: 700; }

/* ---------- 글 상세 ---------- */
.roal-single-head { padding: 28px 0 8px; }
.roal-single-cat { font-size: 14px; font-weight: 700; color: var(--roal-main); }
.roal-single-title { margin: 8px 0 12px; font-size: 1.65em; font-weight: 800; line-height: 1.4; letter-spacing: -0.02em; }
.roal-single-meta { font-size: 14px; color: var(--roal-text-sub); display: flex; gap: 10px; flex-wrap: wrap; }
.roal-single-thumb { margin: 20px 0; }
.roal-single-thumb img { width: 100%; border-radius: var(--roal-radius); }

/* 목차 */
.roal-toc { background: var(--roal-bg-soft); border: 1px solid var(--roal-border); border-radius: var(--roal-radius); padding: 18px 22px; margin: 24px 0; }
.roal-toc-title { font-weight: 700; font-size: 16px; margin: 0 0 10px; display: flex; align-items: center; gap: 6px; }
.roal-toc ol { margin: 0; padding-left: 20px; font-size: 15px; }
.roal-toc li { margin: 4px 0; }
.roal-toc a { color: var(--roal-text-sub); }
.roal-toc a:hover { color: var(--roal-main); }
.roal-toc ol ol { margin-top: 4px; }

/* 본문 */
.roal-content { padding: 4px 0 8px; }
.roal-content h2 { font-size: 1.35em; margin: 1.8em 0 0.6em; padding-left: 12px; border-left: 4px solid var(--roal-main); line-height: 1.4; }
.roal-content h3 { font-size: 1.15em; margin: 1.5em 0 0.5em; }
.roal-content p { margin: 0 0 1.1em; }
.roal-content img { border-radius: var(--roal-radius); }
.roal-content blockquote { margin: 1.2em 0; padding: 14px 18px; background: var(--roal-light); color: var(--roal-main-dark); border-radius: var(--roal-radius); }
.roal-content blockquote p:last-child { margin: 0; }
.roal-content table { border-collapse: collapse; width: 100%; font-size: 0.94em; margin: 1.2em 0; }
.roal-content th, .roal-content td { border: 1px solid var(--roal-border); padding: 10px 12px; text-align: left; }
.roal-content th { background: var(--roal-bg-soft); }
.roal-content a { color: var(--roal-main); text-decoration: underline; text-underline-offset: 3px; }

/* 공유 */
.roal-share { display: flex; gap: 8px; margin: 28px 0; flex-wrap: wrap; }
.roal-share .roal-btn { font-size: 15px; padding: 10px 18px; }
.roal-share .kakao { background: #FEE500; color: #191919; }
.roal-share .kakao:hover { background: #f2d900; }

/* 작성자 박스 */
.roal-author { display: flex; gap: 14px; align-items: center; border: 1px solid var(--roal-border); border-radius: var(--roal-radius); padding: 18px 20px; margin: 24px 0; }
.roal-author img { border-radius: 50%; width: 56px; height: 56px; flex: none; }
.roal-author-name { font-weight: 700; font-size: 16px; }
.roal-author-desc { font-size: 14px; color: var(--roal-text-sub); margin-top: 2px; }

/* 이전/다음 글 */
.roal-prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 24px 0; }
.roal-prevnext a { border: 1px solid var(--roal-border); border-radius: var(--roal-radius); padding: 14px 16px; display: block; min-width: 0; }
.roal-prevnext a:hover { border-color: var(--roal-main); }
.roal-prevnext .label { font-size: 13px; color: var(--roal-text-sub); display: block; margin-bottom: 4px; }
.roal-prevnext .title { font-size: 15px; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.roal-prevnext .next { text-align: right; }
@media (max-width: 560px) { .roal-prevnext { grid-template-columns: 1fr; } }

/* 관련 글 */
.roal-related { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 10px 0 8px; }
.roal-related .roal-post { display: flex; gap: 12px; min-width: 0; }
.roal-related .roal-post > div { min-width: 0; }
.roal-related .roal-thumb { width: 92px; height: 68px; font-size: 12px; }
.roal-related .roal-post-title { font-size: 15px; margin: 0 0 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 560px) { .roal-related { grid-template-columns: 1fr; } }

/* ---------- 검색 / 아카이브 / 404 ---------- */
.roal-archive-head { padding: 28px 0 4px; }
.roal-archive-label { font-size: 14px; font-weight: 700; color: var(--roal-main); }
.roal-archive-title { margin: 6px 0 4px; font-size: 1.5em; font-weight: 800; }
.roal-archive-desc { color: var(--roal-text-sub); font-size: 15px; margin: 0; }

.roal-empty { text-align: center; padding: 56px 0 24px; }
.roal-empty-icon { font-size: 44px; }
.roal-empty h2 { font-size: 1.3em; margin: 12px 0 6px; }
.roal-empty p { color: var(--roal-text-sub); margin: 0 0 20px; }
.roal-empty form { display: flex; gap: 8px; max-width: 420px; margin: 0 auto; }
.roal-empty input[type="search"] { flex: 1; font-size: 16px; padding: 12px 16px; border: 1px solid var(--roal-border); border-radius: var(--roal-radius); background: var(--roal-bg); color: var(--roal-text); }

/* ---------- 페이지 ---------- */
.roal-page-title { margin: 28px 0 8px; font-size: 1.55em; font-weight: 800; }

/* ---------- 댓글 ---------- */
.roal-comments { margin: 32px 0 0; }
.roal-comments .comment-list { list-style: none; padding: 0; }
.roal-comments .comment { border-top: 1px solid var(--roal-border); padding: 16px 0; }
.roal-comments .comment-meta { font-size: 14px; color: var(--roal-text-sub); }
.roal-comments textarea, .roal-comments input[type="text"], .roal-comments input[type="email"] {
  width: 100%; border: 1px solid var(--roal-border); border-radius: var(--roal-radius);
  padding: 12px 14px; font-family: inherit; font-size: 16px; background: var(--roal-bg); color: var(--roal-text);
}

/* ---------- 푸터 ---------- */
.roal-footer { border-top: 1px solid var(--roal-border); background: var(--roal-bg-soft); margin-top: 40px; }
.roal-footer-inner { padding: 28px 0 36px; text-align: center; font-size: 14px; color: var(--roal-text-sub); }
.roal-footer-menu { display: flex; gap: 16px; justify-content: center; margin-bottom: 12px; flex-wrap: wrap; }
.roal-footer-menu a:hover { color: var(--roal-main); }
.roal-footer-sns { display: flex; gap: 10px; justify-content: center; margin-bottom: 14px; }
.roal-footer-sns a {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--roal-border);
  display: inline-flex; align-items: center; justify-content: center; color: var(--roal-text-sub);
}
.roal-footer-sns a:hover { color: var(--roal-main); border-color: var(--roal-main); }
.roal-footer-biz { font-size: 13px; margin-top: 10px; line-height: 1.7; }

/* 맨 위로 */
.roal-top-btn {
  position: fixed; right: 20px; bottom: 24px; width: 48px; height: 48px; z-index: 60;
  border-radius: 50%; border: 1px solid var(--roal-border); background: var(--roal-bg);
  color: var(--roal-text-sub); cursor: pointer; font-size: 20px;
  display: none; align-items: center; justify-content: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}
.roal-top-btn.is-visible { display: flex; }

/* 읽는 시간 */
.roal-readtime { display: inline-flex; align-items: center; gap: 4px; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
@media (max-width: 560px) {
  .roal-single-title { font-size: 1.45em; }
  .roal-list .roal-thumb { width: 104px; height: 78px; font-size: 12px; }
}

/* =========================================================
   스타일 B: 언론사
   ========================================================= */
.roal-newsbar { border-bottom: 1px solid var(--roal-border); font-size: 13px; color: var(--roal-text-sub); background: var(--roal-bg); }
.roal-newsbar-inner { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; }
.roal-newsbar-desc { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

body.roal-style-b { --roal-radius: 0px; }
.roal-style-b .roal-site-title,
.roal-style-b .roal-post-title,
.roal-style-b .roal-single-title,
.roal-style-b .roal-archive-title,
.roal-style-b .roal-page-title,
.roal-style-b .roal-section-title { font-family: 'Noto Serif KR', 'Nanum Myeongjo', serif; }
.roal-style-b .roal-site-title { font-weight: 900; font-size: 24px; letter-spacing: 0; }
.roal-style-b .roal-logo-letter { border-radius: 0; }
.roal-style-b .roal-header { border-bottom: 2px solid var(--roal-text); }
.roal-style-b .roal-header-inner { padding: 20px 0; }
.roal-style-b .roal-catbar-inner { padding: 0; gap: 0; }
.roal-style-b .roal-pill { border: none; border-radius: 0; background: transparent; padding: 12px 14px; border-bottom: 3px solid transparent; font-weight: 600; }
.roal-style-b .roal-pill:hover { color: var(--roal-main); }
.roal-style-b .roal-pill.is-active { background: transparent; color: var(--roal-main); border-bottom-color: var(--roal-main); }
.roal-style-b .roal-tagline { background: var(--roal-text); color: var(--roal-bg); font-size: 14px; }
.roal-style-b .roal-section-title { border-top: 3px solid var(--roal-text); padding-top: 12px; font-size: 19px; }
.roal-style-b .roal-section-title .dot { width: 10px; height: 10px; border-radius: 0; }
.roal-style-b .roal-thumb { border-radius: 0; font-family: 'Noto Serif KR', serif; }
.roal-style-b .roal-list .roal-post { padding: 15px 0; }
.roal-style-b .roal-post-title { font-weight: 700; line-height: 1.45; }
.roal-style-b .roal-post-meta { font-size: 13px; letter-spacing: 0.02em; }
.roal-style-b .roal-popular { grid-template-columns: 1fr; gap: 0; }
.roal-style-b .roal-popular .roal-post { padding: 10px 0; border-bottom: 1px dotted var(--roal-border); }
.roal-style-b .roal-popular .roal-rank { font-family: 'Noto Serif KR', serif; font-size: 20px; }
.roal-style-b .roal-content h2 { border-left: none; padding-left: 0; border-bottom: 2px solid var(--roal-text); padding-bottom: 8px; font-family: 'Noto Serif KR', serif; }
.roal-style-b .roal-single-meta { border-top: 1px solid var(--roal-border); border-bottom: 1px solid var(--roal-border); padding: 10px 0; }
.roal-style-b .roal-btn, .roal-style-b .roal-top-btn, .roal-style-b .roal-thumb img { border-radius: 0; }
.roal-style-b .roal-footer { background: var(--roal-text); }
.roal-style-b .roal-footer-inner, .roal-style-b .roal-footer-menu a, .roal-style-b .roal-footer-sns a { color: var(--roal-bg); }
.roal-style-b .roal-footer-sns a { border-color: rgba(255,255,255,0.35); }

/* =========================================================
   스타일 C: 감성 블로그
   ========================================================= */
body.roal-style-c { background: var(--roal-bg-soft); --roal-radius: 18px; }
.roal-style-c .roal-header { background: transparent; border-bottom: none; }
.roal-style-c .roal-header.is-sticky { background: var(--roal-bg-soft); }
.roal-style-c .roal-header-inner { padding: 24px 0 8px; }
.roal-style-c .roal-site-title { font-weight: 800; }
.roal-style-c .roal-logo-letter { border-radius: 14px; }
.roal-style-c .roal-catbar { background: transparent; border-bottom: none; }
.roal-style-c .roal-catbar-inner { padding: 8px 0 16px; }
.roal-style-c .roal-pill { background: var(--roal-bg); border-color: transparent; }
.roal-style-c .roal-pill.is-active { background: var(--roal-main); color: #fff; }
.roal-style-c .roal-tagline { border-radius: var(--roal-radius); margin: 0 20px; max-width: calc(var(--roal-max) - 40px); margin-left: auto; margin-right: auto; }
.roal-style-c .roal-section-title { font-size: 19px; }
.roal-style-c .roal-list .roal-post,
.roal-style-c .roal-magazine .roal-post-hero { background: var(--roal-bg); border-bottom: none; border-radius: var(--roal-radius); padding: 16px; margin: 14px 0; }
.roal-style-c .roal-cards .roal-post { border: none; background: var(--roal-bg); }
.roal-style-c .roal-thumb { border-radius: 14px; }
.roal-style-c .roal-post-meta { color: var(--roal-main); font-weight: 500; }
.roal-style-c .roal-popular { background: var(--roal-bg); border-radius: var(--roal-radius); padding: 16px 18px; }
.roal-style-c .roal-toc { background: var(--roal-bg); border: none; }
.roal-style-c .roal-single-head, .roal-style-c .roal-content, .roal-style-c .roal-single-thumb { background: transparent; }
.roal-style-c .roal-author, .roal-style-c .roal-prevnext a { background: var(--roal-bg); border: none; }
.roal-style-c .roal-footer { background: transparent; border-top: none; }
.roal-style-c .roal-search-panel { background: transparent; border-bottom: none; }
.roal-style-c .roal-search-panel input[type="search"] { border: none; background: var(--roal-bg); }
