*, ::before, ::after {
    box-sizing: border-box;
    border-width: 0;
    border-style: solid;
    border-color: #e5e7eb;
}

img, svg, video, canvas, audio, iframe, embed, object {
    display: block;
    vertical-align: middle;
}

img, video {
    max-width: 100%;
    height: auto;
}

/* Utility classes */
.object-cover {
    -o-object-fit: cover;
    object-fit: cover;
}

.w-full {
    width: 100%;
}

.h-auto {
    height: auto;
}

.container {
    min-height: 100vh;
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

/* Стиль для новості */
.career-news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(2rem, 1fr)); 
    gap: 20px;
    margin: 20px 0;
    width: 100%;
    max-width: 1200px;
}

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

.news-item {
    max-width: 24rem; 
    width: 100%;
    background-color: #ffffff; 
    border: none; 
    border-radius: 0; 
    overflow: hidden;
    transition: none; 
    display: block; 
    height: auto;
}

.news-image {
    margin-bottom: 1rem; 
}

.news-image img {
    width: 100%;
    height: auto;
    object-fit: cover; 
}

.news-content {
    padding: 0 1rem 1rem 1rem; 
    display: block; 
}

.news-title {
    font-size: 1.25rem; 
    font-weight: 700;
    color: #111827; 
    margin-bottom: 0.75rem;
    line-height: 1.375;
    display: block;
    overflow: visible; 
}

.news-date {
    display: block;
    font-size: 0.875rem; 
    color: #6b7280; 
    margin-bottom: 1rem;
    font-weight: 400;
}

.news-excerpt {
    display: none; 
}

.read-more-btn {
    display: inline-block;
    color: #16a34a; 
    font-weight: 500;
    font-size: 0.875rem; 
    transition: color 0.2s; 
    text-decoration: none;
    background: none;
    border: none;
    padding: 0;
    border-radius: 0;
    align-self: auto;
    margin-top: 0;
}

.read-more-btn:hover {
    color: #15803d; 
}

/* Стиль на повну новину*/
.single-career_news .entry-content {
    margin-top: 20px;
}

.single-career_news .wp-post-image,
.single-career_news .post-thumbnail img,
.single-career_news .news-image img {
    max-height: 400px; 
    width: 100%;
    object-fit: contain; 
    object-position: center;
    border-radius: 8px; 
    margin-bottom: 20px; 
}

.single-career_news .news-featured-image img {
    max-height: 400px; 
    width: auto;
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.single-career_news .news-featured-image {
    text-align: center;
    margin-bottom: 30px;
}

.single-career_news article {
    max-width: 800px; 
    width: 100%;
    background-color: #ffffff;
    padding: 2rem;
    margin: 0 auto;
}

.single-career_news .entry-header {
    margin-bottom: 1rem;
    padding: 0;
}

.single-career_news .entry-title {
    font-size: 2rem; 
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.75rem;
    line-height: 1.375;
}

.single-career_news .entry-date,
.single-career_news .news-date {
    display: block;
    font-size: 1rem; 
    color: #6b7280;
    margin-bottom: 1rem;
    font-weight: 400;
}

/* Контент під заголовком */
.single-career_news .entry-content {
    padding: 0;
    margin: 0;
}

.single-career_news .entry-content p {
    font-size: 1.125rem; 
    line-height: 1.7;
    color: #374151; 
    margin-bottom: 1rem;
    text-align: justify; 
}

.single-career_news .read-more-btn,
.single-career_news a.read-more-btn {
    display: inline-block;
    color: #16a34a;
    font-weight: 500;
    font-size: 0.875rem;
    transition: color 0.2s;
    text-decoration: none;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
}

.single-career_news .read-more-btn:hover,
.single-career_news a.read-more-btn:hover {
    color: #15803d;
}

/* Стиль для галерей новостей  */
.news-gallery {
    max-width: 800px;
    margin: 40px auto 0;
    padding: 20px 0;
    border-top: 2px solid #f0f0f0;
}

.news-gallery h3 {
    margin-bottom: 20px;
    color: #333;
    text-align: center;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.gallery-item {
    display: block;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
    cursor: pointer;
    height: 200px;
    position: relative;
}

.gallery-item a.gallery-item-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    max-width: 100%;
    max-height: 100%;
}

/* Стиль для минулих новин */
.previous-news-section {
    margin: 50px 0 30px 0;
    padding: 30px 0;
    border-top: 2px solid #f0f0f0;
    background: #fafafa;
    border-radius: 10px;
}

.previous-news-title {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-size: 1.5em;
    font-weight: 600;
}

.previous-news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(24rem, 1fr)); /* Как .article */
    gap: 20px; 
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    justify-content: center;
}

.previous-news-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.previous-news-item {
    max-width: 24rem; 
    width: 100%;
    background-color: #ffffff;
    border: none;
    border-radius: 0;
    overflow: hidden;
}

.previous-news-content {
    padding: 1rem; 
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
}

.previous-news-item-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.75rem;
    line-height: 1.375;
}

.previous-news-date {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 1rem;
    font-weight: 400;
}

.vacancy-card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: box-shadow 0.2s;
}

.vacancy-card:hover {
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.vacancy-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
}

.company-logo {
    flex-shrink: 0;
    width: 4rem;
    height: 4rem;
    border-radius: 6px;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.company-logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.vacancy-info {
    flex: 1;
}

.vacancy-title-row {
    margin-bottom: 0.5rem;
}

.vacancy-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
    line-height: 1.3;
}

