:root {
    --color-primary: #7D3C26;
    --color-tan: #C19A6B;
    --color-dark-brown: #7D3C26;
    --color-happy: #E5D000;
    --color-angry: #BF002B;
    --color-bored: #729B31;
    --color-fear: #9833AA;
    --color-sad: #4F6AB7;
    --color-beforedeath: #444649;
    --button-primary: #7D3C26;
}

body,html {
    font-family: 'Kanit', sans-serif;
}
.btn {
    margin: 0px 10px;
}

a {
    text-decoration: none;
}

img {
    max-width: 100%;
}

ul, ol, li {
    list-style: none;
}

.form-control {
    font-size: 15px;
}

.form-control:focus {
    outline: none;
}

.alert {
    font-size: 13px;
}

/* Navbar — คลังภูมิปัญญาจังหวัดน่าน */

.navbar.navbar-nan {
    background-color: #fff;
    color: var(--color-dark-brown);
    padding: 10px 0;
    border-bottom: 1px solid rgba(125, 60, 38, 0.12);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.container-nan-nav {
    max-width: 1200px;
}

.navbar-brand-nan {
    font-weight: bold;
    color: var(--color-dark-brown) !important;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-right: 1rem;
    max-width: min(340px, 42vw);
}

.navbar-brand-nan .navbar-brand-logo {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.navbar-site-title {
    font-family: "IBM Plex Sans Thai", "Kanit", sans-serif;
    font-weight: 600;
    font-size: clamp(0.95rem, 2.1vw, 1.15rem);
    line-height: 1.25;
    color: var(--color-dark-brown);
    text-align: left;
}

.navbar-search-wrap {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 520px;
}

.navbar-search {
    position: relative;
    width: 100%;
}

.search-input-nav {
    border-radius: 50px;
    border: 1px solid rgba(125, 60, 38, 0.45);
    padding: 10px 44px 10px 18px;
    font-size: 15px;
    color: #333;
    background: #fff;
}

.search-input-nav:focus {
    border-color: var(--color-dark-brown);
    box-shadow: 0 0 0 3px rgba(125, 60, 38, 0.12);
}

.navbar-search-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-dark-brown);
    opacity: 0.65;
    pointer-events: none;
}

.btn-register-nan {
    background-color: var(--color-tan);
    color: #fff !important;
    border: none;
    font-weight: 500;
    padding: 8px 22px;
    font-size: 14px;
}

.btn-register-nan:hover {
    background-color: #a8845c;
    color: #fff !important;
}

.btn-login-nan {
    background-color: var(--color-dark-brown);
    color: #fff !important;
    border: none;
    font-weight: 500;
    padding: 8px 22px;
    font-size: 14px;
}

.btn-login-nan:hover {
    background-color: #5f2e1c;
    color: #fff !important;
}

.navbar-toggler-nan {
    border: 1px solid rgba(125, 60, 38, 0.35);
    color: var(--color-dark-brown);
    padding: 8px 12px;
    border-radius: 10px;
    background: #fff;
}

.navbar-profile-nan {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    color: var(--color-dark-brown);
    flex-wrap: wrap;
    gap: 8px;
}

.navbar-profile-nan .navbar-profile-text {
    font-size: 14px;
    text-align: right;
    line-height: 1.2;
    color: var(--color-dark-brown);
}

.navbar-profile-nan .navbar-profile-text span {
    font-size: 11px;
    opacity: 0.85;
}

.navbar-profile-nan .profile-img img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(125, 60, 38, 0.2);
}

.navbar-nan .dropdown {
    margin-left: 4px;
    display: flex;
    align-items: center;
}

.dropdown-toggle-nan {
    border: 1px solid rgba(125, 60, 38, 0.25);
    padding: 8px 12px;
    font-size: 20px;
    border-radius: 12px;
    background-color: #fff;
    color: var(--color-dark-brown);
    display: flex;
    align-items: center;
    justify-content: center;
}

