/* ============================================================
   PSU EDS Design System — psu-design.css
   มหาวิทยาลัยสงขลานครินทร์ วิทยาเขตตรัง
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@300;400;500;600;700&family=Inter:wght@400;500;600&display=swap');

:root {
    --psu-navy:       #003C71;
    --psu-navy-dark:  #002a52;
    --psu-navy-light: #004e96;
    --bg-page:        #f0f4f8;
    --bg-card:        #ffffff;
    --text-primary:   #1a2640;
    --text-secondary: #5a6a7e;
    --border-light:   #dde4ee;
    --shadow-sm:      0 2px 8px rgba(0,60,113,0.08);
    --shadow-md:      0 6px 24px rgba(0,60,113,0.13);
    --shadow-hover:   0 12px 32px rgba(0,60,113,0.18);
    --radius-card:    14px;
    --radius-badge:   50px;
}

* { box-sizing: border-box; }

body {
    font-family: 'Sarabun', 'Inter', sans-serif;
    background-color: var(--bg-page);
    color: var(--text-primary);
    min-height: 100vh;
}

/* PAGE WRAPPER */
.page-wrapper { max-width: 1000px; margin: 0 auto; padding: 2rem 1rem 4rem; }

/* HEADER */
.header-section {
    background: #fff;
    border-radius: var(--radius-card);
    padding: 1.75rem 2rem;
    margin-bottom: 2.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    border-top: 4px solid var(--psu-navy);
    position: relative;
    overflow: hidden;
}
.header-section::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 220px; height: 100%;
    background: linear-gradient(135deg, transparent 0%, rgba(0,60,113,0.03) 100%);
    pointer-events: none;
}
.header-logo {
    width: 82px; height: 82px;
    background: #f0f4f8;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    padding: 12px;
    border: 2px solid var(--border-light);
    flex-shrink: 0;
}
.header-logo img { max-width: 58px; }
.header-info { padding-left: 1.5rem; position: relative; z-index: 1; }
.header-title { font-size: 1.4rem; font-weight: 700; color: var(--psu-navy); margin-bottom: 0.2rem; line-height: 1.3; }
.header-title-en { font-size: 0.88rem; font-weight: 500; color: var(--text-secondary); letter-spacing: 0.3px; margin-bottom: 0.4rem; }
.header-sub { font-size: 0.85rem; color: var(--text-secondary); margin: 0; }
.header-divider { width: 36px; height: 3px; background: var(--psu-navy); border-radius: 2px; margin: 0.45rem 0 0.55rem; }

/* SECTION TITLE */
.section-title {
    font-size: 1.1rem; font-weight: 700;
    color: var(--psu-navy);
    margin-bottom: 1.25rem;
    display: flex; align-items: center; gap: 0.6rem;
}
.section-title::before {
    content: '';
    display: inline-block;
    width: 5px; height: 22px;
    background: var(--psu-navy);
    border-radius: 3px; flex-shrink: 0;
}

/* PROFILE CARD */
.profile-card {
    background: var(--bg-card);
    border-radius: var(--radius-card);
    border: 1px solid var(--border-light);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
    position: relative; overflow: hidden;
}
.profile-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0; width: 4px;
    background: var(--psu-navy);
    border-radius: var(--radius-card) 0 0 var(--radius-card);
    opacity: 0; transition: opacity 0.22s ease;
}
.profile-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: rgba(0,60,113,0.25); }
.profile-card:hover::before { opacity: 1; }
.profile-card.card-head { border-top: 3px solid var(--psu-navy); }

/* PHOTO */
.profile-photo-wrap {
    width: 100px; height: 120px;
    border-radius: 12px; overflow: hidden;
    border: 2px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    flex-shrink: 0; background: #f5f7fa;
    transition: border-color 0.22s ease, box-shadow 0.22s ease;
}
.profile-card:hover .profile-photo-wrap { border-color: var(--psu-navy); box-shadow: 0 4px 14px rgba(0,60,113,0.18); }
.profile-photo-wrap img { width: 100%; height: 100%; object-fit: contain; object-position: top center; }

/* NAME */
.profile-name { font-size: 1.1rem; font-weight: 700; color: var(--psu-navy); text-decoration: none !important; display: inline-block; margin-bottom: 0.1rem; transition: color 0.15s; }
.profile-name:hover { color: var(--psu-navy-light); text-decoration: none !important; }
.profile-name-en { font-size: 0.82rem; color: var(--text-secondary); font-weight: 400; margin-bottom: 0.6rem; }

