/* ========== Solutions Page Styles v2.0 ========== */

/* ===== List Mode — Blog-style Hero ===== */
.solutions-list-hero {
    position: relative;
    min-height: 320px;
    display: flex;
    align-items: flex-end;
    background: url('/img/solutions-hero.jpg') center/cover no-repeat;
    background-color: #1a3a5c;
}

.solutions-list-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.3) 100%);
}

.solutions-list-hero-content {
    position: relative;
    z-index: 1;
    padding: 2.5rem 3rem 2rem;
    color: #fff;
    width: 100%;
    max-width: 720px;
}

.solutions-list-hero .hero-title {
    font-size: 2.4rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 8px rgba(0,0,0,0.35);
    letter-spacing: 0.02em;
}

.solutions-list-hero .hero-subtitle {
    font-size: 1.05rem;
    opacity: 0.9;
    margin-bottom: 1.25rem;
    text-shadow: 0 1px 4px rgba(0,0,0,0.3);
    line-height: 1.6;
}

.hero-tabs {
    display: flex;
    gap: 0.5rem;
}

.hero-tab {
    padding: 0.5rem 1.25rem;
    border: 2px solid rgba(255,255,255,0.5);
    border-radius: 50px;
    background: transparent;
    color: rgba(255,255,255,0.85);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    backdrop-filter: blur(4px);
}

.hero-tab:hover {
    border-color: #fff;
    color: #fff;
    background: rgba(255,255,255,0.15);
}

.hero-tab.active {
    background: #fff;
    color: #1a3a5c;
    border-color: #fff;
}

/* ===== Solutions Intro Article ===== */
.solutions-intro {
    padding: 4rem 0 2rem;
    background: var(--bs-body-bg);
}

.intro-article {
    max-width: 960px;
    margin: 0 auto;
}

.intro-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.intro-eyebrow {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--bs-primary);
    margin-bottom: 0.75rem;
}

.intro-title {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--bs-body-color);
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.intro-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--bs-primary);
    border-radius: 2px;
    margin: 0.75rem auto 0;
}

.intro-lead {
    font-size: 1.15rem;
    color: var(--bs-secondary-color);
    line-height: 1.7;
    max-width: 720px;
    margin: 0 auto;
}

.intro-body {
    font-size: 1rem;
    line-height: 1.85;
    color: var(--bs-body-color);
    margin-bottom: 2.5rem;
}

.intro-body p {
    margin-bottom: 1.25rem;
}

/* Feature cards */
.intro-features {
    margin: 3rem 0;
}

.intro-feature-card {
    text-align: center;
    padding: 2rem 1.5rem;
    border-radius: 14px;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    height: 100%;
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}

.intro-feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
    border-color: var(--bs-primary);
}

.intro-feature-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--bs-primary), #1a3a5c);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    font-size: 1.75rem;
}

.intro-feature-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--bs-body-color);
}

.intro-feature-desc {
    font-size: 0.92rem;
    color: var(--bs-secondary-color);
    line-height: 1.65;
    margin: 0;
}

/* Applications section */
.intro-applications {
    margin-top: 3rem;
    padding: 2rem;
    background: var(--bs-secondary-bg);
    border-radius: 14px;
}

.intro-section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--bs-body-color);
    margin-bottom: 1rem;
    padding-left: 1rem;
    border-left: 4px solid var(--bs-primary);
}

.intro-applications p {
    line-height: 1.8;
    margin-bottom: 1rem;
}

.intro-application-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
}

.intro-application-list li {
    padding: 0.65rem 1rem 0.65rem 2.25rem;
    background: var(--bs-body-bg);
    border-radius: 8px;
    position: relative;
    border: 1px solid var(--bs-border-color);
    font-size: 0.95rem;
}

.intro-application-list li::before {
    content: '\F26B';
    font-family: 'bootstrap-icons';
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--bs-primary);
    font-weight: 600;
}

/* ===== Listing section header ===== */
.solutions-listing {
    background: var(--bs-secondary-bg);
    padding-top: 1rem;
    padding-bottom: 2rem;
}

.listing-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.75rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--bs-border-color);
}

.listing-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: var(--bs-body-color);
}

.solutions-listing .hero-tab {
    border-color: var(--bs-border-color);
    color: var(--bs-secondary-color);
    background: var(--bs-body-bg);
    backdrop-filter: none;
}

