﻿/* ══════════════════════════════════════════════════
   STLYES.CSS — Gallardo E-Katalog — ANA SAYFA

   Üst şerit: marka + 3D logo + adres/telefon + web sitesi.
   Ana alan: her proje tam-yükseklik bir "cephe" (facade) paneli;
   masaüstünde üzerine gelince genişler (CSS :hover), dokunmatikte
   JS (mainpage.js → _wireDelegatedEvents) is-active sınıfını
   karşılığında ekler/kaldırır. Veri akışı (GetAllProjects /
   GetSubProjects / handleProjectClick) HİÇ değişmedi — bu dosya
   sadece görünümü değiştirir, #projectsSidebar ve
   #subProjectsPanel id'leri JS ile birebir aynı kaldı.
   ══════════════════════════════════════════════════ */

:root {
    --brand: #0b326d;
    --brand2: #06203a;
    --grad: linear-gradient(135deg,#0b326d,#06203a);
    --ink: #081527;
    --ink-2: #040b16;
    --ink-soft: #0d1f38;
    --surface2: #0a1a30;
    --border-solid: #1c3050;
    --line: rgba(238,242,248,.14);
    --text: #eef2f8;
    --text-strong: #ffffff;
    --muted: #93a4bd;
    --muted2: #b7c3d6;
    --accent: #6f9fdb;
    --accent-soft: rgba(111,159,219,.12);
    --r-sm: 4px;
    --r-xs: 2px;
    --topbar-h: 64px;
    --dur: 560ms;
    --ease: cubic-bezier(.22,.7,.2,1);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    overflow: hidden;
    background: var(--ink-2);
}

body {
    font-family: 'Montserrat', sans-serif;
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

    body > form#form1 {
        display: flex;
        flex-direction: column;
        height: 100%;
        overflow: hidden;
    }

img {
    display: block;
    max-width: 100%;
    height: auto;
}

button {
    font-family: inherit;
    cursor: pointer;
}

    button:focus-visible {
        outline: 2px solid var(--accent);
        outline-offset: 2px;
    }

a {
    color: inherit;
}

/* ══════════════════════════════
   ÜST ŞERİT
   ══════════════════════════════ */
.topbar {
    flex-shrink: 0;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 0 24px;
    background: var(--ink);
    border-bottom: 1px solid var(--line);
    position: relative;
    z-index: 30;
}

.brand-mark {
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: .02em;
    color: var(--text-strong);
    white-space: nowrap;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.contact-phone {
    display: flex;
    align-items: center;
    gap: 7px;
    text-decoration: none;
    font-size: .78rem;
    font-weight: 500;
    color: var(--muted2);
    white-space: nowrap;
    transition: color var(--dur) var(--ease);
}

    .contact-phone i {
        color: var(--accent);
        flex-shrink: 0;
    }

    .contact-phone:hover {
        color: var(--text-strong);
    }

@media (max-width: 560px) {
    .contact-phone span {
        display: none;
    }

    .contact-phone {
        padding: 8px;
    }
}

.site-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-size: .76rem;
    font-weight: 600;
    color: var(--ink);
    background: var(--text-strong);
    padding: 8px 14px;
    border-radius: var(--r-xs);
    white-space: nowrap;
    transition: background var(--dur) var(--ease);
}

    .site-link:hover {
        background: var(--accent);
    }

/* ══════════════════════════════════════════════════
   CEPHE ŞERİDİ (.facades / #projectsSidebar)
   ══════════════════════════════════════════════════ */
.facades {
    flex: 1;
    display: flex;
    min-height: 0;
}

.facade {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
    cursor: pointer;
    transition: flex-grow var(--dur) var(--ease);
    border-right: 1px solid var(--ink-2);
    outline-offset: -3px;
}

    .facade:last-child {
        border-right: none;
    }

    .facade.is-active {
        flex-grow: 3.1;
    }

.facade-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(.94) contrast(1.02);
    transform: scale(1.08);
    transition: transform 1.3s var(--ease), filter var(--dur) var(--ease);
}

.facade.is-active .facade-img {
    transform: scale(1);
    filter: saturate(1.02);
}

.facade-img--placeholder {
    background: linear-gradient(135deg,#070e1f,#0c1a34);
    display: flex;
    align-items: center;
    justify-content: center;
}

    .facade-img--placeholder span {
        font-size: 2rem;
        font-weight: 800;
        color: rgba(111,159,219,.18);
    }

.facade-scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(4,11,22,.88) 0%, rgba(4,11,22,.5) 30%, rgba(4,11,22,.05) 55%, rgba(4,11,22,.25) 100%);
    transition: opacity var(--dur) var(--ease);
}

