/* ============================================================
   헤어뉴스(/hair-news) — 메인 에디토리얼(home.css .ed-*) 톤을 차용하되
   이 페이지 전용 네임스페이스(.hn-*)로 분리해서 만든다.

   메인의 compact 카드(.hair-news-card--compact)는 인물명+스타일명만 보이지만,
   여기서는 compact=false 이므로 partials/hair_news_card.html 가 렌더하는
   작품명/헤어속성/등록일/원본링크 블록이 전부 살아있다. 그래서 메인 카드를
   그대로 베끼지 않고, 정보 밀도가 높은 채로 라이트 에디토리얼 톤(흰 배경,
   검정 전경, 얇은 헤어라인, 그림자 없음)에 맞춰 새로 짰다.

   .hair-news-card 자체의 클래스명은 partial 계약(메인과 공유)이라 그대로 두고,
   이 파일의 셀렉터는 .hair-news-container 아래로 스코프해서 home.css 의 .ed-*
   규칙과 절대 섞이지 않게 한다.
   ============================================================ */

.hair-news-container {
    --hn-ink: #0f0f0f;
    --hn-ink-dim: #6f6f6f;
    --hn-ink-faint: #a8a5a0;
    --hn-line: #ececea;
    --hn-line-strong: #d6d3ce;
    --hn-accent: #0f0f0f;

    max-width: 1440px;
    margin: 0 auto;
    padding: 32px 24px 96px;
    color: var(--hn-ink);
    font-family: var(--font-sans);
}

/* ---------- 헤더 ---------- */
.hair-news-header {
    text-align: center;
    margin-bottom: 28px;
}

.hair-news-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--hn-ink);
    letter-spacing: -0.01em;
}

.hair-news-subtitle {
    font-size: 14.5px;
    color: var(--hn-ink-dim);
    margin: 0 0 12px;
}

.hair-news-meta {
    font-size: 12.5px;
    color: var(--hn-ink-faint);
    letter-spacing: 0.02em;
}

/* ---------- 필터: 검색창(항상) + 접이식 고급 영역 ---------- */
.hair-news-filters {
    border-top: 1px solid var(--hn-line-strong);
    border-bottom: 1px solid var(--hn-line);
    padding: 16px 0;
    margin-bottom: 28px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.hair-news-filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hair-news-filter-search {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.hair-news-filter-search i {
    position: absolute;
    left: 2px;
    color: var(--hn-ink-faint);
    font-size: 13px;
    pointer-events: none;
}

.hair-news-filter-search input[type="search"] {
    width: 100%;
    padding: 8px 8px 8px 22px;
    border: none;
    border-bottom: 1px solid var(--hn-line-strong);
    border-radius: 0;
    font-size: 14px;
    color: var(--hn-ink);
    background: transparent;
    transition: border-color 0.2s ease;
    outline: none;
}

.hair-news-filter-search input[type="search"]::placeholder {
    color: var(--hn-ink-faint);
}

.hair-news-filter-search input[type="search"]:focus {
    border-color: var(--hn-ink);
}

/* expand 토글 버튼 — 뱃지로 적용된 필터 개수를 보여준다 */
.hair-news-filter-toggle {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid var(--hn-line-strong);
    border-radius: 999px;
    background: #fff;
    color: var(--hn-ink);
    font-family: var(--font-sans);
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease;
    white-space: nowrap;
}

.hair-news-filter-toggle:hover {
    border-color: var(--hn-ink);
}

.hair-news-filter-toggle i {
    font-size: 11px;
    color: var(--hn-ink-dim);
}

.hair-news-filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 17px;
    height: 17px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--hn-ink);
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
    line-height: 1;
}

.hair-news-filter-chevron {
    transition: transform 0.25s ease;
}

.hair-news-filter-toggle.is-expanded .hair-news-filter-chevron {
    transform: rotate(180deg);
}

