/* ==========================================================================
   Department Page — Modern Stylesheet
   For: Sekondi Takoradi Metropolitan Assembly department pages
   (physical-planning.php and similar department templates)

   Load this AFTER the existing template stylesheets (bootstrap.css,
   template.css, responsive.css, base-sizing.css, dp.css) so these rules
   take priority:

     <link rel="stylesheet" href="../css/dp.css" type="text/css" media="all">
     <link rel="stylesheet" href="../css/department-modern.css" type="text/css" media="all">

   It only restyles the sub-header/breadcrumb and department content areas —
   header.php and footer.php are untouched.
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Playfair+Display:wght@700&display=swap");

:root {
  --dp-navy: #095c14;
  --dp-navy-deep: #0c420f;
  --dp-red: #798b56;
  --dp-ink: #24303b;
  --dp-muted: #67757f;
  --dp-line: #e3e8ec;
  --dp-bg: #f6f8f9;
  --dp-white: #ffffff;
  --dp-radius: 6px;
  --dp-font:
    "Inter", "Open Sans", -apple-system, BlinkMacSystemFont, sans-serif;
}

/* --------------------------------------------------------------------
   1. Sub-header — short, flat bar, no sparkles
   -------------------------------------------------------------------- */

#page_header.page-subheader {
  background: var(--dp-navy) !important;
  background-image: none !important;
  padding: 22px 0;
  overflow: hidden;
  min-height: 0 !important;
  height: auto !important;
}

/* kill the animated sparkle layer and the old decorative SVG mask */
#page_header .th-sparkles,
#page_header .bgback,
#page_header .kl-bottommask {
  display: none !important;
}

/* replace the mask with a single quiet accent rule along the bottom edge */
#page_header.page-subheader {
  border-bottom: 3px solid var(--dp-red);
}

#page_header .ph-content-wrap {
  position: relative;
  z-index: 2;
  height: auto !important;
  min-height: 0 !important;
}

/* one row: title on the left, breadcrumb pill on the right — the two
   template columns are re-ordered with flexbox rather than editing the
   markup, so this drops straight into the existing HTML */
#page_header .container .row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

#page_header .col-sm-12.col-md-6.col-lg-6:first-child {
  order: 2;
  flex: 0 0 auto;
  width: auto;
}

#page_header .col-sm-12.col-md-6.col-lg-6:last-child {
  order: 1;
  flex: 0 0 auto;
  width: auto;
}

/* hide the current-date line and subtitle to match the simplified bar */
#page_header .subheader-currentdate,
#page_header .subheader-subtitle {
  display: none !important;
}

/* --------------------------------------------------------------------
   2. Breadcrumbs — compact pill, home icon, highlighted current page
   -------------------------------------------------------------------- */

#page_header .breadcrumbs {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 9px 20px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  font-family: var(--dp-font);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

#page_header .breadcrumbs li {
  display: flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.6);
}

/* home icon in front of the first crumb */
#page_header .breadcrumbs li:first-child a::before {
  font-family: "FontAwesome";
  content: "\f015";
  margin-right: 7px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
}

#page_header .breadcrumbs li + li::before {
  content: "\f105";
  font-family: "FontAwesome";
  display: inline-block;
  margin: 0 10px;
  color: rgba(255, 255, 255, 0.3);
  font-weight: 400;
}

#page_header .breadcrumbs li:last-child {
  color: var(--dp-red);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.03em;
}

#page_header .breadcrumbs a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

#page_header .breadcrumbs a:hover {
  color: var(--dp-white);
}

@media (max-width: 767px) {
  #page_header .breadcrumbs a::before {
    margin-right: 5px;
  }
}

/* --------------------------------------------------------------------
   3. Sub-header title
   -------------------------------------------------------------------- */

#page_header .subheader-titles {
  text-align: left;
}

#page_header .subheader-maintitle {
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
  font-weight: 700;
  font-size: 26px;
  color: var(--dp-white);
  margin: 0;
  letter-spacing: -0.01em;
}