.facade-index {
    position: absolute;
    top: 18px;
    left: 18px;
    font-size: .78rem;
    font-weight: 600;
    color: var(--accent);
    z-index: 1;
}

    .facade-index sup {
        font-size: .58rem;
        color: var(--muted2);
        margin-left: 2px;
    }

.facade-spine {
    position: absolute;
    left: 18px;
    bottom: 22px;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: .92rem;
    font-weight: 600;
    letter-spacing: .02em;
    color: var(--text-strong);
    white-space: nowrap;
    transition: opacity .3s var(--ease);
    z-index: 1;
}

.facade.is-active .facade-spine {
    opacity: 0;
    pointer-events: none;
}

.facade-panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 26px 28px 28px;
    opacity: 0;
    transform: translateY(14px);
    transition: opacity .34s var(--ease), transform .46s var(--ease);
    transition-delay: .05s;
    pointer-events: none;
    z-index: 1;
}

.facade.is-active .facade-panel {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.facade-kicker {
    font-size: .72rem;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: .4rem;
}

.facade-title {
    font-size: clamp(1.3rem,2.6vw,1.9rem);
    font-weight: 700;
    color: var(--text-strong);
    line-height: 1.08;
    margin-bottom: .9rem;
}

.facade-cta {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    background: none;
    border: 1px solid var(--accent);
    color: var(--text-strong);
    font-size: .78rem;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: var(--r-xs);
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

    .facade-cta:hover {
        background: var(--accent);
        color: var(--ink);
    }

/* Fare imleci facade üzerine gelince genişlesin (masaüstü) —
   dokunmatikte zaten JS is-active sınıfını ekliyor. */
@media (hover: hover) and (pointer: fine) {
    /* Fare şerit üzerindeyken is-active durumu geçici olarak devre dışı
       kalır — sadece o an üzerine gelinen sütun genişler ve metnini
       gösterir, diğerleri (aktif olsa bile) sırt etiketine döner. */
    .facades:hover .facade:not(:hover) {
        flex-grow: .7;
    }

        .facades:hover .facade:not(:hover) .facade-panel {
            opacity: 0;
            transform: translateY(14px);
            pointer-events: none;
        }

        .facades:hover .facade:not(:hover) .facade-spine {
            opacity: 1;
            pointer-events: auto;
        }

    .facade:hover {
        flex-grow: 3.1;
    }

        .facade:hover .facade-img {
            transform: scale(1);
        }

        .facade:hover .facade-spine {
            opacity: 0;
        }

        .facade:hover .facade-panel {
            opacity: 1;
            transform: translateY(0);
            pointer-events: auto;
        }
}

/* girişte tek seferlik yükselme */
.facade {
    opacity: 0;
    animation: facadeRise .6s var(--ease) forwards;
}

@keyframes facadeRise {
    to {
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .facade, .facade-img, .facade-scrim, .facade-spine, .facade-panel {
        transition: none !important;
        animation: none !important;
    }
}

/* ══════════════════════════════════════════════════
   ALT-PROJE PANELİ — cephelerin üzerine kayan overlay
   (#subProjectsPanel; JS zaten .active sınıfını ekliyor/çıkarıyor,
   burada sadece CSS görünümü tanımlanıyor).
   ══════════════════════════════════════════════════ */
.project-details-container {
    display: none;
    position: fixed;
    inset: var(--topbar-h) 0 0 0;
    z-index: 40;
    overflow-y: auto;
    background: rgba(4,11,22,.72);
    backdrop-filter: blur(3px);
    padding: 2.2rem 2rem;
    opacity: 0;
    transition: opacity .28s ease;
}

    .project-details-container.active {
        display: block;
        opacity: 1;
    }

.error-message {
    background: rgba(220,70,70,.10);
    color: #ff9b9b;
    padding: 1rem 1.2rem;
    border-radius: var(--r-sm);
    border: 1px solid rgba(220,70,70,.30);
    font-size: .83rem;
    line-height: 1.65;
    max-width: 640px;
    margin: 2rem auto;
}

.loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--ink);
}

.spinner {
    width: 34px;
    height: 34px;
    border: 2.5px solid var(--border-solid);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .75s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading p {
    color: var(--muted);
    margin-top: .6rem;
    font-size: .80rem;
}

/* Breadcrumb (alt-proje panelinde kullanılır) */
.breadcrumb-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .24rem;
    padding: .5rem .8rem;
    background: var(--ink-soft);
    border: 1px solid var(--border-solid);
    border-radius: var(--r-xs);
    margin: 0 auto 1.2rem;
    max-width: 980px;
    font-size: .76rem;
    font-weight: 500;
}

.bc-item {
    color: var(--muted);
    padding: .10rem .3rem;
    border-radius: 4px;
    white-space: nowrap;
    transition: background .14s,color .14s;
}

.bc-link {
    cursor: pointer;
    color: var(--accent);
}

    .bc-link:hover {
        background: var(--accent-soft);
    }

.bc-active {
    color: var(--text-strong);
    cursor: default;
}

.bc-sep {
    color: var(--border-solid);
    font-size: .65rem;
    display: flex;
    align-items: center;
}

/* Alt proje paneli içeriği */
.sp-wrapper {
    max-width: 980px;
    margin: 0 auto;
}

.sp-header {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-strong);
    margin-bottom: 1.1rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid var(--border-solid);
}

    .sp-header i {
        color: var(--accent);
    }

