@font-face {
    font-family: 'NovaRoundSlim-Bold';
    src: url('../fonts/NovaRoundSlim-Bold.ttf') format('truetype');
}

@font-face {
    font-family: 'NovaRound-Book';
    src: url('../fonts/NovaRound-Book.ttf') format('truetype');
}

@font-face {
    font-family: 'Youngtimer';
    src: url('../fonts/maass slicer Italic.ttf') format('truetype');
}

@font-face {
    font-family: 'Oldtimer';
    src: url('../fonts/UPPEAN__.ttf') format('truetype');
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
    text-align: center;
    padding-top: 65px !important;
    scroll-behavior: smooth;
}

body {
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    padding: 0 1rem;
    position: relative;
    z-index: auto;
}

header {
    background: #a2aec0;
    color: #fff;
    padding: 0.8rem 0;
    position: fixed;
    top: 0;
    width: 100%;
    height: auto;
    z-index: 1000;
    transition: transform 0.3s ease;
}

header.hidden {
    transform: translateY(-100%);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.title {
    font-family: 'NovaRoundSlim-Bold', Arial, sans-serif;
    padding-top: 0%;
    margin-top: 0;
    margin-bottom: 0;
    font-size: 2rem;
    padding-left: 1rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1 1 auto;
    min-width: 0;
}

.title a {
    color: #fff;
    text-decoration: none;
    cursor: pointer;
}

.title span {
    font-size: 0.85rem;
    font-style: italic;
    padding-top: 0;
    margin-left: 0;
    font-weight: normal;
    color: #fff;
    line-height: 1.2;
}

.title a:visited {
    color: #fff;
}

/* Lazy loading image optimization */
img {
    display: block;
    max-width: 100%;
    height: auto;
}

img[loading="lazy"] {
    background: linear-gradient(90deg, rgba(200, 200, 200, 0.1), rgba(200, 200, 200, 0.2));
}

/* Smooth fade-in for lazy loaded images */
img[loading="lazy"]:not([src*="data:"]) {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0.8;
    }
    to {
        opacity: 1;
    }
}

.old-style {
    font-family: 'Oldtimer', Arial, sans-serif;
}

.young-style {
    font-family: 'Youngtimer', Arial, sans-serif;
    font-size: 90%;
}

#main-subtitle {
    font-size: 1.3rem;
    margin-top: -1rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

header nav {
    padding-right: 1rem;
    flex: 0 0 auto;
    margin-left: auto;
}

.nav-toggle {
    display: none;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.6rem;
    padding: 0.25rem;
    cursor: pointer;
}

header nav ul {
    list-style: none;
    display: flex;
    gap: 0.8rem;
    margin: 0;
    padding: 0;
    cursor: pointer;
    flex-wrap: wrap;
    justify-content: flex-end;
}

header nav ul li {
    margin: 0;
    padding: 0;
}

header nav ul li a {
    font-family: 'NovaRound-Book', Arial, sans-serif;
    font-size: 0.9rem;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

header nav ul li a:hover {
    color: #55708a;
    text-decoration: none;
    cursor: pointer;
}

.detailing-link {
    position: relative;
    display: inline-block;
}

.detailing-link::before {
    content: '✨';
    position: absolute;
    top: -5px;
    left: -5px;
    font-size: 1.2em;
    animation: sparkle 2s infinite ease-in-out;
    pointer-events: none;
}

@keyframes sparkle {
    0%, 100% {
        opacity: 0;
        transform: scale(0.5) rotate(0deg);
    }
    50% {
        opacity: 1;
        transform: scale(1) rotate(180deg);
    }
}

.btn{
    background: #264e99;
    color: #fff;
    padding: 0.5rem 1rem;
    text-decoration: none;
    margin: 0.5rem;
    transition: background 0.3s ease, color 0.3s ease;
    border-radius:20px;
}

.btn:hover {
    background: #457dd1;
    color: #fff;
    cursor: pointer;
}

.hero {
    background: url('images/gallery/hero.jpg') no-repeat center center/cover;
    text-align: center;
    padding: 1.5rem 0 3rem;
    margin-bottom: 0;
}

.services {
    margin-bottom: 2rem;
    position: relative;
}

.services .service-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    padding: 0 0.5rem;
    max-width: 100%;
}