/* 접이식 영역 — 날짜범위 + 셀렉트 10종 + 리셋 */
.hair-news-filter-advanced {
    padding-top: 16px;
    margin-top: 16px;
    border-top: 1px solid var(--hn-line);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hair-news-filter-advanced[hidden] {
    display: none;
}

.hair-news-filter-dates {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    align-items: flex-end;
}

.hair-news-filter-date {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 150px;
    flex: 0 0 auto;
}

.hair-news-filter-date input[type="date"] {
    padding: 7px 8px;
    border: none;
    border-bottom: 1px solid var(--hn-line-strong);
    background: transparent;
    font-size: 13px;
    color: var(--hn-ink);
    outline: none;
    transition: border-color 0.18s ease;
}

.hair-news-filter-date input[type="date"]:focus,
.hair-news-filter-date input[type="date"]:hover {
    border-color: var(--hn-ink);
}

.hair-news-filter-selects {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    align-items: flex-end;
}

.hair-news-filter-select {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 140px;
    flex: 0 1 auto;
}

.hair-news-filter-label {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--hn-ink-dim);
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.hair-news-filter-select select {
    appearance: none;
    -webkit-appearance: none;
    padding: 7px 22px 7px 2px;
    border: none;
    border-bottom: 1px solid var(--hn-line-strong);
    border-radius: 0;
    background: transparent url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%23a8a5a0' d='M0 0l5 6 5-6z'/></svg>") no-repeat right 2px center;
    font-size: 13px;
    color: var(--hn-ink);
    cursor: pointer;
    outline: none;
    min-width: 140px;
    transition: border-color 0.18s ease;
}

.hair-news-filter-select select:focus,
.hair-news-filter-select select:hover {
    border-color: var(--hn-ink);
}

.hair-news-filter-reset {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid var(--hn-line-strong);
    border-radius: 999px;
    background: #fff;
    color: var(--hn-ink-dim);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    margin-left: auto;
    height: 32px;
}

.hair-news-filter-reset:hover {
    background: var(--hn-ink);
    color: #fff;
    border-color: var(--hn-ink);
}

.hair-news-filter-reset i {
    font-size: 11px;
}

.hair-news-no-matches {
    margin-top: 8px;
}

/* ---------- 그리드: 매거진 인덱스 번호가 붙은 에디토리얼 셀 ---------- */
.hair-news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: clamp(28px, 3vw, 46px) clamp(16px, 2vw, 28px);
    border-top: 1px solid var(--hn-line-strong);
    padding-top: clamp(26px, 3vw, 40px);
}

.hair-news-grid[hidden] {
    display: none;
}

.hair-news-cell {
    position: relative;
    opacity: 0;
    transform: translateY(14px);
    animation: hn-rise 0.6s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
    animation-delay: calc(min(var(--i), 11) * 45ms);
}

.hair-news-cell[hidden] {
    display: none;
}

@keyframes hn-rise {
    to {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hair-news-cell {
        opacity: 1;
        transform: none;
        animation: none;
    }
}

.hair-news-num {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    font-size: 11px;
    letter-spacing: 0.14em;
    color: var(--hn-ink-faint);
    transition: color 0.35s ease;
}

.hair-news-cell:hover .hair-news-num {
    color: var(--hn-ink);
}

/* ---------- 카드 ---------- */
.hair-news-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding-top: 22px;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
    transition: none;
}

.hair-news-card[hidden] {
    display: none;
}

.hair-news-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    background: #fafaf8;
    overflow: hidden;
    border-radius: 0;
}

.hair-news-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: saturate(0.92) contrast(1.04);
    transition: transform 1s cubic-bezier(0.19, 1, 0.22, 1), filter 0.5s ease;
}

.hair-news-cell:hover .hair-news-thumb img {
    transform: scale(1.045);
    filter: saturate(1) contrast(1.04);
}

.hair-news-thumb-empty {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--hn-ink-faint);
    font-size: 32px;
}

