/* =========================================
   1. VARIABLES & RESET
   ========================================= */
:root {
    /* Colors - Architectural Palette */
    --bg-color: #ffffff;
    --text-main: #1a1a1a;       /* Almost black */
    --text-muted: #888888;      /* Light gray for metadata */
    --accent-color: #000000;    /* Jet black for active states */
    --overlay-bg: rgba(255, 255, 255, 0.9); /* White overlay on hover */

    /* Spacing & Layout */
    --container-width: 1200px;  /* Max width of content */
    --gutter: 20px;             /* Gap between images */
    --gutter-header-footer: 20px;             /* Gap between container limits and context */
    --gutter-footer: 20px;             /* Gap between container limits and context */
    --gutter-main: 0px;             /* Gap between container limits and context */
    --gutter-slider: 0px;             /* Gap between container limits and context */
    --header-height: 80px;             /* Header height variable */
    --padding-while-on-mobile: 20px;             /* Gap between container limits and context while using mobile device */

    /* Typography */
    --font-main: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --transition-speed: 0.3s;
}

/* Hard Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased; /* Crisp text on Mac */
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-speed) ease;
}

img {
    width: 100%;
    height: auto;
    display: block; /* Removes tiny space under images */
}

/* =========================================
   2. LAYOUT UTILITIES
   ========================================= */
/* Wrapper to keep content centered */
header, footer {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--gutter-header-footer);
}
main {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--gutter-main);
}

/* Re-usable container to constrain width */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto; /* Centers the container */
    padding: 0 var(--gutter-main);
}

/* =========================================
   2.5 TOP BAR (Socials)
   ========================================= */
.top-bar {
    width: 100%;
    background-color: #444444; /* Dark Grey match */
    height: 40px; /* Slim bar */
    display: flex;
    align-items: center;
}

.top-bar-content {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--gutter-main);

    display: flex;
    justify-content: flex-end; /* Pushes icons to the Right */
    gap: 20px; /* Space between icons */
}

.top-bar-content a {
    color: #ffffff; /* White icons */
    font-size: 1rem;
    transition: color 0.3s ease, transform 0.2s ease;
}

.top-bar-content a:hover {
    color: #cccccc; /* Light grey on hover */
    transform: translateY(-2px); /* Subtle lift effect */
}

/* Update Header Margin so it doesn't stick to the top bar */
header {
    margin-top: 10px;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .top-bar-content {
        justify-content: center; /* Center icons on mobile */
    }
}

/* =========================================
   3. HEADER & NAVIGATION (Screenshot Match)
   ========================================= */
header {
    height: 100px; /* Slightly taller to accommodate logo size */
    display: flex;
    justify-content: space-between; /* Pushes Left group and Right group apart */
    align-items: flex-end; /* Aligns items to the BOTTOM line, like the screenshot */
    padding-bottom: 10px;  /* Space between text and the line */
    border-bottom: 5px solid #999; /* The Thick Grey Line */
    margin-bottom: 10px;
}

/* --- Left Side Group --- */
.header-left {
    display: flex;
    align-items: flex-end; /* Aligns Logo bottom with Tagline bottom */
    gap: 15px;
}

.logo-link img {
    height: 60px; /* Adjust based on your actual logo file */
    width: auto;
    object-fit: contain;
    margin-bottom: -5px; /* Fine-tune to sit perfectly on the visual baseline */
}

.tagline {
    font-family: 'Roboto', sans-serif; /* Or Helvetica */
    font-weight: 400; /* Regular/Thin weight */
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 1px; /* Lifts text slightly off the invisible floor */
}

/* --- Right Side Navigation --- */
nav ul {
    list-style: none;
    display: flex;
    gap: 20px; /* Space between menu items */
    margin-bottom: 5px; /* Align text with tagline */
}

nav a {
    font-family: 'Roboto', sans-serif;
    font-size: 1.1rem;
    text-transform: capitalize; /* "Contact" instead of "CONTACT" */
    font-weight: 400; /* Normal weight */
    color: #333;
    text-decoration: none;
}

nav a:hover {
    color: #000;
}

/* The 'Active' state (e.g. when on Contact page) */
nav a.active {
    font-weight: 700; /* Bold, just like the screenshot */
    color: #000;
    border-bottom: none; /* Removed the underline we had before */
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        height: auto;
        align-items: center;
        gap: 20px;
        padding-top: 20px;
        margin-bottom: 5px;
    }

    .header-left {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .tagline {
        font-size: 0.9rem;
    }

    nav ul {
        gap: 15px;
        font-size: 0.9rem;
    }
}

