/* ================================================================
   assets/css/app.css — SDGs UDRU · Green × Gold × White Theme
   ================================================================ */

/* ── CSS Custom Properties (Design Tokens) ─────────────────── */
:root {
    --green-900: #0D3B20;
    --green-800: #155230;
    --green-700: #1A6B3C;
    --green-600: #1F7A45;
    --green-500: #26934F;
    --green-400: #3CAD65;
    --green-100: #E6F4EC;
    --green-50: #F2FAF5;

    --gold-600: #A07820;
    --gold-500: #C9A84C;
    --gold-400: #D4B96A;
    --gold-300: #E8D090;
    --gold-100: #FBF5E0;
    --gold-50: #FFFDF4;

    --gray-900: #1A1A1A;
    --gray-800: #2D2D2D;
    --gray-700: #444444;
    --gray-500: #6B7280;
    --gray-300: #D1D5DB;
    --gray-100: #F3F4F6;
    --gray-50: #F9FAFB;
    --white: #FFFFFF;

    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / .08), 0 1px 2px -1px rgb(0 0 0 / .06);
    --shadow-md: 0 4px 16px 0 rgb(0 0 0 / .10), 0 2px 6px -1px rgb(0 0 0 / .07);
    --shadow-lg: 0 10px 40px 0 rgb(0 0 0 / .12), 0 4px 12px -2px rgb(0 0 0 / .08);
    --shadow-gold: 0 4px 20px 0 rgb(201 168 76 / .25);

    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
}

/* ── Reset & Base ───────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans Thai', 'Sarabun', sans-serif;
    -webkit-font-smoothing: antialiased;
    background: var(--gray-50);
    color: var(--gray-900);
}

/* ── Gold Divider ───────────────────────────────────────────── */
.gold-divider {
    width: 48px;
    height: 3px;
    background: linear-gradient(90deg, var(--gold-500), var(--gold-300));
    border-radius: 9999px;
    margin: 12px 0 28px;
}

.gold-divider-center {
    margin-left: auto;
    margin-right: auto;
}

/* ── Navbar ─────────────────────────────────────────────────── */
#navbar {
    background: linear-gradient(135deg, var(--green-900) 0%, var(--green-800) 100%);
    border-bottom: 1px solid rgba(201, 168, 76, .2);
    backdrop-filter: blur(8px);
}

#navbar.scrolled {
    box-shadow: var(--shadow-lg);
}

.nav-link {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: .875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, .80);
    transition: all .2s;
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--gold-400);
    background: rgba(255, 255, 255, .08);
}

.nav-active {
    color: var(--gold-400) !important;
    background: rgba(201, 168, 76, .12) !important;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: .875rem;
    color: rgba(255, 255, 255, .80);
    transition: all .2s;
    cursor: pointer;
    width: 100%;
    text-align: left;
}

.mobile-nav-link:hover {
    background: rgba(255, 255, 255, .10);
    color: var(--gold-400);
}

/* ── Dropdown ───────────────────────────────────────────────── */
.sdg-dropdown-panel {
    background: var(--white);
    border: 1px solid var(--gray-100);
    border-top: 3px solid var(--gold-500);
    border-radius: 0 0 16px 16px;
    box-shadow: var(--shadow-lg);
}

/* ── Hero ───────────────────────────────────────────────────── */
.hero-section {
    position: relative;
    min-height: 580px;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
            rgba(13, 59, 32, .92) 0%,
            rgba(21, 82, 48, .80) 45%,
            rgba(26, 107, 60, .55) 100%);
    z-index: 1;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transform: scale(1.06);
    transition: transform 10s ease;
}

.hero-section:hover .hero-bg {
    transform: scale(1);
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 18px;
    border: 1px solid var(--gold-400);
    border-radius: 9999px;
    color: var(--gold-300);
    font-size: .8rem;
    letter-spacing: .05em;
    background: rgba(201, 168, 76, .1);
    backdrop-filter: blur(4px);
}

.hero-gold {
    color: var(--gold-400);
}

/* ── Stats Bar ──────────────────────────────────────────────── */
.stats-bar {
    background: linear-gradient(90deg, var(--green-900), var(--green-800));
    border-top: 1px solid rgba(201, 168, 76, .25);
    border-bottom: 1px solid rgba(201, 168, 76, .15);
}

.stat-item-value {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--gold-400);
    line-height: 1;
}

.stat-item-label {
    font-size: .72rem;
    color: rgba(255, 255, 255, .55);
    margin-top: 3px;
}

.stats-divider {
    width: 1px;
    height: 40px;
    background: linear-gradient(180deg, transparent, rgba(201, 168, 76, .3), transparent);
}

/* ── Section Layout ─────────────────────────────────────────── */
.section-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: .75rem;
    font-weight: 600;
    color: var(--gold-600);
    letter-spacing: .1em;
    text-transform: uppercase;
}

