/* ===================================
   Modern SDG Impact Page Styles
   =================================== */

:root {
    --primary-color: #003C71;
    --secondary-color: #009CDE;
    --accent-color: #00B4E0;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --bg-light: #f8f9fa;
    --shadow-sm: 0 2px 4px #FFFF;
    --shadow-md: 0 4px 6px #FFFF;
    --shadow-lg: 0 10px 25px #FFFF;
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ===================================
   Hero Section Enhancements
   =================================== */

.hero-wrap {
    position: relative;
    overflow: hidden;
    min-height: 300px;
    max-height: 750px;
}

.hero-wrap .overlay {

    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.hero-wrap .container {
    position: relative;
    z-index: 2;
}

.hero-wrap .bread {
    font-weight: 700;
    letter-spacing: 1px;
    animation: fadeInUp 0.8s ease-out;
   
}

/* ===================================
   Section Header - Minimalist Modern Design
   =================================== */

.heading-section {
    position: relative;
    padding: 1rem 1.5rem 0.75rem 1.5rem;
    margin-bottom: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

.heading-section::before,
.heading-section::after {
    display: none;
}

.heading-section .subheading {
    display: none; /* ซ่อน subheading */
}

.heading-section h2 {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
    text-align: center;
}

.heading-section img {
    display: none; /* ซ่อน logo */
}

/* Divider line under title */
.heading-section h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--secondary-color);
    margin: 0.5rem auto 0;
    border-radius: 2px;
}

/* ===================================
   SDG Icons Grid - No Space, Compact
   =================================== */

.sdg-grid-container {
    padding: 0;
    margin: 0;
    background: transparent;
}

.sdg-icons-row-wrapper {
    position: relative;
    padding: 0;
    margin: 0;
}

.sdg-icons-row {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0;
    overflow-x: visible;
    max-width: 100%;
    margin: 0;
}

/* SDG Icon Wrapper - Compact Size */
.sdg-icon-wrapper {
    position: relative;
    flex: 0 0 auto;
    width: 65px;
    height: 65px;
    transition: transform var(--transition-normal);
    display: inline-block;
}

@media (max-width: 1600px) {
    .sdg-icon-wrapper {
        width: 58px;
        height: 58px;
    }
    
    .sdg-icons-row {
        gap: 0.2rem;
    }
}

@media (max-width: 1400px) {
    .sdg-icon-wrapper {
        width: 54px;
        height: 54px;
    }
    
    .sdg-icons-row {
        gap: 0.2rem;
    }
}

@media (max-width: 1200px) {
    .sdg-icon-wrapper {
        width: 50px;
        height: 50px;
    }
    
    .sdg-icons-row {
        gap: 0.15rem;
    }
}

@media (max-width: 992px) {
    .sdg-icon-wrapper {
        width: 46px;
        height: 46px;
    }
    
    .sdg-icons-row {
        gap: 0.15rem;
        padding: 0.3rem 0;
    }
}

@media (max-width: 768px) {
    .sdg-icons-row {
        overflow-x: auto;
        justify-content: flex-start;
    }
    
    .sdg-icon-wrapper {
        width: 60px;
        height: 60px;
    }
    
    .sdg-icons-row {
        gap: 0.25rem;
    }
}

@media (min-width: 1800px) {
    .sdg-icon-wrapper {
        width: 70px;
        height: 70px;
    }
    
    .sdg-icons-row {
        gap: 0.3rem;
    }
}

.sdg-icon-wrapper a {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 1px 3px #ffffff;
    transition: all var(--transition-normal);
    height: 100%;
    width: 100%;
    border: 2px solid transparent;
}

.sdg-icon-wrapper a.active {
    border-color: var(--secondary-color);
    box-shadow: 0 2px 8px rgba(0, 156, 222, 0.3);
}

.sdg-icon-wrapper a img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--transition-fast);
}

.sdg-icon-wrapper a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ffffff;
    opacity: 0;
    transition: opacity var(--transition-fast);
    z-index: 1;
    pointer-events: none;
}

.sdg-icon-wrapper:hover {
    transform: translateY(-3px) scale(1.05);
    z-index: 10;
}

.sdg-icon-wrapper:hover a {
    box-shadow: 0 4px 12px #FFFF;
}

