/* ==========================================================================
   SurveyMETER Joomla template – additions on top of the static theme
   ========================================================================== */

@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('../fonts/plus-jakarta-sans-latin.woff2') format('woff2');
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

/* Joomla system messages */
#system-message-container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--s5); }
#system-message-container:empty { display: none; }
.system-messages { margin: var(--s5) 0 0; }
.system-messages .alert {
  margin: 0 0 var(--s2);
  padding: 14px 18px;
  border-radius: var(--r-sm);
  border: 1px solid var(--rule);
  background: var(--tint);
  font-size: 15px;
}
.system-messages .alert-success { background: #E7F5EA; border-color: #B9DFC2; }
.system-messages .alert-warning { background: #FFF6DB; border-color: #EED9A0; }
.system-messages .alert-error, .system-messages .alert-danger { background: #FCE9E9; border-color: #EFBFBF; }
.system-messages .alert-info { background: var(--mint); border-color: #BCDCC7; }
.system-messages .alert .close, .system-messages .alert .btn-close { float: right; margin-left: 12px; }

/* Breadcrumbs rendered by the template */
.crumbs .crumb-current { color: var(--ink-2); }

/* Generic Joomla content wrappers */
.com-content-article.item-page { padding: 0; }
.com-content-article .page-header { margin-bottom: var(--s4); }
.com-content-article .page-header h1 { font-size: clamp(30px, 3.6vw, 46px); }

/* Article page */
.article-page { padding-top: var(--s7); padding-bottom: var(--s9); }
.article-page .post__meta { display: flex; flex-wrap: wrap; gap: var(--s4) 40px; margin-bottom: var(--s6); padding-bottom: var(--s5); border-bottom: 1px solid var(--rule); }
.article-page .post__meta div { display: grid; gap: 2px; }
.article-page .post__meta .meta-label { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--green); }
.article-page .post__meta .meta-value { font-size: 15px; font-weight: 600; }
.article-page .post__cover { margin: 0 0 var(--s6); }
.article-page .post__cover img { width: 100%; max-height: 520px; object-fit: cover; border-radius: var(--r-md); }

/* Home article: keep the section rhythm from the theme */
.home > .section:first-child { padding-top: 0; }
.home > .hero:first-child { padding-top: 72px; }
.home .section--tint + .section--tint { padding-top: 0; }

/* Joomla pagination */
.pagination-wrapper { margin-top: var(--s7); }
.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
}
.pagination li { list-style: none; }
.pagination li > a, .pagination li > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--rule);
  border-radius: var(--r-pill);
  color: var(--ink);
  text-decoration: none;
  background: var(--card);
}
.pagination a:hover { border-color: var(--ink); }
.pagination li.active > a, .pagination li.active > span { background: var(--ink); border-color: var(--ink); color: #fff; }
.pagination li.disabled > span, .pagination li.disabled > a { opacity: .45; }
.pagination li > a span, .pagination li > span span { min-width: 0; min-height: 0; padding: 0; border: 0; background: none; border-radius: 0; }
.pagination .pagination-counter { border: 0; background: none; color: var(--ink-2); }

/* Search (Smart Search) */
.com-finder .search-form, .com-finder form { display: flex; flex-wrap: wrap; gap: var(--s3); margin-bottom: var(--s6); }
.com-finder input[type="search"], .com-finder input[type="text"] { flex: 1 1 320px; min-height: 52px; padding: 0 20px; border: 1px solid var(--edge); border-radius: var(--r-pill); font: inherit; }
.com-finder .btn { min-height: 52px; }
.com-finder .result__title a, .com-finder .result-title a { font-weight: 700; text-decoration: none; }
.com-finder .result__title a:hover, .com-finder .result-title a:hover { text-decoration: underline; }
.com-finder .result__snippet, .com-finder .result-snippet { color: var(--ink-2); font-size: 15px; }

/* Basic form controls inside content (contact, login) */
.com-content-article input[type="text"], .com-content-article input[type="email"],
.com-content-article input[type="password"], .com-content-article textarea,
.com-content-article select, .com-users input, .com-users textarea, .com-users select {
  width: 100%;
  max-width: 640px;
  min-height: 48px;
  padding: 10px 16px;
  border: 1px solid var(--edge);
  border-radius: var(--r-sm);
  font: inherit;
  background: #fff;
}
.com-content-article textarea, .com-users textarea { min-height: 160px; }
.com-content-article label, .com-users label { display: block; margin-bottom: 6px; font-weight: 600; }
.com-content-article .form-group, .com-users .form-group { margin-bottom: var(--s4); }

/* Editing / front-end buttons injected by Joomla */
.btn-group .btn, .btn-sm { min-height: 36px; padding: 0 14px; font-size: 14px; border-radius: var(--r-pill); }
span.icon-edit, .icon-edit::before { content: none; }

/* Print / accessibility helpers */
.visually-hidden, .sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 640px) {
  #system-message-container { padding: 0 var(--s4); }
  .article-page { padding-top: var(--s5); padding-bottom: var(--s8); }
}

