/* Header menu panels of Customizations\MenuPanels: the desktop mega menu
   (.yt-mega) and the side menu's sub-menus (.yt-nav-sub). Colours follow
   the theme's variables (child style.css, "Brand identity"). */

/* ==========================================================================
   Desktop mega menu: under the header row, the width of its container
   (Platea's .gt-header-main .container is position: relative).
   ========================================================================== */

.gt-header .gt-menu ul li.yt-has-mega {
    position: static;
}

/* The header has no stacking order of its own: the page below it (the
   title bar photo) was painted over the open panel. The sticky header keeps
   Platea's. */
.gt-header.gt-desktop-header:not(.gt-sticky-header) {
    z-index: 90;
}

.gt-header .gt-menu ul li.yt-has-mega > a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.yt-mega-chevron {
    flex: none;
    opacity: .55;
    transition: transform .2s ease;
}

.gt-header .gt-menu ul li.yt-has-mega:hover .yt-mega-chevron,
.gt-header .gt-menu ul li.yt-has-mega:has(:focus-visible) .yt-mega-chevron {
    transform: rotate(180deg);
}

.yt-mega {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 60;
    padding: 6px 12px 0;
    visibility: hidden;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
    pointer-events: none;
}

/* A bridge over the gap between the menu item and the panel, so the
   pointer does not leave the item on its way down. It hangs under the
   item's own link: a bridge as wide as the panel lay over the other menu
   items in the shorter sticky header, so the open panel kept the pointer
   and moving onto another item did not switch panels. */
.gt-header .gt-menu ul li.yt-has-mega > a {
    position: relative;
}

.gt-header .gt-menu ul li.yt-has-mega:hover > a::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 40px;
}

/* Keyboard focus opens a panel too, but not the focus a mouse click leaves
   on a link (:focus-visible), and a hovered item wins over a focused one:
   a clicked item kept its panel over the one under the pointer. */
.gt-header .gt-menu ul li.yt-has-mega:hover > .yt-mega,
.gt-header .gt-menu ul li.yt-has-mega:has(:focus-visible) > .yt-mega {
    visibility: visible;
    opacity: 1;
    transform: none;
    transition-delay: .08s, .08s, 0s;
    pointer-events: auto;
}