@media (max-width: 767px) {
  #page_header .container .row {
    justify-content: flex-start;
  }
  #page_header .col-sm-12.col-md-6.col-lg-6:first-child,
  #page_header .col-sm-12.col-md-6.col-lg-6:last-child {
    width: 100%;
  }
  #page_header .subheader-titles {
    margin-bottom: 14px;
  }
}

/* --------------------------------------------------------------------
   4. Department content — simple, readable, left-aligned
   -------------------------------------------------------------------- */

.hg_section.bg-white {
  background: var(--dp-bg) !important;
  padding: 56px 0;
}

.skills_wgt p,
.skills_wgt li,
.skills_wgt div {
  text-align: left !important;
  text-justify: auto !important;
}

.skills_wgt {
  font-family: var(--dp-font);
  color: var(--dp-ink);
  background: var(--dp-white);
  border: 1px solid var(--dp-line);
  border-radius: var(--dp-radius);
  padding: 32px 36px;
}

.skills_wgt .wgt-title span {
  font-family: var(--dp-font);
  font-weight: 700;
  font-size: 20px;
  color: var(--dp-navy-deep);
  letter-spacing: -0.01em;
}

.skills_wgt p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--dp-ink);
}

.skills_wgt hr {
  border: none;
  border-top: 1px solid var(--dp-line);
  margin: 24px 0;
}

/* legal / statutory list — quiet numbered list, not bulleted <li> soup */
.skills_wgt b,
.skills_wgt strong {
  font-family: var(--dp-font);
  font-weight: 600;
  color: var(--dp-navy-deep);
  font-size: 14px;
}

.skills_wgt li {
  list-style: none;
  font-size: 14px;
  line-height: 1.6;
  color: var(--dp-muted);
  padding: 6px 0 6px 22px;
  position: relative;
  border-bottom: 1px solid var(--dp-line);
}

.skills_wgt li:last-child {
  border-bottom: none;
}

.skills_wgt li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 15px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--dp-red);
}

/* --------------------------------------------------------------------
   5. Head-of-department portrait card — fixed size, any source image
   -------------------------------------------------------------------- */

.photogallery-widget figure {
  border: none !important;
  border-radius: 14px;
  padding: 0 !important;
  margin: 0 auto;
  overflow: hidden;
  background: var(--dp-white);
  box-shadow: 0 10px 30px rgba(14, 34, 51, 0.12);
  max-width: 320px;
}

/* fixed-size frame — every photo, whatever its native dimensions,
   is cropped to fill this exact box */
.photogallery-widget figure .dp-photo-frame,
.photogallery-widget figure {
  position: relative;
}

.photogallery-widget figure img {
  display: block;
  width: 100%;
  height: 360px;
  object-fit: cover;
  object-position: center top;
  transition: transform 0.35s ease;
}

.photogallery-widget figure:hover img {
  transform: scale(1.04);
}

.photogallery-widget figcaption {
  background: var(--dp-white) !important;
  color: var(--dp-navy-deep) !important;
  font-family: var(--dp-font);
  font-style: normal !important;
  padding: 18px 16px !important;
  text-align: center !important;
  border-top: 3px solid var(--dp-red);
}

.photogallery-widget figcaption br {
  content: "";
  display: block;
  margin: 4px 0;
}

/* name (text before the <br>) */
.photogallery-widget figcaption {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.5;
}

/* --------------------------------------------------------------------
   6. Major activities — numbered list, modernised
   -------------------------------------------------------------------- */

.tbk__title {
  font-family: var(--dp-font);
  font-weight: 700;
  font-size: 19px;
  color: var(--dp-navy-deep);
  margin: 48px 0 4px;
  letter-spacing: -0.01em;
}

.tbk__subtitle.list,
ol.list {
  list-style: none !important;
  counter-reset: activity;
  padding-left: 0 !important;
  margin-top: 18px !important;
}

ol.list li {
  counter-increment: activity;
  position: relative;
  list-style: none !important;
  background: var(--dp-white);
  border: 1px solid var(--dp-line);
  border-radius: var(--dp-radius);
  padding: 14px 18px 14px 52px !important;
  margin-bottom: 10px !important;
  font-family: var(--dp-font);
  font-size: 14px;
  line-height: 1.6;
  color: var(--dp-ink);
  text-align: left !important;
}

