/* ============================================================
   China Travel Guide | Rinew Trip
   main.css — Design Tokens, Reset, Global Typography, Components
   ============================================================ */

/* --- Design Tokens --- */
:root {
    /* Brand Colors */
    --color-accent:         #636854;
    --color-accent-light:   #8a9070;
    --color-accent-dark:    #4d5241;
    --color-bg:             #f4f2ed;
    --color-surface:        #ffffff;
    --color-text:           #2a2a2a;
    --color-text-muted:     #6b6b6b;
    --color-border:         #e0ddd6;
    --color-success:        #5a7a5e;
    --color-error:          #c0392b;

    /* Sidebar */
    --sidebar-bg:           #1e1e1a;
    --sidebar-text:         #b8b5ac;
    --sidebar-text-hover:   #f4f2ed;
    --sidebar-accent:       #8a9070;
    --sidebar-width:        260px;

    /* Typography */
    --font-heading:         'Sora', sans-serif;
    --font-body:            'Poppins', sans-serif;

    /* Spacing */
    --space-xs:   8px;
    --space-sm:   16px;
    --space-md:   24px;
    --space-lg:   40px;
    --space-xl:   64px;

    /* Shape */
    --radius-sm:  6px;
    --radius-md:  12px;
    --radius-lg:  20px;

    /* Shadows */
    --shadow-sm:    0 1px 4px rgba(0, 0, 0, 0.06);
    --shadow-card:  0 2px 12px rgba(0, 0, 0, 0.07);
    --shadow-hover: 0 6px 24px rgba(0, 0, 0, 0.12);
    --shadow-login: 0 20px 60px rgba(0, 0, 0, 0.10);

    /* Motion */
    --transition:       0.25s ease;
    --transition-slow:  0.4s ease;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    line-height: 1.25;
    color: var(--color-text);
}

h1 { font-size: clamp(2rem,   4vw, 3rem);    font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem);    font-weight: 600; }
h3 { font-size: clamp(1.1rem, 2vw, 1.375rem); font-weight: 600; }
h4 { font-size: 1.125rem; font-weight: 600; }

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

p:last-child { margin-bottom: 0; }

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover { color: var(--color-accent-dark); }

ul, ol { padding-left: 1.5rem; }
li { margin-bottom: 0.5rem; line-height: 1.7; }
strong { font-weight: 600; }

/* ============================================================
   Shared Content Components (used inside section body HTML)
   ============================================================ */

/* --- Card Grid --- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
    margin: 32px 0;
}

.card {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.card-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.card-body {
    padding: 20px 24px;
}

.card-body h3 {
    font-size: 1.05rem;
    margin-bottom: 8px;
}

.card-body p {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin: 0;
}

/* --- Tip Box --- */
.tip-box {
    background: var(--color-surface);
    border-left: 4px solid var(--color-accent);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 16px 20px;
    margin: 20px 0;
    box-shadow: var(--shadow-sm);
}

.tip-box strong {
    display: block;
    font-family: var(--font-heading);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 6px;
}

/* --- Info Table --- */
.info-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 0.92rem;
    background: var(--color-surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.info-table th {
    background: var(--color-accent);
    color: white;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.82rem;
    text-align: left;
    padding: 12px 16px;
    letter-spacing: 0.03em;
}

.info-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-border);
    vertical-align: top;
}

.info-table tr:last-child td { border-bottom: none; }
.info-table tr:nth-child(even) td { background: rgba(244, 242, 237, 0.6); }

/* --- Accordion --- */
.accordion { margin: 24px 0; }

.accordion-item {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    overflow: hidden;
}

.accordion-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    background: none;
    border: none;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-text);
    text-align: left;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}

.accordion-trigger:hover {
    background: rgba(244, 242, 237, 0.8);
    color: var(--color-accent);
}

.accordion-trigger.active {
    color: var(--color-accent);
    background: rgba(244, 242, 237, 0.8);
}

.accordion-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    border: 1.5px solid currentColor;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
    transition: transform var(--transition);
    color: inherit;
}

.accordion-trigger.active .accordion-icon {
    transform: rotate(45deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    padding: 0 20px;
    transition: max-height 0.35s ease, padding 0.35s ease;
}

.accordion-content.open {
    max-height: 1200px;
    padding: 4px 20px 20px;
}

/* --- Tabs --- */
.tabs { margin: 24px 0; }

.tab-nav {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--color-border);
    overflow-x: auto;
    scrollbar-width: none;
    margin-bottom: 24px;
}

.tab-nav::-webkit-scrollbar { display: none; }

.tab-btn {
    flex-shrink: 0;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    padding: 10px 20px;
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: color var(--transition), border-color var(--transition);
}

.tab-btn:hover { color: var(--color-accent); }

.tab-btn.active {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
    font-weight: 600;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* --- Packing List --- */
.packing-list {
    list-style: none;
    padding: 0;
    margin: 16px 0;
    background: var(--color-surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.packing-list li {
    margin: 0;
    border-bottom: 1px solid var(--color-border);
}

.packing-list li:last-child { border-bottom: none; }

.packing-list label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background var(--transition);
}

.packing-list label:hover { background: rgba(244, 242, 237, 0.7); }

.packing-list input[type="checkbox"] {
    width: 17px;
    height: 17px;
    accent-color: var(--color-accent);
    cursor: pointer;
    flex-shrink: 0;
}

.packing-list label.checked {
    color: var(--color-text-muted);
    text-decoration: line-through;
}

/* --- Print Styles --- */
@media print {
    .sidebar,
    .hamburger,
    .progress-bar,
    .back-to-top,
    .sidebar-footer { display: none !important; }

    .guide-wrapper { grid-template-columns: 1fr !important; }
    .guide-main { padding: 0 !important; }
    .section-block { break-inside: avoid; }
    .guide-hero { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
