/*
Theme Name: Bazewp
Theme URI: https://example.com/bazewp
Author: Antigravity
Author URI: https://example.com
Description: A clean, modern theme for displaying a list of sites.
Version: 1.0.0
Text Domain: bazewp
*/

:root {
    --primary-color: #1A233D;
    --accent-color: #E91E63; /* Pink */
    --bg-color: #f9f9f9;
    --text-color: #333;
    --card-bg: #fff;
    --font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

.site-header-wrapper {
	background: #fff;
	border-bottom: 1px solid #eee;
}

/* Header */
.site-header {
    box-shadow: none;
    padding: 0 2rem; /* Remove vertical padding */
    height: 80px; /* Fixed height */
    display: flex;
    align-items: center;
    justify-content: space-between;
	max-width: 1400px;
	margin: 0 auto;
}

.site-branding {
    flex: 0 0 auto;
    margin-right: 3rem; /* Gap between logo and nav */
}

.site-branding h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: "Georgia", serif; /* Serif font for logo */
    color: #333;
}

.site-branding a {
    text-decoration: none;
    color: var(--primary-color);
}

.brand-dot {
    color: var(--accent-color); /* Pink dot */
}

.main-navigation {
	display: flex;
    height: 100%; /* Full height */
}

.main-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 2rem;
    height: 100%; /* Full height */
    align-items: stretch; /* Ensure li stretches */
}

.main-navigation li {
    margin: 0;
    height: 100%; /* Full height */
    display: flex;
    align-items: center; /* Center content vertically */
}

.main-navigation a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    height: 100%; /* Match header height */
    border-bottom: 2px solid transparent; /* Reserve space */
    padding: 0 5px; /* Horizontal padding only */
    box-sizing: border-box; /* Include border in height */
    position: relative; /* For positioning pseudo-element if needed, or just keeping border */
}

.main-navigation a:hover {
    color: var(--accent-color);
}

.main-navigation .current-menu-item a {
    color: var(--accent-color);
    border-bottom: 2px solid var(--accent-color); /* Pink underline for active */
}

/* Highlight Report menu on blog/post pages only (not on single-site pages) */
body.blog:not(.single-site) .main-navigation a[href*="/report"] {
    color: var(--accent-color);
    border-bottom: 2px solid var(--accent-color);
}

.header-right {
    flex: 0 0 auto;
}

.btn-login {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    background-color: var(--accent-color);
    color: #fff;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color 0.3s;
}

.btn-login:hover {
    background-color: #d81b60;
    color: #fff;
}

/* Hero Section */
.hero-wrapper {
	background-color: #fff;
    padding: 4rem 2rem;
    width: 100%;
    gap: 2rem;
}
.hero-section {
    max-width: 1200px;
    margin: 0 auto;
	display: flex;
    align-items: center;
    justify-content: space-between;
}

.hero-content {
    flex: 1;
    max-width: 600px;
}

.hero-content h2 {
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 1.5rem;
	margin-top: 0;
    color: var(--primary-color);
}

.hero-content .highlight {
    color: var(--accent-color);
}

.hero-content p {
    font-size: 1rem;
    color: #666;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.btn-hero {
    display: inline-block;
    padding: 0.8rem 2.5rem;
    background-color: var(--accent-color);
    color: #fff;
    text-decoration: none;
    border-radius: 30px;
    font-weight: 600;
    transition: background-color 0.3s;
}

.btn-hero:hover {
    background-color: #d81b60;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

#particle-logo-container {
    width: 100%;
    height: 100%;
    min-height: 400px;
}

#particle-logo-container canvas {
    display: block;
    width: 100% !important;
    height: auto !important;
}

/* Main Content */
.site-main {
    max-width: 1400px;
    margin: 3rem auto;
    padding: 0 2rem;
    background-color: #f9f9f9;
    width: 100%;
    box-sizing: border-box;
    /* 定義容器上下文 */
    container-type: inline-size;
    container-name: grid-container;
}

.page-title {
    display: none; /* Hide default page title on home if Hero is present */
}

