/* ===================================================================
   GREEN NETWORK PORTAL - OFFICIAL EDITORIAL DESIGN SYSTEM
   Pixel-perfect Responsive on Mobile (320px - 480px), Tablet & Desktop
   =================================================================== */

:root {
  --primary-green: #33a54d;
  --primary-hover: #2b8c41;
  --primary-deep: #165627;
  --accent-lime: #4ade80;
  --soft-green: #e8f5e9;
  --forest-dark: #122818;
  
  --bg-page: #fbfcf9;
  --bg-surface: #ffffff;
  --bg-muted: #f3f5ed;
  
  --ink-primary: #171f1a;
  --ink-secondary: #4a554e;
  --ink-muted: #738077;
  
  --border-light: rgba(0, 0, 0, 0.08);
  --border-subtle: rgba(0, 0, 0, 0.04);
  
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-card: 0 4px 16px -2px rgba(18, 40, 24, 0.06), 0 2px 6px -1px rgba(18, 40, 24, 0.04);
  --shadow-hover: 0 16px 32px -4px rgba(18, 40, 24, 0.12), 0 6px 12px -2px rgba(18, 40, 24, 0.06);
  --shadow-modal: 0 24px 60px -8px rgba(0, 0, 0, 0.35);

  --font-heading: 'Plus Jakarta Sans', 'Kanit', sans-serif;
  --font-body: 'Sarabun', 'Kanit', sans-serif;
  --font-thai: 'Kanit', sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-page);
  color: var(--ink-primary);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: all 0.2s ease;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

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

.d-flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.text-accent {
  color: var(--primary-green) !important;
}

/* ================= Top Ticker Bar ================= */
.top-ticker-bar {
  background: var(--forest-dark);
  color: #c4d1c8;
  font-size: 13px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.top-bar-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.top-date-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  white-space: nowrap;
}

.top-nav-links {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12.5px;
}

.top-nav-links a {
  color: #c4d1c8;
}

.top-nav-links a:hover {
  color: #fff;
}

.top-nav-links .divider {
  color: rgba(255, 255, 255, 0.2);
  font-size: 11px;
}

.top-social-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.follow-text {
  font-size: 12px;
  color: #8da394;
}

.social-icons a {
  color: #c4d1c8;
  margin-left: 10px;
  font-size: 13px;
}

.social-icons a:hover {
  color: var(--accent-lime);
}

/* ================= Master Brand Header ================= */
.master-header {
  background: var(--bg-surface);
  padding: 20px 0;
  border-bottom: 1px solid var(--border-light);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.brand-showcase {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1;
}

.brand-logo {
  height: 62px;
  width: auto;
  object-fit: contain;
}

.brand-badge-wrap {
  border-left: 1.5px solid var(--border-light);
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.brand-sub {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-secondary);
  line-height: 1.4;
}

.official-award-tag {
  font-size: 11.5px;
  color: var(--primary-deep);
  background: var(--soft-green);
  padding: 3px 10px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  font-weight: 600;
}

/* Search Box */
.search-container {
  position: relative;
  width: 340px;
  flex-shrink: 0;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 16px;
  color: var(--ink-muted);
  font-size: 14px;
  pointer-events: none;
}

#searchInput {
  width: 100%;
  padding: 11px 40px 11px 42px;
  border: 1.5px solid var(--border-light);
  border-radius: 30px;
  background: var(--bg-muted);
  font-size: 14px;
  font-family: inherit;
  color: var(--ink-primary);
  outline: none;
  transition: all 0.25s ease;
}

#searchInput:focus {
  background: #fff;
  border-color: var(--primary-green);
  box-shadow: 0 0 0 4px rgba(51, 165, 77, 0.12);
}

.clear-search-btn {
  position: absolute;
  right: 14px;
  color: var(--ink-muted);
  font-size: 14px;
  padding: 4px;
}

.search-hint {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.search-hint kbd {
  background: #e2e8e4;
  color: var(--ink-secondary);
  padding: 2px 7px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 11px;
}

/* ================= Category Nav Bar (Touch-Optimized) ================= */
.category-nav-bar {
  background: #fff;
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: 0 3px 8px -2px rgba(0,0,0,0.03);
}

.category-pills-wrap {
  position: relative;
  width: 100%;
}

.category-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.category-pills::-webkit-scrollbar {
  display: none;
}

.cat-pill {
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-secondary);
  background: transparent;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid transparent;
  flex-shrink: 0;
}

