/* ========================================
   PROFIL KABUPATEN SOPPENG
======================================== */

.profile-page {
    --profile-green: #17463c;
    --profile-green-light: #28745b;
    --profile-gold: #d8b56d;
    --profile-text: #26372f;
    --profile-muted: #64736b;
    --profile-border: #e4ebe6;

    background: #f5f7f5;
    color: var(--profile-text);
    min-height: 70vh;
    padding-bottom: 64px;
    overflow: hidden;
}

.profile-container {
    width: min(1120px, calc(100% - 40px));
    margin-inline: auto;
}

/* ========================================
   PROFILE HERO - IMAGE + WAVE MASK
======================================== */

.profile-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: 90px 0 120px;
    color: #fff;

    background-image: linear-gradient(
            90deg,
            rgba(8, 32, 25, 0.78) 0%,
            rgba(8, 32, 25, 0.58) 48%,
            rgba(8, 32, 25, 0.3) 100%
        ),
        url("/images/profil-hero-bg.png");

    background-size: cover;
    background-position: center 42%;
    background-repeat: no-repeat;
}

/* Gelombang putih di dasar hero */
.profile-hero::after {
    content: "";
    position: absolute;
    z-index: 2;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 58px;
    pointer-events: none;

    background-repeat: no-repeat;
    background-position: center bottom;
    background-size: 100% 100%;

    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 90' preserveAspectRatio='none'%3E%3Cpath fill='%23f5f7f5' d='M0 34 C100 76 170 50 260 42 S390 72 500 48 S650 65 760 42 S910 74 1030 48 S1210 28 1320 50 S1400 62 1440 36 L1440 90 L0 90 Z'/%3E%3C/svg%3E");
}

.profile-hero .profile-container {
    position: relative;
    z-index: 1;
}

.profile-hero h1 {
    max-width: 850px;
    margin: 0 0 14px;
    color: #fff;
    font-size: clamp(32px, 5vw, 54px);
    font-weight: 800;
    letter-spacing: -0.8px;
    line-height: 1.15;
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.18);
}

.profile-hero p {
    max-width: 740px;
    margin: 12px 0 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    line-height: 1.9;
}

.profile-hero .profile-motto {
    display: inline-block;
    margin-top: 4px;
    padding: 8px 15px;
    border: 1px solid rgba(240, 214, 156, 0.4);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.1);
    color: #f5dca5;
    font-size: 15px;
    font-weight: 700;
}

@media (max-width: 768px) {
    .profile-hero {
        padding: 65px 0 100px;
        background-position: 58% center;
    }

    .profile-hero::after {
        height: 38px;
    }
}

@media (max-width: 480px) {
    .profile-hero {
        padding: 48px 0 88px;
        background-position: 60% center;
    }

    .profile-hero h1 {
        font-size: 30px;
    }

    .profile-hero p {
        font-size: 14px;
    }

    .profile-hero::after {
        height: 28px;
    }
}

.profile-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    color: #f0d69c;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 2.5px;
    text-transform: uppercase;
}

.profile-eyebrow::before {
    content: "";
    width: 28px;
    height: 2px;
    background: var(--profile-gold);
}

.profile-hero h1 {
    max-width: 850px;
    margin: 0 0 14px;
    color: #fff;
    font-size: clamp(32px, 5vw, 54px);
    font-weight: 800;
    letter-spacing: -0.8px;
    line-height: 1.15;
}

.profile-hero p {
    max-width: 700px;
    margin: 12px 0 0;
    color: rgba(255, 255, 255, 0.83);
    font-size: 16px;
    line-height: 1.9;
}

.profile-hero .profile-motto {
    display: inline-block;
    margin-top: 4px;
    padding: 8px 15px;
    border: 1px solid rgba(240, 214, 156, 0.35);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.07);
    color: #f5dca5;
    font-size: 15px;
    font-weight: 700;
}

/* CONTENT */

.profile-content {
    position: relative;
    padding-top: 42px;
}

.profile-logo {
    display: flex;
    justify-content: center;
    margin: -5px 0 32px;
}

.profile-logo img {
    display: block;
    width: 145px;
    height: 145px;
    padding: 14px;
    object-fit: contain;
    border: 1px solid var(--profile-border);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 12px 35px rgba(23, 70, 60, 0.09);
}

/* CARDS */

.profile-card {
    position: relative;
    margin-bottom: 24px;
    padding: 30px 34px;
    overflow-wrap: anywhere;
    border: 1px solid var(--profile-border);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 6px 22px rgba(23, 70, 60, 0.035);
    transition: box-shadow 0.25s ease, border-color 0.25s ease,
        transform 0.25s ease;
}

