/* WP Custom Taxonomy Manager - Frontend Styles */

.wpct-post-taxonomies {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 4px;
}

.wpct-post-taxonomies h4 {
    margin: 0 0 15px 0;
    font-size: 1.1em;
    color: #333;
}

.wpct-taxonomy-terms {
    margin-bottom: 10px;
    line-height: 1.6;
}

.wpct-taxonomy-terms:last-child {
    margin-bottom: 0;
}

.wpct-taxonomy-label {
    font-weight: 600;
    color: #555;
}

.wpct-terms-list a {
    color: #2271b1;
    text-decoration: none;
    padding: 2px 6px;
    border-radius: 3px;
    transition: background 0.2s;
}

.wpct-terms-list a:hover {
    background: #2271b1;
    color: #fff;
}

/* Taxonomy Archive Page */
.taxonomy-archive .wpct-term-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

.taxonomy-archive .wpct-term-header h1 {
    margin-bottom: 10px;
}

/* Term Description on Archive Pages */
.wpct-term-description {
    margin: 15px 0 25px 0;
    padding: 15px 20px;
    background: #f8f9fa;
    border-left: 4px solid #2271b1;
    border-radius: 0 4px 4px 0;
    font-size: 1.05em;
    line-height: 1.6;
    color: #3c434a;
}

.wpct-term-description p {
    margin: 0 0 10px 0;
}

.wpct-term-description p:last-child {
    margin-bottom: 0;
}

/* Term Image on Archive Pages */
.wpct-term-image-wrap {
    margin: 20px 0;
    text-align: center;
}

.wpct-term-image-wrap img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.wpct-term-archive-image {
    display: block;
    margin: 0 auto 20px auto;
}

/* Term Image Shortcode */
.wpct-term-image {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

/* Taxonomy Root Page Styles */
.wpct-taxonomy-root-page {
    max-width: 1200px;
    margin: 0 auto;
}

.wpct-taxonomy-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
}

.wpct-taxonomy-title {
    font-size: 2.5em;
    margin-bottom: 20px;
    color: #1d2327;
}

.wpct-taxonomy-image-wrap {
    margin: 20px 0;
}

.wpct-taxonomy-image-wrap img {
    max-width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.wpct-taxonomy-description {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background: #f8f9fa;
    border-left: 4px solid #2271b1;
    border-radius: 0 8px 8px 0;
    font-size: 1.1em;
    line-height: 1.7;
    color: #3c434a;
}

/* Terms Grid */
.wpct-terms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    padding: 20px 0;
}

.wpct-terms-grid.wpct-columns-1 { grid-template-columns: 1fr; }
.wpct-terms-grid.wpct-columns-2 { grid-template-columns: repeat(2, 1fr); }
.wpct-terms-grid.wpct-columns-3 { grid-template-columns: repeat(3, 1fr); }
.wpct-terms-grid.wpct-columns-4 { grid-template-columns: repeat(4, 1fr); }
.wpct-terms-grid.wpct-columns-5 { grid-template-columns: repeat(5, 1fr); }
.wpct-terms-grid.wpct-columns-6 { grid-template-columns: repeat(6, 1fr); }

.wpct-term-custom-fields {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #2271b1;
}

.wpct-custom-field-item {
    margin-bottom: 12px;
    line-height: 1.6;
}

.wpct-custom-field-item:last-child {
    margin-bottom: 0;
}

.wpct-cf-label {
    font-weight: 600;
    color: #1d2327;
}

.wpct-cf-value {
    color: #3c434a;
}

.wpct-cf-value a {
    color: #2271b1;
    text-decoration: none;
}

.wpct-cf-value a:hover {
    text-decoration: underline;
}

.wpct-cf-url a {
    color: #2271b1;
    word-break: break-all;
}

.wpct-cf-email a {
    color: #2271b1;
}

.wpct-cf-image-wrap img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin-top: 8px;
}

.wpct-cf-textarea {
    display: block;
    margin-top: 4px;
}

.wpct-cf-number {
    font-family: monospace;
    background: #f0f0f1;
    padding: 2px 6px;
    border-radius: 3px;
}

/* Archive page custom fields */
.taxonomy-archive .wpct-term-custom-fields {
    margin: 20px 0;
}

@media (max-width: 1024px) {
    .wpct-terms-grid.wpct-columns-4,
    .wpct-terms-grid.wpct-columns-5,
    .wpct-terms-grid.wpct-columns-6 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .wpct-terms-grid,
    .wpct-terms-grid.wpct-columns-2,
    .wpct-terms-grid.wpct-columns-3,
    .wpct-terms-grid.wpct-columns-4,
    .wpct-terms-grid.wpct-columns-5,
    .wpct-terms-grid.wpct-columns-6 {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .wpct-terms-grid,
    .wpct-terms-grid.wpct-columns-2,
    .wpct-terms-grid.wpct-columns-3,
    .wpct-terms-grid.wpct-columns-4,
    .wpct-terms-grid.wpct-columns-5,
    .wpct-terms-grid.wpct-columns-6 {
        grid-template-columns: 1fr;
    }
}

/* Term Card */
.wpct-term-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.wpct-term-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.wpct-term-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.wpct-term-thumb {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: #f0f0f1;
}

.wpct-term-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.wpct-term-card:hover .wpct-term-thumb img {
    transform: scale(1.05);
}

.wpct-term-thumb.wpct-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2271b1 0%, #135e96 100%);
}

.wpct-placeholder {
    font-size: 4em;
    font-weight: 700;
    color: rgba(255,255,255,0.3);
    text-transform: uppercase;
}

.wpct-term-info {
    padding: 20px;
}

.wpct-term-name {
    font-size: 1.3em;
    margin: 0 0 10px 0;
    color: #1d2327;
}

.wpct-term-desc {
    font-size: 0.95em;
    color: #646970;
    margin: 0 0 15px 0;
    line-height: 1.5;
}

.wpct-term-count {
    display: inline-block;
    padding: 6px 12px;
    background: #f0f0f1;
    border-radius: 20px;
    font-size: 0.85em;
    color: #3c434a;
}

.wpct-no-terms {
    text-align: center;
    padding: 40px;
    color: #646970;
    font-style: italic;
}

/* Shortcode Styles */
.wpct-shortcode-terms a {
    color: #2271b1;
    text-decoration: none;
}

.wpct-shortcode-terms a:hover {
    text-decoration: underline;
}

.wpct-label {
    font-weight: 600;
    margin-right: 5px;
}
