/**
 * A-Z Byg Custom CSS
 * Developed by LynBro ApS — https://lynbro.dk
 */

/* ── Card Hover Effects ── */
.azbyg-card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.azbyg-card-hover:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-left: 4px solid #d32f2f;
}

/* Icon stays white on hover */
.group:hover .group-hover\:bg-primary .material-symbols-outlined,
.group:hover .group-hover\:text-on-primary .material-symbols-outlined {
    color: #ffffff !important;
}

/* ── Button Press Effect ── */
.press-effect {
    transition: transform 0.1s ease-in-out, box-shadow 0.1s ease-in-out;
}
.press-effect:active {
    transform: scale(0.96) translateY(2px) !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2) !important;
}

/* ── 3D Building Drawing Animation ── */
#scroll-building-effect {
    will-change: transform, opacity;
    transition: left 0.8s cubic-bezier(0.4,0,0.2,1),
                top 0.8s cubic-bezier(0.4,0,0.2,1),
                width 0.6s ease,
                height 0.6s ease,
                opacity 0.5s ease;
    position: fixed;
    z-index: 30;
    pointer-events: none;
    opacity: 0;
}

.draw-line {
    stroke-dasharray: 1500;
    stroke-dashoffset: 1500;
    transition: none;
}

.drawing .draw-line {
    animation: draw 2.5s ease-out forwards;
}

.draw-delay-1 { animation-delay: 0s !important; }
.draw-delay-2 { animation-delay: 0.4s !important; }
.draw-delay-3 { animation-delay: 0.8s !important; }
.draw-delay-4 { animation-delay: 1.2s !important; }
.draw-delay-5 { animation-delay: 1.6s !important; }

@keyframes draw {
    to {
        stroke-dashoffset: 0;
    }
}

/* ── Partners Carousel ── */
.partner-carousel-track {
    will-change: transform;
}
.partner-carousel-wrap:hover .partner-carousel-track {
    /* JS reads this to pause */
}

/* ── Before/After Slider ── */
.ba-slide {
    touch-action: none;
    user-select: none;
}

/* ── Active Menu Item — brick-colored rounded underline ── */
nav ul li.current-menu-item > a,
nav ul li.current-menu-parent > a,
nav ul li.current-menu-ancestor > a {
    color: #d32f2f !important;
}
nav ul li.current-menu-item > a > span,
nav ul li.current-menu-parent > a > span,
nav ul li.current-menu-ancestor > a > span {
    color: #d32f2f !important;
    position: relative;
}
nav ul li.current-menu-item > a > span::after,
nav ul li.current-menu-parent > a > span::after,
nav ul li.current-menu-ancestor > a > span::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    right: 0;
    height: 3px;
    background: #d32f2f;
    border-radius: 999px;
}

/* ── Dropdown Menu ── */
header nav ul { list-style: none !important; margin: 0 !important; padding: 0 !important; }
header nav ul li { position: relative !important; }
header nav ul li > ul.sub-menu {
    visibility: hidden;
    opacity: 0;
    position: absolute !important;
    top: 100% !important;
    left: 50% !important;
    transform: translateX(-50%) translateY(8px) !important;
    min-width: 280px !important;
    background: #ffffff !important;
    border-radius: 12px !important;
    box-shadow: 0 20px 40px rgba(0,0,0,0.12), 0 0 0 1px rgba(0,0,0,0.04) !important;
    padding: 8px 0 !important;
    z-index: 200 !important;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    margin: 0 !important;
}
header nav ul li:hover > ul.sub-menu {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0) !important;
}
header nav ul > li > ul.sub-menu > li {
    display: block !important;
    float: none !important;
}
header nav ul > li > ul.sub-menu > li > a {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 10px 20px !important;
    font-size: 0.9rem !important;
    color: #44474e !important;
    transition: all 0.15s ease !important;
    white-space: nowrap !important;
}
header nav ul > li > ul.sub-menu > li > a:hover {
    background: #f7f3f2 !important;
    color: #d32f2f !important;
    padding-left: 24px !important;
}
header nav ul > li > ul.sub-menu > li > a > span {
    color: inherit !important;
}

