/* components.css — buttons, links, the index list (signature), cards, tags, footer. */

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border: 1.5px solid transparent;
  border-radius: var(--radius-pill);
  font-family: var(--font-en);
  font-weight: 700;
  font-size: 15.5px;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition:
    background var(--dur),
    border-color var(--dur),
    color var(--dur),
    transform var(--dur);
}
:root[data-lang="my"] .btn {
  font-family: var(--font-mm);
}
.btn svg {
  width: 18px;
  height: 18px;
  flex: none;
}
.btn--primary {
  background: var(--color-primary);
  color: #fff;
}
.btn--primary:hover {
  background: var(--color-primary-deep);
  text-decoration: none;
}
.btn--ghost {
  background: #fff;
  color: var(--color-primary);
  border-color: var(--color-line);
}
.btn--ghost:hover {
  background: var(--color-blue-mist);
  border-color: var(--color-primary);
  text-decoration: none;
}
.btn:active {
  transform: translateY(1px);
}

/* ---- Arrow link ---- */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-en);
  font-weight: 700;
  font-size: 14.5px;
  color: var(--color-primary);
  text-decoration: none;
  white-space: nowrap;
}
:root[data-lang="my"] .link-arrow {
  font-family: var(--font-mm);
}
.link-arrow svg {
  width: 16px;
  height: 16px;
  transition: transform var(--dur) var(--ease-out);
}
.link-arrow:hover {
  text-decoration: none;
}
.link-arrow:hover svg {
  transform: translateX(4px);
}

/* ---- Index list: the page's structural signature ----
   A precise directory of everything the department publishes. */
.index-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  column-gap: clamp(24px, 5vw, 64px);
  border-top: 1px solid var(--color-line);
}
.index-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 16px;
  padding: 22px 6px;
  border-bottom: 1px solid var(--color-line);
  color: inherit;
  text-decoration: none;
  transition: padding-left var(--dur) var(--ease-out);
}
.index-row:hover {
  padding-left: 14px;
  text-decoration: none;
}
.index-row__mark {
  width: 11px;
  height: 11px;
  margin-top: 0.5em;
  flex: none;
  border: 2px solid var(--color-primary);
  border-radius: 3px;
  transition: background var(--dur);
}
.index-row:hover .index-row__mark {
  background: var(--color-primary);
}
.index-row__body {
  display: block;
}
.index-row__title {
  display: block;
  font-family: var(--font-en);
  font-weight: 700;
  font-size: var(--step-1);
}
:root[data-lang="my"] .index-row__title {
  font-family: var(--font-mm);
}
.index-row__desc {
  display: block;
  margin-top: 3px;
  font-size: 14.5px;
  color: var(--color-slate);
}
.index-row__arrow {
  margin-top: 0.3em;
  color: var(--color-primary);
  transition: transform var(--dur) var(--ease-out);
}
.index-row__arrow svg {
  width: 18px;
  height: 18px;
}
.index-row:hover .index-row__arrow {
  transform: translateX(4px);
}
@media (max-width: 760px) {
  .index-list {
    grid-template-columns: 1fr;
  }
}

/* ---- Quick links panel ----
   A white rounded card that pulls up to overlap the hero; intro (1/3) beside a
   two-column link list (2/3). */
.quicklinks {
  padding-block: 0 clamp(14px, 2vw, 22px);
}
/* Pull the Latest news block up close under the quick-links card. */
#news {
  padding-top: clamp(30px, 4vw, 56px);
}
.ql-panel {
  position: relative;
  z-index: 5;
  margin-top: clamp(-62px, -5vw, -32px);
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: clamp(28px, 5vw, 56px);
  padding: clamp(28px, 4vw, 46px);
  border-radius: clamp(18px, 2.5vw, 26px);
  background: #fff;
  color: var(--color-ink);
  box-shadow:
    0 28px 64px rgba(18, 33, 66, 0.16),
    0 6px 18px rgba(18, 33, 66, 0.08);
  align-items: center;
}
@media (max-width: 760px) {
  .ql-panel {
    grid-template-columns: 1fr;
    gap: 24px;
    margin-top: clamp(-28px, -4vw, -14px);
  }
}
.ql-panel__intro h2 {
  margin-bottom: 12px;
  font-family: var(--font-en);
  font-weight: 800;
  font-size: var(--step-2);
  line-height: 1.2;
  color: var(--color-ink);
}
:root[data-lang="my"] .ql-panel__intro h2 {
  font-family: var(--font-mm);
  line-height: 1.45;
}
.ql-panel__intro p {
  max-width: 38ch;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--color-slate);
}
:root[data-lang="my"] .ql-panel__intro p {
  font-family: var(--font-mm);
  line-height: 1.75;
}
.ql-panel__links ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(3, auto);
  grid-auto-flow: column;
  gap: 2px clamp(24px, 4vw, 56px);
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (max-width: 520px) {
  .ql-panel__links ul {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    grid-auto-flow: row;
  }
}
.ql-panel__links a {
  display: block;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-line);
  font-family: var(--font-en);
  font-size: 15.5px;
  font-weight: 600;
  color: var(--color-ink);
  text-decoration: none;
  transition:
    color var(--dur),
    padding-left var(--dur) var(--ease-out);
}
:root[data-lang="my"] .ql-panel__links a {
  font-family: var(--font-mm);
}
.ql-panel__links a:hover {
  padding-left: 8px;
  color: var(--color-primary);
  text-decoration: none;
}