.cat-pill:hover {
  background: var(--bg-muted);
  color: var(--ink-primary);
}

.cat-pill.active {
  background: var(--primary-green);
  color: #fff;
  box-shadow: 0 4px 12px rgba(51, 165, 77, 0.3);
}

/* ================= Editorial Spotlight (Hero) ================= */
.page-content {
  padding-top: 28px;
  padding-bottom: 60px;
}

.editorial-spotlight {
  display: grid;
  grid-template-columns: 2fr 1.15fr;
  gap: 28px;
  margin-bottom: 40px;
}

.lead-hero-card {
  position: relative;
  background: var(--bg-surface);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-light);
  transition: transform 0.3s, box-shadow 0.3s;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.lead-hero-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.lead-hero-img-wrap {
  position: relative;
  height: 330px;
  overflow: hidden;
  background: #eef2ef;
}

.lead-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.lead-hero-card:hover .lead-hero-img {
  transform: scale(1.03);
}

.hero-overlay-tag {
  position: absolute;
  bottom: 14px;
  left: 14px;
  background: var(--primary-deep);
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 6px;
  backdrop-filter: blur(8px);
}

.lead-hero-body {
  padding: 22px;
}

.lead-hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  font-size: 12.5px;
  color: var(--ink-muted);
  margin-bottom: 10px;
}

.lead-hero-title {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--ink-primary);
  margin-bottom: 10px;
}

.lead-hero-excerpt {
  font-size: 14px;
  color: var(--ink-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Trending Column */
.spotlight-trending {
  background: var(--bg-surface);
  border-radius: 16px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-card);
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.trending-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
}

.trending-header h3 {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
}

.trending-badge {
  background: #fee2e2;
  color: #dc2626;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
}

.trending-item {
  display: flex;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all 0.2s;
}

.trending-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.trending-item:hover {
  transform: translateX(3px);
}

.trending-thumb {
  width: 90px;
  height: 70px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.trending-info h4 {
  font-family: var(--font-heading);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.trending-info .meta-date {
  font-size: 11.5px;
  color: var(--ink-muted);
}

/* ================= Main Layout Grid ================= */
.main-layout-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 36px;
}

.section-title-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  border-bottom: 1.5px solid var(--border-light);
  padding-bottom: 12px;
}

.title-with-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.accent-bar {
  width: 5px;
  height: 22px;
  background: var(--primary-green);
  border-radius: 3px;
}

.title-with-bar h2 {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
}

.results-count {
  font-size: 13px;
  color: var(--ink-muted);
  background: var(--bg-muted);
  padding: 4px 12px;
  border-radius: 12px;
}

/* News Cards Grid */
.news-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
  margin-bottom: 36px;
}

.news-card {
  background: var(--bg-surface);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.news-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(51, 165, 77, 0.3);
}

.card-img-wrap {
  position: relative;
  height: 180px;
  overflow: hidden;
  background: #eef2ef;
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.news-card:hover .card-img {
  transform: scale(1.05);
}

.card-cat-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(23, 31, 26, 0.85);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 4px;
  backdrop-filter: blur(4px);
}

.card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--ink-muted);
  margin-bottom: 8px;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.45;
  color: var(--ink-primary);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-excerpt {
  font-size: 13px;
  color: var(--ink-secondary);
  line-height: 1.55;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-grow: 1;
}

.card-footer {
  border-top: 1px solid var(--border-subtle);
  padding-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary-green);
}

/* Pagination */
.pagination-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
}

.page-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-secondary);
  transition: all 0.2s;
}

.page-btn:hover:not(:disabled) {
  background: var(--primary-green);
  color: #fff;
  border-color: var(--primary-green);
}

.page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.page-info {
  font-size: 13.5px;
  color: var(--ink-muted);
}

/* ================= Sidebar Components ================= */
.sidebar-column {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sidebar-card {
  background: var(--bg-surface);
  border-radius: 14px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  padding: 20px;
}

.sidebar-card .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
}

