/* ===== โรงพยาบาลเสลภูมิ - Main Stylesheet ===== */
@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@300;400;500;600;700&display=swap');

:root {
  --primary:    #0277bd;
  --primary-light: #b3e5fc;
  --primary-dark:  #01579b;
  --secondary:  #00838f;
  --accent:     #80deea;
  --pastel-blue: #e3f2fd;
  --pastel-teal: #e0f7fa;
  --pastel-green:#e8f5e9;
  --pastel-pink: #fce4ec;
  --pastel-yellow:#fffde7;
  --white:      #ffffff;
  --gray-100:   #f5f7fa;
  --gray-200:   #eceff1;
  --gray-400:   #b0bec5;
  --gray-600:   #546e7a;
  --gray-800:   #263238;
  --text-main:  #37474f;
  --border:     #e0e0e0;
  --shadow-sm:  0 2px 8px rgba(2,119,189,0.08);
  --shadow-md:  0 4px 16px rgba(2,119,189,0.12);
  --shadow-lg:  0 8px 32px rgba(2,119,189,0.16);
  --radius:     10px;
  --radius-lg:  16px;
}

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

body {
  font-family: 'Sarabun', sans-serif;
  font-size: 16px;
  color: var(--text-main);
  background: var(--gray-100);
  line-height: 1.7;
}

a { color: var(--primary); text-decoration: none; transition: color .2s; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; }

/* ===== TOP BAR ===== */
.top-bar {
  background: var(--primary-dark);
  color: #b3e5fc;
  font-size: 13px;
  padding: 6px 0;
}
.top-bar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.top-bar a { color: #b3e5fc; }
.top-bar a:hover { color: #fff; }
.top-bar .social-links { display: flex; gap: 12px; }
.top-bar .social-links a { font-size: 15px; }

/* ===== HEADER ===== */
.site-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  padding: 0;
  box-shadow: 0 2px 12px rgba(0,0,0,.2);
  position: sticky; top: 0; z-index: 1000;
}
.header-inner {
  display: flex;
  align-items: center;
  padding: 10px 0;
  gap: 16px;
}
.header-logo { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.header-logo img { width: 68px; height: 68px; object-fit: contain; flex-shrink: 0; }
.logo-placeholder {
  width: 70px; height: 70px; border-radius: 50%;
  background: rgba(255,255,255,.2);
  border: 3px solid rgba(255,255,255,.4);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; color: #fff;
  flex-shrink: 0;
}
.header-text { color: #fff; }
.header-text h1 { font-size: 1.4rem; font-weight: 700; line-height: 1.2; }
.header-text p  { font-size: 13px; opacity: .85; }

/* ===== NAVBAR ===== */
.navbar {
  background: rgba(0,0,0,.15);
  backdrop-filter: blur(4px);
}
.navbar .container { padding: 0; }
.nav-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
}
.nav-list > li { position: relative; }
.nav-list > li > a {
  display: block;
  color: #fff;
  padding: 12px 16px;
  font-size: 14.5px;
  font-weight: 500;
  border-bottom: 3px solid transparent;
  transition: all .2s;
  white-space: nowrap;
}
.nav-list > li > a:hover,
.nav-list > li > a.active {
  background: rgba(255,255,255,.15);
  border-bottom-color: var(--accent);
  color: #fff;
}
.nav-list > li:first-child > a { padding-left: 20px; }

/* Dropdown */
.has-dropdown:hover .dropdown { display: block; }
.dropdown {
  display: none;
  position: absolute;
  top: 100%; left: 0;
  background: #fff;
  min-width: 260px;
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow-md);
  z-index: 1000;
  border-top: 3px solid var(--primary);
}
.dropdown li { list-style: none; }
.dropdown a {
  display: block;
  padding: 10px 18px;
  color: var(--text-main);
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}
.dropdown a:hover { background: var(--pastel-blue); color: var(--primary); }
.dropdown a:last-child { border-bottom: none; }

/* Mobile menu */
.nav-toggle {
  display: none;
  background: rgba(255,255,255,.2);
  border: none; color: #fff;
  font-size: 22px; cursor: pointer;
  padding: 8px 12px; border-radius: 6px;
  margin-left: auto;
}

/* ===== CONTAINER ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ===== HERO / BANNER SLIDER ===== */
.hero-slider {
  position: relative;
  overflow: hidden;
  background: var(--primary-dark);
  width: 100%;
}
.slider-track { display: flex; transition: transform .6s ease; }
.slide {
  min-width: 100%;
  position: relative;
}
.slide img {
  width: 100%; height: auto; aspect-ratio: 1200/450; object-fit: cover;
  display: block;
}
.slide-placeholder {
  width: 100%; aspect-ratio: 1200/450;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 60px; color: rgba(255,255,255,.3);
}
.slide-caption {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.7));
  color: #fff; padding: 40px 30px 20px;
}
.slide-caption h3 { font-size: 1.4rem; font-weight: 600; margin-bottom: 4px; }
.slide-caption p  { font-size: 14px; opacity: .85; }

