/*
Theme Name: Urantia Library
Theme URI: https://urantia.kr
Author: Urantia Korea
Author URI: https://urantia.kr
Description: 유란시아서 도서관 - 학술적이고 품격 있는 유란시아서 연구 사이트 테마
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: urantia-library
Tags: custom-menu, featured-images, threaded-comments, translation-ready
*/

/* ═══════════════════════════════════════════════
   CSS VARIABLES
═══════════════════════════════════════════════ */
:root {
  --cream:        #faf6ef;
  --cream-dark:   #f0e8d8;
  --cream-darker: #e8dcc8;
  --parchment:    #ede0c4;
  --brown-deep:   #2c1a0e;
  --brown-rich:   #3d2510;
  --brown-mid:    #6b4226;
  --brown-soft:   #8b6045;
  --brown-light:  #b8926a;
  --gold:         #a07830;
  --gold-bright:  #c49a3c;
  --gold-pale:    #e8d49a;
  --ink:          #1e1208;
  --ink-mid:      #3a2010;
  --ink-soft:     #6b4a30;
  --red-accent:   #7a2020;
  --divider:      rgba(160,120,48,0.25);

  --font-serif:   'IM Fell English', 'Noto Serif KR', Georgia, serif;
  --font-sans:    'Noto Sans KR', 'Apple SD Gothic Neo', sans-serif;
  --font-display: 'Cormorant Garamond', 'Noto Serif KR', Georgia, serif;

  --radius: 3px;
  --shadow: 0 2px 12px rgba(44,26,14,0.12);
  --shadow-lg: 0 8px 32px rgba(44,26,14,0.18);

  --nav-height: 72px;
  --sidebar-width: 280px;
  --content-max: 1200px;
}

/* ═══════════════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-serif);
  background: var(--cream);
  color: var(--ink);
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--gold-bright); }

h1,h2,h3,h4,h5,h6 {
  font-family: var(--font-display);
  color: var(--brown-deep);
  line-height: 1.3;
  font-weight: 600;
}

p { margin-bottom: 1.2em; }
ul, ol { padding-left: 1.5em; margin-bottom: 1em; }

/* ═══════════════════════════════════════════════
   SKIP LINK
═══════════════════════════════════════════════ */
.skip-link {
  position: absolute; top: -100%; left: 16px;
  background: var(--brown-deep); color: var(--cream);
  padding: 8px 16px; z-index: 9999; border-radius: var(--radius);
  font-family: var(--font-sans); font-size: 13px;
}
.skip-link:focus { top: 16px; }

/* ═══════════════════════════════════════════════
   TOP BAR (Language Switcher)
═══════════════════════════════════════════════ */
.top-bar {
  background: var(--brown-deep);
  color: var(--gold-pale);
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.08em;
  padding: 6px 0;
  border-bottom: 1px solid rgba(184,146,106,0.2);
}
.top-bar-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.top-bar-left { opacity: 0.7; }
.lang-switcher { display: flex; gap: 12px; align-items: center; }
.lang-switcher a {
  color: var(--gold-pale);
  opacity: 0.6;
  font-size: 11px;
  letter-spacing: 0.05em;
}
.lang-switcher a.active,
.lang-switcher a:hover { opacity: 1; color: var(--gold-bright); }
.lang-switcher span { opacity: 0.3; }

/* ═══════════════════════════════════════════════
   HEADER / NAVIGATION
═══════════════════════════════════════════════ */
#masthead {
  background: var(--cream);
  border-bottom: 2px solid var(--parchment);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 16px rgba(44,26,14,0.08);
}

.header-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 24px;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  gap: 40px;
}

/* Logo */
.site-branding { flex-shrink: 0; }
.site-branding a { display: flex; flex-direction: column; gap: 2px; }
.site-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--brown-deep);
  letter-spacing: 0.02em;
  line-height: 1;
}
.site-title span { color: var(--gold); }
.site-tagline {
  font-family: var(--font-sans);
  font-size: 10px;
  color: var(--brown-light);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  line-height: 1;
}