.sidebar-card .card-header h4 {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
}

/* Popular List in Sidebar */
.popular-list {
  display: flex;
  flex-direction: column;
}

.popular-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all 0.2s;
}

.popular-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.popular-item:hover {
  transform: translateX(4px);
}

.popular-item .rank-number {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 800;
  color: rgba(51, 165, 77, 0.4);
  line-height: 1;
  flex-shrink: 0;
}

.popular-item:hover .rank-number {
  color: var(--primary-green);
}

.popular-text h5 {
  font-family: var(--font-heading);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--ink-primary);
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.popular-meta {
  font-size: 11px;
  color: var(--ink-muted);
}

/* Magazine Card */
.magazine-body {
  display: flex;
  gap: 14px;
}

.magazine-cover {
  width: 85px;
  border-radius: 6px;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.magazine-desc h5 {
  font-size: 13.5px;
  font-weight: 700;
  margin-bottom: 4px;
}

.magazine-desc p {
  font-size: 12px;
  color: var(--ink-secondary);
  line-height: 1.45;
  margin-bottom: 8px;
}

.magazine-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary-green);
}

/* Directory Promo Card */
.directory-promo-text {
  font-size: 13px;
  color: var(--ink-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
}

.directory-promo-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--soft-green);
  color: var(--primary-deep);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 6px;
  transition: all 0.2s;
}

.directory-promo-btn:hover {
  background: var(--primary-green);
  color: #fff;
}

/* Tags Cloud */
.tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-chip {
  background: var(--bg-muted);
  color: var(--ink-secondary);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.tag-chip:hover {
  background: var(--primary-green);
  color: #fff;
}

/* ================= Reader Modal ================= */
.reader-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(18, 40, 24, 0.65);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.reader-modal-overlay.active {
  display: flex;
  opacity: 1;
}

.reader-modal-container {
  background: var(--bg-surface);
  width: 100%;
  max-width: 840px;
  max-height: 90vh;
  border-radius: 20px;
  box-shadow: var(--shadow-modal);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  from { transform: scale(0.96) translateY(10px); }
  to { transform: scale(1) translateY(0); }
}

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.06);
  color: var(--ink-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  z-index: 10;
  transition: all 0.2s;
}

.modal-close-btn:hover {
  background: #fee2e2;
  color: #dc2626;
}

.reader-scroll-content {
  overflow-y: auto;
  padding: 32px 36px;
  line-height: 1.8;
}

.reader-header {
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 16px;
}

.reader-categories {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.reader-cat {
  background: var(--soft-green);
  color: var(--primary-deep);
  font-size: 12px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 4px;
}

.reader-title {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.35;
  color: var(--ink-primary);
  margin-bottom: 12px;
}

.reader-meta-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  font-size: 12.5px;
  color: var(--ink-muted);
}

.reader-featured-img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 24px;
}

.reader-body {
  font-size: 15.5px;
  color: #2b3830;
}

.reader-body p {
  margin-bottom: 18px;
}

.reader-body img {
  border-radius: 8px;
  margin: 18px auto;
}

