/* =====================================================================
   SONGKHLA FC — TEAM & CLUB PAGES
   ส่วนขยายของระบบดีไซน์ "SOUTHERN STEEL" (ดู app.css สำหรับโทเคน/พื้นฐาน)
   ใช้กับ: team/index, team/management, club/history, club/stadium, club/trophy
   ===================================================================== */

/* ---------------------------------------------------------------------
   0. SHARED
   --------------------------------------------------------------------- */
.squad-grid .empty-state,
.staff-grid .empty-state,
.exec-grid .empty-state,
.honours-grid .empty-state { grid-column: 1 / -1; }

/* =======================================================================
   1. TEAM — ผู้เล่น (squad)
   ======================================================================= */
.pos-group { margin-bottom: var(--sp-8); }
.pos-group:last-child { margin-bottom: 0; }

.pos-head {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    margin-bottom: var(--sp-5);
}
.pos-head__blade {
    flex-shrink: 0;
    width: 13px;
    height: 13px;
    background: var(--red);
    clip-path: polygon(32% 0, 100% 0, 68% 100%, 0 100%);
}
.pos-head__label { color: var(--ink-900); white-space: nowrap; }
.pos-head__rule { flex: 1; height: 1px; background: rgba(10, 10, 12, .14); }
.pos-head__count { font-size: 1.375rem; color: var(--ink-300); line-height: 1; }

.squad-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--sp-5);
}

.squad-card { position: relative; transition: transform .4s var(--ease-out); }
.squad-card:hover { transform: translateY(-4px); }

.squad-card__frame {
    position: relative;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: linear-gradient(160deg, var(--ink-700) 0%, var(--ink-900) 100%);
    border-radius: var(--radius);
    transition: box-shadow .4s var(--ease-out);
}
.squad-card:hover .squad-card__frame { box-shadow: var(--shadow-lift); }

.squad-card__img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .6s var(--ease-out);
}
.squad-card:hover .squad-card__img { transform: scale(1.07); }

.squad-card__placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.squad-card__placeholder img { width: 48%; opacity: .14; filter: grayscale(1) brightness(6); }

.squad-card__scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(10, 10, 12, 0) 40%, rgba(10, 10, 12, .93) 100%);
    pointer-events: none;
}

/* เบอร์เสื้อยักษ์ — เลือดออกขอบการ์ด */
.squad-card__number {
    position: absolute;
    right: -.05em;
    bottom: -.06em;
    z-index: 2;
    font-size: clamp(4.25rem, 11vw, 7.25rem);
    line-height: .78;
    color: rgba(245, 242, 237, .92);
    text-shadow: 0 8px 26px rgba(10, 10, 12, .6);
    transition: color .3s var(--ease);
    pointer-events: none;
}
.squad-card:hover .squad-card__number { color: var(--red-hot); }

/* ใบมีดแดงกวาดตอน hover */
.squad-card__frame::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 3px;
    background: var(--red);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .45s var(--ease-out);
    z-index: 3;
}
.squad-card:hover .squad-card__frame::after { transform: scaleX(1); }

.squad-card__meta { padding: var(--sp-3) var(--sp-1) 0; position: relative; z-index: 2; }
.squad-card__name {
    font-size: 1.0625rem;
    font-weight: 600;
    letter-spacing: 0;
    color: var(--ink-900);
}
.squad-card__sub {
    margin-top: 4px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px 6px;
    color: var(--ink-400);
    min-width: 0;
}
/* flex item ปริยายเป็น min-width:auto จึงหดต่ำกว่าความกว้างของคำไม่ได้
   ชื่ออังกฤษยาว ๆ เลยดันการ์ดจนหน้าจอ 375px เลื่อนแนวนอนได้ 9px */
.squad-card__sub > span {
    min-width: 0;
    overflow-wrap: anywhere;
}
.squad-card__dot { opacity: .5; }