.sp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill,minmax(220px,1fr));
    gap: .85rem;
}

.sp-card {
    background: var(--surface2);
    border: 1px solid var(--border-solid);
    border-radius: var(--r-sm);
    padding: .95rem 1.05rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: .8rem;
    transition: transform .25s, border-color .2s;
}

    .sp-card:hover {
        transform: translateY(-3px);
        border-color: var(--accent);
    }

    .sp-card:active {
        transform: scale(.98);
    }

.sp-card--parent {
    border-color: rgba(111,159,219,.35);
    background: var(--accent-soft);
}

.sp-media {
    width: 48px;
    height: 48px;
    border-radius: var(--r-xs);
    background: linear-gradient(135deg,#070e1f,#0c1a34);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.sp-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 5px;
}

.sp-initials {
    font-size: .95rem;
    font-weight: 800;
    color: rgba(111,159,219,.5);
}

.sp-name {
    flex: 1;
    font-size: .86rem;
    font-weight: 600;
    color: var(--text-strong);
    line-height: 1.3;
}

.sp-general-label {
    font-size: .64rem;
    font-weight: 400;
    opacity: .55;
    margin-left: .22rem;
}

.sp-arrow {
    color: var(--accent);
    font-size: .78rem;
    opacity: .5;
    flex-shrink: 0;
    transition: opacity .14s;
}

.sp-card:hover .sp-arrow {
    opacity: 1;
}

/* ══════════════════════════════════════════════
   MOBİL ≤ 900px — cepheler yatay şeritten dikey akordeona döner
   ══════════════════════════════════════════════ */
@media (max-width: 900px) {
    html, body {
        height: auto;
        overflow: auto;
    }

        body > form#form1 {
            height: auto;
            overflow: visible;
        }

    .topbar {
        height: auto;
        flex-wrap: nowrap;
        padding: 12px 14px;
        gap: 10px;
    }

    .brand-mark {
        font-size: .92rem;
    }

    .topbar-right {
        gap: 8px;
    }

    .site-link span {
        display: none;
    }

    .site-link {
        padding: 9px 10px;
    }

        .site-link i {
            font-size: .9rem;
        }

    .facades {
        flex-direction: column;
        overflow: visible;
    }

    .facade {
        flex: none;
        height: 145px;
        border-right: none;
        border-bottom: 1px solid var(--ink-2);
    }

        .facade.is-active {
            flex-grow: 0;
            height: 62vh;
        }

        .facade:active {
            filter: brightness(.92);
        }

    .facade-index {
        top: 14px;
        left: 14px;
    }

    .facade-spine {
        writing-mode: horizontal-tb;
        transform: none;
        left: 16px;
        bottom: 14px;
        font-size: .88rem;
    }

    .facade-panel {
        padding: 18px 16px 20px;
    }

    .facade-title {
        margin-bottom: .7rem;
    }

    .facade-cta {
        width: 100%;
        justify-content: center;
        padding: 12px 18px;
    }

    .project-details-container {
        position: static;
        inset: auto;
        padding: 1.1rem .9rem;
        backdrop-filter: none;
        background: var(--ink-2);
    }

    .breadcrumb-nav {
        margin: 0 0 1rem;
    }

    .sp-wrapper {
        margin: 0;
    }

    .sp-grid {
        grid-template-columns: 1fr;
    }

    .sp-card {
        padding: .8rem .9rem;
    }
}

@media (max-width: 380px) {
    .facade {
        height: 130px;
    }

    .facade-title {
        font-size: 1.15rem;
    }
}