.reader-source-box {
  margin-top: 32px;
  background: var(--bg-muted);
  border-left: 4px solid var(--primary-green);
  padding: 16px 20px;
  border-radius: 0 8px 8px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.reader-source-box a {
  color: var(--primary-green);
  font-weight: 600;
  white-space: nowrap;
}

/* ================= Master Footer ================= */
.master-footer {
  background: var(--forest-dark);
  color: #c4d1c8;
  padding-top: 48px;
  border-top: 4px solid var(--primary-green);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1.2fr 1.5fr;
  gap: 36px;
  padding-bottom: 40px;
}

.footer-logo {
  height: 54px;
  width: auto;
  margin-bottom: 16px;
  filter: brightness(1.2);
}

.footer-intro {
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 16px;
  color: #a2b5a8;
}

.awards-badge {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #e2f4e8;
}

.awards-badge i {
  color: var(--accent-lime);
  font-size: 16px;
  margin-top: 2px;
  flex-shrink: 0;
}

.footer-heading {
  font-family: var(--font-heading);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 18px;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a {
  font-size: 13px;
  color: #a2b5a8;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.footer-links a:hover {
  color: var(--accent-lime);
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 12.5px;
  line-height: 1.5;
  color: #a2b5a8;
}

.contact-item i {
  color: var(--accent-lime);
  margin-top: 3px;
  width: 16px;
  flex-shrink: 0;
}

.contact-item a {
  color: #a2b5a8;
}

.contact-item a:hover {
  color: #fff;
}

.footer-bottom-bar {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 16px 0;
  font-size: 12px;
  color: #7a8e80;
}

.scroll-top-btn {
  color: #a2b5a8;
  font-size: 12px;
  font-weight: 500;
}

.scroll-top-btn:hover {
  color: #fff;
}

/* Skeleton loader */
.skeleton-box {
  background: linear-gradient(90deg, #e8ede8 25%, #f4f7f4 50%, #e8ede8 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===================================================================
   RESPONSIVE MEDIA QUERIES (FIXING MOBILE VIEW & OVERLAPS)
   =================================================================== */

@media (max-width: 992px) {
  .header-container {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }
  
  .brand-showcase {
    width: 100%;
  }

  .search-container {
    width: 100%;
    min-width: 100%;
  }

  .editorial-spotlight {
    grid-template-columns: 1fr;
  }

  .main-layout-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}

/* Mobile Screens (Under 768px) */
@media (max-width: 767px) {
  .container {
    padding: 0 14px;
  }

  /* 1. Fix Top Bar: Hide desktop text links that wrap into messy lines */
  .desktop-only {
    display: none !important;
  }

  .top-ticker-bar {
    padding: 7px 0;
  }

  .top-bar-flex {
    justify-content: space-between;
  }

  .top-date-wrap {
    font-size: 11.5px;
  }

  .top-social-actions .social-icons a {
    margin-left: 8px;
    font-size: 12px;
  }

  /* 2. Fix Header & Logo on mobile */
  .master-header {
    padding: 14px 0;
  }

  .brand-showcase {
    gap: 12px;
  }

  .brand-logo {
    height: 48px;
  }

  .brand-badge-wrap {
    padding-left: 12px;
    gap: 3px;
  }

  .brand-sub {
    font-size: 11.5px;
    line-height: 1.35;
  }

  .official-award-tag {
    font-size: 10px;
    padding: 2px 7px;
  }

  /* 3. Fix Search Box on mobile: No overlap with hint */
  #searchInput {
    padding: 10px 36px 10px 38px;
    font-size: 13.5px;
  }

  .search-icon {
    left: 14px;
    font-size: 13px;
  }

  /* 4. Fix Category Nav: Touch scrollable */
  .category-pills {
    padding: 8px 0;
    gap: 6px;
  }

  .cat-pill {
    padding: 6px 13px;
    font-size: 12.5px;
  }

  /* 5. Fix Hero Section */
  .page-content {
    padding-top: 18px;
    padding-bottom: 40px;
  }

  .editorial-spotlight {
    gap: 20px;
    margin-bottom: 28px;
  }

  .lead-hero-img-wrap {
    height: 220px;
  }

  .lead-hero-body {
    padding: 16px;
  }

  .lead-hero-title {
    font-size: 17px;
    line-height: 1.4;
  }

  .lead-hero-excerpt {
    font-size: 13px;
  }

  .trending-thumb {
    width: 75px;
    height: 60px;
  }

  .trending-info h4 {
    font-size: 12.5px;
  }

  /* 6. Fix News Grid Cards */
  .news-cards-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .card-img-wrap {
    height: 190px;
  }

  .card-title {
    font-size: 15px;
  }

  /* 7. Fix Reader Modal on mobile */
  .reader-modal-overlay {
    padding: 10px;
  }

  .reader-modal-container {
    max-height: 94vh;
    border-radius: 14px;
  }

  .reader-scroll-content {
    padding: 20px 16px;
  }

  .reader-title {
    font-size: 18px;
    line-height: 1.4;
  }

  .reader-featured-img {
    max-height: 240px;
    margin-bottom: 16px;
  }

  .reader-body {
    font-size: 14.5px;
  }

  .reader-source-box {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  /* 8. Fix Footer on mobile */
  .footer-grid {
    gap: 24px;
    padding-bottom: 24px;
  }

  .bottom-bar-inner {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }
}


/* ===================================================================
   HAMBURGER MENU & MOBILE DRAWER (EXACT GREEN NETWORK STYLE)
   =================================================================== */

.top-right-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Mobile Hamburger Menu Button */




/* Mobile Drawer Overlay */
.mobile-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(18, 40, 24, 0.65);
  backdrop-filter: blur(4px);
  z-index: 150;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-drawer-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Mobile Navigation Drawer */
.mobile-nav-drawer {
  position: fixed;
  top: 0;
  right: -320px;
  width: 300px;
  max-width: 85vw;
  height: 100vh;
  background: #ffffff;
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.2);
  z-index: 160;
  display: flex;
  flex-direction: column;
  transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.mobile-nav-drawer.active {
  right: 0;
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  background: #fafafa;
}

.drawer-logo {
  height: 40px;
  width: auto;
  object-fit: contain;
}

.drawer-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.05);
  color: var(--ink-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  transition: all 0.2s;
}

.drawer-close-btn:hover {
  background: #fee2e2;
  color: #dc2626;
}

.drawer-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.drawer-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink-muted);
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1.5px solid var(--border-light);
}

.drawer-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.drawer-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink-primary);
  transition: all 0.2s;
}

