/* Back navigation to the parent page. */
:root { --adm-glowbox: 0 0 0 2px rgba(var(--adm-glow), .75), 0 0 22px 6px rgba(var(--adm-glow), .5); }

/* Blurred background pictures. */
.bg-resource::before { background-image: url("school%20resource.png"); background-size: cover; }
.bg-term::before     { background-image: url("term%20test.jpg");       background-size: cover; }

/* Academics page: 2 blocks in the middle. */
.two-blocks { max-width: 820px; }

/* Pills (buttons) with the little square on the right. */
.rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.row  { display: flex; align-items: center; gap: 14px; text-decoration: none; color: #1e2b1c; transition: transform .35s ease; }
.pill {
  flex: 1; padding: 13px 28px; border-radius: 999px; background: rgba(255,255,255,.88);
  font: 700 1.1rem "Nunito Sans", "Noto Sans Sinhala", sans-serif;
  box-shadow: 0 4px 12px rgba(0,0,0,.12); transition: box-shadow .45s ease;
}
.pill[lang="si"] { font-family: "Noto Sans Sinhala", "Nunito Sans", sans-serif; font-weight: 600; }
.pill .num { margin-right: 14px; color: var(--adm-green); font-family: "Source Serif 4", serif; }
.count {
  flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px;
  border: 2px solid var(--adm-green); background: rgba(255,255,255,.88); color: var(--adm-green);
  font: 700 1.05rem "Nunito Sans", sans-serif; transition: box-shadow .45s ease;
}
.count.zero { opacity: .5; }

/* Mouse on a row: a little bigger + green light (fades away when the mouse leaves). */
.row:hover, .row:focus-visible { transform: scale(1.03); outline: none; }
.row:hover .pill, .row:focus-visible .pill, .row:hover .count, .row:focus-visible .count { box-shadow: var(--adm-glowbox); }

/* Resources page: the rows appear slowly one after another. */
.res-list { max-width: 760px; margin: 0 auto; gap: 18px; }
.res-list .row { animation: block-in 1s ease var(--d, 0s) backwards; }

/* Past Term Test Papers: fits the screen, only the list scrolls. */
.fit-screen { height: 100vh; min-height: 560px; box-sizing: border-box; padding-top: 105px; }
.fit-screen .admin-wrap { height: 100%; display: flex; flex-direction: column; padding: 0 24px 26px; box-sizing: border-box; }
.fit-screen .top-row { flex: none; margin-bottom: 14px; }
.scroll-panel {
  flex: 1; min-height: 0; max-height: calc(100vh - 200px); overflow-y: auto; padding: 22px; margin: 0 -22px;
  scrollbar-width: thin; scrollbar-color: var(--adm-green) transparent;
}
.sec-block {
  max-width: 760px; margin: 0 auto 28px; padding: 22px 24px 26px;
  background: rgba(255,255,255,.5); backdrop-filter: blur(4px);
  border-radius: var(--adm-radius); box-shadow: 0 6px 18px rgba(0,0,0,.12);
}
.sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.sec-head h2 { margin: 0; font: 700 1.45rem "Source Serif 4", "Noto Sans Sinhala", serif; color: var(--adm-green); }
.avail { font: 600 .8rem "Nunito Sans", sans-serif; color: var(--adm-green); }
.basket { margin: 22px 0 12px; font: 700 .85rem "Nunito Sans", sans-serif; letter-spacing: .14em; text-transform: uppercase; color: var(--adm-green); }
.sec-head + .basket { margin-top: 4px; }
.note { margin: 0 0 8px; font: 400 1rem "Nunito Sans", sans-serif; }

/* Same scroll animation as the news page: fade in AND out while scrolling. */
.reveal-on .item { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s ease; transition-delay: calc(var(--col, 0) * 70ms); }
.reveal-on .item.is-in { opacity: 1; transform: none; }

@media (max-width: 600px) {
  .pill { padding: 11px 18px; font-size: 1rem; }
  .fit-screen { padding-top: 95px; }
}
@media (prefers-reduced-motion: reduce) { .res-list .row { animation: none; } }


/* Responsive layout for tablets and phones. */


@media (max-width: 900px) {
  @supports (height: 100dvh) {
    .fit-screen { height: 100dvh; }
    .scroll-panel { max-height: calc(100dvh - 200px); }
  }
}

/* Phones: pills (buttons), number squares and the white blocks. */
@media (max-width: 600px) {
  .rows { gap: 12px; }
  .row { gap: 10px; }
  .pill { border-radius: 26px; line-height: 1.35; overflow-wrap: anywhere; }   /* Long names can use 2 lines. */
  .pill .num { margin-right: 10px; }
  .count { width: 40px; height: 40px; border-radius: 10px; font-size: .95rem; }
  .res-list { gap: 14px; }

  .fit-screen .admin-wrap { padding: 0 16px 20px; }
  .scroll-panel { margin: 0 -14px; padding: 16px 14px; }
  .sec-block { padding: 16px 16px 20px; margin-bottom: 20px; }
  .sec-head { flex-wrap: wrap; row-gap: 4px; }
  .sec-head h2 { font-size: 1.25rem; }
  .basket { letter-spacing: .1em; }
}

/* Phone turned sideways (very short screen): the page scrolls normally instead of squeezing the list. */
@media (max-height: 560px) and (orientation: landscape) {
  .fit-screen { height: auto; min-height: 0; }
  .scroll-panel { max-height: none; overflow: visible; }
}
