/*
 * Arzinja — header mega menu
 *
 * Standalone stylesheet. style.css is a webpack/Tailwind build artifact and
 * cannot be regenerated in this checkout, so every class here is its own and
 * every rule is plain CSS. Written RTL first with logical properties, so the
 * same file works if the blog is ever served LTR.
 */

.arz-mega,
.arz-mega *,
.arz-mega-mobile,
.arz-mega-mobile * {
    box-sizing: border-box;
}

/*
 * Shared, not menu specific — this file is the theme's only hand-written
 * stylesheet loaded on every page, and the compiled style.css has no `sr-only`
 * utility to borrow. Used for headings that must exist in the document for
 * crawlers and screen readers without taking up space.
 */
.arz-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* ==========================================================================
   1. The bar
   ========================================================================== */

.arz-mega {
    display: none;
}

@media (min-width: 1024px) {
    .arz-mega {
        display: block;
    }
}

.arz-mega__bar {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.arz-mega__item {
    position: relative;
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
    list-style: none;
}

.arz-mega__link {
    display: inline-flex;
    align-items: center;
    padding: 8px 10px 8px 4px;
    border-radius: 8px 0 0 8px;
    color: #364152;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.15s ease, background-color 0.15s ease;
}

/* The opener is a separate control so the label itself stays a plain link. */
.arz-mega__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 0 8px 8px 0;
    background: none;
    color: #9aa4b2;
    cursor: pointer;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.arz-mega__toggle svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

.arz-mega__toggle-label {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.arz-mega__item:hover .arz-mega__link,
.arz-mega__item:focus-within .arz-mega__link {
    color: #0e9f6e;
    background-color: #f0fdf7;
}

.arz-mega__item:hover .arz-mega__toggle,
.arz-mega__item:focus-within .arz-mega__toggle {
    color: #0e9f6e;
    background-color: #f0fdf7;
}

.arz-mega__item--open .arz-mega__toggle svg {
    transform: rotate(180deg);
}

/* A panel with no archive of its own: the button is the whole bar item. */
.arz-mega__item--bare .arz-mega__toggle {
    gap: 4px;
    width: auto;
    padding: 8px 10px;
    border-radius: 8px;
    color: #364152;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    white-space: nowrap;
}

.arz-mega__item--bare:hover .arz-mega__toggle,
.arz-mega__item--bare:focus-within .arz-mega__toggle {
    color: #0e9f6e;
}

.arz-mega__link:focus-visible,
.arz-mega__toggle:focus-visible {
    outline: 2px solid #0e9f6e;
    outline-offset: 2px;
}

/* ==========================================================================
   2. The panel
   ========================================================================== */

.arz-mega__panel {
    position: absolute;
    inset-block-start: calc(100% + 14px);
    inset-inline-start: 0;
    z-index: 60;
    width: max-content;
    max-width: min(1100px, calc(100vw - 48px));
    padding: 20px;
    border: 1px solid #e6e8ec;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 18px 50px rgba(16, 24, 40, 0.14);
}

/* [hidden] loses to the display rules above without this. */
.arz-mega__panel[hidden] {
    display: none;
}

/*
 * The gap between the bar and the panel would end the hover the moment the
 * pointer crossed it. This bridges it without moving the panel.
 */
.arz-mega__panel::before {
    content: '';
    position: absolute;
    inset-block-end: 100%;
    inset-inline: 0;
    height: 16px;
}

.arz-mega__item:last-child .arz-mega__panel,
.arz-mega__item:nth-last-child(2) .arz-mega__panel {
    inset-inline-start: auto;
    inset-inline-end: 0;
}

/* Named for screen readers; the visible name is the bar link right above it. */
.arz-mega__panel-title {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.arz-mega__cols {
    display: flex;
    align-items: flex-start;
    gap: 28px;
}

/*
 * A long list stays one section with one heading and flows into as many visual
 * columns as it needs — --arz-mega-cols is printed per section by the template.
 */
.arz-mega__col {
    min-width: 168px;
    max-width: calc(230px * var(--arz-mega-cols, 1));
}

.arz-mega__col .arz-mega__list {
    column-count: var(--arz-mega-cols, 1);
    column-gap: 20px;
}

.arz-mega__col .arz-mega__list li {
    /* Otherwise a row can be split across the column break. */
    break-inside: avoid;
}

.arz-mega__col--posts {
    min-width: 260px;
    max-width: 300px;
    padding-inline-start: 24px;
    border-inline-start: 1px solid #eef0f3;
}

.arz-mega__col-title {
    margin: 0 0 10px;
    color: #9aa4b2;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.6;
    letter-spacing: 0;
}

.arz-mega__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.arz-mega__list li {
    margin: 0;
    padding: 0;
    list-style: none;
}

.arz-mega__entry {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    border-radius: 8px;
    color: #364152;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.7;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.arz-mega__entry:hover,
.arz-mega__entry:focus-visible {
    color: #0e9f6e;
    background-color: #f6f8fa;
    outline: none;
}

.arz-mega__entry-title {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.arz-mega__icon {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    margin: 0;
    border-radius: 50%;
}

.arz-mega__symbol {
    flex: 0 0 auto;
    color: #9aa4b2;
    font-size: 11px;
    font-weight: 700;
}

/* Counts are context, not the link text — kept out of the tab-visible weight. */
.arz-mega__count {
    flex: 0 0 auto;
    min-width: 26px;
    padding: 1px 6px;
    border-radius: 999px;
    background: #f2f4f7;
    color: #9aa4b2;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
}

.arz-mega__cols--coins .arz-mega__col {
    min-width: 200px;
}

/* ---- the recent posts column ---- */

.arz-mega__posts {
    margin: 0;
    padding: 0;
    list-style: none;
}

.arz-mega__posts li {
    margin: 0;
    padding: 0;
    list-style: none;
}

.arz-mega__post {
    display: flex;
    gap: 10px;
    padding: 8px;
    border-radius: 10px;
    color: #364152;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.arz-mega__post:hover,
.arz-mega__post:focus-visible {
    background-color: #f6f8fa;
    outline: none;
}

.arz-mega__post img {
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
    margin: 0;
    border-radius: 8px;
    object-fit: cover;
}

.arz-mega__post-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.arz-mega__post-title {
    display: -webkit-box;
    overflow: hidden;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.7;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.arz-mega__post-date {
    color: #9aa4b2;
    font-size: 11px;
    font-weight: 500;
}

/* ---- the panel footer ---- */

.arz-mega__foot {
    margin-block-start: 16px;
    padding-block-start: 14px;
    border-block-start: 1px solid #eef0f3;
}

.arz-mega__cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #0e9f6e;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.arz-mega__cta:hover {
    text-decoration: underline;
}

/* ==========================================================================
   3. The mobile accordions
   ========================================================================== */

.arz-mega-mobile {
    display: block;
    padding: 8px 4px 24px;
    overflow-y: auto;
    max-height: calc(100vh - 88px);
}

@media (min-width: 1024px) {
    .arz-mega-mobile {
        display: none;
    }
}

.arz-mega-mobile__section {
    border-block-end: 1px solid #f0f2f5;
}

.arz-mega-mobile__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    color: #364152;
    cursor: pointer;
    list-style: none;
}

.arz-mega-mobile__summary::-webkit-details-marker {
    display: none;
}

.arz-mega-mobile__summary:focus-visible {
    outline: 2px solid #0e9f6e;
    outline-offset: -2px;
}

.arz-mega-mobile__title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.6;
}

.arz-mega-mobile__summary svg {
    width: 18px;
    height: 18px;
    color: #9aa4b2;
    transition: transform 0.2s ease;
}

.arz-mega-mobile__section[open] .arz-mega-mobile__summary svg {
    transform: rotate(180deg);
}

.arz-mega-mobile__body {
    padding: 0 16px 16px;
}

.arz-mega-mobile__all {
    display: inline-block;
    margin-block-end: 10px;
    color: #0e9f6e;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.arz-mega-mobile__group + .arz-mega-mobile__group {
    margin-block-start: 12px;
}

.arz-mega-mobile__group-title {
    margin: 0 0 6px;
    color: #9aa4b2;
    font-size: 12px;
    font-weight: 700;
}

.arz-mega-mobile__group-title--quiet {
    display: none;
}

.arz-mega-mobile__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.arz-mega-mobile__list li {
    margin: 0;
    padding: 0;
    list-style: none;
}

.arz-mega-mobile__list a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 6px;
    border-radius: 8px;
    color: #364152;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}

.arz-mega-mobile__list a:hover,
.arz-mega-mobile__list a:focus-visible {
    background-color: #f6f8fa;
    outline: none;
}

.arz-mega-mobile__list img {
    width: 20px;
    height: 20px;
    margin: 0;
    border-radius: 50%;
}

.arz-mega-mobile__list span:not(.arz-mega-mobile__count) {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.arz-mega-mobile__count {
    flex: 0 0 auto;
    padding: 1px 6px;
    border-radius: 999px;
    background: #f2f4f7;
    color: #9aa4b2;
    font-size: 11px;
    font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
    .arz-mega__toggle svg,
    .arz-mega-mobile__summary svg {
        transition: none;
    }
}