.drawer-link:hover,
.drawer-link:active {
  background: var(--bg-muted);
  color: var(--primary-deep);
  transform: translateX(4px);
}

.drawer-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.drawer-cat-chip {
  background: var(--bg-muted);
  color: var(--ink-secondary);
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 12.5px;
  font-weight: 500;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all 0.2s;
}

.drawer-cat-chip:hover,
.drawer-cat-chip.active {
  background: var(--primary-green);
  color: #fff;
  border-color: var(--primary-green);
}

.drawer-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}

.drawer-social {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.social-icons-drawer a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-muted);
  color: var(--ink-secondary);
  margin-left: 8px;
  font-size: 13px;
  transition: all 0.2s;
}

.social-icons-drawer a:hover {
  background: var(--primary-green);
  color: #fff;
}

/* Show Hamburger on Mobile */
@media (max-width: 767px) {
  
}


/* ===================================================================
   PREMIUM BESPOKE HAMBURGER BUTTON
   =================================================================== */

.mobile-hamburger-btn {
  display: none;
  position: relative;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  -webkit-tap-highlight-color: transparent;
}

.mobile-hamburger-btn:hover {
  background: rgba(51, 165, 77, 0.25);
  border-color: rgba(74, 222, 128, 0.4);
  transform: translateY(-1px);
}

.mobile-hamburger-btn:active {
  transform: scale(0.92);
  background: var(--primary-green);
  border-color: var(--primary-green);
}

/* 3-Bar Modern Geometry */
.hamburger-icon-wrap {
  width: 20px;
  height: 14px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
}