/* BADGES */
.badge-role { display: inline-flex; align-items: center; gap: 5px; font-size: 0.78rem; font-weight: 600; padding: 4px 13px; border-radius: var(--radius-badge); }
.badge-head  { background: linear-gradient(90deg, var(--psu-navy), var(--psu-navy-light)); color: #fff; }
.badge-staff { background: #eef2f8; color: var(--psu-navy); border: 1px solid #c8d4e8; }
.badge-leave { background: #fff0f0; color: #c0392b; border: 1px solid #f5c6c6; margin-left: 6px; }

/* CONTACT */
.contact-info { margin: 0.75rem 0; }
.contact-row { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.4rem; font-size: 0.88rem; color: var(--text-primary); }
.contact-icon { width: 28px; height: 28px; background: #eef2f8; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 0.75rem; color: var(--psu-navy); }
.contact-label { font-weight: 600; color: var(--text-secondary); white-space: nowrap; font-size: 0.82rem; min-width: 60px; }
.contact-value { color: var(--text-primary); word-break: break-word; }

/* BUTTONS */
.btn-action-group { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.75rem; }
.btn-modern { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; font-weight: 600; padding: 0.4rem 0.9rem; border-radius: 50px; text-decoration: none !important; transition: all 0.18s ease; border: none; cursor: pointer; font-family: 'Sarabun', sans-serif; }
.btn-modern-primary { background: linear-gradient(90deg, var(--psu-navy), var(--psu-navy-light)); color: #fff; box-shadow: 0 2px 8px rgba(0,60,113,0.25); }
.btn-modern-primary:hover { background: linear-gradient(90deg, var(--psu-navy-dark), var(--psu-navy)); box-shadow: 0 4px 14px rgba(0,60,113,0.35); color: #fff; transform: translateY(-1px); }
.btn-modern-outline { background: #fff; color: var(--psu-navy); border: 1.5px solid var(--psu-navy); }
.btn-modern-outline:hover { background: var(--psu-navy); color: #fff; transform: translateY(-1px); }
.btn-modern-secondary { background: linear-gradient(90deg, var(--psu-navy-light), #0062b8); color: #fff; box-shadow: 0 2px 8px rgba(0,60,113,0.2); }
.btn-modern-secondary:hover { background: linear-gradient(90deg, var(--psu-navy), var(--psu-navy-light)); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,60,113,0.32); }

/* CARD LAYOUT */
.card-inner { display: flex; align-items: flex-start; gap: 1.25rem; }
.card-left { text-align: center; }
.card-middle { flex: 1; min-width: 0; }
.card-right { min-width: 240px; max-width: 300px; }
.card-divider { width: 1px; background: var(--border-light); align-self: stretch; flex-shrink: 0; }

/* RESPONSIVE ≤767px */
@media (max-width: 767px) {
    .page-wrapper { padding: 1rem 0.75rem 3rem; }
    .header-section { flex-direction: column !important; align-items: flex-start !important; padding: 1.25rem; gap: 1rem; }
    .header-logo { width: 64px; height: 64px; }
    .header-logo img { max-width: 44px; }
    .header-info { padding-left: 0; }
    .header-title { font-size: 1.1rem; }
    .header-title-en { font-size: 0.8rem; }
    .header-sub { font-size: 0.8rem; }
    .section-title { font-size: 1rem; }
    .profile-card { padding: 1.1rem; }
    .card-inner { flex-direction: column; gap: 0.85rem; }
    .card-left { display: flex; justify-content: center; width: 100%; }
    .profile-photo-wrap { width: 50%; max-width: 180px; height: auto; aspect-ratio: 3/4; flex-shrink: 0; }
    .card-divider { display: none; }
    .card-right { min-width: 0; width: 100%; }
    .btn-action-group { flex-direction: row; }
    .btn-modern { flex: 1; justify-content: center; font-size: 0.78rem; padding: 0.45rem 0.5rem; }
    .contact-row { font-size: 0.83rem; }
    .contact-label { min-width: 52px; }
}

/* RESPONSIVE ≤480px */
@media (max-width: 480px) {
    .header-section { border-radius: 10px; padding: 1rem; }
    .header-title { font-size: 1rem; }
    .header-title-en { display: none; }
    .profile-card { border-radius: 10px; }
    .profile-photo-wrap { width: 55%; max-width: 160px; height: auto; aspect-ratio: 3/4; }
    .profile-name { font-size: 0.98rem; }
    .profile-name-en { font-size: 0.76rem; }
    .badge-role { font-size: 0.72rem; padding: 3px 10px; }
    .contact-icon { width: 24px; height: 24px; font-size: 0.68rem; }
    .contact-value { font-size: 0.8rem; }
    .btn-modern { font-size: 0.74rem; padding: 0.4rem 0.4rem; }
}
