/* =========================================================
   GLOBAL BASE
   ========================================================= */
* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  font-family: 'poppins', Arial, sans-serif;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: #eaf8ff;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: url('assets/img/dilg.jpg') no-repeat center center / cover;
  opacity: .2;
  z-index: -1;
}

/* =========================================================
   JOB SEARCH PAGE
   ========================================================= */
.container {
  max-width: 1100px;
  margin: auto;
  flex: 1;
}

.filters {
  float: left;
  width: 20%;
}

.job-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-left: 28%;
  margin-bottom: 2rem;
}

.job-card {
  text-decoration: none !important;
  color: inherit !important;
  background-color: white;
  border-radius: 10px;
  padding: 2.25rem;
  width: 45%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease;
}

.job-card:hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5) !important;
}

.employment_status {
  font-weight: bold;
  padding: 0.15rem 0.5rem;
  background-color: #ffde59;
  border-radius: 5px;
  font-size: 12px;
  width: fit-content;
  margin-bottom: 0.2rem;
  font-family: 'Poppins', sans-serif !important;
}

.position_name {
  font-size: 1.7rem;
  font-weight: bold;
  font-family: 'Poppins', sans-serif !important;
}

.division {
  font-size: .8rem;
  color: #7e7e7e;
  margin-bottom: .5rem;
  font-family: 'Poppins', sans-serif !important;
}

.place_of_assignment {
  font-size: .8rem;
  font-family: 'Poppins', sans-serif !important;
}

.deadline {
  font-size: .9rem;
  margin-top: 1rem;
  color: red;
  font-family: 'Poppins', sans-serif !important;
}

.salary {
  font-size: .9rem;
  font-family: 'Poppins', sans-serif !important;
}

.page_title {
  padding-left: 50%;
  padding-top: 2rem;
  margin-bottom: 1rem;
  font-family: 'Poppins', sans-serif !important;
}

.view_details {
  font-size: .8rem;
  text-decoration: underline;
  font-family: 'Poppins', sans-serif !important;
}

.view_details:hover {
  color: #0066cc !important;
  text-decoration: none !important;
}

.latest_job,
.job_category {
  font-size: 1.2rem;
  font-weight: bold;
  font-family: 'Poppins', sans-serif !important;
}

.filter_button {
  background-color: #18417f;
  padding: .3rem;
  width: 50%;
  border-radius: 5px;
  color: white;
}

.modal-content {
  border-radius: 12px;
  padding: 20px;
  font-family: 'Poppins', sans-serif !important;
  background-color: #f9fbfc;
}

.modal-header {
  border-bottom: none;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  padding-bottom: 0;
}

.modal-title {
  font-weight: 700;
  font-size: 1.8rem;
  text-align: center;
  color: #222;
  margin-bottom: 1.5rem;
  font-family: 'Poppins', sans-serif !important;
}

.modal-body {
  font-size: .95rem;
  line-height: 1.5;
  padding-top: 0;
  font-family: 'Poppins', sans-serif !important;
}

.modal-body h3 {
  font-size: 1.1rem;
  margin-top: 1.5rem;
  font-weight: 600;
  color: #111;
  font-family: 'Poppins', sans-serif !important;
}

.modal-body hr {
  border-top: 1px solid #ccc;
  margin: .5rem 0;
}

.modal-footer {
  border-top: none;
  display: flex;
  justify-content: flex-end;
  background-color: transparent;
}

.modal-footer button {
  background-color: #213c6c;
  color: white;
  padding: .5rem 1.2rem;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: .95rem;
  font-family: 'Poppins', sans-serif !important;
}

.modal-footer button:hover {
  background-color: #1a2f57;
}

#modalEmploymentStatus {
  background-color: #ffde59;
  color: #000;
  padding: 4px 10px;
  font-size: .75rem;
  font-weight: bold;
  border-radius: 5px;
  display: inline-block;
  margin-bottom: .6rem;
  font-family: 'Poppins', sans-serif !important;
}

