/**
 * Fireflame Planer v2 — Section Home (Дом и офис)
 * Фэншуй помещений + Ремонт
 */

/* ── Заголовок раздела ── */
.fja-section-home__header {
    margin-bottom: var(--fja-spacing-lg);
}

.fja-section-home__title {
    font-family: var(--fja-font-heading);
    font-size: 52px;
    font-weight: 300;
    color: var(--fja-color-text);
    line-height: 1.1;
    margin-bottom: 6px;
}

/* ── Вводный текст ── */
.fja-home-intro p {
    font-size: 13px;
    line-height: 1.6;
    color: var(--fja-color-text);
    margin-bottom: var(--fja-spacing-xs);
}

.fja-home-intro p:last-child {
    margin-bottom: 0;
}

.fja-home-intro__hint {
    font-size: 12px !important;
    color: var(--fja-color-text-muted) !important;
    margin-top: var(--fja-spacing-xs) !important;
}

/* ── Легенда цветов ── */
.fja-home-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px var(--fja-spacing-md);
    margin: var(--fja-spacing-xs) 0;
    font-size: 12px;
    color: var(--fja-color-text-muted);
}

.fja-home-legend__item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.fja-home-legend__dot {
    width: 11px;
    height: 11px;
    border-radius: 2px;
    flex-shrink: 0;
    display: inline-block;
}

