/**
 * Styles for Recipe Display
 *
 * @package DatatimeReceptyProdukty
 */

/* Recipe Container */
.recept-container {
    margin: 0 auto;
    font-family: var(--e-global-typography-text-font-family, 'Nunito', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif);
    color: var(--e-global-color-text);
}

/* Hide print-only elements on frontend */
.print-only {
    display: none !important;
}

/* Show print-only elements when printing */
@media print {
    .print-only {
        display: block !important;
    }

    .no-print {
        display: none !important;
    }

    /* Ensure Nunito font and left alignment for print */
    .recept-header {
        text-align: left !important;
    }

    .recept-title {
        font-family: 'Nunito', sans-serif !important;
        text-align: left !important;
    }
}

/* Recipe ingredients styling */
.recept-ingrediencie {
    border-radius: 1em;
    padding: 3em;
    box-shadow: 0px 10px 30px -15px rgba(0, 0, 0, 0.5);
    height: fit-content;
}

.recept-title {
    font-family: var(--e-global-typography-primary-font-family);
    font-size: var(--e-global-typography-primary-font-size);
    font-weight: var(--e-global-typography-primary-font-weight);
    text-transform: var(--e-global-typography-primary-text-transform);
    font-style: var(--e-global-typography-primary-font-style);
    text-decoration: var(--e-global-typography-primary-text-decoration);
    line-height: var(--e-global-typography-primary-line-height);
    letter-spacing: var(--e-global-typography-primary-letter-spacing);
    word-spacing: var(--e-global-typography-primary-word-spacing);
    color: var(--e-global-color-primary);
    margin-bottom: 20px;
}

/* Print & PDF Buttons */
.recept-actions {
    display: flex;
    gap: 1em;
    flex-direction: row;
    align-content: center;
    align-items: center;
}

.recept-action-btn {
    font-size: 16px !important;
    font-weight: 400 !important;
    text-transform: uppercase !important;
    font-style: normal;
    text-decoration: none;
    line-height: 1em !important;
    padding: 8px 16px !important;
    border: 1px solid var(--e-global-color-primary);
    background-color: transparent !important;
    color: var(--e-global-color-primary) !important;
    border-radius: 1em;
    transition: background-color 0.3s, color 0.3s, transform 0.2s, box-shadow 0.2s;
}

.recept-action-btn:hover {
    background-color: var(--e-global-color-primary) !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0px 10px 30px -15px rgba(0, 0, 0, 0.5);
}

.recept-action-btn i,
.recept-action-btn ion-icon {
    margin-right: 6px;
}

