html {
    overflow-x: hidden;
}

.main-wrap > * {
    min-width: 0;
}

article {
    max-width: 100%;
    color: var(--text, inherit);
    line-height: 1.75;
    font-size: 1rem;
}

main {
    max-width: 100%;
    width: 100%;
}

article p {
    margin: 0 0 1.25em 0;
}

article h2 {
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1.3;
    margin: 2em 0 0.6em 0;
    color: var(--primary);
}

article h3 {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.35;
    margin: 1.5em 0 0.5em 0;
    color: var(--primary);
}

article h4 {
    font-size: 1rem;
    font-weight: 700;
    margin: 1.25em 0 0.4em 0;
}

article > h2:first-child,
article > h3:first-child {
    margin-top: 0;
}

article a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: opacity 0.15s;
}

article a:hover {
    opacity: 0.75;
}

.page-breadcrumb a {
    color: var(--primary);
}

article ul,
article ol {
    margin: 0 0 1.25em 0;
    padding-left: 1.5em;
}

article ul {
    list-style: disc;
}

article ol {
    list-style: decimal;
}

article ul ul,
article ol ol,
article ul ol,
article ol ul {
    margin-bottom: 0;
    margin-top: 0.25em;
}

article li {
    margin-bottom: 0.5em;
    line-height: 1.7;
}

article li:last-child {
    margin-bottom: 0;
}

article li strong,
article li b {
    color: var(--primary);
}

.table-scroll-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 0 1.5em 0;
    border-radius: 6px;
    border: 1px solid var(--border);
    position: relative;
    z-index: 1;
}

article table {
    width: 100%;
    min-width: 500px;
    border-collapse: collapse;
    font-size: 0.9rem;
    line-height: 1.5;
}

article table thead tr {
    background-color: var(--primary);
    color: #fff;
}

article table thead td,
article table thead th {
    padding: 10px 14px;
    font-weight: 700;
    text-align: left;
    vertical-align: middle;
    border: none;
}

article table thead td p,
article table thead th p {
    margin: 0;
    color: #fff;
}

article table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background-color 0.12s;
}

article table tbody tr:last-child {
    border-bottom: none;
}

article table tbody tr:nth-child(odd) {
    background-color: transparent;
}

article table tbody tr:nth-child(even) {
    background-color: color-mix(in srgb, var(--border) 40%, transparent);
}

article table tbody tr:hover {
    background-color: color-mix(in srgb, var(--primary) 6%, transparent);
}

article table tbody td,
article table tbody th {
    padding: 9px 14px;
    vertical-align: middle;
    text-align: left;
    border-right: 1px solid var(--border);
}

article table tbody td:last-child,
article table tbody th:last-child {
    border-right: none;
}

article table tbody td p,
article table tbody th p {
    margin: 0;
}

article strong,
article b {
    font-weight: 700;
}

article u {
    text-decoration-color: var(--primary);
    text-underline-offset: 2px;
}

article img {
    max-width: 100%;
    height: auto;
}

/* FAQ */
.faq-section {
    margin-top: 2.5em;
    border-top: 2px solid var(--border);
    padding-top: 1.5em;
}

.faq-section-title {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--primary);
    margin: 0 0 1em 0;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 0.5em;
}

.faq-item {
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}

.faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 16px;
    cursor: pointer;
    list-style: none;
    background-color: transparent;
    transition: background-color 0.15s;
    gap: 12px;
}

.faq-question::-webkit-details-marker {
    display: none;
}

.faq-item[open] .faq-question {
    background-color: color-mix(in srgb, var(--primary) 6%, transparent);
    border-bottom: 1px solid var(--border);
}

.faq-question::after {
    content: "+";
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
    flex-shrink: 0;
    line-height: 1;
    transition: transform 0.2s;
}

.faq-item[open] .faq-question::after {
    content: "−";
}

.faq-item-title {
    margin: 0;
    font-size: 0.975rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--primary);
}

.faq-answer {
    padding: 13px 16px;
    font-size: 0.95rem;
    line-height: 1.7;
}

.faq-answer p {
    margin: 0 0 0.75em 0;
}

.faq-answer p:last-child {
    margin-bottom: 0;
}


@media (max-width: 900px) {

    article {
        word-break: break-word;
        overflow-wrap: break-word;
    }

    .sidebar {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    article h2 {
        font-size: 1.25rem;
        margin-top: 1.75em;
    }

    article h3 {
        font-size: 1.05rem;
    }

    article ul,
    article ol {
        padding-left: 1.25em;
    }

    article table {
        font-size: 0.82rem;
    }

    article table thead td,
    article table thead th,
    article table tbody td,
    article table tbody th {
        padding: 8px 10px;
    }

    .faq-question {
        padding: 11px 13px;
    }

    .faq-item-title {
        font-size: 0.9rem;
    }

    .faq-answer {
        padding: 11px 13px;
        font-size: 0.9rem;
    }

    .faq-section-title {
        font-size: 1.25rem;
    }
}
@media (max-width: 480px) {
    article {
        font-size: 0.95rem;
    }

    article h2 {
        font-size: 1.15rem;
    }

    .table-scroll-wrap {
        border-radius: 4px;
        margin-left: -4px;
        margin-right: -4px;
    }
}

/* =============================================
   ARCHIVE PAGE
============================================= */

/* =============================================
   GRID
============================================= */
.article-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}

