/**
 * Thai Criminal Code - Hub/Landing Page Styles
 */

/* ─── Hero Section ─── */
.tcc-hero {
    background: linear-gradient(135deg, var(--tcc-navy) 0%, var(--tcc-navy-dark) 100%);
    color: var(--tcc-white);
    padding: 4rem 2rem 3rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.tcc-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 50%, rgba(212,175,55,0.08) 0%, transparent 60%);
    pointer-events: none;
}

.tcc-hero-inner {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.tcc-hero-emblem {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.tcc-hero-logo {
    max-width: 180px;
    max-height: 120px;
    width: auto;
    height: auto;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
    display: block;
    margin: 0 auto;
}

.tcc-garuda {
    width: 80px;
    height: 80px;
    opacity: 0.9;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.tcc-hero-title {
    margin: 0 0 1rem;
}

.tcc-hub-page .tcc-hero .tcc-hero-title .tcc-title-en,
.tcc-hero .tcc-title-en,
h1.tcc-hero-title .tcc-title-en,
.tcc-hero h1 span.tcc-title-en {
    display: block;
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: #ffffff !important;
    text-shadow: 0 2px 6px rgba(0,0,0,0.5);
    -webkit-text-fill-color: #ffffff !important;
}

.tcc-hub-page .tcc-hero .tcc-hero-title .tcc-title-th,
.tcc-hero .tcc-title-th,
h1.tcc-hero-title .tcc-title-th,
.tcc-hero h1 span.tcc-title-th {
    display: block;
    font-size: 1.5rem;
    font-weight: 500;
    color: #d4af37 !important;
    margin-top: 0.5rem;
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
    -webkit-text-fill-color: #d4af37 !important;
}

.tcc-hero-subtitle {
    font-size: 1rem;
    color: #ffffff;
    margin: 0.25rem 0;
    opacity: 0.95;
}

.tcc-hero-subtitle-th {
    font-size: 0.95rem;
    color: #d4af37;
    margin: 0 0 2rem;
}

.tcc-hero-search {
    max-width: 720px;
    margin: 0 auto;
    position: relative;
}

.tcc-hero-search .tcc-search-input {
    background: rgba(255,255,255,0.95);
    border-color: transparent;
    font-size: 1.05rem;
    padding: 1rem 1rem 1rem 3.25rem;
}

.tcc-hero-search .tcc-search-input:focus {
    background: var(--tcc-white);
    border-color: var(--tcc-gold);
}

.tcc-hero-search .tcc-search-btn {
    background: var(--tcc-gold-dark);
}

.tcc-hero-search .tcc-search-btn:hover {
    background: var(--tcc-gold);
}

/* ─── Statistics Bar ─── */
.tcc-stats-bar {
    background: var(--tcc-white);
    border-bottom: 1px solid var(--tcc-border-light);
    padding: 1.25rem 2rem;
}

.tcc-stats-inner {
    max-width: var(--tcc-max-width);
    margin: 0 auto;
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    flex-wrap: wrap;
}

.tcc-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
}

.tcc-stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--tcc-navy);
    line-height: 1;
}

.tcc-stat-label {
    font-size: 0.75rem;
    color: var(--tcc-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    text-align: center;
    line-height: 1.3;
}

/* ─── Books Section ─── */
.tcc-books-section {
    padding: 3rem 2rem;
    background: var(--tcc-bg);
}

.tcc-books-inner {
    max-width: var(--tcc-max-width);
    margin: 0 auto;
}

.tcc-section-heading {
    text-align: center;
    margin-bottom: 2rem;
}

.tcc-heading-en {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--tcc-navy);
}

.tcc-heading-th {
    display: block;
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--tcc-gold-dark);
    margin-top: 0.25rem;
}

/* ─── Book Cards ─── */
.tcc-book-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.tcc-book-card {
    display: flex;
    flex-direction: column;
    background: var(--tcc-white);
    border: 1px solid var(--tcc-border);
    border-radius: var(--tcc-radius-lg);
    overflow: hidden;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
}

