/* assets/css/portal.css - ธีมพอร์ทัลสถานศึกษา (3-Column Boxed Layout, Responsive) */
:root {
  --portal-bg: #eef2f6;
  --portal-navy: #0b4f8a;
  --portal-navy-dark: #073863;
  --portal-blue: #1677c7;
  --portal-sky: #e7f2fc;
  --portal-border: #d7e2ec;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: 'Sarabun', sans-serif;
  background-color: var(--portal-bg);
  color: #1f2937;
  margin: 0;
}

.portal-shell {
  max-width: 1180px;
  margin: 0 auto;
  background-color: #ffffff;
  box-shadow: 0 6px 28px rgba(15, 23, 42, 0.1);
  border-left: 1px solid var(--portal-border);
  border-right: 1px solid var(--portal-border);
}

/* Top Header */
.top-header {
  background: #ffffff;
  padding: 16px 24px;
  border-bottom: 1px solid var(--portal-border);
}

.brand-badge {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--portal-navy), var(--portal-blue));
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

/* Main Navbar */
.portal-nav {
  background: linear-gradient(90deg, var(--portal-navy-dark) 0%, var(--portal-navy) 100%);
}

.portal-nav .nav-link {
  color: #e6f2ff;
  font-weight: 500;
  padding: 11px 16px;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.portal-nav .nav-link:hover,
.portal-nav .nav-link.active {
  background-color: var(--portal-blue);
  color: #ffffff;
}

/* Hero Banner */
.hero-box {
  background: linear-gradient(120deg, rgba(7, 56, 99, 0.92) 0%, rgba(11, 79, 138, 0.86) 55%, rgba(22, 119, 199, 0.82) 100%);
  color: #ffffff;
  padding: 36px 28px;
  border-bottom: 4px solid var(--portal-blue);
}

/* Sidebars & Panels */
.panel-box {
  border: 1px solid var(--portal-border);
  border-radius: 6px;
  background: #ffffff;
  margin-bottom: 18px;
  overflow: hidden;
}

.panel-header {
  background: linear-gradient(90deg, var(--portal-navy) 0%, var(--portal-blue) 100%);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 9px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.panel-body {
  padding: 14px;
}

.side-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.side-list li {
  border-bottom: 1px dashed #e2e8f0;
}

.side-list li:last-child {
  border-bottom: none;
}

.side-list a {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 4px;
  color: #1e293b;
  text-decoration: none;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.side-list a:hover,
.side-list a.active-cat {
  color: var(--portal-navy);
  font-weight: 600;
}

.side-list a i {
  color: var(--portal-blue);
  font-size: 0.78rem;
  flex-shrink: 0;
}

.announce-item {
  padding: 7px 0;
  border-bottom: 1px solid #edf2f7;
  font-size: 0.92rem;
}

.announce-item:last-child {
  border-bottom: none;
}

.announce-item > a,
.news-row > .flex-grow-1 {
  min-width: 0;
  overflow-wrap: break-word;
}

/* News Rows & Thumbnails */
.news-row {
  padding: 14px 0;
  border-bottom: 1px solid #e2e8f0;
}

.news-row:last-child {
  border-bottom: none;
}

.news-thumb {
  width: 156px;
  height: 108px;
  object-fit: cover;
  object-position: 50% 15%;
  border-radius: 6px;
  background: var(--portal-sky);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--portal-navy);
  font-size: 1.5rem;
  flex-shrink: 0;
  border: 1px solid var(--portal-border);
  overflow: hidden;
}

img.news-thumb {
  display: block;
}

/* Executive Photo */
.panel-body .director-photo,
img.director-photo {
  width: 100%;
  max-width: 240px;
  height: 220px;
  object-fit: cover;
  object-position: 50% 10%;
  border-radius: 8px;
  border: 1px solid var(--portal-border);
  margin-left: auto;
  margin-right: auto;
  display: block;
}

img.director-photo-contain {
  max-width: 260px;
  max-height: 200px;
  width: auto;
  height: auto;
  object-fit: contain;
  background-color: #f8f9fa;
  border-radius: 8px;
  border: 1px solid var(--portal-border);
  margin: 0 auto;
  display: block;
}

/* Quote & Stats */
.quote-box {
  background: #f8fbff;
  border-left: 4px solid var(--portal-blue);
  padding: 12px;
  border-radius: 4px;
  font-size: 0.9rem;
  color: #334155;
}

.stat-card {
  border: 1px solid var(--portal-border);
  border-radius: 6px;
  padding: 14px;
  background: #ffffff;
  height: 100%;
}

/* Post Detail */
.post-content {
  font-size: 1rem;
  line-height: 1.75;
  color: #1f2937;
  overflow-wrap: break-word;
}

.post-cover {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 320px;
  object-fit: cover;
  object-position: 50% 15%;
  border-radius: 8px;
  border: 1px solid var(--portal-border);
  background-color: #f8f9fa;
  margin-bottom: 16px;
}

.gallery-img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 200px;
  object-fit: cover;
  object-position: 50% 15%;
  border-radius: 6px;
  border: 1px solid var(--portal-border);
  background-color: #f8f9fa;
}

/* Footer */
.portal-footer {
  background: linear-gradient(180deg, #1b6ca8 0%, #0e4a7a 100%);
  color: #e6f2ff;
  padding: 28px 24px 16px;
  font-size: 0.88rem;
}

.portal-footer h6 {
  color: #ffffff;
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.portal-footer a {
  color: #d7ecff;
  text-decoration: none;
  display: block;
  padding: 2px 0;
  overflow-wrap: anywhere;
}

.portal-footer a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.footer-bottom {
  background: #083356;
  color: #b8d8f5;
  font-size: 0.82rem;
  padding: 10px 24px;
}

/* Tablet & Below (< 992px) */
@media (max-width: 991.98px) {
  .portal-nav .nav-link {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    padding: 9px 14px;
  }

  .panel-body .director-photo,
  img.director-photo {
    max-width: 210px;
    height: 195px;
  }
}

/* Mobile (< 576px) */
@media (max-width: 575.98px) {
  .portal-shell {
    border-left: none;
    border-right: none;
    box-shadow: none;
  }

  .top-header {
    padding: 12px 14px;
  }

  .hero-box {
    padding: 22px 16px;
  }

  .panel-body {
    padding: 12px;
  }

  .news-thumb {
    width: 100%;
    height: 185px;
  }

  .post-cover {
    height: 220px;
  }

  .gallery-img {
    height: 180px;
  }

  .portal-footer,
  .footer-bottom {
    padding-left: 16px;
    padding-right: 16px;
  }
}