#modalPositionName {
  font-size: 1.5rem;
  font-weight: 700;
  margin: .4rem 0;
  color: #222;
  font-family: 'Poppins', sans-serif !important;
}

#modalDivision {
  font-size: .95rem;
  font-weight: 500;
  color: #999;
  margin-bottom: 1rem;
}

a#modalLink {
  word-break: break-word;
  color: #0056b3;
}

.section-underline {
  border: none;
  height: 4px;
  background-color: #ffde59;
  width: 100%;
  margin-bottom: 1.2rem;
  box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
}

.filter-row {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.pager-row {
  margin-left: 28%;
  width: calc(100% - 28%);
  margin-top: 1.5rem;
  margin-bottom: 3rem;
  display: flex;
  justify-content: flex-end; /* push to right */
  align-items: center;
  padding-right: 2.8rem;
}

/* Pagination layout */
.pager-row .pagination {
  display: flex;
  gap: 0.5rem; /* space between page items */
  justify-content: flex-end;
  margin: 0;
  padding: 0 1rem;
}

/* Individual page link style */
.pager-row .page-link {
  border: 1px solid #ddd;
  color: #18417f;
  background-color: #fff;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.2s ease-in-out;
}

.pager-row .page-link:hover {
  background-color: #18417f;
  color: #fff;
  border-color: #18417f;
  text-decoration: none;
}

.pager-row .page-link.active {
  background-color: #18417f;
  color: #fff;
  border-color: #18417f;
}

/* Responsive fix for mobile */
@media (max-width: 900px) {
  .pager-row {
    margin-left: 0;
    width: 100%;
    justify-content: center; /* center pagination on small screens */
  }

  .pager-row .pagination {
    gap: 0.4rem;
    padding: 0;
  }

  .pager-row .page-link {
    padding: 0.35rem 0.65rem;
    font-size: 0.85rem;
  }
}

/* No jobs message */
.no-jobs-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
  min-height: 300px;
  animation: fadeIn 1s ease-in-out;
}

.no-jobs-container img {
  width: 100px;
  margin-bottom: 20px;
  opacity: .9;
}

.no-jobs-container p {
  font-size: 1.2rem;
  color: #6c757d;
  font-weight: 500;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive tweaks */
@media (max-width: 640px) {
  body {
    font-size: 9px;
  }

  .job-card {
    width: 270px;
    margin-left: 2%;
    padding: .8rem;
  }

  .view_details {
    font-size: .5rem;
  }

  .filters {
    width: 25%;
    font-size: x-small;
  }

  .page_title {
    padding-left: 5rem;
  }
}

@media (max-width: 900px) {
  .job-cards {
    margin-left: 0;
    width: 100%;
  }

  .job-card {
    width: 100%;
    margin-left: 0;
  }

  .filters {
    width: 100%;
    margin-bottom: 1rem;
  }

  .page_title {
    padding-left: 0;
    text-align: center;
  }
}

@media (max-width: 800px) {
  .radio-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
  }

  .radio-row label {
    display: flex;
    align-items: center;
    gap: .4rem;
  }

  .filter-row {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
  }

  .filter-group {
    flex: 1 1 45%;
  }
}

/* =========================================================
   CONTACT PAGE
   ========================================================= */
.container-content {
  width: 100%;
  max-width: 1000px;
  margin-inline: auto;
  padding: 20px;
  text-align: left;
}

.contactTitle {
  font-family: 'Poppins', sans-serif !important;
  font-size: 2.2rem;
  font-weight: 800;
  color: #18417f;
  margin: .5rem 0 0;
  text-align: center;
}

.divider {
  border-top: 2px solid #000;
  margin: 1rem 0;
}

.officials-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2rem;
  margin: 2rem auto;
  padding: 1rem;
}

.unit_header {
  color: #18417f;
}

.official-card {
  background: #e8f6fc;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, .1);
  flex: 1 1 45%;
  min-width: 280px;
}

.official-card h2 {
  font-size: 1.5rem;
  margin: .25rem 0 .5rem;
  font-weight: 800;
  font-family: 'Poppins', sans-serif !important;
}