.tcc-book-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--tcc-shadow-lg);
    border-color: var(--tcc-gold);
}

.tcc-book-card-header {
    background: var(--tcc-navy);
    color: var(--tcc-white);
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tcc-book-number-en {
    font-weight: 700;
    font-size: 1rem;
}

.tcc-book-number-th {
    color: var(--tcc-gold-light);
    font-size: 0.9rem;
}

.tcc-book-card-body {
    padding: 1.25rem;
    flex: 1;
}

.tcc-book-name-en {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--tcc-navy);
    margin: 0 0 0.25rem;
}

.tcc-book-name-th {
    font-size: 0.95rem;
    color: var(--tcc-gold-dark);
    margin: 0 0 0.75rem;
}

.tcc-book-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--tcc-text-light);
}

.tcc-book-card-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--tcc-border-light);
}

.tcc-book-cta {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--tcc-navy);
}

.tcc-book-card:hover .tcc-book-cta {
    color: var(--tcc-gold-dark);
}

/* ─── Table of Contents Section ─── */
.tcc-toc-section {
    padding: 3rem 2rem;
    background: var(--tcc-white);
}

.tcc-toc-inner {
    max-width: 900px;
    margin: 0 auto;
}

/* ─── Accordion ─── */
.tcc-toc-accordion {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tcc-toc-book-group {
    border: 1px solid var(--tcc-border);
    border-radius: var(--tcc-radius);
    overflow: hidden;
}

.tcc-toc-accordion-btn {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 1rem 1.25rem;
    background: var(--tcc-bg);
    border: none;
    cursor: pointer;
    font-family: var(--tcc-font);
    font-size: 1rem;
    text-align: left;
    gap: 0.75rem;
    transition: background var(--tcc-transition);
}

.tcc-toc-accordion-btn:hover {
    background: var(--tcc-border-light);
}

.tcc-toc-accordion-btn[aria-expanded="true"] {
    background: var(--tcc-navy);
    color: var(--tcc-white);
}

.tcc-toc-accordion-btn[aria-expanded="true"] .tcc-acc-range {
    color: var(--tcc-gold-light);
}

.tcc-acc-title {
    flex: 1;
    line-height: 1.4;
}

.tcc-acc-title-th {
    display: block;
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--tcc-gold-dark);
    margin-top: 0.15rem;
}

.tcc-toc-accordion-btn[aria-expanded="true"] .tcc-acc-title-th {
    color: var(--tcc-gold-light);
}

.tcc-acc-range {
    font-size: 0.8rem;
    color: var(--tcc-text-muted);
    white-space: nowrap;
}

.tcc-acc-chevron {
    flex-shrink: 0;
    transition: transform 0.3s ease;
    color: var(--tcc-text-muted);
}

.tcc-toc-accordion-btn[aria-expanded="true"] .tcc-acc-chevron {
    transform: rotate(180deg);
    color: var(--tcc-gold-light);
}

.tcc-toc-accordion-panel {
    padding: 1.25rem;
}

.tcc-toc-accordion-panel[hidden] {
    display: none;
}

/* ─── Title Groups in Accordion ─── */
.tcc-toc-title-group {
    margin-bottom: 1.25rem;
}

.tcc-toc-title-group:last-child {
    margin-bottom: 0;
}

.tcc-toc-title-heading {
    font-size: 0.95rem;
    color: var(--tcc-navy);
    margin: 0 0 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--tcc-border-light);
    line-height: 1.5;
}

.tcc-toc-title-th {
    display: block;
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--tcc-gold-dark);
}

.tcc-toc-range {
    font-size: 0.8rem;
    color: var(--tcc-text-muted);
    margin-left: 0.5rem;
}

.tcc-toc-chapter-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tcc-toc-chapter-item {
    border-bottom: 1px solid var(--tcc-border-light);
}

.tcc-toc-chapter-item:last-child {
    border-bottom: none;
}