/* =========================================
   UPDATED LOGO STYLES
   ========================================= */

/* Remove text styles, as it is now an image */
.logo a {
    display: block; /* Removes weird spacing around images */
    line-height: 0; /* Ensures container is exactly image height */
}

/* Control the logo size */
.logo img {
    height: 80px; /* Adjust this number to match your header height preference */
    width: auto;  /* Maintains aspect ratio so the logo doesn't squish */
    object-fit: contain;
}

/* =========================================
   4. FILTERS SECTION
   ========================================= */
.filters {
    padding: 20px 0;
    display: flex;
    justify-content: center; /* Center buttons */
    gap: 15px;
}

.filter-btn {
    background: none;
    border: 1px solid transparent;
    cursor: pointer;
    font-family: var(--font-main);
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 8px 16px;
    transition: all var(--transition-speed) ease;
}

.filter-btn:hover {
    color: var(--text-main);
}

.filter-btn.active {
    border: 1px solid var(--text-main);
    color: var(--text-main);
}

/* =========================================
   5. PORTFOLIO GRID
   ========================================= */
.portfolio-grid {
    display: grid;
    /* This creates a responsive grid automatically */
    /* It fits as many 350px columns as possible, then wraps */
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--gutter);
    padding-bottom: 20px;
}

.portfolio-wrapper {
    padding: 10px 0;
}

/* Project Card Container */
.project-card {
    position: relative; /* Needed for the overlay positioning */
    overflow: hidden;   /* Keeps zoom effect inside the box */
    aspect-ratio: 4/3;  /* Forces all cards to be the same shape (Landscape) */
    background-color: #f4f4f4; /* Placeholder color while loading */

    /* Animation for filtering fade-in/out */
    animation: fadeIn 0.5s ease;
}

/* The Image */
.project-card img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Crops image to fill the square without distortion */
    transition: transform 0.6s ease;
}

/* Hover Effect: Slight Zoom */
.project-card:hover img {
    transform: scale(1.05);
}

/* The Overlay (Text on Hover) */
.project-card .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-bg);

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    opacity: 0; /* Hidden by default */
    transition: opacity var(--transition-speed) ease;
}

.project-card:hover .overlay {
    opacity: 1; /* Show on hover */
}

.overlay h3 {
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.overlay p {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
}

/* =========================================
   6. FOOTER (Updated to Dark Bar)
   ========================================= */
footer {
    width: 100%;
    background-color: #444444; /* Dark Grey background */
    color: #ffffff;            /* White text */
    padding: 25px 0;           /* Vertical height of the bar */
    margin-top: auto;          /* Pushes footer to bottom */
}

.footer-bar {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--gutter);

    display: flex;
    justify-content: space-between; /* Spreads items: Left, Center, Right */
    align-items: center;
    font-size: 0.85rem; /* Small, crisp text */
    font-weight: 500;
}

.f-label {
    font-weight: 700; /* Bolds the "Contact:", "e-mail:" labels */
    margin-right: 5px;
    opacity: 0.9;
}

/* Mobile Responsiveness for Footer */
@media (max-width: 768px) {
    .footer-bar {
        flex-direction: column; /* Stack vertically on mobile */
        gap: 15px;
        text-align: center;
    }
}

/* =========================================
   7. KEYFRAMES & MOBILE RESPONSIVENESS
   ========================================= */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Mobile Screen Adjustments */
@media (max-width: 768px) {
    :root {
        --gutter: 15px;
    }

    /* Stack grid into 1 column */
    .portfolio-grid {
        grid-template-columns: 1fr;
    }
    .portfolio-wrapper {
        padding: 0 var(--padding-while-on-mobile);
    }

    /* Simplify Header for mobile */
    header {
        flex-direction: column;
        height: auto;
        padding: 20px 0;
        gap: 15px;
    }

    /* Adjust Overlay for mobile touch (Always show small label or keep hidden) */
    /* Optional: On mobile, you might want the title below the image instead of hover */
}

/* =========================================
   8. PROJECT DETAIL PAGE
   ========================================= */

/* Hero Image: Full width, limited height */
.project-hero {
    width: 100%;
    height: 60vh; /* Takes up 60% of the screen height */
    overflow: hidden;
    margin-bottom: 60px;
}

.project-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Container for text content */
.project-container {
    max-width: 1000px; /* Make text slightly narrower than full width for readability */
    margin: 0 auto;
    padding: 0 var(--gutter);
}

/* Header: Split Title and Metadata */
.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid #eee;
}

.header-left h1 {
    font-size: 2.5rem;
    font-weight: 300; /* Architectural thin font */
    margin-bottom: 10px;
}