.fja-home-legend__dot--favorable   { background: #c6ffc2; border: 1px solid #8fca9f; }
.fja-home-legend__dot--neutral      { background: #ffffff; border: 1px solid #cccccc; }
.fja-home-legend__dot--unfavorable  { background: #f5f5f5; border: 1px solid #aaaaaa; }
.fja-home-legend__dot--dangerous    { background: #d0d0d0; border: 1px solid #999999; }

/* ══════════════════════════════════════════════
   ТАБЛИЦА ЗВЁЗД — структура точно как в оригинале
   .fja-stars-table-wrapper { position: relative }
     <table>
     <div class="fja-compass-labels"> (абсолютно)
   ══════════════════════════════════════════════ */

.fja-stars-table-wrapper {
    position: relative;
    margin: 30px auto;
    max-width: 300px;
    overflow: visible; /* чтобы метки сторон света не обрезались */
}

.fja-stars-grid-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-radius: 12px;
    overflow: hidden;
}

/* Закругляем углы таблицы */
.fja-stars-grid-table tbody tr:first-child td:first-child { border-top-left-radius: 12px; }
.fja-stars-grid-table tbody tr:first-child td:last-child  { border-top-right-radius: 12px; }
.fja-stars-grid-table tbody tr:last-child  td:first-child { border-bottom-left-radius: 12px; }
.fja-stars-grid-table tbody tr:last-child  td:last-child  { border-bottom-right-radius: 12px; }

.fja-sector-cell {
    width: 33.333%;
    height: 120px;
    padding: 0;
    border: 1px solid #cccccc;
    background: white;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.fja-sector-cell:hover {
    transform: scale(1.02);
    z-index: 1;
    box-shadow: 0 0 15px rgba(139, 111, 71, 0.2);
}

/* Активная (выбранная) ячейка */
.fja-sector-cell--active {
    box-shadow: inset 0 0 0 2px var(--fja-color-text) !important;
    z-index: 2;
    transform: none !important;
}

/* Центр */
.fja-sector-cell--center {
    background: #fdfcfb !important;
}

/* Цветовая заливка — точно как в оригинале */
.fja-sector-cell--favorable   { background: #c6ffc2; }
.fja-sector-cell--unfavorable { background: #f5f5f5; }
.fja-sector-cell--dangerous   { background: #d0d0d0; }
.fja-sector-cell--neutral     { background: #ffffff; }

.fja-sector-cell--favorable:hover   { background: #c3e6cb !important; }
.fja-sector-cell--unfavorable:hover { background: #eeeeee !important; }
.fja-sector-cell--dangerous:hover   { background: #c0c0c0 !important; }
.fja-sector-cell--neutral:hover     { background: #f9f9f9 !important; }

/* Содержимое ячейки */
.fja-stars-content {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding-bottom: 20px;
    gap: 8px;
}

/* Большая цифра — звезда года */
.fja-star-year {
    font-size: 38px;
    font-weight: 500;
    line-height: 1;
}

/* Маленькая цифра в кружке — звезда месяца */
.fja-star-month {
    font-size: 22px;
    font-weight: 600;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid #c2c2c2;
    margin-bottom: 20px;
}

/* ── Метки сторон света — абсолютно внутри враппера ── */
.fja-compass-labels {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.fja-compass-label {
    position: absolute;
    font-family: var(--fja-font-title);
    font-size: 12px;
    font-weight: 500;
    color: var(--fja-color-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.fja-compass-label--top {
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
}

.fja-compass-label--bottom {
    bottom: -21px;
    left: 50%;
    transform: translateX(-50%);
}

.fja-compass-label--left {
    left: -32px;
    top: 50%;
    transform: translateY(-50%);
}

.fja-compass-label--right {
    right: -29px;
    top: 50%;
    transform: translateY(-50%);
}

/* ── Блок описания сектора ── */
.fja-sector-info {
    border: var(--fja-border);
    border-radius: var(--fja-border-radius-lg);
    background: var(--fja-color-bg);
    overflow: hidden;
}

.fja-sector-info__header {
    padding: var(--fja-spacing-md) var(--fja-spacing-lg);
    background: var(--fja-color-beige-light);
    border-bottom: var(--fja-border);
}

.fja-sector-info__header-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 6px;
}

.fja-sector-info__name {
    font-family: var(--fja-font-heading);
    font-size: 26px;
    font-weight: 300;
    color: var(--fja-color-text);
}

.fja-sector-info__meta {
    display: flex;
    align-items: center;
    gap: var(--fja-spacing-sm);
    flex-wrap: wrap;
}

.fja-sector-info__stars {
    font-size: 12px;
    color: var(--fja-color-text-muted);
    font-family: var(--fja-font-title);
}

.fja-sector-info__type {
    font-family: var(--fja-font-title);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: var(--fja-border-radius-sm);
}

.fja-sector-info__type--favorable   { background: #c6ffc2; color: #1a5a38; }
.fja-sector-info__type--neutral      { background: #f5f5f5; color: var(--fja-color-text-muted); }
.fja-sector-info__type--unfavorable  { background: #eeeeee; color: #5a4a3a; }
.fja-sector-info__type--dangerous    { background: #d0d0d0; color: #3a3a3a; }

.fja-sector-info__close {
    background: none;
    border: var(--fja-border);
    border-radius: 50%;
    width: 26px;
    height: 26px;
    font-size: 16px;
    line-height: 1;
    color: var(--fja-color-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    flex-shrink: 0;
    font-family: var(--fja-font-body);
}

.fja-sector-info__close:hover {
    background: var(--fja-color-beige);
    color: var(--fja-color-text);
}

.fja-sector-info__body {
    padding: var(--fja-spacing-md) var(--fja-spacing-lg);
    display: flex;
    flex-direction: column;
    gap: var(--fja-spacing-md);
}

/* ── Блоки Влияние / Коррекция / Активация ── */
.fja-sector-block {
    border-left: 3px solid var(--fja-color-beige);
    padding-left: var(--fja-spacing-md);
}

.fja-sector-block--influence  { border-left-color: var(--fja-color-beige-dark); }
.fja-sector-block--correction { border-left-color: #8fca9f; }
.fja-sector-block--activation { border-left-color: var(--fja-color-violet); }

.fja-sector-block__title {
    font-family: var(--fja-font-title);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--fja-color-text-muted);
    margin-bottom: var(--fja-spacing-xs);
}

/* ══════════════════════════════════════════════
   КОМПАС 24 ГОР — структура точно как в оригинале
   .fja-compass-24-wrapper { position: relative }
     <img class="fja-compass-base">
     <svg class="fja-compass-overlay"> (абсолютно)
   ══════════════════════════════════════════════ */

.fja-compass-24-wrapper {
    position: relative;
    max-width: 400px;
    margin: 40px auto;
    aspect-ratio: 1 / 1;
}

.fja-compass-base {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.fja-compass-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.fja-sector-mask {
    fill: transparent;
    transition: fill 0.3s ease;
}

.fja-sector-mask--danger {
    fill: rgba(180, 180, 180, 0.4);
}

/* ── Список опасных секторов ── */
.fja-dangerous-sectors__title {
    font-size: 13px;
    color: var(--fja-color-text-muted);
    margin-bottom: var(--fja-spacing-sm);
}

.fja-dangerous-sectors__tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--fja-spacing-xs) var(--fja-spacing-sm);
}

.fja-dangerous-sectors__tag {
    display: inline-block;
    background: white;
    color: #555555;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid hsla(0, 100%, 60%, 0.6);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* ── Блок советов по ремонту ── */
.fja-remont-tips__title {
    font-family: var(--fja-font-title);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--fja-color-text-muted);
    margin-bottom: var(--fja-spacing-sm);
}

/* ══════════════════════════════════════════════
   МОБИЛЬНАЯ АДАПТАЦИЯ 768px
   ══════════════════════════════════════════════ */
@media (max-width: 768px) {

    .fja-section-home__title {
        font-size: 30px;
        font-weight: 500;
    }

    .fja-stars-table-wrapper {
        max-width: 98%;
        padding: 5px;
        overflow: visible;
    }

    .fja-compass-labels {
        display: block !important;
    }

    .fja-compass-label {
        font-size: 11px;
        font-weight: 700;
        letter-spacing: 0.5px;
    }

    .fja-compass-label--top    { top: -20px; }
    .fja-compass-label--bottom { bottom: 5px; }

    .fja-compass-label--left {
        left: -15px;
        transform: translateY(-50%) rotate(-90deg);
        transform-origin: center;
    }

    .fja-compass-label--right {
        right: -15px;
        transform: translateY(-50%) rotate(90deg);
        transform-origin: center;
    }

    .fja-sector-cell {
        height: 100px;
        min-height: 100px;
    }

    .fja-stars-content {
        padding-bottom: 10px;
        gap: 5px;
    }

    .fja-star-year {
        font-size: 32px;
        font-weight: 600;
    }

    .fja-star-month {
        font-size: 20px;
        width: 35px;
        height: 35px;
        margin-bottom: 0;
    }

    .fja-sector-info__body {
        padding: var(--fja-spacing-md);
    }

    .fja-compass-24-wrapper {
        max-width: 100%;
        margin-left: 16px;
        margin-right: 16px;
    }
}

/* ══════════════════════════════════════════════
   МОБИЛЬНАЯ АДАПТАЦИЯ 480px
   ══════════════════════════════════════════════ */
@media (max-width: 480px) {

    .fja-sector-cell {
        height: 90px;
        min-height: 90px;
    }

    .fja-star-year  { font-size: 28px; }

    .fja-star-month {
        font-size: 18px;
        width: 32px;
        height: 32px;
    }

    .fja-stars-content {
        padding-bottom: 18px;
        height: 72px;
    }

    .fja-compass-label { font-size: 10px; font-weight: 700; }
    .fja-compass-label--left  { left: -32px; }
    .fja-compass-label--right { right: -30px; }
}