/* Quy định - Quy chế: danh sách (inc/tdd-quy-dinh.php) và khung xem PDF trong bài. */
.tdd-qd {
  --qd-blue: #153994;
  --qd-blue-dark: #0e2a75;
  --qd-gold: #fba10a;
  --qd-ink: #14233c;
  --qd-muted: #5b6b82;
  --qd-line: #e3e9f2;
  color: var(--qd-ink);
  line-height: 1.6;
}

/* Khối giới thiệu (nội dung trang /quy-dinh-quy-che/, .tmp/qdqc-page.php) */
.tdd-qd-intro {
  position: relative;
  margin: 8px 0 26px;
  padding: 26px 32px;
  overflow: hidden;
  border-radius: 16px;
  background:
    radial-gradient(circle at 100% 0, rgb(251 161 10 / 16%), transparent 42%),
    linear-gradient(135deg, #f3f6fd 0%, #fff 70%);
  border: 1px solid #e1e8f4;
}
.tdd-qd-intro .tdd-qd-intro__title {
  margin: 0 0 10px;
  color: #153994;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.35;
}
.tdd-qd-intro__text {
  margin: 0 0 16px;
  color: #3b4a61;
  font-size: 16px;
  line-height: 1.75;
}
.tdd-qd-intro__text strong {
  color: #b42318;
}
.tdd-qd-intro__topics {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.tdd-qd-intro__topics span {
  margin-right: 4px;
  color: #5b6b82;
  font-size: 14px;
  font-weight: 600;
}
.tdd-qd-intro__topics a {
  padding: 5px 14px;
  border: 1px solid #cdd9ef;
  border-radius: 99px;
  background: #fff;
  color: #153994;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.tdd-qd-intro__topics a:hover {
  border-color: #fba10a;
  background: #fba10a;
  color: #0b2253;
}
@media (max-width: 599px) {
  .tdd-qd-intro {
    padding: 20px 18px;
  }
  .tdd-qd-intro .tdd-qd-intro__title {
    font-size: 20px;
  }
  .tdd-qd-intro__text {
    font-size: 15px;
  }
}

/* Bộ lọc */
.tdd-qd-filter {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) repeat(3, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 14px;
  margin: 8px 0 32px;
  padding: 22px 24px;
  border: 1px solid var(--qd-line);
  border-top: 4px solid var(--qd-gold);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 14px 34px -22px rgb(21 57 148 / 45%);
}
.tdd-qd-filter__field {
  min-width: 0;
}
.tdd-qd-filter label {
  display: block;
  margin: 0 0 6px;
  color: var(--qd-blue);
  font-size: 13px;
  font-weight: 700;
}
.tdd-qd .tdd-qd-filter input[type="search"],
.tdd-qd .tdd-qd-filter input[type="date"],
.tdd-qd .tdd-qd-filter select {
  width: 100%;
  height: 46px;
  min-height: 46px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid #cfd9e8;
  border-radius: 9px;
  background-color: #f8fafd;
  box-shadow: none;
  color: var(--qd-ink);
  font-size: 15px;
  transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
}
.tdd-qd-filter input:focus,
.tdd-qd-filter select:focus {
  border-color: var(--qd-blue);
  background-color: #fff;
  box-shadow: 0 0 0 3px rgb(21 57 148 / 14%);
  outline: none;
}
.tdd-qd-filter__input {
  position: relative;
}
.tdd-qd-filter__input svg {
  position: absolute;
  top: 50%;
  left: 13px;
  color: #8796ad;
  transform: translateY(-50%);
  pointer-events: none;
}
.tdd-qd .tdd-qd-filter__input input[type="search"] {
  padding-left: 40px;
}
.tdd-qd-filter__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tdd-qd-filter__submit {
  height: 46px;
  margin: 0;
  padding: 0 26px;
  border: 0;
  border-radius: 9px;
  background: var(--qd-blue);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  transition: background 0.2s, transform 0.2s;
}
.tdd-qd-filter__submit:hover {
  background: var(--qd-blue-dark);
  transform: translateY(-1px);
}
/* "Xóa lọc": nút viền cùng hàng, cùng chiều cao với nút Tìm kiếm. */
.tdd-qd-filter__reset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 46px;
  padding: 0 16px;
  border: 1px solid #cfd9e8;
  border-radius: 9px;
  background: #fff;
  color: var(--qd-muted);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.tdd-qd-filter__reset:hover {
  border-color: #e5484d;
  background: #fff5f5;
  color: #c92a2a;
}
.tdd-qd-filter__reset svg {
  transition: transform 0.3s;
}
.tdd-qd-filter__reset:hover svg {
  transform: rotate(-180deg);
}

/* Tiêu đề danh sách */
.tdd-qd__heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 0 0 16px;
}
.tdd-qd .tdd-qd__heading h2 {
  flex: 0 0 auto;
  width: auto;
  position: relative;
  margin: 0;
  padding-left: 14px;
  color: var(--qd-blue);
  font-size: 22px;
  line-height: 1.3;
}
.tdd-qd__heading h2::before {
  content: "";
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 0;
  width: 4px;
  border-radius: 2px;
  background: var(--qd-gold);
}
.tdd-qd__count {
  padding: 3px 12px;
  border-radius: 99px;
  background: #fff4de;
  color: #8a5300;
  font-size: 13px;
  font-weight: 700;
}
.tdd-qd__notice {
  margin: 0 0 16px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #fdecec;
  color: #a4161a;
  font-size: 14px;
}

/* Thẻ văn bản */
.tdd-qd__list {
  display: grid;
  gap: 14px;
}
/* Máy tính: 2 cột, thẻ cùng hàng cao bằng nhau, nút "Xem văn bản" luôn ở đáy thẻ. */
@media (min-width: 850px) {
  .tdd-qd__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }
  .tdd-qd__list .tdd-qd__empty {
    grid-column: 1 / -1;
  }
  .tdd-qd-card__body {
    display: flex;
    flex-direction: column;
  }
  .tdd-qd-card__footer {
    margin-top: auto;
  }
  .tdd-qd-card__title {
    font-size: 17px;
  }
}
.tdd-qd-card {
  display: flex;
  gap: 20px;
  padding: 20px 22px;
  border: 1px solid var(--qd-line);
  border-radius: 14px;
  background: #fff;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
}
.tdd-qd-card:hover {
  border-color: #b9c8e6;
  box-shadow: 0 16px 34px -24px rgb(21 57 148 / 55%);
  transform: translateY(-2px);
}
.tdd-qd-card__date {
  display: flex;
  flex: 0 0 72px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  height: 82px;
  border-radius: 12px;
  background: linear-gradient(160deg, #1c48b3, var(--qd-blue) 55%, var(--qd-blue-dark));
  color: #fff;
  line-height: 1.1;
  text-align: center;
}
.tdd-qd-card__day {
  font-size: 26px;
  font-weight: 800;
}
.tdd-qd-card__month {
  margin-top: 2px;
  color: var(--qd-gold);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}
.tdd-qd-card__year {
  margin-top: 2px;
  font-size: 12px;
  opacity: 0.85;
}
.tdd-qd-card__body {
  flex: 1;
  min-width: 0;
}
.tdd-qd-card__title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.tdd-qd-card__title a {
  color: var(--qd-ink);
}
.tdd-qd-card__title a:hover {
  color: var(--qd-blue);
}
.tdd-qd-card__summary {
  display: -webkit-box;
  margin: 0 0 12px;
  overflow: hidden;
  color: var(--qd-muted);
  font-size: 14.5px;
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.tdd-qd-card__footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
}
.tdd-qd-card__tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 6px;
  background: #fdecec;
  color: #b42318;
  font-size: 12.5px;
  font-weight: 700;
}
.tdd-qd-card__more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding: 7px 16px;
  border-radius: 99px;
  background: #eef3fc;
  color: var(--qd-blue);
  font-size: 14px;
  font-weight: 700;
  transition: background 0.2s, color 0.2s;
}
.tdd-qd-card__more:hover {
  background: var(--qd-blue);
  color: #fff;
}
.tdd-qd-card__more svg {
  transition: transform 0.2s;
}
.tdd-qd-card__more:hover svg {
  transform: translateX(3px);
}
.tdd-qd__empty {
  padding: 36px 24px;
  border: 1px dashed #c7d3e6;
  border-radius: 14px;
  background: #f8fafd;
  text-align: center;
}
.tdd-qd__empty strong {
  display: block;
  color: var(--qd-blue);
  font-size: 18px;
}
.tdd-qd__empty p {
  margin: 4px 0 10px;
  color: var(--qd-muted);
}
.tdd-qd__empty a {
  font-weight: 700;
}

