/* gm-php — plain CSS port of the gm-web styled-components design */

:root {
  --pink: #d22363;
  --pink-dark: #d22061;
  --pink-soft: #c24672;
  --pink-hover: #ec3374;
  --hero-bg: #fff4ef;
  --footer-bg: #141414;
  --footer-strip-bg: #ffd2ce;
  --tag-bg: #d5fff2;
  --teal: #00c2a6;
  --text-muted: #666;
  --text-body: #333;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Noto Sans Thai', sans-serif;
  color: var(--text-body);
  background: #fff;
}

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

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

h1, h2, h3, h4 {
  margin: 0 0 10px;
}

.container {
  width: 1250px;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 20px;
}

main {
  padding-top: 60px;
  min-height: 60vh;
}

/* ---------- Navbar ---------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 60px;
  background: var(--hero-bg);
  z-index: 200;
}

.navbar-body {
  display: flex;
  align-items: center;
  height: 60px;
  gap: 20px;
}

.navbar .logo {
  flex: 1;
  display: flex;
}

.navbar .logo img {
  /* The source logo's native aspect ratio doesn't match the 200x60 box it's rendered at —
     without this it stretches instead of scaling proportionally (matches the original
     Next.js Image's objectFit: 'contain'). */
  object-fit: contain;
}

.menu-list {
  display: flex;
  align-items: center;
}

.menu-item {
  padding: 5px 10px;
  font-weight: 500;
  color: var(--pink);
  transition: 0.2s;
}

.menu-item:hover,
.menu-item.active {
  color: var(--pink-dark);
}

.menu-button {
  display: none;
  background: none;
  border: none;
  font-size: 1.6em;
  color: var(--pink);
  cursor: pointer;
}

.mobile-menu {
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  background: var(--hero-bg);
  padding: 20px;
  height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-12px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}

.mobile-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.mobile-menu-item {
  padding: 10px;
  color: #b04c72;
  font-weight: 500;
}

.mobile-menu-item.active {
  color: var(--teal);
}

@media screen and (max-width: 1250px) {
  .navbar-body {
    padding: 0;
  }
  .menu-list {
    display: none;
  }
  .menu-button {
    display: flex;
    align-items: center;
  }
}

/* ---------- Highlight / hero section ---------- */
.highlight-section {
  display: flex;
  justify-content: center;
  padding: 25px 0;
  background: var(--hero-bg);
  overflow: hidden;
}

.highlight-body {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  width: 100%;
  gap: 25px;
}

.highlight-left {
  position: relative;
  min-width: 300px;
  width: 500px;
  max-width: 100%;
  border-radius: 16px;
  overflow: hidden;
  display: block;
}

.highlight-left .img-container {
  position: relative;
  aspect-ratio: 1;
  height: 100%;
}

.highlight-left img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: 0.2s;
}

.highlight-left:hover img {
  filter: brightness(0.9);
}

.highlight-left .title {
  z-index: 10;
  padding: 10px 15px;
  background: #fff;
  position: absolute;
  width: calc(100% - 20px);
  left: 10px;
  bottom: 10px;
  border-radius: 10px;
}

.highlight-left .title h3 {
  color: #d22363;
  font-size: 1.2em;
  margin: 0;
}

.highlight-right {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 25px;
  flex: 1;
}

.highlight-right-card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  display: block;
}

.highlight-right-card .img-container {
  position: relative;
  height: 200px;
}

.highlight-right-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: 0.2s;
}

.highlight-right-card:hover img {
  filter: brightness(0.9);
}

.highlight-right-card .details {
  padding: 10px 15px;
  position: absolute;
  width: calc(100% - 20px);
  left: 10px;
  bottom: 10px;
  border-radius: 10px;
  background: #fff;
  min-height: 60px;
}

.highlight-right-card .details h3 {
  color: var(--pink-soft);
  font-size: 1em;
  font-weight: 500;
  margin: 0;
}

@media screen and (max-width: 850px) {
  .highlight-left {
    width: 350px;
    height: 350px;
  }
  .highlight-right {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}

/* ---------- Article grid / cards ---------- */
.article-list-section {
  display: flex;
  justify-content: center;
  padding: 10px 0 4em;
  background: #fff;
}

.article-grid {
  padding-top: 25px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 25px;
}

@media screen and (max-width: 850px) {
  .article-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
}

.article-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.article-card .img-container {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 16px;
  overflow: hidden;
}

.article-card .img-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: 0.2s;
}

.article-card:hover .img-container img {
  filter: brightness(0.9);
}

.article-card .details {
  flex: 1;
  padding: 10px;
}

.article-card h3 {
  font-size: 1.3em;
  font-weight: 600;
  color: var(--pink-soft);
}

