.dns-pm,
.dns-pm * {
  box-sizing: border-box;
}

.dns-pm {
  --dns-pm-primary: #1239b8;
  --dns-pm-dark: #09268f;
  --dns-pm-yellow: #ffb400;
  --dns-pm-text: #142050;
  --dns-pm-muted: #5f6b86;
  --dns-pm-light: #f5faff;
  --dns-pm-shadow: 0 16px 42px rgba(18, 57, 184, 0.12);
  color: var(--dns-pm-text);
  width: 100%;
  max-width: 100%;
}

.dns-pm a,
.dns-pm button {
  font: inherit;
}

.dns-pm svg {
  width: 1em;
  height: 1em;
  fill: currentColor;
  flex: 0 0 auto;
}

.dns-pm :focus-visible,
.dns-pm-lightbox :focus-visible {
  outline: 3px solid var(--dns-pm-yellow);
  outline-offset: 3px;
}

.dns-pm-gallery-filters {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 6px 4px 18px;
  margin-bottom: 12px;
  scrollbar-width: thin;
}

.dns-pm-filter {
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: var(--dns-pm-primary);
  box-shadow: 0 8px 20px rgba(18, 57, 184, 0.11);
  min-height: 42px;
  padding: 9px 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  white-space: nowrap;
  font-weight: 800;
}

.dns-pm-filter:hover,
.dns-pm-filter:focus-visible,
.dns-pm-filter.is-active {
  background: var(--dns-pm-primary);
  color: #fff;
}

.dns-pm-gallery-grid {
  display: grid;
  grid-template-columns: repeat(var(--dns-pm-columns, 3), minmax(0, 1fr));
  gap: 22px;
}

.dns-pm-album-card {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--dns-pm-shadow);
  background: #fff;
  transition: transform .25s ease, box-shadow .25s ease;
  aspect-ratio: 16 / 10;
  min-height: 0;
}

.dns-pm-album-card:hover,
.dns-pm-album-card:focus-within {
  transform: translateY(-5px);
  box-shadow: 0 22px 50px rgba(18, 57, 184, .20);
}

.dns-pm-album-image,
.dns-pm-album-image img {
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
}

.dns-pm-album-image img {
  transition: transform .35s ease;
}

.dns-pm-album-card:hover img {
  transform: scale(1.055);
}

.dns-pm-album-overlay {
  position: absolute;
  inset: auto 0 0;
  padding: 48px 18px 16px;
  color: #fff;
  background: linear-gradient(0deg, rgba(9, 38, 143, .96), rgba(9, 38, 143, .68) 42%, rgba(9, 38, 143, 0));
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: end;
  gap: 10px;
}

.dns-pm-album-overlay h3 {
  margin: 0;
  color: #fff;
  font-size: clamp(18px, 2.2vw, 22px);
  line-height: 1.12;
}

.dns-pm-album-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: var(--dns-pm-accent, var(--dns-pm-primary));
}

.dns-pm-photo-count {
  grid-column: 2;
  width: fit-content;
  border: 1px solid var(--dns-pm-yellow);
  color: var(--dns-pm-yellow);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 800;
}

.dns-pm-open-album,
.dns-pm-full-button {
  background: var(--dns-pm-button);
  color: var(--dns-pm-button-text, #fff);
  transition: background-color .25s ease, color .25s ease, transform .25s ease, box-shadow .25s ease;
}

.dns-pm-open-album:hover,
.dns-pm-open-album:focus-visible,
.dns-pm-full-button:hover,
.dns-pm-full-button:focus-visible {
  background: var(--dns-pm-button-hover, var(--dns-pm-yellow));
  color: var(--dns-pm-button-hover-text, var(--dns-pm-dark));
  transform: translateY(-2px);
}

.dns-pm-open-album {
  border: 0;
  border-radius: 999px;
  padding: 9px 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-weight: 900;
}

.dns-pm-holiday-table-wrap {
  background: #fff;
  border-radius: 22px;
  border: 1px solid #e2e7f6;
  box-shadow: var(--dns-pm-shadow);
  overflow: hidden;
  max-width: 1140px;
  margin: 0 auto;
}

.dns-pm-holiday-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

.dns-pm-col-serial { width: 12%; }
.dns-pm-col-date { width: 20%; }
.dns-pm-col-day { width: 16%; }
.dns-pm-col-title { width: auto; }

.dns-pm-holiday-table th {
  background: var(--dns-pm-primary);
  color: #fff;
  padding: 17px 18px;
  text-align: center;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .02em;
}

.dns-pm-holiday-table th:last-child {
  text-align: left;
}

.dns-pm-holiday-table td {
  padding: 14px 18px;
  border-bottom: 1px solid #edf1fb;
  vertical-align: middle;
  text-align: center;
  overflow-wrap: anywhere;
}

.dns-pm-holiday-table td:last-child {
  text-align: left;
}

.dns-pm-holiday-table tr:nth-child(even) td {
  background: var(--dns-pm-alt, #eef3ff);
}

.dns-pm-serial {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--dns-pm-accent, var(--dns-pm-primary));
  color: #fff;
  font-weight: 900;
}

.dns-pm-date-pill,
.dns-pm-day-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 74px;
  padding: 7px 12px;
  border-radius: 999px;
  background: #fff3cf;
  color: var(--dns-pm-accent, var(--dns-pm-primary));
  font-weight: 800;
}