/* ---------- Coaches (contrasting band) ---------- */
.staff-band .section-title::after { background: var(--red); }
.staff-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: var(--sp-5);
}
.staff-card { position: relative; }
.staff-card__frame {
    position: relative;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: linear-gradient(160deg, var(--ink-700) 0%, var(--ink-900) 100%);
    border: 1px solid rgba(255, 255, 255, .08);
    transition: border-color .3s;
}
.staff-card:hover .staff-card__frame { border-color: var(--red); }
.staff-card__frame img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s var(--ease-out); }
.staff-card:hover .staff-card__frame img { transform: scale(1.06); }
.staff-card__placeholder {
    width: 100%; height: 100%;
    object-fit: contain !important;
    padding: 22%;
    opacity: .15;
    filter: grayscale(1) brightness(6);
}
.staff-card__frame::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 3px;
    background: var(--red);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .4s var(--ease-out);
}
.staff-card:hover .staff-card__frame::after { transform: scaleX(1); }
.staff-card__meta { padding: var(--sp-3) 0 0; }
.staff-card__meta h3 { color: var(--paper-2); font-size: 1rem; font-weight: 600; }
.staff-card__role { display: inline-block; margin-top: 6px; color: var(--red-hot); }

/* =======================================================================
   2. TEAM — ผู้บริหาร (management)
   ======================================================================= */
.exec-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: var(--sp-6);
}
.exec-card {
    border-top: 2px solid rgba(10, 10, 12, .14);
    padding-top: var(--sp-4);
    transition: border-color .3s;
}
.exec-card:hover { border-top-color: var(--red); }
.exec-card__frame {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: linear-gradient(160deg, var(--ink-700) 0%, var(--ink-900) 100%);
    border-radius: var(--radius);
    margin-bottom: var(--sp-3);
}
.exec-card__frame img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s var(--ease-out); }
.exec-card:hover .exec-card__frame img { transform: scale(1.05); }
.exec-card__placeholder {
    width: 100%; height: 100%;
    object-fit: contain !important;
    padding: 24%;
    opacity: .16;
    filter: grayscale(1) brightness(3);
}
.exec-card__meta h3 { font-size: 1rem; font-weight: 600; color: var(--ink-900); }
.exec-card__role {
    display: inline-block;
    margin-top: 6px;
    color: var(--red);
    font-size: var(--fs-sm);
}

.exec-card.is-lead {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: var(--sp-7);
    align-items: center;
    border-top: 0;
    border-bottom: 2px solid var(--red);
    padding: 0 0 var(--sp-6);
    margin-bottom: var(--sp-2);
}
.exec-card.is-lead .exec-card__frame { margin-bottom: 0; }
.exec-card.is-lead .exec-card__meta h3 { font-size: var(--fs-h2); }
.exec-card.is-lead .exec-card__role {
    font-family: var(--font-head);
    font-size: var(--fs-sm);
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}

/* =======================================================================
   3. CLUB — ประวัติความเป็นมา (history)
   ======================================================================= */
.history-lede__inner { max-width: 760px; }
.history-lede__text p { margin-bottom: var(--sp-4); color: var(--ink-700); }
.history-lede__text p:last-child { margin-bottom: 0; }

/* full-bleed editorial band — wallpaper.jpg */
.history-band {
    position: relative;
    height: clamp(220px, 34vw, 420px);
    background-size: cover;
    background-position: center;
    overflow: hidden;
}
.history-band__scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(10, 10, 12, .1) 0%, rgba(10, 10, 12, .88) 100%);
}
.history-band__label {
    position: absolute;
    left: 0; right: 0; bottom: var(--sp-5);
    color: var(--paper-2);
}
.history-band__label .label { color: var(--gold-soft); }

/* ---------- Era track ---------- */
.era-track { position: relative; max-width: 960px; margin: 0 auto; }
.era-track::before {
    content: '';
    position: absolute;
    left: 50%; top: 0; bottom: 0;
    width: 2px;
    background: var(--red);
    transform: translateX(-50%);
}
.era-item {
    position: relative;
    width: 44%;
    margin-bottom: var(--sp-8);
}
.era-item:last-child { margin-bottom: 0; }
.era-item:nth-child(odd) { margin-right: auto; text-align: right; }
.era-item:nth-child(even) { margin-left: auto; text-align: left; }

.era-item__num {
    display: block;
    font-size: clamp(2.75rem, 6vw, 4.5rem);
    line-height: .8;
    color: rgba(10, 10, 12, .12);
}
.era-item__tag { display: block; color: var(--red); margin: var(--sp-1) 0 var(--sp-2); }
.era-item__body h3 { font-size: var(--fs-h3); margin-bottom: var(--sp-2); }
.era-item__body p { color: var(--ink-700); font-size: var(--fs-sm); }

