/* =========================================================
   OFFICERS.CSS (RESPONSIVE)
   - National Officers org chart + modal
   - Cards are uniform size
   - Erwin stays LEFT but is lifted up to match your desired position
========================================================= */

*{ box-sizing: border-box; }

/* ================= PAGE BASE ================= */
html, body { min-height: 100%; }
html { background: #f8f9fb; }

body{
  font-family: 'Inter', sans-serif;
  margin: 0;
  padding-top: clamp(56px, 7vw, 70px); /* navbar offset */
  color: #222;
  background: transparent;
  position: relative;
  z-index: 0;
  overflow-x: hidden;
}

/* prevent scroll when modal is open */
body.modal-open{ overflow: hidden; }

/* If you have a wrapper, make sure it doesn't clip */
.page-wrapper{
  min-height: 100vh;
  overflow: visible;
}

/* ================= BACKGROUND BLUR ================= */
html::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: url("../static/bg_officers.png") center/cover no-repeat;

  /* default blur */
  filter: blur(15px); /* bawasan mula 20px para mas malinaw */
  opacity: 0.95;      /* taas ng opacity para mas visible */
  transition: filter 0.8s ease-out, opacity 0.8s ease-out;
}

body.loaded::before {
  filter: blur(0);  /* smooth transition to sharp */
  opacity: 1;
}