.solutions-listing .hero-tab:hover {
    border-color: var(--bs-primary);
    color: var(--bs-primary);
    background: var(--bs-body-bg);
}

.solutions-listing .hero-tab.active {
    background: var(--bs-primary);
    color: #fff;
    border-color: var(--bs-primary);
}

/* ===== Solution Card ===== */
.solution-card {
    border: 1px solid var(--bs-border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    background: var(--bs-body-bg);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.solution-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.solution-card-image {
    position: relative;
    padding-top: 56.25%;
    overflow: hidden;
    background: var(--bs-secondary-bg);
}

.solution-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.solution-card:hover .solution-card-image img {
    transform: scale(1.05);
}

.solution-card-image .card-type-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    z-index: 1;
}

.badge-case { background: var(--bs-primary); }
.badge-system { background: var(--bs-success); }

.solution-card-image .card-no-image {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    color: var(--bs-secondary);
    opacity: 0.3;
}

.solution-card-body {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.solution-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.solution-card-title a:hover {
    color: var(--bs-primary);
}

.solution-card-summary {
    font-size: 0.875rem;
    color: var(--bs-secondary-color);
    line-height: 1.6;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.solution-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--bs-secondary-color);
    padding-top: 0.75rem;
    border-top: 1px solid var(--bs-border-color);
}

.solution-card-tags {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
}

.solution-card-tags .badge {
    font-size: 0.7rem;
    font-weight: 500;
}

/* ===== Detail Mode ===== */
.solution-hero {
    position: relative;
    overflow: hidden;
    min-height: 340px;
    display: flex;
    align-items: flex-end;
    background: linear-gradient(135deg, var(--bs-primary) 0%, #1a3a5c 100%);
}

.solution-hero.has-cover {
    background-size: cover;
    background-position: center;
}

.solution-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(transparent 30%, rgba(0,0,0,0.7));
}

.solution-hero-content {
    position: relative;
    z-index: 1;
    padding: 2.5rem 0;
    color: #fff;
    width: 100%;
}

/* Breadcrumb inside hero */
.solution-hero-breadcrumb .breadcrumb {
    margin-bottom: 0;
    padding: 0.5rem 1rem;
    background: rgba(0,0,0,0.25);
    border-radius: 8px;
    display: inline-flex;
    backdrop-filter: blur(4px);
}

.solution-hero-breadcrumb .breadcrumb-item a {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.solution-hero-breadcrumb .breadcrumb-item a:hover {
    color: #fff;
    text-decoration: underline;
}

.solution-hero-breadcrumb .breadcrumb-item.active {
    color: #fff;
    font-weight: 600;
}

.solution-hero-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    color: rgba(255,255,255,0.7);
}

.solution-type-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(4px);
}

.solution-hero-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.solution-hero-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 1rem;
}

.solution-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    font-size: 0.875rem;
    opacity: 0.85;
}

.solution-meta-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Highlights */
.solution-highlights { margin-bottom: 2rem; }

.highlight-card {
    text-align: center;
    padding: 1.5rem 1rem;
    border-radius: 12px;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    transition: transform 0.2s;
}

.highlight-card:hover { transform: translateY(-2px); }

.highlight-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--bs-primary);
    line-height: 1.2;
}

.highlight-label {
    font-size: 0.85rem;
    color: var(--bs-secondary-color);
    margin-top: 0.25rem;
}

/* Content */
.solution-content { margin-bottom: 2rem; }
.solution-content .card-body { padding: 2rem; }

/* Content editable state */
.solution-content .card-body[contenteditable="true"] {
    outline: 2px dashed var(--bs-primary);
    outline-offset: -2px;
    min-height: 300px;
}

.solution-content .card-body[contenteditable="true"]:focus {
    outline-style: solid;
    outline-color: var(--bs-primary);
}

/* Gallery */
.solution-gallery { margin-bottom: 2rem; }

.section-subtitle {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.gallery-item {
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s;
}

.gallery-item:hover img { transform: scale(1.05); }

/* Related Products */
.solution-products { margin-bottom: 2rem; }

.related-product-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 10px;
    transition: box-shadow 0.2s;
    text-decoration: none;
    color: var(--bs-body-color);
    background: var(--bs-body-bg);
}

.related-product-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    color: var(--bs-body-color);
}

.related-product-card img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 6px;
    background: #fff;
    flex-shrink: 0;
}

