:root {
  color-scheme: light;
  --bg: #f7f8fa;
  --panel: #ffffff;
  --text: #17202a;
  --muted: #667085;
  --line: #d9dee7;
  --accent: #0f766e;
  --accent-dark: #115e59;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  min-height: 104px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  background-color: rgba(7, 39, 50, 0.58);
  background-image: url("/images/ms-on-trip-header.webp");
  background-position: center 34%;
  background-size: cover;
  background-blend-mode: multiply;
  box-shadow: 0 3px 12px rgba(14, 35, 44, 0.18);
}

.brand {
  color: #fff;
  font-size: 23px;
  font-weight: 800;
  letter-spacing: 0;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
}

nav {
  display: flex;
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
}

.site-header nav {
  color: #fff;
  font-weight: 700;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.65);
}

.site-header nav a {
  border-bottom: 2px solid transparent;
}

.site-header nav a:hover,
.site-header nav a:focus-visible {
  border-bottom-color: #fff;
}

.intro {
  padding: 72px clamp(18px, 5vw, 72px) 52px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, #ffffff 0%, #eef7f4 100%);
}

.intro h1 {
  max-width: 820px;
  margin: 8px 0 14px;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1.08;
}

.intro p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
}

.eyebrow {
  color: var(--accent-dark) !important;
  font-size: 13px !important;
  font-weight: 800;
  text-transform: uppercase;
}

.content,
.about {
  width: min(1040px, calc(100% - 36px));
  margin: 0 auto;
  padding: 42px 0;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-title h2,
.about h2 {
  margin: 0;
  font-size: 24px;
}

button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  padding: 8px 14px;
}

button:hover {
  border-color: var(--accent);
}

.post-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.category-filter {
  display: inline-flex;
  margin-bottom: 18px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f5f7f9;
}

.category-filter button {
  min-height: 34px;
  padding: 6px 13px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
}

.category-filter button[aria-pressed="true"] {
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 3px rgba(20, 29, 38, 0.12);
}

.category-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 24px;
  margin-bottom: 9px;
  padding: 3px 8px;
  border-radius: 4px;
  background: #e7f3ef;
  color: #17664f;
  font-size: 12px;
  font-weight: 800;
}

.meta .category-badge {
  min-height: 0;
  margin-bottom: 0;
}

.post-card {
  overflow: hidden;
  min-height: 190px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 18px;
  cursor: pointer;
  text-align: left;
}

.post-card:hover {
  border-color: var(--accent);
}

.post-card h3 {
  margin: 0 0 10px;
  font-size: 19px;
  line-height: 1.35;
}

.thumb {
  display: block;
  width: calc(100% + 36px);
  height: 150px;
  margin: -18px -18px 16px;
  object-fit: cover;
  border-bottom: 1px solid var(--line);
  background: #e8edf2;
}

.post-card p,
.meta,
.about p {
  color: var(--muted);
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  font-size: 13px;
}

.post-view {
  margin-top: 28px;
  border-top: 1px solid var(--line);
  padding-top: 28px;
}

.post-view h1 {
  margin: 0 0 10px;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.15;
}

.post-body {
  max-width: 780px;
  line-height: 1.85;
}

.hero-image {
  display: block;
  width: min(780px, 100%);
  max-height: 440px;
  margin: 22px 0;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #e8edf2;
}

.image-credit {
  margin: -12px 0 22px;
  color: var(--muted);
  font-size: 13px;
}

.post-body h2 {
  margin: 42px 0 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--line);
  font-size: 25px;
}

.post-body h3 {
  margin: 26px 0 10px;
  font-size: 19px;
}

.post-body p,
.post-body li {
  font-size: 17px;
}

.post-body > p:first-child {
  color: var(--muted);
  font-size: 18px;
}

.post-body p {
  margin: 0 0 18px;
  word-break: keep-all;
}

.post-body li {
  margin-bottom: 9px;
}

.post-body a {
  color: #1769aa;
  text-underline-offset: 3px;
}

.post-body img {
  display: block;
  width: 100%;
  height: auto;
  margin: 22px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.table-wrap {
  width: 100%;
  margin: 22px 0;
  overflow-x: auto;
}

.post-body table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 15px;
}

