/* ==========================================================
   Recipe CPT – Single-page styles
   ========================================================== */

/* ---- Portion Dropdown ---- */
.recipe_dropdown {
    appearance: none;
    -webkit-appearance: none;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%233B1500'/%3E%3C/svg%3E") no-repeat right 12px center;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 6px 32px 6px 12px;
    font-size: inherit;
    font-family: inherit;
    cursor: pointer;
}

/* ---- Ingredients ---- */
.ingredients_title {
    font-weight: 600;
    padding-bottom: 10px;
    margin-bottom: 10px;
    margin-top: 10px;
}

.ingredients_title:not(:first-of-type) {
    padding-top: 2em;
}

.et_pb_code_inner .ingredients_title {
    font-weight: 600 !important;
    padding-bottom: 1em !important;
}

.et_pb_code_inner .ingredients_title:not(:first-of-type) {
    margin-top: 2em !important;
}

table.recipe_ingredients {
    width: 100%;
    border-collapse: collapse;
    padding: 0;
    margin: 0;
}

table.recipe_ingredients tr:first-child td {
    border-top: 2px solid #447d751a;
}

table.recipe_ingredients td {
    border-bottom: 2px solid #447d751a;
    padding: 5px 0 !important;
    vertical-align: top;
}

table.recipe_ingredients .amount {
    font-weight: 600;
    white-space: nowrap;
    padding-right: 14px !important;
    width: 1%;
}

/* ---- Steps ---- */
ul.recipe_steps {
    list-style: none !important;
    padding: 0;
    margin: 0;
    counter-reset: step;
}

ul.recipe_steps li {
    list-style: none !important;
    counter-increment: step;
    padding: 12px 0;
}

ul.recipe_steps li:not(:last-child) {
    padding-bottom: 2em;
}

ul.recipe_steps li::before {
    content: counter(step);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #3B1500;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    margin-right: 12px;
    flex-shrink: 0;
    vertical-align: middle;
}

.recipe_steps .headline {
    text-transform: uppercase;
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
}

ul.recipe_steps li .description {
    display: block;
}

/* ---- Image Gallery ---- */
.recipe_image_gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.recipe_image_gallery_item {
    margin: 0;
    overflow: hidden;
    border-radius: 5px;
    flex: 1 1 0;
    min-width: 0;
    aspect-ratio: 4 / 3;
}

.recipe_image_gallery--count-2 .recipe_image_gallery_item { flex-basis: calc(50% - 4px); }
.recipe_image_gallery--count-3 .recipe_image_gallery_item { flex-basis: calc(33.333% - 6px); }
.recipe_image_gallery--count-4 .recipe_image_gallery_item { flex-basis: calc(25% - 6px); }
.recipe_image_gallery--count-5 .recipe_image_gallery_item { flex-basis: calc(20% - 7px); }
.recipe_image_gallery--count-6 .recipe_image_gallery_item { flex-basis: calc(33.333% - 6px); }

.recipe_image_gallery_item a {
    display: block;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.recipe_image_gallery_item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.recipe_image_gallery_item a:hover img {
    transform: scale(1.05);
}

/* ---- Lightbox ---- */
.wa-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.wa-lightbox.is-open {
    opacity: 1;
    visibility: visible;
}

.wa-lightbox__img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 6px;
    user-select: none;
}

.wa-lightbox__close {
    position: absolute;
    top: 20px;
    right: 24px;
    background: none;
    border: none;
    color: #fff;
    font-size: 36px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 10px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.wa-lightbox__close:hover { opacity: 1; }

.wa-lightbox__prev,
.wa-lightbox__next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #fff;
    font-size: 40px;
    line-height: 1;
    cursor: pointer;
    padding: 12px 16px;
    opacity: 0.7;
    transition: opacity 0.2s;
    user-select: none;
}

.wa-lightbox__prev { left: 12px; }
.wa-lightbox__next { right: 12px; }
.wa-lightbox__prev:hover,
.wa-lightbox__next:hover { opacity: 1; }

.wa-lightbox__counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

/* ---- Legacy Gallery (migrated) ---- */
.recipe_gallery {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.recipe_gallery a {
    width: 25%;
    padding: 8px;
}

/* ---- Instagram Embed ---- */
.ig_embed {
    display: flex;
    justify-content: center;
}

/* ==========================================================
   Responsive
   ========================================================== */
@media (max-width: 980px) {
    .recipe_image_gallery_item { flex-basis: calc(50% - 4px) !important; }
    .recipe_gallery a { width: 33%; padding: 7px; }
}

@media (max-width: 768px) {
    .recipe_gallery a { width: 50%; padding: 6px; }
}

@media (max-width: 480px) {
    .recipe_image_gallery_item { flex-basis: 100% !important; }
}
