/* CSS Variables */
:root {
    /* Colors*/
    --def-color-1: rgb(255,255,255);
    --def-color-2: rgb(240,240,240);
    --def-color-3: rgb(190,190,190);
    --def-color-4: rgb(100,100,100);
    --def-color-5: rgb(50,50,50);
	
    --flex-gap: 1.8%;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: clamp(14px, 1vw + 13px, 20px);
    scroll-behavior: smooth;
}

body {
    font-family: 'Barlow', sans-serif;
	font-weight: 500;
    color: var(--def-color-5);
    background-color: var(--def-color-1);
}

.container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 2% 3%;
}

/* Hero Section */
.hero-section {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: var(--def-color-5);
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../img/bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.8;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 800px;
}

.logo-container {
    max-width: 400px;
    margin: 0 auto;
}

.logo-svg {
    width: 100%;
    height: auto;
    max-height: 300px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

/* Small Header */
.header-small {
    padding: 1rem 0;
    text-align: center;
    background-color: var(--def-color-5);
}

/* Subtitle Section */
.subtitle-section {
    background: var(--def-color-1) url('../img/ai_brightstone.jpg') repeat top center;
    background-size: auto;
}

.subtitle-content {
    max-width: 1320px;
    margin: 0 auto;
    padding: 50px 3%;
}

.subtitle-main {
    color: var(--def-color-5);
    margin-bottom: 1.3rem;
}

.subtitle-description {
    color: var(--def-color-5);
}

/* Services Section */
.services-section {
    background-color: var(--def-color-2);
}

.services-section > .container {
    padding: 30px 3%;
    margin: 0 auto;
}

.services-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.2rem;
    margin-top: 1rem;
    gap: 10px;
}

.services-icon svg {
    width: 16px;
    height: 16px;
    position: relative;
    top: 1px;
}

.section-title {
    font-weight: 500;
    margin: 0;
    text-transform: uppercase;
	white-space: nowrap;
}

.services-flex {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--flex-gap);
}

.service-item {
    width: calc(25% - (3 * var(--flex-gap) / 4));
    flex-basis: auto;
    flex-grow: 0;
    flex-shrink: 0;
}

.service-image {
    width: 100%;
    aspect-ratio: 1/0.56;
    overflow: hidden;
    position: relative;
}

.service-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.service-item:hover .service-image img {
    transform: scale(1.05);
}

.service-title {
    color: var(--def-color-5);
    font-weight: 700;
    margin: 0.6rem 0;
	font-size: 1.05rem;
}

.service-description {
    color: var(--def-color-4);
    font-weight: 500;
    margin: 0 0 1rem 0;
	font-size: 0.9rem;
}

/* Machinery Section */
.machinery-section {
    background: #1f1f1f url('../img/ai_winkelbild.jpg') top center no-repeat;
    background-size: cover;
    color: var(--def-color-1);
    margin: 0 auto;
}

.machinery-section > .dark-table-container {
    padding: 2rem 3%;
    margin: 0 auto;
    max-width: 1800px;
    text-align: center;
}

.machinery-section .dark-table {
    width: 100%;
    border-collapse: collapse;
}

.machinery-section .dark-table th,
.machinery-section .dark-table td {
    padding: 0.7rem;
    text-align: left;
}

.machinery-section .dark-table td[data-label="Typ"] {
    font-weight: bold;
	font-size: 1.1rem;
	table-layout: auto;
	white-space: nowrap; 
}

.machinery-section .dark-table th {
    text-transform: uppercase;
    font-weight: 400;
	font-size: 0.8rem;
    color: var(--def-color-3);
	white-space: nowrap; 
}

.machinery-section .dark-table tbody {
	font-size: 0.9rem;
}

.machinery-section .dark-table tbody tr:nth-child(odd) {
    background-color: rgba(0, 0, 0, 0.3);
}

.machinery-section .dark-table tbody tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.05);
}

/* About Us Section */
.about-us-section {
    background: var(--def-color-1);
}

.about-us-content {
    max-width: 1800px;
    margin: 0 auto;
    padding: 50px 3%;
    color: var(--def-color-5);
}

.about-us-title {
    margin-bottom: 2.8rem;
	font-weight: 400;
	font-size: clamp(20px, 3vw + 11px, 40px);
}

.about-us-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.about-us-col h3 {
    font-weight: bold;
    margin-bottom: 0.8rem;
    color: var(--def-color-5);
	text-transform: uppercase;
}

/* Contact Section */
.contact-section > .container {
    padding-top: 1rem;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
}

.contact-info,
.contact-details {
    border-top: 1px solid var(--def-color-3);
    padding-top: 1.5rem;
}

.contact-details {
    text-align: right;
}

