/* plan-dept4: styles extracted from index.php, category.php, item.php, tor.php, principles.php */

/* From plan-dept4/index.php */
/* ── Hero ─────────────────────────────────── */
.dept4-hero {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, rgba(11,31,15,0.65) 0%, rgba(26,58,34,0.5) 60%, rgba(13,43,20,0.7) 100%),
              url('../css/img/banner.jpg');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  padding: 5rem 2rem 4rem;
  text-align: center; color: #fff;
}
.dept4-hero::after {
  content: ''; position: absolute; top: -200px; left: 50%;
  transform: translateX(-50%); width: 700px; height: 700px; border-radius: 50%;
  background: radial-gradient(circle, rgba(58,90,64,.35) 0%, transparent 70%);
  pointer-events: none;
}
.dept4-hero > * { position: relative; z-index: 1; }
.dept4-hero .inner { position: relative; max-width: 740px; margin: 0 auto; }
.dept4-hero .eyebrow {
  display: inline-block;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25);
  border-radius: 20px; padding: .35rem 1rem;
  font-size: .88rem; letter-spacing: .05em; margin-bottom: 1rem;
}
.dept4-hero h1 {
  font-size: clamp(1.7rem, 4vw, 2.8rem);
  font-weight: 700; line-height: 1.25; margin: 0 0 1rem;
}
.dept4-hero h1 strong { color: #C5A880; }
.dept4-hero p { font-size: 1rem; opacity: .85; line-height: 1.65; margin: 0; }
.pill-row { display: flex; gap: .7rem; justify-content: center; flex-wrap: wrap; margin-top: 1.5rem; }
.pill {
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.3);
  border-radius: 20px; padding: .4rem 1rem;
  font-size: .85rem; display: flex; align-items: center; gap: .4rem;
  color: #fff; text-decoration: none; transition: background .2s;
}
a.pill:hover { background: rgba(255,255,255,.22); }
/* ── Stats bar ────────────────────────────── */
.stats-bar {
  background: #fff; border-bottom: 1px solid #e0ebe2;
  padding: .9rem 2rem;
  display: flex; gap: 2rem; justify-content: center; flex-wrap: wrap;
}
.stat-chip { text-align: center; }
.stat-chip .s-num   { font-size: 1.5rem; font-weight: 700; color: #2d4a33; line-height: 1; }
.stat-chip .s-label { font-size: .78rem; color: #6b8f71; }
/* ── Main wrap ────────────────────────────── */
.main-content { max-width: 1100px; margin: 0 auto; padding: 3rem 1.5rem; }
.section-heading {
  font-size: .8rem; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: #3A5A40;
  margin-bottom: 1.5rem;
  display: flex; align-items: center; gap: .6rem;
}
.section-heading::after { content: ''; flex: 1; height: 1px; background: #d4ede0; }
/* ── Filter bar ───────────────────────────── */
.filter-bar {
  display: flex; align-items: center; gap: .7rem;
  flex-wrap: wrap; margin-bottom: 1rem;
  background: #fff; border: 1px solid #e0ebe2;
  border-radius: 12px; padding: .75rem 1rem;
  box-shadow: 0 1px 6px rgba(58,90,64,.05);
}
.filter-bar input[type=search],
.filter-bar select {
  font-family: 'Anuphan', sans-serif; font-size: .87rem;
  padding: .45rem .85rem; border: 1px solid #d4ede0;
  border-radius: 8px; background: #fafafa; color: #1e2e20;
  outline: none; transition: border-color .2s;
}
.filter-bar input[type=search] { flex: 1; min-width: 160px; }
.filter-bar input[type=search]:focus,
.filter-bar select:focus { border-color: #3A5A40; background: #fff; }
.filter-count { font-size: .82rem; color: #6b8f71; margin-left: auto; white-space: nowrap; }

/* ── Category cards ───────────────────────── */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.4rem;
}
.cat-card {
  background: #fff;
  border: 1px solid #e0ebe2;
  border-radius: 16px; overflow: hidden;
  text-decoration: none; color: inherit;
  transition: transform .25s, box-shadow .25s, border-color .25s;
  display: flex; flex-direction: column;
}
.cat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 36px rgba(58,90,64,.13);
  border-color: #6B8F71;
}
.cat-card-top {
  background: linear-gradient(135deg, #2d4a33, #4a7a54);
  padding: 1.3rem 1.5rem 1.1rem;
  position: relative; overflow: hidden;
}
.cat-card-top::after {
  content: ''; position: absolute; top: -30px; right: -30px;
  width: 100px; height: 100px;
  background: rgba(255,255,255,.07); border-radius: 50%;
}
.cat-icon { display: block; margin-bottom: .4rem; width: 36px; height: 36px; color: #fff; }
.cat-card-body { padding: 1.1rem 1.4rem; flex: 1; }
.cat-name { font-size: .98rem; font-weight: 700; color: #1e2e20; line-height: 1.35; margin-bottom: .5rem; }
.cat-desc { font-size: .85rem; color: #5a7a5e; line-height: 1.55; }
.cat-card-footer {
  padding: .85rem 1.4rem;
  border-top: 1px solid #eef3f0;
  display: flex; align-items: center; justify-content: space-between;
}
.item-cnt { background:#d4ede0; color:#1a3a20; border-radius:12px; padding:.18rem .65rem; font-size:.82rem; font-weight:600; }
.view-link { color:#3A5A40; font-size:.86rem; font-weight:600; display:flex; align-items:center; gap:.3rem; }
/* From plan-dept4/category.php */
.breadcrumb-bar {
  background: #fff; border-bottom: 1px solid #e0ebe2;
  padding: .6rem 2rem; font-size: .85rem;
  display: flex; align-items: center; gap: .4rem; flex-wrap: wrap;
}
.breadcrumb-bar a { color: #3A5A40; text-decoration: none; }
.breadcrumb-bar a:hover { text-decoration: underline; }
.breadcrumb-bar .sep { color: #9ca3af; }
.breadcrumb-bar .cur { color: #1e2e20; font-weight: 600; }
/* ── Category banner ──────────────────────── */
.cat-banner {
  background: linear-gradient(135deg, rgba(7,26,12,0.65) 0%, rgba(15,46,20,0.55) 55%, rgba(26,64,32,0.7) 100%),
              url('../css/img/banner.jpg');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  padding: 2.5rem 2rem 2rem; color: #fff;
  position: relative; overflow: hidden;
}
.cat-banner::before {
  content: ''; position: absolute; right: -60px; top: -60px;
  width: 200px; height: 200px;
  background: rgba(197,168,128,.08); border-radius: 50%;
}
.cat-banner .inner { position: relative; max-width: 900px; margin: 0 auto; display: flex; align-items: flex-start; gap: 1.2rem; }
.cat-banner .b-icon { font-size: 2.8rem; line-height: 1; flex-shrink: 0; }
.cat-banner .b-tag  {
  display: inline-block; background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.25); border-radius: 20px;
  padding: .25rem .85rem; font-size: .82rem; margin-bottom: .6rem;
}
.cat-banner h1 {
  font-size: clamp(1.1rem, 2.5vw, 1.65rem); font-weight: 700;
  line-height: 1.3; margin: 0 0 .6rem;
}
.cat-banner p { font-size: .92rem; opacity: .85; line-height: 1.55; margin: 0; }
/* ── Layout ───────────────────────────────── */
.page-layout {
  max-width: 1100px; margin: 0 auto; padding: 2.5rem 1.5rem;
  display: grid; grid-template-columns: 220px 1fr; gap: 2rem;
}
@media (max-width: 700px) { .page-layout { grid-template-columns: 1fr; } }
/* ── Sidebar ──────────────────────────────── */
.sidebar { position: sticky; top: 80px; align-self: start; }
.sidebar-title {
  font-size: .76rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: #3A5A40; margin-bottom: .75rem;
}
.sidebar-link {
  display: flex; align-items: center; gap: .55rem;
  padding: .55rem .75rem; border-radius: 8px;
  text-decoration: none; font-size: .88rem; color: #4b5563;
  transition: .18s; margin-bottom: .25rem;
}
.sidebar-link:hover  { background: #f0faf4; color: #2d4a33; }
.sidebar-link.active { background: #2d4a33; color: #fff; font-weight: 600; }
.sidebar-link .s-cnt { margin-left: auto; background: rgba(255,255,255,.18); border-radius: 10px; padding: .1rem .45rem; font-size: .76rem; }
.sidebar-link:not(.active) .s-cnt { background: #d4ede0; color: #1a3a20; }
/* ── Table ────────────────────────────────── */
.section-heading {
  font-size: .78rem; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: #3A5A40;
  margin-bottom: 1.2rem;
  display: flex; align-items: center; gap: .6rem;
}
.section-heading::after { content: ''; flex: 1; height: 1px; background: #d4ede0; }
.table-wrap {
  background: #fff; border-radius: 14px;
  border: 1px solid #e0ebe2;
  overflow: hidden; box-shadow: 0 2px 16px rgba(58,90,64,.06);
}
.items-table { width: 100%; border-collapse: collapse; }
.items-table th {
  background: #f8f9fa; font-weight: 600; color: #2d4a33;
  font-size: .84rem; padding: .8rem 1.1rem;
  text-align: left; border-bottom: 2px solid #e2e8f0;
}
.items-table td {
  padding: .9rem 1.1rem; border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
.items-table tr:last-child td { border-bottom: none; }
.items-table tr:hover td { background: #f8f9fa; }
.item-num  { color: #9ca3af; font-size: .83rem; font-weight: 600; text-align: center; }
.item-thumb { width: 58px; height: 58px; object-fit: cover; border-radius: 10px; border: 1px solid #d4ede0; display: block; }
.item-no-img { width: 58px; height: 58px; background: #f0faf4; border-radius: 10px; border: 1px dashed #c0d0c2; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; }
.item-name { font-weight: 700; font-size: .95rem; color: #1e2e20; }
.item-note { font-size: .82rem; color: #6b8f71; margin-top: .25rem; line-height: 1.45; }
.std-chip  {
  display: inline-block; background: #f0faf4; color: #2d4a33;
  border: 1px solid #a8d5b5; border-radius: 10px;
  padding: .1rem .55rem; font-size: .76rem;
  margin: .1rem .12rem .1rem 0;
}
.dept-text { font-size: .85rem; color: #4b5563; }
.detail-btn {
  display: inline-flex; align-items: center; gap: .3rem;
  background: #f0faf4; color: #2d4a33;
  border: 1px solid #a8d5b5; border-radius: 8px;
  padding: .32rem .8rem; font-size: .82rem;
  text-decoration: none; font-weight: 600; white-space: nowrap;
  transition: .18s;
}
.detail-btn:hover { background: #d4ede0; }
/* From plan-dept4/item.php */
.breadcrumb-bar { /* duplicate, safe */ }
.page-wrap { max-width: 820px; margin: 0 auto; padding: 2.5rem 1.5rem; }
.back-link {
  display: inline-flex; align-items: center; gap: .4rem;
  color: #3A5A40; text-decoration: none; font-size: .88rem;
  font-weight: 600; margin-bottom: 1.2rem; transition: .18s;
}
.back-link:hover { color: #1a3a20; }
/* ── Card ─────────────────────────────────── */
.item-card {
  background: #fff; border: 1px solid #e0ebe2;
  border-radius: 20px; overflow: hidden;
  box-shadow: 0 4px 24px rgba(58,90,64,.08);
}
.item-header {
  background: linear-gradient(135deg, #071a0c, #0f2e14 55%, #1a4020);
  padding: 2rem 2rem 1.6rem; color: #fff; position: relative; overflow: hidden;
}
.item-header::after {
  content: ''; position: absolute; right: -50px; bottom: -50px;
  width: 180px; height: 180px;
  background: rgba(255,255,255,.05); border-radius: 50%;
}
.item-header .cat-tag {
  display: inline-flex; align-items: center; gap: .4rem;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25);
  border-radius: 20px; padding: .28rem .85rem; font-size: .82rem;
  margin-bottom: .85rem;
}
.item-header h1 {
  font-size: clamp(1.1rem, 2.8vw, 1.5rem); font-weight: 700;
  line-height: 1.3; margin: 0; position: relative;
}
/* Stronger specificity for item page to avoid accidental overrides */
.page-wrap .item-card {
  background: #fff; border: 1px solid #e0ebe2;
  border-radius: 20px; overflow: hidden;
  box-shadow: 0 4px 24px rgba(58,90,64,.08);
}
.page-wrap .item-card .item-header {
  background: linear-gradient(135deg, #071a0c, #0f2e14 55%, #1a4020);
  padding: 2rem 2rem 1.6rem; color: #fff; position: relative; overflow: hidden;
}
.page-wrap .item-card .item-header::after {
  content: ''; position: absolute; right: -50px; bottom: -50px;
  width: 180px; height: 180px; background: rgba(255,255,255,.05); border-radius: 50%;
}
.page-wrap .item-card .cat-tag {
  display: inline-flex; align-items: center; gap: .4rem;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25);
  border-radius: 20px; padding: .28rem .85rem; font-size: .82rem; margin-bottom: .85rem;
}

/* ── Item page (scoped) — styles only for plan-dept4/item.php when body.dept4-item is present */
.dept4-item .page-wrap { max-width: 920px; }
.dept4-item .item-card {
  background: #fff; border-radius: 18px; overflow: hidden;
  box-shadow: 0 18px 40px rgba(10,30,18,0.12), 0 4px 12px rgba(0,0,0,0.06);
  border: 1px solid rgba(26,58,34,0.06);
}
.dept4-item .item-card .item-header {
  background: linear-gradient(135deg, rgba(7,26,12,0.95) 0%, rgba(15,46,20,0.9) 55%, rgba(26,64,32,0.95) 100%);
  padding: 2.25rem 2.25rem 1.6rem; color: #fff; position: relative; overflow: hidden;
  border-top-left-radius: 18px; border-top-right-radius: 18px;
}
.dept4-item .item-card .item-header::after {
  content: ''; position: absolute; right: -40px; bottom: -40px;
  width: 200px; height: 200px; background: rgba(255,255,255,0.03); border-radius: 50%;
}
.dept4-item .item-card .cat-tag {
  background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.18);
  color: #fff; font-weight: 600;
}
.dept4-item .item-body { padding: 1.6rem 2rem 2.2rem; background: linear-gradient(180deg, rgba(255,255,255,1) 0%, rgba(255,255,255,1) 100%); }
.dept4-item .item-main-img { width: 100%; max-width: 420px; height: auto; border-radius: 12px; display: block; margin: 0 0 1rem 0; }
.dept4-item .info-section { margin-bottom: 1rem; }
.dept4-item .info-label {
  font-size: .86rem; font-weight: 700; letter-spacing: .06em;
  text-transform: none; color: #2d4a33; margin-bottom: .6rem; display: flex; align-items: center; gap: .5rem;
}
.dept4-item .info-label::after { content: ''; flex: 1; height: 1px; background: #eef3f0; margin-left: .6rem; }
.dept4-item .info-value { font-size: .98rem; color: #1e2e20; line-height: 1.6; }
.dept4-item .std-chip { background: #e8f5e9; color: #1a3a20; border: 1px solid #cfead2; }
.dept4-item .no-std { color: #9ca3af; font-size: .9rem; }
.dept4-item .pn-nav { border-top: 1px solid #eef3f0; padding: 1.2rem 1.6rem; display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.dept4-item .pn-btn { display: flex; flex-direction: column; padding: .9rem 1rem; border-radius: 10px; border: 1px solid #e8f4ea; background: #fff; color: inherit; text-decoration: none; transition: .18s;    font-size: x-small; }
.dept4-item .pn-btn.prev { align-items: flex-start; }
.dept4-item .pn-btn.next { align-items: flex-end; text-align: right; }
.dept4-item .pn-btn:hover { border-color: #6b8f71; box-shadow: 0 6px 18px rgba(26,58,34,0.06); }

@media (max-width: 820px) {
  .dept4-item .pn-nav { grid-template-columns: 1fr; }
  .dept4-item .item-main-img { max-width: 100%; }
}
/* From plan-dept4/tor.php */
.tor-hero {
  background: linear-gradient(135deg, #071a0c 0%, #0f2e14 55%, #1a4020 100%);
  padding: 3rem 2rem 2.5rem; text-align: center; color: #fff;
  position: relative; overflow: hidden;
}
.tor-hero::before {
  content: ''; position: absolute; right: -80px; bottom: -80px;
  width: 260px; height: 260px;
  background: rgba(197,168,128,.07); border-radius: 50%;
}
.tor-hero .inner { position: relative; max-width: 660px; margin: 0 auto; }
.tor-hero .eyebrow {
  display: inline-block;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25);
  border-radius: 20px; padding: .3rem .9rem; font-size: .85rem; margin-bottom: .85rem;
}
/* From plan-dept4/principles.php */
.prin-hero {
  background: linear-gradient(135deg, #071a0c 0%, #0f2e14 55%, #1a4020 100%);
  padding: 3.5rem 2rem 3rem; text-align: center; color: #fff;
  position: relative; overflow: hidden;
}
.prin-hero::before {
  content: ''; position: absolute; left: -80px; top: -60px;
  width: 280px; height: 280px;
  background: rgba(255,255,255,.04); border-radius: 50%;
}
.prin-hero .inner { position: relative; max-width: 700px; margin: 0 auto; }
.prin-hero .eyebrow {
  display: inline-block;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25);
  border-radius: 20px; padding: .3rem .9rem; font-size: .85rem; margin-bottom: .9rem;
}
.prin-hero h1 { font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 700; margin: 0 0 .8rem; line-height: 1.25; }
.prin-hero h1 span { color: #C5A880; }
.prin-hero p  { font-size: .95rem; opacity: .8; line-height: 1.65; margin: 0; }