/* Filters */
/* Filters */
.site-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 2rem;
    justify-content: center;
    padding: 0 1rem;
    align-items: center;
}

.filter-select {
    /* Hidden original select */
}

/* Keyword Search Section - Google Style */
.keyword-search-section {
    max-width: 700px;
    margin: 0 auto 2.5rem;
    padding: 0 1rem;
}

.keyword-search-wrapper {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #dfe1e5;
    border-radius: 24px;
    padding: 5px 8px 5px 20px;
    box-shadow: 0 1px 3px rgba(32, 33, 36, 0.08);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.keyword-search-wrapper:hover {
    box-shadow: 0 1px 6px rgba(32, 33, 36, 0.16);
    border-color: rgba(223, 225, 229, 0);
}

.keyword-search-wrapper:focus-within {
    box-shadow: 0 1px 6px rgba(32, 33, 36, 0.28);
    border-color: rgba(223, 225, 229, 0);
}

.keyword-search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 12px 16px 12px 0;
    font-size: 16px;
    background: transparent;
    color: #202124;
    font-family: var(--font-family);
}

.keyword-search-input::placeholder {
    color: #9aa0a6;
}

.keyword-search-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background-color: var(--accent-color);
    color: #fff;
    border: none;
    border-radius: 18px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.keyword-search-button:hover {
    background-color: #d81b60;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.keyword-search-button:active {
    transform: scale(0.98);
}

.keyword-search-button svg {
    width: 18px;
    height: 18px;
}

.sites-count-info {
    text-align: center;
    margin-bottom: 2rem;
    color: #999;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#reset-filters {
    padding: 0 .8rem;
    border: 1px solid #e0e0e0;
    border-radius: 0;
	height: 42px;
    background: #fff;
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
	border-radius: 5px;
}

#reset-filters:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* Select2 Customization */
.site-filters .select2-container--default .select2-selection--single {
    border: 1px solid #e0e0e0;
    border-radius: 0;
    height: 42px;
    display: flex;
    align-items: center;
    background-color: #fff;
    transition: border-color 0.3s;
	border-radius: 5px;
}

.site-filters .select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--primary-color);
}

.site-filters .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 42px;
    padding-left: 15px;
    color: #333;
    font-size: 0.9rem;
}

.site-filters .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 40px;
    right: 5px;
}

.site-filters .select2-container {
    min-width: 180px;
    margin-bottom: 0; /* Remove margin as we use gap in flex container */
}

.site-filters .select2-dropdown {
    border: 1px solid #e0e0e0;
    border-radius: 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.site-filters .select2-results__option {
    padding: 10px 15px;
    font-size: 0.9rem;
}

.site-filters .select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background-color: var(--primary-color);
    color: white;
}

.site-filters .select2-container--default .select2-selection--single .select2-selection__clear {
	position: absolute;
    right: 9px;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
	background:#fff;
	z-index: 10;	
}

.site-filters .select2-container--default .select2-selection--single .select2-selection__clear:hover {
    color: var(--accent-color);
}

.select2-container--default .select2-search--dropdown .select2-search__field {
	border: 1px solid #ccc!important;
	padding: .5rem;
}

.select2-container--default .select2-search--dropdown .select2-search__field:focus-visible {
    border: 1px solid #ccc!important;
	outline: 0!important;
}

/* Select2 Multiple Customization */
.site-filters .select2-container--default .select2-selection--multiple {
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    min-height: 42px;
    background-color: #fff;
    transition: border-color 0.3s;
    padding: 4px 30px 4px 5px;
    position: relative;
}

.site-filters .select2-container--default .select2-selection--multiple::after {
    content: "";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #888;
    pointer-events: none;
}

.site-filters .select2-container--default.select2-container--open .select2-selection--multiple {
    border-color: var(--primary-color);
}

.site-filters .select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: #f0f0f0;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    padding: 2px 8px 2px 5px;
    margin-right: 5px;
    margin-top: 4px;
    font-size: 0.85rem;
    color: #333;
    display: inline-flex;
    align-items: center;
}

