/**
 * Additional Styles for Gotuj z Maciejem Theme
 */

/* Search Overlay */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.98);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-overlay-inner {
    width: 100%;
    max-width: 600px;
    padding: 40px;
    text-align: center;
}

.search-overlay .search-close {
    position: absolute;
    top: 20px;
    right: 30px;
    background: none;
    border: none;
    font-size: 2.5rem;
    cursor: pointer;
    color: #333;
    transition: color 0.3s ease;
}

.search-overlay .search-close:hover {
    color: #888;
}

.search-overlay .search-form {
    border: none;
    border-bottom: 2px solid #333;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}

.search-overlay .search-form:hover,
.search-overlay .search-form:focus-within {
    box-shadow: none;
    transform: none;
}

.search-overlay .search-field {
    font-size: 1.5rem;
    padding: 20px;
    background: transparent;
    text-align: center;
}

.search-overlay .search-submit {
    background: transparent;
    color: #333;
    padding: 20px;
    border-radius: 0;
}

.search-overlay .search-submit:hover {
    background: transparent;
    color: #e25555;
    transform: none;
}

.search-overlay .search-submit svg {
    width: 24px;
    height: 24px;
}

/* Post Navigation */
.post-navigation {
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    padding: 30px 0;
    max-width: 800px;
    margin: 0 auto;
}

.post-navigation .nav-links {
    display: flex;
    justify-content: space-between;
    gap: 30px;
}

.post-navigation .nav-previous,
.post-navigation .nav-next {
    flex: 1;
}

.post-navigation .nav-next {
    text-align: right;
}

.post-navigation .nav-subtitle {
    display: block;
    font-size: 0.75rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 5px;
}

.post-navigation .nav-title {
    font-size: 1rem;
    color: #333;
}

.post-navigation a:hover .nav-title {
    color: #888;
}

/* Social Share */
.social-share {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 20px 0;
    max-width: 800px;
    margin: 0 auto;
}

.social-share .share-label {
    font-size: 0.8rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #888;
}

.social-share a,
.social-share button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid #ddd;
    border-radius: 50%;
    color: #666;
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    text-decoration: none;
}

.social-share a:hover,
.social-share button:hover {
    background: #333;
    border-color: #333;
    color: #fff;
}

/* Social platform colors on hover */
.social-share .share-facebook:hover {
    background: #1877f2;
    border-color: #1877f2;
}

.social-share .share-pinterest:hover {
    background: #e60023;
    border-color: #e60023;
}

.social-share .share-twitter:hover {
    background: #000;
    border-color: #000;
}

.social-share .share-whatsapp:hover {
    background: #25d366;
    border-color: #25d366;
}

.social-share .share-email:hover {
    background: #ea4335;
    border-color: #ea4335;
}

/* Copy Link Button */
.social-share .copy-link-btn {
    position: relative;
}

.social-share .copy-link-btn .copy-success {
    display: none;
    color: #28a745;
}

.social-share .copy-link-btn.copied {
    border-color: #28a745;
    background: #d4edda;
}

.social-share .copy-link-btn.copied svg:first-child {
    display: none;
}

.social-share .copy-link-btn.copied .copy-success {
    display: block;
}

.social-share .copy-link-btn:hover {
    background: #6c757d;
    border-color: #6c757d;
}

.social-share .copy-link-btn.copied:hover {
    background: #28a745;
    border-color: #28a745;
}

/* Native Share Button - only visible when supported */
.social-share .native-share-btn {
    display: none;
}

.social-share .native-share-btn.visible {
    display: flex;
}

.social-share .native-share-btn:hover {
    background: #007bff;
    border-color: #007bff;
}

.social-share svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Archive Header */
.archive-header {
    text-align: center;
    padding: 50px 20px;
    margin-bottom: 30px;
}