/* Print Styles - Synchronized with PDF styles */
@media print {

    .recept-actions,
    .recept-social,
    .no-print {
        display: none !important;
    }

    /* Hide site header/navigation */
    header,
    .site-header,
    #site-header,
    .main-header,
    #main-header,
    .main-navigation,
    #main-navigation,
    .navbar,
    #navbar,
    .navigation,
    #navigation,
    .elementor-location-header,
    .site-branding,
    #masthead,
    .header-wrapper,
    .primary-menu,
    .menu-primary,
    .top-bar,
    .site-navigation,
    nav,
    .elementor-nav-menu,
    .header-area,
    .et-fixed-header,
    #et-top-navigation,
    #header,
    .ast-main-header-bar-alignment,
    #site-navigation,
    .ast-mobile-menu-buttons {
        display: none !important;
    }

    /* Additional spacing at the top to compensate for the hidden header */
    body {
        padding-top: 0 !important;
        margin-top: 0 !important;
    }

    .recept-container {
        margin-top: 0 !important;
    }

    .recept-header {
        text-align: center;
        margin-top: 15mm;
    }

    .recept-title {
        color: #000;
        font-size: 24pt;
        font-weight: bold;
        margin-bottom: 5mm;
        text-align: center;
    }

    .recept-img-container {
        text-align: center;
        margin-bottom: 15mm;
    }

    .recept-img-container img {
        max-width: 100%;
        height: auto;
        display: block;
        margin: 0 auto;
        border-radius: 1em;
    }

    .recept-meta {
        margin-bottom: 15mm;
        padding: 10mm;
        background-color: #f8f8f8;
        border-left: 2mm solid #000;
    }

    .recept-meta-item {
        display: flex;
        align-items: center;
        margin-bottom: 5mm;
        color: #000;
    }

    .recept-meta-item ion-icon {
        margin-right: 3mm;
        color: #000;
        font-size: 12pt;
    }

    .recept-meta-label {
        font-weight: bold;
        margin-right: 3mm;
        color: #000;
    }

    .recept-meta-value {
        flex-grow: 1;
        color: #000;
    }

    .recept-popis {
        margin-bottom: 15mm;
        color: #000;
    }

    .recept-section-title {
        color: #000;
        font-size: 18pt;
        font-weight: bold;
        margin-bottom: 8mm;
        border-bottom: 0.5mm solid #000;
        padding-bottom: 3mm;
    }

    .recept-ingrediencie,
    .recept-postup {
        margin-bottom: 15mm;
    }

    .recept-content {
        display: block;
    }

    .ingrediencie-group-title {
        font-size: 14pt;
        font-weight: bold;
        margin-top: 10mm;
        margin-bottom: 5mm;
        color: #000;
    }

    .ingrediencie-list {
        padding-left: 5mm;
        margin-bottom: 10mm;
        list-style-type: disc;
    }

    .ingrediencie-list li {
        margin-bottom: 3mm;
        padding-bottom: 2mm;
        border-bottom: 0.2mm solid #ccc;
        color: #000;
    }

    .postup-list {
        counter-reset: step-counter;
        padding-left: 0;
        margin-bottom: 10mm;
        list-style-type: none;
    }

    .postup-list li {
        position: relative;
        margin-bottom: 8mm;
        padding-left: 15mm;
        color: #000;
    }

    .postup-list li:before {
        content: counter(step-counter);
        counter-increment: step-counter;
        position: absolute;
        left: 0;
        top: 0;
        font-weight: bold;
        font-size: 14pt;
        color: #000;
        border: none;
        width: auto;
        height: auto;
        display: inline;
        background-color: transparent;
        transform: none;
    }

    .krok-popis {
        margin-bottom: 5mm;
    }

    .krok-obrazok {
        max-width: 80%;
        height: auto;
        display: block;
        margin: 5mm auto;
        border-radius: 1em;
    }

    a {
        color: #000;
        text-decoration: none !important;
    }

    p,
    li {
        color: #000;
    }

    /* Override any grid/flex layouts for print */
    .galeria-container {
        display: none !important;
    }
}

/* Recipe Image */
.recept-img-container {
    width: 100%;
    margin-bottom: 30px;
    border-radius: 1em;
    overflow: hidden;
    box-shadow: 0px 10px 30px -15px rgba(0, 0, 0, 0.5);
}

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

/* Recipe Video */
.recept-video-container {
    width: 100%;
    margin-bottom: 30px;
    border-radius: 1em;
    overflow: hidden;
    box-shadow: 0px 10px 30px -15px rgba(0, 0, 0, 0.5);
    position: relative;
}

.recept-video-container iframe,
.recept-video-container video,
.recept-video-container .fb-video {
    width: 100%;
    display: block;
    aspect-ratio: 16 / 9;
    border: none;
}

/* Video Error Message */
.video-error {
    background-color: #f8f8f8;
    border-left: 4px solid var(--e-global-color-secondary);
    padding: 20px;
    margin: 15px 0;
    color: var(--e-global-color-text);
}

.video-error p {
    margin: 0 0 10px 0;
    line-height: 1.5;
}

.video-error ul {
    margin: 0 0 10px 20px;
    padding: 0;
}

.video-error li {
    margin-bottom: 5px;
    line-height: 1.5;
}

.video-error a {
    color: var(--e-global-color-primary);
    word-break: break-all;
}

