/* ========================================
   Shared CSS - combined from src/shared/*.css
   Order: base -> nav -> components -> dark-mode-toggle -> footer
   ======================================== */

/* ── Base ── */
html {
    font-size: 14px;
    scroll-behavior: smooth;
}
body {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #ffffff;
    color: #333;
    transition: background-color 0.3s, color 0.3s;
}
body.dark-mode {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

/* ── Nav: Top Bar ── */
.site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-bottom: 1px solid #e0e0e0;
    z-index: 1000;
    transition: background-color 0.3s, border-color 0.3s;
}
body.dark-mode .site-nav {
    background: #1a1a1a;
    border-color: #333;
}
.nav-inner {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ── Nav: Brand ── */
.nav-brand {
    font-size: 1.05rem;
    font-weight: 700;
    color: #333;
    text-decoration: none;
    transition: color 0.2s;
    letter-spacing: -0.02em;
}
body.dark-mode .nav-brand {
    color: #e0e0e0;
}
.nav-brand:hover {
    color: #666;
}
body.dark-mode .nav-brand:hover {
    color: #aaa;
}

/* ── Nav: Hamburger Button ── */
.nav-hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    padding: 8px 6px;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 6px;
    transition: background-color 0.2s;
}
.nav-hamburger:hover {
    background: rgba(0, 0, 0, 0.06);
}
body.dark-mode .nav-hamburger:hover {
    background: rgba(255, 255, 255, 0.08);
}
.nav-hamburger span {
    display: block;
    height: 2.5px;
    background: #555;
    border-radius: 1px;
    transition: background-color 0.2s;
}
body.dark-mode .nav-hamburger span {
    background: #aaa;
}

/* ── Nav: Overlay ── */
.nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}
.nav-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* ── Nav: Drawer ── */
.nav-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    max-width: 80vw;
    background: #ffffff;
    z-index: 1002;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
}
.nav-drawer.open {
    transform: translateX(0);
}
body.dark-mode .nav-drawer {
    background: #1e1e1e;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.4);
}

/* Drawer header */
.nav-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.2rem;
    height: 48px;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
}
body.dark-mode .nav-drawer-header {
    border-color: #333;
}
.nav-drawer-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #333;
    letter-spacing: -0.01em;
}
body.dark-mode .nav-drawer-title {
    color: #e0e0e0;
}
.nav-drawer-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    font-size: 1.4rem;
    color: #888;
    cursor: pointer;
    border-radius: 6px;
    transition: background-color 0.2s, color 0.2s;
    line-height: 1;
}
.nav-drawer-close:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #333;
}
body.dark-mode .nav-drawer-close {
    color: #777;
}
body.dark-mode .nav-drawer-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #e0e0e0;
}

/* Drawer links */
.nav-drawer-links {
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0;
    overflow-y: auto;
}
.nav-drawer-links .nav-link {
    display: block;
    padding: 0.75rem 1.4rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: #555;
    text-decoration: none;
    border-radius: 0;
    transition: color 0.2s, background-color 0.2s;
}
.nav-drawer-links .nav-link:hover {
    color: #333;
    background: rgba(0, 0, 0, 0.04);
}
body.dark-mode .nav-drawer-links .nav-link {
    color: #999;
}
body.dark-mode .nav-drawer-links .nav-link:hover {
    color: #e0e0e0;
    background: rgba(255, 255, 255, 0.06);
}

/* Active state in drawer */
.nav-drawer-links .nav-link.active {
    color: #333;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.04);
    border-left: 3px solid #555;
    padding-left: calc(1.4rem - 3px);
}
body.dark-mode .nav-drawer-links .nav-link.active {
    color: #e0e0e0;
    background: rgba(255, 255, 255, 0.06);
    border-left-color: #888;
}

/* ── Components: Section Header + Card ── */
/* Section Header */
.section-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
}
.section-label {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
    position: relative;
    padding-left: 1rem;
}
.section-label::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 1.1em;
    background: #999;
    border-radius: 2px;
}
body.dark-mode .section-label::before {
    background: #666;
}
.section-more {
    font-size: 0.85rem;
    color: #888;
    text-decoration: none;
    transition: color 0.2s;
}
.section-more:hover {
    color: #333;
}
body.dark-mode .section-more {
    color: #777;
}
body.dark-mode .section-more:hover {
    color: #ccc;
}

/* Section Divider */
.section-divider {
    margin: 0 0 2.5rem 0;
    border: none;
    height: 1px;
    background: linear-gradient(to right, transparent, #ddd 20%, #ddd 80%, transparent);
}
body.dark-mode .section-divider {
    background: linear-gradient(to right, transparent, #333 20%, #333 80%, transparent);
}

/* Card Grid */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

/* Card */
.card {
    display: block;
    padding: 1.2rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.card:hover {
    border-color: #999;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    text-decoration: none;
}
body.dark-mode .card {
    border-color: #444;
}
body.dark-mode .card:hover {
    border-color: #666;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.card-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.3rem 0;
    color: #333;
}
body.dark-mode .card-title {
    color: #e0e0e0;
}
.card-desc {
    font-size: 0.85rem;
    color: #888;
    margin: 0 0 0.3rem 0;
    line-height: 1.5;
}
body.dark-mode .card-desc {
    color: #777;
}
.card-meta {
    font-size: 0.8rem;
    color: #999;
    margin: 0;
}
body.dark-mode .card-meta {
    color: #666;
}

@media (max-width: 600px) {
    .card-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.8rem;
    }
}

/* ── Dark Mode Toggle ── */
.dark-mode-toggle {
    padding: 10px 20px;
    border-radius: 10px;
    border: 1px solid #ccc;
    background-color: #f5f5f5;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 500;
    color: #555;
    transition: all 0.3s;
    white-space: nowrap;
    flex-shrink: 0;
}
.dark-mode-toggle:hover {
    background-color: #e8e8e8;
    border-color: #999;
}
body.dark-mode .dark-mode-toggle {
    background-color: #3a3a3a;
    border-color: #555;
    color: #ccc;
}
body.dark-mode .dark-mode-toggle:hover {
    background-color: #444;
}
.toggle-circle {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #888;
    transition: all 0.3s;
}
body.dark-mode .toggle-circle {
    background-color: #ddd;
}

/* ── Footer ── */
footer {
    margin-top: 4rem;
    padding: 2rem 0;
    border-top: 1px solid #e0e0e0;
    text-align: center;
    color: #666;
    font-size: 0.9rem;
    transition: border-color 0.3s, color 0.3s;
}
body.dark-mode footer {
    border-color: #444;
    color: #999;
}
.footer-links {
    margin: 1rem 0;
}
.footer-links a {
    color: #666;
    text-decoration: none;
    margin: 0 0.5rem;
    transition: color 0.2s;
}
.footer-links a:hover {
    color: #333;
    text-decoration: underline;
}
body.dark-mode .footer-links a {
    color: #999;
}
body.dark-mode .footer-links a:hover {
    color: #ccc;
}
.footer-copyright {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: #999;
}
body.dark-mode .footer-copyright {
    color: #666;
}
.footer-toggle {
    margin-bottom: 1rem;
}
.footer-business {
    margin-top: 0.8rem;
    font-size: 0.75rem;
    color: #999;
    line-height: 1.8;
}
.footer-business p {
    margin: 0;
}
body.dark-mode .footer-business {
    color: #666;
}
