/* Accessible Color Palette */
:root {
    --gh-color-all: #595959;
    /* Gray for All */
    --gh-color-1: #0d6efd;
    /* Blue */
    --gh-color-2: #198754;
    /* Green */
    --gh-color-3: #c82333;
    /* Red (Darkened) */
    --gh-color-4: #6610f2;
    /* Indigo */
    --gh-color-5: #d63384;
    /* Pink */
    --gh-color-6: #fd7e14;
    /* Orange */
    --gh-color-7: #008080;
    /* Teal */
    --gh-color-8: #8540f5;
    /* Purple */
}

/* Dynamic Color Classes */
.gas-hero-color-all {
    --gh-theme: var(--gh-color-all);
}

.gas-hero-color-0 {
    --gh-theme: var(--gh-color-1);
}

.gas-hero-color-1 {
    --gh-theme: var(--gh-color-2);
}

.gas-hero-color-2 {
    --gh-theme: var(--gh-color-3);
}

.gas-hero-color-3 {
    --gh-theme: var(--gh-color-4);
}

.gas-hero-color-4 {
    --gh-theme: var(--gh-color-5);
}

.gas-hero-color-5 {
    --gh-theme: var(--gh-color-6);
}

.gas-hero-color-6 {
    --gh-theme: var(--gh-color-7);
}

.gas-hero-color-7 {
    --gh-theme: var(--gh-color-8);
}

/* Container */
.gas-hero-container {
    /* max-width: 1200px; */
    margin: 0 auto;
    padding: 20px;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/* Filter Bar */
.gas-hero-filter-bar {
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: left;
}

.gas-hero-badge {
    background-color: transparent;
    color: var(--gh-theme, #333);
    border: 1px solid var(--gh-theme, #ddd);
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.gas-hero-badge:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.gas-hero-badge.active {
    background-color: var(--gh-theme, #007bff);
    color: white;
    border-color: var(--gh-theme, #007bff);
}

/* List Layout (Vertical Stack) */
.gas-hero-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Card Style (Horizontal) */
.gas-hero-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: row;
    /* Horizontal layout */
    align-items: flex-start;
    /* Align to top */
}

.gas-hero-card-img-container {
    width: 240px;
    /* Fixed width for image column */
    height: auto;
    max-height: 180px;
    /* Limit height to prevent too tall images */
    /* Remove fixed/min height constraint */
    overflow: hidden;
    background-color: #f0f0f0;
    flex-shrink: 0;
    /* Prevent shrinking */
    align-self: flex-start;
    /* Align to top, don't stretch */
    position: relative;
    display: flex;
    align-items: center;
    /* Center vertically if we wanted, but for crop top alignment is usually better or center */
    justify-content: center;
}

.gas-hero-card-img {
    width: 100%;
    height: auto;
    /* Allow natural height */
    display: block;
    /* Remove bottom space */
    object-fit: cover;
    /* Ensure image fits */
    transition: transform 0.3s;
    position: static;
    /* Flow naturally */
}

.gas-hero-card:hover .gas-hero-card-img {
    transform: scale(1.05);
}

.gas-hero-card-body {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* RWD: Stack vertically on small screens */
@media (max-width: 768px) {
    .gas-hero-card {
        flex-direction: column;
    }

    .gas-hero-card-img-container {
        width: 100%;
        height: auto;
    }
}

.gas-hero-card-title {
    font-size: 1.125rem;
    font-weight: bold;
    margin-bottom: 10px;
    color: #007bff;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.4;
}

.gas-hero-card-title:hover {
    text-decoration: underline;
}

.gas-hero-card-title:focus {
    outline: 2px solid #0d6efd;
    background-color: #ffeb3b;
    /* High contrast yellow background */
    color: #000;
    text-decoration: none;
}

.gas-hero-card-meta {
    font-size: 0.8125rem;
    color: #666;
    margin-bottom: 10px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.gas-hero-tag {
    background-color: var(--gh-theme, #666);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
}

.gas-hero-card-text {
    font-size: 0.875rem;
    color: #333;
    line-height: 1.6;
    white-space: pre-wrap;
    /* 保留換行 */
}

/* Modal Styles */
.gas-hero-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.gas-hero-modal.open {
    opacity: 1;
    visibility: visible;
}

.gas-hero-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.gas-hero-modal-dialog {
    position: relative;
    background: white;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    overflow-y: auto;
    /* Enable scrolling on the dialog itself */
    transform: translateY(-20px);
    transition: transform 0.3s ease;
    display: block;
    /* Ensure block layout */
}

.gas-hero-modal-content {
    /* Reset flex properties */
    display: block;
    height: auto;
}

.gas-hero-modal.open .gas-hero-modal-dialog {
    transform: translateY(0);
}

.gas-hero-modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: start;
}

.gas-hero-modal-title {
    margin: 0;
    font-size: 1.25rem;
    color: #333;
}

.gas-hero-modal-close {
    background: none;
    border: none;
    font-size: 1.75rem;
    line-height: 1;
    color: #999;
    cursor: pointer;
    padding: 0;
    margin-left: 10px;
}

.gas-hero-modal-close:hover {
    color: #333;
}

.gas-hero-modal-body {
    padding: 20px;
    /* Remove internal scrolling constraints */
    overflow-y: visible;
    flex: none;
    min-height: auto;
}

.gas-hero-modal-info {
    margin-bottom: 15px;
    color: #666;
    font-size: 0.875rem;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 10px;
}

.gas-hero-modal-text {
    line-height: 1.8;
    color: #333;
    white-space: pre-wrap;
    margin-bottom: 20px;
}

/* Hero Modal Content Styles */
.gas-hero-modal-section-title {
    font-size: 1.1rem;
    font-weight: bold;
    color: #004488;
    margin: 20px 0 10px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 2px solid #eee;
    padding-bottom: 5px;
}

.gas-hero-modal-file-list {
    margin-bottom: 20px;
}

.gas-hero-file-item {
    padding: 5px 0;
}

.gas-hero-file-item a {
    color: #0d6efd;
    text-decoration: none;
    font-size: 0.95rem;
}

.gas-hero-file-item a:hover {
    text-decoration: underline;
}

.gas-hero-modal-images {
    /* Container for the whole section (Title + List) */
    display: block;
}

.gas-hero-modal-image-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.gas-hero-modal-img {
    max-width: 200px;
    height: auto;
    border-radius: 4px;
    border: 1px solid #ddd;
    display: block;
    margin-bottom: 10px;
}

/* Pagination */
.gas-hero-pagination {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.gas-hero-page-btn {
    border: 1px solid #ddd;
    background-color: white;
    padding: 8px 12px;
    min-width: 36px;
    border-radius: 4px;
    cursor: pointer;
    color: #333;
    transition: all 0.2s;
}

.gas-hero-page-btn:hover:not(:disabled) {
    background-color: #e9ecef;
    border-color: #dee2e6;
}

.gas-hero-page-btn.active {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
}

.gas-hero-page-btn:disabled {
    color: #ccc;
    cursor: not-allowed;
    background-color: #f8f9fa;
}