.hair-news-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(15, 15, 15, 0.78);
    color: #fff;
    font-size: 10.5px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    letter-spacing: 0.05em;
}

.hair-news-title-logo {
    position: absolute;
    top: 10px;
    right: 10px;
    max-width: 38%;
    max-height: 52px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.hair-news-title-logo img {
    display: block;
    max-width: 100%;
    max-height: 44px;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* ---------- 본문: 정보 밀도가 높으므로 얇은 구획선으로 섹션을 나눈다 ---------- */
.hair-news-card-body {
    padding: 14px 0 0;
    display: flex;
    flex-direction: column;
    gap: 9px;
    flex: 1;
}

.hair-news-card-title {
    font-weight: 700;
    font-size: 16px;
    line-height: 1.32;
    letter-spacing: -0.005em;
    margin: 0;
    color: var(--hn-ink);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hair-news-card-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12.5px;
    color: var(--hn-ink-dim);
}

.hair-news-person {
    font-weight: 600;
    color: var(--hn-ink);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hair-news-context {
    color: var(--hn-ink-dim);
}

.hair-news-context-type {
    display: inline-block;
    font-style: normal;
    font-size: 10px;
    font-weight: 700;
    color: var(--hn-ink);
    background: transparent;
    border: 1px solid var(--hn-line-strong);
    padding: 1px 7px;
    border-radius: 999px;
    margin-right: 6px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    vertical-align: middle;
}

.hair-news-attrs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 8px;
    border-top: 1px solid var(--hn-line);
}

.hair-news-attr {
    font-size: 10.5px;
    background: transparent;
    color: var(--hn-ink-dim);
    padding: 3px 9px;
    border: 1px solid var(--hn-line-strong);
    border-radius: 999px;
    line-height: 1.3;
}

.hair-news-date {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--hn-ink-faint);
}

.hair-news-date i {
    font-size: 10.5px;
    color: var(--hn-ink-faint);
}

.hair-news-card-links {
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    padding-top: 9px;
    border-top: 1px solid var(--hn-line);
}

/* "이 머리 합성해보기" — 메인 카드와 같은 규약(.hair-news-try-btn)이지만, 이 페이지 카드는
   정보를 전부 노출하는 형태라 사진 위에 얹지 않고 본문 맨 아래에 카드 폭으로 둔다.
   링크 줄에 margin-top:auto 가 걸려 있어 이 버튼이 자연히 카드 바닥에 붙는다. */
.hair-news-card .hair-news-try-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 12px;
    padding: 12px 14px;
    border: none;
    border-radius: 2px;
    background: var(--hn-accent);
    color: #ffffff;
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: background-color 0.25s ease;
}

.hair-news-card .hair-news-try-btn:hover {
    background: #000000;
}

.hair-news-card .hair-news-try-btn i {
    font-size: 11px;
}

.hair-news-source-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--hn-ink);
    text-decoration: none;
    letter-spacing: 0.01em;
    padding-bottom: 1px;
    border-bottom: 1px solid var(--hn-line-strong);
    transition: border-color 0.18s ease, color 0.18s ease;
}

.hair-news-source-link i {
    font-size: 10px;
    color: var(--hn-ink-dim);
}

.hair-news-source-link:hover {
    border-color: var(--hn-ink);
}

.hair-news-empty {
    text-align: center;
    padding: 96px 20px;
    color: var(--hn-ink-dim);
    border-top: 1px solid var(--hn-line);
}

.hair-news-empty i {
    font-size: 42px;
    margin-bottom: 16px;
    display: block;
    color: var(--hn-ink-faint);
}

.hair-news-empty p {
    font-size: 14px;
    margin: 0;
}

.hair-news-loading-more {
    text-align: center;
    padding: 32px 20px;
    color: var(--hn-ink-dim);
    font-size: 20px;
}