.dropdown-toggle-nan.show {
    background-color: rgba(125, 60, 38, 0.08);
}

.navbar-nan .dropdown-menu[data-bs-popper] {
    top: calc(100% + 6px);
    margin-top: 0;
    border-radius: 12px;
    border: 1px solid rgba(125, 60, 38, 0.12);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    right: 0;
    left: auto;
    min-width: 200px;
}

.navbar-nan .dropdown-item {
    color: var(--color-dark-brown);
    font-size: 14px;
}

.navbar-nan .dropdown-item:hover {
    background-color: rgba(193, 154, 107, 0.2);
    color: var(--color-dark-brown);
}

.navbar-nan .dropdown-menu {
    background-color: #fff;
}

/* Legacy helpers (หน้าอื่นที่ยังอ้างอิงคลาสเดิม) */
.navbar:not(.navbar-nan) {
    background-color: var(--color-primary);
    color: #fff;
    padding: 0;
}

.logo-text {
    display: flex;
    flex-direction: column;
    text-align: right;
    font-family: "IBM Plex Sans Thai", sans-serif;
    font-weight: lighter;
    font-size: 22px;
    line-height: 1.1;
    margin-top: 7px;
}

.navbar-profile {
    display: flex;
    align-items: center;
    justify-content: center;
    color: inherit;
}

.navbar-profile-text {
    font-size: 14px;
    text-align: right;
    line-height: 1;
}

.navbar-profile-text span {
    font-size: 10px;
}

.navbar-profile img {
    width: 35px;
    height: 35px;
    border-radius: 50px;
    overflow: hidden;
}

.dropdown {
    margin-left: 10px;
    display: flex;
    top: 5px;
}

.navbar:not(.navbar-nan) .dropdown #dropdownMenuButton {
    border: 0;
    padding: 10px 10px;
    font-size: 23px;
    height: 55px;
    border-radius: 15px 15px 0 0;
    background-color: transparent;
    color: #fff;
    display: flex;
}

.dropdown-menu[data-bs-popper] {
    margin-top: 0;
    border-radius: 0;
    border: none;
    right: 0;
    left: auto;
}

.navbar:not(.navbar-nan) .dropdown #dropdownMenuButton.show,
.navbar:not(.navbar-nan) .dropdown-menu.show {
    background-color: #ccc;
    color: var(--color-primary);
}

.navbar:not(.navbar-nan) .dropdown-item {
    color: #fff;
    font-size: 14px;
}

.navbar:not(.navbar-nan) .dropdown-menu {
    background-color: var(--color-primary);
}

.dropdown-login-mobile {
    display: none;
}

/* Button */

.btn-outline {
    border: 1px solid #fff;
    background: transparent;
    color: #fff;
}

.btn-round {
    border-radius: 20px;
}
.btn-sm {
    padding: 5px 13px;
}

.btn-lg {
    padding: 8px 30px;
    font-size: 16px;
}

.btn-primary {
    background-color: var(--button-primary);
    color: #fff;
    border: none;
}

.btn-primary:hover {
    background-color: var(--button-primary);
    color: #fff;
    border: none;
}

/* Form */

.form-group {
    margin-bottom: 15px;
}

.form-control {
    border-radius: 5px;
    border: 1px solid var(--color-primary);
    padding: 5px;
}
.form-control:focus,
.form-control:active {
    outline: none;
}

label {
    font-size: 14px;
}

/* Main */

.search-input {
    border-radius: 50px;
    text-align: center;
    max-width: 550px;
    margin: auto;
}

.navbar-search .search-input {
    max-width: none;
    width: 100%;
    margin: 0;
    text-align: left;
}

.main-title {
    text-align: center;
}

.wrapper {
    padding: 60px 0px;
}

/* หน้าแรก — คลังภูมิปัญญาจังหวัดน่าน */
.wrapper-home-nan {
    padding: 28px 0 56px;
}