.official-card h5 {
  margin: .25rem 0;
  font-weight: 800;
  font-size: 1rem;
  font-family: 'Poppins', sans-serif !important;
}

.official-card p {
  margin: .25rem 0;
  font-weight: 800;
  font-family: 'Poppins', sans-serif !important;
}

.officialName {
  color: #18417f;
  font-family: 'Poppins', sans-serif !important;
}

/* With photo */
.official-card--with-photo {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.official-photo {
  width: 100%;
  max-width: 280px;
  height: 300px;        /* sets consistent visual height */
  object-fit: cover;    /* crops edges if needed */
  border-radius: 14px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, .12);
}

.official-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.official-meta {
  min-width: 0;
}

/* Location */
.location-section {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  background: rgba(24, 65, 127, .05);
  padding: 2rem;
  border-radius: 10px;
  margin: 2rem auto;
  max-width: 1200px;
}

.location-info,
.location-map {
  flex: 1 1 45%;
  min-width: 280px;
}

.location-title {
  font-family: 'Poppins', sans-serif !important;
  font-size: 2rem;
  font-weight: 800;
  color: #18417f;
  margin: 0 0 .5rem;
  
}

.location-subtitle {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 1rem;
  font-family: 'Poppins', sans-serif !important;
}

.location-address {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.6;
  font-family: 'Poppins', sans-serif !important;
}

.map-frame {
  width: 100%;
  height: 350px;
  border: 0;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
  display: block;
}

@supports (aspect-ratio:4/3) {
  .map-frame {
    height: auto;
    aspect-ratio: 4/3;
  }
}

/* Responsive Contact */
@media (max-width: 992px) {
  .officials-row {
    justify-content: center;
    max-width: 740px;
    margin-inline: auto;
  }

  .official-card {
    flex: 1 1 100%;
    max-width: 720px;
  }

  .location-section {
    justify-content: center;
  }

  .location-info,
  .location-map {
    flex: 1 1 100%;
    max-width: 720px;
  }

  .location-title {
    font-size: 1.75rem;
  }
}

@media (max-width: 576px) {
  .container-content {
    padding: 16px;
  }

  .officials-row {
    gap: 1rem;
    padding: .5rem;
  }

  .official-card {
    padding: 1rem;
  }

  .official-card h2 {
    font-size: 1.25rem;
  }

  .official-card h5 {
    font-size: .95rem;
  }

  .official-card p {
    font-size: .9rem;
  }

  .location-section {
    padding: 1.25rem;
    gap: 1rem;
  }

  .location-title {
    font-size: 1.5rem;
  }

  .location-subtitle {
    font-size: 1.05rem;
  }

  .map-frame {
    height: 300px;
  }

  @supports (aspect-ratio:4/3) {
    .map-frame {
      aspect-ratio: 3/2;
    }
  }
}

.official-card--portrait{
  display:flex;
  flex-direction:column;
  align-items:center;
  text-align:center;
  gap:.75rem;
  padding:1.5rem;
}

/* Large portrait */
.official-photo{
  width: 220px;
  aspect-ratio: 3 / 4;          /* keeps a nice portrait ratio */
  object-fit: cover;
  border-radius: 14px;
  box-shadow: 0 6px 14px rgba(0,0,0,.12);
  background: #f4f7fb;
}

/* Typography tweaks */
.officialName{
  font-size: clamp(1.1rem, 2.2vw, 1.5rem);
  font-weight: 800;
  color:#18417f;
  margin: .25rem 0 0;
  text-transform: uppercase;
  letter-spacing:.5px;
}

.officialTitle{
  margin:0;
  font-weight:700;
  color:#2b3b55;
  opacity:.9;
}

/* Grid behavior (reuse your .officials-row) */
.officials-row{
  display:flex;
  flex-wrap:wrap;
  gap:2rem;
  justify-content:space-between;
}

/* Two-up on desktop, one-up on small screens */
.official-card--portrait{
  flex:1 1 45%;
  min-width:280px;
}

@media (max-width: 992px){
  .official-card--portrait{ flex:1 1 100%; max-width:720px; margin-inline:auto; }
  .official-photo{ width: 200px; }
}