.profile-card:hover {
    border-color: #cbdcd1;
    box-shadow: 0 12px 30px rgba(23, 70, 60, 0.07);
}

.profile-card h2 {
    display: flex;
    align-items: center;
    gap: 13px;
    margin: 0 0 20px;
    color: var(--profile-green);
    font-size: 23px;
    font-weight: 800;
    line-height: 1.4;
}

.profile-card h2::before {
    content: "";
    flex: 0 0 4px;
    width: 4px;
    height: 27px;
    border-radius: 5px;
    background: var(--profile-gold);
}

.profile-card p {
    margin: 0;
    color: #526259;
    font-size: 15px;
    line-height: 1.95;
    white-space: pre-line;
}

/* DETAIL INFORMASI */

.profile-detail {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    padding: 16px 0;
    border-top: 1px solid #edf1ed;
    font-size: 14px;
    line-height: 1.8;
}

.profile-detail:first-of-type {
    margin-top: 8px;
}

.profile-detail strong {
    flex: 0 0 180px;
    color: var(--profile-green);
    font-weight: 700;
}

.profile-detail span,
.profile-detail p,
.profile-detail a {
    min-width: 0;
    margin: 0;
    color: var(--profile-muted);
    overflow-wrap: anywhere;
}

.profile-detail a {
    color: var(--profile-green-light);
    text-decoration: none;
    font-weight: 600;
}

.profile-detail a:hover {
    color: var(--profile-green);
    text-decoration: underline;
}

/* VISI DAN MISI */

.profile-card:has(h2) {
    scroll-margin-top: 100px;
}

/* RESPONSIVE TABLET */

@media (max-width: 768px) {
    .profile-hero {
        padding: 58px 0 65px;
    }

    .profile-hero h1 {
        font-size: clamp(30px, 7vw, 42px);
    }

    .profile-hero p {
        font-size: 15px;
    }

    .profile-content {
        padding-top: 30px;
    }

    .profile-card {
        padding: 25px;
        border-radius: 13px;
    }

    .profile-card h2 {
        font-size: 21px;
    }

    .profile-detail strong {
        flex-basis: 145px;
    }
}

/* RESPONSIVE MOBILE */

@media (max-width: 480px) {
    .profile-container {
        width: calc(100% - 30px);
    }

    .profile-hero {
        padding: 46px 0 52px;
    }

    .profile-eyebrow {
        font-size: 10px;
        letter-spacing: 2px;
    }

    .profile-hero h1 {
        font-size: 30px;
        letter-spacing: -0.4px;
    }

    .profile-hero p {
        font-size: 14px;
        line-height: 1.8;
    }

    .profile-content {
        padding-top: 24px;
    }

    .profile-logo img {
        width: 120px;
        height: 120px;
        border-radius: 18px;
    }

    .profile-card {
        margin-bottom: 16px;
        padding: 21px 18px;
        border-radius: 12px;
    }

    .profile-card h2 {
        gap: 10px;
        margin-bottom: 15px;
        font-size: 19px;
    }

    .profile-card h2::before {
        height: 23px;
    }

    .profile-card p {
        font-size: 14px;
        line-height: 1.85;
    }

    .profile-detail {
        display: block;
        padding: 13px 0;
        font-size: 13px;
    }

    .profile-detail strong {
        display: block;
        margin-bottom: 4px;
    }
}

/* AKSESIBILITAS GERAK */

@media (prefers-reduced-motion: reduce) {
    .profile-card {
        transition: none;
    }
}

/* ========================================
   DAFTAR MISI PEMBANGUNAN
======================================== */

.profile-mission-card {
    padding: 34px;
}

.profile-section-label {
    margin-bottom: 10px;
    color: #b18b43;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 2px;
}

.profile-mission-card h2 {
    margin-bottom: 10px;
}

.profile-mission-card .profile-intro {
    margin-bottom: 24px;
    color: #718078;
    font-size: 14px;
}

.profile-mission-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.profile-mission-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    min-width: 0;
    padding: 21px;
    border: 1px solid #e4ebe6;
    border-radius: 12px;
    background: #fbfcfb;
    transition: border-color 0.2s ease, box-shadow 0.2s ease,
        transform 0.2s ease;
}

.profile-mission-item:hover {
    border-color: #b8d2c2;
    box-shadow: 0 7px 20px rgba(23, 70, 60, 0.07);
    transform: translateY(-2px);
}

.profile-mission-number {
    display: flex;
    flex: 0 0 42px;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: #e8f2eb;
    color: #17463c;
    font-size: 14px;
    font-weight: 800;
}

.profile-mission-item p {
    margin: 2px 0 0;
    color: #43554b;
    font-size: 14px;
    line-height: 1.85;
    white-space: normal;
}