.article-card:hover h3 {
  color: var(--pink-hover);
}

.article-card p {
  color: var(--text-muted);
}

.category-tag {
  display: inline-block;
  margin-bottom: 10px;
  padding: 4px 16px;
  border-radius: 10px;
  color: #e56262;
  font-size: 0.9em;
  background: #ffe0d2;
}

/* ---------- Pagination ---------- */
.pagination {
  padding: 2em 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  background: #fff;
}

.page-link {
  min-width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-body);
}

.page-link:hover {
  background: rgba(0, 0, 0, 0.06);
}

.page-link.active {
  background: var(--pink);
  color: #fff;
}

.page-link-prev,
.page-link-next {
  width: auto;
  min-width: 0;
  padding: 0 14px;
  border-radius: 16px;
}

/* ---------- Article view page ---------- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  color: #777;
}

.article-body {
  padding-top: 25px;
  display: flex;
  gap: 30px;
  align-items: flex-start;
}

.article-body .content {
  flex: 1;
  min-width: 0;
}

.article-body .right-side {
  width: 300px;
  flex-shrink: 0;
}

.article-body .right-side .ads {
  position: sticky;
  top: 80px;
  min-height: 280px;
  background: #f3f3f3;
}

@media screen and (max-width: 850px) {
  .article-body {
    flex-direction: column;
  }
  .article-body .right-side {
    width: 100%;
  }
}

.article-content {
  line-height: 1.8;
  font-size: 1.05em;
}

.article-content img {
  border-radius: 8px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 0;
}

.tag-item {
  padding: 4px 15px;
  border-radius: 8px;
  background: var(--tag-bg);
  transition: 0.2s;
}

.tag-item:hover {
  background: #b9f5e4;
}

.related-articles {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 25px;
}

@media screen and (max-width: 850px) {
  .related-articles {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

.related-article-card {
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 1px 1px rgba(238, 238, 238, 0.65);
  transition: 0.2s;
}

.related-article-card:hover {
  box-shadow: 0 0 7px 1px #ddd;
}

.related-article-card .img-container {
  position: relative;
  height: 150px;
}

.related-article-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.related-article-card .details {
  flex: 1;
  padding: 10px 12px;
  color: #555;
}

.divider {
  border: none;
  border-top: 1px solid rgba(0, 0, 0, 0.12);
  margin: 20px 0;
}

/* ---------- Category / tag header strip ---------- */
.page-header-strip {
  display: flex;
  justify-content: center;
  padding: 15px 0;
  background: var(--hero-bg);
}

.page-header-strip .breadcrumb {
  margin: 0;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--footer-bg);
  color: #fff;
}

.footer-top {
  background: #111;
  padding: 40px 0;
}

.footer-body {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.footer-col {
  flex: 1;
  min-width: 260px;
}

.footer-policy-link {
  display: inline-block;
  margin-top: 10px;
  color: var(--pink);
}

.footer-menu-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.chip {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 16px;
  background: var(--pink);
  color: #fff;
  font-size: 0.85em;
}

.footer-contact {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-bottom {
  padding: 20px 0;
  background: var(--footer-strip-bg);
}

.footer-bottom p {
  text-align: center;
  color: #b04c72;
  margin: 0;
}

/* ---------- Policy popup ---------- */
.policy-popup {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: #fff;
  width: 340px;
  max-width: 80%;
  padding: 20px;
  z-index: 200;
  border-radius: 16px;
  font-size: 13px;
  box-shadow: rgba(0, 0, 0, 0.12) 0 4px 8px 0, rgba(0, 0, 0, 0.08) 0 2px 4px 0;
}

.policy-popup p {
  color: var(--text-body);
  margin: 0 0 10px;
}

.policy-popup a {
  color: #0ebe93;
  font-weight: 500;
}

.policy-popup-actions {
  display: flex;
  gap: 10px;
}

.btn {
  flex: 1;
  padding: 8px 14px;
  border-radius: 16px;
  border: none;
  font-size: 12px;
  cursor: pointer;
}

.btn-default {
  background: #eee;
  color: #333;
}

.btn-dark {
  background: #222;
  color: #fff;
}

/* ---------- Policy page ---------- */
.policy-page {
  padding: 40px 0 60px;
}

.policy-page h1 {
  color: var(--pink);
}

.policy-page ul {
  padding-left: 20px;
}

/* ---------- 404 page ---------- */
.not-found-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 100px 20px;
}

.not-found-page h1 {
  font-size: 3em;
  color: var(--pink);
}

/* Visible to screen readers and search engines, hidden visually — used for pages (like home)
   that need a real <h1> for SEO/accessibility but whose design has no natural place to show one. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