.archive-title {
    font-size: 2rem;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.archive-description {
    color: #666;
    font-size: 1rem;
    margin-top: 15px;
}

/* Search Header */
.search-header {
    text-align: center;
    padding: 50px 20px;
    margin-bottom: 30px;
}

.search-title {
    font-size: 1.5rem;
    letter-spacing: 2px;
}

.search-title span {
    font-style: italic;
    font-weight: 600;
}

/* Error 404 */
.error-404 {
    text-align: center;
    padding: 80px 20px;
}

.error-404 .page-title {
    font-size: 2rem;
    margin-bottom: 20px;
}

.error-404 .page-content {
    max-width: 600px;
    margin: 0 auto;
}

.error-404 .search-form {
    margin: 30px 0;
}

.error-404 .widget-area {
    margin-top: 50px;
    text-align: left;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
}

/* Page Header */
.page-header {
    text-align: center;
    padding: 50px 20px;
}

/* Post Tags */
.tags-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    padding: 20px 0;
    max-width: 800px;
    margin: 0 auto;
    font-size: 0.85rem;
}

.tags-links a {
    display: inline-block;
    padding: 5px 12px;
    background: #f5f5f5;
    color: #666;
    font-size: 0.8rem;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.tags-links a:hover {
    background: #333;
    color: #fff;
}

/* Recipe Actions */
.recipe-actions {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #eee;
    margin-top: 20px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .post-navigation .nav-links {
        flex-direction: column;
    }
    
    .post-navigation .nav-next {
        text-align: left;
    }
    
    .social-share {
        flex-wrap: wrap;
    }
}

/* ==========================================================================
   Recipes Page with Filters
   ========================================================================== */

.recipes-page-main {
    padding: 40px 0 60px;
}

.recipes-page-header {
    text-align: center;
    margin-bottom: 40px;
}

.recipes-page-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2.5rem;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #333;
    margin-bottom: 10px;
}

.recipes-page-description {
    font-size: 1.1rem;
    color: #888;
    font-style: italic;
}

/* Filters Section */
.recipes-filters {
    background: #f9f9f9;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 40px;
}

.filters-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-end;
}

.filter-group {
    flex: 1;
    min-width: 180px;
}

.filter-group.filter-search {
    flex: 2;
    min-width: 250px;
}

.filter-group.filter-reset {
    flex: 0;
    min-width: auto;
}

.filter-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #666;
    margin-bottom: 8px;
}

.filter-input,
.filter-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    background: #fff;
    transition: all 0.3s ease;
    appearance: none;
    accent-color: #e25555;
    -webkit-appearance: none;
    -moz-appearance: none;
    color: #333;
}

.filter-select option {
    color: #333;
}

.filter-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
    cursor: pointer;
}

.filter-input:focus,
.filter-select:focus {
    outline: none;
    border-color: #e25555;
    box-shadow: 0 0 0 3px rgba(226, 85, 85, 0.1);
}

.reset-filters-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.reset-filters-btn:hover {
    border-color: #e25555;
    color: #e25555;
}

.reset-filters-btn svg {
    transition: transform 0.3s ease;
}

.reset-filters-btn:hover svg {
    transform: rotate(-45deg);
}

/* Active Filters */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #e25555;
    color: #fff;
    border-radius: 20px;
    font-size: 0.85rem;
}

.filter-tag button {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.filter-tag button:hover {
    opacity: 1;
}

/* Results Count */
.results-count {
    margin-top: 20px;
    font-size: 0.9rem;
    color: #888;
}

#results-count-number {
    font-weight: 700;
    color: #333;
}

/* Recipes Grid */
.recipes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

/* Recipe Card Item - match main page post-card styling */
.recipe-card-item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.recipe-card-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.recipe-card-thumbnail {
    position: relative;
    overflow: hidden;
}

.recipe-card-thumbnail img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.recipe-card-item:hover .recipe-card-thumbnail img {
    transform: scale(1.05);
}

.recipe-difficulty-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.difficulty-easy {
    background: #4CAF50;
    color: #fff;
}

.difficulty-medium {
    background: #FF9800;
    color: #fff;
}

.difficulty-hard {
    background: #f44336;
    color: #fff;
}

.recipe-card-content {
    padding: 20px;
}

.recipe-card-content {
    padding: 1.25rem;
}

.recipe-card-category {
    margin-bottom: 10px;
}

.recipe-card-category a {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #e25555;
    text-decoration: none;
    font-weight: 600;
}

.recipe-card-category a:hover {
    text-decoration: underline;
}

