/* ============================================================
   portal-components.css — DNTU Library Portal UI overrides
   Loaded after nav.css in MasterPagePortal2Column.Master

   Design reference: dntu.edu.vn/css/style.css
   - Font:        Montserrat (same as DNTU main)
   - Body text:   #737477  (--rt-body from DNTU)
   - Heading:     #262626  (--rt-heading from DNTU)
   - Border/line: #eee / #D9D9D9 (--rt-line / --rt-border from DNTU)
   - Radius:      6px cards, 4px buttons (DNTU uses 3–7px)
   - Transition:  0.3s ease (DNTU uses 0.4s, split the diff)
   Library sub-brand colors stay as-is: teal #0f6670, orange #FF701D
   ============================================================ */

/* ─── A. Design tokens ───────────────────────────────────── */
:root {
  /* Shadows */
  --pc-card-shadow:       0 2px 8px rgba(0, 0, 0, 0.07);
  --pc-card-shadow-hover: 0 8px 24px rgba(149, 157, 165, 0.2); /* same as DNTU nav shadow */

  /* Radius — matches DNTU card radius range (3–7px) */
  --pc-radius:    6px;
  --pc-radius-sm: 3px;
  --pc-radius-btn: 4px;

  /* Transitions */
  --pc-transition: 0.3s ease;

  /* Library brand (teal sub-brand) */
  --pc-teal:     var(--menu);        /* #0f6670 */

  /* DNTU-aligned neutrals */
  --pc-body-text: #4a4a4a;           /* darkened for legibility on white */
  --pc-heading:   #262626;           /* --rt-heading from DNTU */
  --pc-muted:     #9d9ea2;
  --pc-border:    #D9D9D9;           /* --rt-border from DNTU */
  --pc-line:      #eee;              /* --rt-line from DNTU */

  /* Category badge — teal version of DNTU's #FFEAEE/#AB1F24 */
  --pc-badge-bg:  #E4F2F3;
  --pc-badge-text: var(--pc-teal);
}

/* ─── B. Global font & body text ─────────────────────────── */
/* Scope chặt — chỉ áp dụng trong vùng portal content, tránh đè icon fonts */
.bg_00,
.content.container,
.news-detail,
.news-main-final,
.relate-news,
.submenu2,
.submenu3,
.group-infor-document,
.title-menu,
.title-about,
.row-breadcrumb {
  font-family: "Montserrat", sans-serif;
}
/* Headings trong portal pages */
.bg_00 h1, .bg_00 h2, .bg_00 h3,
.bg_00 h4, .bg_00 h5, .bg_00 h6,
.content.container h1, .content.container h2,
.content.container h3, .content.container h4 {
  font-family: "Montserrat", sans-serif;
  color: var(--pc-heading);
  font-weight: 600;
}