.tcc-toc-chapter-item a {
    display: block;
    padding: 0.5rem 0 0.5rem 1rem;
    font-size: 0.9rem;
    color: var(--tcc-text);
    transition: all var(--tcc-transition);
}

.tcc-toc-chapter-item a:hover {
    color: var(--tcc-navy);
    background: var(--tcc-bg);
    padding-left: 1.25rem;
}

.tcc-toc-chapter-th {
    display: block;
    font-size: 0.8rem;
    color: var(--tcc-text-light);
}

.tcc-toc-no-subdivisions {
    color: var(--tcc-text-light);
    font-size: 0.9rem;
    font-style: italic;
}

/* ─── About Section ─── */
.tcc-about-section {
    padding: 3rem 2rem;
    background: var(--tcc-bg);
}

.tcc-about-inner {
    max-width: 900px;
    margin: 0 auto;
}

.tcc-about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.tcc-about-text-en,
.tcc-about-text-th {
    font-size: 0.95rem;
    line-height: 1.8;
}

.tcc-about-text-en {
    padding-right: 1rem;
    border-right: 2px solid var(--tcc-gold);
}

.tcc-about-text-th {
    padding-left: 1rem;
}

/* ─── Responsive ─── */
@media (max-width: 1023px) {
    .tcc-book-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .tcc-hero {
        padding: 2.5rem 1rem 2rem;
    }

    .tcc-title-en {
        font-size: 1.5rem;
    }

    .tcc-title-th {
        font-size: 1.15rem;
    }

    .tcc-stats-inner {
        gap: 1.5rem;
    }

    .tcc-stat-number {
        font-size: 1.25rem;
    }

    .tcc-book-cards {
        grid-template-columns: 1fr;
    }

    .tcc-about-content {
        grid-template-columns: 1fr;
    }

    .tcc-about-text-en {
        padding-right: 0;
        border-right: none;
        border-bottom: 2px solid var(--tcc-gold);
        padding-bottom: 1.5rem;
    }

    .tcc-about-text-th {
        padding-left: 0;
    }
}

@media (max-width: 575px) {
    .tcc-hero {
        padding: 2rem 0.75rem 1.5rem;
    }

    .tcc-title-en {
        font-size: 1.25rem;
    }

    .tcc-garuda {
        width: 60px;
        height: 60px;
    }

    .tcc-stats-inner {
        gap: 1rem;
    }

    .tcc-stat-number {
        font-size: 1rem;
    }

    .tcc-books-section,
    .tcc-toc-section,
    .tcc-about-section,
    .tcc-seo-section,
    .tcc-faq-section,
    .tcc-disclaimer-section {
        padding: 2rem 0.75rem;
    }
}

/* ─── SEO Content Section ─── */
.tcc-seo-section {
    padding: 3rem 2rem;
    background: var(--tcc-white);
    border-top: 1px solid var(--tcc-border-light);
}

.tcc-seo-inner {
    max-width: var(--tcc-max-width);
    margin: 0 auto;
}

.tcc-seo-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.tcc-seo-card {
    background: var(--tcc-bg);
    border: 1px solid var(--tcc-border);
    border-radius: var(--tcc-radius-lg);
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.tcc-seo-card:hover {
    border-color: var(--tcc-gold);
    box-shadow: var(--tcc-shadow);
}

.tcc-seo-card-title {
    margin: 0 0 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--tcc-gold);
}

.tcc-seo-title-en {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--tcc-navy);
}

.tcc-seo-title-th {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--tcc-gold-dark);
    margin-top: 0.25rem;
}

.tcc-seo-card-content p {
    margin: 0 0 0.75rem;
    font-size: 0.9rem;
    line-height: 1.7;
}

.tcc-seo-card-content p:last-child {
    margin-bottom: 0;
}

.tcc-seo-card-content p[lang="en"] {
    color: var(--tcc-text);
}

