/**
 * Orion Projects Enhanced Widget Styles - Mega Menu Layout
 * 
 * @package Orion_Construction
 * @since 1.0.0
 */

/* Orion Projects Mega Menu
   The widget markup carries no Tailwind utility classes. Colours, font
   family/weight/transform/letter-spacing and margins come from the widget's
   Elementor controls; the layout and the breakpoint-driven size/spacing
   schedule live here, because the reference steps them over five breakpoints
   (412/640/992/1199/1380/1752) and Elementor only exposes three. Every
   responsive control on the widget is left empty by default so this schedule
   applies, and setting one in the editor overrides it. */
.orion-projects-mega-menu {
    width: 100%;
}

/* ── Grid ─────────────────────────────────────────────────────── */
.orion-projects-mega-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin: 0;
    padding: 22px 0 30px;
    list-style: none;
    height: 100%;
}
@media (min-width: 412px) { .orion-projects-mega-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 992px)  { .orion-projects-mega-grid { padding-bottom: 36px; } }
@media (min-width: 1199px) { .orion-projects-mega-grid { gap: 24px; } }
@media (min-width: 1752px) { .orion-projects-mega-grid { gap: 28px; padding-bottom: 40px; } }

/* Desktop column count. The 1fr / 2-up steps above are shared. */
@media (min-width: 640px) {
    .orion-projects-mega-grid--3col,
    .orion-projects-mega-grid--4col { grid-template-columns: repeat(2, 1fr); }
    .orion-projects-mega-grid--5col { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 992px) {
    .orion-projects-mega-grid--3col { grid-template-columns: repeat(3, 1fr); }
    .orion-projects-mega-grid--5col { grid-template-columns: repeat(5, 1fr); }
}
@media (min-width: 1199px) {
    .orion-projects-mega-grid--4col { grid-template-columns: repeat(4, 1fr); }
}

/* ── Card ─────────────────────────────────────────────────────── */
.orion-projects-mega-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
}
@media (min-width: 640px) { .orion-projects-mega-item { gap: 17px; } }

.orion-projects-mega-image {
    position: relative;
    width: 100%;
}

/* The ::before spacer holds the card's aspect ratio while the image is
   absolutely positioned over it. */
.orion-projects-mega-image-link {
    display: flex;
    position: relative;
    width: 100%;
    height: 100% !important;
    overflow: hidden;
    /* Wraps an image only; keeps the theme's global link colour out. */
    color: inherit;
}
.orion-projects-mega-image-link::before {
    content: "";
    display: block;
    padding-top: 60%;
}
@media (min-width: 640px) { .orion-projects-mega-image-link::before { padding-top: 116%; } }

/* Beat Elementor's `.elementor img { height: auto; max-width: 100% }` so the
   absolute image fills the ::before aspect-ratio box (same pattern as
   testimonials / project cards). Without !important the img collapses to its
   intrinsic landscape height and leaves a large gap above the titles. */
.orion-projects-mega-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100% !important;
    max-width: none;
    object-fit: cover;
}

/* Reveal-on-hover affordance from the project cards. The mega menu is not the
   hover group that shows it, so it stays hidden here — as on the reference. */
.orion-projects-mega-arrow { display: none; color: #000; }

.orion-projects-mega-title-link { display: block; text-decoration: none; color: inherit; }
/* No text-align here on purpose: the reference title inherits the header's
   alignment, which centres below 769px. */

/* ── Footer row ───────────────────────────────────────────────── */
.orion-projects-mega-footer {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
    padding-block: 18px;
}
@media (min-width: 640px) {
    .orion-projects-mega-footer {
        align-items: center;
        flex-wrap: nowrap;
        gap: 18px;
        padding-block: 20px;
    }
}
@media (min-width: 1380px) { .orion-projects-mega-footer { padding-block: 24px; } }
@media (min-width: 1752px) { .orion-projects-mega-footer { padding-block: 30px; } }

.orion-projects-mega-copyright {
    text-align: start;
    cursor: default;
}
@media (min-width: 640px) { .orion-projects-mega-copyright { text-align: center; } }

/* Debug message for no projects */
.orion-projects-mega-no-projects {
    text-align: center;
    padding: 40px 20px;
    background-color: var(--orion-secondary);
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    margin-bottom: 30px;
}

.orion-projects-mega-no-projects p {
    margin: 10px 0;
    color: #666;
}

/* ── Type scale ───────────────────────────────────────────────── */
/* Card titles and the footer copyright. Elementor's Typography controls emit
   an element-scoped selector and still override all of this. Values mirror
   `2xl:text-lg lg:text-[15px] text-sm 2xl:leading-8 1xl:leading-7
   xl:leading-[26px] lg:leading-[25px] leading-[23px]`. */
.orion-projects-mega-title,
.orion-projects-mega-copyright {
    font-size: 14px;
    line-height: 23px;
}
@media (min-width: 992px) {
    .orion-projects-mega-title,
    .orion-projects-mega-copyright { font-size: 15px; line-height: 25px; }
}
@media (min-width: 1199px) {
    .orion-projects-mega-title,
    .orion-projects-mega-copyright { line-height: 26px; }
}
@media (min-width: 1380px) {
    .orion-projects-mega-title,
    .orion-projects-mega-copyright { line-height: 28px; }
}
@media (min-width: 1752px) {
    .orion-projects-mega-title,
    .orion-projects-mega-copyright { font-size: 18px; line-height: 32px; }
}

/* "View Projects" link. Colour, family, weight, transform and letter spacing
   are Elementor-controlled; the box and size schedule are here. */
.orion-projects-mega-view-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    white-space: nowrap;
    text-decoration: none;
    font-size: 14px;
    line-height: 24px;
    border-bottom-style: solid;
    border-bottom-width: 1px;
    padding-block: 8px;
    padding-inline: 0;
    transition: color .3s ease-in-out, border-color .3s ease-in-out;
}
@media (min-width: 1199px) { .orion-projects-mega-view-link { font-size: 15px; } }
@media (min-width: 1752px) { .orion-projects-mega-view-link { font-size: 18px; } }