/* หมวดใหญ่ 3 การ์ด + ปุ่มหัวข้อย่อยแบบม็อกอัป */
.featured-categories {
    margin-bottom: 0;
}

.featured-categories-row {
    align-items: stretch;
    --bs-gutter-x: 0.65rem;
    --bs-gutter-y: 0.65rem;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 768px) {
    .featured-categories-row {
        --bs-gutter-x: 0.85rem;
        --bs-gutter-y: 0.85rem;
        max-width: 720px;
    }
}

@media (min-width: 992px) {
    .featured-categories-row {
        --bs-gutter-x: 1rem;
        max-width: 780px;
    }
}

.featured-categories .col-md-4 {
    display: flex;
}

.featured-cat-card {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    width: 100%;
    max-width: 220px;
    margin: 0 auto;
    aspect-ratio: 1 / 1;
    min-height: 158px;
    border-radius: 20px;
    overflow: hidden;
    background: linear-gradient(135deg, #C19A6B 0%, #7D3C26 100%);
    background-size: cover;
    background-position: center;
    box-shadow: 0 8px 24px rgba(62, 28, 14, 0.14);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    border: 6px solid transparent;
    box-sizing: border-box;
}

.featured-cat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 40px rgba(62, 28, 14, 0.22);
}

.featured-cat-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.42), transparent 52%);
    pointer-events: none;
}

.featured-cat-label {
    position: relative;
    z-index: 1;
    margin-bottom: 14px;
    background: #fff;
    color: var(--color-dark-brown);
    font-weight: 600;
    font-size: clamp(0.72rem, 1.35vw, 0.88rem);
    padding: 7px 14px;
    white-space: nowrap;
    max-width: calc(100% - 20px);
    overflow: hidden;
    text-overflow: ellipsis;
    border: 2px solid var(--color-dark-brown);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
    font-family: "IBM Plex Sans Thai", "Kanit", sans-serif;
}

.featured-cat-card.is-selected {
    border-color: #5c2415;
    box-shadow: 0 18px 44px rgba(62, 28, 14, 0.28);
}

.archive-subcats {
    margin-top: 28px;
    width: 100%;
}

.archive-subcats-inner {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px 16px;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

.archive-subcat-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 46px;
    padding: 10px 14px;
    font-size: clamp(0.8rem, 1.4vw, 0.95rem);
    font-weight: 600;
    color: #fff !important;
    background-color: #5c2415;
    border: 2px solid transparent;
    text-decoration: none !important;
    text-align: center;
    line-height: 1.25;
    transition: background 0.2s ease, transform 0.15s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: "IBM Plex Sans Thai", "Kanit", sans-serif;
}

.archive-subcat-pill:hover {
    background-color: #4a1c10;
    color: #fff !important;
    transform: translateY(-1px);
}

.archive-subcat-pill.is-active {
    background-color: #5c2415;
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.85);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35) inset, 0 4px 14px rgba(0, 0, 0, 0.2);
}

.archive-breadcrumb {
    font-size: 15px;
    font-weight: 500;
}

.archive-breadcrumb-count {
    font-weight: 600;
    opacity: 0.9;
}

.archive-breadcrumb-sep {
    margin: 0 6px;
    opacity: 0.65;
}

.tag-btn-container--hidden {
    display: none !important;
}

.archive-search-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    padding: 12px 18px;
    border-radius: 14px;
    background: rgba(125, 60, 38, 0.06);
    border: 1px solid rgba(125, 60, 38, 0.12);
    color: var(--color-dark-brown);
}

.archive-search-bar__label {
    font-weight: 600;
    font-size: 14px;
}

.archive-search-bar__path {
    font-size: 14px;
    opacity: 0.95;
}

.archive-grid-home {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 20px 18px;
    margin-top: 50px;
}