.hair-news-loading-more[hidden] {
    display: none;
}

/* ---------- 반응형 ---------- */
@media (max-width: 900px) {
    .hair-news-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@media (max-width: 600px) {
    .hair-news-container {
        padding: 20px 14px 72px;
    }

    .hair-news-title {
        font-size: 21px;
    }

    .hair-news-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px 12px;
    }

    .hair-news-card-body {
        padding: 10px 0 0;
        gap: 7px;
    }

    .hair-news-card-title {
        font-size: 13.5px;
    }

    .hair-news-person {
        font-size: 9.5px;
    }

    .hair-news-attrs {
        gap: 4px;
    }

    .hair-news-attr {
        font-size: 9.5px;
        padding: 2px 7px;
    }

    .hair-news-date {
        font-size: 10px;
    }

    .hair-news-card-links {
        gap: 10px;
    }

    .hair-news-source-link {
        font-size: 10.5px;
    }

    .hair-news-title-logo {
        top: 6px;
        right: 6px;
        max-width: 42%;
        max-height: 38px;
        padding: 3px 6px;
    }

    .hair-news-title-logo img {
        max-height: 32px;
    }

    .hair-news-filter-bar {
        gap: 8px;
    }

    .hair-news-filter-toggle span:not(.hair-news-filter-count) {
        display: none;
    }

    .hair-news-filter-toggle {
        padding: 8px 10px;
    }

    .hair-news-filter-selects {
        gap: 10px 8px;
    }

    .hair-news-filter-select {
        min-width: calc(50% - 4px);
        flex: 1 0 calc(50% - 4px);
    }

    .hair-news-filter-select select {
        min-width: 0;
        width: 100%;
    }

    .hair-news-filter-reset {
        margin-left: 0;
        flex: 1 0 100%;
        justify-content: center;
    }

    .hair-news-filter-date {
        min-width: calc(50% - 4px);
        flex: 1 0 calc(50% - 4px);
    }

    .hair-news-filter-date input[type="date"] {
        width: 100%;
    }
}

/* ---------- Admin: selection, edit button, toolbar, modal ---------- */
.hair-news-card-select {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 5;
    cursor: pointer;
    user-select: none;
}

.hair-news-card-select input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.hair-news-select-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.92);
    border: 1.5px solid var(--hn-line-strong, #d1d5db);
    color: transparent;
    font-size: 11px;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.hair-news-card-select:hover .hair-news-select-box {
    border-color: var(--hn-ink);
}

.hair-news-card-select input:checked + .hair-news-select-box {
    background: var(--hn-ink);
    border-color: var(--hn-ink);
    color: #fff;
}

.hair-news-cell:has(.hair-news-card.is-selected) {
    outline: 1px solid var(--hn-ink);
    outline-offset: 4px;
}

.hair-news-card-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 5;
    display: inline-flex;
    gap: 6px;
    padding: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.16);
    opacity: 1;
}

.hair-news-card-action {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: none;
    background: transparent;
    color: var(--hn-ink-dim);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    padding: 0;
    transition: background 0.15s ease, color 0.15s ease;
}

.hair-news-card-edit:hover {
    background: var(--hn-ink);
    color: #fff;
}

.hair-news-card-delete:hover {
    background: #ef4444;
    color: #fff;
}

.hair-news-card-action:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Admin view: ensure controls always visible, never depend on hover.
   When a title-logo would conflict with the top-right action cluster, push it down. */
.hair-news-container[data-is-admin="1"] .hair-news-card-select,
.hair-news-container[data-is-admin="1"] .hair-news-card-actions {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

.hair-news-container[data-is-admin="1"] .hair-news-title-logo {
    top: auto;
    bottom: 10px;
}

.hair-news-container[data-is-admin="1"] .hair-news-badge {
    left: 38px;
}

.hair-news-admin-toolbar {
    position: sticky;
    top: 10px;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--hn-ink);
    color: #fff;
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 16px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.hair-news-admin-selected {
    font-size: 13px;
    margin-right: auto;
    color: #e5e7eb;
}

.hair-news-admin-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    line-height: 1;
}