.site-filters .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: #999;
    margin-right: 5px;
    border-right: 1px solid #ccc;
    padding-right: 5px;
    line-height: 1;
    font-weight: bold;
    font-size: 1.1em;
    display: inline-block;
    position: static; /* Reset any absolute positioning */
}

.site-filters .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: #d9534f;
    background: transparent;
    border-color: #999;
}

.site-filters .select2-container--default .select2-selection--multiple .select2-search__field {
    margin-top: 0;
    margin-left: 5px;
    height: 32px;
    line-height: 32px;
	font-size:14px;
	color: #666;
}

.site-filters .select2-container--default .select2-selection--multiple .select2-selection__clear {
	background:#fff;
	z-index: 10;
	margin-top: 0;
	top: 50%;
	transform: translateY(-50%);
	margin-right: 7px;
}

/* Sites Grid */
.sites-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 1px; /* 1px gap */
    background-color: #eee; /* Background color to show through gap as border if needed, or just tight spacing */
    padding: 1px; /* Border effect around grid */
    width: 100%;
    max-width: 100%;
	min-height: 50vh;
    box-sizing: border-box;
}

/* 使用 Container Queries */
@container grid-container (min-width: 600px) {
    .sites-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@container grid-container (min-width: 900px) {
    .sites-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@container grid-container (min-width: 1200px) {
    .sites-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.site-card {
    background: #fff; /* White background for cards */
    border-radius: 0;
    overflow: hidden; /* Changed to hidden to enable scroll effect */
    box-shadow: none;
    transition: opacity 0.3s;
    padding: 1rem; /* Add padding inside card */
    min-width: 0; /* Allow grid item to shrink below content size */
}

.site-card:hover {
    transform: none;
    opacity: 1;
    z-index: 1; /* Bring to front on hover if needed */
}

.site-card-image-link {
    display: block;
    text-decoration: none;
    cursor: pointer;
}

.site-card-image {
    height: 180px; /* Slightly smaller to fit content */
    background-color: #f0f0f0;
    background-size: cover;
    background-position: top center; /* Start from top */
    background-repeat: no-repeat;
    margin-bottom: 1rem;
    box-shadow: none; /* Remove shadow */
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
}

/* Animate background position on image hover only */
.site-card-image-link:hover .site-card-image {
    background-position: bottom center; /* Scroll to bottom */
    transition: background-position 6s ease .5s; /* 3s delay, then 6s scroll */
}

/* Image Loading Animation */
.site-card-image-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f0f0f0;
    z-index: 1;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.site-card-image-loader.hidden {
    opacity: 0;
    pointer-events: none;
}

.loader-dots {
    display: flex;
    gap: 4px;
    align-items: center;
}

.loader-dot {
    width: 6px;
    height: 6px;
    background-color: #E91D62;
    border-radius: 50%;
    animation: bounce 1.4s ease-in-out infinite;
}

.loader-dot:nth-child(1) {
    animation-delay: 0s;
}

.loader-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.loader-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    40% {
        transform: translateY(-8px);
        opacity: 1;
    }
}


.site-card-content {
    padding: 0;
}

.site-card-title {
    margin: 0 0 0.3rem;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #333;
}

.site-card-title a {
    text-decoration: none;
    color: var(--text-color);
}

.site-card-meta {
    font-size: 0.7rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.site-card-tech {
    font-size: 0.9rem;
    color: #666;
    border-top: 1px solid #f0f0f0;
    padding-top: 0.5rem;
}

.tech-item {
    margin-bottom: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tech-item .label {
    font-weight: 600;
    color: #333;
    margin-right: 0.3rem;
}

.tech-item.colors {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.color-swatches {
    display: inline-flex;
    gap: 0.3rem;
    align-items: center;
}

.color-swatch {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 3px;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.flag-lang {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
}

.flag-lang::before {
    font-size: 1rem;
}

/* Pagination */
.pagination {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    padding: 1rem;
    margin-top: 0;
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    z-index: 100;
    border-top: 1px solid #eee;
    transition: width 0.3s ease;
}

/* 當側邊欄打開時,分頁導覽限制在左側欄寬度內 */
body.panel-open .pagination {
    width: calc(100vw - var(--panel-width));
}

.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #fff;
    border: 1px solid #eee;
    color: #666;
    text-decoration: none;
    border-radius: 50%;
    transition: all 0.3s;
    cursor: pointer;
    font-size: 0.9rem;
}

.pagination .page-numbers.current,
.pagination .page-numbers:hover {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 2rem;
    padding-bottom: 120px; /* Space for fixed pagination */
    background: #fff;
    margin-top: 4rem;
    color: #999;
    font-size: 0.9rem;
}

/* Site Detail Panel */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    --panel-width: 0px;
}

body.panel-open {
    --panel-width: 50vw;
}

#primary {
    flex: 1;
    transition: width 0.3s ease;
}

.site-detail-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: var(--panel-width);
    height: 100vh;
    background: #fff;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    transform: translateX(100%);
    transition: transform 0.3s ease, width 0.3s ease;
    z-index: 1000;
    display: flex;
}

.site-detail-panel.open {
    transform: translateX(0);
}

/* 當側邊欄打開時，限制主要內容區塊寬度 */
body.panel-open {
    overflow-x: hidden;
}

body.panel-open .site-header,
body.panel-open .hero-section,
body.panel-open .site-main,
body.panel-open #primary,
body.panel-open .site-footer {
    width: calc(100vw - var(--panel-width)) !important;
    max-width: calc(100vw - var(--panel-width)) !important;
    margin-right: var(--panel-width) !important;
    margin-left: 0 !important; /* 確保靠左 */
    box-sizing: border-box;
    transition: all 0.3s ease;
}

/* 拖曳時禁用過渡動畫，避免延遲 */
body.is-resizing .site-detail-panel,
body.is-resizing .site-header,
body.is-resizing .hero-section,
body.is-resizing .site-main,
body.is-resizing #primary,
body.is-resizing .site-footer {
    transition: none !important;
}

/* Resize Handle */
.resize-handle {
    position: absolute;
    left: 0;
    top: 0;
    width: 5px;
    height: 100%;
    background: #ddd;
    cursor: ew-resize;
    transition: background 0.2s;
    z-index: 10;
}

.resize-handle:hover,
.resize-handle.dragging {
    background: var(--accent-color);
}

/* Panel Content */
.panel-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.panel-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
}

.close-panel {
	display: none;
    position: absolute;
    right: 10px;
	z-index: 100;
    top: 10px;
    background: #E91D62;
    border: none;
    font-size: 2rem;
    color: #fff;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
	border-radius: 50%;
}

.site-detail-panel.open .close-panel {
	display: flex;
}

.close-panel:hover {
    filter: brightness(1.1);
}

.panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 0 2rem;
}