/* ─── C. .title-menu ─────────────────────────────────────── */
.title-menu {
  background-color: var(--pc-teal);
  color: #fff;
  padding: 18px 0;
  border-bottom: 3px solid var(--BrandOrange);
}
.title-menu h4 {
  color: #fff;
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* ─── D. Breadcrumb ──────────────────────────────────────── */
.row-breadcrumb {
  background-color: #f6f6f6;       /* --light-white from DNTU */
  border-bottom: 1px solid var(--pc-line);
  height: auto !important;
  padding: 0;
}
ul.breadcrumb {
  padding: 8px 0 !important;
}
ul.breadcrumb li {
  color: var(--pc-body-text) !important;
  line-height: 32px;
}
ul.breadcrumb li a {
  color: var(--pc-teal) !important;
  text-decoration: none;
}
ul.breadcrumb li a:hover {
  color: var(--BrandOrange) !important;
}
ul.breadcrumb li+li:before {
  color: var(--pc-muted);
}

/* ─── E. .news-main-final — list format (image left + text right) ── */
/* Mirrors DNTU .blog__single--item pattern */
.news-main-final {
  display: flex;
  gap: 20px;
  padding: 16px 20px;
  border: none;
  border-bottom: 1px solid var(--pc-line);  /* list divider, không phải card box */
  border-radius: 0;
  margin-bottom: 0;
  transition: background-color var(--pc-transition), box-shadow var(--pc-transition);
  background: #fff;
}
.news-main-final:last-child {
  border-bottom: none;
}
.news-main-final:hover {
  background-color: #fafafa;
  box-shadow: inset 3px 0 0 var(--pc-teal); /* teal left accent on hover */
}
/* Image column — fixed size thumbnail */
.news-main-final .col-3 {
  overflow: hidden;
  border-radius: var(--pc-radius-sm);
  min-width: 150px;
  max-width: 160px;
  width: 160px !important;
  flex-shrink: 0;
  align-self: flex-start;
}
.news-main-final .col-3 img {
  width: 100%;
  height: 105px;
  object-fit: cover;
  border-radius: var(--pc-radius-sm);
  transform: scale(1);
  transition: transform 0.4s ease;
  display: block;
}
.news-main-final:hover .col-3 img {
  transform: scale(1.05);
}
/* Title — override Bootstrap fs-4 (1.5rem → 1.05rem for list readability) */
.news-main-final h5 {
  margin-bottom: 6px;
  font-size: 1.05rem !important; /* fs-4 class is 1.5rem, too large for list */
}
.news-main-final h5 a {
  color: var(--pc-heading);
  text-decoration: none;
  line-height: 1.55;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-main-final h5 a:hover {
  color: var(--pc-teal);
}
/* Description */
.news-main-final p,
.news-description {
  color: var(--pc-body-text);
  font-size: 0.85rem;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}

/* ─── F. .news-detail article ────────────────────────────── */
/* max-width 900px — đủ rộng cho nội dung, tránh quá loãng ở màn lớn */
.container.news-detail.option_1 {
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}
.news-detail.option_1 p {
  line-height: 1.8;
  color: var(--pc-body-text);
  font-size: var(--p-s, 16px);
}
.news-detail.option_1 h1,
.news-detail.option_1 h2,
.news-detail.option_1 h3,
.news-detail.option_1 h4 {
  color: var(--pc-heading);
}
/* header-news-more border */
.header-news-more {
  border-top: 1px solid var(--pc-line);
  padding-top: 12px;
  margin-top: 16px !important;
  align-items: center;
}
/* relate-news */
.relate-news {
  border-top: 3px solid var(--pc-teal);
  padding-top: 16px;
  margin-top: 24px;
}
.relate-news .list {
  padding-left: 0;
  list-style: none;
}
.relate-news .list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--pc-line);
  font-size: 0.9rem;
}
.relate-news .list li a {
  color: var(--pc-heading);
  text-decoration: none;
}
.relate-news .list li a:hover {
  color: var(--pc-teal);
}