ol.list li::before {
  content: counter(activity);
  position: absolute;
  left: 16px;
  top: 14px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--dp-navy);
  color: var(--dp-white);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 767px) {
  ol.list li {
    padding-left: 46px !important;
  }
}

/* --------------------------------------------------------------------
   7. "Previous X" office-holder listings — modern card grid
   Covers both markup patterns used across pages:
     - .team_member   (Presiding Member / Metro Coordinating Director grids)
     - .team-member   (Mayor's slick carousel)
   -------------------------------------------------------------------- */

.kl-title-block .tbk__title {
  margin-top: 0;
}

/* card shell */
.team_member,
.team-member {
  background: var(--dp-white);
  border: 1px solid var(--dp-line);
  border-radius: 16px;
  overflow: hidden;
  text-align: center !important;
  box-shadow: 0 6px 16px rgba(14, 34, 51, 0.06);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
  margin-bottom: 28px;
}

.team_member:hover,
.team-member:hover {
  transform: translateY(-6px);
  border-color: var(--dp-navy);
  box-shadow: 0 18px 34px rgba(14, 34, 51, 0.16);
}

/* stray legacy spacing hacks in the markup — collapse them */
.team_member + br,
.team_member ~ br,
.team-member + br,
.team-member ~ br {
  display: none !important;
}

/* fixed-size photo, any source image, no grayscale-until-hover gimmick */
.team_member > a,
.team-member > a {
  display: block;
  overflow: hidden;
  position: relative;
}

.team_member img.img-fluid,
.team-member img.img-fluid {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: cover;
  object-position: center top;
  filter: none !important;
  transition: transform 0.4s ease;
}

.team_member:hover img.img-fluid,
.team-member:hover img.img-fluid {
  transform: scale(1.06);
}

/* name */
.team_member h4,
.team_member h5,
.team-member h5.mmb-title {
  font-family: var(--dp-font);
  font-weight: 700;
  font-size: 14.5px;
  color: var(--dp-navy-deep);
  line-height: 1.4;
  margin: 16px 14px 6px;
}

.team_member h4 strong,
.team_member h5 strong,
.team-member h5.mmb-title strong {
  font-weight: 700;
}

/* duration / position — pill badge */
.team_member h6,
.team_member .mmb-position,
.team-member .mmb-position {
  display: inline-block;
  font-family: var(--dp-font);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.03em;
  color: var(--dp-red);
  background: rgba(205, 33, 34, 0.08);
  padding: 4px 13px;
  border-radius: 999px;
  margin: 0 0 18px;
}

/* legacy separator dash — no longer needed with the pill badge */
.team_member .separator,
.team-member .separator {
  display: none !important;
}

.team_member .details,
.team-member .details {
  padding: 0 18px 18px;
  font-family: var(--dp-font);
  font-size: 13px;
  line-height: 1.6;
  color: var(--dp-muted);
  text-align: left !important;
}

.team_member .details:empty,
.team-member .details:empty {
  display: none;
}

/* grid spacing for the plain bootstrap column layout */
.hg_section .row > [class*="col-"] > .team_member {
  height: calc(100% - 28px);
}

/* carousel wrapper — quiet down the default theme chrome */
.team-boxes__carousel-wrapper {
  padding: 0 4px;
}

.team-boxes__carousel .slick-slide {
  padding: 0 10px;
}

/* --------------------------------------------------------------------
   8. Historical record tables (e.g. Council / Executive Chairman)
   -------------------------------------------------------------------- */

.dp-table-card {
  margin-bottom: 36px;
}

.dp-table-card:last-child {
  margin-bottom: 0;
}

.dp-table-title {
  font-family: var(--dp-font);
  font-weight: 700;
  font-size: 15px;
  color: var(--dp-navy-deep);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 14px;
  padding-left: 14px;
  border-left: 4px solid var(--dp-red);
}