@media (max-width: 768px) {
    .profile-mission-list {
        grid-template-columns: 1fr;
    }

    .profile-mission-card {
        padding: 25px;
    }
}

@media (max-width: 480px) {
    .profile-mission-card {
        padding: 21px 18px;
    }

    .profile-mission-item {
        gap: 12px;
        padding: 16px;
    }

    .profile-mission-number {
        flex-basis: 36px;
        width: 36px;
        height: 36px;
        font-size: 12px;
    }
}

/* ========================================
   PIMPINAN DAERAH
======================================== */

.leadership-content {
    padding-top: 42px;
}

.leadership-heading {
    margin-bottom: 28px;
    text-align: center;
}

.leadership-label {
    color: #b18b43;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 2px;
}

.leadership-heading h2 {
    margin: 10px 0;
    color: #17463c;
    font-size: clamp(25px, 4vw, 34px);
    font-weight: 800;
}

.leadership-heading p {
    margin: 0;
    color: #64736b;
    line-height: 1.8;
}

.leadership-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 26px;
    max-width: 900px;
    margin: 0 auto;
}

.leadership-card {
    overflow: hidden;
    border: 1px solid #e4ebe6;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 28px rgba(23, 70, 60, 0.06);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.leadership-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 34px rgba(23, 70, 60, 0.12);
}

.leadership-photo {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 320px;
    padding: 24px;
    background: linear-gradient(145deg, #e5eee8, #f5f7f5);
}

.leadership-photo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 210px;
    height: 250px;
    border: 1px dashed #9ab4a3;
    border-radius: 12px;
    color: #557363;
    background: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}

.leadership-info {
    padding: 25px;
    text-align: center;
}

.leadership-position {
    display: inline-block;
    margin-bottom: 10px;
    color: #b18b43;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.5px;
}

.leadership-info h3 {
    margin: 0 0 10px;
    color: #17463c;
    font-size: 23px;
    font-weight: 800;
}

.leadership-info p {
    margin: 0;
    color: #64736b;
    font-size: 14px;
    line-height: 1.8;
}

@media (max-width: 650px) {
    .leadership-content {
        padding-top: 28px;
    }

    .leadership-grid {
        grid-template-columns: 1fr;
        max-width: 420px;
        gap: 20px;
    }

    .leadership-photo {
        min-height: 280px;
    }

    .leadership-photo-placeholder {
        height: 230px;
    }

    .leadership-info {
        padding: 22px 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .leadership-card {
        transition: none;
    }
}

.leadership-image {
    display: block;
    width: 210px;
    height: 280px;
    object-fit: cover;
    object-position: center top;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(23, 70, 60, 0.12);
}

.leadership-history-links {
    max-width: 900px;
    margin: 42px auto 0;
    padding: 28px;
    border: 1px solid #e4ebe6;
    border-radius: 14px;
    background: #fff;
}

.leadership-history-links h2 {
    margin: 0 0 8px;
    color: #17463c;
}

.leadership-history-links p {
    color: #64736b;
    line-height: 1.7;
}

.leadership-history-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

.leadership-history-actions a {
    display: inline-flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: 8px;
    background: #17463c;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.leadership-history-actions a:hover {
    background: #28745b;
}

@media (max-width: 480px) {
    .leadership-image {
        width: 190px;
        height: 250px;
    }

    .leadership-history-links {
        padding: 20px;
    }
}

/* Tombol riwayat */
.leadership-history-btn {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-width: 190px;
    padding: 13px 17px;
    border: 1px solid #17463c;
    border-radius: 9px;
    background: #17463c;
    color: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.leadership-history-btn:hover {
    background: #28745b;
    transform: translateY(-1px);
}

/* Popup */
.leadership-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.leadership-modal.is-open {
    display: flex;
}

.leadership-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(9, 28, 22, 0.72);
    backdrop-filter: blur(4px);
}

.leadership-modal-dialog {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(760px, 100%);
    max-height: 85vh;
    overflow: hidden;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
    animation: leadership-modal-enter 0.2s ease-out;
}

.leadership-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 23px 26px;
    border-bottom: 1px solid #e5ebe7;
}

.leadership-modal-header h2 {
    margin: 7px 0 0;
    color: #17463c;
    font-size: 22px;
}

.leadership-modal-close {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border: 0;
    border-radius: 10px;
    background: #f0f4f1;
    color: #17463c;
    font-size: 28px;
    cursor: pointer;
}

.leadership-modal-body {
    padding: 20px 26px;
    overflow-y: auto;
}

.leadership-history-item {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    padding: 18px 0;
    border-bottom: 1px solid #e8eee9;
}

