/* Category Directory Styles */

/* ========================================
   Search Box
   ======================================== */
.cd-search-wrap {
    margin-bottom: 30px;
}

.cd-search-form {
    max-width: 100%;
}

.cd-search-input-wrap {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.cd-search-input {
    flex: 1;
    padding: 15px 20px;
    font-size: 16px;
    border: none;
    outline: none;
    background: transparent;
}

.cd-search-input::placeholder {
    color: #888;
}

.cd-search-btn {
    padding: 15px 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #666;
    transition: color 0.2s;
}

.cd-search-btn:hover {
    color: #2271b1;
}

.cd-search-btn svg {
    display: block;
    width: 22px;
    height: 22px;
}

.cd-search-advanced {
    text-align: right;
    margin-top: 8px;
}

.cd-search-advanced a {
    font-size: 13px;
    color: #2271b1;
    text-decoration: none;
}

.cd-search-advanced a:hover {
    text-decoration: underline;
}

/* ========================================
   Statistics Bar
   ======================================== */
.cd-stats-wrap {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px 20px;
    margin-bottom: 30px;
}

.cd-stats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 25px;
}

.cd-stats-label {
    font-weight: 600;
    color: #1d2327;
}

.cd-stats-item {
    color: #50575e;
    font-size: 14px;
}

.cd-stats-item strong {
    color: #1d2327;
    font-weight: 600;
}

/* ========================================
   Directory Grid
   ======================================== */
.cd-directory-wrap {
    margin-bottom: 40px;
}

.cd-directory-title {
    font-size: 24px;
    font-weight: 400;
    color: #2271b1;
    margin: 0 0 25px 0;
    padding: 0;
    border: none;
}

.cd-directory-grid {
    display: grid;
    gap: 25px;
}

.cd-columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.cd-columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.cd-columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* ========================================
   Category Card
   ======================================== */
.cd-category-card {
    background: #fff;
    padding: 20px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
}

.cd-category-name {
    font-size: 18px;
    font-weight: 400;
    margin: 0 0 12px 0;
    padding: 0;
    border: none;
}

.cd-category-name a {
    color: #2271b1;
    text-decoration: none;
}

.cd-category-name a:hover {
    color: #135e96;
    text-decoration: underline;
}

.cd-category-desc {
    font-size: 13px;
    color: #666;
    margin: 0 0 12px 0;
    line-height: 1.5;
}

/* ========================================
   Subcategory List
   ======================================== */
.cd-subcategory-list {
    list-style: none;
    margin: 0 0 12px 0;
    padding: 0;
}

.cd-subcategory-list li {
    margin-bottom: 6px;
    font-size: 14px;
    line-height: 1.4;
}

.cd-subcategory-list a {
    color: #50575e;
    text-decoration: none;
}

.cd-subcategory-list a:hover {
    color: #2271b1;
    text-decoration: underline;
}

.cd-post-count {
    color: #888;
    font-size: 13px;
    margin-left: 3px;
}

.cd-empty-text {
    font-size: 14px;
    color: #888;
    font-style: italic;
    margin: 0 0 12px 0;
}

/* ========================================
   View All Link
   ======================================== */
.cd-view-all {
    display: inline-block;
    font-size: 13px;
    color: #2271b1;
    text-decoration: none;
}

.cd-view-all:hover {
    text-decoration: underline;
}

/* ========================================
   No Categories Message
   ======================================== */
.cd-no-categories {
    text-align: center;
    padding: 40px 20px;
    background: #f9f9f9;
    border-radius: 4px;
    color: #666;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 992px) {
    .cd-columns-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .cd-columns-3,
    .cd-columns-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .cd-directory-title {
        font-size: 20px;
    }
    
    .cd-stats {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

@media (max-width: 480px) {
    .cd-columns-2,
    .cd-columns-3,
    .cd-columns-4 {
        grid-template-columns: 1fr;
    }
    
    .cd-search-input {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .cd-search-btn {
        padding: 12px 15px;
    }
    
    .cd-category-card {
        padding: 15px;
    }
}

/* ========================================
   Wine Theme Variation (Optional)
   ======================================== */
.cd-theme-wine .cd-directory-title {
    color: #722F37;
}

.cd-theme-wine .cd-category-name a {
    color: #722F37;
}

.cd-theme-wine .cd-category-name a:hover {
    color: #4a1f24;
}

.cd-theme-wine .cd-view-all {
    color: #722F37;
}

.cd-theme-wine .cd-search-btn:hover {
    color: #722F37;
}

.cd-theme-wine .cd-search-advanced a {
    color: #722F37;
}

.cd-theme-wine .cd-subcategory-list a:hover {
    color: #722F37;
}

/* ========================================
   Alternative Light Background
   ======================================== */
.cd-bg-light {
    background: #f0f4f7;
    padding: 30px;
    border-radius: 8px;
}

.cd-bg-light .cd-category-card {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
    .cd-search-wrap {
        display: none;
    }
    
    .cd-category-card {
        break-inside: avoid;
        border: 1px solid #ccc;
    }
}
