html {
    min-height: 100%;
    background: #f6f8fb;
    scrollbar-gutter: stable;
}

body {
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    background: #f6f8fb;
    color: #111;
    font-size: 13.5px;
    line-height: 1.4;
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* center content */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

/* header navigation */
.header-inner {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px 20px 0;
    position: relative;
    box-sizing: border-box;
}

.navbar {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 1px solid #e6eaf0;
}

.navbar-inner {
    max-width: 1000px;
    margin: 0 auto;
    padding: 18px 20px;
    position: relative;
    box-sizing: border-box;
}

.navbar-links a {
    margin: 0 12px;
    padding: 6px 2px;
    text-decoration: none;
    color: #6b7280;
    font-size: 14px;
}

.navbar-links a:hover {
    color: #111;
}

.navbar-links a.active {
    color: #111;
    border-bottom: 1px solid #111;
}

.navbar .header-social {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 2px;
    opacity: 0.72;
}

.header-social:hover {
    opacity: 1;
}

.header-social-icon {
    width: 16px;
    height: 16px;
    display: block;
}

.brand {
    text-align: center;
    font-size: 16px;
    letter-spacing: 0.8px;
    color: #111;
    margin-top: 0;
    margin-bottom: 6px;
}

/* title */
h1 {
    text-align: center;
    font-weight: normal;
}

.home-intro {
    max-width: 720px;
    margin: 0 auto;
}

.home-feature {
    max-width: 720px;
    margin: 34px auto 0;
    padding: 18px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    box-sizing: border-box;
}

.home-feature::after {
    content: "";
    display: block;
    clear: both;
}

.home-feature-images {
    float: left;
    display: flex;
    width: min(320px, 45%);
    margin: 0 22px 12px 0;
    gap: 8px;
    align-items: flex-start;
    text-decoration: none;
    min-width: 0;
}

.home-feature-images img {
    flex: 1 1 0;
    min-width: 0;
    max-width: calc(50% - 4px);
    height: auto;
    display: block;
    background: #fff;
    padding: 2px;
}

.home-feature-label {
    color: #6b7280;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 5px;
}

.home-feature-title {
    margin: 0 0 12px;
    font-size: 18px;
    line-height: 1.3;
    font-weight: 600;
}

.home-feature-story-title {
    margin: 0 0 6px;
    font-size: 14px;
    line-height: 1.35;
    font-weight: 600;
}

.home-feature-description {
    margin: 0;
    color: #374151;
}

.home-feature-link {
    display: inline-flex;
    margin-top: 14px;
    color: #111;
    text-decoration: none;
    border-bottom: 1px solid #111;
    font-weight: 500;
}

.home-feature-link:hover {
    color: #374151;
    border-bottom-color: #374151;
}

/* collection gallery */
.content {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
    padding: 10px;
    min-width: 0;
}

.coin-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 0;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    transition: box-shadow 0.2s ease;
    scroll-margin-top: 20px;
}

.coin-card:hover {
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

.coin-card:target,
.coin-card-target {
    box-shadow: 0 0 0 2px #111, 0 10px 24px rgba(0,0,0,0.12);
}

.coin-images {
    display: flex !important;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 8px;
    align-items: flex-start;
    width: 100%;
    min-width: 0;
}

.coin-images img {
    flex: 1 1 0;
    min-width: 60px;
    max-width: calc(50% - 4px);
    width: auto;
    height: auto;
    display: block !important;
    background: white;
    padding: 2px;
    cursor: pointer;
}

.coin-info {
    display: block;
    margin-top: 0;
    padding-top: 10px;
    border-top: 1px solid rgba(0,0,0,0.08);
}

.coin-info-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
    flex: 1;
}

.coin-card:hover {
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}