/* Loading Spinner */
.loading-spinner {
    text-align: center;
    padding: 3rem;
    color: #999;
    font-size: 1.1rem;
}

.site-detail-content {
    display: none;
}

.site-detail-content.loaded {
    display: block;
}


/* Detail Content Styles */
.detail-section {
    margin-bottom: 2rem;
}

.detail-section h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #333;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 0.5rem;
}

.detail-row {
    display: flex;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.detail-label {
    font-weight: 600;
    color: #666;
    min-width: 120px;
}

.detail-value {
    flex: 1;
    color: #333;
}

.detail-value a {
    color: var(--accent-color);
    text-decoration: none;
}

.detail-value a:hover {
    text-decoration: underline;
}


/* Color Palette Display */
.color-palette {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.5rem;
}

.color-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}

.color-box {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    border: 1px solid #ddd;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.color-code {
    font-size: 0.75rem;
    color: #666;
    font-family: monospace;
}

.color-label {
    font-size: 0.7rem;
    color: #999;
    text-transform: uppercase;
}

/* New Detail Panel Styles */
.detail-banner {
    height: 30vh;
    background-size: cover;
    background-position: top left;
    background-repeat: no-repeat;
	margin: 0 -2rem;
	filter: brightness(0.8);
}

.detail-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #f0f0f0;
}