.gt-header .gt-menu ul li.yt-has-mega.yt-mega-closed > .yt-mega,
.gt-header .gt-menu ul:has(> li.yt-has-mega:hover) > li.yt-has-mega:not(:hover) > .yt-mega {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

.yt-mega-inner {
    padding: 28px 32px 30px;
    border: 1px solid var(--gt-theme-tertiary, #dedcd4);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 24px 48px -12px rgba(22, 42, 40, .22);
    text-align: left;
    line-height: 1.35;
}

/* Platea's menu link rules (size, weight, hover line) must not reach the
   panel's links. */
.gt-header .gt-menu .yt-mega a,
.gt-header .gt-menu .yt-mega a:visited {
    display: flex;
    padding: 0;
    color: var(--gt-text-color-secondary, #162a28);
    font-size: .9375rem;
    font-weight: 500;
    text-decoration: none;
}

.gt-header .gt-menu .yt-mega a::before,
.gt-header .gt-menu .yt-mega a::after {
    display: none;
}

.gt-header .gt-menu .yt-mega ul {
    display: grid;
    align-items: start;
    margin: 0;
    padding: 0;
    list-style: none;
    text-align: left;
}

.gt-header .gt-menu .yt-mega ul li {
    margin: 0;
    padding: 0;
}

.yt-mega .yt-mega-heading {
    margin: 0 0 14px;
    color: var(--yt-brand-muted, #5f6b68);
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.yt-mega-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
}

.gt-header .gt-menu .yt-mega a.yt-mega-all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    color: var(--gt-theme-primary, #ff4400);
    font-size: .875rem;
    font-weight: 600;
}

.yt-mega-head .yt-mega-all {
    margin-top: 0 !important;
}

.gt-header .gt-menu .yt-mega a.yt-mega-all:hover {
    color: var(--yt-brand-green, #162a28);
}

/* Columns: links, chips, recent items. */
.yt-mega-cols {
    display: grid;
    gap: 40px;
}

.yt-mega-cols--recipes {
    grid-template-columns: 1.1fr 1.2fr 2fr;
}

.yt-mega-cols--blog {
    grid-template-columns: 1fr 3fr;
}

.gt-header .gt-menu .yt-mega .yt-mega-links {
    gap: 4px;
}

.gt-header .gt-menu .yt-mega .yt-mega-links a {
    padding: 8px 12px;
    margin-inline: -12px;
    border-radius: 10px;
}

.gt-header .gt-menu .yt-mega .yt-mega-links a:hover {
    background: var(--yt-surface, #fff2ea);
    color: var(--gt-theme-primary, #ff4400);
}

.gt-header .gt-menu .yt-mega .yt-mega-posts {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.gt-header .gt-menu .yt-mega .yt-mega-posts a {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    font-size: .875rem;
    font-weight: 600;
}

.yt-mega-post-image {
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 12px;
    background: var(--yt-surface, #fff2ea);
}

.yt-mega-post-image img,
.yt-mega-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s ease;
}

.gt-header .gt-menu .yt-mega a:hover .yt-mega-post-image img,
.gt-header .gt-menu .yt-mega a:hover .yt-mega-card-image img {
    transform: scale(1.05);
}

/* Platea gives every header menu link a rounded peach background on hover /
   focus (the top level's pill); on the photo cards it stuck out around the
   image with the text on its edge. Panel links get none, the image zoom and
   the orange text mark them; tiles and rows that want a background set it
   below with more specific selectors. */
.gt-header .gt-menu .yt-mega a:hover,
.gt-header .gt-menu .yt-mega a:focus,
.gt-header .gt-menu .yt-mega li:hover > a,
.gt-header .gt-menu .yt-mega li:focus > a {
    background-color: transparent;
    color: var(--gt-theme-primary, #ff4400);
}

/* Category / cuisine cards: five in a row. */
.gt-header .gt-menu .yt-mega .yt-mega-cards {
    grid-template-columns: repeat(5, 1fr);
    gap: 20px 16px;
    margin-top: 6px;
}

.gt-header .gt-menu .yt-mega .yt-mega-cards a {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
}

.yt-mega-card-image {
    display: block;
    aspect-ratio: 16 / 9;
    margin-bottom: 8px;
    overflow: hidden;
    border-radius: 12px;
    background: var(--yt-surface, #fff2ea);
}

.yt-mega-card-name {
    font-weight: 600;
}

.yt-mega-card-count {
    color: var(--yt-brand-muted, #5f6b68);
    font-size: .8125rem;
    font-weight: 400;
}

/* Ingredients: icon tiles, nine in a row. */
.gt-header .gt-menu .yt-mega .yt-mega-ingredients {
    grid-template-columns: repeat(9, 1fr);
    gap: 10px;
    margin-top: 6px;
}

.gt-header .gt-menu .yt-mega .yt-mega-ingredients a {
    --yt-menu-icon: 44px;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 4px;
    border-radius: 14px;
    background: var(--yt-surface-page, #fffbf8);
    font-size: .8125rem;
    text-align: center;
}

.gt-header .gt-menu .yt-mega .yt-mega-ingredients a:hover {
    background: var(--yt-surface, #fff2ea);
}

/* ==========================================================================
   Side menu sub-menus (phones, tablets).
   ========================================================================== */

body .gt-off-canvas .gt-menu ul li.yt-has-sub .gt-menu-item {
    align-items: center;
}

/* The item's own chevron (child style.css) gives way to the toggle. */
body .gt-off-canvas .gt-menu ul li.yt-has-sub .gt-menu-link a::after {
    display: none;
}

body .gt-off-canvas .yt-nav-toggle {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-left: 4px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--gt-text-color-secondary, #162a28);
    cursor: pointer;
}

body .gt-off-canvas .yt-nav-toggle svg {
    transition: transform .2s ease;
}

body .gt-off-canvas .yt-nav-toggle:hover,
body .gt-off-canvas .yt-nav-toggle[aria-expanded="true"] {
    background: var(--yt-surface, #fff2ea);
    color: var(--gt-theme-primary, #ff4400);
}

body .gt-off-canvas .yt-nav-toggle[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

/* Starts where the item's icon starts (the item link has 12px padding). */
body .gt-off-canvas .yt-nav-sub {
    margin: 2px 0 12px 12px;
    padding: 0 0 4px;
}

body .gt-off-canvas .yt-nav-sub[hidden] {
    display: none;
}

body .gt-off-canvas .gt-menu .yt-nav-sub ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

body .gt-off-canvas .gt-menu .yt-nav-sub li {
    margin: 0;
    line-height: 1.3;
}

body .gt-off-canvas .gt-menu .yt-nav-sub a,
body .gt-off-canvas .gt-menu .yt-nav-sub a:visited {
    display: flex;
    align-items: center;
    color: var(--gt-text-color-secondary, #162a28);
    font-size: .9375rem;
    font-weight: 500;
    text-decoration: none;
}

body .gt-off-canvas .gt-menu .yt-nav-sub a:hover {
    color: var(--gt-theme-primary, #ff4400);
}

body .gt-off-canvas .gt-menu .yt-nav-sub-links a {
    padding: 9px 0;
}

body .gt-off-canvas .gt-menu .yt-nav-sub-terms a {
    display: grid;
    grid-template-columns: 36px 1fr;
    grid-template-rows: auto auto;
    column-gap: 12px;
    padding: 6px 0;
}

.yt-nav-sub-image {
    grid-row: span 2;
    width: 36px;
    height: 36px;
    overflow: hidden;
    border-radius: 50%;
    background: var(--yt-surface, #fff2ea);
}

.yt-nav-sub-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.yt-nav-sub-name {
    align-self: end;
}

.yt-nav-sub-count {
    align-self: start;
    color: var(--yt-brand-muted, #5f6b68);
    font-size: .75rem;
    font-weight: 400;
}

body .gt-off-canvas .gt-menu .yt-nav-sub-ingredients {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

body .gt-off-canvas .gt-menu .yt-nav-sub-ingredients a {
    --yt-menu-icon: 34px;
    flex-direction: column;
    gap: 4px;
    padding: 10px 2px;
    border-radius: 12px;
    background: var(--yt-surface-page, #fffbf8);
    font-size: .75rem;
    text-align: center;
}

body .gt-off-canvas .gt-menu .yt-nav-sub a.yt-nav-sub-all {
    display: inline-flex;
    gap: 6px;
    margin-top: 8px;
    color: var(--gt-theme-primary, #ff4400);
    font-size: .875rem;
    font-weight: 600;
}

/* ==========================================================================
   Shared by both: recipe pages with an icon tile, quick links with a round
   photo, ingredient icons coloured like the "Malzemeler" page (orange line,
   light orange fill; IngredientFinder::icon()).
   ========================================================================== */

.yt-menu-pages,
.yt-menu-quicks {
    margin: 0;
    padding: 0;
    list-style: none;
}

.gt-header .gt-menu .yt-mega .yt-menu-pages,
.yt-nav-sub .yt-menu-pages {
    display: grid;
    gap: 4px;
}

.gt-header .gt-menu .yt-mega a.yt-menu-page,
body .gt-off-canvas .gt-menu .yt-nav-sub a.yt-menu-page {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px 8px 0;
    border-radius: 12px;
}

.gt-header .gt-menu .yt-mega a.yt-menu-page {
    margin-inline: -10px;
    padding-left: 10px;
}

.gt-header .gt-menu .yt-mega a.yt-menu-page:hover {
    background: var(--yt-surface, #fff2ea);
}

.yt-menu-page-icon {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--yt-surface, #fff2ea);
    color: var(--gt-theme-primary, #ff4400);
}

.yt-menu-page-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.3;
}

.yt-menu-page-text strong {
    font-weight: 600;
}

.yt-menu-page-text span {
    color: var(--yt-brand-muted, #5f6b68);
    font-size: .8125rem;
    font-weight: 400;
}

.gt-header .gt-menu .yt-mega .yt-menu-quicks,
.yt-nav-sub .yt-menu-quicks {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.gt-header .gt-menu .yt-mega a.yt-menu-quick,
body .gt-off-canvas .gt-menu .yt-nav-sub a.yt-menu-quick {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px 6px 6px;
    border: 1px solid var(--gt-theme-tertiary, #dedcd4);
    border-radius: 999px;
    font-size: .875rem;
    font-weight: 600;
}

.gt-header .gt-menu .yt-mega a.yt-menu-quick:hover,
body .gt-off-canvas .gt-menu .yt-nav-sub a.yt-menu-quick:hover {
    border-color: var(--gt-theme-primary, #ff4400);
}

.yt-menu-quick-image {
    flex: none;
    width: 32px;
    height: 32px;
    overflow: hidden;
    border-radius: 50%;
    background: var(--yt-surface, #fff2ea);
}

.yt-menu-quick-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

body .gt-off-canvas .yt-nav-sub-heading {
    margin: 14px 0 8px;
    color: var(--yt-brand-muted, #5f6b68);
    font-size: .6875rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.yt-mega .yt-if-icon,
.yt-nav-sub .yt-if-icon {
    display: block;
    width: var(--yt-menu-icon, 40px);
    height: var(--yt-menu-icon, 40px);
    color: var(--gt-theme-primary, #ff4400);
}

.yt-mega .yt-if-icon svg,
.yt-nav-sub .yt-if-icon svg,
.gt-header .gt-item .yt-mega .yt-if-icon svg {
    display: block;
    width: 100%;
    height: 100%;
    color: inherit;
}

/* Platea sizes and colours every header SVG (.gt-header .gt-item svg:
   22 x 20px, text colour); the panel's icons keep their own. */
.gt-header .gt-item .yt-mega .yt-menu-page-icon svg {
    width: 20px;
    height: 20px;
    color: inherit;
}

.gt-header .gt-item .yt-mega .yt-mega-all svg {
    width: 16px;
    height: 16px;
    color: inherit;
}

.yt-mega .yt-if-icon .b,
.yt-nav-sub .yt-if-icon .b {
    fill: currentColor;
    fill-opacity: .14;
}

.yt-mega .yt-if-icon .d,
.yt-nav-sub .yt-if-icon .d {
    fill: currentColor;
    stroke: none;
}

@media (prefers-reduced-motion: reduce) {
    .yt-mega,
    .yt-mega-chevron,
    .yt-mega-post-image img,
    .yt-mega-card-image img,
    body .gt-off-canvas .yt-nav-toggle svg {
        transition: none;
    }
}