.hair-news-admin-btn-primary {
    background: var(--hn-ink);
    color: #fff;
}

.hair-news-admin-btn-primary:hover {
    background: #000;
}

.hair-news-admin-btn-secondary {
    background: #fff;
    color: var(--hn-ink);
    border-color: var(--hn-line-strong);
}

.hair-news-admin-btn-secondary:hover {
    background: #f3f4f6;
}

.hair-news-admin-btn-danger {
    background: #ef4444;
    color: #fff;
}

.hair-news-admin-btn-danger:hover {
    background: #dc2626;
}

.hair-news-admin-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Modal */
.hair-news-modal {
    position: fixed;
    inset: 0;
    /* Sit above the sticky top header (z-index 100) and the fixed mobile
       bottom menu bar (#mobile-bottom-menu, z-index 1000) so the modal's
       top/bottom (close + save buttons) are never hidden behind those bars. */
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.hair-news-modal[hidden] {
    display: none;
}

.hair-news-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 15, 15, 0.55);
    backdrop-filter: blur(2px);
}

.hair-news-modal-dialog {
    position: relative;
    background: #fff;
    width: 100%;
    max-width: 720px;
    max-height: 92vh;
    border-radius: 14px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.28);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.hair-news-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--hn-line);
}

.hair-news-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--hn-ink);
}

.hair-news-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: var(--hn-ink-dim);
    padding: 6px;
    border-radius: 6px;
}

.hair-news-modal-close:hover {
    background: #f3f4f6;
    color: var(--hn-ink);
}

.hair-news-modal-body {
    padding: 16px 18px;
    overflow-y: auto;
    flex: 1;
}

.hair-news-modal-section {
    margin-bottom: 18px;
}

.hair-news-modal-section h4 {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 700;
    color: var(--hn-ink);
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.hair-news-modal-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 8px;
}

.hair-news-modal-row-full {
    grid-template-columns: 1fr;
}

.hair-news-modal-body label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: var(--hn-ink-dim);
}

.hair-news-modal-body label > span {
    font-weight: 600;
    color: var(--hn-ink-dim);
}

.hair-news-modal-body textarea {
    resize: vertical;
    font-family: inherit;
    line-height: 1.5;
}

.hair-news-modal-hint {
    margin: -2px 0 8px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--hn-ink-dim);
}

.hair-news-modal-body input,
.hair-news-modal-body textarea {
    border: 1px solid var(--hn-line-strong);
    border-radius: 7px;
    padding: 8px 10px;
    font-size: 13px;
    color: var(--hn-ink);
    background: #fafbfc;
    outline: none;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.hair-news-modal-body input:focus,
.hair-news-modal-body textarea:focus {
    border-color: var(--hn-ink);
    background: #fff;
}

.hair-news-modal-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    border-radius: 7px;
    padding: 8px 12px;
    font-size: 12.5px;
    margin: 8px 0 0;
}

.hair-news-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 18px;
    border-top: 1px solid var(--hn-line);
    background: #f9fafb;
}

@media (max-width: 600px) {
    .hair-news-modal-row {
        grid-template-columns: 1fr;
    }

    /* Anchor to the top so the dialog rises to the very top of the screen
       and the container can scroll if anything still overflows. */
    .hair-news-modal {
        padding: 0;
        align-items: flex-start;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Use the dynamic viewport height (dvh) so the footer (Save button) is
       never hidden behind the mobile browser's address/toolbar chrome. */
    .hair-news-modal-dialog {
        width: 100%;
        border-radius: 0;
        height: 100vh;        /* fallback for browsers without dvh */
        height: 100dvh;
        max-height: 100vh;    /* fallback */
        max-height: 100dvh;
    }
}