.tcc-seo-card-content p[lang="th"] {
    color: var(--tcc-text-light);
    font-size: 0.85rem;
    padding-top: 0.5rem;
    border-top: 1px dashed var(--tcc-border-light);
}

/* ─── FAQ Section ─── */
.tcc-faq-section {
    padding: 3rem 2rem;
    background: var(--tcc-bg);
    border-top: 1px solid var(--tcc-border-light);
}

.tcc-faq-inner {
    max-width: 900px;
    margin: 0 auto;
}

.tcc-faq-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tcc-faq-item {
    background: var(--tcc-white);
    border: 1px solid var(--tcc-border);
    border-radius: var(--tcc-radius);
    overflow: hidden;
    transition: all 0.3s ease;
}

.tcc-faq-item:hover {
    border-color: var(--tcc-gold);
}

.tcc-faq-question {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    width: 100%;
    padding: 1.25rem;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--tcc-font);
    text-align: left;
    gap: 1rem;
    transition: background var(--tcc-transition);
}

.tcc-faq-question:hover {
    background: var(--tcc-bg);
}

.tcc-faq-question[aria-expanded="true"] {
    background: var(--tcc-navy);
    color: var(--tcc-white);
}

.tcc-faq-q-en {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
}

.tcc-faq-q-th {
    display: block;
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--tcc-gold-dark);
    margin-top: 0.35rem;
}

.tcc-faq-question[aria-expanded="true"] .tcc-faq-q-th {
    color: var(--tcc-gold-light);
}

.tcc-faq-chevron {
    flex-shrink: 0;
    margin-top: 0.25rem;
    transition: transform 0.3s ease;
    color: var(--tcc-text-muted);
}

.tcc-faq-question[aria-expanded="true"] .tcc-faq-chevron {
    transform: rotate(180deg);
    color: var(--tcc-gold-light);
}

.tcc-faq-answer {
    padding: 1.25rem;
    background: var(--tcc-bg);
    border-top: 1px solid var(--tcc-border-light);
}

.tcc-faq-answer[hidden] {
    display: none;
}

.tcc-faq-answer p {
    margin: 0 0 1rem;
    font-size: 0.95rem;
    line-height: 1.8;
}

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

.tcc-faq-answer p[lang="en"] {
    color: var(--tcc-text);
}

.tcc-faq-answer p[lang="th"] {
    color: var(--tcc-text-light);
    font-size: 0.9rem;
    padding-top: 0.75rem;
    margin-top: 0.75rem;
    border-top: 1px dashed var(--tcc-border);
}

/* ─── Disclaimer Section ─── */
.tcc-disclaimer-section {
    padding: 2rem;
    background: var(--tcc-white);
    border-top: 1px solid var(--tcc-border-light);
}

.tcc-disclaimer-inner {
    max-width: 900px;
    margin: 0 auto;
}

.tcc-disclaimer {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: var(--tcc-radius);
    padding: 1.5rem;
}

.tcc-disclaimer-title {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    color: #92400e;
}

.tcc-disclaimer-title span {
    display: inline;
}

.tcc-disclaimer-title span[lang="th"]::before {
    content: ' / ';
}

.tcc-disclaimer p {
    margin: 0 0 0.75rem;
    font-size: 0.9rem;
    line-height: 1.7;
    color: #78350f;
}

.tcc-disclaimer p:last-child {
    margin-bottom: 0;
}

/* ─── Always Bilingual (never hidden by language switcher) ─── */
.tcc-always-bilingual .tcc-about-text-en,
.tcc-always-bilingual .tcc-about-text-th {
    display: block !important;
}

/* ─── Visual Guide Section ─── */
.tcc-visual-guide-section {
    padding: 3rem 2rem;
    background: var(--tcc-white);
    border-top: 1px solid var(--tcc-border-light);
}

.tcc-visual-guide-inner {
    max-width: var(--tcc-max-width);
    margin: 0 auto;
}

.tcc-visual-guide-subtitle {
    text-align: center;
    color: #718096;
    margin-bottom: 2rem;
    font-size: 0.95rem;
    line-height: 1.7;
}