.section-label::before,
.section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-300));
}

.section-label::after {
    background: linear-gradient(90deg, var(--gold-300), transparent);
}

.section-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.25;
}

.section-subtitle {
    font-size: .9375rem;
    color: var(--gray-500);
    margin-top: 6px;
}

.section-divider {
    /* kept for compat */
    width: 48px;
    height: 3px;
    background: linear-gradient(90deg, var(--gold-500), var(--gold-300));
    border-radius: 9999px;
    margin: 12px 0 28px;
}

/* ── News Card ──────────────────────────────────────────────── */
.news-card {
    background: var(--white);
    border-radius: var(--radius-2xl);
    border: 1px solid var(--gray-100);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all .3s cubic-bezier(.4, 0, .2, 1);
    position: relative;
}

.news-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--gold-500), var(--gold-300));
    opacity: 0;
    transition: opacity .3s;
}

.news-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--gold-300);
}

.news-card:hover::after {
    opacity: 1;
}

.news-card-img {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/9;
    background: var(--gray-100);
}

.news-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .6s cubic-bezier(.4, 0, .2, 1);
}

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

.news-card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.news-card-title {
    font-size: .9375rem;
    font-weight: 600;
    color: var(--gray-900);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color .2s;
}

.news-card:hover .news-card-title,
.news-card-title a:hover {
    color: var(--green-700);
}

.news-card-excerpt {
    font-size: .8125rem;
    color: var(--gray-500);
    margin-top: 6px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.6;
}

.news-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--gray-100);
    font-size: .75rem;
    color: var(--gray-500);
}

/* ── SDG Badge ──────────────────────────────────────────────── */
.sdg-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 9999px;
    font-size: .7rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    line-height: 1.5;
}

/* ── SDG Chip (filter) ──────────────────────────────────────── */
.sdg-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px;
    border-radius: 12px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all .2s;
    min-width: 68px;
    background: var(--white);
    box-shadow: var(--shadow-sm);
}

.sdg-chip:hover {
    border-color: currentColor;
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.sdg-chip.active {
    border-color: currentColor;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, .08), var(--shadow-md);
    transform: translateY(-2px);
}

.sdg-chip img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.sdg-chip span {
    font-size: .7rem;
    font-weight: 700;
    line-height: 1;
}

/* ── Stat Card (SDG activity) ───────────────────────────────── */
.stat-card {
    background: var(--white);
    border-radius: var(--radius-2xl);
    border: 1px solid var(--gray-100);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all .3s;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-gold);
    border-color: var(--gold-300);
}

.stat-number {
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1;
}

.stat-label {
    font-size: .75rem;
    color: var(--gray-500);
    margin-top: 4px;
    line-height: 1.4;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: 10px;
    font-weight: 600;
    font-size: .875rem;
    transition: all .2s;
    cursor: pointer;
    border: none;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--green-700), var(--green-600));
    color: #fff;
    box-shadow: 0 4px 14px rgba(26, 107, 60, .3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--green-800), var(--green-700));
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(26, 107, 60, .4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-gold {
    background: linear-gradient(135deg, var(--gold-500), var(--gold-600));
    color: #fff;
    box-shadow: 0 4px 14px rgba(201, 168, 76, .3);
}

.btn-gold:hover {
    background: linear-gradient(135deg, var(--gold-600), var(--gold-500));
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--gray-300);
    color: var(--gray-700);
}

.btn-outline:hover {
    border-color: var(--gold-500);
    color: var(--gold-600);
    background: var(--gold-50);
}

.btn-outline-gold {
    background: transparent;
    border: 1.5px solid var(--gold-400);
    color: var(--gold-600);
}

.btn-outline-gold:hover {
    background: var(--gold-500);
    color: #fff;
}

.btn-danger {
    background: #ef4444;
    color: #fff;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-sm {
    padding: 6px 14px;
    font-size: .8125rem;
}

/* ── Form Inputs ────────────────────────────────────────────── */
.form-input {
    width: 100%;
    padding: 10px 16px;
    border-radius: 10px;
    border: 1.5px solid var(--gray-300);
    font-size: .875rem;
    color: var(--gray-900);
    background: var(--white);
    transition: all .2s;
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: var(--green-500);
    box-shadow: 0 0 0 3px rgba(26, 107, 60, .1);
}

.form-label {
    display: block;
    font-size: .875rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.form-error {
    font-size: .75rem;
    color: #ef4444;
    margin-top: 4px;
}

/* ── Upload Zone ────────────────────────────────────────────── */
.upload-zone {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-xl);
    padding: 28px 20px;
    text-align: center;
    cursor: pointer;
    transition: all .2s;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--gold-400);
    background: var(--gold-50);
}