.category-tag {
    font-size: 0.9rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.header-right {
    display: flex;
    gap: 40px;
}

.meta-item {
    display: flex;
    flex-direction: column;
}

.meta-item .label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.meta-item .value {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Description Text */
.project-description {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #444;
    margin-bottom: 80px;
    max-width: 700px;
}

/* Detail Gallery Grid */
.project-gallery {
    display: grid;
    grid-template-columns: 1fr 1fr; /* 2 columns */
    gap: var(--gutter);
    margin-bottom: 80px;
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
}

/* Back Button */
.project-nav {
    margin-bottom: 50px;
}

.back-btn {
    display: inline-block;
    border: 1px solid #ccc;
    padding: 10px 20px;
    font-size: 0.9rem;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.back-btn:hover {
    border-color: #000;
    background: #000;
    color: #fff;
}

/* Mobile Responsiveness for Details */
@media (max-width: 768px) {
    .project-hero {
        height: 40vh;
    }

    .project-header {
        flex-direction: column;
        gap: 30px;
    }

    .header-right {
        flex-wrap: wrap; /* Let metadata wrap if screen is tight */
        gap: 20px;
    }

    .project-gallery {
        grid-template-columns: 1fr; /* 1 column on mobile */
    }
}

/* =========================================
   9. CONTACT PAGE (Redesigned)
   ========================================= */

.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Equal split */
    gap: 40px; /* Big gap between map and text */
    margin-top: 40px;
    margin-bottom: 40px;
    align-items: center; /* Vertically center the text relative to the map */
}

/* --- Left Column: The Map --- */
.map-frame {
    width: 100%;
    height: 400px; /* Square-ish shape */
    border: 3px solid #000; /* The thick black border from the screenshot */
    padding: 0;
    overflow: hidden;
}

/* --- Right Column: Typography --- */
.info-column {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.intro-heading {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 5px;
    color: #000;
}

.intro-sub {
    font-size: 1.1rem;
    color: #444;
    margin-bottom: 40px;
    line-height: 1.5;
}

/* Contact Details Rows */
.contact-row {
    margin-bottom: 20px;
    font-size: 1rem;
    line-height: 1.6;
}

.contact-row .label {
    font-weight: 600; /* Bold label like "Adresa:" */
    color: #000;
    margin-right: 5px;
}

.contact-row .value {
    color: #333;
}

/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {
    .contact-container {
        grid-template-columns: 1fr; /* Stack them */
        margin-left: 20px;
        margin-right: 20px;
        gap: 40px;
        margin-top: 30px;
    }

    .map-frame {
        height: 300px; /* Slightly shorter map on mobile */
    }
}

/* =========================================
   10. HOMEPAGE SLIDER
   ========================================= */

.hero-slider {
    position: relative;
    width: 100%;
    height: 500px; /* <-- REDUCED HEIGHT */
    overflow: hidden;
    background: #000;
    margin-top: 40px;
    margin-bottom: 60px; /* Add space below the slider */
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0; /* Hidden by default */
    transition: opacity 1s ease-in-out;
    z-index: 1;
}

.slide.active {
    opacity: 1; /* Show active slide */
    z-index: 2;
}

/* The Image itself */
.slide-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: brightness(0.7); /* Darken slightly so text is readable */
}

/* Text Overlay */
.slide-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #fff;
    z-index: 3;
}

.slide-content h1 {
    font-size: 3rem;
    font-weight: 300;
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.slide-cat {
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 30px;
}

.slide-btn {
    display: inline-block;
    border: 1px solid #fff;
    color: #fff;
    padding: 12px 30px;
    text-transform: uppercase;
    font-size: 0.9rem;
    transition: background 0.3s;
}

.slide-btn:hover {
    background: #fff;
    color: #000;
}

/* Navigation Buttons (Arrows) */
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.3);
    color: white;
    border: none;
    font-size: 2rem;
    padding: 15px;
    cursor: pointer;
    z-index: 10;
    transition: background 0.3s;
}

.slider-btn:hover {
    background: rgba(0,0,0,0.8);
}

.prev { left: 0; }
.next { right: 0; }

/* Mobile Adjustments */
@media (max-width: 768px) {
    .hero-slider { height: 50vh; }
    .slide-content h1 { font-size: 1.8rem; }
}

/* =========================================
   11. SERVICES SECTION (Homepage)
   ========================================= */
.services-section {
    padding-bottom: 80px; /* Space before footer */
    text-align: center;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* Create 4 equal columns */
    gap: 40px; /* Space between columns */
}