.slider-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.25); border: none; color: #fff;
  width: 44px; height: 44px; border-radius: 50%;
  font-size: 18px; cursor: pointer; transition: background .2s;
  display: flex; align-items: center; justify-content: center;
}
.slider-btn:hover { background: rgba(255,255,255,.5); }
.slider-btn.prev { left: 16px; }
.slider-btn.next { right: 16px; }

.slider-dots {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 8px;
}
.slider-dots span {
  width: 10px; height: 10px; border-radius: 50%;
  background: rgba(255,255,255,.5); cursor: pointer; transition: background .2s;
}
.slider-dots span.active { background: #fff; }

/* ===== QUICK INFO BAR ===== */
.quick-info {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}
.quick-info .container {
  display: flex; gap: 24px; flex-wrap: wrap; align-items: center;
}
.quick-info-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; color: var(--gray-600);
}
.quick-info-item i { color: var(--primary); font-size: 16px; }
.quick-info-item strong { color: var(--primary); }

/* ===== SECTION ===== */
.section { padding: 40px 0; }
.section-title {
  font-size: 1.3rem; font-weight: 700;
  color: var(--primary-dark);
  padding-bottom: 10px;
  margin-bottom: 20px;
  border-bottom: 3px solid var(--primary-light);
  display: flex; align-items: center; gap: 10px;
  position: relative;
}
.section-title::after {
  content: '';
  position: absolute; bottom: -3px; left: 0;
  width: 60px; height: 3px;
  background: var(--primary);
}
.section-title i { color: var(--primary); font-size: 1.2em; }

.section-header {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-bottom: 20px; gap: 10px; flex-wrap: wrap;
}
.view-all {
  font-size: 13px; color: var(--primary);
  border: 1px solid var(--primary);
  padding: 4px 12px; border-radius: 20px;
  white-space: nowrap;
}
.view-all:hover { background: var(--primary); color: #fff; }

/* ===== MAIN LAYOUT ===== */
.main-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 28px;
}
@media (max-width: 900px) { .main-layout { grid-template-columns: 1fr; } }

/* ===== SERVICE TABLE ===== */
.service-table-wrap { overflow-x: auto; }
.service-table {
  width: 100%; border-collapse: collapse;
  font-size: 14px;
}
.service-table th {
  background: var(--primary);
  color: #fff; padding: 10px 14px;
  text-align: left; font-weight: 600;
}
.service-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); }
.service-table tr:nth-child(even) td { background: var(--pastel-blue); }
.service-table tr:hover td { background: var(--primary-light); }
.badge-24 { background: #e8f5e9; color: #2e7d32; padding: 2px 8px; border-radius: 10px; font-size: 12px; }
.badge-close { background: #ffebee; color: #c62828; padding: 2px 8px; border-radius: 10px; font-size: 12px; }

/* ===== NEWS CARDS ===== */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.news-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
  display: flex; flex-direction: column;
}
.news-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.news-card .card-img {
  width: 100%; height: 180px; object-fit: cover;
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 48px; color: var(--primary);
}
.news-card .card-img img { width: 100%; height: 100%; object-fit: cover; }
.news-card .card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.news-card .card-cat {
  font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--white); background: var(--secondary);
  padding: 2px 8px; border-radius: 10px;
  display: inline-block; margin-bottom: 8px;
}
.news-card h4 { font-size: 15px; font-weight: 600; line-height: 1.4; margin-bottom: 8px; flex: 1; }
.news-card .card-meta { font-size: 12px; color: var(--gray-400); display: flex; gap: 12px; align-items: center; }

/* ===== NEWS LIST (sidebar style) ===== */
.news-list { list-style: none; }
.news-list li {
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
  display: flex; gap: 10px; align-items: flex-start;
}
.news-list li:last-child { border-bottom: none; }
.news-list li i { color: var(--primary); margin-top: 3px; flex-shrink: 0; }
.news-list li a { font-size: 14px; line-height: 1.4; color: var(--text-main); }
.news-list li a:hover { color: var(--primary); }
.news-list li .date { font-size: 11px; color: var(--gray-400); display: block; margin-top: 2px; }

/* ===== SIDEBAR CARD ===== */
.sidebar-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 24px;
}
.sidebar-card .card-header {
  background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
  color: #fff; padding: 12px 16px;
  font-weight: 600; font-size: 15px;
  display: flex; gap: 8px; align-items: center;
}
.sidebar-card .card-header i { font-size: 16px; }
.sidebar-card .card-body { padding: 14px 16px; }