.archive-card-link {
    display: block;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.archive-card-link:hover {
    color: inherit;
}

.archive-card {
    border-radius: 18px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.archive-card-link:hover .archive-card {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(125, 60, 38, 0.15);
}

.archive-card__img {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #e8dfd6;
}

.archive-card__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.archive-card__footer {
    background-color: var(--color-dark-brown);
    color: #fff;
    padding: 14px 14px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    min-height: 88px;
}

.archive-card__title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.archive-card__sub {
    font-size: 13px;
    opacity: 0.92;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 1199px) {
    .archive-grid-home {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 991px) {
    .archive-grid-home {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 16px;
    }

    .navbar-brand-nan {
        max-width: none;
    }
}

@media (max-width: 991px) {
    .archive-subcats-inner {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px 12px;
    }
}

@media (max-width: 767px) {
    .archive-grid-home {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .featured-cat-card {
        aspect-ratio: 4 / 3;
        min-height: 142px;
        max-width: none;
    }

    .featured-cat-label {
        white-space: normal;
        text-align: center;
        max-width: calc(100% - 16px);
        padding: 6px 12px;
        font-size: 0.82rem;
    }

    .featured-cat-card {
        border-width: 5px;
    }

    .featured-categories-row {
        max-width: 100%;
    }

    .archive-subcats-inner {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px 10px;
    }

    .archive-subcats {
        margin-top: 22px;
    }
}

@media (max-width: 480px) {
    .archive-grid-home {
        grid-template-columns: 1fr;
    }
}

#detail-page {
    padding: 30px 0px;
}
svg {
  width: 32px;
  height: 40px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1;
}

.select-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
}

#select-input-age,
#select-input-style {
    width: 135px;
    margin: 0px 10px;
    text-align: center;
    border: 2px solid var(--color-primary);
    border-radius: 50px;
    color: var(--color-primary);
    padding: 5px;
}

#search-bar,
#search-bar-detail {
    color: var(--color-primary);
    margin-bottom: 50px !important;
}

#search-bar span,
#search-bar-detail span {
    background-color: var(--color-primary);
    color: #fff;
    padding: 3px 8px;
    border-radius: 15px;
}

/* ปุ่ม Tag */
.tag-btn-container {
    text-align: center;
}
.tag-btn {
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    margin: 7px 1px;
    padding: 4px 10px;
}