/* Nav Menu */
#primary-navigation { flex: 1; }
.nav-menu {
  display: flex;
  list-style: none;
  padding: 0; margin: 0;
  gap: 0;
  flex-wrap: wrap;
}
.nav-menu > li { position: relative; }
.nav-menu > li > a {
  display: block;
  padding: 8px 14px;
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-mid);
  letter-spacing: 0.04em;
  white-space: nowrap;
  border-radius: var(--radius);
  transition: background 0.2s, color 0.2s;
}
.nav-menu > li > a:hover,
.nav-menu > li.current-menu-item > a {
  background: var(--cream-dark);
  color: var(--gold);
}
/* Dropdown */
.nav-menu .sub-menu {
  display: none;
  position: absolute; top: 100%; left: 0;
  background: var(--cream);
  border: 1px solid var(--divider);
  border-top: 2px solid var(--gold);
  border-radius: 0 0 var(--radius) var(--radius);
  min-width: 200px;
  box-shadow: var(--shadow-lg);
  list-style: none; padding: 8px 0; margin: 0;
  z-index: 200;
}
.nav-menu li:hover > .sub-menu { display: block; }
.nav-menu .sub-menu a {
  display: block;
  padding: 8px 18px;
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--ink-mid);
}
.nav-menu .sub-menu a:hover { background: var(--cream-dark); color: var(--gold); }

/* Search + Hamburger */
.header-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.header-search-btn {
  background: none; border: none; cursor: pointer;
  color: var(--brown-soft); padding: 8px;
  font-size: 16px; transition: color 0.2s;
}
.header-search-btn:hover { color: var(--gold); }
.menu-toggle {
  display: none;
  background: none; border: 1px solid var(--divider);
  border-radius: var(--radius); cursor: pointer;
  padding: 6px 10px; color: var(--brown-mid);
  font-size: 18px;
}

/* ═══════════════════════════════════════════════
   HERO / BANNER
═══════════════════════════════════════════════ */
.site-hero {
  background: linear-gradient(160deg, var(--brown-deep) 0%, var(--brown-rich) 50%, #1a0a04 100%);
  color: var(--cream);
  padding: 100px 24px 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.site-hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 50% -20%, rgba(160,120,48,0.25) 0%, transparent 60%),
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23c49a3c' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; }
.hero-eyebrow {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.4em;
  color: var(--gold-pale);
  text-transform: uppercase;
  margin-bottom: 20px;
  opacity: 0.8;
}
.hero-title {
  font-size: clamp(32px, 5.5vw, 58px);
  font-weight: 700;
  color: var(--cream);
  line-height: 1.2;
  margin-bottom: 12px;
}
.hero-title em { color: var(--gold-bright); font-style: normal; }
.hero-subtitle {
  font-family: var(--font-sans);
  font-size: 15px;
  color: rgba(250,246,239,0.7);
  max-width: 520px;
  margin: 0 auto 40px;
  line-height: 1.8;
  font-weight: 300;
}
.hero-circles {
  display: flex; justify-content: center;
  align-items: center; gap: 8px; margin-top: 36px;
}
.hero-circles span {
  border-radius: 50%;
  border: 1.5px solid rgba(196,154,60,0.5);
  display: block;
}
.hero-circles span:nth-child(1) { width: 14px; height: 14px; }
.hero-circles span:nth-child(2) { width: 24px; height: 24px; }
.hero-circles span:nth-child(3) { width: 36px; height: 36px; }

/* ═══════════════════════════════════════════════
   SECTION COLUMNS (메인 카테고리 그리드)
═══════════════════════════════════════════════ */
.section-columns {
  background: var(--cream-dark);
  border-top: 1px solid var(--divider);
  border-bottom: 1px solid var(--divider);
  padding: 48px 24px;
}
.section-columns-inner {
  max-width: var(--content-max);
  margin: 0 auto;
}
.section-columns-title {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--gold);
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 32px;
}
.columns-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.col-card {
  background: var(--cream);
  border: 1px solid var(--divider);
  border-top: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  text-decoration: none;
  display: block;
}
.col-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-top-color: var(--gold-bright);
}
.col-card-icon {
  font-size: 26px;
  margin-bottom: 10px;
  display: block;
  filter: saturate(0.8);
}
.col-card-title {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  color: var(--brown-deep);
  letter-spacing: 0.04em;
  line-height: 1.4;
}
.col-card-title-en {
  font-family: var(--font-sans);
  font-size: 10px;
  color: var(--brown-light);
  margin-top: 4px;
  letter-spacing: 0.05em;
}

