/* ================================================
   RESPONSIVE.CSS - Media Services Theme
   Desktop-first approach (max-width breakpoints)
   Breakpoints:
     max-xl  : 1279px
     max-lg  : 1023px
     max-md  :  767px
     max-sm  :  639px
   ================================================ */


/* ------------------------------------------------
   MOBILE MENU OVERLAY
   ------------------------------------------------ */

.mobile-menu-overlay {
    visibility: hidden;
    transition: visibility 0s linear 0.5s;
}

.mobile-menu-overlay.is-open {
    visibility: visible;
    transition-delay: 0s;
}

.mobile-backdrop {
    background: rgba(4, 30, 53, 0.88);
    opacity: 0;
    transition: opacity 0.45s ease-out;
    cursor: pointer;
}

.mobile-menu-overlay.is-open .mobile-backdrop {
    opacity: 1;
}

.mobile-panel {
    transform: translateX(100%);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu-overlay.is-open .mobile-panel {
    transform: translateX(0);
}

/* Nav list top-level items - staggered slide-in */
.mobile-nav-list > li {
    border-bottom: 1px solid rgba(4, 30, 53, 0.1);
    opacity: 0;
    transform: translateX(24px);
    transition: opacity 0.35s ease-out, transform 0.35s ease-out;
}

.mobile-menu-overlay.is-open .mobile-nav-list > li {
    opacity: 1;
    transform: translateX(0);
}

.mobile-menu-overlay.is-open .mobile-nav-list > li:nth-child(1)  { transition-delay: 0.20s; }
.mobile-menu-overlay.is-open .mobile-nav-list > li:nth-child(2)  { transition-delay: 0.27s; }
.mobile-menu-overlay.is-open .mobile-nav-list > li:nth-child(3)  { transition-delay: 0.34s; }
.mobile-menu-overlay.is-open .mobile-nav-list > li:nth-child(4)  { transition-delay: 0.41s; }
.mobile-menu-overlay.is-open .mobile-nav-list > li:nth-child(5)  { transition-delay: 0.48s; }
.mobile-menu-overlay.is-open .mobile-nav-list > li:nth-child(6)  { transition-delay: 0.55s; }
.mobile-menu-overlay.is-open .mobile-nav-list > li:nth-child(7)  { transition-delay: 0.62s; }
.mobile-menu-overlay.is-open .mobile-nav-list > li:nth-child(8)  { transition-delay: 0.69s; }

/* Parent link + toggle button side by side */
.mobile-nav-list .menu-item-has-children {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.mobile-nav-list .menu-item-has-children > a {
    flex: 1;
}

.mobile-nav-list a {
    display: block;
    padding: 0.9rem 0;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--primary_blue);
    transition: color 0.25s ease-out, padding-left 0.25s ease-out;
}

.mobile-nav-list a:hover {
    color: var(--accent);
    padding-left: 0.4rem;
}


/* ------------------------------------------------
   SUBMENU - DROPDOWN ON CLICK
   ------------------------------------------------ */

/* Hidden by default */
.mobile-nav-list .sub-menu {
    display: none;
    width: 100%;
    flex-basis: 100%;
    padding-left: 1rem;
    padding-bottom: 0.5rem;
    row-gap: 0;
    /* Override desktop clip-path / position styles */
    clip-path: none !important;
    position: static !important;
    transform: none !important;
    background: transparent !important;
    border: none !important;
    opacity: 1 !important;
    max-width: none !important;
    pointer-events: all !important;
    font-size: 1rem;
    color: var(--primary_blue);
}

/* Visible when parent has .sub-open */
.mobile-nav-list li.sub-open > .sub-menu {
    display: grid;
}

.mobile-nav-list .sub-menu li {
    border-bottom: none !important;
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
}

.mobile-nav-list .sub-menu a {
    padding: 0.4rem 0;
    font-size: 0.95rem;
    opacity: 0.65;
}

.mobile-nav-list .sub-menu a:hover {
    opacity: 1;
    padding-left: 0.4rem;
}

/* Submenu chevron toggle button */
.submenu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--primary_blue);
    padding: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s ease-out;
    flex-shrink: 0;
}

.submenu-toggle.sub-open {
    transform: rotate(180deg);
}


/* ------------------------------------------------
   HAMBURGER BUTTON
   ------------------------------------------------ */

.hamburger-bar {
    display: block;
    width: 28px;
    height: 1.5px;
    background: currentColor;
    transition: transform 0.32s ease-out, opacity 0.32s ease-out;
    transform-origin: center;
}

.menu-is-open .hamburger-bar:nth-child(1) {
    transform: translateY(8.5px) rotate(45deg);
}

.menu-is-open .hamburger-bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.menu-is-open .hamburger-bar:nth-child(3) {
    transform: translateY(-8.5px) rotate(-45deg);
}


/* ------------------------------------------------
   FIXED HEADER - RESPONSIVE
   ------------------------------------------------ */

@media (max-width: 1023px) {
    .fixed-header {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }
}


/* ------------------------------------------------
   HERO - MOBILE TEXT SIZE
   ------------------------------------------------ */

@media (max-width: 1023px) {
    .hero-title {
        font-size: clamp(2.5rem, 10vw, 6rem);
    }
}

@media (max-width: 767px) {
    .hero-title {
        font-size: clamp(2rem, 11vw, 4rem);
    }
}