/* Fallback for browsers that don't support aspect-ratio */
@supports not (aspect-ratio: 16 / 9) {
    .recept-video-container {
        position: relative;
        padding-bottom: 56.25%;
        height: 0;
    }

    .recept-video-container iframe,
    .recept-video-container video,
    .recept-video-container .fb-video {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }
}


.krok-popis {
    line-height: 1.6;
    font-size: larger;
}

/* Recipe Meta Info */
.recept-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1em;
    margin-bottom: 30px;
    background-color: #f8f8f8;
    border-radius: 1em;
    padding: 3em;
    box-shadow: 0px 10px 30px -15px rgba(0, 0, 0, 0.5);
    flex-direction: row;
    align-content: center;
    align-items: center;
    justify-content: space-between;
}

.recept-meta-left {
    display: flex;
    flex-direction: row;
    gap: 2em;
    flex: 1;
}

/* Mobile responsive for recept-meta-left */
@media (max-width: 768px) {
    .recept-meta {
        flex-direction: column;
        gap: 1.5em;
    }

    .recept-meta-left {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1em;
        width: 100%;
        margin: auto;
    }

    .recept-meta-right {
        display: flex;
        flex-direction: row;
        gap: 1em;
        align-items: flex-end;
        flex-wrap: wrap;
        align-content: center;
        justify-content: flex-start;
    }
}

.recept-meta-right {
    display: flex;
    flex-direction: row;
    gap: 1em;
    align-items: flex-end;
}

.recept-meta-item {
    display: grid;
    grid-template-columns: 2.5em 1fr;
    grid-template-rows: auto auto;
    gap: 0em 1em;
    align-items: start;
}

/* Ikona - ľavý stĺpec, cez oba riadky */
.recept-meta-item ion-icon {
    grid-row: 1 / 3;
    grid-column: 1;
    font-size: 2.5em;
    color: var(--e-global-color-secondary);
    align-self: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Label - pravý stĺpec, prvý riadok */
.recept-meta-item .recept-meta-label {
    grid-column: 2;
    grid-row: 1;
    text-align: left;
    font-weight: 600;
    margin: 0;
}

/* Value - pravý stĺpec, druhý riadok */
.recept-meta-item .recept-meta-value {
    grid-column: 2;
    grid-row: 2;
    text-align: left;
    margin: 0;
}

.recept-meta-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--e-global-color-text);
}

/* Recipe Description */
.recept-popis {
    margin-bottom: 40px;
    line-height: 1.6;
    font-size: larger;
}

/* Recipe Content */
.recept-content {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 40px;
}

.recept-ingrediencie {
    flex: 1;
    min-width: 300px;
}

.recept-postup {
    flex: 2;
    min-width: 400px;
    padding: 3em 0;
}

.recept-section-title {
    font-family: var(--e-global-typography-secondary-font-family);
    font-size: var(--e-global-typography-secondary-font-size);
    font-weight: var(--e-global-typography-secondary-font-weight);
    text-transform: var(--e-global-typography-secondary-text-transform);
    font-style: var(--e-global-typography-secondary-font-style);
    text-decoration: var(--e-global-typography-secondary-text-decoration);
    line-height: var(--e-global-typography-secondary-line-height);
    letter-spacing: var(--e-global-typography-secondary-letter-spacing);
    word-spacing: var(--e-global-typography-secondary-word-spacing);
    color: var(--e-global-color-primary);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--e-global-color-primary);
}

.ingrediencie-group-title {
    font-family: var(--e-global-typography-accent-font-family);
    font-size: var(--e-global-typography-primary-line-height);
    letter-spacing: var(--e-global-typography-accent-letter-spacing);
    color: var(--e-global-color-secondary);
}

/* Ingredients List */
.ingrediencie-list {
    list-style-type: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.ingrediencie-list a {
    font-weight: 500 !important;
    color: var(--e-global-color-primary) !important;
}

.ingrediencie-list a::after {
    content: "🔗";
    font-weight: normal;
    color: var(--e-global-color-text);
}

.ingrediencie-list li {
    position: relative;
    padding: 8px 0 8px 20px;
    border-bottom: 1px solid var(--e-global-color-d4f3030);
    color: var(--e-global-color-text);
}

.ingrediencie-list li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--e-global-color-secondary);
}