/* ═══════════════════════════════════════════════
   MAIN CONTENT LAYOUT
═══════════════════════════════════════════════ */
.site-main-wrap {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 48px 24px;
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  gap: 48px;
}
.site-main-wrap.full-width {
  grid-template-columns: 1fr;
}
.site-main { min-width: 0; }

/* ═══════════════════════════════════════════════
   POSTS / ARTICLES
═══════════════════════════════════════════════ */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 48px;
}
.post-card {
  background: #fff;
  border: 1px solid var(--divider);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}
.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.post-card-thumb img {
  width: 100%; height: 180px; object-fit: cover;
}
.post-card-thumb-placeholder {
  width: 100%; height: 180px;
  background: linear-gradient(135deg, var(--cream-darker) 0%, var(--parchment) 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 40px; opacity: 0.4;
}
.post-card-body { padding: 20px; }
.post-card-cat {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
}
.post-card-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--brown-deep);
  margin-bottom: 8px;
  line-height: 1.4;
}
.post-card-title a { color: inherit; }
.post-card-title a:hover { color: var(--gold); }
.post-card-excerpt {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.7;
  margin-bottom: 14px;
}
.post-card-meta {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--brown-light);
  display: flex; gap: 12px; align-items: center;
}
.post-card-meta span::before { content: '·'; margin-right: 12px; opacity: 0.5; }
.post-card-meta span:first-child::before { display: none; }

/* Single Post */
.entry-header { margin-bottom: 36px; padding-bottom: 24px; border-bottom: 1px solid var(--divider); }
.entry-category {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 12px;
  display: block;
}
.entry-title { font-size: clamp(24px, 4vw, 38px); margin-bottom: 16px; }
.entry-meta {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--brown-light);
  display: flex; gap: 16px; flex-wrap: wrap;
}
.entry-content {
  font-size: 16px;
  line-height: 1.95;
  color: var(--ink-mid);
}
.entry-content h2 {
  font-size: 24px; margin: 36px 0 16px;
  padding-bottom: 8px; border-bottom: 1px solid var(--divider);
}
.entry-content h3 { font-size: 19px; margin: 28px 0 12px; }
.entry-content p { margin-bottom: 1.3em; }
.entry-content blockquote {
  background: var(--cream-dark);
  border-left: 4px solid var(--gold);
  padding: 20px 24px;
  margin: 28px 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--ink-mid);
}
.entry-content blockquote cite {
  display: block; margin-top: 10px;
  font-family: var(--font-sans); font-size: 12px;
  color: var(--gold); font-style: normal;
}

/* ═══════════════════════════════════════════════
   CITATION STYLE (유란시아서 인용)
═══════════════════════════════════════════════ */
.urantia-quote {
  background: linear-gradient(135deg, var(--cream-dark) 0%, var(--parchment) 100%);
  border: 1px solid rgba(160,120,48,0.3);
  border-left: 4px solid var(--gold);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 24px 28px;
  margin: 32px 0;
  position: relative;
}
.urantia-quote::before {
  content: '"';
  font-family: Georgia, serif;
  font-size: 72px;
  color: var(--gold);
  opacity: 0.15;
  position: absolute; top: -8px; left: 12px;
  line-height: 1;
}
.urantia-quote p {
  font-style: italic;
  font-size: 15px;
  color: var(--ink-mid);
  line-height: 1.9;
  margin: 0 0 10px;
  position: relative; z-index: 1;
}
.urantia-quote .paper-ref {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--gold);
  font-weight: 600;
  letter-spacing: 0.05em;
}

/* ═══════════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════════ */
.sidebar { flex-shrink: 0; }
.widget {
  background: #fff;
  border: 1px solid var(--divider);
  border-top: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 28px;
  box-shadow: var(--shadow);
}
.widget-title {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--divider);
}
.widget ul { list-style: none; padding: 0; margin: 0; }
.widget ul li {
  font-family: var(--font-sans);
  font-size: 13px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(160,120,48,0.1);
  color: var(--ink-mid);
}
.widget ul li:last-child { border-bottom: none; }
.widget ul li a { color: var(--ink-mid); }
.widget ul li a:hover { color: var(--gold); }
.widget ul li::before { content: '▸ '; color: var(--gold); font-size: 10px; }