/* Wide article layout (landing pages, people grids, card lists inside articles) */
.prose--wide { max-width: none; }
.prose--wide .cards-grid,
.prose--wide .people,
.prose--wide .partner-grid,
.prose--wide .timeline,
.prose--wide .contact-page,
.prose--wide .focus,
.prose--wide .scope,
.prose--wide .journey,
.prose--wide .covers,
.prose--wide .list { list-style: none; padding-left: 0; }
.prose .cards-grid li,
.prose .people li,
.prose .partner-grid li,
.prose .covers li,
.prose .list li { margin-top: 0; }
.prose .cards-grid a { font-weight: inherit; }
.prose .contact-page { display: grid; }
.prose .people--page { margin-bottom: var(--s5); }
.prose .timeline li { margin-top: 0; }
.prose .partner-grid h2 { margin-top: 0; }

/* --------------------------------------------------------------------------
   Smart Search (com_finder)
   -------------------------------------------------------------------------- */
.com-finder {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px var(--s5) var(--s9);
}
.com-finder legend { border: 0; }
.com-finder fieldset { border: 0; padding: 0; margin: 0; }
.com-finder .form-inline { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s3); }
.com-finder .form-inline > label { flex: 0 0 auto; padding-bottom: 14px; font-weight: 700; }
.com-finder .input-group { display: flex; flex-wrap: wrap; flex: 1 1 420px; gap: var(--s2); }
.com-finder .form-control {
  flex: 1 1 240px;
  min-height: 56px;
  padding: 0 22px;
  border: 1px solid var(--edge);
  border-radius: var(--r-pill);
  font: inherit;
  font-size: 17px;
  background: #fff;
}
.com-finder .form-control:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--mint), 0 0 0 4px var(--green); }
.com-finder .btn { min-height: 56px; padding: 0 24px; }
.com-finder .btn-primary { background: var(--green); color: #fff; }
.com-finder .btn-secondary { box-shadow: inset 0 0 0 1.5px var(--ink); background: transparent; color: var(--ink); }
.com-finder .btn-secondary:hover { background: var(--ink); color: #fff; }
.com-finder__advanced.collapse:not(.show) { display: none; }
.com-finder__advanced { margin-top: var(--s5); padding: var(--s5); border: 1px solid var(--rule); border-radius: var(--r-md); background: var(--tint); }
.com-finder__tips { margin-bottom: var(--s4); padding: var(--s4); background: var(--card); border-radius: var(--r-sm); border: 1px solid var(--rule); font-size: 15px; color: var(--ink-2); }
.com-finder__filter { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); }
.com-finder__filter .control-group { margin: 0; }
.com-finder__filter label { display: block; margin-bottom: 6px; font-weight: 600; }
.com-finder .form-select {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--edge);
  border-radius: var(--r-sm);
  background: #fff;
  font: inherit;
}
.com-finder__results { margin-top: var(--s7); }
.com-finder__explained { margin-bottom: var(--s5); color: var(--ink-2); }
.com-finder__results-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.result__item { padding: 24px 0; border-bottom: 1px solid var(--rule); }
.result__title { margin: 0 0 8px; font-size: 20px; font-weight: 700; line-height: 1.3; }
.result__title-link { display: block; text-decoration: none; color: var(--ink); }
.result__title-link:hover .result__title-text { text-decoration: underline; text-underline-offset: 4px; }
.result__title-url { display: block; margin-top: 2px; font-size: 13px; font-style: normal; font-weight: 400; color: var(--green); overflow-wrap: anywhere; }
.result__description { margin: 0 0 8px; font-size: 15px; color: var(--ink-2); }
.result__date { display: block; margin-bottom: 2px; font-size: 13px; font-weight: 700; color: var(--green); }
.result__taxonomy { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0; padding: 0; list-style: none; font-size: 13px; color: var(--ink-2); }
.result__taxonomy span { font-weight: 600; }
mark, .highlight { background: var(--lime); color: var(--ink); padding: 0 2px; border-radius: 3px; }
.com-finder .pagination { margin-top: var(--s6); }