.hamburger-icon-wrap .bar {
  display: block;
  width: 100%;
  height: 2px;
  background: #ffffff;
  border-radius: 4px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.hamburger-icon-wrap .bar-mid {
  width: 75%;
  align-self: flex-start;
}

.mobile-hamburger-btn:hover .bar-mid {
  width: 100%;
}

/* When drawer is active / open */
.mobile-hamburger-btn.is-active {
  background: var(--primary-green);
  border-color: var(--primary-green);
}

.mobile-hamburger-btn.is-active .bar-top {
  transform: translateY(6px) rotate(45deg);
}

.mobile-hamburger-btn.is-active .bar-mid {
  opacity: 0;
  transform: translateX(-6px);
}

.mobile-hamburger-btn.is-active .bar-bot {
  transform: translateY(-6px) rotate(-45deg);
}

@media (max-width: 767px) {
  .mobile-hamburger-btn {
    display: inline-flex !important;
  }
}


/* ===================================================================
   ULTRA-PREMIUM HAMBURGER & MOBILE DRAWER (EDITORIAL GRADE)
   =================================================================== */

.text-accent-light {
  color: var(--accent-lime);
}

.top-right-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Premium Mobile Hamburger Menu Button */
.mobile-hamburger-btn {
  display: none;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 6px 14px 6px 10px;
  border-radius: 20px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.mobile-hamburger-btn:hover,
.mobile-hamburger-btn:active {
  background: rgba(51, 165, 77, 0.3);
  border-color: var(--accent-lime);
  color: #ffffff;
  transform: scale(1.02);
}

.hamburger-icon-wrap {
  width: 18px;
  height: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hamburger-icon-wrap .bar {
  display: block;
  width: 100%;
  height: 2px;
  background-color: #ffffff;
  border-radius: 2px;
  transition: all 0.25s ease;
}

.hamburger-icon-wrap .bar-2 {
  width: 75%;
  background-color: var(--accent-lime);
}

.mobile-hamburger-btn:hover .bar-2 {
  width: 100%;
}

.hamburger-text {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: #f0fdf4;
}

/* Drawer Overlay */
.mobile-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 24, 15, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.mobile-drawer-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Slide Drawer */
.mobile-nav-drawer {
  position: fixed;
  top: 0;
  right: -360px;
  width: 330px;
  max-width: 88vw;
  height: 100vh;
  background: #ffffff;
  box-shadow: -10px 0 35px rgba(0, 0, 0, 0.25);
  z-index: 210;
  display: flex;
  flex-direction: column;
  transition: right 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.mobile-nav-drawer.active {
  right: 0;
}

/* Drawer Header */
.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-light);
  background: #fbfdfb;
}

.drawer-brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.drawer-logo {
  height: 42px;
  width: auto;
  object-fit: contain;
}

.drawer-tagline {
  font-size: 11px;
  color: var(--ink-muted);
  font-weight: 500;
}

.drawer-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.05);
  color: var(--ink-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.2s;
}

.drawer-close-btn:hover {
  background: #fee2e2;
  color: #dc2626;
  transform: rotate(90deg);
}

/* Drawer Search Box */
.drawer-search-wrap {
  padding: 14px 20px 8px;
  background: #ffffff;
}

.drawer-search-box {
  display: flex;
  align-items: center;
  background: var(--bg-muted);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 8px 14px;
  gap: 10px;
}

.drawer-search-box i {
  color: var(--ink-muted);
  font-size: 13px;
}

.drawer-search-box input {
  border: none;
  background: transparent;
  outline: none;
  font-family: inherit;
  font-size: 13.5px;
  width: 100%;
  color: var(--ink-primary);
}

/* Drawer Body */
.drawer-body {
  padding: 16px 20px 24px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  -webkit-overflow-scrolling: touch;
}

.drawer-section-title {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--ink-muted);
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-light);
}

/* Drawer Nav List */
.drawer-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.drawer-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-primary);
  transition: all 0.2s ease;
  background: transparent;
}

.drawer-link:hover,
.drawer-link:active {
  background: var(--bg-muted);
  color: var(--primary-deep);
  transform: translateX(4px);
}

.link-icon-badge {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--soft-green);
  color: var(--primary-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

.link-title {
  flex: 1;
}

.link-arrow {
  font-size: 11px;
  color: var(--ink-muted);
}

/* Drawer Categories Chips */
.drawer-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 20px;
}

.drawer-cat-chip {
  background: var(--bg-muted);
  color: var(--ink-secondary);
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all 0.2s;
}

.drawer-cat-chip:hover,
.drawer-cat-chip.active {
  background: var(--primary-green);
  color: #fff;
  border-color: var(--primary-green);
}

/* Drawer Awards Card */
.drawer-awards-card {
  background: #f4f9f4;
  border: 1px solid #d4ebd7;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 20px;
  font-size: 11.5px;
  line-height: 1.45;
  color: #1b4d24;
}

.drawer-awards-card i {
  color: #1e7e34;
  font-size: 16px;
  margin-top: 2px;
  flex-shrink: 0;
}

.drawer-awards-card strong {
  display: block;
  margin-bottom: 2px;
  color: #13461c;
}

.drawer-awards-card p {
  color: #2e6037;
  margin: 0;
}

/* Drawer Footer */
.drawer-footer {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--border-light);
}

.drawer-social-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.drawer-social-label {
  font-size: 12px;
  color: var(--ink-muted);
  font-weight: 500;
}

.social-icons-drawer {
  display: flex;
  gap: 10px;
}

