/* ==========================================================================
   ธีมและองค์ประกอบส่วนหัว (Header) และส่วนท้าย (Footer)
   สำนักงานเขตพื้นที่การศึกษามัธยมศึกษานราธิวาส (สพม.นราธิวาส)
   ========================================================================== */

:root {
  --gov-navy-dark: #0f1c31;
  --gov-navy: #162846;
  --gov-navy-light: #1e3a5f;
  --gov-blue-bar: #244a6f;
  --gov-blue-hover: #1c3b5a;
  --gov-accent: #f59e0b;
  --gov-text-muted: #94a3b8;
  --gov-border: rgba(255, 255, 255, 0.12);
}

/* Grayscale Mourning Mode */
body.grayscale {
  filter: grayscale(100%);
  transition: filter 0.3s ease;
}

/* ==========================================
   1. ส่วนหัวเว็บไซต์ (Gov Header)
   ========================================== */
.gov-header-wrapper {
  width: 100%;
  font-family: 'Prompt', 'Sarabun', sans-serif;
  position: relative;
  z-index: 1000;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

/* แถบข้อมูลติดต่อด้านบนสุด (Top Bar) */
.gov-top-bar {
  background: var(--gov-navy-light);
  color: #f1f5f9;
  padding: 6px 4%;
  font-size: 13.5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.gov-top-info {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.gov-top-info a, .gov-top-info span {
  color: #e2e8f0;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}

.gov-top-info a:hover {
  color: #38bdf8;
}

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

.gov-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border-radius: 50%;
  text-decoration: none;
  transition: background 0.2s, transform 0.2s;
}

.gov-social-link:hover {
  background: #38bdf8;
  transform: translateY(-2px);
  color: #fff;
}

.gov-mourn-btn {
  background: #000;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 12.5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.gov-mourn-btn:hover {
  background: #222;
  border-color: #fff;
}

/* แถบโลโก้และชื่อหน่วยงาน (Brand Header) */
.gov-brand-bar {
  background: #ffffff;
  padding: 12px 4%;
  border-bottom: 1px solid #e2e8f0;
}

.gov-brand-container {
  max-width: 1380px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 15px;
}

.gov-brand-left {
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
}

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

.gov-brand-box {
  background: #1e3a5f;
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 4px;
  box-shadow: 0 4px 10px rgba(30, 58, 95, 0.15);
}

.gov-brand-title {
  font-size: 21px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.2px;
  color: #ffffff;
  margin: 0;
}

.gov-brand-subtitle {
  font-size: 13.5px;
  font-weight: 400;
  color: #cbd5e1;
  margin-top: 3px;
  letter-spacing: 0.3px;
}

.gov-brand-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8fafc;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.gov-brand-badge-icon {
  font-size: 24px;
}

.gov-brand-badge-text small {
  display: block;
  font-size: 11px;
  color: #64748b;
  text-transform: uppercase;
  font-weight: 600;
}

.gov-brand-badge-text strong {
  display: block;
  font-size: 14px;
  color: #0f172a;
}

/* แถบเมนูหลัก (Main Navigation) */
.gov-nav-bar {
  background: var(--gov-blue-bar);
  padding: 0 4%;
}

.gov-nav-container {
  max-width: 1380px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.gov-nav-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.gov-nav-item {
  position: relative;
}

.gov-nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 18px;
  color: #ffffff;
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}

.gov-nav-link:hover, .gov-nav-link.active {
  background: var(--gov-blue-hover);
  color: #38bdf8;
}

.gov-nav-link.active {
  box-shadow: inset 0 -3px 0 #38bdf8;
}

.gov-nav-btn {
  background: #f59e0b;
  color: #0f172a !important;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
}

.gov-nav-btn:hover {
  background: #d97706;
  color: #ffffff !important;
  transform: translateY(-1px);
}

.gov-nav-btn.btn-outline {
  background: transparent;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: none;
}

.gov-nav-btn.btn-outline:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* ==========================================
   2. ส่วนท้ายเว็บไซต์ (Gov Footer)
   ========================================== */
.gov-footer-wrapper {
  width: 100%;
  font-family: 'Prompt', 'Sarabun', sans-serif;
  margin-top: auto;
}

/* แถบโลโก้หน่วยงานและกระทรวง */
.gov-footer-logos-strip {
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  border-bottom: 2px solid #cbd5e1;
  padding: 16px 4%;
  overflow: hidden;
}

.gov-footer-logos-inner {
  max-width: 1380px;
  margin: 0 auto;
  display: flex;
  justify-content: space-around;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
}

.gov-footer-logo-item {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  transition: transform 0.25s ease, filter 0.25s ease;
}

.gov-footer-logo-item:hover {
  transform: scale(1.12);
}

.gov-footer-logo-img {
  height: 54px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.06));
}

/* ตัวเนื้อหาหลักของ Footer */
.gov-footer-main {
  background: var(--gov-navy);
  color: #f1f5f9;
  padding: 40px 4% 30px;
}

.gov-footer-grid {
  max-width: 1380px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.15fr 1.15fr 1fr;
  gap: 35px;
}

.gov-footer-col h5 {
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 18px;
  position: relative;
  padding-bottom: 10px;
}

.gov-footer-col h5::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 45px;
  height: 2px;
  background: #38bdf8;
  border-radius: 2px;
}

