/* 文章頁面自定義樣式 */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.aspect-w-16 {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
}

.aspect-h-9 {
    position: absolute;
    height: 100%;
    width: 100%;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

/* TinyMCE 內容樣式 */
.prose {
    color: #374151;
    line-height: 1.75;
}

.prose h1,
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
    color: #111827;
    font-weight: 600;
    line-height: 1.25;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.prose h1 {
    font-size: 2.25rem;
    margin-top: 0;
}

.prose h2 {
    font-size: 1.875rem;
}

.prose h3 {
    font-size: 1.5rem;
}

.prose h4 {
    font-size: 1.25rem;
}

.prose h5 {
    font-size: 1.125rem;
}

.prose h6 {
    font-size: 1rem;
}

.prose p {
    margin-top: 1.25rem;
    margin-bottom: 1.25rem;
}

.prose strong {
    color: #111827;
    font-weight: 600;
}

.prose a {
    color: #2563eb;
    text-decoration: underline;
    font-weight: 500;
}

.prose a:hover {
    color: #1d4ed8;
}

.prose ul,
.prose ol {
    margin-top: 1.25rem;
    margin-bottom: 1.25rem;
    padding-left: 1.625rem;
}

.prose li {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.prose ul > li {
    position: relative;
}

.prose ul > li::before {
    content: '';
    position: absolute;
    background-color: #d1d5db;
    border-radius: 50%;
    width: 0.375rem;
    height: 0.375rem;
    top: calc(0.875rem - 0.1875rem);
    left: -1.25rem;
}

.prose ol {
    counter-reset: list-counter;
}

.prose ol > li {
    position: relative;
    counter-increment: list-counter;
}

.prose ol > li::before {
    content: counter(list-counter) '.';
    position: absolute;
    font-weight: 400;
    color: #6b7280;
    left: -1.25rem;
}

.prose blockquote {
    font-weight: 500;
    font-style: italic;
    color: #111827;
    border-left-width: 0.25rem;
    border-left-color: #e5e7eb;
    quotes: '\201C' '\201D' '\2018' '\2019';
    margin-top: 1.6rem;
    margin-bottom: 1.6rem;
    padding-left: 1rem;
}

.prose blockquote p:first-of-type::before {
    content: open-quote;
}

.prose blockquote p:last-of-type::after {
    content: close-quote;
}

.prose table {
    width: 100%;
    table-layout: auto;
    text-align: left;
    margin-top: 2rem;
    margin-bottom: 2rem;
    font-size: 0.875rem;
    line-height: 1.7142857;
}

.prose thead {
    border-bottom-width: 1px;
    border-bottom-color: #d1d5db;
}

.prose thead th {
    color: #111827;
    font-weight: 600;
    vertical-align: bottom;
    padding-right: 0.5714286rem;
    padding-bottom: 0.5714286rem;
    padding-left: 0.5714286rem;
}

.prose tbody tr {
    border-bottom-width: 1px;
    border-bottom-color: #e5e7eb;
}

.prose tbody tr:last-child {
    border-bottom-width: 0;
}

.prose tbody td {
    vertical-align: baseline;
    padding-top: 0.5714286rem;
    padding-right: 0.5714286rem;
    padding-bottom: 0.5714286rem;
    padding-left: 0.5714286rem;
}

.prose img {
    margin-top: 2rem;
    margin-bottom: 2rem;
    max-width: 100%;
    height: auto;
}

.prose code {
    color: #111827;
    font-weight: 600;
    font-size: 0.875rem;
    background-color: #f3f4f6;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
}

.prose pre {
    color: #e5e7eb;
    background-color: #1f2937;
    overflow-x: auto;
    font-weight: 400;
    font-size: 0.875rem;
    line-height: 1.7142857;
    margin-top: 1.7142857rem;
    margin-bottom: 1.7142857rem;
    border-radius: 0.375rem;
    padding: 0.8571429rem 1.1428571rem;
}

.prose pre code {
    background-color: transparent;
    border-width: 0;
    border-radius: 0;
    padding: 0;
    font-weight: inherit;
    color: inherit;
    font-size: inherit;
    font-family: inherit;
    line-height: inherit;
}

.prose hr {
    border-color: #e5e7eb;
    border-top-width: 1px;
    margin-top: 3rem;
    margin-bottom: 3rem;
}

/* 響應式調整 */
@media (max-width: 640px) {
    .prose {
        font-size: 0.875rem;
        line-height: 1.7142857;
    }

    .prose h1 {
        font-size: 1.875rem;
    }

    .prose h2 {
        font-size: 1.5rem;
    }

    .prose h3 {
        font-size: 1.25rem;
    }

    .prose table {
        font-size: 0.75rem;
    }

    .prose pre {
        font-size: 0.75rem;
    }
}