/* ---------- Identity band — southern-underdog.png ---------- */
.identity-band__grid {
    display: grid;
    grid-template-columns: .85fr 1.15fr;
    gap: var(--sp-8);
    align-items: center;
}
.identity-band__poster img {
    width: 100%;
    max-width: 340px;
    margin: 0 auto;
    display: block;
    filter: drop-shadow(0 22px 50px rgba(0, 0, 0, .5));
}
.identity-band__content p { color: var(--ink-300); margin-bottom: var(--sp-5); }
.identity-facts { border-top: var(--rule-dark); }
.identity-facts li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--sp-4);
    padding: var(--sp-3) 0;
    border-bottom: var(--rule-dark);
}
.identity-facts__k { color: var(--gold-soft); white-space: nowrap; }
.identity-facts__v { font-family: var(--font-head); font-weight: 500; color: var(--paper-2); text-align: right; }

/* =======================================================================
   4. CLUB — สนามเหย้า (stadium)
   ======================================================================= */
.stadium-hero {
    position: relative;
    height: clamp(240px, 42vw, 520px);
    background-size: cover;
    background-position: center;
    overflow: hidden;
}
.stadium-hero__scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(10, 10, 12, .05) 0%, rgba(10, 10, 12, .92) 100%);
}
.stadium-hero__caption {
    position: absolute;
    left: 0; right: 0; bottom: var(--sp-6);
    color: var(--paper-2);
}
.stadium-hero__caption .label { display: block; color: var(--red-hot); margin-bottom: var(--sp-2); }
.stadium-hero__caption h2 { font-size: var(--fs-h1); color: var(--paper-2); }

.stadium-lede { max-width: 760px; color: var(--ink-700); margin-bottom: var(--sp-7); }

.stat-strip {
    display: flex;
    border-top: var(--rule);
    border-bottom: var(--rule);
    margin-bottom: var(--sp-8);
}
.stat-strip__item {
    flex: 1;
    padding: var(--sp-6) var(--sp-5);
    text-align: center;
    border-left: var(--rule);
}
.stat-strip__item:first-child { border-left: 0; }
.stat-strip__value {
    display: block;
    font-family: var(--font-head);
    font-size: var(--fs-h3);
    font-weight: 600;
    color: var(--ink-900);
    margin-bottom: var(--sp-2);
}
.stat-strip__item--lead .stat-strip__value {
    font-family: var(--font-num);
    font-weight: 700;
    font-size: clamp(2.75rem, 6vw, 4rem);
    line-height: 1;
    color: var(--red);
    font-variant-numeric: tabular-nums;
}
.stat-strip__label { color: var(--ink-400); }

.map-frame {
    position: relative;
    padding-bottom: 46%;
    height: 0;
    overflow: hidden;
    border-top: 3px solid var(--red);
    margin-bottom: var(--sp-8);
}
.map-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.travel-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--sp-6);
}
.travel-item { display: flex; gap: var(--sp-4); }
.travel-item__num { flex-shrink: 0; font-size: 2rem; line-height: 1; color: var(--red); }
.travel-item h3 { color: var(--paper-2); font-size: 1rem; margin-bottom: var(--sp-2); }
.travel-item p { color: var(--ink-300); font-size: var(--fs-sm); }

/* =======================================================================
   5. CLUB — ถ้วยรางวัล (trophy / honours hall)
   ======================================================================= */
.page-hero.trophy-hero::before {
    background:
        radial-gradient(60% 70% at 8% 0%, color-mix(in srgb, var(--gold) 22%, transparent) 0%, transparent 60%),
        radial-gradient(55% 60% at 100% 108%, color-mix(in srgb, var(--red-deep) 60%, transparent) 0%, transparent 58%);
}

.honours-section { position: relative; overflow: hidden; }
.honours-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(color-mix(in srgb, var(--gold) 14%, transparent) 1px, transparent 1px);
    background-size: 26px 26px;
    pointer-events: none;
}
.honours-section > .container { position: relative; z-index: 1; }
.honours-section .section-title::after { background: var(--gold); }