/* Phân trang */
.tdd-qd__pagination {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 28px;
}
.tdd-qd__pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--qd-line);
  border-radius: 10px;
  background: #fff;
  color: var(--qd-ink);
  font-weight: 600;
}
.tdd-qd__pagination a.page-numbers:hover {
  border-color: var(--qd-blue);
  color: var(--qd-blue);
}
.tdd-qd__pagination .current {
  border-color: var(--qd-blue);
  background: var(--qd-blue);
  color: #fff;
}

@media (max-width: 1023px) {
  .tdd-qd-filter {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .tdd-qd-filter__field--search {
    grid-column: 1 / -1;
  }
  .tdd-qd-filter__actions {
    grid-column: 1 / -1;
    gap: 10px;
  }
}
@media (max-width: 599px) {
  .tdd-qd-filter {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 18px 16px;
  }
  .tdd-qd-filter__field:has(select) {
    grid-column: 1 / -1;
  }
  .tdd-qd-filter__submit {
    flex: 1;
  }
  .tdd-qd-card {
    gap: 14px;
    padding: 16px;
  }
  .tdd-qd-card__date {
    flex-basis: 56px;
    height: 66px;
    border-radius: 10px;
  }
  .tdd-qd-card__day {
    font-size: 20px;
  }
  .tdd-qd-card__title {
    font-size: 16px;
  }
  .tdd-qd-card__more {
    margin-left: 0;
  }
}

/* Trang một văn bản (single-tdd_quy_dinh.php) */
.tdd-qd-single {
  padding-top: 32px;
}
.tdd-qd-doc__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  margin: 0 0 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e3e9f2;
  color: #5b6b82;
  font-size: 14px;
}
.tdd-qd-doc__label {
  padding: 3px 12px;
  border-left: 3px solid #fba10a;
  border-radius: 4px;
  background: #153994;
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
}
.tdd-qd-doc__content {
  font-size: 16px;
  line-height: 1.75;
  overflow-wrap: anywhere;
}
.tdd-qd-doc__content img {
  border-radius: 10px;
}
.tdd-qd-others {
  margin: 44px 0 20px;
}
.tdd-qd-others .tdd-qd__heading {
  justify-content: space-between;
}
.tdd-qd-others__all {
  color: #153994;
  font-weight: 700;
}