.contact-address p {
    font-weight: 500;
	padding-bottom: 0.1rem;
}

.contact-details p {
    font-weight: 500;
	padding-bottom: 0.6rem;
}

.contact-details a {
	display: inline-flex;
    align-items: center;
    gap: 0.3em; 
    color: var(--def-color-5);
	font-weight: 600;
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-details a::before {
    content: "›";
	display: inline-flex;
    color: var(--def-color-4);
	font-size: 1.2rem;
	position: relative;
	line-height: 1;
	align-items: center;
}

.contact-details a:hover::before {
    color: #000;
}

.contact-details a:hover {
    color: #000;
}

.phone {
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
}

.phone svg {
    width: 1em;
    height: 1em;
    flex-shrink: 0;
}

/* Footer Section */
.footer-section {
    background-color: var(--def-color-2);
}

.footer-section > .container {
    padding-bottom: 1rem;
    padding-top: 1rem;
}

.footer-links {
    display: flex;
    gap: 1.2rem;
    max-width: 1800px;
    justify-content: flex-start;
    flex-wrap: wrap;
	font-size: 0.9rem;
	padding-bottom: 1rem;
}

.footer-links a {
    position: relative;
    text-decoration: none;
    color: var(--def-color-4);
    padding-bottom: 0.3rem;
    pointer-events: auto;
	text-transform: uppercase;
	font-weight: 700;
}

.footer-links a:hover {
    color: var(--def-color-5);
}

.footer-links a.active {
    pointer-events: none;
	color: var(--def-color-4);
}

.footer-links a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 1px;
    background-color: var(--def-color-5);
    transition: width 0.3s ease;
}

.footer-links a:hover::after {
    width: 100%;
}

.footer-links a.active::after {
    width: 100%;
    background-color: var(--def-color-3);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
	font-size: 0.8rem;
	margin-top: 1rem;
}

.back-to-top-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    color: var(--def-color-3);
    text-decoration: none;
    border-radius: 25px;
    border: 1px solid var(--def-color-3);
    transition: all 0.3s ease;
}

.back-to-top-btn:hover {
    transform: translateY(-2px);
    background-color: var(--def-color-1);
}

.back-to-top-text {
    font-weight: 700;
    color: var(--def-color-5);
    text-transform: uppercase;
	font-size: 0.8rem;
}

.back-to-top-icon svg {
    width: 16px;
    height: 16px;
    transform: rotate(180deg);
    color: var(--def-color-5);
    position: relative;
    top: 1px;
}

.footer-copyright p {
    color: var(--def-color-4);
    margin: 0;
	font-size: 13px;
}

/* Mobile Navigation (hidden by default) */
.mobile-nav {
    display: none;
}

/* ===========================
   Modal Overlay Styles (No-JS)
   =========================== */

/* Overlay-Grundstruktur */
.modal-overlay {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100%;
    background: rgba(0,0,0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99;
}

/* Anzeigen, wenn Ziel im URL-Hash */
.modal-overlay:target {
    display: flex;
}

/* Modalfenster */
.modal {
    background: var(--def-color-2);
    color: var(--def-color-5);
    max-width: 920px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 0;
    margin: 5%;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

/* Modalinhalte */
.modal-body {
    padding: 1.2rem;
	font-size: 0.9rem;
}

/* Close-Button (oben rechts, sticky) */
.modal-close {
    position: sticky;
    top: 0;
    float: right;
    padding: 0.4rem 0.8rem;
    background: var(--def-color-1);
    font-size: 2.5rem;
    line-height: 0.8;
    color: var(--def-color-5);
    text-decoration: none;
    cursor: pointer;
    z-index: 100;
    opacity: 0.6;
	box-shadow: 0 3px 12px rgba(0, 0, 0, 0.3);
	border-radius: 0px 0px 0px 15px;
    border: none;
}
.modal-close:hover {
    opacity: 1;
}

.modal a.modal-close::before {
    content: none;
}

.modal-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 1.15rem;
    margin-bottom: 1.8rem;
    margin-top: 1rem;
}
.modal-title-icon svg {
    display: block;
    width: 14px;
    height: 14px;
    margin-top: 0.1rem;
}

.modal p {
    margin-bottom: 1rem;
}
.modal ul {
    margin-left: 1.5rem;
}

.modal a {
    color: var(--def-color-4);
    font-weight: 700;
    text-decoration: none;
    transition: color 0.3s ease;
}
.modal a::before {
    content: "›";
    display: inline-block;
    margin-right: 0.24em;
    transition: transform 0.3s;
    color: var(--def-color-4);
    font-size: 1.2rem;
	line-height: 0.5em;
    position: relative;
    top: 1px;
}
.modal a:hover::before {
    color: #000;
}
.modal a:hover {
    color: #000;
}

.modal-target {
  position: fixed;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

#t-impressum:target ~ .modal-overlay#overlay-impressum,
#t-datenschutz:target ~ .modal-overlay#overlay-datenschutz,
#t-barrierefreiheit:target ~ .modal-overlay#overlay-barrierefreiheit {
  display: flex; 
}

@media (max-width: 980px) {

    .about-us-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
        grid-template-areas:
            "col1 col1"
            "col2 col3";
        gap: 1.8rem;
    }

    .about-us-col:nth-child(1) {
        grid-area: col1;
    }

    .about-us-col:nth-child(2) {
        grid-area: col2;
    }

    .about-us-col:nth-child(3) {
        grid-area: col3;
    }

    .service-item {
        width: calc(50% - var(--flex-gap));
    }

    .machinery-section {
        background-attachment: fixed;
    }

    .machinery-section .dark-table thead {
        display: none;
    }

    .machinery-section .dark-table tbody {
        display: flex;
        flex-wrap: wrap;
        gap: 0rem;
    }

    .machinery-section .dark-table tr {
        display: block;
        flex: 0 0 calc(50% - 1rem);
        padding: 0.8rem;
        box-sizing: border-box;
    }

    .machinery-section .dark-table td {
        display: block;
        padding: 0.08rem;
    }

    .machinery-section .dark-table td[data-label="Arbeitsbereich"]::before {
        content: "ARBEITSBEREICH:";
        display: inline;
        margin-right: 0.3em;
        color: var(--def-color-3);
    }
	
	.machinery-section .dark-table td[data-label="Arbeitsbereich"] {
		text-align: left;
}

    .machinery-section .dark-table td[data-label="Einsatzzweck"]::before {
        content: "EINSATZZWECK:";
        display: inline;
        margin-right: 0.3em;
        color: var(--def-color-3);
    }
}