/* Card — โทนกลาง (ไม่แยกสีตามอารมณ์) */
.card-neutral .card {
    background: linear-gradient(180deg, #fff 0%, #f8f6f4 100%);
    color: var(--color-primary);
}

.card-neutral .card-body,
.card-neutral .card-title,
.card-neutral .card-text {
    color: var(--color-primary);
}

/* Card */

.card {
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0px 3px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s;
    margin: 20px 0px;
    border: 0px;
    color: #fff;
}

.card:hover {
    transform: translateY(-5px);
}

.feeling-card .card-img {
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    height: 230px;
    overflow: hidden;
}

.feeling-card .card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-body {
    position: relative;
    flex: 1 1 auto;
    padding: var(--bs-card-spacer-y) var(--bs-card-spacer-x);
    color: var(--bs-card-color);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-body .badge {
    position: absolute;
    top: -35px;
    transform: translate(-50%);
    left: 50%;
    padding: 5px 10px 8px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: normal;
}

.card-body-content {
    margin-bottom: 15px;
}

.detail-container h3,
.detail-container p {
    color: #7c0d0e;
}

.detail-content {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.detail-img {
    position: relative;
}

.detail-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    max-width: 100%;
    padding: 25px 0px;
    position: relative;
}

.gallery::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
    pointer-events: none;
    opacity: 0;
}

.gallery a {
    display: block;
    width: 100%;
    height: 150px;
    overflow: hidden;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery a:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.gallery img{ 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    display: block;
    transition: transform 0.3s ease;
}

.gallery a:hover img {
    transform: scale(1.05);
}

/* Responsive Gallery */
@media (max-width: 1200px) {
    .gallery {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 992px) {
    .gallery {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .gallery a {
        height: 140px;
    }
}

@media (max-width: 768px) {
    .gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .gallery a {
        height: 130px;
    }
}

@media (max-width: 576px) {
    .gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 15px 0px;
    }
    
    .gallery a {
        height: 120px;
        border-radius: 4px;
    }
}

@media (max-width: 480px) {
    .gallery {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    
    .gallery a {
        height: 200px;
    }
}

@media (max-width: 364px) {
    .logo-text {
        font-size: 18px;
    }

    .navbar-brand img {
        width: 36px;
        height: 36px;
    }

    .dropdown #dropdownMenuButton {
        padding: 10px 7px;
    }
}

.action-group {
    width: 100%;
}

.filling-box {
    text-align: right;
    color: var(--color-primary);
    display: flex;
    justify-content: space-between;
}

.btn-action {
    border-radius: 13px;
    font-size: 12px;
    padding: 2px 10px;
    margin: 0px;
    margin-left: 0px;
    margin-left: 10px;
}

.btn-good,
.btn-good:hover {
    background-color: rgb(232, 119, 189);
    color: #fff;
}

.btn-no,
.btn-no:hover {
    background-color: #515151;
    color: #fff;
}

.feeling-text {
    display: inline-block;
    vertical-align: middle;
    margin-left: 15px;
}

.feeling-text svg {
    width: 26px;
    height: 26px;
}

.feeling-text span {
    display: inline-block;
    vertical-align: middle;
}

.feeling-text.text-good {
    color: rgb(232, 119, 189);
}

.feeling-text.text-no {
    color: #515151;
}

.btn-action svg {
    width: 26px;
    height: 26px;
}

.btn-action span {
    display: inline-block;
    vertical-align: middle;
}

.social-box {   
    border: 1px solid var(--color-primary);
    margin-top: 20px;
    padding: 4px 15px;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.profile-box {
    display: flex;
    align-items: center;
    text-align: right;
    color: var(--color-primary);
}

.profile-img {
    border-radius: 50px;
    overflow: hidden;
    margin-left: 10px;
    width: 40px;
    height: 40px;
}

.profile-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-name {
    font-size: 14px;
}

.profile-name span {
    font-size: 12px;
}

.cards-related {
    padding: 70px 0px 0px;
    margin: auto;
}

#profileform .preview { cursor: pointer; display: inline-block; }
#profileform .preview img {
    width: 150px; height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #ccc;
    transition: 0.3s;
}
#profileform input[type=file] {
    display: none;
}
  
/* My Feeling */

#profileform,
#myfeelingform {
    max-width: 900px;
    margin: auto;
}

#profileform .main-title,
#myfeelingform .main-title {
    text-align: left;
    color: var(--color-primary);
    font-size: 24px;
    margin-bottom: 25px !important;
}

#btn-profile-image {
    background-color: var(--color-primary);
    margin-top: 10px;
    font-size: 13px;
}

.card-box a {
    height: 100%;
    display: grid;
}

.card-box-my-feeling {
    margin-top: 50px;
}

.card-box-my-feeling .card-box-my-feeling-title {
    font-size: 16px;
    color: var(--color-primary);
}

.card-box-my-feeling .card-box a {
    display: inline;
}

/* Register */

#registerform {
    max-width: 500px;
    margin: auto;
    border: 1px solid var(--color-primary);
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
}

#facebook-login-btn {
    background-color: #1877F2;
    color: #fff;
    border-color: #1877F2;
    font-size: 14px;
    width: 200px;
}
/* Login */

#loginform {
    max-width: 350px;
    margin: auto;
    border: 1px solid var(--color-primary);
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
}

/* Footer */

.footer {
    background: var(--color-primary);
    color: #fff;
    text-align: center;
    padding: 50px 0 30px;
}
.footer a {
    color: #fff;
    margin: 0 8px;
    font-size: 18px;
    text-decoration: none;
}

.footer-nan {
    padding: 44px 16px 36px;
}