/* =============================================
   CARD
============================================= */
.article-card {
    background: #ffffff;
    border: 1px solid #e4e0d8;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.09);
    transform: translateY(-2px);
}

.archive-card-body {
    padding: 20px 22px 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* =============================================
   TAG / CATEGORY
============================================= */
.tag {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}

.archive-card-dot {
    color: #bbb;
    font-size: 14px;
    line-height: 1;
}

.archive-card-cat {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #c9a84c;
    text-decoration: none;
}

.archive-card-cat:hover {
    color: #a8872d;
}

/* =============================================
   TITLE
============================================= */
.archive-card-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 12px;
    color: #1a2744;
}

.archive-card-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s;
}

.archive-card-title a:hover {
    color: #c9a84c;
}

/* =============================================
   EXCERPT
============================================= */
.archive-card-excerpt {
    font-size: 0.875rem;
    color: #555;
    line-height: 1.65;
    margin-top: auto;
}

.archive-card-excerpt p {
    margin: 0;
}

/* =============================================
   PAGINATION
============================================= */
.archive-pagination {
    display: flex;
    justify-content: center;
    margin-top: 16px;
}

.archive-pagination .nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.archive-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border: 1px solid #e4e0d8;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #1a2744;
    text-decoration: none;
    background: #ffffff;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.archive-pagination .page-numbers:hover {
    background: #1a2744;
    color: #ffffff;
    border-color: #1a2744;
}

.archive-pagination .page-numbers.current {
    background: #1a2744;
    color: #ffffff;
    border-color: #1a2744;
    cursor: default;
}

.archive-pagination .page-numbers.dots {
    border: none;
    background: none;
    color: #aaa;
    cursor: default;
}

/* =============================================
   EMPTY STATE
============================================= */
.archive-empty {
    text-align: center;
    padding: 60px 20px;
    background: #ffffff;
    border: 1px solid #e4e0d8;
    border-radius: 8px;
}

.archive-empty h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1a2744;
    margin-bottom: 10px;
}

.archive-empty p {
    font-size: 0.95rem;
    color: #777;
}

/* =============================================
   RESPONSIVE
============================================= */
@media (max-width: 900px) {
    .article-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

@media (max-width: 560px) {
    .archive-page {
        padding: 24px 0 40px;
    }

    .article-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .archive-card-body {
        padding: 16px 16px 20px;
    }

    .archive-card-title {
        font-size: 0.95rem;
    }

    .archive-pagination .page-numbers {
        min-width: 34px;
        height: 34px;
        font-size: 12px;
    }
}

/* =============================================
   404 PAGE
============================================= */
.error-404 {
    display: flex;
    align-items: flex-start;
    gap: 48px;
    padding: 60px 0 80px;
    max-width: 680px;
    margin: 0 auto;
}

.error-404-code {
    font-size: 120px;
    font-weight: 700;
    line-height: 1;
    color: #e4e0d8;
    flex-shrink: 0;
    user-select: none;
}

.error-404-inner {
    padding-top: 8px;
}

.section-label {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #c9a84c;
    margin-bottom: 12px;
}

.error-404-inner .entry-title {
    font-size: 2rem;
    font-weight: 700;
    color: #1a2744;
    line-height: 1.25;
    margin: 0 0 16px;
}

.error-404-text {
    font-size: 0.95rem;
    color: #666;
    line-height: 1.7;
    margin: 0 0 28px;
}

.btn-primary {
    display: inline-block;
    background: #1a2744;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 11px 22px;
    border-radius: 4px;
    text-decoration: none;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #c9a84c;
    color: #fff;
}

.error-404-actions {
    margin-bottom: 32px;
}

.error-404-search-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #999;
    margin-bottom: 10px;
}

/* WordPress search form */
.error-404-search .search-form {
    display: flex;
    gap: 0;
    max-width: 420px;
}

.error-404-search .search-field {
    flex: 1;
    height: 42px;
    padding: 0 14px;
    font-size: 14px;
    color: #1a1a1a;
    background: #fff;
    border: 1px solid #e4e0d8;
    border-right: none;
    border-radius: 4px 0 0 4px;
    outline: none;
    transition: border-color 0.15s;
}

.error-404-search .search-field:focus {
    border-color: #1a2744;
}

.error-404-search .search-submit {
    height: 42px;
    padding: 0 18px;
    background: #1a2744;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.error-404-search .search-submit:hover {
    background: #c9a84c;
}

/* =============================================
   RESPONSIVE
============================================= */
@media (max-width: 600px) {
    .error-404 {
        flex-direction: column;
        gap: 0;
        padding: 40px 0 60px;
        align-items: center;
        text-align: center;
    }

    .error-404-code {
        font-size: 80px;
        color: #ede9e1;
        margin-bottom: 8px;
    }

    .error-404-inner .entry-title {
        font-size: 1.5rem;
    }

    .error-404-search .search-form {
        max-width: 100%;
    }
}
