/*
Theme Name: MEDIAKING__v2
Theme URI: https://example.com/
Author: OpenAI
Author URI: https://openai.com/
Version: 12.1-haim-design
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: mediaking
*/

:root {
  --bg: #eef1f4;
  --text: #111111;
  --muted: #6b7280;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --accent: #b91c1c;
  --light: #f8fafc;
  --max-width: 1240px;
}

* { box-sizing: border-box; }
html { margin: 0; padding: 0; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans KR", sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #eef1f4 0%, #f5f6f8 240px, #eef1f4 100%);
  line-height: 1.65;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
img { max-width: 100%; height: auto; display: block; }
.container { width: min(100% - 24px, var(--max-width)); margin: 0 auto; }
.screen-reader-text { position: absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }

.site-header { background:#fff; border-bottom:1px solid var(--border); position:relative; z-index:100; }
.header-branding { padding:20px 0 16px; border-bottom:1px solid var(--border); background:#fff; }
.header-branding-inner { display:flex; align-items:center; justify-content:center; }
.logo-wrap { text-align:center; }
.logo-wrap .custom-logo-link, .logo-wrap img { margin:0 auto; }
.logo-wrap .site-title { margin:0; font-size:var(--site-title-size-desktop, clamp(30px,4vw,42px)); font-weight:900; letter-spacing:-0.04em; line-height:1.08; max-width:100%; overflow-wrap:anywhere; word-break:keep-all; }
.logo-wrap .site-title a { color:var(--text); }
.logo-wrap .site-description { margin:8px 0 0; color:var(--muted); font-size:13px; letter-spacing:.08em; text-transform:uppercase; }

.header-topbar { background:#111827; color:#fff; font-size:13px; }
.header-topbar-inner { min-height:40px; display:flex; align-items:center; justify-content:space-between; gap:16px; }
.topbar-left, .topbar-right { display:flex; align-items:center; gap:14px; flex-wrap:wrap; }
.topbar-label { display:inline-flex; align-items:center; justify-content:center; min-height:24px; padding:0 10px; border-radius:999px; background:var(--accent); color:#fff; font-size:12px; font-weight:800; letter-spacing:.04em; text-transform:uppercase; }
.topbar-links { display:flex; align-items:center; gap:14px; flex-wrap:wrap; }
.topbar-links a { color:rgba(255,255,255,.92); font-weight:600; max-width:220px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.topbar-links a + a::before { content:"•"; margin-right:14px; color:rgba(255,255,255,.45); }
.site-date { color:rgba(255,255,255,.82); }

.site-nav-wrap { background:#fff; border-bottom:1px solid var(--border); }
.site-nav-inner { min-height:56px; display:flex; align-items:center; justify-content:center; }
.main-navigation ul { list-style:none; margin:0; padding:0; display:flex; align-items:center; flex-wrap:wrap; gap:26px; }
.main-navigation a { display:inline-flex; align-items:center; min-height:56px; font-size:15px; font-weight:800; letter-spacing:-.01em; }

.section { padding:42px 0; }
.section-title { display:flex; align-items:center; justify-content:space-between; margin-bottom:18px; }
.section-title h2 { margin:0; font-size:28px; line-height:1.2; }
.section-title a { color:var(--accent); font-weight:700; }

.hero-grid { display:grid; grid-template-columns:minmax(0,1.55fr) minmax(300px,1fr); gap:24px; padding:24px 0 14px; align-items:start; }
.hero-main, .category-feature, .post-card, .popular-list li, .widget { background:#fff; border:1px solid rgba(17,24,39,.06); overflow:hidden; box-shadow:0 10px 30px rgba(15,23,42,.06), 0 2px 8px rgba(15,23,42,.03); }
.hero-main, .category-feature, .post-card { border-radius:20px; }
.popular-list li, .widget { border-radius:16px; }
.hero-main-content, .category-feature-content, .post-card-content { padding:18px; }
.category-badge { display:inline-block; margin-bottom:10px; font-size:12px; font-weight:800; color:var(--accent); text-transform:uppercase; letter-spacing:.06em; }
.hero-main h2 { margin:0 0 10px; font-size:34px; line-height:1.2; }
.hero-main > a { display:block; }
.hero-main > a img { width:100%; aspect-ratio:16/9; object-fit:cover; }
.hero-main p, .category-feature p, .post-card-content p { color:var(--muted); margin:0; }
.post-meta { font-size:13px; color:var(--muted); }

.hero-sub { display:grid; gap:14px; align-content:start; }
.hero-sub article { display:grid; grid-template-columns:128px minmax(0,1fr); gap:14px; padding:14px; border:1px solid rgba(17,24,39,.06); background:#fff; border-radius:16px; box-shadow:0 8px 22px rgba(15,23,42,.05), 0 2px 6px rgba(15,23,42,.03); align-items:center; }
.hero-sub article:last-child { border-bottom:1px solid rgba(17,24,39,.06); }
.hero-sub article img { width:128px; height:90px; object-fit:cover; border-radius:12px; }
.hero-sub-content { padding:0; }
.hero-sub h3 { margin:0 0 6px; font-size:16px; line-height:1.4; }
.hero-sub .category-badge { margin-bottom:6px; font-size:11px; }

.category-grid { display:grid; grid-template-columns:minmax(0,1.3fr) minmax(280px,1fr); gap:24px; }
.category-list { display:grid; gap:12px; }
.category-list article { display:grid; grid-template-columns:104px minmax(0,1fr); gap:14px; align-items:center; padding:14px; border:1px solid rgba(17,24,39,.06); border-radius:16px; background:#fff; box-shadow:0 8px 22px rgba(15,23,42,.05), 0 2px 6px rgba(15,23,42,.03); }
.category-list article img { width:104px; height:74px; object-fit:cover; border-radius:10px; }
.category-list-content { padding:0; }
.category-list-content h3 { margin:0 0 6px; line-height:1.35; font-size:17px; }

.popular-list { list-style:none; margin:0; padding:0; display:grid; gap:12px; }
table { width:100%; border-collapse:separate; border-spacing:0; background:#fff; border:1px solid rgba(17,24,39,.08); border-radius:14px; overflow:hidden; box-shadow:0 10px 24px rgba(15,23,42,.05), 0 2px 6px rgba(15,23,42,.03); }
th, td { border-bottom:1px solid #e5e7eb; padding:12px 14px; }
tr:last-child td { border-bottom:0; }
.popular-list li a { display:grid; grid-template-columns:52px 1fr; gap:14px; padding:18px; align-items:start; }
.popular-number { font-size:30px; font-weight:800; color:var(--accent); line-height:1; }

.content-grid { display:grid; grid-template-columns:minmax(0,1fr) 300px; gap:28px; padding:34px 0; }
.posts-loop { display:grid; gap:20px; }
.post-card img { width:100%; }
.post-card-content h2, .post-card-content h1 { font-size:34px; margin:0 0 8px; line-height:1.2; }
.sidebar .widget { padding:18px; margin-bottom:18px; }
.widget-title { margin-top:0; font-size:20px; }
.widget ul { margin:0; padding-left:18px; }
.archive-header { padding:28px 0 12px; }
.archive-header h1 { margin:0 0 8px; font-size:38px; }
.single-thumbnail { margin:18px 0 22px; border-radius:20px; overflow:hidden; }
.entry-content { font-size:18px; }
.entry-content p { margin-bottom:1.25em; }
.pagination { display:flex; gap:8px; flex-wrap:wrap; margin-top:26px; }
.pagination .page-numbers { border:1px solid var(--border); padding:10px 14px; border-radius:999px; }
.pagination .current { background:var(--accent); color:#fff; border-color:var(--accent); }

.site-footer { border-top:0; margin-top:40px; background:#111827; color:#fff; }
.footer-inner { padding:18px 0; display:grid; gap:10px; justify-items:center; text-align:center; }
.footer-menu ul { list-style:none; display:flex; gap:18px; flex-wrap:wrap; margin:0; padding:0; justify-content:center; }
.footer-menu a { color:rgba(255,255,255,.9); }
.footer-menu a:hover { color:#fff; }
.copyright { color:rgba(255,255,255,.9); font-size:14px; }

@media (max-width: 980px) {
  .hero-grid, .category-grid, .content-grid { grid-template-columns:1fr; }
  .site-nav-inner { justify-content:flex-start; overflow-x:auto; -webkit-overflow-scrolling:touch; }
  .main-navigation { min-width:max-content; }
  .topbar-right { display:none; }
  .hero-main > a img { aspect-ratio:16/10; }
}

@media (max-width: 640px) {
  .section { padding:30px 0; }
  .container { width:min(100% - 16px, var(--max-width)); }
  .header-branding-inner { padding-inline:4px; }
  .logo-wrap .site-title { font-size:var(--site-title-size-mobile, 28px); line-height:1.12; }
  .hero-main h2, .post-card-content h2, .post-card-content h1, .archive-header h1 { font-size:26px; }
  .hero-main > a img { aspect-ratio:16/10; }
  .hero-sub article, .category-list article { grid-template-columns:96px minmax(0,1fr); gap:12px; padding:12px; }
  .hero-sub article img, .category-list article img { width:96px; height:72px; }
  .topbar-links { display:grid; gap:6px; }
  .topbar-links a + a::before { content:none; margin:0; }
  .main-navigation ul { gap:18px; flex-wrap:nowrap; padding-right:16px; }
  .main-navigation a { min-height:50px; font-size:14px; white-space:nowrap; }
  .header-topbar-inner { align-items:flex-start; padding-block:8px; }
}


/* Overflow fix for inner pages */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

main, section, article, aside,
.container, .content-grid, .posts-loop, .post-card, .post-card-content,
.entry-content, .sidebar, .widget, .archive-header {
  max-width: 100%;
  min-width: 0;
}

.content-grid,
.hero-grid,
.category-grid {
  overflow-x: hidden;
}

.entry-content > * {
  max-width: 100%;
}

.entry-content img,
.entry-content figure,
.entry-content iframe,
.entry-content embed,
.entry-content object,
.entry-content video,
.entry-content table,
.entry-content pre,
.entry-content code,
.entry-content .wp-block-image,
.entry-content .wp-block-embed,
.entry-content .wp-block-table,
.entry-content .wp-block-preformatted,
.entry-content .wp-block-code,
.entry-content .wp-block-cover,
.entry-content .wp-block-media-text,
.entry-content .alignwide,
.entry-content .alignfull {
  max-width: 100%;
}

.entry-content table,
.entry-content pre {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.entry-content iframe,
.entry-content embed,
.entry-content object,
.entry-content video {
  width: 100%;
}

.entry-content img,
.entry-content figure {
  height: auto;
}

.entry-content a {
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 980px) {
  .content-grid,
  .hero-grid,
  .category-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-width: 0;
  }
}

@media (max-width: 640px) {
  .post-card-content,
  .hero-main-content,
  .category-feature-content,
  .sidebar .widget {
    padding-left: 14px;
    padding-right: 14px;
  }

  .entry-content {
    font-size: 17px;
  }
}

/* ===== FINAL: same left/right columns for top and middle ===== */
.hero-grid,
.category-grid {
  grid-template-columns: minmax(0,1.55fr) minmax(300px,1fr) !important;
  gap: 24px !important;
  align-items: stretch !important;
}

.hero-main-wrap,
.hero-main,
.category-grid > div:first-child,
.category-feature {
  height: 100%;
}

.hero-main,
.category-feature {
  display: flex;
  flex-direction: column;
}

.hero-main-content,
.category-feature-content {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.hero-main-content .post-meta {
  margin-top: auto;
}

.category-feature-content p {
  margin-top: auto;
}

.hero-sub {
  height: 100%;
  display: grid;
  grid-template-rows: repeat(4, minmax(0, 1fr));
  align-content: stretch;
}

.category-list {
  height: 100%;
  display: grid;
  grid-template-rows: repeat(3, minmax(0, 1fr));
  align-content: stretch;
}

.hero-sub article,
.category-list article {
  min-height: 0;
}

.hero-sub h3,
.category-list-content h3 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.category-feature > a img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}

@media (max-width: 980px) {
  .hero-grid,
  .category-grid {
    grid-template-columns: 1fr !important;
  }

  .hero-main-wrap,
  .hero-main,
  .hero-sub,
  .category-grid > div:first-child,
  .category-feature,
  .category-list {
    height: auto;
  }

  .hero-sub,
  .category-list {
    grid-template-rows: auto;
  }
}


/* ===== Sidebar Search + Recent Posts: Clean Final v2 ===== */
.sidebar-search-widget,
.sidebar-recent-widget {
  padding: 18px;
  border-radius: 18px;
}

/* Search box */
.sidebar-search-widget .search-form {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.sidebar-search-widget .search-field {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  font: inherit;
  outline: none;
}

.sidebar-search-widget .search-field:focus {
  border-color: #d6a900;
  box-shadow: 0 0 0 3px rgba(255, 212, 0, .18);
}

.sidebar-search-widget .search-submit {
  height: 42px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  background: #111827;
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
}

.sidebar-search-widget .search-submit:hover {
  background: #000000;
}

/* Recent Posts */
.mk-recent-posts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.mk-recent-post {
  margin: 0;
  padding: 0;
}

.mk-recent-link {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  padding: 10px;
  background: #fafafa;
  border: 1px solid #eeeeee;
  border-radius: 15px;
  overflow: hidden;
  transition: background .2s ease, border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.mk-recent-link:hover {
  background: #ffffff;
  border-color: #dddddd;
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, .06);
}

.mk-recent-thumb,
.mk-recent-thumb img,
.mk-recent-no-thumb {
  display: block;
  width: 70px;
  height: 70px;
}

.mk-recent-thumb img {
  object-fit: cover;
  border-radius: 12px;
}

.mk-recent-no-thumb {
  border-radius: 12px;
  background: #eeeeee;
  color: #888888;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6px;
}

.mk-recent-content {
  min-width: 0;
}

.mk-recent-content strong {
  display: -webkit-box;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
  color: #222222;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mk-recent-date {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  color: #888888;
}

/* Mobile/tablet sidebar: smaller thumbnail + rounded compact cards */
@media (max-width: 980px) {
  .sidebar-search-widget,
  .sidebar-recent-widget {
    padding: 14px;
    border-radius: 18px;
  }

  .sidebar-search-widget .search-form {
    gap: 7px;
  }

  .sidebar-search-widget .search-field,
  .sidebar-search-widget .search-submit {
    height: 40px;
    border-radius: 11px;
  }

  .mk-recent-posts {
    gap: 10px;
  }

  .mk-recent-link {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 10px;
    padding: 9px;
    border-radius: 16px;
    background: #ffffff;
    border: 1px solid rgba(17, 24, 39, .08);
    box-shadow: 0 7px 16px rgba(15, 23, 42, .045);
  }

  .mk-recent-link:hover {
    transform: none;
  }

  .mk-recent-thumb,
  .mk-recent-thumb img,
  .mk-recent-no-thumb {
    width: 64px;
    height: 58px;
  }

  .mk-recent-thumb img,
  .mk-recent-no-thumb {
    border-radius: 12px;
  }

  .mk-recent-content strong {
    font-size: 14px;
    line-height: 1.34;
    -webkit-line-clamp: 2;
  }

  .mk-recent-date {
    margin-top: 4px;
    font-size: 11.5px;
  }
}

@media (max-width: 420px) {
  .mk-recent-link {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 9px;
    padding: 8px;
    border-radius: 15px;
  }

  .mk-recent-thumb,
  .mk-recent-thumb img,
  .mk-recent-no-thumb {
    width: 58px;
    height: 54px;
  }

  .mk-recent-content strong {
    font-size: 13.5px;
    line-height: 1.32;
  }
}

/* ===== FORCE FIX: Recent Posts mobile card thumbnails ===== */
.sidebar .sidebar-recent-widget ul.mk-recent-posts {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: grid !important;
  gap: 10px !important;
}

.sidebar .sidebar-recent-widget li.mk-recent-post {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.sidebar .sidebar-recent-widget .mk-recent-link {
  display: grid !important;
  grid-template-columns: 72px minmax(0, 1fr) !important;
  gap: 12px !important;
  align-items: center !important;
  width: 100% !important;
  padding: 10px !important;
  background: #ffffff !important;
  border: 1px solid rgba(17, 24, 39, .08) !important;
  border-radius: 18px !important;
  overflow: hidden !important;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .055) !important;
}

.sidebar .sidebar-recent-widget .mk-recent-thumb {
  display: block !important;
  width: 72px !important;
  min-width: 72px !important;
  max-width: 72px !important;
  height: 62px !important;
  border-radius: 14px !important;
  overflow: hidden !important;
  background: #f1f3f5 !important;
}

.sidebar .sidebar-recent-widget .mk-recent-thumb img,
.sidebar .sidebar-recent-widget .mk-recent-thumb img.attachment-thumbnail,
.sidebar .sidebar-recent-widget .mk-recent-thumb img.size-thumbnail,
.sidebar .sidebar-recent-widget .mk-recent-no-thumb {
  display: block !important;
  width: 72px !important;
  min-width: 72px !important;
  max-width: 72px !important;
  height: 62px !important;
  min-height: 62px !important;
  max-height: 62px !important;
  aspect-ratio: auto !important;
  object-fit: cover !important;
  border-radius: 14px !important;
  overflow: hidden !important;
}

.sidebar .sidebar-recent-widget .mk-recent-content {
  min-width: 0 !important;
  overflow: hidden !important;
}

.sidebar .sidebar-recent-widget .mk-recent-content strong {
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  font-size: 14px !important;
  line-height: 1.35 !important;
  font-weight: 800 !important;
}

.sidebar .sidebar-recent-widget .mk-recent-date {
  display: block !important;
  margin-top: 4px !important;
  font-size: 11.5px !important;
  color: #888888 !important;
}

@media (max-width: 980px) {
  .sidebar .sidebar-recent-widget {
    padding: 14px !important;
    border-radius: 20px !important;
  }

  .sidebar .sidebar-recent-widget .mk-recent-link {
    grid-template-columns: 66px minmax(0, 1fr) !important;
    gap: 10px !important;
    padding: 9px !important;
    border-radius: 18px !important;
  }

  .sidebar .sidebar-recent-widget .mk-recent-thumb,
  .sidebar .sidebar-recent-widget .mk-recent-thumb img,
  .sidebar .sidebar-recent-widget .mk-recent-thumb img.attachment-thumbnail,
  .sidebar .sidebar-recent-widget .mk-recent-thumb img.size-thumbnail,
  .sidebar .sidebar-recent-widget .mk-recent-no-thumb {
    width: 66px !important;
    min-width: 66px !important;
    max-width: 66px !important;
    height: 58px !important;
    min-height: 58px !important;
    max-height: 58px !important;
    border-radius: 14px !important;
  }
}

@media (max-width: 420px) {
  .sidebar .sidebar-recent-widget .mk-recent-link {
    grid-template-columns: 60px minmax(0, 1fr) !important;
    gap: 9px !important;
    padding: 8px !important;
    border-radius: 17px !important;
  }

  .sidebar .sidebar-recent-widget .mk-recent-thumb,
  .sidebar .sidebar-recent-widget .mk-recent-thumb img,
  .sidebar .sidebar-recent-widget .mk-recent-thumb img.attachment-thumbnail,
  .sidebar .sidebar-recent-widget .mk-recent-thumb img.size-thumbnail,
  .sidebar .sidebar-recent-widget .mk-recent-no-thumb {
    width: 60px !important;
    min-width: 60px !important;
    max-width: 60px !important;
    height: 54px !important;
    min-height: 54px !important;
    max-height: 54px !important;
    border-radius: 13px !important;
  }
}

/* ===== Custom English Search Form: Modern v1 ===== */
.mk-search-form {
  width: 100%;
  margin: 0;
}

.mk-search-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(17, 24, 39, .06);
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.mk-search-inner:focus-within {
  border-color: #FFD400;
  box-shadow: 0 10px 30px rgba(255, 212, 0, .18), 0 0 0 4px rgba(255, 212, 0, .16);
  transform: translateY(-1px);
}

.mk-search-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  color: #6b7280;
  background: #f3f4f6;
}

.mk-search-field,
.sidebar-search-widget .mk-search-field {
  flex: 1;
  width: 100%;
  min-width: 0;
  height: 40px;
  padding: 0 4px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #111827;
  font: inherit;
  font-size: 14px;
  outline: none;
  box-shadow: none;
}

.mk-search-field::placeholder {
  color: #9ca3af;
}

.mk-search-submit,
.sidebar-search-widget .mk-search-submit {
  flex: 0 0 auto;
  height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: #111827;
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
}

.mk-search-submit:hover,
.sidebar-search-widget .mk-search-submit:hover {
  background: #000000;
  box-shadow: 0 8px 18px rgba(17, 24, 39, .18);
  transform: translateY(-1px);
}

.mk-search-submit:active,
.sidebar-search-widget .mk-search-submit:active {
  transform: translateY(0);
}

@media (max-width: 480px) {
  .mk-search-inner {
    border-radius: 18px;
  }

  .mk-search-submit,
  .sidebar-search-widget .mk-search-submit {
    padding: 0 13px;
  }
}

/* News-style pagination: compact, mobile-friendly */
.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 34px 0 12px;
  padding-top: 18px;
  border-top: 1px solid #eeeeee;
}

.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  background: #ffffff;
  color: #222222;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  box-shadow: none;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.pagination a.page-numbers:hover {
  border-color: #111111;
  background: #f7f7f7;
  color: #111111;
}

.pagination .page-numbers.current {
  border-color: #111111;
  background: #111111;
  color: #ffffff;
}

.pagination .page-numbers.prev,
.pagination .page-numbers.next {
  min-width: 34px;
  padding: 0 11px;
  font-size: 17px;
  font-weight: 800;
}

.pagination .page-numbers.dots {
  border-color: transparent;
  background: transparent;
  min-width: 20px;
  padding: 0 2px;
  color: #777777;
}

@media (max-width: 640px) {
  .pagination {
    gap: 5px;
    margin: 26px 0 8px;
    padding-top: 14px;
  }

  .pagination .page-numbers {
    min-width: 31px;
    height: 31px;
    padding: 0 8px;
    border-radius: 3px;
    font-size: 12px;
  }

  .pagination .page-numbers.prev,
  .pagination .page-numbers.next {
    min-width: 31px;
    padding: 0 9px;
    font-size: 16px;
  }
}

/* ===== Category page: news portal style ===== */
.category-news-layout {
  align-items: start;
}

.category-news-header {
  margin: 0 0 18px;
  padding: 22px 0 16px;
  border-bottom: 2px solid #111111;
}

.category-news-eyebrow {
  display: inline-flex;
  align-items: center;
  height: 24px;
  margin-bottom: 10px;
  padding: 0 9px;
  border-radius: 999px;
  background: #111827;
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  line-height: 1;
  text-transform: uppercase;
}

.category-news-header h1 {
  margin: 0;
  font-size: 34px;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.04em;
}

.category-news-description {
  margin-top: 8px;
  color: #6b7280;
  font-size: 14px;
}

.category-news-list {
  gap: 0;
  border-top: 1px solid #e5e7eb;
  background: #ffffff;
  border-radius: 0 0 16px 16px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .05);
}

.category-news-card.post-card {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 18px;
  padding: 18px 0;
  border: 0;
  border-bottom: 1px solid #e5e7eb;
  border-radius: 0;
  box-shadow: none;
  background: #ffffff;
}

.category-news-card.post-card:last-of-type {
  border-bottom: 0;
}

.category-news-thumb {
  display: block;
  margin-left: 18px;
  border-radius: 10px;
  overflow: hidden;
  background: #f3f4f6;
}

.category-news-thumb img {
  width: 100%;
  height: 142px;
  object-fit: cover;
  transition: transform .2s ease;
}

.category-news-card:hover .category-news-thumb img {
  transform: scale(1.03);
}

.category-news-content.post-card-content {
  padding: 2px 18px 2px 0;
}

.category-news-content .category-badge {
  margin-bottom: 7px;
  color: #b91c1c;
  font-size: 11px;
}

.category-news-content h2 {
  margin: 0 0 7px;
  font-size: 22px;
  font-weight: 850;
  line-height: 1.32;
  letter-spacing: -0.03em;
}

.category-news-content h2 a:hover {
  color: #b91c1c;
}

.category-news-meta {
  margin-bottom: 8px;
  font-size: 12px;
  color: #777777;
}

.category-news-content p {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #555555;
  font-size: 14px;
  line-height: 1.6;
}

.category-news-empty {
  padding: 24px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #ffffff;
  color: #6b7280;
}

@media (max-width: 760px) {
  .category-news-header {
    margin-bottom: 12px;
    padding: 16px 0 12px;
  }

  .category-news-header h1 {
    font-size: 28px;
  }

  .category-news-list {
    border-radius: 12px;
  }

  .category-news-card.post-card {
    grid-template-columns: 116px minmax(0, 1fr);
    gap: 12px;
    padding: 13px 0;
  }

  .category-news-thumb {
    margin-left: 12px;
    border-radius: 8px;
  }

  .category-news-thumb img {
    height: 82px;
  }

  .category-news-content.post-card-content {
    padding: 0 12px 0 0;
  }

  .category-news-content .category-badge {
    display: none;
  }

  .category-news-content h2 {
    margin-bottom: 5px;
    font-size: 15px;
    line-height: 1.38;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .category-news-meta {
    margin-bottom: 0;
    font-size: 11px;
  }

  .category-news-content p {
    display: none;
  }
}

@media (max-width: 420px) {
  .category-news-card.post-card {
    grid-template-columns: 104px minmax(0, 1fr);
  }

  .category-news-thumb img {
    height: 76px;
  }
}

/* Mobile global category/menu centering - applies to every page */
@media (max-width: 980px) {
  .site-nav-wrap .site-nav-inner {
    justify-content: center !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .site-nav-wrap .main-navigation {
    width: 100% !important;
    min-width: 0 !important;
  }

  .site-nav-wrap .main-navigation ul,
  .site-nav-wrap .main-navigation .menu {
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 0 18px !important;
    margin: 0 auto !important;
    padding-left: 0 !important;
    text-align: center !important;
  }

  .site-nav-wrap .main-navigation li {
    margin: 0 !important;
    text-align: center !important;
  }

  .site-nav-wrap .main-navigation a {
    min-height: 44px !important;
    justify-content: center !important;
    text-align: center !important;
  }
}

@media (max-width: 420px) {
  .site-nav-wrap .main-navigation ul,
  .site-nav-wrap .main-navigation .menu {
    gap: 0 14px !important;
  }

  .site-nav-wrap .main-navigation a {
    font-size: 14px !important;
  }
}

/* MEDIAKING: Naver-style hashtag buttons */
.post-tags {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid #eeeeee;
    font-size: 13px;
    color: #555555;
}

.post-tags strong {
    display: inline-block;
    margin-right: 8px;
    font-size: 12px;
    color: #777777;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .02em;
}

.post-tags a,
.tagcloud a {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 10px;
    margin: 3px 4px 3px 0;
    border: 1px solid #e4e6eb;
    border-radius: 999px;
    background: #f7f8fa;
    color: #222222;
    font-size: 12px !important;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    transition: background .18s ease, border-color .18s ease, transform .18s ease;
}

.post-tags a::before,
.tagcloud a::before {
    content: '#';
    margin-right: 1px;
    color: #0a7cff;
    font-weight: 800;
}

.post-tags a:hover,
.tagcloud a:hover {
    background: #eef5ff;
    border-color: #bfd8ff;
    color: #0a57c2;
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .post-tags {
        margin-top: 18px;
        padding-top: 14px;
    }

    .post-tags strong {
        display: block;
        margin: 0 0 8px;
    }

    .post-tags a,
    .tagcloud a {
        min-height: 30px;
        padding: 6px 10px;
        margin: 3px 3px 4px 0;
        font-size: 12px !important;
    }
}
/* MEDIAKING scroll mini bar: logo + category above reading progress */
.mk-scroll-mini-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 44px;
    background: rgba(255, 255, 255, 0.97);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    z-index: 2147483646;
    transform: translateY(-110%);
    opacity: 0;
    transition: transform .22s ease, opacity .22s ease;
    pointer-events: none;
}

body.mk-mini-visible .mk-scroll-mini-bar {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.mk-scroll-mini-inner {
    max-width: 1180px;
    height: 44px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: 18px;
    overflow: hidden;
}

.mk-scroll-mini-logo {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #111;
    text-decoration: none;
    font-family: 'Montserrat', sans-serif;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: .2px;
    line-height: 1;
    white-space: nowrap;
}

.mk-scroll-mini-logo img {
    width: 25px;
    height: 25px;
    object-fit: contain;
    display: block;
}

.mk-scroll-mini-cats {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
}

.mk-scroll-mini-cats ul,
.mk-scroll-mini-cats .menu {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
    white-space: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.mk-scroll-mini-cats ul::-webkit-scrollbar,
.mk-scroll-mini-cats .menu::-webkit-scrollbar {
    display: none;
}

.mk-scroll-mini-cats li {
    margin: 0;
    padding: 0;
    flex: 0 0 auto;
}

.mk-scroll-mini-cats a {
    display: inline-flex;
    align-items: center;
    height: 44px;
    color: #222;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
}

.mk-scroll-mini-cats a:hover {
    color: #0a57c2;
}

/* When the mini bar appears, push the existing yellow reading progress bar below it. */
body.mk-mini-visible #reading-progress-bar {
    top: 44px !important;
}

@media (max-width: 768px) {
    .mk-scroll-mini-bar,
    .mk-scroll-mini-inner {
        height: 40px;
    }

    .mk-scroll-mini-inner {
        padding: 0 10px;
        gap: 10px;
    }

    .mk-scroll-mini-logo {
        font-size: 13px;
        max-width: 42%;
        overflow: hidden;
    }

    .mk-scroll-mini-logo span {
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mk-scroll-mini-logo img {
        width: 22px;
        height: 22px;
    }

    .mk-scroll-mini-cats ul,
    .mk-scroll-mini-cats .menu {
        gap: 12px;
    }

    .mk-scroll-mini-cats a {
        height: 40px;
        font-size: 12px;
    }

    body.mk-mini-visible #reading-progress-bar {
        top: 40px !important;
    }
}


/* ===== FIX: Center scroll mini bar + remove mobile horizontal scroll ===== */
.mk-scroll-mini-inner {
    max-width: 1180px !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 18px !important;
    text-align: center !important;
}

.mk-scroll-mini-logo {
    flex: 0 0 auto !important;
    margin: 0 !important;
}

.mk-scroll-mini-cats {
    flex: 0 1 auto !important;
    min-width: 0 !important;
    max-width: calc(100% - 160px) !important;
    display: flex !important;
    justify-content: center !important;
    overflow: hidden !important;
}

.mk-scroll-mini-cats ul,
.mk-scroll-mini-cats .menu {
    width: auto !important;
    max-width: 100% !important;
    justify-content: center !important;
    overflow-x: hidden !important;
    white-space: nowrap !important;
    flex-wrap: nowrap !important;
}

/* Mobile: no horizontal scroll, compact centered categories */
@media (max-width: 768px) {
    .mk-scroll-mini-inner {
        width: 100% !important;
        max-width: 100% !important;
        height: 40px !important;
        padding-left: 8px !important;
        padding-right: 8px !important;
        gap: 8px !important;
        justify-content: center !important;
        overflow: hidden !important;
    }

    .mk-scroll-mini-logo {
        max-width: 34% !important;
        min-width: 0 !important;
        flex: 0 1 auto !important;
        font-size: 12px !important;
        gap: 5px !important;
    }

    .mk-scroll-mini-logo img {
        width: 20px !important;
        height: 20px !important;
        flex: 0 0 auto !important;
    }

    .mk-scroll-mini-logo span {
        display: inline-block !important;
        max-width: 100% !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    .mk-scroll-mini-cats {
        flex: 1 1 auto !important;
        max-width: 66% !important;
        overflow: hidden !important;
        justify-content: center !important;
    }

    .mk-scroll-mini-cats ul,
    .mk-scroll-mini-cats .menu {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-wrap: nowrap !important;
        gap: 8px !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
        white-space: nowrap !important;
    }

    .mk-scroll-mini-cats li {
        flex: 0 1 auto !important;
        min-width: 0 !important;
        max-width: 72px !important;
        overflow: hidden !important;
    }

    .mk-scroll-mini-cats a {
        height: 40px !important;
        max-width: 72px !important;
        display: inline-flex !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        font-size: 11.5px !important;
        line-height: 1 !important;
    }
}

@media (max-width: 420px) {
    .mk-scroll-mini-inner {
        gap: 6px !important;
        padding-left: 6px !important;
        padding-right: 6px !important;
    }

    .mk-scroll-mini-logo {
        max-width: 32% !important;
        font-size: 11.5px !important;
    }

    .mk-scroll-mini-cats {
        max-width: 68% !important;
    }

    .mk-scroll-mini-cats ul,
    .mk-scroll-mini-cats .menu {
        gap: 6px !important;
    }

    .mk-scroll-mini-cats li,
    .mk-scroll-mini-cats a {
        max-width: 58px !important;
    }

    .mk-scroll-mini-cats a {
        font-size: 11px !important;
    }
}


/* ===== MEDIAKING FINAL MOBILE SINGLE FIX =====
   Keep the existing progress bar, but force the mini logo/category bar
   to work and stay centered on mobile single pages. */
.mk-scroll-mini-bar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    display: block !important;
    visibility: visible !important;
    z-index: 2147483646 !important;
}

body.mk-mini-visible .mk-scroll-mini-bar {
    transform: translateY(0) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

.mk-scroll-mini-inner {
    width: 100% !important;
    max-width: 980px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    overflow: hidden !important;
}

.mk-scroll-mini-logo {
    flex: 0 0 auto !important;
}

.mk-scroll-mini-cats {
    flex: 0 1 auto !important;
    min-width: 0 !important;
    overflow: hidden !important;
    display: flex !important;
    justify-content: center !important;
}

.mk-scroll-mini-cats ul,
.mk-scroll-mini-cats .menu {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-wrap: nowrap !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    max-width: 100% !important;
}

body.mk-mini-visible #reading-progress-bar {
    top: 44px !important;
}

@media (max-width: 768px) {
    .mk-scroll-mini-bar,
    .mk-scroll-mini-inner {
        height: 40px !important;
    }

    .mk-scroll-mini-inner {
        max-width: 100% !important;
        padding-left: 8px !important;
        padding-right: 8px !important;
        gap: 8px !important;
    }

    .mk-scroll-mini-logo {
        max-width: 35% !important;
        min-width: 0 !important;
        font-size: 12px !important;
        overflow: hidden !important;
    }

    .mk-scroll-mini-logo img {
        width: 20px !important;
        height: 20px !important;
        flex: 0 0 auto !important;
    }

    .mk-scroll-mini-logo span {
        display: inline-block !important;
        max-width: 100% !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    .mk-scroll-mini-cats {
        max-width: 65% !important;
    }

    .mk-scroll-mini-cats ul,
    .mk-scroll-mini-cats .menu {
        width: 100% !important;
        gap: 7px !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
    }

    .mk-scroll-mini-cats li {
        flex: 0 1 auto !important;
        min-width: 0 !important;
        max-width: 60px !important;
        overflow: hidden !important;
    }

    .mk-scroll-mini-cats a {
        height: 40px !important;
        max-width: 60px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        font-size: 11px !important;
    }

    body.mk-mini-visible #reading-progress-bar {
        top: 40px !important;
    }
}


/* ===== BOMUL LINK CARD: main right 4th card + sidebar ===== */
.hero-sub {
  grid-template-rows: repeat(4, minmax(0, 1fr)) !important;
}

.hero-sub .hero-sub-ad-card img {
  width: 128px !important;
  height: 90px !important;
  object-fit: cover !important;
  border-radius: 12px !important;
}

.sidebar-bomul-widget {
  padding: 0 !important;
  overflow: hidden !important;
}

.sidebar-bomul-link {
  display: block !important;
}

.sidebar-bomul-link img {
  width: 100% !important;
  height: auto !important;
  display: block !important;
}

@media (max-width: 640px) {
  .hero-sub .hero-sub-ad-card img {
    width: 96px !important;
    height: 72px !important;
  }
}