.post-body th,
.post-body td {
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.post-body th {
  background: #1769aa;
  color: #fff;
}

.post-body tr:nth-child(even) td {
  background: #f5f7f9;
}

.summary-box,
.tip-box,
.insight-box,
.warning-box,
.disclosure-box,
.faq-item,
.post-body blockquote {
  margin: 20px 0;
  padding: 17px 20px;
  border-left: 4px solid #1769aa;
  border-radius: 6px;
  background: #f3f7fb;
}

.tip-box,
.insight-box {
  border-left-color: #bb7600;
  background: #fff9ed;
}

.warning-box {
  border-left-color: #bd3939;
  background: #fff3f3;
}

.disclosure-box {
  box-sizing: border-box;
  width: min(780px, 100%);
  margin-top: 20px;
  margin-bottom: 34px;
  border: 1px solid #d9dde2;
  border-left: 4px solid #555;
  background: #f7f7f7;
  color: #333;
  font-size: 14px;
}

.disclosure-title {
  display: block;
  margin-bottom: 7px;
  color: #222;
  font-size: 15px;
}

.disclosure-box p:first-of-type {
  margin-top: 0;
}

.affiliate-link {
  display: inline-block;
  margin: 4px 0;
  padding: 10px 14px;
  border: 1px solid #1769aa;
  border-radius: 6px;
  background: #fff;
  font-weight: 700;
  text-decoration: none;
}

.faq-item {
  border-left-width: 3px;
}

.summary-box p:last-child,
.tip-box p:last-child,
.insight-box p:last-child,
.warning-box p:last-child,
.disclosure-box p:last-child,
.faq-item p:last-child,
.post-body blockquote p:last-child {
  margin-bottom: 0;
}

.empty {
  grid-column: 1 / -1;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  padding: 24px;
}

.post-discovery {
  width: min(780px, 100%);
  margin-top: 56px;
}

.post-navigation {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.post-nav-link {
  display: flex;
  min-width: 0;
  padding: 20px 18px 22px 0;
  flex-direction: column;
  gap: 5px;
}

.post-nav-link + .post-nav-link,
.post-nav-empty + .post-nav-link {
  padding-right: 0;
  padding-left: 18px;
  border-left: 1px solid var(--line);
}

.post-nav-next {
  align-items: flex-end;
  text-align: right;
}

.post-nav-link span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.post-nav-link strong {
  max-width: 100%;
  font-size: 16px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.post-nav-link:hover strong {
  color: var(--accent-dark);
}

.related-posts {
  margin-top: 34px;
}

.related-posts h2 {
  margin: 0 0 16px;
  font-size: 22px;
}

.related-post-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.related-post {
  display: grid;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}

.related-post:hover {
  border-color: var(--accent);
}

.related-post img,
.related-post-placeholder {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-bottom: 1px solid var(--line);
  background: #e8edf2;
  object-fit: cover;
}

.related-post-copy {
  display: flex;
  min-width: 0;
  padding: 13px 14px 14px;
  flex-direction: column;
  gap: 8px;
}

.related-post-copy strong {
  font-size: 15px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.related-post-copy small {
  color: var(--muted);
  font-size: 12px;
}

.site-footer {
  display: grid;
  gap: 12px;
  padding: 30px clamp(18px, 4vw, 56px);
  border-top: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 13px;
}

.site-footer strong {
  color: var(--text);
  font-size: 15px;
}

.site-footer nav {
  flex-wrap: wrap;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 640px) {
  .site-header {
    min-height: 112px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    background-position: 56% 32%;
  }

  .site-header nav {
    width: auto;
    align-self: stretch;
    justify-content: flex-start;
    gap: 24px;
  }

  .intro {
    padding-top: 48px;
  }

  .post-navigation,
  .related-post-list {
    grid-template-columns: 1fr;
  }

  .post-nav-empty {
    display: none;
  }

  .post-nav-link,
  .post-nav-link + .post-nav-link,
  .post-nav-empty + .post-nav-link {
    padding: 16px 0;
    border-left: 0;
  }

  .post-nav-link + .post-nav-link {
    border-top: 1px solid var(--line);
  }

  .post-nav-next {
    align-items: flex-start;
    text-align: left;
  }

  .related-post {
    grid-template-columns: 112px minmax(0, 1fr);
  }

  .related-post img,
  .related-post-placeholder {
    height: 100%;
    min-height: 96px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }
}

@media print {
  @page {
    size: A4;
    margin: 14mm 13mm 16mm;
  }

  body {
    background: #fff;
    color: #171717;
    font-size: 10.5pt;
  }

  .site-header,
  .intro,
  .section-title,
  #post-list,
  .post-discovery,
  .site-footer {
    display: none !important;
  }

  .content {
    width: auto;
    max-width: none;
    margin: 0;
    padding: 0;
  }

  .post-view {
    display: block !important;
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  .post-view > h1 {
    margin: 0 0 8mm;
    font-size: 23pt;
    line-height: 1.25;
  }

  .post-view > .meta {
    margin-bottom: 6mm;
  }

  .hero-image {
    max-height: 92mm;
    margin: 0 0 3mm;
    object-fit: cover;
    border-radius: 0;
  }

  .image-credit {
    margin-bottom: 8mm;
    font-size: 8pt;
  }

  .post-body {
    font-size: 10.5pt;
    line-height: 1.72;
  }

  .post-body > p:first-child {
    font-size: 11pt;
  }

  .post-body h2,
  .post-body h3 {
    break-after: avoid-page;
  }

  .post-body h2 {
    margin-top: 9mm;
    font-size: 16pt;
  }

  .post-body h3 {
    font-size: 12.5pt;
  }

  .table-wrap {
    overflow: visible;
  }

  .post-body table {
    min-width: 0;
    font-size: 8.5pt;
  }

  .post-body th,
  .post-body td {
    padding: 2.3mm 2.5mm;
  }

  .summary-box,
  .tip-box,
  .insight-box,
  .warning-box,
  .disclosure-box,
  .faq-item,
  .post-body blockquote,
  .post-body table {
    break-inside: avoid-page;
  }

  .affiliate-link {
    color: #111;
    border-color: #777;
  }

  a {
    color: #111 !important;
  }
}
