/* =============================================================
   buildlog_hero.css
   Hero image + info bar for the build log page
   ============================================================= */

/* ---------------------------------------------------------------
   1. HERO
   --------------------------------------------------------------- */
.build-hero {
    position: relative;
    width: 100%;
    /* Negative margin to bleed past any page container padding */
    margin-left: calc(-1 * var(--page-gutter, 0px));
    margin-right: calc(-1 * var(--page-gutter, 0px));
    margin-bottom: 0;
    overflow: hidden;
    background: #111;
}

/* Image wrapper — gives us the 16:9 → 21:9 aspect ratio */
.build-hero__image-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 21 / 9;
    min-height: 260px;
    max-height: 520px;
    overflow: hidden;
}

.build-hero__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%; /* bias toward upper part of car photos */
    display: block;
    /* Subtle initial animation */
    animation: heroFadeIn 0.6s ease both;
}

@keyframes heroFadeIn {
    from { opacity: 0; transform: scale(1.03); }
    to   { opacity: 1; transform: scale(1); }
}

/* Gradient overlay — strong at the bottom for legible text */
.build-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0,0,0,0.05) 0%,
        rgba(0,0,0,0.15) 50%,
        rgba(0,0,0,0.72) 100%
    );
    pointer-events: none;
}

/* Text sits at the bottom of the image */
.build-hero__content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem 1.75rem 1.25rem;
    z-index: 2;
}

/* Car make / model / year pill */
.build-hero__badge {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.85);
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 999px;
    padding: 0.25em 0.9em;
    margin-bottom: 0.55rem;
}

/* Build title */
.build-hero__title {
    font-size: clamp(1.5rem, 4vw, 2.6rem);
    font-weight: 800;
    line-height: 1.15;
    color: #fff;
    text-shadow: 0 2px 12px rgba(0,0,0,0.5);
    margin: 0;
}

/* Fallback when there is no image yet */
.build-hero--no-image {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 60%, #0f3460 100%);
    min-height: 180px;
    display: flex;
    align-items: flex-end;
}

.build-hero__content--plain {
    position: static;
    padding: 2rem 1.75rem 1.5rem;
}

.build-hero__title--dark {
    color: #fff;
}

/* ---------------------------------------------------------------
   2. INFO BAR
   --------------------------------------------------------------- */
.build-infobar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    background: #1e1e1e;
    border-bottom: 1px solid #333;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    /* stick right below hero with no gap */
    margin-bottom: 1.5rem;
}

.build-infobar__left {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
}

.build-infobar__right {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

/* Avatar */
.build-infobar__avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #dee2e6;
    flex-shrink: 0;
}

/* Author + date stack */
.build-infobar__meta {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.build-infobar__by {
    font-size: 0.85rem;
    color: #cdd1d6; /* 9.6:1 on #1e1e1e — passes AAA ✓ */
}

.build-infobar__by a {
    font-weight: 600;
    color: #7db3ff; /* 7.75:1 on #1e1e1e — passes AAA ✓ */
    text-decoration: none;
}

.build-infobar__by a:hover {
    text-decoration: underline;
}

.build-infobar__date {
    font-size: 0.78rem;
    color: #c4cdd6; /* 10.36:1 on #1e1e1e — passes AAA ✓ */
}

/* Like button (inherits existing .like-button styles, just tweak sizing) */
.build-infobar__like {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: #495057;
    transition: background 0.15s, border-color 0.15s;
}

.build-infobar__like:hover:not(.disabled) {
    background: #e9f0ff;
    border-color: #0d6efd;
    color: #0d6efd;
}

.build-infobar__like .material-icons {
    font-size: 1.1rem;
}

/* Share button — leverages existing .button-style, just add rounding */
.build-infobar__share {
    border-radius: 999px !important;
    padding: 0.35rem 1rem !important;
    font-size: 0.85rem !important;
}

/* Edit button */
.build-infobar__edit {
    border-radius: 999px !important;
}

/* ---------------------------------------------------------------
   3. DESCRIPTION BLOCK (below info bar)
   --------------------------------------------------------------- */
.build-description {
    padding: 0 0.25rem 0.5rem;
    margin-bottom: 1.5rem;
}

.build-description p {
    font-size: 1rem;
    line-height: 1.75;
    color: #343a40;
}

/* ---------------------------------------------------------------
   4. RESPONSIVE TWEAKS
   --------------------------------------------------------------- */
@media (max-width: 576px) {
    .build-hero__image-wrap {
        aspect-ratio: 16 / 9;
        max-height: 280px;
    }

    .build-hero__content {
        padding: 1rem 1rem 0.85rem;
    }

    .build-hero__badge {
        font-size: 0.7rem;
    }

    .build-infobar {
        padding: 0.65rem 0.85rem;
    }

    .build-infobar__right {
        width: 100%;
        justify-content: flex-end;
    }
}