/* ---- Card grids ---- */
.service-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
@media (max-width: 900px) {
  .service-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 620px) {
  .service-grid {
    grid-template-columns: 1fr;
  }
}

/* ---- Latest updates block ----
   Featured card + headline-only mini-list, then a 3-up card grid.
   Announcement vs advisory is signalled by badge colour only. */
.updates-top {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 24px;
  margin-bottom: 24px;
}
.updates-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
@media (max-width: 900px) {
  .updates-top,
  .updates-grid {
    grid-template-columns: 1fr;
  }
}

.update-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  color: inherit;
  text-decoration: none;
  transition:
    transform var(--dur) var(--ease-out),
    box-shadow var(--dur);
}
.update-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
}

/* Image slot: local illustration or the placeholder wash. Set --card-img on the
   element, or replace the span with <img class="update-thumb" alt="…">. */
.update-thumb {
  height: 160px;
  border-bottom: 1px solid var(--color-line);
  background-image: var(--card-img, none), var(--bg-placeholder);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
img.update-thumb {
  width: 100%;
  object-fit: cover;
}
.update-card--featured .update-thumb {
  height: clamp(200px, 26vw, 264px);
}

.badge {
  align-self: flex-start;
  margin: 16px 20px 0;
  padding: 4px 10px;
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
:root[data-lang="my"] .badge {
  font-family: var(--font-mm);
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}
.badge--announcement {
  background: var(--color-blue-mist);
  color: var(--color-primary);
}
.badge--advisory {
  background: var(--color-danger-bg);
  color: var(--color-danger);
}

.update-date {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--color-slate);
}
:root[data-lang="my"] .update-date {
  font-family: var(--font-mm);
  letter-spacing: 0;
  text-transform: none;
}
.update-card .update-date {
  margin: 10px 20px 0;
}
.update-card h3 {
  margin: 8px 20px 0;
  font-family: var(--font-en);
  font-weight: 700;
  font-size: var(--step-1);
  line-height: 1.3;
}
:root[data-lang="my"] .update-card h3 {
  font-family: var(--font-mm);
  line-height: 1.55;
}
.update-card--featured h3 {
  font-size: clamp(1.25rem, 1rem + 1.1vw, 1.55rem);
}
.update-card p {
  margin: 10px 20px 20px;
  font-size: 14.5px;
  color: var(--color-slate);
}

/* Mini-list: same card shell, headline-only rows, hairline dividers, no images */
.update-mini-list {
  display: flex;
  flex-direction: column;
  align-self: start;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}
.update-mini-item {
  border-bottom: 1px solid var(--color-line);
}
.update-mini-item:last-child {
  border-bottom: 0;
}
.update-mini-item a {
  display: block;
  padding: 15px 20px;
  color: inherit;
  text-decoration: none;
  transition: background var(--dur);
}
.update-mini-item a:hover {
  background: var(--color-blue-mist);
  text-decoration: none;
}
.update-mini-item h4 {
  margin-top: 6px;
  font-family: var(--font-en);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.35;
  color: var(--color-ink);
}
:root[data-lang="my"] .update-mini-item h4 {
  font-family: var(--font-mm);
  font-weight: 600;
  line-height: 1.55;
}

.updates__cta {
  margin-top: 40px;
  text-align: center;
}

/* ---- Director General's message — dark pull-quote band ---- */
.dg {
  position: relative;
  isolation: isolate;
  background: var(--dg-bg);
  overflow: hidden;
}
.dg::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    115deg,
    transparent 0 46px,
    rgba(255, 255, 255, 0.045) 46px 47px
  );
}
.dg__grid {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
}
@media (max-width: 820px) {
  .dg__grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}
.dg :focus-visible {
  outline-color: #fff;
}

.dg__icon {
  width: 30px;
  height: 30px;
  margin-bottom: 22px;
  color: var(--hero-accent);
}
.dg__quote {
  margin: 0;
  max-width: 34rem;
}
.dg__quote p {
  margin: 0;
  font-family: var(--font-en);
  font-weight: 700;
  font-size: clamp(1.55rem, 1.05rem + 2.1vw, 2.35rem);
  line-height: 1.34;
  letter-spacing: -0.01em;
  color: #fff;
}
:root[data-lang="my"] .dg__quote {
  max-width: 42rem;
}
:root[data-lang="my"] .dg__quote p {
  font-family: var(--font-mm);
  font-size: clamp(1.25rem, 0.95rem + 1.5vw, 1.9rem);
  line-height: 1.6;
  letter-spacing: 0;
}
.dg__attr {
  margin-top: 22px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}
:root[data-lang="my"] .dg__attr {
  font-family: var(--font-mm);
  letter-spacing: 0.02em;
  text-transform: none;
  font-size: 13px;
}