@media (max-width: 576px){
  .official-photo{ width: 170px; border-radius:12px; }
}

/* =========================================================
   HERO / LANDING PAGE
   ========================================================= */
:root {
  --radius: 20px;
  --radius-sm: 18px;
  --hero-bg: rgba(24, 65, 127, 0.6);
  --brand: #18417f;
}

main.hero-section {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  padding: clamp(16px, 4vw, 32px);
  position: relative;
}

.overlay {
  background: var(--hero-bg);
  border-radius: var(--radius);
  color: #fff;
  width: min(900px, 95%);
  padding: clamp(24px, 6vw, 80px) clamp(28px, 7vw, 96px);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.overlay img {
  width: clamp(120px, 20vw, 200px);
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto 16px;
}

.mainPageText {
  background-color: var(--brand);
  padding: clamp(14px, 3vw, 30px);
  border-radius: var(--radius);
  margin: 0;
  font-size: clamp(1.1rem, 2.6vw, 2rem);
  line-height: 1.25;
}

footer {
  background-color: var(--brand);
  color: #fff;
  text-align: center;
  padding: 10px 0;
  margin-top: auto;
}

@media (max-width: 992px) {
  .overlay {
    width: min(760px, 96%);
  }
}

@media (max-width: 576px) {
  :root {
    --radius: var(--radius-sm);
  }

  .overlay {
    width: 94%;
    padding: 24px;
  }

  .mainPageText {
    padding: 16px;
  }

  footer {
    padding: 8px 0;
  }
}

/* =========================================================
   ABOUT PAGE
   ========================================================= */
.about-section {
  background-color: rgba(24, 65, 127, .6);
  border-radius: 20px;
  padding: 2rem;
  margin-block: 2rem;
}

.about-wrapper {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: stretch;
  min-height: 60vh;
}

.about-card,
.charter-card {
  flex: 1 1 48%;
  background-color: rgba(255, 255, 255, .05);
  backdrop-filter: blur(4px);
  padding: 1.5rem;
  border-radius: 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .1);
}

.about-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #fff;
  text-align: center;
  margin-bottom: 1rem;
  font-family: 'poppins', Arial, sans-serif;
}

.about-text {
  color: #f1f1f1;
  line-height: 1.6;
  font-size: 1rem;
  text-align: justify;
  margin-bottom: 1rem;
  font-family: 'poppins', Arial, sans-serif;
}

.charter-iframe-wrapper {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: inset 0 0 5px rgba(0, 0, 0, .2);
  height: 550px;
}

@supports (aspect-ratio:4/5) {
  .charter-iframe-wrapper {
    height: auto;
    aspect-ratio: 4/5;
  }
}

.charter-iframe-wrapper iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

@media (max-width: 992px) {

  .about-card,
  .charter-card {
    flex: 1 1 100%;
  }

  .about-wrapper {
    max-width: 720px;
    margin-inline: auto;
    justify-content: center;
  }

  .charter-iframe-wrapper {
    height: 460px;
  }

  @supports (aspect-ratio:4/5) {
    .charter-iframe-wrapper {
      aspect-ratio: 3/4;
    }
  }
}

@media (max-width: 576px) {
  .about-section {
    padding: 1rem;
    border-radius: 14px;
  }

  .about-wrapper {
    gap: 1rem;
    max-width: 480px;
  }

  .about-card,
  .charter-card {
    padding: 1rem;
  }

  .about-title {
    font-size: 1.35rem;
  }

  .about-text {
    font-size: .95rem;
  }

  .charter-iframe-wrapper {
    height: 380px;
  }

  @supports (aspect-ratio:4/5) {
    .charter-iframe-wrapper {
      aspect-ratio: 2/3;
    }
  }
}

/* =========================================================
   APPLY FORM PAGE
   ========================================================= */
.form-container {
  background: #fff;
  border-radius: 15px;
  padding: 30px;
  margin: 30px auto;
  max-width: 1100px;
  box-shadow: 0 0 10px rgba(0, 0, 0, .1);
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('../assets/img/background.jpg');
  background-size: cover;
  background-position: center;
  opacity: .1;
  z-index: -1;
}