.vacancy-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.meta-icon {
    color: #9ca3af;
}

.requirements-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.requirement-tag {
    background: #eff6ff;
    color: #2563eb;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.vacancy-description {
    padding: 0 1.5rem;
    flex: 1;
    color: #374151;
    line-height: 1.6;
}

.vacancy-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

.posted-date {
    font-size: 0.875rem;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.details-button,
.apply-button {
    background: #16a34a;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.details-button:hover,
.apply-button:hover {
    background: #15803d;
}

.contact-info {
    margin-top: 10px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 0.5rem;
}

/* Адаптивність */
@media (max-width: 768px) {
    .career-news-grid,
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .container {
        padding: 0.5rem;
    }
    
    .news-item,
    .previous-news-item,
    .single-career_news article {
        max-width: 100%; 
    }
    
    .news-content,
    .previous-news-content {
        padding: 0 0.5rem 0.5rem 0.5rem;
    }
    
    .single-career_news .wp-post-image,
    .single-career_news .post-thumbnail img,
    .single-career_news .news-image img {
        max-height: 300px;
    }
    
    .single-career_news .news-featured-image img {
        max-height: 300px;
    }
    

    .previous-news-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 15px;
    }
    
    .previous-news-section {
        margin: 40px 0 20px 0;
        padding: 20px 0;
    }
    
    .previous-news-title {
        font-size: 1.3em;
        margin-bottom: 20px;
    }
    
    .previous-news-content {
        padding: 12px;
    }
    
    .previous-news-item {
        min-height: auto;
    }
    
    .previous-news-image {
        height: auto;
    }
    

    .single-career_news .entry-title {
        font-size: 1.5rem; 
    }
    
    .single-career_news .entry-content {
        padding: 0;
    }
    
    .single-career_news .read-more-btn {
        margin-left: 0;
    }
    
    .single-career_news .entry-header {
        padding: 0;
    }

    .single-career_news article {
        padding: 1rem;
    }

    .single-career_news .entry-content p {
        font-size: 1rem;
        text-align: left;
    }

    .vacancies-list {
        gap: 1rem;
    }

    .vacancy-card {
        padding: 1rem;
    }

    .vacancy-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .company-logo {
        width: 3rem;
        height: 3rem;
    }

    .vacancy-title {
        font-size: 1.125rem;
    }

    .vacancy-meta {
        gap: 0.75rem;
    }

    .vacancy-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .apply-button,
    .details-button {
        align-self: stretch;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .career-news-grid,
    .previous-news-grid {
        gap: 15px;
    }
    
    .news-content,
    .previous-news-content {
        padding: 0 0.5rem 0.5rem 0.5rem;
    }
    
    .news-title,
    .previous-news-item-title {
        font-size: 1.125rem;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 10px;
    }
    

    .single-career_news .wp-post-image,
    .single-career_news .post-thumbnail img,
    .single-career_news .news-image img {
        max-height: 250px;
    }
    
    .single-career_news .news-featured-image img {
        max-height: 250px;
    }

    .single-career_news .entry-title {
        font-size: 1.25rem;
    }
    
    .single-career_news .read-more-btn {
        font-size: 0.875rem;
    }
    
    .single-career_news .entry-header {
        padding: 0;
    }
    
    .single-career_news .entry-content {
        padding: 0;
    }

    .vacancy-card {
        padding: 0.75rem;
    }

    .vacancy-title {
        font-size: 1rem;
    }
}

.news-item,
.previous-news-item {
    min-height: 0;
    height: auto;
}

.news-image,
.previous-news-image,
.gallery-item {
    flex-shrink: 0;
}

.news-content,
.previous-news-content {
    min-height: 0;
    flex-shrink: 1;
}

/* Фікс для контейнерів з зображенням */
.image-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.previous-news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, 24rem); 
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    justify-content: center;
    align-items: start; 
}

.previous-news-item {
    max-width: 24rem;
    width: 100%; 
    background-color: #ffffff;
    border: none;
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
    transition: none;
    display: block;
    height: auto;
    min-width: 24rem;
    flex-shrink: 0; 
}

.image-container img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
}

.single-career_news #primary {
    max-width: none;
    margin: 0;
    padding: 0;
}

.single-career_news .container {
    min-height: auto; 
    padding: 1rem;
    max-width: 100%;
    justify-content: flex-start;
}

/* Admin Gallery Styles for Career News Meta Box */
.news-gallery-container {
    position: relative;
}

.gallery-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
    padding: 10px;
    border: 1px dashed #ddd;
    border-radius: 4px;
    min-height: 60px;
    background-color: #f9f9f9;
}

.gallery-image {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 4px;
    overflow: hidden;
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.remove-image {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background-color: #dc3232;
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.remove-image:hover {
    background-color: #b32d2e;
}

#add_gallery_images,
#clear_gallery {
    background-color: #0073aa;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.2s;
}

#add_gallery_images:hover,
#clear_gallery:hover {
    background-color: #005a87;
}

#clear_gallery {
    background-color: #a00;
    margin-left: 10px;
}

#clear_gallery:hover {
    background-color: #800;
}

.news-gallery-container p {
    margin: 10px 0;
}

/* Responsive for smaller admin screens */
@media (max-width: 782px) {
    .gallery-preview {
        gap: 8px;
    }
    
    .gallery-image {
        width: 60px;
        height: 60px;
    }
    
    #add_gallery_images,
    #clear_gallery {
        padding: 6px 12px;
        font-size: 12px;
    }
}