.honours-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: center;
    gap: var(--sp-3);
    text-align: center;
    margin: 0 auto var(--sp-8);
    padding: var(--sp-4) var(--sp-6);
    max-width: 520px;
    border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent);
    background: linear-gradient(90deg, color-mix(in srgb, var(--gold) 12%, transparent), color-mix(in srgb, var(--red) 12%, transparent));
}
.honours-strip__num { font-size: 2.25rem; color: var(--gold); text-shadow: 0 0 18px color-mix(in srgb, var(--gold) 55%, transparent); }
.honours-strip__label { color: var(--bone); }

.honours-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: var(--sp-6);
}
.honour-card {
    position: relative;
    background: linear-gradient(160deg, rgba(255, 255, 255, .05) 0%, rgba(255, 255, 255, .01) 100%);
    border: 1px solid color-mix(in srgb, var(--gold) 26%, transparent);
    padding: var(--sp-7) var(--sp-5) var(--sp-6);
    text-align: center;
    clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 0 100%);
    transition: var(--transition);
}
.honour-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--gold) 18%, transparent), transparent 65%);
    opacity: 0;
    transition: var(--transition);
    pointer-events: none;
}
.honour-card:hover {
    border-color: var(--gold);
    transform: translateY(-6px);
    box-shadow: 0 20px 44px rgba(0, 0, 0, .45), 0 0 26px color-mix(in srgb, var(--gold) 25%, transparent);
}
.honour-card:hover::after { opacity: 1; }

.honour-card__icon { width: 76px; height: 76px; margin: 0 auto var(--sp-4); display: flex; align-items: center; justify-content: center; }
.honour-card__icon img {
    max-width: 100%; max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 16px color-mix(in srgb, var(--gold) 40%, transparent));
    transition: var(--transition);
}
.honour-card:hover .honour-card__icon img { transform: scale(1.08); }

.honour-card__count {
    font-size: clamp(2.25rem, 5vw, 3rem);
    color: var(--gold);
    line-height: 1;
    margin-bottom: var(--sp-3);
    text-shadow: 0 0 20px color-mix(in srgb, var(--gold) 35%, transparent);
}
.honour-card__count--text {
    font-family: var(--font-head);
    font-size: var(--fs-sm);
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    text-shadow: none;
}
.honour-card__name {
    color: var(--paper-2);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: var(--sp-3);
    min-height: 2.6em;
}
.honour-card__years {
    display: inline-block;
    font-family: var(--font-head);
    font-size: var(--fs-xs);
    color: var(--gold-soft);
    border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent);
    padding: 3px 12px;
}

/* =======================================================================
   6. RESPONSIVE
   ======================================================================= */
@media (max-width: 960px) {
    .exec-card.is-lead { grid-template-columns: 180px 1fr; gap: var(--sp-5); }
    .identity-band__grid { grid-template-columns: 1fr; gap: var(--sp-6); text-align: center; }
    .identity-band__poster img { max-width: 260px; }
    .identity-facts li { justify-content: center; gap: var(--sp-2); }
    .identity-facts__v { text-align: left; }
}

@media (max-width: 640px) {
    .pos-head__count { display: none; }

    .squad-grid, .staff-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--sp-4); }
    .squad-card__number { font-size: clamp(3.25rem, 20vw, 5rem); }

    .exec-grid { grid-template-columns: 1fr; }
    .exec-card.is-lead { grid-template-columns: 1fr; text-align: center; }
    .exec-card.is-lead .exec-card__frame { max-width: 220px; margin: 0 auto var(--sp-4); }

    .era-track::before { left: 0; }
    .era-item { width: 100%; margin-bottom: var(--sp-6); padding-left: var(--sp-5); }
    .era-item:nth-child(odd), .era-item:nth-child(even) {
        margin-left: 0; margin-right: 0; text-align: left;
    }

    .identity-band__content { text-align: left; }
    .identity-facts li { justify-content: space-between; }

    .stat-strip { flex-direction: column; }
    .stat-strip__item { border-left: 0; border-top: var(--rule); padding: var(--sp-5); }
    .stat-strip__item:first-child { border-top: 0; }

    .honours-strip { flex-direction: column; gap: 2px; padding: var(--sp-4) var(--sp-5); }
}