/* Search Widget */
.widget-search { display: flex; gap: 8px; }
.widget-search input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--divider);
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 13px;
  background: var(--cream);
  color: var(--ink);
}
.widget-search input:focus {
  outline: none;
  border-color: var(--gold);
}
.widget-search button {
  padding: 8px 14px;
  background: var(--gold);
  color: white; border: none;
  border-radius: var(--radius);
  cursor: pointer; font-size: 14px;
}
.widget-search button:hover { background: var(--gold-bright); }

/* ═══════════════════════════════════════════════
   FEATURED SECTION (홈 - 최근 자료)
═══════════════════════════════════════════════ */
.home-section {
  padding: 56px 24px;
  max-width: var(--content-max);
  margin: 0 auto;
}
.home-section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 28px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--parchment);
}
.home-section-header h2 {
  font-size: 24px;
}
.home-section-header a {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--gold);
  letter-spacing: 0.05em;
}

/* ═══════════════════════════════════════════════
   BREADCRUMB
═══════════════════════════════════════════════ */
.breadcrumb {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--brown-light);
  padding: 12px 0;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--divider);
}
.breadcrumb a { color: var(--brown-light); }
.breadcrumb a:hover { color: var(--gold); }
.breadcrumb span { margin: 0 6px; opacity: 0.5; }

/* ═══════════════════════════════════════════════
   PAGINATION
═══════════════════════════════════════════════ */
.pagination {
  display: flex; gap: 8px; justify-content: center;
  margin-top: 40px; flex-wrap: wrap;
}
.pagination a, .pagination span {
  font-family: var(--font-sans);
  font-size: 13px;
  padding: 7px 13px;
  border: 1px solid var(--divider);
  border-radius: var(--radius);
  color: var(--ink-mid);
  background: var(--cream);
}
.pagination a:hover { background: var(--gold); color: white; border-color: var(--gold); }
.pagination .current { background: var(--gold); color: white; border-color: var(--gold); }

/* ═══════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════ */
#colophon {
  background: var(--brown-deep);
  color: var(--cream-dark);
  margin-top: 80px;
  border-top: 3px solid var(--gold);
}
.footer-widgets {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 56px 24px 40px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
}
.footer-col h4 {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold-pale);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(196,154,60,0.2);
}
.footer-col p {
  font-family: var(--font-sans);
  font-size: 13px;
  color: rgba(240,232,216,0.6);
  line-height: 1.8;
  margin: 0;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col ul li {
  font-family: var(--font-sans);
  font-size: 13px;
  padding: 5px 0;
}
.footer-col ul li a {
  color: rgba(240,232,216,0.6);
  transition: color 0.2s;
}
.footer-col ul li a:hover { color: var(--gold-pale); }
.footer-bottom {
  border-top: 1px solid rgba(196,154,60,0.15);
  padding: 20px 24px;
  max-width: var(--content-max);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-sans);
  font-size: 11px;
  color: rgba(240,232,216,0.4);
  flex-wrap: wrap;
  gap: 8px;
}

/* ═══════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .site-main-wrap { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .footer-widgets { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  :root { --nav-height: 60px; }
  .header-inner { gap: 16px; }
  #primary-navigation { display: none; }
  #primary-navigation.open { display: block; position: absolute; top: var(--nav-height); left: 0; right: 0; background: var(--cream); border-bottom: 2px solid var(--divider); padding: 12px 0; box-shadow: var(--shadow-lg); }
  .nav-menu { flex-direction: column; }
  .nav-menu > li > a { padding: 12px 24px; }
  .menu-toggle { display: block; }
  .columns-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-widgets { grid-template-columns: 1fr; gap: 24px; }
  .footer-bottom { justify-content: center; text-align: center; }
  .posts-grid { grid-template-columns: 1fr; }
  .home-section-header { flex-direction: column; gap: 8px; }
}
@media (max-width: 480px) {
  .columns-grid { grid-template-columns: repeat(2, 1fr); }
  .site-hero { padding: 70px 20px 60px; }
}

/* ═══════════════════════════════════════════════
   UTILITY CLASSES
═══════════════════════════════════════════════ */
.text-center { text-align: center; }
.section-label {
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--gold);
  text-transform: uppercase;
  display: block;
  margin-bottom: 6px;
}
.ornament {
  text-align: center;
  color: var(--gold);
  letter-spacing: 0.6em;
  font-size: 14px;
  opacity: 0.4;
  margin: 32px 0;
}