.dns-pm-day-pill {
  background: #eaf8ff;
  color: var(--dns-pm-primary);
}

.dns-pm-holiday-title {
  font-weight: 800;
  color: var(--dns-pm-text);
  line-height: 1.35;
}

.dns-pm-holiday-cards {
  display: none;
}

.dns-pm-card-grid {
  display: grid;
  grid-template-columns: repeat(var(--dns-pm-columns, 3), minmax(0, 1fr));
  gap: 24px;
}

.dns-pm-book-grid {
  max-width: 1180px;
  margin: 0 auto;
}

.dns-pm-syllabus-grid {
  grid-template-columns: repeat(2, minmax(0, 500px));
  justify-content: center;
  gap: 22px;
  max-width: 1080px;
  margin: 0 auto;
}

.dns-pm-book-card,
.dns-pm-syllabus-card {
  background: #fff;
  border: 2px solid var(--dns-pm-accent);
  border-radius: 22px;
  padding: 18px;
  box-shadow: var(--dns-pm-shadow);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  overflow: hidden;
  min-width: 0;
}

.dns-pm-syllabus-card {
  max-width: 520px;
  width: 100%;
  padding: 16px;
}

.dns-pm-book-card:hover,
.dns-pm-syllabus-card:hover,
.dns-pm-book-card:focus-within,
.dns-pm-syllabus-card:focus-within {
  transform: translateY(-5px);
  box-shadow: 0 22px 48px rgba(18, 57, 184, .18);
}

.dns-pm-book-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
}

.dns-pm-big-number,
.dns-pm-floating-number {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 17px;
  background: var(--dns-pm-badge);
  color: var(--dns-pm-number-text, #fff);
  font-size: 28px;
  line-height: 1;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(255, 85, 37, .22);
}

.dns-pm-book-heading h3,
.dns-pm-syllabus-content h3 {
  margin: 0;
  color: var(--dns-pm-heading, var(--dns-pm-accent));
  font-size: clamp(24px, 2.6vw, 32px);
  line-height: 1.05;
}

.dns-pm-book-heading p,
.dns-pm-syllabus-content p {
  margin: 5px 0 0;
  color: var(--dns-pm-subheading, var(--dns-pm-text));
  font-weight: 800;
  line-height: 1.25;
}

.dns-pm-age {
  display: inline-block;
  margin-top: 5px;
  color: var(--dns-pm-age, var(--dns-pm-muted));
  font-weight: 800;
  line-height: 1.25;
}

.dns-pm-file-badge {
  display: none !important;
}

.dns-pm-book-image {
  display: grid;
  place-items: center;
  margin: 10px 0 18px;
  border-radius: 14px;
  overflow: hidden;
  background: #f5f8ff;
}

.dns-pm-book-image img {
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 245px;
  object-fit: contain;
  display: block;
}

.dns-pm-full-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 50px;
  border-radius: 14px;
  text-decoration: none;
  font-weight: 900;
}

.dns-pm-syllabus-image {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  aspect-ratio: 16 / 8.7;
  max-height: 265px;
  background: #eef3ff;
  margin-bottom: 16px;
}

.dns-pm-syllabus-image img,
.dns-pm-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: grid;
  place-items: center;
  color: var(--dns-pm-accent);
  font-size: 48px;
}

.dns-pm-floating-number {
  position: absolute;
  z-index: 2;
  top: 12px;
  left: 12px;
  width: 58px;
  height: 58px;
  font-size: 25px;
}

.dns-pm-syllabus-content {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 15px;
}

.dns-pm-class-icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--dns-pm-icon-bg);
  color: var(--dns-pm-icon-color);
  font-size: 25px;
  flex: 0 0 auto;
}

.dns-pm-syllabus-content h3 {
  font-size: clamp(24px, 2.4vw, 31px);
}

.dns-pm-syllabus-content p {
  color: var(--dns-pm-age);
}

.dns-pm-lightbox {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(9, 38, 143, .92);
  padding: 22px;
}

.dns-pm-lightbox.is-open {
  display: flex;
}

.dns-pm-lightbox-dialog {
  width: min(100%, 1060px);
  max-height: calc(100vh - 32px);
  background: #fff;
  border-radius: 24px;
  padding: 16px;
  position: relative;
  box-shadow: 0 30px 80px rgba(0,0,0,.35);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
}