.leadership-history-image {
    width: 82px;
    height: 104px;
    flex-shrink: 0;
    object-fit: cover;
    object-position: center top;
    border-radius: 9px;
    background: #edf2ee;
}

.leadership-history-info h3 {
    margin: 0 0 7px;
    color: #17463c;
    font-size: 17px;
}

.leadership-history-info p {
    margin: 6px 0 0;
    color: #64736b;
    font-size: 13px;
    line-height: 1.7;
}

.leadership-history-info .leadership-history-period {
    color: #a27a32;
    font-weight: 700;
}

.leadership-modal-loading,
.leadership-modal-empty {
    padding: 28px 0;
    color: #64736b;
    text-align: center;
}

body.leadership-modal-open {
    overflow: hidden;
}

@keyframes leadership-modal-enter {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 520px) {
    .leadership-modal {
        padding: 10px;
    }

    .leadership-modal-dialog {
        max-height: 90vh;
        border-radius: 14px;
    }

    .leadership-modal-header {
        padding: 19px;
    }

    .leadership-modal-header h2 {
        font-size: 19px;
    }

    .leadership-modal-body {
        padding: 12px 19px;
    }

    .leadership-history-item {
        gap: 13px;
    }

    .leadership-history-image {
        width: 68px;
        height: 88px;
    }

    .leadership-history-info h3 {
        font-size: 15px;
    }

    .leadership-history-actions {
        flex-direction: column;
    }

    .leadership-history-btn {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .leadership-modal-dialog {
        animation: none;
    }
}

.leadership-profile-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 14px;
    padding: 11px 18px;
    border: 0;
    border-radius: 8px;
    background: #176b46;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.leadership-profile-btn:hover {
    background: #105236;
}

.leadership-profile-dialog {
    width: min(760px, calc(100% - 28px));
    max-height: 88vh;
    overflow-y: auto;
}

.leadership-profile-content {
    display: flex;
    align-items: flex-start;
    gap: 22px;
    margin-bottom: 24px;
}

.leadership-profile-photo {
    width: 150px;
    height: 190px;
    flex-shrink: 0;
    object-fit: cover;
    border-radius: 12px;
}

.leadership-profile-info h3 {
    margin: 8px 0;
    font-size: 1.45rem;
}

.leadership-profile-position {
    color: #176b46;
    font-weight: 700;
}

.leadership-profile-section {
    padding: 16px 0;
    border-top: 1px solid #e5e7eb;
}

.leadership-profile-section h3 {
    margin: 0 0 8px;
    font-size: 1rem;
    color: #176b46;
}

.leadership-profile-section p {
    margin: 0;
    line-height: 1.8;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

@media (max-width: 560px) {
    .leadership-profile-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .leadership-profile-photo {
        width: 135px;
        height: 170px;
    }

    .leadership-profile-dialog {
        max-height: 92vh;
    }
}

.leadership-profile-list {
    margin: 0;
    padding-left: 28px;
    display: grid;
    gap: 10px;
}

.leadership-profile-list li {
    padding-left: 5px;
    line-height: 1.7;
    color: #374151;
}

.leadership-profile-list li::marker {
    color: #176b46;
    font-weight: 700;
}

/* ========================================
   HERO LAMBANG DAERAH
   ======================================== */

.lambang-page {
    padding: 0 0 70px;
    overflow: hidden;
}

.lambang-daerah-hero {
    width: 100%;
    max-width: none;
    margin: 0 0 30px;
    box-sizing: border-box;
    text-align: center;
}

.lambang-daerah-hero .profile-container {
    width: min(1120px, calc(100% - 40px));
    margin-inline: auto;
}

.lambang-daerah-hero .profile-container > p {
    max-width: 700px;
    margin: 12px auto 0;
}

.lambang-daerah-hero-logo {
    display: flex;
    justify-content: center;
    margin: 28px auto 0;
}

.lambang-daerah-hero-logo img {
    display: block;
    width: 190px;
    max-width: 75%;
    max-height: 240px;
    object-fit: contain;
}

/* Konten sejarah tetap rapi dan terpusat */
.lambang-container {
    width: min(1000px, calc(100% - 40px));
    margin-inline: auto;
}

@media (max-width: 600px) {
    .lambang-page {
        padding-bottom: 45px;
    }

    .lambang-daerah-hero {
        margin-bottom: 22px;
    }

    .lambang-daerah-hero .profile-container {
        width: calc(100% - 30px);
    }

    .lambang-daerah-hero-logo {
        margin-top: 22px;
    }

    .lambang-daerah-hero-logo img {
        width: 150px;
        max-height: 190px;
    }

    .lambang-container {
        width: calc(100% - 30px);
    }
}
