/* ============================================
   CSS Custom Properties
   ============================================ */

:root {
    --background: #ffffff;
    --foreground: #0a0a0a;
    --card: #ffffff;
    --card-foreground: #0a0a0a;
    --muted: #f5f5f5;
    --muted-foreground: #737373;
    --border: #e5e5e5;
    --primary: #171717;
    --primary-foreground: #fafafa;
    --secondary: #f5f5f5;
    --secondary-foreground: #171717;
    --accent: #f5f5f5;
    --accent-foreground: #171717;
    --radius: 0.625rem;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --container: 1200px;
    --header-height: 64px;
}

/* ============================================
   Reset & Base
   ============================================ */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--foreground);
    background: var(--background);
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

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

/* ============================================
   Container
   ============================================ */

.tita-container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.tita-main {
    padding-top: 2rem;
    padding-bottom: 4rem;
    min-height: 60vh;
}

/* ============================================
   Header
   ============================================ */

.tita-header {
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.tita-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.tita-header__logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.125rem;
    white-space: nowrap;
}

.tita-header__logo-icon {
    font-size: 1.5rem;
}

.tita-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    overflow-x: auto;
}

.tita-nav__link {
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--muted-foreground);
    transition: all 0.15s ease;
    white-space: nowrap;
}

.tita-nav__link:hover {
    color: var(--foreground);
    background: var(--accent);
}

.tita-nav__link--active {
    color: var(--foreground);
    background: var(--accent);
}

/* Mobile menu button */
.tita-header__menu-btn {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.tita-header__menu-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--foreground);
    transition: all 0.2s ease;
}

/* ============================================
   Hero
   ============================================ */

.tita-hero {
    padding: 5rem 0 4rem;
    text-align: center;
    background: linear-gradient(180deg, var(--muted) 0%, var(--background) 100%);
}

.tita-hero__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}

.tita-hero__icon {
    font-size: 4rem;
}

.tita-hero__title {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.tita-hero__tagline {
    font-size: 1.25rem;
    color: var(--muted-foreground);
    max-width: 600px;
}

.tita-hero__actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

/* ============================================
   Buttons
   ============================================ */

.tita-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
}

.tita-btn--primary {
    background: var(--primary);
    color: var(--primary-foreground);
}

.tita-btn--primary:hover {
    opacity: 0.9;
}

.tita-btn--outline {
    background: transparent;
    color: var(--foreground);
    border-color: var(--border);
}

.tita-btn--outline:hover {
    background: var(--accent);
}

/* ============================================
   Sections
   ============================================ */

.tita-section {
    padding: 3.5rem 0;
}

.tita-section--muted {
    background: var(--muted);
}

.tita-section__title {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 0.5rem;
}

.tita-section__description {
    color: var(--muted-foreground);
    margin-bottom: 2rem;
}

/* ============================================
   Card Grid
   ============================================ */

.tita-card-grid {
    display: grid;
    gap: 1.5rem;
}

.tita-card-grid--2 {
    grid-template-columns: 1fr;
}

.tita-card-grid--3 {
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .tita-card-grid--2,
    .tita-card-grid--3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .tita-card-grid--3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================
   Content Card
   ============================================ */

.tita-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    border-top: 3px solid var(--border);
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.tita-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.tita-card__image {
    position: relative;
    height: 160px;
    overflow: hidden;
    background: var(--muted);
}

.tita-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tita-card__image-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--muted), var(--border));
}

.tita-card__video-indicator {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    z-index: 2;
}

.tita-card__body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tita-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.tita-card__title {
    font-size: 1.0625rem;
    font-weight: 600;
    line-height: 1.3;
}

.tita-card__title a {
    transition: color 0.15s;
}

.tita-card__title a:hover {
    color: #2563eb;
}

.tita-card__summary {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tita-card__footer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: auto;
}

.tita-card__date,
.tita-card__vendor {
    font-size: 0.8125rem;
    color: var(--muted-foreground);
}

/* ============================================
   Badges
   ============================================ */

.tita-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.1875rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.4;
    white-space: nowrap;
}

.tita-badge--outline {
    background: transparent;
    border: 1px solid var(--border);
}

.tita-badge--muted {
    background: var(--muted);
    color: var(--muted-foreground);
}

.tita-badge--tag {
    background: var(--secondary);
    color: var(--secondary-foreground);
    font-size: 0.6875rem;
}

.tita-badge--filter {
    padding: 0.375rem 0.875rem;
    font-size: 0.8125rem;
    border: 1px solid var(--border);
    background: var(--background);
    cursor: pointer;
    transition: all 0.15s ease;
}

.tita-badge--filter:hover {
    background: var(--accent);
}

.tita-badge--active {
    background: var(--primary);
    color: var(--primary-foreground);
    border-color: var(--primary);
}

/* ============================================
   Topic Card
   ============================================ */