/* Mobile menu: show sub-items inline */
#mobile-nav .sub-menu {
    visibility: visible !important;
    display: block !important;
    position: static !important;
    transform: none !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 0 0 0 16px !important;
    min-width: auto !important;
    margin-top: 8px !important;
}
#mobile-nav .sub-menu li a {
    color: #74777f !important;
    padding: 6px 0 !important;
    font-size: 1rem !important;
}
#mobile-nav .sub-menu li a:hover {
    background: transparent !important;
    color: #d32f2f !important;
    padding-left: 0 !important;
}
#mobile-nav .menu-item-has-children > a::after { display: none !important; }

/* Arrow indicator for parent items with submenu */
header nav ul li.menu-item-has-children > a::after {
    content: '';
    display: inline-block;
    width: 5px;
    height: 5px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    margin-left: 4px;
    margin-bottom: 2px;
    opacity: 0.5;
    transition: transform 0.2s ease;
}
header nav ul li.menu-item-has-children:hover > a::after {
    transform: rotate(-135deg);
    opacity: 1;
}

/* ── Sticky Header: give sections scroll margin ── */
section {
    scroll-margin-top: 80px;
}

/* ── Ensure WP admin bar doesn't mess with sticky header ── */
.admin-bar header.sticky {
    top: 32px;
}

@media screen and (max-width: 782px) {
    .admin-bar header.sticky {
        top: 46px;
    }
}

/* ── Contact Form 7 Styling ── */
.azbyg-cf7-wrap .wpcf7-form label {
    display: block;
    font-weight: 700;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    color: #1b1c1c;
}
.azbyg-cf7-wrap .wpcf7-form input[type="text"],
.azbyg-cf7-wrap .wpcf7-form input[type="email"],
.azbyg-cf7-wrap .wpcf7-form input[type="tel"],
.azbyg-cf7-wrap .wpcf7-form textarea {
    width: 100%;
    border: 1px solid rgba(116, 119, 127, 0.3);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    outline: none;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}
.azbyg-cf7-wrap .wpcf7-form input:focus,
.azbyg-cf7-wrap .wpcf7-form textarea:focus {
    border-color: #d32f2f;
    box-shadow: 0 0 0 2px rgba(211, 47, 47, 0.2);
}
.azbyg-cf7-wrap .wpcf7-form textarea {
    resize: none;
    min-height: 120px;
}
.azbyg-cf7-wrap .wpcf7-form p {
    margin-bottom: 1rem;
}
.azbyg-cf7-wrap .wpcf7-form input[type="submit"] {
    width: 100%;
    background: #d32f2f;
    color: #fff;
    padding: 1rem 2rem;
    border-radius: 0.75rem;
    font-weight: 700;
    font-size: 1.125rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Manrope', sans-serif;
}
.azbyg-cf7-wrap .wpcf7-form input[type="submit"]:hover {
    background: #b71c1c;
    transform: scale(1.02) translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}
