:root {
    --brand: #fbb034;
    --brand-2: #f08205;
    --bg: #f7f7fb;
    --card: #ffffff;
    --muted: #6c757d;
    --ok: #16a34a;
    --down: #dc2626;
    --gold: #d4af37;
    --gold-dark: #b8962e;
    --gold-soft: #f6e7b2;
    --gold-1: #c9a227;
    --gold-2: #f4d06f;
    --gold-3: #fff6d6;
    --line: rgba(0, 0, 0, 0.08);
    --shadow: 0 10px 25px rgba(0, 0, 0, 0.06);
}

html,
body {
    height: 100%;
}

body {
    background: radial-gradient(100% 100%, var(--gold-3), transparent 60%), linear-gradient(180deg, #fffdf9, #fffdf9);
    font-family: "Kanit", "Prompt", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    text-decoration: none;
}

.form-control,
.form-select {
    border-color: #ced4da;
    transition: all 0.2s ease-in-out;
}

.form-control:hover,
.form-select:hover {
    border-color: var(--gold-hover);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--gold-main);
    box-shadow: 0 0 0 0.25rem var(--gold-soft);
}

.head-top-bar {
    background-color: #fbb034 !important;
}

.head-top-navbar {
    background-color: #ffffff !important;
}

.head-top-navbar-border-bottom {
    /*border-bottom: solid 1px #e5d1af !important;*/
    border-bottom: none !important;
    box-shadow: 0 1px 0 #ffffff, 0 4px 12px rgb(177 162 137 / 20%) !important;
}

main {
    flex: 1 0 auto;
}

footer {
    margin-top: auto !important;
    flex-shrink: 0;
}