@media (max-width: 640px) {
  .com-finder { padding: 32px var(--s4) var(--s8); }
  .com-finder__filter { grid-template-columns: minmax(0, 1fr); }
  .com-finder .form-inline > label { padding-bottom: 0; }
  .com-finder .input-group .btn { flex: 1 1 100%; }
}
.result__title-url { display: none; }
.timeline li { grid-template-columns: 120px minmax(0, 1fr); }
/* Buttons inside article prose keep their own colours */
.prose a.btn { text-decoration: none; }
.prose a.btn--primary { color: #fff; }
.prose a.btn--lime { color: var(--ink); }
.prose a.btn--outline { color: var(--ink); }
.prose a.btn--ghost { color: #fff; }
/* Never leave an empty media frame when an article has no usable image */
.post__cover:empty, .card__media:empty { display: none; }

/* Breadcrumb alignment: links have a 44px tap target, plain text does not */
.crumbs { align-items: center; }
.crumbs li { display: inline-flex; align-items: center; line-height: 1.4; }
.crumbs li + li::before { line-height: 1; }

/* Drupal tables often carry align/height presentational attributes. */
.prose table,
.prose table[align],
.prose table[width] {
  float: none !important;
  width: 100% !important;
  max-width: 100%;
  height: auto !important;
  margin: 1em 0;
}
.prose table[align="center"] { margin-left: auto; margin-right: auto; }
.lang__btn.is-disabled { opacity: .35; cursor: default; text-decoration: none; }

/* Hero carousel (home page) */
.hero-carousel__viewport {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--r-lg);
  box-shadow: var(--lift);
}
.hero-carousel__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 45% 50%;
  opacity: 0;
  transition: opacity .5s var(--ease);
}
.hero-carousel__img.is-active { opacity: 1; }
.hero-carousel__arrow {
  position: absolute;
  top: 50%;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-top: -22px;
  border-radius: 50%;
  background: rgba(15, 42, 30, .55);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  transition: background-color .2s var(--ease);
}
.hero-carousel__arrow:hover { background: var(--forest); }
.hero-carousel__arrow--prev { left: 16px; }
.hero-carousel__arrow--next { right: 16px; }
.hero-carousel__dots {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 3;
  display: flex;
  gap: 8px;
}
.hero-carousel__dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .55);
  box-shadow: 0 0 0 1px rgba(15, 42, 30, .25);
  transition: background-color .2s var(--ease), transform .2s var(--ease);
}
.hero-carousel__dot.is-active { background: var(--lime); transform: scale(1.2); }
.hero-carousel__caption[hidden] { display: none; }
@media (max-width: 640px) {
  .hero-carousel__arrow { width: 40px; height: 40px; margin-top: -20px; }
  .hero-carousel__arrow--prev { left: 8px; }
  .hero-carousel__arrow--next { right: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-carousel__img { transition: none; }
}

/* Home: remove the old stats strip and keep the next section close to the hero */
.home .hero { padding-bottom: var(--s6); }
.home .hero + .section { padding-top: var(--s7); }
@media (max-width: 640px) {
  .home .hero { padding-bottom: var(--s5); }
  .home .hero + .section { padding-top: var(--s7); }
}

/* Clickable people cards (halaman struktur) */
.people--page li { padding: 0; }
.people--page li a.person-link {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 18px;
  color: inherit;
  text-decoration: none;
}
.people--page li a.person-link:hover strong,
.prose .timeline a:hover { text-decoration: underline; text-underline-offset: 3px; }
.prose .timeline a { color: inherit; text-decoration: none; font-weight: 600; }

/* Struktur: timeline labels need a wider first column */
.prose .timeline li { grid-template-columns: 180px minmax(0, 1fr); }
.people--page li { transition: border-color .2s var(--ease); }
.people--page li:hover { border-color: var(--green); }
@media (max-width: 640px) {
  .prose .timeline li { grid-template-columns: 1fr; gap: 4px; }
}

/* Staff profile photo: max 6 x 6 cm, centered, keep aspect ratio */
.staff-photo {
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: 72ch;
  margin: 0 0 var(--s6);
}
.staff-photo img {
  display: block;
  width: auto;
  height: auto;
  max-width: 6cm;
  max-height: 6cm;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(15, 42, 30, .12);
}

/* News cards: don't stretch a card to the height of the tallest card in the row */
.cards-grid { align-items: start; }
.card { align-self: start; }
.card--no-media .card__body { flex: 0 0 auto; }

/* Post images: use the full article width, keep the original aspect ratio */
.post__cover img {
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  border-radius: var(--r-lg);
}
.prose img {
  width: auto !important;
  max-width: 100%;
  height: auto !important;
  object-fit: contain;
}

/* Pagination arrows: Joomla's icon font is not loaded, draw them with text */
.pagination .icon-angle-left::before { content: "\2039"; font-family: inherit; font-style: normal; }
.pagination .icon-angle-right::before { content: "\203A"; font-family: inherit; font-style: normal; }
.pagination .icon-angle-double-left::before { content: "\00AB"; font-family: inherit; font-style: normal; }
.pagination .icon-angle-double-right::before { content: "\00BB"; font-family: inherit; font-style: normal; }
.pagination .icon-angle-left::before,
.pagination .icon-angle-right::before,
.pagination .icon-angle-double-left::before,
.pagination .icon-angle-double-right::before {
  font-size: 22px;
  line-height: 1;
  font-weight: 700;
}

/* Cover image must follow the article column, not the full page, and never crop */
.article-page .post__cover {
  max-width: 72ch;
  margin-left: 0;
}
.article-page .post__cover img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
}

/* Header logo matches the admin login-card logo width */
.nav__logo img { width: 220px; height: auto; }
@media (max-width: 640px) {
  .nav__logo img { width: 180px; }
}
