/*
Theme Name: Medical Live Portal
Theme URI: https://medical-live.local/
Author: Medical Live
Description: Korean medical news portal theme with right popular-news sidebar, category sections, restrained 600px single featured images, and SEO-friendly semantic markup.
Version: 2.7.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: medical-live-portal
Tags: news, blog, custom-logo, featured-images, right-sidebar, grid-layout, responsive-layout
*/

:root {
  --ml-red: #e42d31;
  --ml-red-dark: #c91f23;
  --ml-brand: #111827;
  --ml-brand-muted: #64748b;
  --ml-yellow: #ffbf1c;
  --ml-text: #202124;
  --ml-sub: #5f6368;
  --ml-line: #e5e7eb;
  --ml-bg: #f1f2f4;
  --ml-white: #fff;
  --ml-dark: #111827;
  --ml-max: 1240px;
  --ml-shadow: 0 6px 18px rgba(17,24,39,.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ml-bg);
  color: var(--ml-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", "Apple SD Gothic Neo", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.68;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--ml-red); }
img { max-width: 100%; height: auto; vertical-align: middle; }
button, input, textarea, select { font: inherit; }

.ml-container { width: min(var(--ml-max), calc(100% - 32px)); margin: 0 auto; }
.screen-reader-text { position: absolute; left: -9999px; }

/* Header */
.site-header { background: #fff; border-bottom: 1px solid #efefef; }
.ml-brand-wrap { position: relative; min-height: 126px; display: flex; align-items: center; justify-content: center; text-align: center; }
.site-title { margin: 0; font-size: clamp(34px, 5vw, 54px); line-height: .95; font-weight: 900; letter-spacing: -0.08em; color: var(--ml-brand); }
.site-title a { color: var(--ml-brand); }
.site-description { margin: 10px 0 0; font-size: 12px; color: var(--ml-brand-muted); letter-spacing: .08em; font-weight: 700; }
.custom-logo-link img { max-height: 76px; width: auto; }

.ml-header-tools { position: absolute; right: 0; bottom: 22px; display: flex; gap: 8px; align-items: center; }
.ml-circle-btn { width: 28px; height: 28px; border-radius: 50%; border: 0; background: var(--ml-dark); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.ml-search-toggle { background: var(--ml-brand); }
.ml-mobile-toggle { display: none; }

.ml-nav-bar { background: var(--ml-red); color: #fff; border-top: 1px solid rgba(255,255,255,.2); }
.ml-nav-inner { min-height: 42px; display: flex; align-items: center; justify-content: center; }
.primary-menu { margin: 0; padding: 0; list-style: none; display: flex; align-items: center; gap: 0; flex-wrap: wrap; justify-content: center; }
.primary-menu li { position: relative; }
.primary-menu a { display: block; padding: 12px 18px; color: #fff; font-weight: 800; font-size: 15px; line-height: 1; }
.primary-menu a:hover { background: var(--ml-red-dark); color: #fff; }
.primary-menu .sub-menu { display: none; position: absolute; top: 100%; left: 0; min-width: 190px; background: #fff; color: var(--ml-text); list-style: none; margin: 0; padding: 8px 0; box-shadow: var(--ml-shadow); z-index: 50; }
.primary-menu li:hover > .sub-menu { display: block; }
.primary-menu .sub-menu a { color: var(--ml-text); padding: 10px 14px; }

.ml-search-panel { display: none; padding: 14px 0; background: #fff; border-bottom: 1px solid var(--ml-line); }
.ml-search-panel.is-open { display: block; }
.search-form { display: flex; gap: 8px; }
.search-field { width: 100%; border: 1px solid var(--ml-line); border-radius: 0; padding: 12px 14px; background: #fff; }
.search-submit, .ml-btn { border: 0; background: var(--ml-red); color: #fff; font-weight: 800; padding: 12px 18px; cursor: pointer; }
.search-submit:hover, .ml-btn:hover { background: var(--ml-red-dark); color: #fff; }

/* Home top line */
.ml-main { padding: 20px 0 44px; }
.ml-live-strip { display: grid; grid-template-columns: 58px repeat(3, 1fr); gap: 16px; align-items: center; background: #fff; padding: 14px 16px; margin-bottom: 16px; overflow: hidden; }
.ml-live-badge { width: 52px; height: 52px; background: var(--ml-red); color: #fff; border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; font-weight: 900; font-size: 14px; }
.ml-strip-item { display: grid; grid-template-columns: 60px 1fr; gap: 12px; align-items: center; min-width: 0; }
.ml-strip-item img { width: 60px; height: 44px; object-fit: cover; background: #f3f4f6; }
.ml-strip-item-title { margin: 0; font-size: 14px; line-height: 1.35; font-weight: 800; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Portal layout */
.ml-top-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.ml-card, .ml-box { background: #fff; border: 1px solid #e7e8ec; }
.ml-hero-card { position: relative; min-height: 460px; overflow: hidden; display: block; background: #d1d5db; }
.ml-hero-card img { width: 100%; height: 460px; object-fit: cover; }
.ml-hero-card::after, .ml-overlay-card::after { content: ""; position: absolute; inset: auto 0 0 0; height: 58%; background: linear-gradient(to top, rgba(0,0,0,.72), rgba(0,0,0,0)); pointer-events: none; }
.ml-hero-content, .ml-overlay-content { position: absolute; left: 20px; right: 20px; bottom: 18px; z-index: 1; color: #fff; }
.ml-category-label { display: inline-block; padding: 6px 9px; background: var(--ml-yellow); color: #1f2937; font-size: 12px; line-height: 1; font-weight: 900; margin-bottom: 10px; }
.ml-hero-title { margin: 0; font-size: clamp(27px, 3vw, 38px); line-height: 1.18; font-weight: 900; letter-spacing: -0.04em; text-shadow: 0 2px 8px rgba(0,0,0,.28); }
.ml-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; color: #eef2f7; font-size: 12px; font-weight: 700; }
.ml-meta.dark { color: var(--ml-sub); }
.ml-meta span::before { content: "◎"; margin-right: 4px; font-size: 10px; opacity: .7; }
.ml-meta span:first-child::before { content: ""; margin: 0; }

/* Popular */
.ml-sidebar-sticky { position: sticky; top: 20px; }
.ml-section-title { margin: 0 0 16px; font-size: 26px; font-weight: 900; letter-spacing: -0.05em; }
.ml-section-title::after { content: ""; display: block; width: 32px; height: 3px; background: var(--ml-yellow); margin-top: 8px; }
.ml-popular-box { padding: 18px; }
.ml-popular-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 14px; }
.ml-popular-item { display: grid; grid-template-columns: 36px 96px 1fr; gap: 10px; align-items: start; border-bottom: 1px solid #edf0f2; padding-bottom: 14px; }
.ml-popular-item:last-child { border-bottom: 0; padding-bottom: 0; }
.ml-rank { width: 34px; height: 34px; background: var(--ml-yellow); color: #111; font-weight: 900; display: inline-flex; align-items: center; justify-content: center; }
.ml-popular-thumb img { width: 96px; height: 78px; object-fit: cover; background: #f3f4f6; }
.ml-popular-title { margin: 4px 0 0; font-size: 14px; line-height: 1.38; font-weight: 850; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ml-popular-cat { font-size: 11px; font-weight: 800; color: var(--ml-sub); }

/* Category blocks */
.ml-home-section { margin-top: 22px; }
.ml-section-head { display: flex; justify-content: space-between; align-items: end; margin: 0 0 14px; }
.ml-section-head .ml-section-title { margin-bottom: 0; }
.ml-more-link { font-size: 13px; font-weight: 900; color: var(--ml-sub); }
.ml-overlay-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.ml-overlay-card { position: relative; min-height: 250px; display: block; overflow: hidden; background: #d1d5db; }
.ml-overlay-card img { width: 100%; height: 250px; object-fit: cover; transition: transform .25s ease; }
.ml-overlay-card:hover img { transform: scale(1.04); }
.ml-overlay-title { margin: 0; color: #fff; font-size: 19px; line-height: 1.28; font-weight: 900; text-shadow: 0 2px 8px rgba(0,0,0,.25); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.ml-compact-section { background: #fff; border: 1px solid #e7e8ec; padding: 18px; }
.ml-compact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px 24px; }
.ml-compact-item { display: grid; grid-template-columns: 138px 1fr; gap: 12px; align-items: center; }
.ml-compact-item img { width: 138px; height: 92px; object-fit: cover; background: #f3f4f6; }
.ml-compact-title { margin: 0; font-size: 14px; line-height: 1.42; font-weight: 850; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.ml-lower-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; margin-top: 22px; }
.ml-list-panel { background: #fff; border: 1px solid #e7e8ec; padding: 18px; }
.ml-news-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 22px; }
.ml-list-item { display: grid; grid-template-columns: 220px 1fr; gap: 22px; align-items: center; border-bottom: 1px solid #edf0f2; padding-bottom: 22px; }
.ml-list-item:last-child { border-bottom: 0; padding-bottom: 0; }
.ml-list-thumb img { width: 220px; height: 156px; object-fit: cover; background: #f3f4f6; }
.ml-list-title { margin: 4px 0 8px; font-size: 21px; line-height: 1.35; font-weight: 900; letter-spacing: -0.03em; }
.ml-excerpt { margin: 0 0 12px; color: var(--ml-sub); font-size: 15px; }
.ml-read-more { display: inline-flex; border: 1px solid #d1d5db; padding: 7px 13px; font-size: 13px; font-weight: 800; color: var(--ml-text); }
.ml-read-more:hover { border-color: var(--ml-red); color: var(--ml-red); }
.ml-ad-box { background: #fff; border: 1px solid #e7e8ec; min-height: 260px; display: flex; align-items: center; justify-content: center; padding: 22px; text-align: center; }
.ml-ad-logo { font-size: 28px; font-weight: 950; letter-spacing: -0.08em; color: var(--ml-dark); }
.ml-ad-logo b { background: var(--ml-red); color: #fff; padding: 0 5px; margin-left: 3px; }
.ml-ad-box img { max-width: 100%; height: auto; }

/* Archive / single */
.ml-content-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.ml-page-panel { background: #fff; border: 1px solid #e7e8ec; padding: clamp(22px, 4vw, 42px); }
.ml-archive-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.ml-standard-card { background: #fff; border: 1px solid #e7e8ec; overflow: hidden; }
.ml-standard-card img { width: 100%; height: 210px; object-fit: cover; background: #f3f4f6; }
.ml-standard-body { padding: 16px; }
.ml-standard-title { margin: 4px 0 8px; font-size: 20px; line-height: 1.35; font-weight: 900; }

.ml-article-header { margin-bottom: 24px; text-align: left; }
.ml-article-kicker { color: var(--ml-red); font-weight: 900; font-size: 14px; margin-bottom: 8px; }
.ml-article-title { margin: 0; font-size: clamp(30px, 4vw, 44px); line-height: 1.18; font-weight: 950; letter-spacing: -0.055em; }
.ml-deck { margin: 16px 0 0; color: var(--ml-sub); font-size: 18px; line-height: 1.65; border-left: 4px solid var(--ml-yellow); padding-left: 14px; }
.ml-single-featured { max-width: 600px; margin: 24px auto; text-align: center; }
.ml-single-featured img { width: auto; max-width: 600px; max-height: 480px; object-fit: contain; }
.ml-caption { color: var(--ml-sub); font-size: 13px; margin-top: 8px; }
.ml-article-content { font-size: 17px; line-height: 1.86; color: #222; }
.ml-article-content p { margin: 0 0 1.05em; }
.ml-article-content h2 { font-size: 27px; line-height: 1.35; margin: 2em 0 .7em; letter-spacing: -0.05em; }
.ml-article-content h3 { font-size: 22px; line-height: 1.38; margin: 1.6em 0 .6em; letter-spacing: -0.04em; }
.ml-article-content blockquote { margin: 1.4em 0; border-left: 4px solid var(--ml-red); background: #f8f9fb; padding: 16px 18px; color: #374151; }
.ml-article-content img { max-width: 100%; height: auto; }
.ml-source-note { margin-top: 30px; padding: 16px; background: #f8f9fb; border: 1px solid var(--ml-line); color: var(--ml-sub); font-size: 14px; }
.ml-tags { margin-top: 26px; display: flex; gap: 8px; flex-wrap: wrap; }
.ml-tags a { padding: 6px 10px; border: 1px solid var(--ml-line); color: var(--ml-sub); font-size: 13px; }
.ml-related { margin-top: 30px; }
.ml-related-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }

.navigation.pagination { margin: 28px 0 0; }
.nav-links { display: flex; gap: 6px; flex-wrap: wrap; }
.page-numbers { display: inline-flex; min-width: 36px; height: 36px; align-items: center; justify-content: center; border: 1px solid var(--ml-line); background: #fff; color: var(--ml-text); font-weight: 800; }
.page-numbers.current { background: var(--ml-red); border-color: var(--ml-red); color: #fff; }

.site-footer { background: #15171b; color: #d1d5db; padding: 34px 0; margin-top: 22px; }
.footer-inner { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: center; }
.footer-logo { font-size: 24px; font-weight: 950; color: #fff; letter-spacing: -0.06em; }
.footer-logo b { color: var(--ml-red); }
.footer-info { margin: 6px 0 0; color: #9ca3af; font-size: 13px; }
.footer-menu { list-style: none; display: flex; gap: 14px; flex-wrap: wrap; margin: 0; padding: 0; font-size: 13px; }

@media (max-width: 980px) {
  .ml-top-layout, .ml-lower-layout, .ml-content-layout { grid-template-columns: 1fr; }
  .ml-sidebar-sticky { position: static; }
  .ml-live-strip { grid-template-columns: 58px 1fr; }
  .ml-strip-item:nth-child(n+4) { display: none; }
  .ml-overlay-grid { grid-template-columns: 1fr; }
  .ml-compact-grid { grid-template-columns: 1fr 1fr; }
  .ml-related-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .ml-container { width: min(100% - 22px, var(--ml-max)); }
  .ml-brand-wrap { min-height: 100px; }
  .site-title { font-size: 38px; }
  .ml-header-tools { right: 0; bottom: 14px; }
  .ml-mobile-toggle { display: inline-flex; }
  .ml-nav-inner { display: none; align-items: stretch; }
  .ml-nav-inner.is-open { display: block; }
  .primary-menu { display: block; width: 100%; }
  .primary-menu a { padding: 14px 12px; border-bottom: 1px solid rgba(255,255,255,.18); }
  .primary-menu .sub-menu { position: static; display: block; box-shadow: none; background: var(--ml-red-dark); }
  .primary-menu .sub-menu a { color: #fff; padding-left: 26px; }
  .ml-hero-card, .ml-hero-card img { min-height: 340px; height: 340px; }
  .ml-hero-content, .ml-overlay-content { left: 14px; right: 14px; bottom: 14px; }
  .ml-compact-grid { grid-template-columns: 1fr; }
  .ml-compact-item { grid-template-columns: 112px 1fr; }
  .ml-compact-item img { width: 112px; height: 78px; }
  .ml-list-item { grid-template-columns: 1fr; gap: 12px; }
  .ml-list-thumb img { width: 100%; height: auto; max-height: 240px; }
  .ml-archive-grid { grid-template-columns: 1fr; }
  .ml-article-title { font-size: 30px; }
  .ml-article-content { font-size: 16px; }
  .ml-single-featured img { width: 100%; max-width: 600px; max-height: none; }
}

/* v2.1: compact popular news + stronger responsive/content stability */
.ml-top-layout-balanced { align-items: start; }
.ml-main-hero-area, .ml-page-panel, .ml-list-panel, .ml-box, .ml-standard-card { min-width: 0; }

.ml-home-popular-sidebar { max-height: none; }
.ml-popular-head { margin-bottom: 8px; }
.ml-popular-head .ml-section-title { margin-bottom: 0; }
.ml-popular-list-compact { gap: 0; }
.ml-popular-item-compact {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px 0;
  border-bottom: 1px solid #edf0f2;
}
.ml-popular-item-compact:first-child { padding-top: 0; }
.ml-popular-item-compact:last-child { border-bottom: 0; padding-bottom: 0; }
.ml-popular-text { min-width: 0; display: block; }
.ml-popular-title {
  margin: 4px 0 3px;
  font-size: 14px;
  line-height: 1.42;
  font-weight: 900;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ml-popular-date { display: block; color: var(--ml-sub); font-size: 12px; line-height: 1.35; }
.ml-popular-thumb { display: none; }

.ml-hero-card, .ml-hero-card img { height: 420px; min-height: 420px; }
.ml-home-section { clear: both; }
.ml-section-head { gap: 12px; }
.ml-more-link { white-space: nowrap; }

/* Make inserted content from the custom editor safe inside the single template. */
.ml-page-panel { overflow: hidden; }
.ml-article-content { max-width: 100%; }
.ml-article-content > * { max-width: 100%; }
.ml-article-content figure,
.ml-article-content .wp-caption,
.ml-article-content .wp-block-image,
.ml-article-content .wp-block-embed,
.ml-article-content .mlne-image-wrap,
.ml-article-content .mlne-summary-box,
.ml-article-content .mlne-quote-box {
  max-width: 100% !important;
  width: auto !important;
}
.ml-article-content iframe,
.ml-article-content video,
.ml-article-content embed,
.ml-article-content object {
  display: block;
  max-width: 100%;
  width: 100%;
}
.ml-article-content iframe[src*="youtube"],
.ml-article-content iframe[src*="youtu.be"] {
  aspect-ratio: 16 / 9;
  height: auto;
}
.ml-article-content table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
}
.ml-article-content img.aligncenter,
.ml-article-content .aligncenter { margin-left: auto; margin-right: auto; }
.ml-article-content .alignleft { float: left; margin: 6px 18px 12px 0; }
.ml-article-content .alignright { float: right; margin: 6px 0 12px 18px; }
.ml-article-content::after { content: ""; display: block; clear: both; }

@media (max-width: 1180px) {
  .ml-top-layout, .ml-lower-layout, .ml-content-layout { grid-template-columns: minmax(0, 1fr) 300px; }
}

@media (max-width: 980px) {
  .ml-top-layout, .ml-lower-layout, .ml-content-layout { grid-template-columns: 1fr; }
  .ml-home-popular-sidebar { position: static; }
  .ml-popular-list-compact { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
  .ml-hero-card, .ml-hero-card img { height: 380px; min-height: 380px; }
  .ml-lower-layout .ml-home-aside { order: 2; }
}

@media (max-width: 720px) {
  .ml-live-strip {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 12px;
  }
  .ml-strip-item:nth-of-type(n+3) { display: none; }
  .ml-hero-card, .ml-hero-card img { height: 310px; min-height: 310px; }
  .ml-hero-title { font-size: 26px; }
  .ml-popular-list-compact { grid-template-columns: 1fr; }
  .ml-hide-popular-mobile .ml-home-popular-sidebar { display: none; }
  .ml-compact-section { padding: 15px; }
  .ml-list-title { font-size: 19px; }
  .ml-article-content .alignleft,
  .ml-article-content .alignright { float: none; margin: 12px auto; display: block; }
}

/* v2.2: newsroom home layout — left latest / center hero / right popular */
.ml-live-strip { display: none; }
.ml-newsdesk {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: stretch;
  margin-bottom: 22px;
}
.ml-newsdesk-latest,
.ml-newsdesk-hero,
.ml-newsdesk-popular { min-width: 0; }
.ml-newsdesk .ml-hero-card,
.ml-newsdesk .ml-hero-card img {
  height: 430px;
  min-height: 430px;
}
.ml-newsdesk .ml-hero-title {
  font-size: clamp(28px, 3.2vw, 42px);
  line-height: 1.16;
}
.ml-newsdesk .ml-hero-card-wrap { height: 100%; }

.ml-rolling-panel {
  height: 430px;
  padding: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.ml-rolling-head {
  flex: 0 0 auto;
  align-items: center;
  margin-bottom: 10px;
}
.ml-rolling-head .ml-section-title {
  margin: 0;
  font-size: 24px;
}
.ml-roll-list {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow: hidden;
  scroll-behavior: smooth;
}
.ml-roll-list.is-paused { scroll-behavior: auto; }
.ml-roll-item {
  border-bottom: 1px solid #edf0f2;
}
.ml-roll-item:last-child { border-bottom: 0; }
.ml-roll-link {
  min-height: 66px;
  padding: 10px 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  color: var(--ml-text);
}
.ml-roll-link:hover .ml-roll-title { color: var(--ml-red); }
.ml-roll-num,
.ml-roll-link .ml-rank {
  width: 30px;
  height: 30px;
  background: var(--ml-yellow);
  color: #111;
  font-weight: 950;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
  margin-top: 2px;
}
.ml-latest-panel .ml-roll-num {
  background: #111827;
  color: #fff;
}
.ml-roll-body { min-width: 0; display: block; }
.ml-roll-cat {
  display: block;
  margin-bottom: 3px;
  color: var(--ml-sub);
  font-size: 11px;
  line-height: 1.2;
  font-weight: 900;
}
.ml-roll-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  font-size: 14px;
  line-height: 1.38;
  font-weight: 900;
  letter-spacing: -0.025em;
}
.ml-roll-date {
  display: block;
  margin-top: 4px;
  color: var(--ml-sub);
  font-size: 12px;
  line-height: 1.25;
}
.ml-roll-empty { display: block; padding: 14px 0; color: var(--ml-sub); font-size: 14px; }

/* Override legacy popular-list styles inside the rolling panel. */
.ml-rolling-panel .ml-popular-list,
.ml-rolling-panel .ml-latest-list { display: block; gap: 0; }
.ml-rolling-panel .ml-popular-item,
.ml-rolling-panel .ml-latest-item { display: block; padding: 0; }
.ml-rolling-panel .ml-popular-title,
.ml-rolling-panel .ml-popular-cat { display: initial; }
.ml-rolling-panel .ml-popular-thumb { display: none; }
.ml-rolling-panel .ml-popular-head { margin-bottom: 10px; }

@media (max-width: 1180px) {
  .ml-newsdesk { grid-template-columns: 260px minmax(0, 1fr) 260px; }
  .ml-rolling-panel,
  .ml-newsdesk .ml-hero-card,
  .ml-newsdesk .ml-hero-card img { height: 400px; min-height: 400px; }
  .ml-roll-link { min-height: 64px; }
}

@media (max-width: 980px) {
  .ml-newsdesk { grid-template-columns: 1fr; }
  .ml-newsdesk-hero { order: 1; }
  .ml-newsdesk-latest { order: 2; }
  .ml-newsdesk-popular { order: 3; }
  .ml-rolling-panel { height: 360px; }
  .ml-newsdesk .ml-hero-card,
  .ml-newsdesk .ml-hero-card img { height: 380px; min-height: 380px; }
}

@media (max-width: 720px) {
  .ml-newsdesk { gap: 14px; }
  .ml-rolling-panel { height: 330px; padding: 14px; }
  .ml-rolling-head .ml-section-title { font-size: 22px; }
  .ml-newsdesk .ml-hero-card,
  .ml-newsdesk .ml-hero-card img { height: 310px; min-height: 310px; }
  .ml-roll-link { min-height: 62px; }
}


/* v2.3: curated hero, safer beauty-medical section, full article index, slower rollers */
.ml-list-panel-head {
  align-items: center;
  margin-bottom: 8px;
}

.ml-more-wrap {
  margin-top: 18px;
  text-align: center;
}

.ml-button-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 20px;
  border: 1px solid var(--ml-red);
  background: #fff;
  color: var(--ml-red);
  font-weight: 900;
  letter-spacing: -0.03em;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}

.ml-button-more:hover {
  background: var(--ml-red);
  color: #fff;
  border-color: var(--ml-red);
}

.ml-archive-header {
  padding: 28px;
  margin-bottom: 18px;
}

.ml-archive-header .ml-kicker {
  margin: 0 0 8px;
  color: var(--ml-red);
  font-size: 13px;
  font-weight: 950;
  letter-spacing: .08em;
}

.ml-archive-header h1 {
  margin: 0 0 8px;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.18;
  letter-spacing: -0.06em;
}

.ml-archive-header p {
  margin: 0;
  color: var(--ml-sub);
  font-size: 16px;
}

.ml-all-news-layout {
  align-items: start;
}

.ml-all-news-ad {
  margin-top: 18px;
}

.ml-empty-state {
  padding: 28px 0;
  color: var(--ml-sub);
  list-style: none;
}

.ml-pagination {
  margin-top: 24px;
}

.ml-pagination ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ml-pagination a,
.ml-pagination span {
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--ml-line);
  background: #fff;
  color: var(--ml-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.ml-pagination .current {
  background: var(--ml-red);
  border-color: var(--ml-red);
  color: #fff;
}

.ml-rolling-panel {
  contain: layout paint;
}

@media (max-width: 720px) {
  .ml-section-head.ml-list-panel-head {
    align-items: flex-start;
  }

  .ml-archive-header {
    padding: 20px;
  }

  .ml-button-more {
    width: 100%;
  }
}

/* v2.4: fixed top news menu, manual rolling controls, official footer */
.ml-roll-controls {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 10px;
}

.ml-roll-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--ml-line);
  background: #fff;
  color: var(--ml-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, color .18s ease;
}

.ml-roll-btn:hover,
.ml-roll-btn:focus {
  background: var(--ml-red);
  border-color: var(--ml-red);
  color: #fff;
  outline: none;
}

.ml-roll-static .ml-roll-controls {
  display: none;
}

.ml-nav-bar .primary-menu a {
  color: #fff;
}

.menu-item-all-news a {
  position: relative;
}

.footer-inner {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  align-items: start;
  gap: 28px;
}

.footer-brand-block {
  min-width: 0;
}

.footer-company-grid {
  min-width: 0;
  display: grid;
  gap: 6px;
  color: #cbd5e1;
  font-size: 13px;
  line-height: 1.7;
}

.footer-company-grid p {
  margin: 0;
}

.footer-company-grid a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-bottom-row {
  grid-column: 1 / -1;
  border-top: 1px solid rgba(255,255,255,.12);
  padding-top: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.footer-copy {
  margin: 0;
  color: #9ca3af;
  font-size: 13px;
}

@media (max-width: 980px) {
  .footer-inner {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .ml-rolling-head {
    align-items: center;
  }
  .ml-roll-btn {
    width: 30px;
    height: 30px;
  }
  .footer-company-grid {
    font-size: 12px;
  }
  .footer-bottom-row {
    align-items: flex-start;
  }
}


/* v2.6: clean header, no red category bar */
.ml-nav-bar { display: none !important; }
.ml-mobile-toggle { display: none !important; }
.site-header { background: #fff; border-bottom: 1px solid var(--ml-line); }
.ml-brand-wrap { min-height: 112px; }
.site-title, .site-title a { color: var(--ml-brand) !important; }
.site-description { color: var(--ml-brand-muted) !important; }
.ml-search-toggle { background: var(--ml-brand) !important; }
.ml-search-toggle:hover, .ml-search-toggle:focus { background: #334155 !important; }
@media (max-width: 720px) {
  .ml-brand-wrap { min-height: 86px; }
  .site-title { font-size: clamp(30px, 8vw, 42px); }
}

/* v2.7: optional menu below logo, softer logo spacing, plain footer contacts */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--ml-line);
}

.ml-brand-wrap {
  min-height: auto !important;
  padding-top: 22px;
  padding-bottom: 20px;
}

.site-title {
  font-size: clamp(28px, 4.2vw, 46px) !important;
  letter-spacing: -0.075em;
}

.site-description {
  margin-top: 8px;
  font-size: 11px;
}

.custom-logo-link img {
  max-height: 66px;
  width: auto;
}

.ml-header-tools {
  bottom: auto !important;
  top: 50%;
  transform: translateY(-50%);
}

.ml-header-menu-row {
  background: #fff;
  border-top: 1px solid #f1f5f9;
  border-bottom: 1px solid var(--ml-line);
}

.ml-header-menu-inner {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ml-top-menu {
  width: 100%;
  justify-content: center;
  gap: 4px;
}

.ml-top-menu a {
  color: #1f2937 !important;
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.025em;
  border-radius: 999px;
}

.ml-top-menu a:hover,
.ml-top-menu a:focus {
  background: #f3f4f6;
  color: var(--ml-red) !important;
}

.ml-top-menu .current-menu-item > a,
.ml-top-menu .current-menu-ancestor > a,
.ml-top-menu .current_page_item > a {
  background: #f8fafc;
  color: #111827 !important;
}

.ml-top-menu .sub-menu {
  border: 1px solid var(--ml-line);
  border-radius: 12px;
  overflow: hidden;
}

.ml-top-menu .sub-menu a {
  border-radius: 0;
  padding: 10px 14px;
  color: #1f2937 !important;
  background: #fff;
}

.footer-company-grid a {
  color: inherit;
  text-decoration: none;
  pointer-events: none;
}

@media (max-width: 720px) {
  .ml-brand-wrap {
    padding-top: 18px;
    padding-bottom: 16px;
  }

  .site-title {
    font-size: clamp(26px, 8vw, 38px) !important;
  }

  .custom-logo-link img {
    max-height: 56px;
  }

  .ml-header-tools {
    right: 0;
  }

  .ml-header-menu-inner {
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .ml-top-menu {
    justify-content: flex-start;
    flex-wrap: nowrap;
    min-width: max-content;
    padding: 4px 0;
  }

  .ml-top-menu a {
    padding: 12px 13px;
    font-size: 13px;
    white-space: nowrap;
  }
}
