/*
Theme Name: Fox Child
Template:   fox
Version:    1.0.0
Description: Child theme for Fox Magazine (v6.0.9.8). Adds a Readable Article post template and fixes the sticky-header / admin-bar conflict.
*/

/*
 * ADMIN BAR / STICKY HEADER FIX
 * ======================================================
 * Root cause: header-below.css is loaded async via the fox56_async
 * media trick. The .admin-bar .is-sticky { top: 32px } rule inside it
 * can lose a race against the sticky-header JS. This synchronous child
 * stylesheet always arrives before JS, so these rules are guaranteed.
 *
 * Additionally, .before-sticky (position: fixed, top inherited at -400px)
 * has no admin-bar offset in the parent theme, causing the slide-in
 * animation to end 32px too low. The rules below fix both states.
 */

/* Desktop: fix animation start point */
.admin-bar .masthead--sticky .masthead__wrapper.before-sticky {
    top: -368px; /* -400px + 32px admin bar */
}

/* Desktop: guarantee is-sticky lands below admin bar */
.admin-bar .masthead--sticky .masthead__wrapper.is-sticky {
    top: 32px !important;
}

/* Mobile: WP admin bar is 46px on viewports ≤600px */
@media screen and (max-width: 600px) {
    .admin-bar .masthead--sticky .masthead__wrapper.before-sticky {
        top: -354px; /* -400px + 46px */
    }
    .admin-bar .masthead--sticky .masthead__wrapper.is-sticky {
        top: 46px !important;
    }
}

/* ========================================
   AUTHOR META — BASE LAYOUT
   ======================================== */

.meta56.component56 .post-author-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    line-height: 1.4;
}

.meta56.component56 .post-author-meta p {
    margin: 6px 0;
}

.meta56.component56 .avatar-group {
    display: flex;
    align-items: center;
    margin: 0;
}

/* ========================================
   AVATAR IMAGE + RING
   ======================================== */

.meta56.component56 .avatar img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #E36A5B !important;
    background: #fff;
    box-sizing: border-box;
    display: block;
}

/* ========================================
   MULTI-AUTHOR OVERLAP STACK
   ======================================== */

.meta56.component56 .avatar-group .avatar {
    margin-left: -14px;
    position: relative;
    z-index: 1;
}

.meta56.component56 .avatar-group .avatar:first-child {
    margin-left: 0;
    z-index: 1;
}

.meta56.component56 .avatar-group .avatar:nth-child(2) {
    z-index: 3;
}

.meta56.component56 .avatar-group .avatar:nth-child(3) {
    z-index: 4;
}

/* ========================================
   AUTHOR NAME + LINKS
   ======================================== */

.meta56.component56 .post-author-meta strong {
    font-weight: 600;
}

.meta56.component56 .post-author-meta a {
    color: inherit;
    text-decoration: none;
}

/* ========================================
   MISC
   ======================================== */

img.scaled-image {
    border: 0;
}
