/**
 * CCT PAK 20 - MOBILE PERSONNEL PROFILE CARDS (OPTION 2: iOS HIG MODERN CARD)
 * Pure CSS Specificity • Zero Important Directive • Mobile Only (@media max-width: 991.98px)
 * Designed for districts.php / CountyService.php
 */

@media (max-width: 991.98px) {
  /* Toggle card view: hide desktop card, show mobile iOS card */
  .church-county-section .county-card-desktop {
    display: none;
  }

  .church-county-section .county-card-mobile {
    display: flex;
  }

  /* Compact grid gutter for iOS cards */
  .church-county-section .county-profile-grid {
    margin-top: 12px;
    margin-bottom: 24px;
    --bs-gutter-y: 12px;
    --bs-gutter-x: 12px;
  }

  /* 3. iOS Modern Profile Card (Phương án 2) */
  .church-county-section .ios-profile-card {
    background: #ffffff;
    border-radius: 18px;
    border: 0.5px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.02);
    padding: 14px;
    transition: transform 0.12s ease, background-color 0.15s ease;
    position: relative;
    overflow: hidden;
    width: 100%;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    margin: 0;
    -webkit-tap-highlight-color: transparent;
  }

  .church-county-section .ios-profile-card:active {
    transform: scale(0.988);
    background-color: #fafafc;
  }

  /* Top Section: Avatar + Content */
  .church-county-section .ios-card-top {
    display: flex;
    align-items: flex-start;
    gap: 13px;
  }

  /* Avatar Container (64px) & Squircle Clipping */
  .church-county-section .ios-avatar-box {
    position: relative;
    width: 64px;
    height: 64px;
    flex-shrink: 0;
  }

  .church-county-section .ios-avatar-box picture {
    display: block;
    width: 64px;
    height: 64px;
    border-radius: 16px;
    overflow: hidden;
  }

  .church-county-section .ios-avatar-img {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    object-fit: cover;
    display: block;
    background: #eef2f6;
    border: 1px solid rgba(0, 0, 0, 0.06);
  }

  /* Monogram Avatar */
  .church-county-section .ios-avatar-mono {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, #fdfbf7 0%, #f4ede2 100%);
    border: 1.5px solid #e8decb;
    color: #8c6a28;
    font-size: 26px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
  }

  /* Info Column */
  .church-county-section .ios-card-info {
    flex-grow: 1;
    min-width: 0;
  }

  .church-county-section .ios-card-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 3px;
  }

  .church-county-section .ios-role-tag {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    letter-spacing: 0.1px;
    line-height: 1.25;
  }

  .church-county-section .ios-role-tag.is-lead {
    background: #fef7e0;
    color: #9a6503;
    border: 0.5px solid #f9e29a;
  }

  .church-county-section .ios-role-tag.is-member {
    background: #f4f4f8;
    color: #48484a;
    border: 0.5px solid #e2e2ea;
  }

  .church-county-section .ios-tenure-text {
    font-size: 10.5px;
    color: #a1a1aa;
    font-weight: 500;
    letter-spacing: -0.1px;
    white-space: nowrap;
  }

  .church-county-section .ios-person-name {
    font-size: 17px;
    font-weight: 800;
    color: #14161a;
    line-height: 1.28;
    letter-spacing: -0.2px;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* ชื่อภาษาม้ง — 13px สีทองเข้ม #a16207 (yellow-700)
     การ์ดมือถือพื้นขาวล้วน: ทองอ่อน #fbbf24 บนขาวให้คอนทราสต์เพียง ~1.9:1 (อ่านไม่ออก)
     ต้องใช้โทนเข้มขึ้นเป็น #a16207 → ~4.9:1 ผ่านเกณฑ์ AA ที่ขนาด 13px/600
     ยังคงเป็น «สีทอง» ตามที่ต้องการ แต่ไม่จ้าจนแสบตา */
  .church-county-section .ios-person-hmong {
    font-size: 13px;
    font-weight: 600;
    color: #a16207;
    line-height: 1.32;
    letter-spacing: 0.002em;
    margin-bottom: 4px;
  }

  .church-county-section .ios-affiliation {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12.5px;
    color: #64748b;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .church-county-section .ios-affiliation i,
  .church-county-section .ios-affiliation svg {
    font-size: 13px;
    color: #94a3b8;
    flex-shrink: 0;
  }

  /* Divider Inset */
  .church-county-section .ios-card-divider {
    height: 0.5px;
    background: rgba(60, 60, 67, 0.12);
    margin: 11px 0 10px;
  }

  /* Bottom Section: Quick Action Dock */
  .church-county-section .ios-card-dock {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
  }

  /* Primary Call Pill Button */
  .church-county-section .ios-call-btn {
    flex-grow: 1;
    height: 38px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: opacity 0.15s ease, background-color 0.15s ease;
    box-sizing: border-box;
    min-width: 0;
  }

  .church-county-section .ios-call-btn:active {
    opacity: 0.82;
  }

  .church-county-section .ios-call-btn.is-direct,
  .church-county-section .ios-call-btn.is-direct:visited,
  .church-county-section .ios-call-btn.is-direct:hover,
  .church-county-section .ios-call-btn.is-direct:focus {
    background: #eafbf0;
    border: 0.5px solid #b8f2c8;
    color: #178338;
  }

  .church-county-section .ios-call-btn.is-office,
  .church-county-section .ios-call-btn.is-office:visited,
  .church-county-section .ios-call-btn.is-office:hover,
  .church-county-section .ios-call-btn.is-office:focus {
    background: #f4f4f8;
    border: 0.5px solid #e2e2ea;
    color: #48484a;
  }

  .church-county-section .ios-call-btn i,
  .church-county-section .ios-call-btn svg {
    font-size: 15px;
    flex-shrink: 0;
  }

  .church-county-section .ios-call-btn span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Secondary Social Circle Buttons */
  .church-county-section .ios-icon-circle-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    flex-shrink: 0;
    font-size: 17px;
    border: 0.5px solid transparent;
    transition: opacity 0.15s ease;
  }

  .church-county-section .ios-icon-circle-btn:active {
    opacity: 0.75;
  }

  .church-county-section .ios-btn-line,
  .church-county-section .ios-btn-line:visited,
  .church-county-section .ios-btn-line:hover,
  .church-county-section .ios-btn-line:focus {
    background: #06c755;
    color: #ffffff;
  }

  .church-county-section .ios-btn-fb,
  .church-county-section .ios-btn-fb:visited,
  .church-county-section .ios-btn-fb:hover,
  .church-county-section .ios-btn-fb:focus {
    background: #1877f2;
    color: #ffffff;
  }

  .church-county-section .ios-btn-email,
  .church-county-section .ios-btn-email:visited,
  .church-county-section .ios-btn-email:hover,
  .church-county-section .ios-btn-email:focus {
    background: #e2e8f0;
    color: #334155;
  }

  .church-county-section .ios-btn-yt,
  .church-county-section .ios-btn-yt:visited,
  .church-county-section .ios-btn-yt:hover,
  .church-county-section .ios-btn-yt:focus {
    background: #ff0000;
    color: #ffffff;
  }

  /* Vacant State */
  .church-county-section .ios-profile-card.is-vacant {
    background: #fafafa;
    border-style: dashed;
    border-color: #cbd5e1;
    box-shadow: none;
  }

  .church-county-section .ios-profile-card.is-vacant .ios-person-name {
    color: #94a3b8;
    font-weight: 600;
    font-style: italic;
  }

  .church-county-section .ios-profile-card.is-vacant .ios-avatar-img {
    opacity: 0.65;
    filter: grayscale(1);
  }
}