/* Mobile layout (phones): single-column service items */
@media (max-width: 1100px) {
    .services .service-list {
        display: block;
        gap: 0;
        padding: 0; /* Remove padding since container already has padding */
    }

    .services .service-item {
        display: block !important;
        width: 100% !important; /* Full width of container */
        flex: none !important;
        max-width: none !important;
        padding: 1.25rem 1rem;
        text-align: left;
        margin-bottom: 1rem;
        box-sizing: border-box;
    }

    .services .service-item .service-icon {
        display: none; /* Hide icon on mobile for cleaner look */
    }

    .services .service-item h3 {
        margin-top: 0;
        font-size: 1.2rem;
        margin-bottom: 0.5rem;
    }

    .services .service-item p {
        font-size: 0.9rem;
        line-height: 1.4;
        margin: 0.5rem 0;
    }

    .services .service-item ul {
        font-size: 0.85rem;
        line-height: 1.4;
        margin: 0.5rem 0;
        padding-left: 1.2rem;
    }

    .services .service-item li {
        margin-bottom: 0.25rem;
    }

    .services .service-item:hover {
        transform: none;
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    }
}

/* Mobile layout (phones): full-width quick-contact buttons */
@media (max-width: 1100px) {
    .quick-contact {
        gap: 0.75rem;
    }

    .quick-contact__item {
        min-width: 100%;
        max-width: 100%;
        width: 100%;
        padding: 0.875rem 1rem;
        flex: none;
    }

    .quick-contact__label {
        font-size: 0.9rem;
    }

    .quick-contact__value {
        font-size: clamp(1.2rem, 4vw, 1.8rem);
    }

    .quick-contact__hint {
        font-size: 1.2rem;
        margin: 0.5rem 0 1.5rem;
    }
}
 
/* Desktop layout (wide screens): multi-column service grid */
@media (min-width: 1101px) {
    .services .service-item {
        flex: 1 1 calc(33.333% - 1rem);
        max-width: calc(33.333% - 1rem);
        padding: 1.5rem 1rem;
        margin-bottom: 1rem;
    }
}

.services .service-item {
    background: #fff;
    padding: 1.5rem 1rem;
    text-align: left;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: visible;
    min-height: auto;
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.services .service-item .service-icon {
    flex-shrink: 0;
    width: clamp(2rem, 6vw, 3.2rem);
    height: clamp(2rem, 6vw, 3.2rem);
    object-fit: contain;
    margin-top: 0.25rem;
}

.services .service-item .service-content {
    flex: 1;
    min-width: 0;
}

.services .service-item:hover {
    transform: scale(1.02);
    box-shadow: 0 0 15px rgba(71, 71, 228, 0.2);
}

.services .service-item h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    color: #000000;
}

.services .service-item p {
    margin: 0.5rem 0;
    line-height: 1.4;
    color: #000000;
}

.services .service-item ul {
    margin: 0.5rem 0;
    padding-left: 1.2rem;
    line-height: 1.4;
    color: #555;
}

.services .service-item li {
    margin-bottom: 0.25rem;
}

.gallery {
    margin-bottom: 2rem;
    position: relative;
    z-index: auto;
}

.gallery .project-card {
    background: #fff;
    border: 1px solid #dbe4f2;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
    z-index: auto;
}

.gallery .project-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(38, 78, 153, 0.08), rgba(69, 125, 209, 0.08));
    pointer-events: none;
    z-index: 0;
}

.gallery .project-card > * {
    position: relative;
    z-index: auto;
}

.gallery .project-heading {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem 1rem;
    margin-bottom: 1rem;
    position: static;
    z-index: auto;
}

.gallery .project-title {
    margin: 0;
    font-size: 2rem;
    color: #1f3b63;
    font-family: 'Youngtimer';
}

.gallery .project-meta {
    margin: 0;
    color: #2d68a0;
    font-size: 1.1rem;
    font-weight: bold;
}

.gallery .gallery-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    padding: 0 1rem;
    margin-bottom: 2rem;
    position: static;
    z-index: auto;
}

.gallery .gallery-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    flex: 1 1 calc(33.333% - 1rem);
    max-width: calc(33.333% - 1rem);
    box-sizing: border-box;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    z-index: auto;
    border-radius: 0.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.12);
    isolation: isolate;
}

/* Responsive gallery grid */
/* Mobile (phones): single-column */
@media (max-width: 1100px) {
    .gallery .gallery-item {
        flex: 1 1 100%;
        max-width: 100%;
        min-height: 200px;
    }
}

/* Tablet: two-column layout */
@media (min-width: 1101px) and (max-width: 1440px) {
    .gallery .gallery-item {
        flex: 1 1 calc(50% - 1rem);
        max-width: calc(50% - 1rem);
        min-height: 250px;
    }
}