.service-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Icon sizing */
.service-icon {
    width: auto;
    height: 80px; /* Adjust based on your actual icon size preferences */
    margin-bottom: 25px;
}

/* Typography to match screenshot */
.service-item h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: #000;
}

.service-subtitle {
    font-size: 1rem;
    font-weight: 700;
    color: #666; /* Dark grey */
    margin-bottom: 5px;
}

.service-item p:last-child {
    font-size: 1rem;
    color: #666;
    line-height: 1.4;
    max-width: 220px; /* Ensures text wraps nicely like in the image */
}

/* Responsive: 2 columns on tablet, 1 on mobile */
@media (max-width: 992px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 60px 40px; /* Larger vertical gap */
    }
}

@media (max-width: 600px) {
    .hero-slider {
        height: 300px; /* Even shorter slider on phones */
    }

    .services-grid {
        grid-template-columns: 1fr; /* Stack vertically */
    }
}

/* =========================================
   12. TEAM PAGE (Echipa)
   ========================================= */

/* Intro Text Block */
.team-intro {
    margin-top: 60px;
    margin-bottom: 80px;
    line-height: 1.6;
    color: #333;
    text-align: justify; /* Justifies text block like in the image */
}

.team-intro strong {
    font-weight: 700;
    color: #000;
}

/* Team List Container */
.team-list {
    display: flex;
    flex-direction: column;
    gap: 60px; /* Space between team members */
    margin-bottom: 100px;
}

/* Individual Member Row */
.team-member {
    display: flex;
    align-items: flex-start; /* Aligns text to top of image */
    gap: 40px; /* Space between image and text */
}

/* The Member Photo */
.member-photo {
    flex-shrink: 0; /* Prevents image from shrinking */
    width: 200px;   /* Fixed width for portrait */
}

.member-photo img {
    width: 100%;
    height: auto;
    aspect-ratio: 1/1; /* Forces square shape */
    object-fit: cover; /* Crops image nicely */
    border: 3px solid #000; /* The black border from screenshot */
    display: block;
}

/* The Member Text */
.member-info {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #333;
    text-align: justify;
}

.member-info strong {
    font-size: 1rem;
    color: #000;
}

/* =========================================
   UPDATED RESPONSIVENESS (Tablets & Mobile)
   ========================================= */

/* We use 1200px to cover iPad Pro and landscape modes safely */
@media (max-width: 1200px) {

    .team-member {
        flex-direction: column; /* Stack image on top of text */
        gap: 30px;
        align-items: center; /* This attempts to center the image */
    }

    .member-photo {
        /* FORCE the width. Flexbox sometimes ignores 'width' without max-width */
        width: 200px;
        max-width: 200px;

        /* Ensure it centers even if flex alignment fails */
        margin: 0 auto;
    }

    /* Adjust text alignment for reading on tablets */
    .team-intro, .member-info {
        text-align: left;
        padding: 0 var(--padding-while-on-mobile);
    }
}

/* Specific adjustments for smaller Phones */
@media (max-width: 600px) {
    .member-photo {
        width: 150px; /* Smaller on actual phones */
        max-width: 150px;
    }
}

/* =========================================
   13. SERVICES PAGE (Servicii)
   ========================================= */

.services-list-page {
    display: flex;
    flex-direction: column;
    gap: 60px; /* Space between rows */
    margin-top: 60px;
    margin-bottom: 100px;
}

.service-row {
    display: flex;
    align-items: center; /* Vertically center the icon with the text block */
    gap: 50px; /* Gap between icon and text */
}

.service-icon-wrapper {
    flex-shrink: 0;
    width: 140px; /* Width of the icon container */
    display: flex;
    justify-content: center;
}

.service-icon-wrapper img {
    width: 100%;
    height: auto;
    object-fit: contain;
    /* Optional: If icons need to be slightly transparent or grey like the image */
    opacity: 0.8;
}

.service-text p {
    font-size: 1rem;
    line-height: 1.6;
    color: #555; /* Dark grey text */
    text-align: justify; /* Clean blocks of text */
}

.service-text strong {
    color: #000; /* Bold title is Black */
    font-weight: 700;
}

/* Mobile Responsiveness for Services */
@media (max-width: 768px) {
    .service-row {
        flex-direction: column; /* Stack icon on top */
        gap: 20px;
        text-align: center;
    }

    .service-text p {
        text-align: justify-all; /* Easier to read on mobile */
    }

    .service-icon-wrapper {
        width: 100px; /* Smaller icons on phone */
    }

    .services-list-page {
        padding: 0 var(--padding-while-on-mobile);
    }
}