.social-icons-drawer a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-muted);
  color: var(--ink-secondary);
  font-size: 14px;
  transition: all 0.2s;
  border: 1px solid var(--border-light);
}

.social-icons-drawer a.fb-btn:hover { background: #1877f2; color: #fff; border-color: #1877f2; }
.social-icons-drawer a.yt-btn:hover { background: #ff0000; color: #fff; border-color: #ff0000; }
.social-icons-drawer a.x-btn:hover { background: #000000; color: #fff; border-color: #000000; }

.drawer-legal {
  font-size: 11px;
  color: var(--ink-muted);
  text-align: center;
  padding-top: 8px;
}

/* Trigger Hamburger Button on Mobile Screen */
@media (max-width: 767px) {
  .mobile-hamburger-btn {
    display: inline-flex !important;
  }
}

/* GULF Official Source Tag & Pinned Badge */
.gulf-source-badge {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.4);
}

.gulf-source-badge i {
  color: #7dd3fc;
  font-size: 11px;
}

.card-source-tag {
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.source-gulf {
  color: #0284c7;
}

.source-green {
  color: var(--primary-green);
}

/* ===================================================================
   GULF OFFICIAL MASTER FOOTER (WHITE CARD ON CLEAN LIGHT BACKGROUND)
   =================================================================== */
.master-footer {
  background: #f8fafc;
  color: var(--ink-primary);
  padding-top: 40px;
  border-top: 1px solid #e2e8f0;
}

.footer-gulf-wrapper {
  padding-bottom: 40px;
}

.gulf-footer-header {
  margin-bottom: 20px;
}

.gulf-footer-title {
  color: #2e8b40; /* Official green matching user requirement */
  font-family: var(--font-thai);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.2px;
}

.gulf-footer-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 32px 36px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 32px;
  align-items: flex-start;
}

.gulf-footer-logo-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 24px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.gulf-footer-logo-img {
  width: 100%;
  max-width: 150px;
  height: auto;
  object-fit: contain;
}

.gulf-footer-details {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.gulf-footer-desc {
  font-size: 15px;
  line-height: 1.75;
  color: #334155;
  margin-bottom: 4px;
}

.gulf-footer-meta-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gulf-meta-item {
  display: flex;
  align-items: baseline;
  gap: 16px;
  font-size: 15px;
  line-height: 1.6;
}

.gulf-meta-label {
  font-weight: 700;
  color: #0f172a;
  min-width: 85px;
  flex-shrink: 0;
  font-size: 15px;
}

.gulf-meta-value {
  color: #334155;
  flex: 1;
}

.gulf-phone-link {
  color: #334155;
  text-decoration: none;
  transition: color 0.2s;
}

.gulf-phone-link:hover {
  color: #2e8b40;
}

.gulf-web-link {
  color: #2e8b40 !important;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s;
}

.gulf-web-link:hover {
  color: #165627 !important;
}

.gulf-cat-badge {
  color: #2e8b40;
  font-weight: 600;
}

.footer-bottom-bar {
  background: #0f1f14;
  color: #8fa395;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 18px 0;
  font-size: 12.5px;
}

.footer-bottom-bar span {
  color: #a3b8aa;
}

.footer-bottom-bar .scroll-top-btn {
  color: #a3b8aa;
}

.footer-bottom-bar .scroll-top-btn:hover {
  color: #ffffff;
}

/* Sidebar GULF Spotlight Widget */
.sidebar-gulf-widget {
  padding-top: 4px;
}

.gulf-badge-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 12px;
  display: inline-flex;
  align-items: center;
}

.gulf-widget-logo {
  height: 26px;
  width: auto;
}

.gulf-widget-title {
  font-family: var(--font-thai);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-primary);
  line-height: 1.4;
  margin-bottom: 8px;
}

@media (max-width: 768px) {
  .gulf-footer-title {
    font-size: 20px;
  }

  .gulf-footer-card {
    grid-template-columns: 1fr;
    padding: 22px 18px;
    gap: 20px;
  }

  .gulf-footer-logo-box {
    max-width: 170px;
    min-height: 100px;
    padding: 14px;
  }

  .gulf-meta-item {
    flex-direction: column;
    gap: 2px;
  }

  .gulf-meta-label {
    min-width: auto;
  }
}