.brand-badge {
    background: rgba(245, 158, 11, 0.12);
    color: var(--brand-2);
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.navbar-brand strong {
    color: var(--brand-2);
}

.hero-card {
    border: 0;
    border-radius: 18px;
    box-shadow: 0 1px 0 #e5e5e5, 0 3px 8px rgba(0, 0, 0, 0.1) !important;
}

.soft-card {
    border: 0;
    border-radius: 18px;
    box-shadow: 0 1px 0 #e5e5e5, 0 3px 8px rgba(0, 0, 0, 0.1) !important;
}

.price {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.3px;
}

.btn-brand {
    background: var(--brand-2);
    border-color: var(--brand-2);
    color: #fff;
}

.btn-brand:hover {
    background: #ee6b07;
    border-color: #ee6b07;
    color: #fff;
}

.btn-outline-brand {
    border-color: rgba(217, 119, 6, 0.55);
    color: var(--brand-2);
}

.btn-outline-brand:hover {
    background: rgba(217, 119, 6, 0.12);
    color: var(--brand-2);
}

.table thead th {
    background: #ffc76a;
    border-bottom: 1px solid rgba(245, 158, 11, 0.25);
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    font-size: 0.85rem;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: #111827;
}

.stat {
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.skeleton {
    background: linear-gradient( 90deg, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.06));
    background-size: 200% 100%;
    animation: sk 1.2s infinite;
    border-radius: 8px;
}

@keyframes sk {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

a {
    color: inherit;
}

a:hover {
    color: var(--brand-2);
}

hr {
    opacity: .1;
}

.navbar-expand-lg .navbar-nav .nav-link {
    padding-right: 0.9rem;
    padding-left: 0.9rem;
}

.dropdown-menu-top {
    border: 0;
    box-shadow: 0 1px 0 #e5e5e5, 0 3px 8px rgba(0, 0, 0, 0.1) !important;
}

.table-gold tbody tr {
    font-weight: 300;
    font-size: 14px;
}

.table-gold tbody tr:nth-child(odd)>* {
    background-color: #faf8ec !important;
}

.table-gold tbody tr:nth-child(even)>* {
    background-color: #fcf4cf !important;
}

.table-gold tbody tr:hover>* {
    background-color: #ffefad !important;
}

.table-gold.table-bordered {
    --bs-table-border-color: #fff;
}

.table-gold.table thead th {
    border-bottom: #fff;
    font-weight: 400;
}

.table-gold.table thead th.bg {
    background-color: #ffb900 !important;
}

.table-gold td.bg {
    background-color: #ffb900 !important;
}

.arrow-up {
    display: inline-block;
    will-change: transform;
    transform: translate3d(0, 0, 0);
    animation: arrowFloat 1.4s linear infinite;
}

@keyframes arrowFloat {
    0% {
        transform: translate3d(0, 6px, 0);
    }
    100% {
        transform: translate3d(0, -6px, 0);
    }
}

.arrow-down {
    display: inline-block;
    will-change: transform;
    transform: translate3d(0, 0, 0);
    animation: arrowDown 1.6s linear infinite;
    color: #dc3545;
}

@keyframes arrowDown {
    0% {
        transform: translate3d(0, -6px, 0);
    }
    100% {
        transform: translate3d(0, 6px, 0);
    }
}

#yearScroller a.year-link {
    min-width: 86px;
    flex: 0 0 auto;
    white-space: nowrap;
}

.yearhistory .start-bt-0 {
    left: 15px !important;
}

.yearhistory .end-bt-0 {
    right: 15px !important;
}

.select2-container {
    z-index: 1500 !important;
}

.select2-dropdown {
    z-index: 1500 !important;
}

.select2-container--bootstrap-5 .select2-selection {
    border: 1px solid #e2e8ef;
}

.select2-container--bootstrap-5.select2-container--focus .select2-selection,
.select2-container--bootstrap-5.select2-container--open .select2-selection {
    border-color: #00174d;
    box-shadow: none;
}

.select2-container--bootstrap-5 .select2-dropdown {
    border-color: #00174d;
}

.select2-container--bootstrap-5 .select2-dropdown .select2-results__options .select2-results__option.select2-results__option--highlighted {
    color: #000;
    background-color: #b5b5b5;
}

.select2-container--bootstrap-5 .select2-dropdown .select2-results__options .select2-results__option.select2-results__option--selected,
.select2-container--bootstrap-5 .select2-dropdown .select2-results__options .select2-results__option[aria-selected=true]:not(.select2-results__option--highlighted) {
    color: #000;
    background-color: #e9ecef;
}

.select2-container--bootstrap-5 .select2-dropdown .select2-search .select2-search__field:focus {
    border: 1px solid #017ffd;
    box-shadow: none;
}

.select2-results__option {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    width: 100%;
}

.summary-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.summary-link * {
    text-decoration: none !important;
}

.summary-year-card {
    padding: 26px 22px;
    border-radius: 22px;
    background: linear-gradient( 135deg, #ffffff, #fff1b8);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 4px 14px rgba(0, 0, 0, .08);
    backdrop-filter: saturate(110%);
}

.summary-link:hover .summary-year-card {
    transform: translateY(-2px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 10px 22px rgba(0, 0, 0, .12);
}

.year-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: #8a6a00;
    margin-bottom: 18px;
}

.metal-title {
    font-size: .95rem;
    font-weight: 600;
    margin: 14px 0 6px;
}

.gold-bar {
    color: #b8860b;
}

.gold-orn {
    color: #c47a00;
}

.year-metrics {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.metric {
    flex: 1;
    text-align: center;
}

.metric-label {
    font-size: .8rem;
    color: #777;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.metric-value.highlight {
    color: #b8860b;
}

.metric-divider {
    width: 1px;
    height: 42px;
    background: linear-gradient( to bottom, transparent, rgba(0, 0, 0, .2), transparent);
}

.year-diff {
    margin-top: 20px;
    padding-top: 14px;
    text-align: center;
    border-top: 1px dashed rgba(0, 0, 0, .2);
}

.diff-label {
    font-size: .85rem;
    color: #666;
}

.diff-value {
    font-size: 1.9rem;
    font-weight: 800;
}

.diff-value.up {
    color: #16a34a;
}

.metric-unit {
    font-size: .75rem;
    color: #888;
}

.summary-empty {
    text-align: center;
    color: #8a6a00;
}

.empty-icon {
    font-size: 2.4rem;
    opacity: .6;
    margin: 10px 0 6px;
}

.empty-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.empty-desc {
    font-size: .85rem;
    color: #7a6a3a;
    line-height: 1.5;
}

#scrollTopBtn {
    position: fixed;
    right: 22px;
    bottom: 22px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #C6A75E, #E5C97A);
    color: white;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px) scale(.9);
    transition: opacity .28s ease, transform .28s ease, box-shadow .25s ease;
}


/* ตอนแสดง */

#scrollTopBtn.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}


/* hover ให้ลอยแบบ premium */

#scrollTopBtn:hover {
    transform: translateY(-6px) scale(1.05);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .25);
}


/* ตอนกด */

#scrollTopBtn:active {
    transform: translateY(-2px) scale(.98);
}

.news-card .news-image {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    /* ทำให้ทุกภาพเท่ากัน */
    overflow: hidden;
    border-radius: 12px 12px 0 0;
    background: #f3f3f3;
}

.news-card .news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* ครอบภาพ */
    object-position: center;
    /* จัดกลาง */
    transition: 0.4s ease;
}


/* hover effect */

.news-card:hover .news-image img {
    transform: scale(1.05);
}

.news-card .news-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, 0.4));
}

@media (min-width: 1400px) {
    .container,
    .container-lg,
    .container-md,
    .container-sm,
    .container-xl,
    .container-xxl {
        max-width: 960px !important;
    }
}