.related-product-info h6 {
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.related-product-info p {
    font-size: 0.8rem;
    color: var(--bs-secondary-color);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* CTA */
.solution-cta .btn {
    padding: 0.75rem 2.5rem;
    font-size: 1.05rem;
    border-radius: 50px;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .solutions-list-hero { min-height: 240px; }
    .solutions-list-hero-content { padding: 1.5rem; }
    .solutions-list-hero .hero-title { font-size: 1.75rem; }
    .hero-tab { padding: 0.4rem 0.875rem; font-size: 0.8rem; }
    .solution-hero-title { font-size: 1.5rem; }
    .solution-hero-content { padding: 1.5rem 0; }
    .highlight-value { font-size: 1.4rem; }

    .solutions-intro { padding: 2.5rem 0 1.5rem; }
    .intro-title { font-size: 1.65rem; }
    .intro-lead { font-size: 1rem; }
    .intro-applications { padding: 1.5rem 1rem; }
    .intro-section-title { font-size: 1.2rem; }
    .listing-header { flex-direction: column; align-items: flex-start; }
    .listing-title { font-size: 1.25rem; }
}

/* ===== Dark Theme Overrides =====
   本站暗黑模式以 [data-theme="dark"] 切換，但僅覆寫專案自家變數，
   Bootstrap 內建的 --bs-* 變數（body-bg / body-color / secondary-* / border-color）
   並未隨之切換，導致本檔大量使用 var(--bs-body-bg) 等的版面在暗黑模式下
   仍呈現白底。此區塊將 solutions 頁面用到的 --bs-* 變數對應到 dark 設計值。 */
[data-theme="dark"] .solutions-intro,
[data-theme="dark"] .solutions-listing,
[data-theme="dark"] .solution-card,
[data-theme="dark"] .solution-card-image,
[data-theme="dark"] .intro-feature-card,
[data-theme="dark"] .intro-applications,
[data-theme="dark"] .intro-application-list li,
[data-theme="dark"] .highlight-card,
[data-theme="dark"] .related-product-card,
[data-theme="dark"] .solution-card-footer,
[data-theme="dark"] .listing-header,
[data-theme="dark"] .solutions-listing .hero-tab {
    --bs-body-bg: var(--bg-primary);
    --bs-body-color: var(--text-secondary);
    --bs-secondary-bg: var(--bg-secondary);
    --bs-secondary-color: var(--text-tertiary);
    --bs-border-color: var(--border-color);
}

[data-theme="dark"] .solutions-intro {
    background: var(--bg-primary);
}

[data-theme="dark"] .solutions-listing {
    background: var(--bg-secondary);
}

[data-theme="dark"] .intro-title,
[data-theme="dark"] .intro-feature-title,
[data-theme="dark"] .intro-section-title,
[data-theme="dark"] .listing-title,
[data-theme="dark"] .solution-card-title a {
    color: var(--text-secondary);
}

[data-theme="dark"] .intro-lead,
[data-theme="dark"] .intro-body,
[data-theme="dark"] .intro-feature-desc,
[data-theme="dark"] .intro-applications p,
[data-theme="dark"] .intro-application-list li,
[data-theme="dark"] .solution-card-summary,
[data-theme="dark"] .solution-card-footer,
[data-theme="dark"] .highlight-label,
[data-theme="dark"] .related-product-info p {
    color: var(--text-tertiary);
}

[data-theme="dark"] .solution-card,
[data-theme="dark"] .intro-feature-card,
[data-theme="dark"] .highlight-card,
[data-theme="dark"] .related-product-card,
[data-theme="dark"] .intro-application-list li {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .intro-applications {
    background: var(--bg-tertiary);
}

[data-theme="dark"] .solution-card-image {
    background: var(--bg-tertiary);
}

[data-theme="dark"] .solution-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .intro-feature-card:hover {
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .related-product-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .listing-header,
[data-theme="dark"] .solution-card-footer {
    border-color: var(--border-color);
}

[data-theme="dark"] .solutions-listing .hero-tab {
    background: var(--bg-primary);
    color: var(--text-tertiary);
    border-color: var(--border-color);
}

[data-theme="dark"] .solutions-listing .hero-tab:hover {
    background: var(--bg-primary);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

[data-theme="dark"] .solutions-listing .hero-tab.active {
    background: var(--primary-color);
    color: var(--text-inverse);
    border-color: var(--primary-color);
}