.sdg-icon-wrapper:hover a::before {
    opacity: 1;
}

.sdg-icon-wrapper:hover a img {
    transform: scale(1.03);
}

/* Scroll Hint Indicators - Hidden for all visible layout */
.sdg-icons-row-wrapper::before,
.sdg-icons-row-wrapper::after {
    display: none;
}

/* ===================================
   SDG Detail Content Section
   =================================== */


.sdg-detail-section h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid;
    position: relative;
    animation: slideInLeft 0.8s ease-out;
}

.sdg-detail-section h2::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 100px;
    height: 3px;
    background: #ffffff;
    opacity: 0.3;
}

/* ===================================
   Metrics Section
   =================================== */

.metric-item {
    background: var(--bg-light);
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    transition: all var(--transition-normal);
    border-left: 4px solid var(--primary-color);
    animation: slideInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.metric-item:nth-child(1) { animation-delay: 0.1s; }
.metric-item:nth-child(2) { animation-delay: 0.2s; }
.metric-item:nth-child(3) { animation-delay: 0.3s; }
.metric-item:nth-child(4) { animation-delay: 0.4s; }
.metric-item:nth-child(5) { animation-delay: 0.5s; }

.metric-item:hover {
    transform: translateX(10px);
    box-shadow: var(--shadow-md);
    background: #ffff;
}

.metric-item h4 {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    font-size: 1.25rem;
}

.metric-item h4 i {
    margin-right: 0.75rem;
    color: var(--secondary-color);
    font-size: 1.5rem;
}

/* ===================================
   Indicator Links
   =================================== */

.indicator-link {
    display: block;
    padding: 1rem 1.5rem;
    margin: 0.75rem 0;
    background: #fff;
    border-radius: 10px;
    text-decoration: none;
    transition: all var(--transition-normal);
    border-left: 3px solid transparent;
    box-shadow: var(--shadow-sm);
}

.indicator-link h5 {
    color: var(--primary-color);
    font-size: 1rem;
    font-weight: 500;
    margin: 0;
    transition: color var(--transition-fast);
    display: flex;
    align-items: center;
}

.indicator-link h5 i {
    margin-right: 0.5rem;
    transition: transform var(--transition-fast);
}

.indicator-link:hover {
    transform: translateX(5px);
    border-left-color: var(--secondary-color);
    box-shadow: var(--shadow-md);
    background: linear-gradient(to right, #fff 0%, #f0f8ff 100%);
}

.indicator-link:hover h5 {
    color: var(--secondary-color);
}

.indicator-link:hover h5 i {
    transform: translateX(5px);
}

/* ===================================
   Responsive Adjustments
   =================================== */

@media (max-width: 767px) {
    .sdg-detail-section {
        padding: 1.5rem;
    }
    
    .sdg-detail-section h2 {
        font-size: 1.75rem;
    }
    
    .metric-item {
        padding: 1.5rem;
    }
}

/* ===================================
   Animations
   =================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===================================
   Smooth Scroll
   =================================== */

html {
    scroll-behavior: smooth;
}

/* ===================================
   Loading Animation
   =================================== */

.sdg-loading {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 5px solid var(--bg-light);
    border-radius: 50%;
    border-top-color: var(--secondary-color);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===================================
   Utility Classes
   =================================== */

.text-gradient {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.card-hover {
    transition: all var(--transition-normal);
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* ===================================
   Accessibility Improvements
   =================================== */

.sdg-icon-wrapper a:focus,
.indicator-link:focus {
    outline: 3px solid var(--secondary-color);
    outline-offset: 3px;
}

/* ===================================
   Print Styles
   =================================== */

@media print {
    .hero-wrap,
    .sdg-icon-wrapper:hover {
        transform: none;
    }
    
    .sdg-detail-section {
        box-shadow: none;
        page-break-inside: avoid;
    }
}

/* ===================================
   Dark Mode Support (Optional)
   =================================== */

@media (prefers-color-scheme: dark) {
    :root {
        --bg-light: #ffffff;
        --text-dark: #e0e0e0;
        --text-light: #b0b0b0;
    }
}

/* ===================================
   Custom Scrollbar
   =================================== */

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}