.ingrediencie-list li:last-child {
    border-bottom: none;
}

/* Steps List */
.postup-list {
    counter-reset: step-counter;
    list-style-type: none;
    padding: 0;
}

.postup-list li {
    position: relative;
    padding: 15px 15px 15px 80px;
    margin-bottom: 15px;
    border-radius: 1em;
    color: var(--e-global-color-text);
}

.postup-list li::before {
    content: counter(step-counter);
    counter-increment: step-counter;
    position: absolute;
    left: 15px;
    top: 40px;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border: 2px solid var(--e-global-color-primary);
    color: var(--e-global-color-primary);
    font-weight: normal;
    font-size: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: white;
}

.krok-obrazok {
    margin-top: 15px;
    border-radius: 1em !important;
    max-width: 100%;
    height: auto;
    display: block;
}

/* Gallery */
.recept-galeria {
    margin-bottom: 40px;
}

/* Updated gallery with flexbox */
.galeria-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    /* Consistent gap */
    justify-content: flex-start;
}

.galeria-item {
    /* Allow grow/shrink, set basis for 4 columns minus gap adjustment */
    flex: 1 1 calc(25% - (3 * 15px / 4));
    /* Removed fixed height/min-width */
    border-radius: 1em;
    overflow: hidden;
    box-shadow: 0px 10px 30px -15px rgba(0, 0, 0, 0.5);
    position: relative;
}

.galeria-item a {
    display: flex;
    /* Changed to flex to help center image if needed */
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
}

.galeria-item img {
    display: block;
    /* Ensure image is block level */
    width: 100%;
    /* Removed fixed height */
    aspect-ratio: 1 / 1;
    /* Maintain square aspect ratio */
    object-fit: cover;
    /* Cover the area without distortion */
    object-position: center;
    transition: transform 0.3s ease-in-out;
}

.galeria-item a:hover img {
    transform: scale(1.05);
}

/* Social Sharing */
.recept-social-title {
    font-family: var(--e-global-typography-accent-font-family);
    font-size: var(--e-global-typography-accent-font-size);
    font-weight: var(--e-global-typography-accent-font-weight);
    color: var(--e-global-color-primary);
    margin-bottom: 15px;
    text-align: center;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1em;
    flex-wrap: wrap;
    align-content: center;
    align-items: center;
}

.social-link {
    display: inline-flex;
    align-items: center;
    padding: 8px 15px;
    background-color: #fff;
    color: var(--e-global-color-text);
    text-decoration: none !important;
    border-radius: 3em;
    box-shadow: 0px 10px 30px -15px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s, box-shadow 0.2s;
}

.social-link ion-icon {
    margin-right: 8px;
    font-size: 1.2em;
}

.social-link:hover {
    transform: translateY(-2px);
    box-shadow: 0px 10px 30px -15px rgba(0, 0, 0, 0.5);
}

/* Keep Brand Colors */
.social-link.facebook {
    background-color: #3b5998;
    color: white;
}

.social-link.facebook:hover {
    color: white;
}