/* ─── G. Date badge & category tag ──────────────────────── */
/* Mirrors DNTU .blog__cat pattern */
.news-date-badge {
  text-align: right;
  color: var(--pc-muted);
  font-size: 0.8rem;
  margin-bottom: 10px;
}
.news-date-badge i {
  margin-right: 4px;
  color: var(--pc-teal);
}
/* Category/badge chip */
.news-cat-badge {
  display: inline-block;
  padding: 4px 12px;
  background: var(--pc-badge-bg);
  color: var(--pc-badge-text);
  border-radius: var(--pc-radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 100%;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* ─── H. Social share icons ──────────────────────────────── */
.share {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  padding-bottom: 10px;
}
.share a img {
  display: none;
}
.share a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background-color: #f6f6f6;
  color: var(--pc-heading);
  font-size: 0.875rem;
  text-decoration: none;
  border: 1px solid var(--pc-line);
  transition: background-color var(--pc-transition), color var(--pc-transition), border-color var(--pc-transition), transform var(--pc-transition);
}
.share a:hover {
  transform: scale(1.1);
  border-color: transparent;
}
.share a[title="Facebook"]:hover  { background-color: #1877f2; color: #fff; }
.share a[title="Linkedin"]:hover  { background-color: #0a66c2; color: #fff; }
.share a[title="twitter"]:hover,
.share a[title="Twitter"]:hover   { background-color: #1da1f2; color: #fff; }

/* ─── I. .submenu2 ───────────────────────────────────────── */
.submenu2 {
  background-color: var(--pc-teal) !important;
  border-bottom: 3px solid var(--BrandOrange);
  padding: 16px 25px 8px !important;
}
.submenu2 a {
  color: #fff !important;
  text-decoration: none;
  transition: background-color var(--pc-transition);
  padding: 4px 10px;
  border-radius: var(--pc-radius-btn);
  font-weight: 500;
  font-size: 0.95rem;
}
.submenu2 a:hover {
  background-color: rgba(255, 255, 255, 0.18);
}
.submenu2 a.active,
.submenu2 a[aria-current="page"] {
  background-color: var(--BrandOrange);
}

/* ─── J. .title-about ────────────────────────────────────── */
.title-about {
  color: var(--pc-teal) !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 16px;
  padding: 16px;
  font-size: 1.6rem;
  font-weight: 700;
  font-family: "Montserrat", sans-serif;
}
.title-about img {
  display: none !important;
}
.title-about::before,
.title-about::after {
  content: '';
  flex: 1;
  max-width: 100px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--pc-teal));
  border-radius: 2px;
}
.title-about::after {
  background: linear-gradient(270deg, transparent, var(--pc-teal));
}
.title-about p,
.title-about a {
  margin: 0;
  text-align: center;
  color: inherit;
  text-decoration: none;
  white-space: normal;       /* allow wrap for long titles */
  word-break: break-word;
}

/* ─── K. Content typography ──────────────────────────────── */
.content.container p {
  line-height: 1.8;
  color: var(--pc-body-text);
}
.content.container img {
  max-width: 100%;
  height: auto;
}

/* ─── L. Resources search UI ─────────────────────────────── */
/* Page title (TrangTaiNguyenChiTiet) */
.title-document {
  color: var(--pc-teal) !important;
}

/* ── Sidebar .submenu3 card ──────────────────────────────── */
.submenu3 {
  background: #fff;
  border: 1px solid var(--pc-line);
  border-radius: var(--pc-radius);
  overflow: hidden;
  box-shadow: var(--pc-card-shadow);
  padding: 0 !important;         /* padding handled by children */
}
.submenu3 h5 {
  /* keep existing teal bg from layout.css, just tweak radius to match card */
  border-radius: 0 !important;   /* remove the 25px 0 25px 0 quirk */
  padding: 14px 16px !important;
  font-size: 1rem !important;
  margin: 0;
}
.submenu3 p {
  border-bottom: 1px solid var(--pc-line) !important;
  margin: 0;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background-color var(--pc-transition);
}
.submenu3 p:last-child {
  border-bottom: none !important;
}
.submenu3 p:hover {
  background-color: var(--pc-badge-bg);
}
.submenu3 p a {
  color: var(--pc-heading);
  text-decoration: none;
  flex: 1;
  padding: 10px 0;
  font-size: 0.9rem;
}
.submenu3 p a:hover {
  color: var(--pc-teal);
}
/* Active link — set by JS (class .pc-active added via script) */
.submenu3 p.pc-active {
  background-color: var(--pc-badge-bg);
  border-left: 3px solid var(--pc-teal);
}
.submenu3 p.pc-active a {
  color: var(--pc-teal);
  font-weight: 600;
}

/* ── Search area ─────────────────────────────────────────── */
.group-search {
  background-color: #f6f6f6 !important;
  border-radius: var(--pc-radius);
  padding: 16px !important;
  border: 1px solid var(--pc-border);
  box-shadow: var(--pc-card-shadow);
  margin-bottom: 20px;
}
/* Let Bootstrap .input-group handle border-radius joining.
   Only override border COLOR — do NOT set border-radius here */
.select-document {
  border-color: var(--pc-border) !important;
  border-right-color: transparent !important; /* removes double border at join */
  background-color: #fff !important;
  color: var(--pc-heading);
}
.select-document:focus {
  border-color: var(--pc-teal) !important;
  box-shadow: none;
  outline: none;
}
.search-document {
  border-color: var(--pc-border) !important;
  background-color: #fff !important;
}
.search-document:focus {
  border-color: var(--pc-teal) !important;
  box-shadow: 0 0 0 2px rgba(15, 102, 112, 0.12) !important;
  outline: none;
}
/* Restore left border on input so join with select is clean */
.input-group .select-document + .search-document {
  border-left: 1px solid var(--pc-border) !important;
}
.btn-search-document {
  background-color: var(--pc-teal) !important;
  border: none;
  border-radius: var(--pc-radius-btn) !important;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background-color var(--pc-transition);
  white-space: nowrap;
}
.btn-search-document:hover {
  background-color: var(--BrandOrange) !important;
}
.btn-search-document-2 {
  margin-left: 8px;
  display: flex;
  align-items: center;
}

/* ─── M. Owl carousel cards ──────────────────────────────── */
.owl_new_book .link .blockImg img {
  height: 220px;
  object-fit: cover;
}
.owl_new_book .link:hover .blockText > span {
  background: var(--pc-teal) !important;
}

/* ─── N. Attachment table ─────────────────────────────────── */
table#tblTepDinhKem {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.875rem;
}
table#tblTepDinhKem td {
  padding: 6px 8px;
  vertical-align: middle;
  border-bottom: 1px solid var(--pc-line);
}