.recipe-card-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.recipe-card-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.recipe-card-title a:hover {
    color: #666;
}

.recipe-card-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: #888;
}

.recipe-card-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.recipe-card-meta svg {
    color: #bbb;
}

/* No Results Message */
.no-results-message {
    text-align: center;
    padding: 60px 20px;
    color: #888;
}

.no-results-message svg {
    color: #ddd;
    margin-bottom: 20px;
}

.no-results-message h3 {
    font-size: 1.5rem;
    color: #666;
    margin-bottom: 10px;
}

.no-results-message p {
    font-size: 1rem;
}

/* Responsive Filters */
@media (max-width: 768px) {
    .recipes-filters {
        padding: 20px;
    }
    
    .filters-wrapper {
        gap: 15px;
    }
    
    .filter-group {
        min-width: 100%;
    }
    
    .filter-group.filter-search {
        min-width: 100%;
    }
    
    .filter-group.filter-reset {
        min-width: 100%;
    }
    
    .reset-filters-btn {
        width: 100%;
        justify-content: center;
    }
    
    .recipes-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .recipes-page-title {
        font-size: 1.8rem;
        letter-spacing: 2px;
    }
}

/* ==========================================================================
   Date Display Fix - Hide modified date, show only published date
   ========================================================================== */

.post-meta time.updated:not(.published) {
    display: none;
}

.post-meta .posted-on time.published + time.updated {
    display: none;
}

/* ==========================================================================
   Comments Styling
   ========================================================================== */

.comment-list .comment-body {
    padding-left: 0;
}

.comment-list .comment-author {
    margin-bottom: 0.5rem;
}

.comment-list .comment-author .avatar {
    display: none;
}

.comment-list .comment-author .fn {
    font-size: 1.2rem;
    font-weight: 600;
}

.comment-list .comment-author .fn a {
    color: #333;
    text-decoration: none;
}

.comment-list .comment-author .says {
    font-size: 1rem;
}

/* Reply form title and cancel link */
#reply-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

#reply-title small {
    display: block;
    width: 100%;
    margin-top: 0.5rem;
}

#reply-title small a {
    font-size: 0.9rem;
    color: #888;
    text-decoration: none;
}

#reply-title small a:hover {
    color: #333;
    text-decoration: underline;
}

/* ==========================================================================
   Comment Form Cookies Consent Checkbox
   ========================================================================== */

.comment-form-cookies-consent {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.comment-form-cookies-consent input[type="checkbox"] {
    margin-top: 0.25rem;
    flex-shrink: 0;
}

.comment-form-cookies-consent label {
    font-size: 0.85rem;
    line-height: 1.5;
    color: #666;
}

/* ==========================================================================
   Recipe Card Styling (Consistent across all pages)
   ========================================================================== */

/* Difficulty badge styling - works on both main page and recipe page */
.post-card .post-thumbnail .recipe-difficulty-badge,
.recipe-card-item .recipe-card-thumbnail .recipe-difficulty-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
}

/* Meta styling for recipe cards on main page */
.post-card .recipe-card-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: #888;
}

.post-card .recipe-card-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.post-card .recipe-card-meta svg {
    color: #bbb;
}

.recipe-card-item .recipe-card-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: #888;
}

.recipe-card-item .recipe-card-meta svg {
    vertical-align: middle;
    margin-right: 0.25rem;
}

/* ==========================================================================
   Recipe Featured Image (below title)
   ========================================================================== */

.recipe-featured-image {
    margin: 1.5rem 0;
    border-radius: 8px;
    overflow: hidden;
}

.recipe-featured-image img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
    display: block;
    background: #fafafa;
}

/* ==========================================================================
   Recipe Info Bar (on single recipe page)
   ========================================================================== */

.recipe-info-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 3rem;
    margin-top: 1.5rem;
    margin-bottom: 0;
    padding: 1.25rem 2rem;
    background: #f9f9f9;
    border-radius: 8px;
}

.recipe-info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.recipe-info-item svg {
    color: #e25555;
    flex-shrink: 0;
}

.recipe-info-label {
    font-size: 0.85rem;
    color: #888;
}

