/*
Theme Name: NUS Civic Reslience Lab Theme
Author: 
Author URI: 
Theme URI: 
Tags: full-site-editing, block-patterns
Text Domain: 
Requires at least: 6.4
Requires PHP: 7.4
Tested up to: 6.4
Version: 1.2

License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/

/* WordPress Editor Specific Fixes */
.wp-admin .editor-styles-wrapper,
.editor-styles-wrapper,
.block-editor-writing-flow {
    overflow: auto !important;
    height: auto !important;
}

/* Ensure scrolling works in WordPress admin and editor */
.wp-admin body,
.editor-styles-wrapper body {
    overflow: auto !important;
    height: auto !important;
}

/* WordPress Editor: Keep left panel fixed, only right content scrolls */
.wp-admin .main-grid,
.editor-styles-wrapper .main-grid {
    overflow: hidden !important;
}

.wp-admin .left-panel,
.editor-styles-wrapper .left-panel {
    overflow: hidden !important;
    height: 100% !important;
    position: sticky !important;
    top: 0 !important;
}

.wp-admin .scroll-content,
.editor-styles-wrapper .scroll-content {
    overflow-y: auto !important;
    height: 100% !important;
}

.wp-admin .content-wrapper,
.editor-styles-wrapper .content-wrapper {
    overflow: hidden !important;
}

html {
	scroll-behavior: smooth;
}

@media screen and (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
}

body {
	-moz-osx-font-smoothing: grayscale;
	-webkit-font-smoothing: antialiased;
}

/* --- 1. Global base styles --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #fff;
    color: #000;
    line-height: 1.4;
    display: block;
    height: auto;
    overflow: visible;
}

/* --- 2. Header area (fixed) --- */
.header {
    border-bottom: 1px solid #000; 
    flex-shrink: 0; /* Prevent compression */
}

.header-top {
    padding: 15px 0;
    border-bottom: 1px solid #000; 
}

.logo-nus {
    height: 35px;
    display: block;
}


.header-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    padding-bottom: 40px; 
}

.brand {
    font-weight: 700;
    font-size: 20px;
}

.wp-block-query-pagination {
    display: flex !important;
    align-items: center;
    gap: 12px; 
    margin-top: 40px;
}  

/* 2. 页码数字样式 */
.wp-block-query-pagination-numbers {
    display: flex !important;
    align-items: center;
    gap: 8px;
} 

.wp-block-query-pagination-numbers a, 
.wp-block-query-pagination-numbers span {
    text-decoration: none !important;
    /* 按照要求改为 13px */
    font-size: 13px !important;
    color: #333 !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    /* 微调容器大小以匹配小字号，保持正方形 */
    width: 30px !important; 
    height: 30px !important;
    aspect-ratio: 1 / 1 !important;
    transition: background-color 0.2s ease;
}

/* 当前页：183FF5 正方形 */
.wp-block-query-pagination-numbers .current {
    background-color: #183FF5 !important;
    color: #ffffff !important;
    border-radius: 0px !important;
    font-weight: bold;
}

/* 3. 左右箭头按钮通用样式 */
.wp-block-query-pagination-previous, 
.wp-block-query-pagination-next {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 40px !important;
    height: 40px !important;
    background-color: #183FF5 !important;
    border-radius: 50% !important;
    position: relative !important;
    cursor: pointer;
    overflow: hidden !important;
    text-indent: -999em !important;
    /* 确保悬浮时不产生任何位移 */
    transform: none !important;
}

/* 悬浮状态保持稳定 */
.wp-block-query-pagination-previous:hover, 
.wp-block-query-pagination-next:hover {
    transform: none !important;
    background-color: #183FF5 !important;
}

/* 4. 注入安全编码后的简约 SVG 箭头 */
.wp-block-query-pagination-previous::after, 
.wp-block-query-pagination-next::after {
    content: "" !important;
    display: block !important;
    width: 18px !important;
    height: 18px !important;
    background-color: #ffffff !important;
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
}

/* 左箭头 - 已编码 */
.wp-block-query-pagination-previous::after {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M15 19l-7-7 7-7'/%3E%3C/svg%3E");
}

/* 右箭头 - 已编码 */
.wp-block-query-pagination-next::after {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M9 5l7 7-7 7'/%3E%3C/svg%3E");
}

/* 针对桌面端（大屏幕）开启吸顶 */
@media (min-width: 960px) {
    /* 1. 确保父级容器（Columns）不对齐拉伸，否则 sticky 无效 */
    .wp-block-columns {
        align-items: flex-start !important;
    }

    /* 2. 锁定特定列 */
    .sticky-column {
        position: -webkit-sticky !important;
        position: sticky !important;
            top: var(--wp--custom--header--height, 126.412px) !important;
        z-index: 10;
        /* 强制优先级，防止被内容挤压 */
        flex-shrink: 0 !important;
    }
}

/* 3. 手机端（小屏幕）建议取消吸顶，以免遮挡内容 */
@media (max-width: 959px) {
    .sticky-column {
        position: static !important;
    }
}

/* 确保 Header 始终在所有内容之上 */
body .wp-block-template-part-header,
body header, 
body .header-container-class { /* 请替换为你 Header 容器的具体类名 */
    position: sticky !important;
    top: 0;
    z-index: 9999 !important; /* 赋予极高的层级 */
    background-color: #ffffff; /* 确保 Header 有背景色，否则滚动时内容会透出来 */
}

/* 降低下方滚动内容的层级，防止冲突 */
body .wp-block-group, 
body .wp-block-image {
    z-index: 1;
}