.detail-site-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0 0 0.75rem;
    color: #333;
}

.detail-site-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.detail-site-url {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
	background: var(--accent-color);
	border-radius: 100px;
	padding: 0.5rem 1rem;
	transition: all 0.2s;
}

.detail-site-url:hover {
    filter: brightness(1.1);
}

.detail-language-badge {
    display: inline-block;
    color: var(--primary-color);
    font-size: 0.75rem;
    font-weight: 600;
}

.detail-description {
    padding: 1.5rem 2rem;
    background: #f9f9f9;
    margin: 0;
}

.detail-description p {
    margin: 0;
    line-height: 1.6;
    color: #666;
}


.detail-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.info-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 1.25rem;
    transition: box-shadow 0.2s;
}

.info-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.info-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #ccc;
}

.info-item {
    margin-bottom: 0.75rem;
}

.info-item:last-child {
    margin-bottom: 0;
}

.info-label {
    font-weight: 600;
    color: #666;
    margin-bottom: 0.25rem;
    font-size: 0.85rem;
}

.info-value {
    color: #333;
    line-height: 1.5;
    word-break: break-word;
}

.info-value a {
    color: #666;
    text-decoration: none;
}

.info-value a:hover {
    text-decoration: none;
}

.tag-link {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    background: #f0f0f0;
    color: #666;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.85rem;
    transition: all 0.2s;
    margin: .2rem;
}

.tag-link:hover {
    background: var(--accent-color);
    color: #fff;
    text-decoration: none;
}


.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}


.social-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    background: #f0f0f0;
    color: #666;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.social-link svg {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

.social-link:hover {
    background: var(--accent-color);
    color: #fff;
}

.detail-full-screenshot {
    padding: 2rem;
    background: #efefef;
    margin: 2rem -2rem;

}

.detail-full-screenshot h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 1rem;
    color: #333;
}

.detail-full-screenshot img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    display: block;
}

/* Responsive */
@media (max-width: 768px) {
    .site-detail-panel {
        width: 100%!important;
    }
    
    .resize-handle {
        display: none;
    }
    
    .detail-info-grid {
        grid-template-columns: 1fr;
    }
    
    .detail-site-title {
        font-size: 1.5rem;
    }
}

/* Related Sites Section */
.related-sites-wrapper {
    width: 100%;  /* 重要：body 是 flex container，需要明確設定寬度 */
    max-width: 1200px;
    margin: 4rem auto 0;
    padding: 0 1rem 4rem;
    box-sizing: border-box;
}

.related-sites-section {
    margin-bottom: 3rem;
}

.related-sites-container {
    container-type: inline-size;
    container-name: grid-container;
}

/* Override styles for related sites grid */
.related-sites-wrapper .sites-grid {
    min-height: auto;
    background-color: transparent;
    padding: 0;
    gap: 1rem;
}

.related-sites-wrapper .site-card {
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: visible;
}

.related-sites-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #eee;
    color: #333;
}

/* ==================== Mobile Menu Toggle ==================== */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    width: 44px;
    height: 44px;
    position: relative;
    z-index: 101;
}

.hamburger-line {
    display: block;
    position: absolute;
    left: 8px;
    right: 8px;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.hamburger-line:nth-child(1) {
    top: 12px;
}

.hamburger-line:nth-child(2) {
    top: 20px;
}

.hamburger-line:nth-child(3) {
    top: 28px;
}

/* Hamburger animation when open - X shape */
.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    top: 20px;
    transform: rotate(45deg);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    top: 20px;
    transform: rotate(-45deg);
}

