/*
 * BFH Single Perfume Shell (single.css)
 *
 * Page frame for templates/single-bfh_perfume.php: the two-column body, the
 * tab bar, and the section/card primitives every content partial reuses.
 * The partials themselves are styled in detail.css and sidebar.css so each
 * file stays readable and an Elementor widget can pull in only what it needs.
 */

.bfh-single {
    background-color: var(--bfh-bg-page);
    color: var(--bfh-text-primary);
    font-family: var(--bfh-font-sans);
    line-height: 1.6;
}

.bfh-single__body {
    padding-block: var(--bfh-space-6) var(--bfh-space-10);
}

.bfh-single__layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: var(--bfh-space-6);
    align-items: start;
}

.bfh-single__content {
    display: flex;
    flex-direction: column;
    gap: var(--bfh-space-6);
    min-width: 0;
}

.bfh-single__sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--bfh-space-5);
    /* Sticky so the rating summary and share row stay reachable through a long
       notes/reviews column, but never taller than the viewport. */
    position: sticky;
    top: var(--bfh-space-5);
    max-height: calc(100vh - var(--bfh-space-8));
    overflow-y: auto;
    scrollbar-width: thin;
}

.bfh-single__sidebar::-webkit-scrollbar {
    width: 6px;
}

.bfh-single__sidebar::-webkit-scrollbar-thumb {
    background-color: var(--bfh-border);
    border-radius: var(--bfh-radius-pill);
}

/* -------------------- Tab bar -------------------- */
.bfh-tabs {
    position: sticky;
    top: 0;
    z-index: var(--bfh-z-sticky);
    margin-bottom: var(--bfh-space-6);
    background-color: var(--bfh-surface-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: var(--bfh-border-width) solid var(--bfh-border);
}

.bfh-tabs__list {
    display: flex;
    gap: var(--bfh-space-5);
    margin: 0;
    padding: 0;
    list-style: none;
    /* The design shows seven tabs; on a narrow viewport they scroll sideways
       rather than wrapping into a second row that would break the sticky bar. */
    overflow-x: auto;
    scrollbar-width: none;
}

.bfh-tabs__list::-webkit-scrollbar {
    display: none;
}

.bfh-tabs__item {
    margin: 0;
    flex: 0 0 auto;
}

.bfh-tabs__link {
    display: block;
    padding: var(--bfh-space-4) 0;
    border-bottom: 2px solid transparent;
    color: var(--bfh-text-secondary);
    font-size: var(--bfh-text-xs);
    font-weight: var(--bfh-font-weight-semibold);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    transition: color var(--bfh-anim-fast), border-color var(--bfh-anim-fast);
}

.bfh-tabs__link:hover {
    color: var(--bfh-text-primary);
}

.bfh-tabs__link.is-active,
.bfh-tabs__link[aria-selected="true"] {
    color: var(--bfh-color-primary);
    border-bottom-color: var(--bfh-color-primary);
}

.bfh-tabs__link:focus-visible {
    outline: 2px solid var(--bfh-color-primary);
    outline-offset: 4px;
}

/* -------------------- Section & card primitives -------------------- */
.bfh-section {
    scroll-margin-top: var(--bfh-space-10);
}

.bfh-section__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--bfh-space-4);
    flex-wrap: wrap;
    margin-bottom: var(--bfh-space-5);
}

/* Both headings share their type scale; only .bfh-section__title gets the
   bottom margin, because .bfh-section__head already spaces its own row. */
.bfh-section__title,
.bfh-card__title {
    font-family: var(--bfh-font-serif);
    font-weight: var(--bfh-font-weight-semibold);
    color: var(--bfh-text-primary);
}

.bfh-section__title {
    margin: 0 0 var(--bfh-space-5);
    font-size: var(--bfh-text-2xl);
}

.bfh-section__head .bfh-section__title {
    margin-bottom: 0;
}

.bfh-card__title {
    margin: 0 0 var(--bfh-space-4);
    font-size: var(--bfh-text-lg);
}

.bfh-section__subtitle {
    margin: calc(var(--bfh-space-5) * -1) 0 var(--bfh-space-5);
    font-size: var(--bfh-text-sm);
    color: var(--bfh-text-secondary);
}

.bfh-section__lede {
    margin: 0 0 var(--bfh-space-5);
    font-size: var(--bfh-text-base);
    color: var(--bfh-text-secondary);
}