.recipe-info-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
}

/* Reduce gap between header and content */
.single-recipe-main .single-post-header {
    margin-bottom: 1rem;
}

.single-recipe-main .post-content {
    padding-top: 0;
    max-width: 800px;
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
}

.single-recipe-main .post-content h2 {
    text-align: center;
    margin-top: 2rem;
    margin-bottom: 1.5rem;
}

.single-recipe-main .post-content ol {
    max-width: 600px;
    margin: 0 auto;
}

@media (max-width: 600px) {
    .recipe-info-bar {
        gap: 1.5rem;
        padding: 1rem;
    }
    
    .recipe-info-item {
        flex: 1 1 45%;
    }
}

/* ==========================================================================
   Recipe Instructions with Images
   ========================================================================== */

.recipe-instructions .instruction-item {
    display: flex;
    flex-direction: column;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
}

.recipe-instructions .instruction-item:last-child {
    border-bottom: none;
}

.recipe-instructions .instruction-content {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.recipe-instructions .instruction-step {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: #333;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.recipe-instructions .instruction-text {
    flex: 1;
    line-height: 1.7;
}

.recipe-instructions .instruction-image {
    margin-top: 1rem;
    border-radius: 8px;
    overflow: hidden;
}

.recipe-instructions .instruction-image img {
    width: 100%;
    max-width: 600px;
    height: auto;
    display: block;
}

/* ==========================================================================
   Recipe Steps from Gutenberg Blocks
   ========================================================================== */

.wp-block-group.recipe-step {
    background: #fafafa;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Ukryj puste kroki (tylko placeholder bez treści) */
.wp-block-group.recipe-step:has(p:only-child:empty),
.wp-block-group.recipe-step:has(> p:first-child:last-of-type:empty) {
    display: none;
}

/* Ukryj recipe-step jeśli paragraf ma tylko placeholder text lub jest pusty */
.wp-block-group.recipe-step p:empty {
    display: none;
}

.wp-block-group.recipe-step p {
    margin-bottom: 1rem;
    font-size: 1.05rem;
    line-height: 1.8;
}

.wp-block-group.recipe-step .wp-block-image {
    margin: 1rem 0 0 0;
}

.wp-block-group.recipe-step .wp-block-image img {
    border-radius: 8px;
}

.wp-block-group.recipe-step .wp-block-image.step-image img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

/* ==========================================================================
   404 Error Page
   ========================================================================== */

.error-404-main {
    padding: 80px 20px;
    text-align: center;
}

.error-404 .page-header {
    margin-bottom: 2rem;
}

.error-404 .error-code {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 8rem;
    font-weight: 700;
    color: #eee;
    margin: 0;
    line-height: 1;
}

.error-404 .page-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2rem;
    font-weight: 400;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 0;
    color: #333;
}

.error-404 .page-content p {
    font-size: 1.1rem;
    color: #666;
    max-width: 500px;
    margin: 0 auto 2rem;
}

.error-404 .btn-home {
    display: inline-block;
    padding: 15px 40px;
    background: #333;
    color: #fff;
    font-size: 0.85rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-decoration: none;
    transition: background 0.3s ease;
}

.error-404 .btn-home:hover {
    background: #555;
}

.error-404 .search-section {
    margin-top: 3rem;
}

.error-404 .search-section p {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 1rem;
}

.error-404 .search-form {
    max-width: 400px;
    margin: 0 auto;
}

/* ==========================================================================
   Ukryj puste elementy z szablonu przepisu
   ========================================================================== */

/* Ukryj puste paragrafy i grupy */
.single-recipe-main .post-content p:empty,
.single-recipe-main .post-content .wp-block-group:empty {
    display: none;
}

/* Ukryj recipe-step który nie ma treści (tylko placeholder) */
.single-recipe-main .wp-block-group.recipe-step:not(:has(p:not(:empty))):not(:has(img)) {
    display: none;
}

/* Ukryj nagłówek Wskazówki jeśli następny element jest pusty */
.single-recipe-main .post-content h2 + p:empty {
    display: none;
}

/* Dla przeglądarek bez :has - fallback z JS */
.hide-empty-block {
    display: none !important;
}