/* แผนที่และหน่วยงาน (คอลัมน์ 1) */
.gov-map-embed {
  width: 100%;
  height: 180px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.15);
  margin-bottom: 14px;
}

.gov-map-embed iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.gov-org-info {
  font-size: 14px;
  line-height: 1.6;
}

.gov-org-name {
  font-weight: 700;
  color: #ffffff;
  font-size: 15px;
}

.gov-org-sub {
  color: #cbd5e1;
  font-size: 13.5px;
}

/* รายการติดต่อ (คอลัมน์ 2) */
.gov-contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.gov-contact-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 1.5;
}

.gov-contact-icon {
  font-size: 18px;
  color: #38bdf8;
  flex-shrink: 0;
  margin-top: 2px;
}

.gov-contact-text strong {
  display: block;
  color: #ffffff;
  font-size: 15px;
  margin-bottom: 2px;
}

.gov-contact-text a {
  color: #ffffff;
  text-decoration: none;
  transition: color 0.2s;
}

.gov-contact-text a:hover {
  color: #38bdf8;
}

.gov-contact-text small {
  color: #94a3b8;
  font-size: 12px;
  display: block;
}

/* สถิติผู้เข้าชม (คอลัมน์ 3) */
.gov-counter-box {
  background: #000000;
  border: 2px solid #334155;
  border-radius: 6px;
  padding: 6px 10px;
  display: inline-flex;
  gap: 4px;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.6);
  margin-bottom: 16px;
}

.gov-counter-digit {
  width: 26px;
  height: 34px;
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid #475569;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Courier New', Courier, monospace;
  font-size: 22px;
  font-weight: 700;
  color: #38bdf8;
  box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.gov-counter-digit img {
  height: 24px;
  width: auto;
}

.gov-visitor-table {
  width: 100%;
  font-size: 13.5px;
}

.gov-visitor-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
}

.gov-visitor-row img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.gov-visitor-meta {
  margin-top: 10px;
  padding-top: 8px;
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.6;
}

/* แถบลิขสิทธิ์ด้านล่างสุด (Copyright Bar) */
.gov-footer-bottom {
  background: var(--gov-navy-dark);
  color: #94a3b8;
  padding: 16px 4%;
  font-size: 13px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.gov-footer-bottom-inner {
  max-width: 1380px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.gov-footer-bottom-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gov-footer-bottom-logo {
  height: 28px;
  width: auto;
}

/* ==========================================
   3. เมนูปุ่มลอยมุมขวาล่าง (Floating Action Menu)
   ========================================== */
.spmnara-floating-menu {
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 999999;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  align-items: flex-end;
}

.float-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #ffffff !important;
  padding: 9px 18px;
  border-radius: 50px;
  text-decoration: none !important;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  white-space: nowrap;
}

.float-btn:hover {
  transform: translateX(-5px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  color: #ffffff !important;
}

.float-btn svg {
  flex-shrink: 0;
}

.btn-fb { background: #1877F2; }
.btn-fb:hover { background: #1462c7; }

.btn-qa { background: #009688; }
.btn-qa:hover { background: #00796b; }

.btn-msg { 
  background: #0084ff; 
  animation: pulse-blue 2s infinite; 
}
.btn-msg:hover { background: #006fe6; }

.btn-tel { background: #22c55e; }
.btn-tel:hover { background: #16a34a; }

@keyframes pulse-blue {
  0% { box-shadow: 0 0 0 0 rgba(0, 132, 255, 0.55); }
  70% { box-shadow: 0 0 0 16px rgba(0, 132, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 132, 255, 0); }
}

/* ==========================================
   Responsive Breakpoints
   ========================================== */
@media (max-width: 992px) {
  .gov-footer-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .gov-brand-box {
    padding: 8px 14px;
  }
  .gov-brand-title {
    font-size: 18px;
  }
}

@media (max-width: 768px) {
  .gov-top-bar {
    justify-content: center;
    text-align: center;
  }
  .gov-top-info {
    justify-content: center;
    gap: 10px;
  }
  .gov-brand-container {
    justify-content: center;
    text-align: center;
  }
  .gov-brand-left {
    flex-direction: column;
  }
  .gov-nav-menu {
    justify-content: center;
    width: 100%;
  }
  .gov-nav-link {
    padding: 10px 12px;
    font-size: 14px;
  }
  .gov-footer-bottom-inner {
    flex-direction: column;
    text-align: center;
  }
  .spmnara-floating-menu {
    bottom: 15px;
    right: 15px;
    gap: 8px;
  }
  .float-btn {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    justify-content: center;
    padding: 0;
  }
  .float-btn span {
    display: none;
  }
}