/* ------------------------------------------------
   CONTACT FORM - SINGLE COLUMN ON MOBILE
   ------------------------------------------------ */

@media (max-width: 767px) {
    .contact-form form {
        grid-template-columns: 1fr !important;
    }

    .contact-form .form-group:has(input[placeholder="Θέμα"]),
    .contact-form .form-group:has(textarea) {
        grid-column: span 1 !important;
    }
}


/* ------------------------------------------------
   ABOUT PAGE - HISTORY TIMELINE - MOBILE
   ------------------------------------------------ */

@media (max-width: 1023px) {
    /* Shift the vertical center line to the left edge */
    .history-timeline > .timeline-center-line {
        left: 1.5rem !important;
        transform: translateX(0) !important;
    }

    /* Each row becomes left-aligned single column */
    .history-timeline .timeline-item {
        flex-direction: row !important;
    }

    .history-timeline .timeline-item .timeline-content {
        width: 100% !important;
        padding-right: 0 !important;
        padding-left: 3.5rem !important;
        text-align: left !important;
    }

    /* Hide the empty spacer column */
    .history-timeline .timeline-item .timeline-empty {
        display: none !important;
    }

    /* Move the dot to match the new line position */
    .history-timeline .timeline-item .timeline-dot {
        left: 1.5rem !important;
        transform: translateX(-50%) !important;
    }
}


/* ------------------------------------------------
   SERVICE ICON LIST - ICONS ABOVE TEXT ON MOBILE
   ------------------------------------------------ */

@media (max-width: 767px) {
    /* Each list item becomes a column: icon on top, text below */
    .service-icon-list > li {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.5rem !important;
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }

    /* Icon span becomes full-width top area instead of left sidebar */
    .service-icon-list > li > span {
        width: 48px !important;
        height: 48px !important;
        border: none !important;
    }
}


/* ------------------------------------------------
   BORDERED TITLE - RESPONSIVE
   ------------------------------------------------ */

@media (max-width: 1023px) {
    .bordered-title {
        padding-left: 2rem;
        font-size: clamp(2rem, 5vw, 3.5rem);
    }
}

@media (max-width: 767px) {
    .bordered-title {
        padding-left: 0;
        font-size: clamp(1.8rem, 7vw, 2.5rem);
    }

    .bordered-title::before {
        display: none;
    }

    .bordered-title span {
        padding-inline: 0;
    }
}


/* ------------------------------------------------
   PAGE TITLE HEADING - RESPONSIVE
   ------------------------------------------------ */

@media (max-width: 1023px) {
    .page-title h1 {
        font-size: clamp(2rem, 6vw, 4rem);
        line-height: 1.05;
    }
}

@media (max-width: 767px) {
    .page-title h1 {
        font-size: clamp(1.8rem, 8vw, 3rem);
        line-height: 1.1;
        letter-spacing: -0.5px;
    }
}


/* ------------------------------------------------
   SERVICE LIST BUTTON - MOBILE FONT SIZE
   ------------------------------------------------ */

@media (max-width: 767px) {
    .service-list button {
        font-size: 1rem !important;
    }
}


/* ------------------------------------------------
   FOOTER - VERTICAL LAYOUT + CONSISTENT DIVIDERS
   ------------------------------------------------ */

@media (max-width: 767px) {
    /* Nav links: 2-col → 1-col on mobile */
    .footer .grid.grid-cols-2:first-child {
        grid-template-columns: 1fr !important;
    }

    /* Nav link column dividers: remove left border, add top border */
    .footer .grid.grid-cols-2:first-child > div {
        border-left: none !important;
        border-top: none !important;
    }

    /* Remove top padding from first nav column */
    .footer .grid.grid-cols-2:first-child > div:first-child {
        border-top: none !important;
    }

    /* Bottom row (social + 9AM): stack on mobile */
    .footer .grid.grid-cols-2.mt-auto {
        grid-template-columns: 1fr !important;
    }

    /* Social links: remove left border, add top border */
    .footer .grid.grid-cols-2.mt-auto .border-l {
        border-left: none !important;
        border-top: 1px solid rgba(255, 255, 255, 0.2) !important;
        padding-top: 1rem !important;
        padding-left: 0 !important;
    }

    /* 9AM credit: left-align on mobile */
    .footer .grid.grid-cols-2.mt-auto .content-end {
        text-align: left !important;
        padding-top: 0.5rem;
    }

    /* Consistent separator between logo col and nav col */
    .footer .grid.grid-cols-2 > div:first-child {
        border-bottom: none !important;
    }
}


/* ------------------------------------------------
   GENERAL SPACING - MOBILE
   ------------------------------------------------ */

@media (max-width: 767px) {
    /* CTA buttons need breathing room */
    .main-cta {
        margin-top: 1.5rem;
    }

    /* Section headings - more breathing room below */
    .about h3.text-lg,
    section > div > h3.text-lg {
        margin-bottom: 1rem;
    }

    /* Service accordion items */
    .service-list li {
        padding-block: 0.25rem;
    }

    /* Contact form submit */
    .contact-form input[type="submit"] {
        margin-top: 0.5rem;
    }

    /* Page title section */
    .page-title {
        padding-top: 5rem;
    }
}


/* ------------------------------------------------
   GENERAL - PREVENT HORIZONTAL OVERFLOW
   ------------------------------------------------ */

@media (max-width: 1023px) {
    body {
        overflow-x: hidden;
    }
}