/* Khung xem PDF trong bài */
.tdd-qd-files {
  margin-top: 28px;
}
.tdd-qd-file {
  margin: 0 0 24px;
  border: 1px solid #dce3ec;
  border-radius: 10px;
  overflow: hidden;
  scroll-margin-top: 110px;
}
.tdd-qd-file__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 16px;
  padding: 14px 16px;
  border-left: 4px solid #fba10a;
  background: #f5f7fa;
}
.tdd-qd-file__header h2 {
  flex: 1 1 240px;
  min-width: 0;
  margin: 0;
  color: #153994;
  font-size: 17px;
  overflow-wrap: anywhere;
}
.tdd-qd-file__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.tdd-qd-file__actions a {
  font-weight: 600;
}
.tdd-qd-file__actions a.tdd-qd-file__download {
  padding: 8px 18px;
  border-radius: 5px;
  background: #153994;
  color: #fff;
}
.tdd-qd-file__actions a.tdd-qd-file__download:hover {
  background: #0e2a75;
}
.tdd-qd-file__frame {
  display: block;
  width: 100%;
  height: min(80vh, 900px);
  min-height: 420px;
  border: 0;
  background: #e9edf2;
}
.tdd-qd-file__help {
  margin: 0;
  padding: 10px 16px;
  color: #526078;
  font-size: 14px;
}
@media (max-width: 549px) {
  .tdd-qd-file__frame {
    height: 70vh;
    min-height: 360px;
  }
}