.azbyg-cf7-wrap .wpcf7-form .wpcf7-response-output {
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    margin-top: 1rem;
}
.azbyg-cf7-wrap .wpcf7-form .wpcf7-not-valid-tip {
    color: #d32f2f;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}
.azbyg-cf7-wrap .wpcf7-form select,
.wpcf7-form select {
    width: 100%;
    border: 1px solid rgba(116, 119, 127, 0.3);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    outline: none;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
    background: #fff;
    appearance: auto;
}
.azbyg-cf7-wrap .wpcf7-form select:focus,
.wpcf7-form select:focus {
    border-color: #d32f2f;
    box-shadow: 0 0 0 2px rgba(211, 47, 47, 0.2);
}

/* CF7 form inside kontakt page (non azbyg-cf7-wrap) */
.wpcf7-form input[type="text"],
.wpcf7-form input[type="email"],
.wpcf7-form input[type="tel"],
.wpcf7-form textarea {
    width: 100%;
    border: 1px solid rgba(116, 119, 127, 0.3);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    outline: none;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}
.wpcf7-form input:focus,
.wpcf7-form textarea:focus {
    border-color: #d32f2f;
    box-shadow: 0 0 0 2px rgba(211, 47, 47, 0.2);
}
.wpcf7-form textarea {
    resize: none;
    min-height: 120px;
}
.wpcf7-form input[type="submit"] {
    width: 100%;
    background: #d32f2f;
    color: #fff;
    padding: 1rem 2rem;
    border-radius: 0.75rem;
    font-weight: 700;
    font-size: 1.125rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Manrope', sans-serif;
}
.wpcf7-form input[type="submit"]:hover {
    background: #b71c1c;
    transform: scale(1.02) translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}
.wpcf7-form .wpcf7-response-output {
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    margin-top: 1rem;
}
.wpcf7-form .wpcf7-not-valid-tip {
    color: #d32f2f;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}
/* CF7 spinner */
.wpcf7-spinner {
    display: block;
    margin: 0.75rem auto 0;
}
/* CF7 success message */
.wpcf7-form.sent .wpcf7-response-output {
    border-color: #16a34a;
    background: #f0fdf4;
    color: #166534;
}
.wpcf7-form.failed .wpcf7-response-output,
.wpcf7-form.aborted .wpcf7-response-output {
    border-color: #d32f2f;
    background: #fef2f2;
    color: #991b1b;
}
.wpcf7-form.invalid .wpcf7-response-output {
    border-color: #ea580c;
    background: #fff7ed;
    color: #9a3412;
}

/* ── Legal & Content Pages — Mobile Responsive ── */
@media (max-width: 640px) {
    /* page.php wrapper — tighter on mobile */
    main > .max-w-4xl {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
        margin-top: 1rem !important;
        margin-bottom: 1rem !important;
        border-radius: 1rem !important;
    }
    /* Outer section container px-8 → px-4 on mobile */
    main .max-w-4xl.px-8,
    main section .max-w-4xl.px-8 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    /* Also cover px-6 containers */
    main .max-w-4xl.px-6,
    main section .max-w-4xl.px-6 {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    /* Card containers p-8 → p-4 */
    main .rounded-2xl.p-8,
    main section .rounded-2xl.p-8 {
        padding: 1rem !important;
        border-radius: 0.75rem !important;
    }
    /* Inner white cards p-6 → p-3 */
    main .rounded-xl.p-6 {
        padding: 0.75rem !important;
    }
    /* Inner white cards p-5 → p-3 */
    main .rounded-xl.p-5 {
        padding: 0.75rem !important;
    }
    /* Cards with p-4 → p-3 */
    main .rounded-xl.p-4 {
        padding: 0.75rem !important;
    }
    /* Reduce section top/bottom padding */
    main section.py-24 {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }
    main section.py-16 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    /* Tables — smaller text, tighter cells */
    main table {
        font-size: 0.8rem;
    }
    main table th,
    main table td {
        padding: 0.5rem !important;
    }
    /* Grid cards for rights section */
    main .grid .rounded-xl {
        padding: 0.75rem !important;
    }
    /* List items — tighter indent */
    main ul.list-disc,
    main ul[class*="pl-"] {
        padding-left: 1.25rem !important;
    }
    /* Prose inside default page template */
    main .prose {
        font-size: 0.95rem;
    }
}

/* ── Service Card Modal ── */
.azbyg-modal {
    position: fixed;
    inset: 0;
    z-index: 999998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.azbyg-modal__overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.azbyg-modal__container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 640px;
    max-height: 88vh;
    overflow-y: auto;
    background: #ffffff;
    border-radius: 1.5rem;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.2);
    animation: azbyg-modal-in 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overscroll-behavior: contain;
}

.azbyg-modal__close {
    position: sticky;
    top: 0;
    float: right;
    z-index: 10;
    background: #fff;
    border: 1px solid #e6e2e1;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin: 1.25rem 1.25rem 0 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.2s ease;
}

.azbyg-modal__close:hover {
    background: #f7f3f2;
    transform: scale(1.05);
}

.azbyg-modal__content {
    padding: 2rem 2rem 2rem;
}

@media (max-width: 640px) {
    .azbyg-modal {
        align-items: flex-end;
        padding: 0;
    }
    .azbyg-modal__container {
        max-height: 92vh;
        border-radius: 1.5rem 1.5rem 0 0;
        animation: azbyg-modal-slide-up 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .azbyg-modal__content {
        padding: 1.25rem 1.25rem 2rem;
    }
}

/* Modal header */
.azbyg-modal__header {
    margin-bottom: 1.5rem;
}

.azbyg-modal__icon-wrap {
    width: 56px;
    height: 56px;
    background: rgba(211, 47, 47, 0.08);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.azbyg-modal__icon-wrap .material-symbols-outlined {
    font-size: 28px;
    color: #d32f2f;
}

.azbyg-modal__title {
    font-family: 'Manrope', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    color: #1b1c1c;
    margin: 0 0 0.35rem;
    line-height: 1.25;
}

.azbyg-modal__subtitle {
    font-size: 0.95rem;
    color: #74777f;
    margin: 0;
    line-height: 1.4;
}

/* Modal body */
.azbyg-modal__body {
    margin-bottom: 1.5rem;
}

.azbyg-modal__body p {
    font-size: 0.9rem;
    color: #44474e;
    line-height: 1.7;
    margin: 0 0 0.75rem;
}

.azbyg-modal__body strong {
    color: #1b1c1c;
}

/* Sections */
.azbyg-modal__section-title {
    font-family: 'Manrope', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: #1b1c1c;
    margin: 0 0 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.azbyg-modal__section-title .material-symbols-outlined {
    font-size: 20px;
    color: #d32f2f;
}

.azbyg-modal__highlights,
.azbyg-modal__process {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.azbyg-modal__highlights li,
.azbyg-modal__process li {
    font-size: 0.875rem;
    color: #44474e;
    line-height: 1.5;
}

/* CTA */
.azbyg-modal__cta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e6e2e1;
}

.azbyg-modal__cta-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.9rem 1.5rem;
    border-radius: 0.75rem;
    font-family: 'Manrope', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.azbyg-modal__cta-btn--primary {
    background: #d32f2f;
    color: #fff;
}

.azbyg-modal__cta-btn--primary:hover {
    background: #b71c1c;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(211, 47, 47, 0.3);
}

.azbyg-modal__cta-btn--secondary {
    background: #f7f3f2;
    color: #1b1c1c;
    border: 1px solid #e6e2e1;
}

.azbyg-modal__cta-btn--secondary:hover {
    background: #e6e2e1;
}

/* Card hover indicator */
[data-modal-id] {
    cursor: pointer;
    position: relative;
}

[data-modal-id]::after {
    content: 'Læs mere';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(211, 47, 47, 0.9));
    color: #fff;
    text-align: center;
    padding: 2rem 0.5rem 0.75rem;
    font-family: 'Manrope', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    border-radius: 0 0 1rem 1rem;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

[data-modal-id]:hover::after {
    opacity: 1;
}

/* Animations */
@keyframes azbyg-modal-in {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes azbyg-modal-slide-up {
    from { opacity: 0; transform: translateY(60px); }
    to { opacity: 1; transform: translateY(0); }
}

.azbyg-modal--closing .azbyg-modal__container {
    animation: azbyg-modal-out 0.2s ease forwards;
}

.azbyg-modal--closing .azbyg-modal__overlay {
    animation: azbyg-modal-fade-out 0.2s ease forwards;
}

@keyframes azbyg-modal-out {
    to { opacity: 0; transform: scale(0.95) translateY(10px); }
}

@keyframes azbyg-modal-fade-out {
    to { opacity: 0; }
}
