/* ============================================================
   Comic Calendar — Public Styles v3.0
   ============================================================ */

/* --- Main Comic Display --- */
.cc-wrapper {
    max-width: 1000px;
    margin: 0 auto 2rem;
    text-align: center;
}

.cc-comic-display img {
    max-width: 100%;
    max-height: calc(90vh - 300px);
    width: auto;
    height: auto;
    object-fit: contain;
    box-shadow: 0 4px 16px rgba(0,0,0,0.10);
    border-radius: 4px;
}

@media (max-width: 768px) {
    .cc-comic-display img {
        max-height: calc(100vh - 180px);
    }
}

/* --- Controls Container --- */
.cc-controls-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0;
}

/* --- Topic Filter Pills --- */
.cc-topic-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin: 0 0 1.25rem;
    padding: 1rem 0 1.25rem;
    border-bottom: 1px solid #e8e8e8;
}

.cc-topic-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid #d0d0d0;
    background: #fff;
    color: #444;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
    white-space: nowrap;
    line-height: 1.3;
}

.cc-topic-pill:hover {
    border-color: #888;
    background: #f4f4f4;
    color: #111;
    text-decoration: none;
}

.cc-topic-pill.active {
    background: #2d6a0a;
    border-color: #2d6a0a;
    color: #fff;
}

.cc-topic-pill.active .cc-topic-count {
    background: rgba(255,255,255,0.25);
    color: #fff;
}

.cc-topic-count {
    display: inline-block;
    background: #eee;
    color: #666;
    font-size: 11px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* --- Navigation Buttons --- */
.cc-nav-buttons {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 0 0 1.5rem;
    flex-wrap: wrap;
}

.cc-btn {
    padding: 8px 16px;
    background: #333;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.15s;
    white-space: nowrap;
}

.cc-btn:hover {
    background: #555;
    color: #fff;
    text-decoration: none;
}

.cc-btn.disabled {
    opacity: 0.35;
    pointer-events: none;
    cursor: default;
}

.cc-btn-random {
    background: #4a7c2f;
}

.cc-btn-random:hover {
    background: #3a6020;
}

/* --- Archive Grid --- */
.cc-archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin-top: 0.5rem;
}

.cc-grid-item {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    border: 1.5px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
    cursor: pointer;
}

.cc-grid-item:hover {
    border-color: #888;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
    text-decoration: none;
}

.cc-grid-item--active {
    border-color: #2d6a0a;
    border-width: 2px;
    box-shadow: 0 0 0 3px rgba(45,106,10,0.12);
}

.cc-grid-item img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
    background: #f0f0f0;
}

.cc-grid-placeholder {
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #f0f0f0;
}

.cc-grid-title {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #222;
    padding: 6px 8px 2px;
    line-height: 1.35;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.cc-grid-date {
    display: block;
    font-size: 10px;
    color: #888;
    padding: 0 8px 7px;
}

/* Active item label override */
.cc-grid-item--active .cc-grid-title {
    color: #2d6a0a;
}

/* No results */
.cc-no-results {
    text-align: center;
    color: #888;
    padding: 2rem;
    font-size: 14px;
}

/* --- Responsive --- */
@media (max-width: 600px) {
    .cc-archive-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 8px;
    }

    .cc-topic-filters {
        gap: 6px;
    }

    .cc-topic-pill {
        font-size: 12px;
        padding: 5px 11px;
    }
}

/* --- Random Comic Widget --- */
.cc-random-comic-widget {
    text-align: center;
    padding: 10px 0;
}

.cc-random-comic-widget img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.10);
}

.cc-random-comic-widget .cc-random-comic-title {
    font-size: 0.9em;
    font-weight: bold;
    text-align: center;
    margin-top: 1em;
}