/* Mobile fallback: remove fixed background if needed */
@media (max-width: 720px){
  html::before{
    content: none !important;
    background: none !important;
  }
  body{
    background: linear-gradient(to bottom, #ffffff 0%, #f3f7ff 32%, #cfe0ff 68%, #0f2d55 100%);
    background-attachment: fixed;
  }
}

/* On some mobile browsers fixed backgrounds can stutter */
@media (max-width: 768px){
  html::before{ position: absolute; }
}

/* ================= HERO ================= */
.officers-hero{
  padding: clamp(56px, 9vw, 120px) 20px;
  text-align: center;

  /* desktop can have slight overlap look */
  margin-bottom: clamp(-50px, -4vw, -85px);
  margin-top: clamp(-20px, -3vw, -55px);
}

.officers-hero h1{
  font-family: 'Merriweather', serif;
  font-size: clamp(28px, 5.2vw, 56px);
  font-weight: 900;
  color: #000;
  margin: 0 0 10px;
  line-height: 1.1;
  padding: 0 10px;
}

.officers-hero p{
  margin: 0;
  color: rgba(0,0,0,.62);
  font-size: clamp(13px, 2vw, 16px);
  line-height: 1.35;
}

/* ================= ORG CHART ================= */
.org-v2{
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(16px, 3vw, 36px);
  padding: clamp(18px, 3.5vw, 40px) 20px clamp(44px, 6vw, 70px);
  position: relative; /* SVG anchor */
  overflow: visible;
}

/* SVG line layer */
.org-lines{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* SVG line style */
.org-line{
  stroke: rgba(0, 0, 0, 0.55);
  stroke-width: 4;        /* requested */
  stroke-linecap: round;
}

/* ================= ROWS ================= */
.org-row{
  width: min(1200px, 100%);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(14px, 3vw, 48px);
  position: relative;
  z-index: 2;
  justify-items: center;
}

/* PRESIDENT ROW — TRUE CENTER */
.row-1{
  display: flex !important;
  justify-content: center !important;
}
.row-1 .slot{ justify-content: center !important; }

/* Secretary + Exec VP row */
.row-2{
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* ================= SLOTS ================= */
.slot{ display: flex; justify-content: center; min-width: 0; }
.slot.left{ justify-content: flex-start; }
.slot.center{ justify-content: center; }
.slot.right{ justify-content: flex-end; }
.slot.col{ justify-content: center; }

/* helper for intentional empty slots (hidden on smaller screens) */
.slot-empty{ min-height: 1px; }

/* =========================================================
   OFFICER CARD (UNIFORM SIZE FOR ALL)
   - fixed photo height so image issues don't stretch card
   - fixed text block height so names don't stretch card
========================================================= */

.officer-card{
  position: relative;
  background: #fff;
  border-radius: 16px;

  width: clamp(170px, 22vw, 270px);
  max-width: 100%;

  padding: 16px;
  text-align: center;

  display: flex;
  flex-direction: column;
  align-items: center;

  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
  cursor: pointer;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  z-index: auto;
}

.officer-card:hover{
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.20);
  transform: translateY(-2px);
}

/* Photo (LOCK HEIGHT = cards always same) */
.officer-photo{
  width: 100%;
  height: 180px;
  object-fit: cover;
  object-position: center top;
  border-radius: 12px;
  background: #f0f0f0;
  display: block;
}

/* Text block (LOCK HEIGHT = cards always same) */
.officer-info{
  width: 100%;
  margin-top: 12px;
  min-height: 56px;

  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.officer-info h4{
  margin: 0;
  font-size: clamp(14px, 1.8vw, 18px);
  font-weight: 800;
  line-height: 1.2;

  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.officer-info p{
  margin: 0;
  font-size: clamp(12px, 1.6vw, 15px);
  color: rgba(0,0,0,.62);
  line-height: 1.3;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ================= OVERLAY ================= */
.modal-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0);
  pointer-events: none;
  opacity: 0;
  z-index: 5000;
  transition: opacity 0.25s ease, background 0.25s ease;
}

.modal-overlay.show{
  pointer-events: auto;
  opacity: 1;
  background: rgba(0,0,0,0.5);
}

/* ================= DETAIL MODAL ================= */
.detail-panel{
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.92);

  width: min(560px, 92vw);
  max-width: 92vw;

  background: #fff;
  border-radius: 16px;
  padding: clamp(16px, 3vw, 26px);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  opacity: 0;
  z-index: 6000;
  transition: opacity 0.22s ease, transform 0.22s ease;

  max-height: 88vh;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.detail-panel.show{
  pointer-events: auto;
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.detail-body{ text-align: center; }

.speech-photo{
  width: 100%;
  height: 240px;
  object-fit: cover;
  object-position: center;
  border-radius: 12px;
  margin-bottom: 12px;
  background: #f0f0f0;
  display: block;
}

.detail-panel h3{
  margin: 10px 0 6px;
  font-size: clamp(16px, 2.4vw, 22px);
  font-weight: 900;
}

.detail-panel .role{
  margin: 0 0 10px;
  font-weight: 800;
  color: #1f4068;
  font-size: clamp(13px, 1.8vw, 16px);
}

.detail-panel .speech{
  font-style: italic;
  color: #555;
  font-size: clamp(12px, 1.7vw, 15px);
  line-height: 1.45;
}

/* close button */
.detail-panel .close{
  position: absolute;
  top: 10px;
  right: 12px;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 0;
  background: rgba(0,0,0,.04);
  color: #ff4d4f;
  font-size: 28px;
  cursor: pointer;
  z-index: 2;
}

.detail-panel .close:hover{ transform: scale(1.06); }

/* ================= RESPONSIVE BREAKPOINTS ================= */

/* Tablet: 3 cols -> 2 cols */
@media (max-width: 1024px){
  .org-row{
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
  }
  .slot.left, .slot.right, .slot.center, .slot.col{
    justify-content: center;
  }
  .slot-empty{ display: none; }

  .officer-photo{ height: 170px; }
}

/* Phone: background gradient + remove overlap + stacked layout */
@media (max-width: 720px){
  html::before{
    content: none !important;
    background: none !important;
  }

  body{
    background: linear-gradient(
      to bottom,
      #ffffff 0%,
      #f3f7ff 32%,
      #cfe0ff 68%,
      #0f2d55 100%
    ) !important;
    background-attachment: fixed;
  }

  .officers-hero{
    margin-top: 0 !important;
    margin-bottom: 10px !important;
    padding: 52px 16px 26px !important;
  }

  .org-v2{
    padding: 18px 14px 60px !important;
    gap: 16px !important;
  }

  .org-row{
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .officer-card{
    width: min(92vw, 340px);
    padding: 14px;
    border-radius: 16px;
  }

  .officer-photo{ height: 180px; }

  /* stacked layout: lines won't match */
  .org-lines{ display: none !important; }
}

/* =========================================================
   POSITION FIX — MOVE ERWIN UP (LEFT SLOT), KEEP SAME CARD SIZE
   - Only affects the Secretary General slot in row-2
   - Does NOT change card dimensions at all
========================================================= */
.row-2 .slot.left{
  position: relative;
  top: -170px;       /* adjust if you want higher/lower */
}

/* safety: stacked layout should not offset */
@media (max-width: 1100px){
  .row-2 .slot.left{ top: 0; }
}


/* Move President up a bit */
.row-1{
  position: relative;
  top: -45px; /* tweak -25 to -45 */
}

@media (max-width: 1100px){
  .row-1{ top: 0; }
}