.form_submit_button {
  background-color: #213c6c;
  border: none;
}

.duplicate-warning {
  border-left: 4px solid #dc3545;
  background-color: #f8f9fa;
  padding: 10px 15px;
  margin-bottom: 15px;
}

@media (max-width: 576px) {

  h2,
  h4 {
    font-size: 1.2rem;
  }

  label {
    font-size: .9rem;
  }
}

/* =========================================================
   Applicants Portal — Home (main.php) – Scoped + Conflict-free
   ========================================================= */
:root{
  --radius: 20px;
  --radius-sm: 18px;
  --hero-bg: rgba(24, 65, 127, 0.6);
  --brand: #18417f;
}

/* Base reset kept minimal (don’t override global body styles) */
.home-hero * { box-sizing: border-box; }

/* Hero section */
.hero-section {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  padding: clamp(16px, 4vw, 32px);
  position: relative;
}

/* Background image only for the home hero.
   NOTE: path is relative to this CSS file (assets/css -> assets/img) */
.home-hero::before{
  content: "";
  position: fixed;
  inset: 0;
  background: url('../assets/img/dilg.jpg') center center / cover no-repeat;
  z-index: -1;
}

/* Overlay card */
.hero-section .overlay{
  background: var(--hero-bg);
  border-radius: var(--radius);
  color: #fff;
  width: min(900px, 95%);
  padding: clamp(24px, 6vw, 80px) clamp(28px, 7vw, 96px);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  position: relative;
  z-index: 1;  
}

/* Logo */
.hero-section .overlay img{
  width: clamp(120px, 20vw, 200px);
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto 16px;
}

/* Main title */
.mainPageText{
  background-color: var(--brand);
  padding: clamp(14px, 3vw, 30px);
  border-radius: var(--radius);
  margin: 0;
  font-size: clamp(1.1rem, 2.6vw, 2rem);
  line-height: 1.25;
}

/* Footer – keep simple; site-wide footer CSS can still apply */
.home-hero + footer{
  background-color: var(--brand);
  color: #fff;
  text-align: center;
  padding: 10px 0;
  margin-top: auto;
}

/* ---------- Responsive ---------- */
@media (max-width: 992px){
  .hero-section .overlay{ width: min(760px, 96%); }
}

@media (max-width: 576px){
  :root{ --radius: var(--radius-sm); }
  .hero-section .overlay{ width: 94%; padding: 24px; }
  .mainPageText{ padding: 16px; }
  .home-hero + footer{ padding: 8px 0; }
}

/* --- RSP hero text --- */
.overlay-rsp { text-align: center; }

.overlay-rsp .rsp-acronym{
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: .02em;
  margin: 0 0 .6rem 0;
  line-height: 1.1;
}

.overlay-rsp .rsp-expanded{
  display: inline-block;
  margin: 0;
  padding: clamp(10px, 1.8vw, 16px) clamp(16px, 2.5vw, 28px);
  border-radius: var(--radius);
  background-color: var(--brand);
  color: #fff;
  font-weight: 600;
  font-size: clamp(1rem, 2.2vw, 1.5rem);
  line-height: 1.25;
}


/* =========================================================
   SITE-WIDE FOOTER (for Applicants Portal pages)
   ========================================================= */
.site-footer{
  background-color:#18417f;
  color:#fff;
  text-align:center;
  padding:1rem 0;
  margin:0;
  font-size:.95rem;
  line-height:1.5;
}
.site-footer *{ margin:0; padding:0; }

.footer_text{
  font-family: "Poppins", Arial, sans-serif;
  padding-left:1rem;
  padding-right:1rem;
}

/* (Optional) modal sizes you were using */
.modal-dialog.large   { max-width: 80vw; }
.modal-dialog.mid-large{ max-width: 50vw; }
@media (max-width: 576px){
  .modal-dialog.large,
  .modal-dialog.mid-large{ max-width: 95vw; }
}