/* ── Admin Sidebar ──────────────────────────────────────────── */
.admin-sidebar {
    background: linear-gradient(180deg, var(--green-900) 0%, #0a2e18 100%);
    min-height: 100vh;
    width: 260px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(201, 168, 76, .15);
}

.admin-sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    margin: 1px 8px;
    font-size: .875rem;
    color: rgba(255, 255, 255, .65);
    transition: all .2s;
}

.admin-sidebar-link:hover {
    background: rgba(255, 255, 255, .08);
    color: rgba(255, 255, 255, .9);
}

.admin-sidebar-link.active {
    background: linear-gradient(90deg, rgba(201, 168, 76, .2), rgba(201, 168, 76, .08));
    color: var(--gold-400);
    border-left: 3px solid var(--gold-500);
    padding-left: 11px;
}

.admin-sidebar-section {
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: rgba(201, 168, 76, .4);
    padding: 16px 22px 4px;
}

/* ── Table ──────────────────────────────────────────────────── */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--gray-500);
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.data-table td {
    padding: 12px 16px;
    font-size: .875rem;
    color: var(--gray-700);
    border-bottom: 1px solid var(--gray-100);
}

.data-table tbody tr:hover {
    background: var(--green-50);
}

.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-xl);
    border: 1px solid var(--gray-200);
}

/* ── Page Btn (pagination) ──────────────────────────────────── */
.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    font-size: .875rem;
    border: 1.5px solid var(--gray-200);
    color: var(--gray-600);
    transition: all .2s;
}

.page-btn:hover {
    border-color: var(--gold-500);
    color: var(--gold-600);
    background: var(--gold-50);
}

.page-btn.active {
    background: linear-gradient(135deg, var(--green-700), var(--green-600));
    border-color: transparent;
    color: #fff;
}

/* ── Footer ─────────────────────────────────────────────────── */
.footer-link {
    color: rgba(255, 255, 255, .5);
    transition: color .2s;
    font-size: .875rem;
}

.footer-link:hover {
    color: var(--gold-400);
}

.footer-social {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .08);
    color: rgba(255, 255, 255, .5);
    font-size: .8125rem;
    transition: all .2s;
    border: 1px solid rgba(255, 255, 255, .1);
}

.footer-social:hover {
    background: var(--gold-500);
    color: #fff;
    border-color: var(--gold-500);
    transform: translateY(-2px);
}

/* ── Gold accent card border ────────────────────────────────── */
.card-gold-border {
    border: 1px solid var(--gray-100);
    border-top: 3px solid var(--gold-500);
    border-radius: var(--radius-2xl);
    background: var(--white);
    box-shadow: var(--shadow-sm);
}

/* ── Preview Grid ───────────────────────────────────────────── */
.preview-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 12px;
}

.preview-item {
    position: relative;
    aspect-ratio: 1;
    background: var(--gray-100);
    border-radius: 10px;
    overflow: hidden;
}

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

.preview-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ef4444;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .7rem;
    cursor: pointer;
}

/* ── Line Clamp ─────────────────────────────────────────────── */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Animations ─────────────────────────────────────────────── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(28px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes shimmer {

    0%,
    100% {
        opacity: .6
    }

    50% {
        opacity: 1
    }
}

.fade-in-up {
    animation: fadeInUp .55s ease both;
}

.fade-in-left {
    animation: fadeInLeft .55s ease both;
}

.delay-100 {
    animation-delay: .10s;
}

.delay-200 {
    animation-delay: .20s;
}

.delay-300 {
    animation-delay: .30s;
}

.delay-400 {
    animation-delay: .40s;
}

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--green-600);
    border-radius: 3px;
}

/* ── Quill editor ───────────────────────────────────────────── */
.ql-editor {
    min-height: 260px;
    font-family: 'Noto Sans Thai', sans-serif;
    font-size: 14px;
}

/* ── News content richtext ──────────────────────────────────── */
.news-content {
    overflow-wrap: break-word;
    word-break: break-word;
    min-width: 0;
}

.news-content h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 28px 0 10px;
}

.news-content h3 {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--gray-800);
    margin: 20px 0 8px;
}

.news-content p {
    margin-bottom: 14px;
    line-height: 1.8;
    color: var(--gray-700);
}

.news-content ul,
.news-content ol {
    padding-left: 22px;
    margin-bottom: 14px;
}

.news-content li {
    margin-bottom: 4px;
    line-height: 1.7;
}

.news-content img {
    max-width: 100%;
    border-radius: 12px;
    margin: 16px auto;
    display: block;
}

.news-content a {
    color: var(--green-700);
    text-decoration: underline;
}

.news-content blockquote {
    border-left: 4px solid var(--gold-400);
    padding-left: 16px;
    color: var(--gray-600);
    font-style: italic;
    margin: 16px 0;
    background: var(--gold-50);
    border-radius: 0 8px 8px 0;
    padding: 12px 16px;
}