/* ========================================
   NOTES CAROUSEL SECTION - INTEGRATED GRID
   ======================================== */

/* Notes section with proper spacing */
.gh-topic.notes-section {
    margin-top: 120px;
    margin-bottom: 140px;
}

/* Add spacing between title and carousel */
.gh-topic.notes-section .notes-carousel-wrapper {
    margin-top: 32px;
}

/* Do NOT override gh-topic-name - use theme default completely */

/* Carousel wrapper - hides overflow and positions nav buttons */
.notes-carousel-wrapper {
    position: relative;
    overflow: hidden;
    margin-bottom: 0;
}

/* Carousel container - scrollable */
.notes-carousel {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 2px;
}

.notes-carousel::-webkit-scrollbar {
    display: none;
}

/* Black square note cards */
.note-card-square {
    flex: 0 0 auto;
    width: 228px;
    height: 228px;
    background: #000000;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.note-card-square:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.note-card-link {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
}

.note-card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    width: 100%;
    margin-top: 8px;
}

.note-card-square .note-card-title {
    color: #FFFFFF;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
    text-align: center;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Note card metadata container */
.note-card-meta {
    display: flex;
    align-items: center;
    gap: 0;
    flex-shrink: 0;
    margin-bottom: 12px;
}

.note-card-type {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.02em;
}

.note-card-sep {
    margin: 0 4px;
    color: rgba(255, 255, 255, 0.3);
    font-size: 12px;
}

.note-card-date {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
}

.note-card-link:hover .note-card-title {
    color: #EEEEEE;
}

/* Overlay Navigation Buttons */
.carousel-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(255, 255, 255, 0.9);
    color: #000000;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.carousel-nav-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: translateY(-50%) scale(1.05);
}

.carousel-nav-btn:active:not(:disabled) {
    transform: translateY(-50%) scale(0.95);
}

.carousel-nav-btn:disabled {
    opacity: 0;
    pointer-events: none;
}

.carousel-nav-btn svg {
    width: 24px;
    height: 24px;
}

.carousel-prev {
    left: 10px;
}

.carousel-next {
    right: 10px;
}

.notes-carousel-wrapper:hover .carousel-nav-btn:not(:disabled),
.notes-carousel-wrapper .carousel-nav-btn:not(:disabled) {
    opacity: 1;
}

/* ========================================
   NOTE POST STYLING
   ======================================== */

.post-template .tag-notes .post-full-image,
.post-template .tag-note .post-full-image {
    display: none !important;
}

.post-card.tag-notes:not(.post-card-image-link) .post-card-image,
.post-card.tag-note:not(.post-card-image-link) .post-card-image {
    background: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.post-card.tag-notes:not(.post-card-image-link) .post-card-image::before,
.post-card.tag-note:not(.post-card-image-link) .post-card-image::before {
    content: "NOTE";
    color: #FFFFFF;
    font-size: 48px;
    font-weight: 700;
    letter-spacing: 2px;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    .note-card-square {
        width: 290px;
        height: 290px;
        padding: 25px;
    }
    
    .note-card-square .note-card-title {
        font-size: 24px;
    }
    
    .carousel-nav-btn {
        width: 40px;
        height: 40px;
    }
    
    .carousel-nav-btn svg {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    .note-card-square {
        width: 242px;
        height: 242px;
        padding: 20px;
    }
    
    .note-card-square .note-card-title {
        font-size: 24px;
        -webkit-line-clamp: 4;
    }
    
    .carousel-nav-btn {
        width: 36px;
        height: 36px;
    }
    
    .carousel-prev {
        left: 5px;
    }
    
    .carousel-next {
        right: 5px;
    }
}

/* ========================================
   GRID ALIGNMENT ADJUSTMENTS
   ======================================== */

.container .notes-carousel-wrapper {
    margin-left: 0;
    margin-right: 0;
}

.notes-carousel-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 100%;
    background: linear-gradient(to left, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 5;
}

.notes-carousel-wrapper.has-more::after {
    opacity: 1;
}

.notes-carousel-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 80px;
    height: 100%;
    background: linear-gradient(to right, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 5;
}

.notes-carousel-wrapper.has-more-left::before {
    opacity: 1;
}