@import url("https://fonts.googleapis.com/css2?family=Bai+Jamjuree:wght@400;600;700&display=swap");

:root {
  --bg: #f7faf8;
  --surface: #ffffff;
  --ink: #10201d;
  --muted: #5c6f6a;
  --line: #d9e5e1;
  --teal: #0f766e;
  --teal-dark: #115e59;
  --green: #3f8f45;
  --amber: #c77c14;
  --coral: #c4553d;
  --blue: #2f6fa3;
  --shadow: 0 14px 38px rgba(16, 32, 29, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: "Bai Jamjuree", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

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

button,
input,
textarea,
select {
  font: inherit;
}

img {
  max-width: 100%;
  display: block;
}

.skip-link {
  position: absolute;
  top: -80px;
  left: 12px;
  z-index: 20;
  padding: 10px 14px;
  background: var(--ink);
  color: #fff;
}

.skip-link:focus {
  top: 12px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 72px;
  padding: 12px clamp(16px, 4vw, 48px);
  background: rgba(247, 250, 248, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-logo {
  width: min(42vw, 152px);
  height: 54px;
  border-radius: 8px;
  object-fit: contain;
  background: #fff;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.top-nav a,
.ghost-button {
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--teal-dark);
  cursor: pointer;
}

.top-nav a:hover,
.ghost-button:hover {
  background: #e8f4f1;
}

.hero {
  display: grid;
  gap: 20px;
  align-items: center;
  overflow: hidden;
  padding: 30px clamp(16px, 4vw, 48px) 18px;
}

.hero-copy {
  min-width: 0;
  max-width: 780px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

h1 {
  font-size: clamp(40px, 10vw, 80px);
}

h2 {
  font-size: clamp(24px, 5vw, 36px);
}

h3 {
  font-size: 20px;
}

.hero-text {
  max-width: 660px;
  margin: 12px 0 18px;
  color: var(--muted);
  font-size: 18px;
  overflow-wrap: anywhere;
}

.hero-image {
  width: min(100%, 560px);
  aspect-ratio: 4 / 3;
  justify-self: center;
  object-fit: contain;
}

.search-box {
  max-width: 680px;
}

.search-box label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
}

.search-box div {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

input,
select {
  min-height: 48px;
  padding: 0 12px;
}

textarea {
  padding: 12px;
  resize: vertical;
}

button,
.search-box button,
.read-button,
.share-button {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  padding: 10px 16px;
  background: var(--teal);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

button:hover,
.read-button:hover,
.share-button:hover {
  background: var(--teal-dark);
}

.danger-button {
  background: #b42318;
}

.danger-button:hover {
  background: #8f1d14;
}

.trust-band {
  display: grid;
  gap: 10px;
  padding: 10px clamp(16px, 4vw, 48px) 24px;
}

.trust-band div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.trust-band strong,
.trust-band span {
  display: block;
}

.trust-band span {
  color: var(--muted);
  font-size: 14px;
}

.content-shell {
  display: grid;
  gap: 20px;
  padding: 8px clamp(16px, 4vw, 48px) 42px;
}

.filters,
.article-list-section {
  min-width: 0;
}

.category-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 0;
}

.category-button {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.category-button.active {
  border-color: var(--teal);
  background: #e8f4f1;
  color: var(--teal-dark);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-heading span {
  color: var(--muted);
  white-space: nowrap;
}

.article-grid {
  display: grid;
  gap: 14px;
}

.article-card {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 12px;
  min-height: 150px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(16, 32, 29, 0.06);
}

.article-card > div {
  min-width: 0;
}

.article-card img {
  width: 112px;
  height: 126px;
  border-radius: 8px;
  object-fit: cover;
  background: #e8f4f1;
}

.article-card h3 {
  display: -webkit-box;
  margin-bottom: 6px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.article-card p {
  display: -webkit-box;
  margin: 0 0 10px;
  overflow: hidden;
  color: var(--muted);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.meta-row span {
  padding: 4px 8px;
  border-radius: 8px;
  background: #edf5f3;
}

.article-view {
  max-width: 900px;
  margin: 0 auto;
  padding: 18px clamp(16px, 4vw, 48px) 56px;
}

.article-hero {
  display: grid;
  gap: 18px;
  align-items: center;
}

.article-hero img {
  width: 100%;
  max-height: 420px;
  border-radius: 8px;
  object-fit: cover;
  background: #e8f4f1;
}

.article-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.article-kicker span {
  padding: 5px 10px;
  border-radius: 8px;
  background: #e8f4f1;
  color: var(--teal-dark);
  font-size: 14px;
  font-weight: 700;
}

.article-summary {
  color: var(--muted);
  font-size: 18px;
  overflow-wrap: anywhere;
}

.article-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0;
}

.article-body {
  margin-top: 20px;
  font-size: 18px;
}

.article-body p {
  margin: 0 0 18px;
}

.info-box {
  margin: 22px 0;
  padding: 16px;
  border-left: 5px solid var(--teal);
  border-radius: 8px;
  background: #ffffff;
}

.info-box.warning {
  border-left-color: var(--coral);
}

.info-box h2 {
  margin-bottom: 8px;
  font-size: 22px;
}

.info-box ul {
  margin: 0;
  padding-left: 22px;
}

.source-list a {
  color: var(--blue);
  text-decoration: underline;
}

.site-footer {
  display: grid;
  gap: 16px;
  padding: 26px clamp(16px, 4vw, 48px);
  background: #10201d;
  color: #fff;
}

.site-footer p {
  max-width: 900px;
  margin: 8px 0 0;
  color: #cfe0dc;
}

.site-footer a {
  width: fit-content;
  border-bottom: 1px solid #fff;
}

.admin-body {
  background: #f2f7f5;
}

.admin-main {
  padding: 24px clamp(16px, 4vw, 48px) 56px;
}

.login-panel {
  width: min(100%, 480px);
  max-width: 480px;
  margin: 28px auto;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.login-panel form,
.editor {
  display: grid;
  gap: 14px;
}

.login-panel label,
.editor label {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

.form-message {
  min-height: 26px;
  margin: 0;
  color: var(--muted);
}

.admin-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 18px;
}

.admin-layout {
  display: grid;
  gap: 16px;
}

.admin-list,
.editor {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.password-box {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.password-box h2 {
  font-size: 20px;
}

.admin-search {
  margin-bottom: 12px;
}

.admin-list-item {
  width: 100%;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.admin-list-item.active {
  border-color: var(--teal);
  background: #e8f4f1;
}

.editor-grid {
  display: grid;
  gap: 14px;
}

.editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

@media (min-width: 640px) {
  .search-box div {
    grid-template-columns: 1fr auto;
  }

  .trust-band {
    grid-template-columns: repeat(3, 1fr);
  }

  .article-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .article-card {
    grid-template-columns: 132px 1fr;
  }

  .article-card img {
    width: 132px;
  }

  .editor-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 980px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(360px, 42vw);
    padding-top: 42px;
  }

  .content-shell {
    grid-template-columns: 250px 1fr;
    align-items: start;
  }

  .category-list {
    display: grid;
    overflow: visible;
  }

  .article-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .article-card {
    grid-template-columns: 1fr;
  }

  .article-card img {
    width: 100%;
    height: 168px;
  }

  .article-hero {
    grid-template-columns: 1.2fr 0.8fr;
  }

  .admin-layout {
    grid-template-columns: 340px 1fr;
    align-items: start;
  }
}

@media (max-width: 640px) {
  main,
  .hero,
  .hero-copy,
  .hero-text,
  .search-box,
  .content-shell,
  .trust-band,
  .site-footer,
  .admin-main {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .hero-text,
  .article-summary,
  .article-card h3,
  .article-card p {
    word-break: break-word;
    line-break: anywhere;
  }
}

@media (max-width: 480px) {
  .site-header {
    align-items: center;
    flex-direction: row;
  }

  .brand {
    flex: 1 1 100%;
  }

  .brand-logo {
    width: 64px;
  }

  .top-nav {
    width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
    scrollbar-width: none;
  }

  .top-nav::-webkit-scrollbar {
    display: none;
  }

  h1 {
    font-size: clamp(36px, 12vw, 52px);
  }

  .login-panel h1 {
    font-size: clamp(34px, 11vw, 46px);
    overflow-wrap: anywhere;
  }

  .hero-image {
    width: min(100%, 360px);
  }

  .article-card {
    grid-template-columns: 96px 1fr;
    min-height: 142px;
  }

  .article-card img {
    width: 96px;
    height: 118px;
  }
}