.tcc-charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.tcc-chart-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-left: 4px solid #3182CE;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.tcc-chart-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.tcc-chart-card h3 {
    margin-bottom: 1rem;
    color: #1A202C;
    font-size: 1.05rem;
}

.tcc-chart-card h3 span[lang="th"] {
    display: block;
    font-size: 0.85em;
    color: #4A5568;
    font-weight: 400;
    margin-top: 0.25rem;
}

.tcc-chart-footer {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: #718096;
    line-height: 1.5;
}

/* ─── Amendment History Section ─── */
.tcc-amendment-section {
    padding: 3rem 2rem;
    background: var(--tcc-bg);
    border-top: 1px solid var(--tcc-border-light);
}

.tcc-amendment-inner {
    max-width: var(--tcc-max-width);
    margin: 0 auto;
}

.tcc-amendment-timeline {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 600px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.tcc-amendment-timeline::-webkit-scrollbar {
    width: 6px;
}

.tcc-amendment-timeline::-webkit-scrollbar-track {
    background: var(--tcc-border-light);
    border-radius: 3px;
}

.tcc-amendment-timeline::-webkit-scrollbar-thumb {
    background: #3182CE;
    border-radius: 3px;
}

.tcc-amendment-card {
    background: var(--tcc-white);
    border: 1px solid var(--tcc-border);
    border-left: 4px solid var(--tcc-gold);
    border-radius: var(--tcc-radius);
    padding: 1.25rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.tcc-amendment-card:hover {
    border-color: #3182CE;
    box-shadow: 0 2px 8px rgba(49,130,206,0.1);
}

.tcc-amendment-card.tcc-amendment-recent {
    border-left-color: #3182CE;
}

.tcc-amendment-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tcc-amendment-number {
    font-weight: 700;
    color: var(--tcc-navy);
    font-size: 1rem;
}

.tcc-amendment-year {
    font-size: 0.85rem;
    color: #3182CE;
    font-weight: 600;
    white-space: nowrap;
}

.tcc-amendment-name-en {
    font-weight: 600;
    color: var(--tcc-text);
    font-size: 0.95rem;
    margin-bottom: 0.15rem;
}

.tcc-amendment-name-th {
    color: var(--tcc-gold-dark);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.tcc-amendment-desc-en {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--tcc-text);
    margin-bottom: 0.5rem;
}

.tcc-amendment-desc-th {
    font-size: 0.85rem;
    line-height: 1.7;
    color: var(--tcc-text-light);
    padding-top: 0.5rem;
    border-top: 1px dashed var(--tcc-border-light);
}

.tcc-amendment-sections {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: #3182CE;
    font-weight: 500;
}

/* ─── Copyright Notice (hub page disclaimer) ─── */
.tcc-copyright-notice {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid #f59e0b;
}

.tcc-copyright-notice h3 {
    font-size: 0.95rem;
    color: #92400e;
    margin-bottom: 0.75rem;
}

.tcc-copyright-notice ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tcc-copyright-notice li {
    font-size: 0.85rem;
    color: #78350f;
    padding: 0.25rem 0;
    padding-left: 1.25rem;
    position: relative;
}

.tcc-copyright-notice li::before {
    content: '\00a9';
    position: absolute;
    left: 0;
    color: #92400e;
}

/* ─── Responsive - SEO & FAQ ─── */
@media (max-width: 767px) {
    .tcc-seo-grid {
        grid-template-columns: 1fr;
    }

    .tcc-faq-question {
        padding: 1rem;
    }

    .tcc-faq-q-en {
        font-size: 0.95rem;
    }

    .tcc-faq-answer {
        padding: 1rem;
    }

    .tcc-charts-grid {
        grid-template-columns: 1fr;
    }

    .tcc-amendment-timeline {
        max-height: 400px;
    }

    .tcc-amendment-header {
        flex-direction: column;
    }
}