.bfh-section__meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--bfh-space-3) var(--bfh-space-6);
    margin: var(--bfh-space-5) 0 0;
    padding-top: var(--bfh-space-5);
    border-top: var(--bfh-border-width) solid var(--bfh-border);
}

.bfh-section__meta-label {
    display: block;
    font-size: var(--bfh-text-xs);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--bfh-text-muted);
}

.bfh-section__meta-value {
    display: block;
    margin-top: 2px;
    font-size: var(--bfh-text-sm);
    font-weight: var(--bfh-font-weight-medium);
    color: var(--bfh-text-primary);
}

/* -------------------- Accord chips -------------------- */
.bfh-accords {
    display: flex;
    flex-wrap: wrap;
    gap: var(--bfh-space-2);
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Weighted variant: one accord per row so the bars line up and compare. */
.bfh-accords--bars {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: var(--bfh-space-3);
}

.bfh-accord {
    display: grid;
    grid-template-columns: minmax(6rem, 8rem) 1fr auto;
    align-items: center;
    gap: var(--bfh-space-3);
}

.bfh-accord__label {
    font-size: var(--bfh-text-sm);
    font-weight: var(--bfh-font-weight-medium);
    color: var(--bfh-text-primary);
}

.bfh-accord__label a {
    color: inherit;
    text-decoration: none;
}

.bfh-accord__label a:hover,
.bfh-accord__label a:focus-visible {
    color: var(--bfh-color-primary);
}

.bfh-accord__track {
    display: block;
    height: 8px;
    border-radius: var(--bfh-radius-pill);
    background: var(--bfh-surface-hover);
    overflow: hidden;
}

.bfh-accord__bar {
    display: block;
    height: 100%;
    border-radius: var(--bfh-radius-pill);
    transition: width var(--bfh-anim-slow) ease-out;
}

/* The fill colour comes from the .bfh-accord-{slug} palette in components.css;
   this only covers a slug that palette doesn't know. */
.bfh-accord__bar:not([class*="bfh-accord-"]) {
    background-color: var(--bfh-color-primary);
}

.bfh-accord__value {
    font-size: var(--bfh-text-xs);
    font-weight: var(--bfh-font-weight-semibold);
    color: var(--bfh-text-secondary);
    font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: reduce) {
    .bfh-accord__bar {
        transition: none;
    }
}

@media (max-width: 480px) {
    .bfh-accord {
        grid-template-columns: 1fr auto;
    }

    .bfh-accord__track {
        grid-column: 1 / -1;
        order: 3;
    }
}

/* -------------------- Shared star rating -------------------- */
.bfh-rating {
    display: flex;
    align-items: center;
    gap: var(--bfh-space-2);
    flex-wrap: wrap;
}

.bfh-rating__stars {
    display: inline-flex;
    gap: 2px;
    font-size: var(--bfh-text-base);
    line-height: 1;
}

.bfh-rating__star {
    color: var(--bfh-rating-empty);
}

.bfh-rating__star.is-full {
    color: var(--bfh-rating-filled);
}

/* A gradient rather than a second glyph, so a half star needs no extra markup
   and still reads as one character wide. */
.bfh-rating__star.is-half {
    background-image: linear-gradient(
        90deg,
        var(--bfh-rating-filled) 50%,
        var(--bfh-rating-empty) 50%
    );
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.bfh-rating__value {
    font-size: var(--bfh-text-sm);
    font-weight: var(--bfh-font-weight-semibold);
    color: var(--bfh-text-primary);
    font-variant-numeric: tabular-nums;
}

.bfh-rating__count {
    font-size: var(--bfh-text-sm);
    color: var(--bfh-text-secondary);
}

.bfh-rating--compact .bfh-rating__stars {
    font-size: var(--bfh-text-sm);
}

.bfh-rating--compact .bfh-rating__value {
    font-size: var(--bfh-text-xs);
}

/* -------------------- Responsive -------------------- */
@media (max-width: 1024px) {
    .bfh-single__layout {
        grid-template-columns: minmax(0, 1fr);
    }

    /* Unpinned once the sidebar sits below the content: a sticky element in
       normal flow would otherwise hover over the footer. */
    .bfh-single__sidebar {
        position: static;
        max-height: none;
        overflow: visible;
    }
}

@media (max-width: 600px) {
    .bfh-tabs__list {
        gap: var(--bfh-space-4);
    }

    .bfh-section__title {
        font-size: var(--bfh-text-xl);
    }
}