.tita-topic-card {
    display: block;
    padding: 1.5rem;
    border: 1px solid var(--border);
    border-left: 4px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.tita-topic-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.tita-topic-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.tita-topic-card__title {
    font-size: 1.25rem;
    font-weight: 600;
}

.tita-topic-card__description {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    line-height: 1.5;
}

/* ============================================
   Section Card (Browse by Type)
   ============================================ */

.tita-section-card {
    display: block;
    padding: 1.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    text-align: center;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.tita-section-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.tita-section-card__icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    display: block;
}

.tita-section-card__title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.tita-section-card__description {
    font-size: 0.8125rem;
    color: var(--muted-foreground);
    margin-bottom: 0.75rem;
}

/* ============================================
   Topic Filter
   ============================================ */

.tita-topic-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

/* ============================================
   Page Header
   ============================================ */

.tita-page-header {
    margin-bottom: 2rem;
}

.tita-page-header__title {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.tita-page-header__description {
    color: var(--muted-foreground);
    font-size: 1.0625rem;
}

/* ============================================
   Breadcrumb
   ============================================ */

.tita-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--muted-foreground);
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.tita-breadcrumb a {
    color: var(--muted-foreground);
    transition: color 0.15s;
}

.tita-breadcrumb a:hover {
    color: var(--foreground);
}

.tita-breadcrumb__sep {
    color: var(--border);
}

.tita-breadcrumb__current {
    color: var(--foreground);
    font-weight: 500;
}

/* ============================================
   Single Content
   ============================================ */

.tita-single {
    max-width: 800px;
}

.tita-single__header {
    margin-bottom: 2rem;
}

.tita-single__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-bottom: 1rem;
}

.tita-single__title {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 0.75rem;
}

.tita-single__abstract {
    font-size: 1.0625rem;
    color: var(--muted-foreground);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.tita-single__meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

.tita-single__author {
    font-weight: 500;
    color: var(--foreground);
}

/* Video embed */
.tita-single__video {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: var(--radius);
    margin-bottom: 2rem;
}

.tita-single__video iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Cover image */
.tita-single__cover {
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 2rem;
}

.tita-single__cover img {
    width: 100%;
}

/* Tool info card */
.tita-tool-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem;
    background: var(--muted);
    border-radius: var(--radius);
    margin-bottom: 2rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.tita-tool-card__info {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    font-size: 0.9375rem;
}

/* PDF section */
.tita-pdf-section {
    margin-bottom: 2rem;
}

/* Content body */
.tita-single__content {
    margin-bottom: 2rem;
}

.tita-single__back {
    margin-top: 3rem;
}

/* Tags */
.tita-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-top: 2rem;
}

/* ============================================
   Prose (Content Typography)
   ============================================ */

.tita-prose h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    letter-spacing: -0.01em;
}

.tita-prose h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.tita-prose p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.tita-prose ul, .tita-prose ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.tita-prose li {
    margin-bottom: 0.375rem;
    line-height: 1.6;
}

.tita-prose pre {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 1.25rem;
    border-radius: var(--radius);
    overflow-x: auto;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    line-height: 1.6;
}

.tita-prose code {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.875em;
}

.tita-prose p code {
    background: var(--muted);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
}

.tita-prose strong {
    font-weight: 600;
}

.tita-prose table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

.tita-prose th, .tita-prose td {
    padding: 0.625rem;
    border: 1px solid var(--border);
    text-align: left;
    font-size: 0.875rem;
}

.tita-prose th {
    background: var(--muted);
    font-weight: 600;
}

/* ============================================
   Topic Header (detail page)
   ============================================ */

.tita-topic-header {
    padding: 2rem;
    border-left: 4px solid var(--border);
    background: var(--muted);
    border-radius: var(--radius);
    margin-bottom: 2.5rem;
}

.tita-topic-header__title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.tita-topic-header__description {
    color: var(--muted-foreground);
    font-size: 1rem;
}

/* Topic section */
.tita-topic-section {
    margin-bottom: 1rem;
}

.tita-topic-section__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.tita-topic-section__header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.tita-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: #2563eb;
    transition: opacity 0.15s;
}

.tita-link:hover {
    opacity: 0.8;
}

/* ============================================
   Divider
   ============================================ */

.tita-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2rem 0;
}

/* ============================================
   Empty State
   ============================================ */

.tita-empty {
    text-align: center;
    padding: 4rem 0;
    color: var(--muted-foreground);
}

/* ============================================
   Footer
   ============================================ */

.tita-footer {
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    margin-top: auto;
}

.tita-footer__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.tita-footer__brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.tita-footer__copy {
    font-size: 0.8125rem;
    color: var(--muted-foreground);
}

/* ============================================
   Pagination
   ============================================ */

.tita-pagination .nav-links {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 2rem;
}

.tita-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    transition: all 0.15s;
}

.tita-pagination .page-numbers.current {
    background: var(--primary);
    color: var(--primary-foreground);
    border-color: var(--primary);
}

.tita-pagination .page-numbers:hover:not(.current) {
    background: var(--accent);
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
    .tita-hero__title {
        font-size: 2rem;
    }

    .tita-hero__tagline {
        font-size: 1rem;
    }

    .tita-header__logo-text {
        display: none;
    }

    .tita-header__menu-btn {
        display: flex;
    }

    .tita-nav {
        display: none;
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--background);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 1rem 1.5rem;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    }

    .tita-nav--open {
        display: flex;
    }

    .tita-nav__link {
        padding: 0.5rem 0;
    }

    .tita-single__title {
        font-size: 1.5rem;
    }

    .tita-page-header__title {
        font-size: 1.5rem;
    }

    .tita-topic-section__header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .tita-tool-card {
        flex-direction: column;
        align-items: flex-start;
    }
}