/* ===== QUICK LINKS ===== */
.quick-links-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.quick-link-item {
  background: var(--white);
  border-radius: var(--radius);
  padding: 18px 12px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: all .2s;
  border: 2px solid transparent;
}
.quick-link-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}
.quick-link-item .icon-circle {
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin: 0 auto 10px;
  transition: transform .2s;
}
.quick-link-item:hover .icon-circle { transform: scale(1.1); }
.quick-link-item span {
  display: block; font-size: 12px; font-weight: 500;
  color: var(--gray-600); line-height: 1.3;
}

/* ===== MAP ===== */
.map-container {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.map-container iframe { display: block; }

/* ===== FOOTER ===== */
.site-footer {
  background: linear-gradient(135deg, #01579b 0%, #006064 100%);
  color: #b3e5fc;
  padding: 40px 0 0;
  margin-top: 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 30px;
  border-bottom: 1px solid rgba(255,255,255,.15);
}
.footer-col h4 {
  color: #fff; font-size: 16px; font-weight: 600;
  margin-bottom: 14px; padding-bottom: 8px;
  border-bottom: 2px solid rgba(255,255,255,.2);
}
.footer-col p, .footer-col a { font-size: 13.5px; color: #b3e5fc; line-height: 1.8; }
.footer-col a:hover { color: #fff; }
.footer-col ul { list-style: none; }
.footer-col ul li { padding: 4px 0; }
.footer-col ul li i { margin-right: 6px; font-size: 12px; }
.footer-contact li { display: flex; gap: 8px; align-items: flex-start; }
.footer-bottom {
  background: rgba(0,0,0,.2);
  text-align: center;
  padding: 14px 20px;
  font-size: 13px;
  color: rgba(255,255,255,.6);
}

/* ===== CATEGORY BADGES ===== */
.cat-activity { background: #e3f2fd; color: #1565c0; }
.cat-pr       { background: #e8f5e9; color: #2e7d32; }
.cat-procurement { background: #fff8e1; color: #e65100; }
.cat-job      { background: #fce4ec; color: #880e4f; }

/* ===== CARDS SECTION BG ===== */
.bg-white { background: var(--white); }
.bg-pastel-blue { background: var(--pastel-blue); }
.bg-pastel-teal { background: var(--pastel-teal); }

/* ===== PAGE HERO ===== */
.page-hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: #fff; padding: 32px 0;
  margin-bottom: 30px;
}
.page-hero h2 { font-size: 1.8rem; font-weight: 700; }
.page-hero p  { opacity: .85; font-size: 15px; margin-top: 6px; }
.breadcrumb { font-size: 13px; color: rgba(255,255,255,.75); margin-top: 10px; }
.breadcrumb a { color: rgba(255,255,255,.85); }
.breadcrumb span { margin: 0 6px; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 500; margin-bottom: 6px; font-size: 14px; }
.form-control {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid var(--border); border-radius: var(--radius);
  font-family: inherit; font-size: 15px; color: var(--text-main);
  background: var(--white);
  transition: border-color .2s, box-shadow .2s;
}
.form-control:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(2,119,189,.15);
}
textarea.form-control { resize: vertical; min-height: 120px; }
select.form-control { appearance: none; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 24px; border-radius: var(--radius);
  font-family: inherit; font-size: 15px; font-weight: 600;
  cursor: pointer; border: none; transition: all .2s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn-secondary { background: var(--secondary); color: #fff; }
.btn-outline { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }

/* ===== ALERTS ===== */
.alert { padding: 14px 18px; border-radius: var(--radius); margin-bottom: 16px; font-size: 14px; }
.alert-success { background: var(--pastel-green); color: #2e7d32; border-left: 4px solid #2e7d32; }
.alert-error   { background: #ffebee; color: #c62828; border-left: 4px solid #c62828; }
.alert-info    { background: var(--pastel-blue); color: var(--primary-dark); border-left: 4px solid var(--primary); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .nav-list {
    display: none; flex-direction: column;
    background: rgba(0,0,0,.2);
    width: 100%;
  }
  .nav-list.open { display: flex; }
  .nav-list > li > a { padding: 12px 20px; border-bottom: 1px solid rgba(255,255,255,.1); }
  .hero-slider, .slide img, .slide-placeholder { aspect-ratio: 1200/450; height: auto; }
  .quick-links-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr; }
  .news-grid { grid-template-columns: 1fr; }
  .header-text h1 { font-size: 1.1rem; }
}
@media (max-width: 480px) {
  .quick-links-grid { grid-template-columns: repeat(2, 1fr); }
  .quick-link-item { padding: 14px 8px; }
}