/* Desktop: three-column layout */
@media (min-width: 1441px) {
    .gallery .gallery-item {
        flex: 1 1 calc(33.333% - 1rem);
        max-width: calc(33.333% - 1rem);
        min-height: 300px;
    }
}

.gallery .gallery-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: var(--tile-bg-image);
    background-size: cover;
    background-position: center;
    filter: blur(0.2rem);
    transform: scale(1.15);
    opacity: 0.65;
    z-index: 0;
    pointer-events: none;
}

.gallery .gallery-item img {
    width: 100%;
    transition: transform 0.3s ease;
    display: block;
    max-height: 100%;
    border-radius: inherit;
    position: relative;
    z-index: 1;
}


.gallery .gallery-item .description {
    display: none;
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 0.5rem;
    box-sizing: border-box;
    text-align: center;
    z-index: 3;
}

.gallery .gallery-item:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.gallery .gallery-item:hover img {
    transform: scale(1.1);
}

.gallery .gallery-item.active {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 999999;
    width: 90%;
    height: 90%;
    max-width: 90vw;
    max-height: 90vh;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 0.6rem;
}

body:has(.gallery .gallery-item.active)::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999998;
    pointer-events: none;
}

.gallery .gallery-item.active img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transform: none;
    position: relative;
    z-index: 1;
}

.gallery .gallery-item.active .description {
    display: block;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3; /* above the image (image is z-index: 1) */
}

.gallery .gallery-item.active::before {
    content: none !important;
}

.gallery .gallery-item .close-btn {
    display: none;
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    z-index: 2;
}

.gallery .gallery-item.active .close-btn {
    display: block;
    top: 10px;
    right: 10px;
}

.gallery .btn {
    margin-top: 1rem;
    font-size: xx-large;
}

.contact {
    background: #f4f4f4;
    padding: 2rem 0;
    position: relative;
}

.contact form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.contact .form-group {
    display: flex;
    flex-direction: column;
    margin-top: 2rem;
    width: 100%;
    max-width: 500px;
}

.contact .form-group label {
    text-align: left;
    margin-bottom: 0.5rem;
}

.contact .form-group input,
.contact .form-group textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

footer {
    background: #333;
    color: #fff;
    text-align: center;
    padding: 1rem 0;
    width: 100%;
}

body {
    background-color: #e6eef8;
}

.section-background {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    isolation: isolate;
}

.section-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: blur(3px);
    -webkit-filter: blur(3px);
    z-index: 0;
    border-radius: inherit;
}

.section-title{
    font-size: 2rem;
    font-weight: bold;
}

.section-home::before {
    background-image: url('../images/gallery/g2_5.jpg');
}

@media (max-width: 800px){
    .section-home::before {
        background-image: url('../images/gallery/mobile/g2_5.jpg');
    }
}

.section-quick-contact::before {
    background-image: url('../images/gallery/peugeot_104_21.jpg');
    background-position: 0% 75%;
}

@media (max-width: 800px){
    .section-quick-contact::before {
        background-image: url('../images/gallery/mobile/peugeot_104_21.jpg');
        background-position: 0% 75%;
    }
}

.section-services::before {
    background-image: url('../images/gallery/mb_sl_1.jpg');
}

@media (max-width: 800px){
    .section-services::before {
        background-image: url('../images/gallery/mobile/mb_sl_1.jpg');
    }
}

.section-contact::before {
    background-image: url('../images/gallery/f_1.jpg');
}

@media (max-width: 800px){
    .section-contact::before {
        background-image: url('../images/gallery/mobile/f_1.jpg');
    }
}
.section-background .container {
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.5); 
    padding: 20px; 
    border-radius: 20px;
}

#quick-contact {
    margin: 1.25rem 0 2rem;
}

.quick-contact {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    align-items: stretch;
}

.quick-contact__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;

    text-decoration: none;
    color: #0b2540;

    background: rgba(255, 255, 255, 0.85);
    border: 2px solid rgba(38, 78, 153, 0.25);
    border-radius: 16px;
    padding: 1rem 1.25rem;
    min-width: min(420px, 90vw);

    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    cursor: pointer;
}

.quick-contact__item:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.12);
    border-color: rgba(38, 78, 153, 0.45);
}

.quick-contact__item:focus-visible {
    outline: 4px solid rgba(38, 78, 153, 0.35);
    outline-offset: 4px;
}

.quick-contact__label {
    font-family: Arial, sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    color: #2d68a0;
    font-size: 1rem;
}