/* ─── O. Homepage overrides (index.aspx user controls) ──── */

/* News-more section: hover color (#C50202 → teal) */
.all-content-news-more:hover {
  color: var(--pc-teal) !important;
}
.all-content-news-more:hover a {
  color: var(--pc-teal) !important;
}

/* "xem thêm >" link */
.see-more a {
  color: var(--pc-teal);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color var(--pc-transition);
}
.see-more a:hover {
  color: var(--BrandOrange);
}
.see-more i {
  color: var(--pc-teal);
  font-size: 0.75rem;
}

/* content-news-more link */
.content-news-more a {
  color: var(--pc-heading);
  text-decoration: none;
  transition: color var(--pc-transition);
}
.content-news-more a:hover {
  color: var(--pc-teal);
}

/* Tab header — "Tin tức" / "Thông báo" tabs */
.tab__header > div:hover {
  background-color: var(--pc-teal) !important;
  color: #fff !important;
}
/* Active tab: keep cream bg but change text from #C50202 → teal */
.tab__header > div.tab__header--active {
  color: var(--pc-teal) !important;
  background-color: #FFE9B4 !important; /* BrandOrange-light — intentional lib brand */
  border-bottom: 3px solid var(--pc-teal);
}

/* News section heading (.news-events-title in ucPortalCenterNewsHot) */
.news-events-title {
  color: var(--pc-teal) !important;
}

/* "Giới thiệu sách" section title on bg-green (teal bg)
   — .news-document-title uses white text, images line-left2/line-right2
   — keep as-is since bg is already teal, images are white line variants */
.news-document-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #fff !important;
}

/* Back to top button */
#back-to-top {
  background-color: var(--pc-teal) !important;
}
#back-to-top:hover {
  background-color: var(--BrandOrange) !important;
}

/* btn-modal (used in some popups) */
.btn-modal {
  background-color: var(--pc-teal) !important;
}
.btn-modal:hover {
  background-color: #fff !important;
  color: var(--pc-teal) !important;
  border-color: var(--pc-teal) !important;
}


/* ─── Mobile ≤767px ──────────────────────────────────────── */
@media (max-width: 767px) {
  .submenu2 {
    padding: 10px 16px 6px !important;
  }
  .submenu2 .container {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 4px;
  }
  .news-main-final {
    flex-direction: column !important;
    gap: 10px;
    padding: 12px;
  }
  .news-main-final .col-3 {
    min-width: unset !important;
    max-width: 100% !important;
    width: 100% !important;
  }
  .news-main-final .col-3 img {
    height: 160px;
  }
  .container.news-detail.option_1 {
    max-width: 100%;
  }
  .title-about {
    font-size: 1.2rem;
  }
  .title-about::before,
  .title-about::after {
    max-width: 60px;
  }
}