.social-link.instagram {
    background: linear-gradient(45deg, #405DE6, #5851DB, #833AB4, #C13584, #E1306C, #FD1D1D);
    color: white;
}

.social-link.instagram:hover {
    color: white;
}

.social-link.twitter {
    background-color: #1DA1F2;
    color: white;
}

.social-link.twitter:hover {
    color: white;
}

.social-link.linkedin {
    background-color: #0077B5;
    color: white;
}

.social-link.linkedin:hover {
    color: white;
}

.social-link.youtube {
    background-color: #FF0000;
    color: white;
}

.social-link.youtube:hover {
    color: white;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .recept-meta {
        flex-direction: column;
        align-items: stretch;
        padding: 15px;
    }

    .recept-content {
        flex-direction: column;
        gap: 20px;
    }

    .recept-ingrediencie {
        min-width: unset;
        padding: 15px;
    }

    .recept-postup {
        min-width: unset;
        padding: 0px;
    }

    .recept-title {
        font-size: var(--e-global-typography-primary-font-size);
    }

    .recept-section-title {
        font-size: var(--e-global-typography-secondary-font-size);
    }

    .postup-list li {
        padding: 15px 15px 15px 70px;
    }

    .postup-list li::before {
        left: 10px;
        top: 35px;
        width: 40px;
        height: 40px;
        font-size: 24px;
    }

    .recept-actions,
    .recept-social {
        justify-content: center;
    }

    .galeria-item {
        /* Allow grow/shrink, set basis for 3 columns minus gap adjustment */
        flex: 1 1 calc(50% - (2 * 15px / 3));
        /* Removed fixed height/min-width */
    }

    .social-links {
        gap: 0.5em;
    }
}

@media (max-width: 480px) {
    .recept-title {
        font-size: 24px;
    }

    .recept-section-title {
        font-size: 20px;
    }

    .recept-action-btn {
        font-size: 14px !important;
        padding: 6px 12px !important;
    }

    .postup-list li {
        padding: 10px 10px 10px 60px;
    }

    .postup-list li::before {
        left: 5px;
        top: 30px;
        width: 35px;
        height: 35px;
        font-size: 20px;
    }

    /* Update small screen gallery layout */
    .galeria-item {
        /* Allow grow/shrink, set basis for 2 columns minus gap adjustment */
        flex: 1 1 calc(50% - (1 * 15px / 2));
        /* Removed fixed height/min-width */
    }

    .social-link {
        padding: 6px 10px;
        font-size: 0.9em;
    }

    .social-link ion-icon {
        font-size: 1.1em;
    }
}

/* ============================================
   Autori receptu (Foodblogeri) Section
   ============================================ */

.recept-autori-sekcia {
    margin-top: 3em;
    margin-bottom: 2em;
}

.autori-list {
    display: flex;
    flex-direction: column;
    gap: 1.5em;
}

.autor-karta {
    display: flex;
    align-items: center;
    gap: 1.5em;
    padding: 2em;
    background: #fff;
    border-radius: 1em;
    box-shadow: 0px 10px 30px -15px rgba(0, 0, 0, 0.5);
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.autor-karta:hover {
    transform: translateY(-5px);
    box-shadow: 0px 15px 40px -10px rgba(0, 0, 0, 0.6);
}

.autor-foto {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0px 5px 15px -5px rgba(0, 0, 0, 0.3);
}

.autor-foto img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.autor-info {
    flex: 1;
}

.autor-meno {
    margin: 0 0 0.5em 0;
    font-size: 1.5em;
    font-weight: 600;
    color: var(--e-global-color-primary, #333);
    font-family: var(--e-global-typography-primary-font-family, 'Nunito', sans-serif);
}

.autor-bio {
    margin: 0;
    font-size: 1em;
    line-height: 1.6;
    color: var(--e-global-color-text, #666);
}

/* Responsive styles for autori section */
@media (max-width: 768px) {
    .autor-karta {
        flex-direction: column;
        text-align: center;
        gap: 1em;
        padding: 1.5em;
    }

    .autor-foto {
        width: 80px;
        height: 80px;
    }

    .autor-meno {
        font-size: 1.3em;
    }

    .autor-bio {
        font-size: 0.95em;
    }
}

@media (max-width: 480px) {
    .recept-autori-sekcia {
        margin-top: 2em;
    }

    .autori-list {
        gap: 1em;
    }

    .autor-karta {
        padding: 1em;
    }

    .autor-foto {
        width: 70px;
        height: 70px;
    }

    .autor-meno {
        font-size: 1.2em;
    }

    .autor-bio {
        font-size: 0.9em;
    }
}

/* Print styles for autori section */
@media print {
    .recept-autori-sekcia {
        page-break-inside: avoid;
        margin-top: 2em;
    }

    .autor-karta {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }

    .autor-karta:hover {
        transform: none;
        box-shadow: none;
    }
}