.dp-table-card .table-responsive {
  overflow-x: auto;
  background: var(--dp-white);
  border: 1px solid var(--dp-line);
  border-radius: var(--dp-radius);
  box-shadow: 0 6px 18px rgba(14, 34, 51, 0.05);
}

table.dp-modern-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--dp-font);
}

table.dp-modern-table thead th {
  background: var(--dp-navy);
  color: var(--dp-white);
  text-align: left;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 13px 18px;
}

table.dp-modern-table tbody td {
  padding: 12px 18px;
  font-size: 14px;
  color: var(--dp-ink);
  border-bottom: 1px solid var(--dp-line);
}

table.dp-modern-table tbody tr:last-child td {
  border-bottom: none;
}

table.dp-modern-table tbody tr {
  transition: background-color 0.15s ease;
}

table.dp-modern-table tbody tr:hover {
  background: var(--dp-bg);
}

/* --------------------------------------------------------------------
   9. Previous Mayor's carousel — uniform card heights + responsive fixes

   Note: this page loads slick.js but never loads slick's own core
   stylesheet, so .slick-list isn't clipped and slides aren't laid out
   correctly out of the box. The base rules below restore that required
   behaviour; the rest makes every card the same height and styles the
   .hgSlickNav arrow buttons to match the site.
   -------------------------------------------------------------------- */

.slick-slider {
  position: relative;
  display: block;
  box-sizing: border-box;
  user-select: none;
  touch-action: pan-y;
}

.slick-list {
  position: relative;
  overflow: hidden;
  display: block;
  margin: 0;
  padding: 0;
}

.slick-track {
  position: relative;
  top: 0;
  display: flex;
  align-items: stretch;
  margin: 0 auto;
}

.slick-track::before,
.slick-track::after {
  display: table;
  content: "";
}

.slick-slide {
  display: none;
  float: left;
  height: auto;
  min-height: 1px;
}

.slick-slide img {
  display: block;
}

.slick-initialized .slick-slide {
  display: flex;
}

.slick-slide > div {
  display: flex;
  width: 100%;
}

/* uniform card height within a row of slides */
.team-boxes__carousel-wrapper {
  overflow: hidden;
}

.team-member {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
}

/* reserve consistent space for 1- or 2-line names so every pill badge
   lines up at the same height regardless of name length */
.team-member h5.mmb-title {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
}

.team-member .details {
  flex: 1;
}

/* slide gutters so cards don't touch */
.team-boxes__carousel .slick-slide {
  padding: 0 10px;
  box-sizing: border-box;
}

/* --------------------------------------------------------------------
   10. Carousel nav arrows (.hgSlickNav) — custom, since the slick
   theme icon font isn't loaded either
   -------------------------------------------------------------------- */

.hgSlickNav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-top: 30px;
}

.hgSlickNav .slick-prev,
.hgSlickNav .slick-next {
  position: static;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--dp-navy);
  color: transparent;
  font-size: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.hgSlickNav .slick-prev::before,
.hgSlickNav .slick-next::before {
  font-family: Georgia, serif;
  font-size: 18px;
  line-height: 1;
  color: var(--dp-white);
  opacity: 1;
  content: "\2039";
}

.hgSlickNav .slick-next::before {
  content: "\203A";
}

.hgSlickNav .slick-prev:hover,
.hgSlickNav .slick-next:hover {
  background: var(--dp-red);
}

.hgSlickNav .slick-prev:focus-visible,
.hgSlickNav .slick-next:focus-visible {
  outline: 2px solid var(--dp-navy);
  outline-offset: 2px;
}

.hgSlickNav .slick-disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

/* --------------------------------------------------------------------
   11. Responsive photo sizing for the card grid (4 → 2 → 1 per row)
   -------------------------------------------------------------------- */

@media (max-width: 991px) {
  .team_member img.img-fluid,
  .team-member img.img-fluid {
    height: 240px;
  }
}

@media (max-width: 480px) {
  .team-boxes__carousel .slick-slide {
    padding: 0 6px;
  }
  .team_member img.img-fluid,
  .team-member img.img-fluid {
    height: 280px;
  }
}