.dns-pm-lightbox-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 220px;
}

.dns-pm-lightbox-image {
  width: 100%;
  max-height: calc(100vh - 150px);
  object-fit: contain;
  background: #f5faff;
  border-radius: 16px;
}

.dns-pm-lightbox-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.dns-pm-lightbox-title-wrap {
  min-width: 0;
}

.dns-pm-lightbox-title {
  display: block;
  color: var(--dns-pm-dark);
  font-weight: 900;
  font-size: 18px;
  line-height: 1.25;
}

.dns-pm-lightbox-count {
  display: inline-block;
  margin-top: 3px;
  color: var(--dns-pm-muted);
  font-weight: 800;
  font-size: 13px;
}

.dns-pm-lightbox button {
  border: 0;
  border-radius: 999px;
  min-width: 44px;
  min-height: 44px;
  background: rgba(9, 38, 143, .82);
  color: #fff;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  transition: background-color .25s ease, transform .25s ease, opacity .25s ease;
}

.dns-pm-lightbox button:hover,
.dns-pm-lightbox button:focus-visible {
  background: var(--dns-pm-yellow);
  color: var(--dns-pm-dark);
  transform: translateY(-1px);
}

.dns-pm-lightbox-close {
  font-size: 26px;
  line-height: 1;
}

.dns-pm-lightbox-prev,
.dns-pm-lightbox-next {
  position: absolute;
  top: 50%;
  z-index: 4;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .22);
}

.dns-pm-lightbox-prev { left: 16px; }
.dns-pm-lightbox-next { right: 16px; }
.dns-pm-lightbox-prev[hidden],
.dns-pm-lightbox-next[hidden] { display: none !important; }

body.dns-pm-lightbox-open {
  overflow: hidden;
}

@media (max-width: 1024px) {
  .dns-pm-gallery-grid,
  .dns-pm-book-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dns-pm-syllabus-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dns-pm-big-number {
    width: 58px;
    height: 58px;
    font-size: 26px;
  }
}

@media (max-width: 760px) {
  .dns-pm-syllabus-grid {
    grid-template-columns: minmax(0, 1fr);
    max-width: 540px;
  }
}

@media (max-width: 700px) {
  .dns-pm-holiday-table {
    display: none;
  }

  .dns-pm-holiday-table-wrap {
    background: transparent;
    border: 0;
    box-shadow: none;
    overflow: visible;
  }

  .dns-pm-holiday-cards {
    display: grid;
    gap: 12px;
  }

  .dns-pm-holiday-card {
    padding: 16px;
    border-radius: 18px;
    background: #fff;
    border: 1px solid #e3e8f8;
    box-shadow: 0 10px 26px rgba(18, 57, 184, .09);
  }

  .dns-pm-holiday-card-head {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    align-items: center;
  }

  .dns-pm-holiday-card h3 {
    margin: 0;
    font-size: 17px;
    line-height: 1.28;
    color: var(--dns-pm-text);
  }

  .dns-pm-holiday-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    margin-top: 12px;
    padding-left: 44px;
    color: var(--dns-pm-muted);
    font-weight: 800;
  }

  .dns-pm-holiday-card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }
}

@media (max-width: 650px) {
  .dns-pm-gallery-grid,
  .dns-pm-book-grid,
  .dns-pm-card-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .dns-pm-book-grid {
    max-width: 520px;
  }

  .dns-pm-book-card,
  .dns-pm-syllabus-card {
    padding: 16px;
    border-radius: 20px;
  }

  .dns-pm-big-number,
  .dns-pm-floating-number {
    width: 54px;
    height: 54px;
    border-radius: 15px;
    font-size: 24px;
  }

  .dns-pm-book-heading h3,
  .dns-pm-syllabus-content h3 {
    font-size: 25px;
  }

  .dns-pm-book-image img {
    max-height: 220px;
  }

  .dns-pm-syllabus-image {
    max-height: none;
  }

  .dns-pm-album-overlay {
    grid-template-columns: auto 1fr;
  }

  .dns-pm-open-album {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: center;
  }

  .dns-pm-lightbox {
    padding: 10px;
  }

  .dns-pm-lightbox-dialog {
    border-radius: 18px;
    padding: 12px;
    max-height: calc(100vh - 20px);
  }

  .dns-pm-lightbox-image {
    max-height: calc(100vh - 145px);
  }

  .dns-pm-lightbox-prev,
  .dns-pm-lightbox-next {
    width: 46px;
    height: 46px;
  }

  .dns-pm-lightbox-prev { left: 8px; }
  .dns-pm-lightbox-next { right: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .dns-pm *,
  .dns-pm-lightbox * {
    transition: none !important;
    animation: none !important;
  }
}