@media (min-width: 601px) and (max-width: 980px)  {
    /* Linke Spalte in ungeraden Zeilen dunkel */
    .machinery-section .dark-table tbody tr:nth-child(4n + 1) {
        background-color: rgba(0, 0, 0, 0.3);
    }

    /* Rechte Spalte in ungeraden Zeilen hell */
    .machinery-section .dark-table tbody tr:nth-child(4n + 2) {
        background-color: rgba(255, 255, 255, 0.05);
    }

    /* Linke Spalte in geraden Zeilen hell */
    .machinery-section .dark-table tbody tr:nth-child(4n + 3) {
        background-color: rgba(255, 255, 255, 0.05);
    }

    /* Rechte Spalte in geraden Zeilen dunkel */
    .machinery-section .dark-table tbody tr:nth-child(4n + 4) {
        background-color: rgba(0, 0, 0, 0.3);
    }
}

@media (max-width: 600px) {
    .hero-section {
        min-height: 300px;
    }

    .logo-container {
        max-width: 300px;
    }

    .logo-svg {
        height: 190px;
        width: 280px;
        margin-right: 0px;
    }

    .subtitle-content {
        width: auto;
        padding: 5% 3%;
    }

    .services-flex {
        flex-direction: column;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 0.7rem;
    }

    .service-item {
        width: 100%;
        flex-basis: auto;
        flex-grow: 0;
        flex-shrink: 0;
    }

    .service-image {
        height: 200px;
    }
	
    .services-header {
        justify-content: flex-start;
    }	

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .contact-info,
    .contact-details {
        padding-top: 1rem;
    }

    .contact-details {
        text-align: left;
        border-top: none;
    }

    .footer-section > .container {
        padding-bottom: 3%;
    }

    .machinery-section .dark-table,
    .machinery-section .dark-table thead,
    .machinery-section .dark-table tbody,
    .machinery-section .dark-table th,
    .machinery-section .dark-table td,
    .machinery-section .dark-table tr {
        display: block;
    }

    .machinery-section .dark-table thead {
        display: none;
    }

	.machinery-section .dark-table td[data-label="Typ"] {
		font-size: 1.2rem;
	}
	
    .machinery-section .dark-table td[data-label="Arbeitsbereich"]::before,
    .machinery-section .dark-table td[data-label="Einsatzzweck"]::before {
        display: inline;
        margin-right: 0.3em;
        color: var(--def-color-3);
    }

    .machinery-section .dark-table td[data-label="Arbeitsbereich"]::before {
        content: "ARBEITSBEREICH:";
    }

    .machinery-section .dark-table td[data-label="Einsatzzweck"]::before {
        content: "EINSATZZWECK:";
    }

    .about-us-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        grid-template-areas:
            "col1"
            "col2"
            "col3";
    }
}