.footer-nan-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.footer-category-pill {
    background: #fff;
    color: var(--color-dark-brown) !important;
    font-weight: 600;
    font-size: 14px;
    padding: 10px 22px;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.footer-category-pill:hover {
    background: #fffef8;
    color: #5f2e1c !important;
}

.footer-social-nan {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.btn-social-circle {
    width: 48px;
    height: 48px;
    border-radius: 50% !important;
    padding: 0 !important;
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border: none !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-social-circle img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.btn-social-circle .fa {
    font-size: 22px;
    color: #fff;
}

.footer-social-nan .social-facebook {
    background: #1877f2;
}

.footer-social-nan .social-instagram {
    background: linear-gradient(35deg, #f58529, #dd2a7b, #8134af);
}

.footer-social-nan .social-tiktok {
    background: #000;
}

.footer-social-nan .social-youtube {
    background: #ff0000;
}

.footer-social-nan .social-line {
    background: #06c755;
}

.social-tiktok-mark {
    color: #fff;
    font-size: 20px;
    font-weight: 700;
}

.footer-copy-nan {
    font-size: 14px;
    opacity: 0.95;
    line-height: 1.6;
}

.btn-social {
    background-color: #fff;
    height: 33px;
    padding: 0px;
    width: 33px;
    margin: 0px 3px;
}
.btn-social:hover {
    background-color: #fff;
}

.footer p {
    font-size: 13px;
}

@media (max-width: 991px) {
    .dropdown {
        margin-left: 5px;
    }
    .navbar-profile-text {
        display: none;
    }

    .navbar-slogan {
        display: none;
    }
    .navbar-slogan-mobile {
        display: block;
    }
}

@media (max-width: 767px) {
    .wrapper {
        padding: 50px 0px;
    }

    .navbar-brand {
        scale: 0.9;
    }

    .navbar-login {
        display: none;
    }

    .dropdown-login-mobile {
        display: block;
    }

    .detail-img {
        margin-bottom: 30px;
    }

    .filling-box {
        font-size: 13px;
    }

    .btn-action {
        padding: 1px 6px;
        margin-left: 4px;
    }

    .social-box {
        padding: 4px 5px;
    }

    .btn-social {
        margin: 0px;
    }
    
}

/* Enhanced Image Gallery Upload Styles */
.image-gallery-upload {
    border: 2px dashed #007bff;
    border-radius: 12px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9ff 0%, #e3f2fd 100%);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.image-gallery-upload:hover {
    border-color: #0056b3;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.15);
}

.upload-area {
    text-align: center;
    position: relative;
    cursor: pointer;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.upload-area input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-icon {
    font-size: 48px;
    color: #007bff;
    margin-bottom: 15px;
    animation: bounce 2s infinite;
}

.upload-text p {
    margin: 5px 0;
    color: #495057;
    font-weight: 500;
}

.upload-hint {
    font-size: 14px;
    color: #6c757d !important;
    font-weight: 400 !important;
}

.gallery-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.preview-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    background: white;
}

.preview-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.preview-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
}

.preview-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    border: none;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.preview-remove:hover {
    background: linear-gradient(135deg, #c82333, #a71e2a);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

.gallery-info {
    background-color: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 6px;
    padding: 10px;
}

.gallery-info small {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gallery-info i {
    color: #007bff;
    font-size: 14px;
}

.file-counter-info {
    margin-bottom: 8px;
    padding: 8px 12px;
    background-color: #e8f5e8;
    border: 1px solid #c3e6c3;
    border-radius: 6px;
}

.file-counter {
    color: #28a745 !important;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-counter::before {
    content: "📁";
    font-size: 16px;
}

/* Existing Gallery Styles */
.existing-gallery {
    margin-bottom: 20px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.gallery-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.gallery-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.gallery-thumbnail {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
}

.gallery-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.gallery-item:hover .gallery-actions {
    opacity: 1;
}

.delete-existing-image {
    background-color: rgba(220, 53, 69, 0.9);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.delete-existing-image:hover {
    background-color: rgba(220, 53, 69, 1);
}

.delete-existing-image i {
    font-size: 12px;
}

/* Drag and Drop States */
.upload-area.dragover {
    border-color: #28a745;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    transform: scale(1.02);
}

.upload-area.dragover .upload-icon {
    color: #28a745;
    animation: pulse 1s infinite;
}

/* Animations */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* Responsive Gallery Upload */
@media (max-width: 768px) {
    .image-gallery-upload {
        padding: 15px;
    }
    
    .upload-icon {
        font-size: 36px;
        margin-bottom: 10px;
    }
    
    .upload-text p {
        font-size: 14px;
    }
    
    .upload-hint {
        font-size: 12px;
    }
    
    .gallery-preview {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }
    
    .preview-item img {
        height: 100px;
    }
    
    .preview-remove {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }
}

@media (max-width: 576px) {
    .image-gallery-upload {
        padding: 12px;
    }
    
    .upload-area {
        min-height: 100px;
    }
    
    .upload-icon {
        font-size: 28px;
        margin-bottom: 8px;
    }
    
    .gallery-preview {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 8px;
    }
    
    .preview-item img {
        height: 80px;
    }
    
    .preview-remove {
        width: 20px;
        height: 20px;
        font-size: 10px;
    }
}

/* หน้ารายละเอียดคลังภูมิปัญญา (detail archive) */
.wrapper-detail-archive {
    padding-top: 20px;
    padding-bottom: 56px;
}

.detail-archive-featured {
    margin-bottom: 20px;
}

.detail-archive-title {
    color: var(--color-dark-brown);
    font-size: clamp(1.35rem, 3vw, 1.85rem);
    font-weight: 700;
}

.detail-archive-meta {
    font-size: 15px;
}

.detail-archive-hero img {
    width: 100%;
    border-radius: 18px;
    object-fit: cover;
    max-height: 520px;
}

.nan-info-panel {
    background-color: var(--color-dark-brown);
    color: #fff;
    border-radius: 16px;
    padding: 18px 20px;
    margin-bottom: 14px;
    box-shadow: 0 6px 20px rgba(125, 60, 38, 0.12);
}

.nan-info-panel__title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 14px;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 8px;
}

.nan-dl {
    margin: 0;
}

.nan-kv {
    margin-bottom: 12px;
}

.nan-kv:last-child {
    margin-bottom: 0;
}

.nan-kv dt {
    font-size: 0.82rem;
    opacity: 0.88;
    margin-bottom: 3px;
    font-weight: 500;
}

.nan-kv dd {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.45;
}

.nan-tag-wrap {
    margin-bottom: 12px;
}

.nan-tag {
    display: inline-block;
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
    padding: 6px 14px;
    font-size: 0.9rem;
}

.nan-instruments .nan-chip {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 5px 12px;
    margin: 3px 6px 3px 0;
    font-size: 0.85rem;
}

.nan-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.nan-action-tile {
    width: 92px;
    height: 92px;
    border-radius: 16px;
    background: linear-gradient(160deg, #e8d5c4, #d4bc9f);
    color: var(--color-dark-brown) !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
    padding: 8px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.nan-action-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(125, 60, 38, 0.15);
    color: #4a2416 !important;
}

.nan-action-tile i {
    font-size: 28px;
    margin-bottom: 6px;
}

.nan-action-tile--disabled {
    opacity: 0.38;
    cursor: not-allowed;
}

.nan-rich-text {
    color: #333;
    line-height: 1.75;
    font-size: 15px;
}

.detail-archive-related__title {
    color: var(--color-dark-brown);
    font-size: 1.25rem;
    font-weight: 700;
}

.archive-grid-related {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 18px;
}

@media (max-width: 1199px) {
    .archive-grid-related {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .archive-grid-related {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .archive-grid-related {
        grid-template-columns: 1fr;
    }

    .nan-action-tile {
        width: 80px;
        height: 80px;
    }
}