/* JLPT180 SEO/Public v0.3.5 - scoped to virtual public SEO routes only */
#jlpt180-seo-public,
#jlpt180-seo-public * { box-sizing: border-box; }

#jlpt180-seo-public.jlpt180-seo-public {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
  color: #172033;
  font-family: inherit;
  overflow-wrap: anywhere;
}

#jlpt180-seo-public a { text-decoration: none; }

.j180seo-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.5;
}

.j180seo-breadcrumb a { color: #315f4b; }
.j180seo-breadcrumb span { color: #687386; }

.j180seo-hero {
  padding: clamp(22px, 5vw, 46px);
  border: 1px solid rgba(30, 72, 55, .16);
  border-radius: 24px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 14px 40px rgba(28, 42, 35, .08);
}

.j180seo-kicker {
  margin: 0 0 8px;
  font-weight: 800;
  color: #3d725c;
  letter-spacing: .02em;
}

.j180seo-hero h1 {
  margin: 0;
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1.12;
  color: #172033;
}

.j180seo-lead {
  max-width: 850px;
  margin: 16px 0 0;
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.75;
  color: #4e596a;
}

.j180seo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.j180seo-btn {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 11px 17px;
  border: 1px solid #cfd7d3;
  border-radius: 14px;
  background: #fff;
  color: #26332e;
  font-weight: 800;
}

.j180seo-btn-primary {
  border-color: #2d6a4f;
  background: #2d6a4f;
  color: #fff;
}

.j180seo-level-grid,
.j180seo-topic-grid,
.j180seo-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.j180seo-level-card,
.j180seo-topic-card,
.j180seo-stat,
.j180seo-copy {
  min-width: 0;
  border: 1px solid rgba(30, 72, 55, .13);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(28, 42, 35, .055);
}

.j180seo-level-card,
.j180seo-topic-card { padding: 20px; }

.j180seo-level-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  min-height: 36px;
  padding: 7px 12px;
  border-radius: 999px;
  background: #eef7f2;
  color: #2d6a4f;
  font-weight: 900;
}

.j180seo-level-card h2,
.j180seo-topic-card h3 {
  margin: 14px 0 8px;
  color: #172033;
}

.j180seo-level-card h2 a { color: inherit; }
.j180seo-level-card p,
.j180seo-topic-card p,
.j180seo-copy p { line-height: 1.7; color: #566173; }

.j180seo-link { color: #286147; font-weight: 850; }

.j180seo-section { margin-top: 36px; }
.j180seo-section > h2 { margin: 0 0 12px; font-size: clamp(23px, 3vw, 32px); color: #172033; }

.j180seo-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.j180seo-stat { padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.j180seo-stat-label { color: #687386; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.j180seo-stat-value { font-size: clamp(28px, 4vw, 38px); color: #1d513b; }
.j180seo-stat-note { color: #707989; font-size: 13px; line-height: 1.45; }

.j180seo-copy { padding: clamp(20px, 4vw, 30px); }

.j180seo-level-links { display: flex; flex-wrap: wrap; gap: 10px; }
.j180seo-level-link {
  display: inline-flex;
  min-width: 56px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  border: 1px solid #cfd7d3;
  border-radius: 14px;
  background: #fff;
  color: #2e3b35;
  font-weight: 900;
}
.j180seo-level-link.is-current { background: #eef7f2; border-color: #74a58f; color: #215840; }

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

@media (max-width: 520px) {
  #jlpt180-seo-public.jlpt180-seo-public {
    width: min(100% - 24px, 1180px);
    padding-top: 18px;
  }
  .j180seo-hero { border-radius: 18px; padding: 20px 16px; }
  .j180seo-level-grid,
  .j180seo-topic-grid,
  .j180seo-stats { grid-template-columns: 1fr; gap: 12px; }
  .j180seo-level-card,
  .j180seo-topic-card,
  .j180seo-stat { border-radius: 16px; }
  .j180seo-actions { display: grid; grid-template-columns: 1fr; }
  .j180seo-btn { width: 100%; }
}

/* v0.2.0: public content lists + server-side pagination */
.j180seo-category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.j180seo-category-tab {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border: 1px solid #cfd7d3;
  border-radius: 14px;
  background: #fff;
  color: #2e3b35;
  font-weight: 850;
}

.j180seo-category-tab.is-current {
  border-color: #74a58f;
  background: #eef7f2;
  color: #215840;
}

.j180seo-list-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 14px;
}

.j180seo-list-head h2,
.j180seo-list-head p { margin: 0; }
.j180seo-list-head p { color: #687386; line-height: 1.5; }

.j180seo-content-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.j180seo-entry {
  min-width: 0;
  padding: 18px;
  border: 1px solid rgba(30, 72, 55, .13);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(28, 42, 35, .045);
  overflow-wrap: anywhere;
}

.j180seo-entry-head {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: baseline;
}

.j180seo-entry h2 {
  margin: 0;
  color: #172033;
  font-size: clamp(21px, 3vw, 27px);
  line-height: 1.3;
}

.j180seo-reading {
  margin: 0;
  color: #3d725c;
  font-weight: 800;
  font-size: 15px;
}

.j180seo-meaning {
  margin: 10px 0 0;
  color: #303b4b;
  font-size: 16px;
  line-height: 1.65;
}

.j180seo-hanviet,
.j180seo-entry-meta {
  margin: 8px 0 0;
  color: #687386;
  font-size: 13px;
  line-height: 1.55;
}

.j180seo-example {
  margin-top: 12px;
  padding: 12px 14px;
  border-left: 3px solid #8eb8a5;
  border-radius: 0 12px 12px 0;
  background: #f6faf8;
}

.j180seo-example p { margin: 0; line-height: 1.65; }
.j180seo-example p + p { margin-top: 5px; }
.j180seo-example-vi { color: #5e6878; font-size: 14px; }

.j180seo-empty {
  padding: 22px;
  border: 1px solid rgba(30, 72, 55, .13);
  border-radius: 18px;
  background: #fff;
  color: #4e596a;
}
.j180seo-empty p { margin: 8px 0 0; line-height: 1.65; }

.j180seo-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin-top: 24px;
}

.j180seo-page-link {
  display: inline-flex;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border: 1px solid #cfd7d3;
  border-radius: 12px;
  background: #fff;
  color: #2e3b35;
  font-weight: 800;
}

.j180seo-page-link.is-current {
  border-color: #2d6a4f;
  background: #2d6a4f;
  color: #fff;
}

.j180seo-page-gap { color: #7b8491; padding: 0 2px; }

#jlpt180-seo-public code {
  max-width: 100%;
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  .j180seo-content-list { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .j180seo-category-tabs { display: grid; grid-template-columns: 1fr; }
  .j180seo-category-tab { width: 100%; }
  .j180seo-entry { padding: 16px; border-radius: 16px; }
  .j180seo-list-head { align-items: flex-start; }
  .j180seo-pagination { justify-content: flex-start; }
}

/* v0.3.1: compact horizontal homepage SEO strip */
.j180seo-home-nav,
.j180seo-home-nav * { box-sizing: border-box; }

.j180seo-home-nav {
  width: min(1180px, calc(100% - 28px));
  margin: 10px auto 16px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
  border: 1px solid rgba(40, 104, 78, .14);
  border-radius: 15px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 7px 18px rgba(22, 65, 83, .07);
  color: #172033;
  font-family: inherit;
}

body.jlpt180-clean-lobby #view-dashboard .j180seo-home-nav {
  width: 100%;
  margin: 9px 0 2px;
}

.j180seo-home-nav-head {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 3px;
  padding: 2px 4px;
}

.j180seo-home-nav-kicker {
  margin: 0;
  color: #4d7866;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.j180seo-home-nav h2 {
  margin: 0;
  color: #18394a;
  font-size: 15px;
  line-height: 1.15;
  white-space: nowrap;
}

.j180seo-home-nav-head p:not(.j180seo-home-nav-kicker) { display: none; }

.j180seo-home-all-link {
  color: #2f7053;
  font-size: 10px;
  line-height: 1.1;
  font-weight: 850;
  text-decoration: none;
}

.j180seo-home-levels {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
}

.j180seo-home-level-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(53, 111, 87, .12);
  border-radius: 11px;
  background: #fff;
}

.j180seo-home-level-main {
  display: flex;
  min-height: 34px;
  padding: 5px 8px 3px;
  flex-direction: row;
  align-items: baseline;
  justify-content: space-between;
  gap: 5px;
  color: #16374a;
  text-decoration: none;
}

.j180seo-home-level-main strong {
  min-width: 0;
  font-size: 12px;
  line-height: 1.1;
  white-space: nowrap;
}

.j180seo-home-level-main span {
  min-width: 0;
  overflow: hidden;
  color: #78909d;
  font-size: 9px;
  line-height: 1.1;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.j180seo-home-level-sub {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid rgba(53, 111, 87, .08);
}

.j180seo-home-level-sub a {
  min-width: 0;
  padding: 4px 2px 5px;
  color: #47715e;
  font-size: 8px;
  line-height: 1.1;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}

.j180seo-home-level-sub a + a { border-left: 1px solid rgba(53, 111, 87, .08); }

@media (max-width: 900px) {
  .j180seo-home-nav {
    grid-template-columns: 140px minmax(0, 1fr);
    padding: 9px;
  }
  .j180seo-home-levels { grid-template-columns: repeat(5, minmax(82px, 1fr)); }
  .j180seo-home-level-main { padding-left: 6px; padding-right: 6px; }
}

@media (max-width: 700px) {
  .j180seo-home-nav {
    width: calc(100% - 16px);
    grid-template-columns: 1fr;
    gap: 7px;
    padding: 9px;
    border-radius: 13px;
  }
  body.jlpt180-clean-lobby #view-dashboard .j180seo-home-nav { width: 100%; margin-top: 8px; }
  .j180seo-home-nav-head {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 0 2px;
  }
  .j180seo-home-nav-kicker { display: none; }
  .j180seo-home-nav h2 { font-size: 13px; }
  .j180seo-home-all-link { font-size: 9px; }
  .j180seo-home-levels { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
  .j180seo-home-level-main {
    min-height: 29px;
    padding: 4px 2px 2px;
    display: block;
    text-align: center;
  }
  .j180seo-home-level-main strong { display: block; font-size: 10px; }
  .j180seo-home-level-main span { display: none; }
  .j180seo-home-level-sub { display: none; }
}

@media (max-width: 430px) {
  .j180seo-home-levels { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .j180seo-home-level-sub { display: none; }
  .j180seo-home-level-main { min-height: 31px; display: flex; align-items: center; justify-content: center; }
}

.j180seo-game-bridge {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr);
  gap: 20px;
  padding: clamp(20px, 4vw, 30px);
  border: 1px solid rgba(30, 72, 55, .13);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(28, 42, 35, .055);
}

.j180seo-game-bridge h2 { margin: 0; color: #172033; }
.j180seo-game-bridge-copy > p:last-child { margin-bottom: 0; color: #596576; line-height: 1.65; }
.j180seo-game-bridge-links { display: grid; gap: 8px; align-content: start; }
.j180seo-game-bridge-links a {
  display: flex;
  min-height: 42px;
  align-items: center;
  padding: 9px 13px;
  border: 1px solid #d5ddd9;
  border-radius: 12px;
  background: #f8fbf9;
  color: #285c45;
  font-weight: 850;
  text-decoration: none;
}

@media (max-width: 900px) {
  .j180seo-game-bridge { grid-template-columns: 1fr; }
}

/* v0.3.3 SAFE MOBILE: never make the SEO block a child of #view-dashboard.
   The footer anchor owns placement on mobile so Sảnh flex/order rules remain untouched. */
.j180seo-home-nav-anchor { display:none !important; }
@media (max-width: 767px) {
  body.jlpt180-clean-lobby > .j180seo-home-nav,
  body.jlpt180-clean-lobby .j180seo-home-nav {
    width:calc(100% - 20px);
    max-width:430px;
    margin:10px auto calc(104px + env(safe-area-inset-bottom, 0px));
  }
}


/* v0.3.5: internal bridge from /jlpt/ to specialist public hub.
   This stylesheet is enqueued only on JLPT virtual routes; homepage/Sảnh remains untouched. */
.j180seo-specialist-bridge {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  padding: clamp(20px, 4vw, 30px);
  border: 1px solid rgba(30, 72, 55, .13);
  border-radius: 20px;
  background: linear-gradient(135deg, #f7fbf8, #fff);
  box-shadow: 0 10px 30px rgba(28, 42, 35, .05);
}
.j180seo-specialist-bridge h2 { margin: 0; color: #172033; font-size: clamp(22px, 3vw, 30px); }
.j180seo-specialist-bridge .j180seo-kicker { margin-bottom: 6px; }
.j180seo-specialist-copy > p:last-child { margin: 9px 0 0; max-width: 780px; color: #596576; line-height: 1.65; }
.j180seo-specialist-action { display: flex; justify-content: flex-end; }
.j180seo-specialist-action .j180seo-btn { white-space: nowrap; }
@media (max-width: 760px) {
  .j180seo-specialist-bridge { grid-template-columns: 1fr; gap: 14px; }
  .j180seo-specialist-action { justify-content: flex-start; }
}
@media (max-width: 520px) {
  .j180seo-specialist-bridge { padding: 18px 16px; border-radius: 16px; }
  .j180seo-specialist-action .j180seo-btn { width: 100%; white-space: normal; }
}