/* ==================== Mobile Responsive (768px) ==================== */
@media (max-width: 768px) {
    /* Header */
    .site-header {
        padding: 0 1rem;
        height: 60px;
        position: relative;
        flex-wrap: nowrap;
        overflow: visible;
    }

    .site-branding {
        flex: 1;
        margin-right: 0;
    }

    .site-branding h1 {
        font-size: 1.3rem;
    }

    /* Main Navigation - push to right */
    .main-navigation {
        flex: 0 0 auto;
        margin-right: 0;
        margin-left: auto;
        position: static;
        height: auto;
    }

    /* Show hamburger menu */
    .mobile-menu-toggle {
        display: flex;
        flex-shrink: 0;
    }


    .main-navigation ul,
    .main-navigation > div { /* For wp_nav_menu wrapper */
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: #fff;
        flex-direction: column;
        padding: 0;
        gap: 0;
        height: auto;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease, box-shadow 0.3s ease;
        box-shadow: none;
        z-index: 100;
    }

    .main-navigation.open ul,
    .main-navigation.open > div {
        max-height: calc(100vh - 60px);
        overflow-y: auto;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }

    .main-navigation ul {
        position: static;
        max-height: none;
        overflow: visible;
        box-shadow: none;
    }

    .main-navigation.open ul {
        display: flex;
    }

    .main-navigation li {
        height: auto;
        border-bottom: 1px solid #eee;
    }

    .main-navigation li:last-child {
        border-bottom: none;
    }

    .main-navigation a {
        height: auto;
        padding: 1rem 1.5rem;
        border-bottom: none;
        display: block;
        width: 100%;
    }

    .main-navigation .current-menu-item a {
        border-bottom: none;
        background: #f9f9f9;
    }

    /* Hide login button in nav on mobile (keep it if needed, or move to menu) */
    .header-right {
        display: none;
    }

    /* Hero Section - Single Column */
    .hero-wrapper {
        padding: 2rem 1rem;
    }

    .hero-section {
        flex-direction: column;
        text-align: center;
    }

    .hero-content {
        max-width: 100%;
        order: 2;
    }

    .hero-content h2 {
        font-size: 1.8rem;
    }

    .hero-image {
        order: 1;
        min-height: 250px;
        max-width: 250px;
        margin: 0 auto 1.5rem;
    }

    #particle-logo-container {
        min-height: 250px;
    }

    /* Main Content */
    .site-main {
        padding: 0 1rem;
        margin: 1.5rem auto;
    }

    /* Sites Grid */
    .sites-grid {
        gap: 1rem;
        padding: 0;
    }

    .site-card {
        padding: 0.8rem;
    }

    .site-card-image {
        height: 150px;
    }

    /* Filters */
    .site-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .site-filters .select2-container {
        width: 100% !important;
    }

    /* Pagination */
    .pagination {
        padding: 0.8rem;
    }

    .pagination .page-numbers {
        width: 35px;
        height: 35px;
        font-size: 0.85rem;
    }

    /* Footer */
    .site-footer {
        padding: 1.5rem 1rem;
        padding-bottom: 70px;
    }

    /* Panel */
    .site-detail-panel {
        width: 100% !important;
    }

    .resize-handle {
        display: none;
    }

    .detail-info-grid {
        grid-template-columns: 1fr;
    }

    .detail-site-title {
        font-size: 1.5rem;
    }

    .detail-banner {
        height: 200px !important;
    }

    .detail-header {
        padding: 1rem;
    }

    .detail-description {
        padding: 1rem;
    }

    .detail-info-grid {
        padding: 0 1rem !important;
    }

    .panel-body {
        padding: 0;
    }

    /* Related Sites */
    .related-sites-wrapper {
        padding: 0 1rem 2rem;
        margin-top: 2rem;
    }

    .related-sites-title {
        font-size: 1.2rem;
    }
}

/* ==================== Smaller Mobile (480px) ==================== */
@media (max-width: 480px) {
    .hero-content h2 {
        font-size: 1.5rem;
    }

    .hero-content p {
        font-size: 0.9rem;
    }

    .btn-hero {
        padding: 0.7rem 2rem;
        font-size: 0.9rem;
    }

    .site-card-title {
        font-size: 0.8rem;
    }

    .site-card-meta {
        font-size: 0.65rem;
    }
}