.coin-open {
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.coin-open:hover {
    text-decoration: none;
}

.coin-action-buttons {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.coin-action-button {
    flex: 0 0 auto;
    position: relative;
    border: 1px solid #d8dee7;
    border-radius: 999px;
    background: #f7f9fc;
    color: #374151;
    font-size: 12px;
    line-height: 1;
    padding: 7px;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.coin-action-button:hover {
    background: #eef2f7;
    border-color: #c7d0dc;
    color: #111;
}

.coin-action-button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.coin-action-button[data-temporary-label]::after {
    content: attr(data-temporary-label);
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    padding: 4px 8px;
    border-radius: 999px;
    background: #111;
    color: #fff;
    font-size: 11px;
    line-height: 1;
    white-space: nowrap;
}

.coin-action-icon {
    width: 14px;
    height: 14px;
    display: block;
}

.site-footer {
    margin: 36px auto 0;
    padding: 20px 20px 28px;
    border-top: 1px solid #e6eaf0;
    color: #6b7280;
    font-size: 13px;
    width: 100%;
    box-sizing: border-box;
    margin-top: auto;
}

.site-footer-inner {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.site-footer-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #374151;
    text-decoration: none;
    font-weight: 500;
}

.site-footer-link:hover {
    color: #111;
}

.site-footer-icon {
    width: 18px;
    height: 18px;
    display: block;
}

.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    background: rgba(0,0,0,0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.lightbox.hidden {
    display: none;
}

.lightbox img {
    max-width: 80%;
    max-height: 80vb;
    border-radius: 8px;
}

.lightbox .close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 30px;
    color: white;
    cursor: pointer;
}

.lightbox .nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 40px;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
}

.lightbox .left {
    left: 30px;
}

.lightbox .right {
    right: 30px;
}

.lightbox-dots {
    position: absolute;
    left: 50%;
    bottom: 22px;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(4px);
}

.lightbox-dots.hidden {
    display: none;
}

.lightbox-dot {
    width: 8px;
    height: 8px;
    border: 0;
    border-radius: 50%;
    padding: 0;
    background: rgba(255,255,255,0.38);
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease, opacity 0.2s ease;
}

.lightbox-dot:hover {
    background: rgba(255,255,255,0.65);
}

.lightbox-dot.active {
    background: #fff;
    transform: scale(1.2);
}

.lightbox-dots-dark {
    background: rgba(17,17,17,0.08);
}

.lightbox-dots-dark .lightbox-dot {
    background: rgba(17,17,17,0.28);
}

.lightbox-dots-dark .lightbox-dot:hover {
    background: rgba(17,17,17,0.48);
}

.lightbox-dots-dark .lightbox-dot.active {
    background: #111;
}

.lightbox-counter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(17,17,17,0.08);
    color: #111;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.lightbox-counter.hidden {
    display: none;
}

.coin-modal-header {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
}

.coin-modal-content {
    width: min(800px, 90vw);
    max-width: 800px;
    box-sizing: border-box;
    background: white;
    padding: 10px;
    border-radius: 10px;
    margin: auto;
    display: flex;
    flex-direction: column;
    gap: 0px;
}

.coin-modal-images {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    width: 100%;
    max-width: 100%;
}

.coin-modal-images img {
    flex: 1 1 calc(50% - 10px);
    width: min(40vw, 40vh, 400px, calc(50% - 10px));
    max-width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    display: block;
    background: #fff;
    margin: 0;
}

.coin-modal-label {
    font-weight: 600;
}

.coin-modal-info {
    margin: 0;
    padding: 0;
}

.coin-modal-group {
    margin: 10px 0;
}

.coin-modal-group p {
    margin: 0;
}


/* sidebar with categories */
.layout {
    display: flex;
    max-width: 1000px;
    margin: 0 auto;
}

.sidebar {
    flex: 0 0 190px;
    padding: 10px;
    position: sticky;
    top: 10px;
    align-self: flex-start;
}

.category-item {
    margin-bottom: 8px;
}

.category-item a {
    display: block;
    padding: 6px;
    border: 1px solid #e0e0e0;
    text-decoration: none;
    color: #111;
    background: #fff;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.category-item a:hover {
    background: #e9eef5;   /* more contrast */
    border-color: #d0d7e2;
}

.category-item a.active {
    background: #e9eef5;
    color: #111;
    font-weight: 500;
}

/* top-bar - search field and filter */
.top-bar {
    margin: 0 auto 10px auto;
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 8px 10px;
}

.top-bar input {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.top-bar select {
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    min-width: 0;
}

.top-bar form {
    display: flex;
    gap: 10px;
    align-items: center;
    width: 100%;
}

#search-input {
    font-style: italic;
    min-width: 0;
}


/* map page - content on pin (text, images) */
.map-pin-popup-images {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.map-pin-popup-link,
.map-pin-popup-link:visited,
.map-pin-popup-link:hover,
.map-pin-popup-link:active {
    display: block;
    text-align: center;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}


/* mobile phone optimization */
@media (max-width: 720px) {
    .content {
        grid-template-columns: 1fr;
        max-width: 800px;   /* match your coin-cards */
        margin: 0 auto;
    }

    .home-feature {
        max-width: 520px;
    }

    .home-feature-images {
        float: none;
        width: 100%;
        margin: 0 0 16px;
    }

    .layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        box-sizing: border-box;
        position: static;
        order: -1;
    }

    .top-bar form {
        display: flex;
        gap: 10px;
        align-items: center;
        width: 50%;
    }

    .top-bar select {
        width: 50%;
    }

    .lightbox .nav,
    #coinPrev,
    #coinNext {
        display: none;
    }

    .lightbox,
    #coinModal {
        touch-action: pan-y;
    }

    .lightbox-dots {
        bottom: 16px;
        gap: 7px;
        padding: 7px 10px;
    }

    .lightbox-counter {
        min-width: 52px;
        padding: 7px 10px;
        font-size: 11px;
    }

    .lightbox-dot {
        width: 7px;
        height: 7px;
    }

    .coin-info-header {
        align-items: center;
    }

    .coin-share-button {
        padding: 8px;
    }

    .site-footer-inner {
        flex-direction: column;
        justify-content: center;
        text-align: center;
    }
}
