/* =========================================================
   component.css
   Scoped style for component.php only
   ต้องโหลดหลัง assets/css/index.css
========================================================= */

.component-page {
    --component-max: 1220px;
    --component-card-radius: 34px;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: clamp(16px, 2vw, 24px);
}

.component-head,
.component-grid {
    position: relative;
    z-index: 6;
    width: min(var(--component-max), 100%);
    margin-inline: auto;
}

.component-kicker {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 9px 18px;
    border-radius: 999px;
    color: #0b2347;
    font-weight: 900;
    background: linear-gradient(135deg, var(--gold), #fff2ad);
    box-shadow: 0 12px 28px rgba(245, 197, 66, .18);
}

.component-title {
    display: block;
    margin: 14px 0 8px;
    font-family: "Chonburi", "Noto Sans Thai", serif;
    font-size: clamp(2.75rem, 4.3vw, 4.9rem);
    line-height: 1.08;
    letter-spacing: -1.2px;
    color: transparent;
    background: linear-gradient(100deg, #071f4b 10%, #0b2347 34%, #126bd6 50%, #0b2347 66%, #071f4b 90%);
    background-size: 260% auto;
    -webkit-background-clip: text;
    background-clip: text;
    animation: titleLight 5.5s ease-in-out infinite;
}

.component-desc {
    max-width: 960px;
    margin: 0;
    color: rgba(11, 35, 71, .82);
    font-size: clamp(.98rem, 1.02vw, 1.14rem);
    font-weight: 650;
    line-height: 1.72;
}

.component-grid {
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(18px, 2.2vw, 30px);
    align-items: stretch;
}

.component-card {
    position: relative;
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    gap: clamp(12px, 1.2vw, 16px);
    padding: clamp(22px, 2.2vw, 32px);
    border-radius: var(--component-card-radius);
    color: var(--dark);
    text-decoration: none;
    background:
        radial-gradient(circle at 10% 8%, rgba(245, 197, 66, .24), transparent 34%),
        radial-gradient(circle at 92% 92%, rgba(18, 136, 248, .18), transparent 42%),
        linear-gradient(135deg, rgba(255, 255, 255, .76), rgba(255, 255, 255, .34));
    border: 1px solid rgba(255, 255, 255, .70);
    box-shadow:
        0 24px 68px rgba(7, 35, 71, .12),
        inset 0 1px 0 rgba(255, 255, 255, .48);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease;
}

.component-card::before {
    content: "";
    position: absolute;
    inset: -58%;
    z-index: -1;
    background: linear-gradient(115deg, transparent 42%, rgba(255, 255, 255, .32) 50%, transparent 58%);
    transform: translateX(-62%) rotate(8deg);
    animation: cardShine 7s ease-in-out infinite;
}

.component-card:nth-child(2)::before {
    animation-delay: .65s;
}

.component-card:hover {
    transform: translateY(-6px);
    box-shadow:
        0 32px 84px rgba(7, 94, 200, .18),
        inset 0 1px 0 rgba(255, 255, 255, .55);
}

.component-main {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: clamp(18px, 2vw, 28px);
    align-items: center;
}

.component-number {
    width: clamp(66px, 7vw, 112px);
    height: clamp(66px, 7vw, 112px);
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    font-family: "Chonburi", "Noto Sans Thai", serif;
    font-size: clamp(3.1rem, 5vw, 4.6rem);
    line-height: 1;
    background: linear-gradient(135deg, var(--blue), var(--blue-dark));
    box-shadow: 0 22px 50px rgba(7, 94, 200, .22);
}

.component-title-group {
    min-width: 0;
}

.component-chip {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-bottom: 10px;
    padding: 7px 14px;
    border-radius: 999px;
    color: var(--blue-dark);
    background: rgba(245, 197, 66, .28);
    font-size: .92rem;
    font-weight: 900;
    white-space: nowrap;
}

.component-card h2 {
    margin: 0 0 4px;
    color: #0b2347;
    font-family: "Chonburi", "Noto Sans Thai", serif;
    font-size: clamp(1.65rem, 2.35vw, 2.75rem);
    line-height: 1.2;
    letter-spacing: -.6px;
}

.component-card h3 {
    margin: 0;
    color: var(--blue-dark);
    font-size: clamp(1.05rem, 1.25vw, 1.35rem);
    font-weight: 900;
    line-height: 1.42;
}

.component-card-desc {
    margin: 0;
    color: rgba(11, 35, 71, .78);
    font-weight: 750;
    line-height: 1.58;
}

.component-topic-list {
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
    gap: 9px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.component-topic-list li {
    position: relative;
    min-width: 0;
    padding: 9px 12px 9px 32px;
    border-radius: 16px;
    color: rgba(11, 35, 71, .82);
    background: rgba(255, 255, 255, .52);
    border: 1px solid rgba(255, 255, 255, .58);
    font-size: clamp(.88rem, .94vw, 1rem);
    font-weight: 820;
    line-height: 1.45;
}

.component-topic-list li::before {
    content: "★";
    position: absolute;
    left: 12px;
    top: 9px;
    color: var(--gold);
}

.component-go {
    display: inline-flex;
    justify-self: start;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
    padding: 11px 18px;
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(135deg, var(--blue), var(--blue-dark));
    font-weight: 900;
    box-shadow: 0 16px 34px rgba(7, 94, 200, .20);
}

.component-page .slide-controls a.btn-main,
.component-page .slide-controls a.btn-outline,
.slide-controls a.btn-main,
.slide-controls a.btn-outline {
    width: 42px;
    height: 42px;
    padding: 0;
    display: grid;
    place-items: center;
    font-size: 1.45rem;
    line-height: 1;
}

@media (max-width: 1366px) {
    .component-title {
        font-size: clamp(2.5rem, 4vw, 4.35rem);
    }

    .component-card {
        padding: clamp(20px, 1.9vw, 28px);
    }

    .component-topic-list {
        gap: 8px;
    }
}

@media (max-width: 1180px) {
    .component-page {
        min-height: 100vh;
    }

    .component-grid {
        grid-template-columns: 1fr;
    }

    .component-topic-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .component-main {
        grid-template-columns: 1fr;
    }

    .component-chip {
        white-space: normal;
    }

    .component-topic-list {
        grid-template-columns: 1fr;
    }
}