.quick-contact__value {
    font-family: Arial, sans-serif;
    font-weight: bold;
    font-size: clamp(1.5rem, 3.2vw, 2.25rem);
    line-height: 1.1;
}

.quick-contact__hint {
    flex-basis: 100%;
    margin: 0.25rem 0 2rem;
    color: #1f3b63;
    font-weight: 600;
    font-size: 1.5rem;
    max-width: 900px;
}

/* Mobile-first responsive design */
/* Mobile phones and small tablets (up to 1100px) */
@media (max-width: 1100px) {
    html, body {
        padding-top: 65px;
    }

    .title {
        font-size: 1.3rem;
        padding-left: 0.5rem;
    }

    .title span {
        font-size: 0.7rem;
    }

    header {
        padding: 0.6rem 0;
        will-change: transform;
        backface-visibility: hidden;
    }

    .nav-toggle {
        display: block;
    }

    header nav {
        padding-right: 0.5rem;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(162, 174, 192, 0.95);
        display: none;
        flex-direction: column;
        align-items: center;
        padding: 0.75rem 0;
        z-index: 999;
    }

    header.nav-open nav {
        display: flex;
    }

    header nav ul {
        gap: 0.3rem;
        justify-content: center;
        flex-direction: column;
        width: 100%;
    }

    header nav ul li a {
        font-size: clamp(1rem, 3vw, 1.2rem);
        padding: 0.5rem 0.4rem;
        width: 100%;
        text-align: center;
    }

    #main-subtitle {
        font-size: 1rem;
        margin-top: -0.8rem;
    }
}

/* Desktop and larger (769px and up) */
@media (min-width: 769px) {
    .nav-toggle {
        display: none !important;
    }

    header nav {
        position: static !important;
        background: transparent !important;
        display: flex !important;
        flex-direction: row !important;
        padding: 0 !important;
        z-index: auto !important;
        margin-left: auto !important;
        margin-right: 1rem !important;
    }

    header nav ul {
        flex-direction: row !important;
        width: auto !important;
    }

    header nav ul li a {
        width: auto !important;
        text-align: left !important;
        padding: 0.25rem !important;
        font-size: 2rem !important;
    }
}

/* Tablets and larger (768px and up) */
@media (min-width: 768px) {
    html, body {
        padding-top: 100px;
    }

    .title {
        font-size: 2.5rem;
    }

    .title span {
        font-size: 1rem;
    }

    header nav ul li a {
        font-size: 1.1rem;
    }

    #main-subtitle {
        font-size: 1.8rem;
    }
}

/* Desktop (1024px and up) */
@media (min-width: 1024px) {
    html, body {
        padding-top: 110px;
    }

    .title {
        font-size: 3rem;
    }

    .title span {
        font-size: 1.2rem;
    }

    header nav ul li a {
        font-size: 1.3rem;
    }

    #main-subtitle {
        font-size: 2.2rem;
    }
}

/* Large screens (1400px+) */
@media (min-width: 1400px) {
    html, body {
        padding-top: 120px;
    }

    .title {
        font-size: 3.5rem;
    }

    header nav ul li a {
        font-size: 1.4rem;
    }
}

/* Lightbox (gallery click to enlarge + navigation) */
.lightbox {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    z-index: 100000;
    padding: 1rem;
}

.lightbox-open {
    overflow: hidden;
}

.lightbox__content {
    position: relative;
    max-width: 95vw;
    max-height: 95vh;
    width: min(800px, 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox__image {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 0.5rem;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.7);
}

.lightbox__caption {
    margin-top: 0.75rem;
    color: #fff;
    text-align: center;
    font-size: 0.95rem;
    max-width: 90vw;
}

.lightbox__close,
.lightbox__nav {
    position: absolute;
    border: none;
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    padding: 0.4rem 0.6rem;
    border-radius: 0.35rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.lightbox__close:hover,
.lightbox__nav:hover {
    background: rgba(0, 0, 0, 0.6);
}

.lightbox__close {
    top: 0.75rem;
    right: 0.75rem;
    font-size: 1.2rem;
}

.lightbox__nav {
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.75rem;
    padding: 0.5rem 0.75rem;
}

.lightbox__nav--prev {
    left: 0.75rem;
}

.lightbox__nav--next {
    right: 0.75rem;
}

/* Hide lightbox nav controls on touch-size screens */
@media (max-width: 1100px) {
    .lightbox__nav {
        display: none;
    }
}