.dg__cta {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  font-family: var(--font-en);
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
}
:root[data-lang="my"] .dg__cta {
  font-family: var(--font-mm);
}
.dg__cta:hover {
  text-decoration: none;
}
.dg__cta-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 50%;
  background: #2e5aa0;
  color: #fff;
  transition:
    background var(--dur),
    transform var(--dur);
}
.dg__cta-btn svg {
  width: 18px;
  height: 18px;
}
.dg__cta:hover .dg__cta-btn {
  background: #3f74c4;
  transform: translateX(3px);
}
@media (max-width: 820px) {
  .dg__cta {
    justify-self: start;
  }
}

/* ---- Services: rounded gradient panel ---- */
.services-panel {
  padding: clamp(40px, 6vw, 76px) clamp(22px, 5vw, 64px);
  border-radius: clamp(20px, 3vw, 36px);
  background:
    radial-gradient(
      52% 58% at 12% 6%,
      rgba(30, 69, 136, 0.14),
      transparent 72%
    ),
    radial-gradient(
      46% 54% at 93% 16%,
      rgba(30, 69, 136, 0.09),
      transparent 72%
    ),
    radial-gradient(
      72% 80% at 74% 112%,
      rgba(30, 69, 136, 0.12),
      transparent 70%
    ),
    #f4f7fc;
  box-shadow: 0 24px 70px rgba(18, 33, 66, 0.11);
}
.services-panel .section-head {
  justify-content: center;
  margin-bottom: clamp(28px, 4vw, 44px);
}
.services-panel .section-head__text {
  max-width: none;
  text-align: center;
}
.services-panel__foot {
  margin-top: clamp(28px, 4vw, 44px);
  text-align: center;
}
@media (max-width: 620px) {
  .services-panel {
    padding: 30px 18px;
    border-radius: 18px;
  }
}

/* ---- Related departments (logo wall) ---- */
.depts {
  border-top: 1px solid var(--color-line);
}
.dept-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px clamp(28px, 6vw, 72px);
  margin: 0;
  padding: 0;
  list-style: none;
}
.dept-grid > li {
  flex: 0 1 200px;
}
.dept {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  height: 100%;
  padding: 12px 8px;
  color: inherit;
  text-align: center;
  text-decoration: none;
}
.dept:hover {
  text-decoration: none;
}
.dept__logo {
  width: auto;
  height: clamp(64px, 8vw, 84px);
  max-width: 100%;
  object-fit: contain;
  filter: grayscale(1);
  opacity: 0.7;
  transition:
    filter var(--dur),
    opacity var(--dur);
}
.dept:hover .dept__logo,
.dept:focus-visible .dept__logo {
  filter: grayscale(0);
  opacity: 1;
}
.dept__name {
  font-family: var(--font-en);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--color-slate);
}
:root[data-lang="my"] .dept__name {
  font-family: var(--font-mm);
  line-height: 1.5;
}

/* ---- Service card ---- */
.service-card {
  padding: 26px;
  background: #fff;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition:
    transform var(--dur) var(--ease-out),
    box-shadow var(--dur);
}
.service-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.service-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 16px;
  border-radius: var(--radius);
  background: var(--color-blue-mist);
  color: var(--color-primary);
}
.service-icon svg {
  width: 23px;
  height: 23px;
}
.service-card h3 {
  margin-bottom: 6px;
  font-family: var(--font-en);
  font-weight: 700;
  font-size: var(--step-0);
}
:root[data-lang="my"] .service-card h3 {
  font-family: var(--font-mm);
}
.service-card p {
  font-size: 14.5px;
  color: var(--color-slate);
}

/* ---- Footer ---- */
.site-footer {
  background: var(--color-primary-deep);
  color: #fff;
}
.site-footer .container {
  padding-block: clamp(44px, 6vw, 72px) 28px;
}
.site-footer a {
  color: #fff;
}
.site-footer :focus-visible {
  outline-color: #fff;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 40px;
}
@media (max-width: 820px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 560px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}
.footer-brand__mark {
  width: 70px;
  height: 70px;
  margin-bottom: 14px;
  border-radius: 8px;
  /* background: #fff; */
  padding: 3px;
  object-fit: contain;
}
.footer-brand__name {
  font-family: var(--font-en);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.01em;
}
.footer-brand__name span {
  display: block;
  margin-top: 4px;
  font-family: var(--font-mm);
  font-weight: 400;
  font-size: 14px;
  opacity: 0.85;
}
.footer-brand p {
  margin-top: 14px;
  max-width: 34ch;
  font-size: 14px;
  opacity: 0.82;
}
.footer-col h2 {
  margin-bottom: 14px;
  font-family: var(--font-en);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.7;
}
:root[data-lang="my"] .footer-col h2 {
  font-family: var(--font-mm);
  letter-spacing: 0.02em;
  text-transform: none;
  font-size: 13px;
}
.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0;
}
.footer-col a,
.footer-col li {
  font-size: 14.5px;
  opacity: 0.85;
  text-decoration: none;
}
.footer-col a:hover {
  opacity: 1;
  text-decoration: underline;
}
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 12.5px;
  opacity: 0.78;
}
