/* ============================================================
   Admin Home Page editor (views/admin_home_page.html): toolbar,
   language tabs, the form on the left and the live preview on
   the right (layout B). Tokens from site.css.
   ============================================================ */

.admin-home-page { padding-bottom: 40px; }
.admin-home-page .ahp-sp { flex: 1; }

/* Toolbar + tabs stay in view while the form scrolls, below the fixed
   site header (#mainNav, --pp-header-h tall). The bar is 50px, the tabs 44px. */
.admin-home-page .ahp-bar {
    position: sticky; top: var(--pp-header-h, 64px); z-index: 20;
    display: flex; align-items: center; gap: 10px; height: 50px; box-sizing: border-box;
    background: #242424; color: #eee;
    padding: 10px 16px; border-radius: 6px 6px 0 0;
}
.admin-home-page .ahp-title {
    margin: 0; font-size: 18px; font-weight: 600; color: #fff;
}
.admin-home-page .ahp-bar .dirty-pill {
    font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
    background: #e8912d; color: #1a1a1a; border-radius: 4px; padding: 2px 6px; font-weight: 600;
}

.admin-home-page .ahp-tabs {
    position: sticky; top: calc(var(--pp-header-h, 64px) + 50px); z-index: 19;
    display: flex; align-items: flex-end; gap: 2px; height: 44px; box-sizing: border-box;
    background: #fff; border-bottom: 1px solid #e6e6e6;
    padding: 8px 16px 0;
}
.admin-home-page .ahp-tab {
    background: none; border: 0; border-bottom: 2px solid transparent;
    padding: 6px 12px; color: #5c5c5c; font-size: 14px;
}
.admin-home-page .ahp-tab:hover { color: #1a1a1a; }
.admin-home-page .ahp-tab.on { border-bottom-color: #a32512; color: #1a1a1a; font-weight: 600; }
.admin-home-page .ahp-tab:focus-visible { outline: 2px solid #a32512; outline-offset: 1px; }
.admin-home-page .stale-dot {
    display: inline-block; width: 7px; height: 7px; border-radius: 50%;
    background: #e8912d; margin-left: 5px; vertical-align: middle;
}
.admin-home-page .ahp-translate { margin-bottom: 6px; }

/* Two columns: form | preview */
.admin-home-page .ahp-cols {
    display: flex; align-items: flex-start; gap: 16px;
    background: #f6f6f4; padding: 16px; border-radius: 0 0 6px 6px;
}
.admin-home-page .ahp-form { flex: 1 1 48%; min-width: 0; }
.admin-home-page .ahp-preview-col {
    flex: 1 1 52%; min-width: 0;
    position: sticky; top: calc(var(--pp-header-h, 64px) + 104px);
    max-height: calc(100vh - var(--pp-header-h, 64px) - 120px); overflow-y: auto;
    background: #fff; border: 1px solid #e6e6e6; border-radius: 6px;
}
.admin-home-page .ahp-preview-label {
    position: sticky; top: 0; z-index: 2;
    font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600;
    color: #5c5c5c; background: #f9f9f7; border-bottom: 1px solid #e6e6e6; padding: 6px 10px;
}
.admin-home-page .ahp-preview { overflow: hidden; background: #ececea; }
.admin-home-page .ahp-preview [data-home-section] { cursor: pointer; }
.admin-home-page .ahp-preview [data-home-section]:hover { outline: 3px dashed #a32512; outline-offset: -3px; }

/* Form blocks */
.admin-home-page .ahp-block {
    background: #fff; border: 1px solid #e6e6e6; border-radius: 6px;
    padding: 12px 14px 14px; margin: 0 0 12px;
    scroll-margin-top: calc(var(--pp-header-h, 64px) + 104px);
    transition: box-shadow .3s, border-color .3s;
}
.admin-home-page .ahp-block legend {
    float: left; width: 100%; border: 0; margin: 0 0 8px; padding: 0;
    font-size: 15px; font-weight: 600; color: #1a1a1a;
}
.admin-home-page .ahp-block legend + * { clear: both; }
.admin-home-page .ahp-block.ahp-flash { border-color: #a32512; box-shadow: 0 0 0 3px #e3c5c0; background: #fdf8f7; }
.admin-home-page .ahp-block.ahp-hidden > :not(legend):not(.ahp-hide) { opacity: .55; }

.admin-home-page .ahp-hide { display: block; font-weight: normal; color: #4a4a4a; margin-bottom: 8px; }
.admin-home-page .ahp-field { margin-bottom: 8px; }
.admin-home-page .ahp-label,
.admin-home-page .ahp-group-label,
.admin-home-page .ahp-seconds {
    display: block; margin: 0 0 3px;
    font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; color: #5c5c5c;
}
.admin-home-page .form-control { border-color: #c8c8c8; border-radius: 4px; box-shadow: none; }
.admin-home-page .form-control:focus { outline: 2px solid #a32512; outline-offset: 1px; border-color: #c8c8c8; }
.admin-home-page .ahp-hint { display: block; font-size: 11px; color: #5c5c5c; margin-top: 2px; }
.admin-home-page .ahp-missing { display: block; font-size: 12px; font-weight: 600; color: #a32512; margin-top: 2px; }

.admin-home-page .ahp-group { border-left: 3px solid #ececea; padding-left: 10px; margin: 4px 0 10px; }

/* Repeating lists */
.admin-home-page .ahp-list { margin: 4px 0 12px; }
.admin-home-page .ahp-items { list-style: none; padding: 0; margin: 0 0 6px; }
.admin-home-page .ahp-item {
    background: #f9f9f7; border: 1px solid #e6e6e6; border-radius: 6px;
    padding: 6px 10px 2px; margin-bottom: 6px;
}
.admin-home-page .ahp-item-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.admin-home-page .ahp-item-num { font-size: 12px; font-weight: 600; color: #4a4a4a; text-transform: capitalize; }
.admin-home-page .ahp-line { display: flex; align-items: center; gap: 8px; padding: 4px 8px; }
.admin-home-page .handle { cursor: move; color: #5c5c5c; padding: 2px 4px; }
.admin-home-page .ahp-remove { font-size: 15px; line-height: 1; padding: 1px 7px; }
.admin-home-page .ui-sortable-helper { box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 8px 24px rgba(0,0,0,.06); }
.admin-home-page .ui-sortable-placeholder { visibility: visible !important; background: #fdf8f7; border: 1px dashed #e3c5c0; }

/* Slider */
.admin-home-page .ahp-slides { list-style: none; padding: 0; margin: 0 0 10px; }
.admin-home-page .ahp-slide {
    display: flex; align-items: center; gap: 10px;
    background: #f9f9f7; border: 1px solid #e6e6e6; border-radius: 6px;
    padding: 6px 10px; margin-bottom: 6px;
}
.admin-home-page .ahp-slide-num {
    flex: none; width: 22px; height: 22px; border-radius: 50%;
    background: #242424; color: #fff; font-size: 12px; font-weight: 600;
    display: flex; align-items: center; justify-content: center;
}
.admin-home-page .ahp-thumb { flex: none; width: 96px; height: 32px; object-fit: cover; border-radius: 4px; background: #ececea; }
.admin-home-page .ahp-slide-meta { flex: 1; min-width: 0; }
.admin-home-page .ahp-filename { font-size: 12px; color: #4a4a4a; word-break: break-all; margin-bottom: 3px; }
.admin-home-page .ahp-empty { padding: 10px; color: #5c5c5c; font-style: italic; }
.admin-home-page .ahp-slider-row { display: flex; align-items: flex-end; gap: 10px; }
.admin-home-page .ahp-seconds { margin: 0; }
.admin-home-page .ahp-seconds input { width: 90px; margin-top: 3px; }
.admin-home-page .ahp-seconds.has-error input { border-color: #a32512; }

/* File inputs hide inside their label button. */
.admin-home-page .ahp-upload-btn { position: relative; overflow: hidden; margin: 0; }
.admin-home-page .ahp-upload-btn input[type=file] {
    position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%;
}
.admin-home-page .ahp-image-pick { display: flex; gap: 8px; align-items: center; }
.admin-home-page .ahp-image-pick select { flex: 1; min-width: 0; }

/* Quill (inline toolbar) */
.admin-home-page .ql-toolbar.ql-snow { border-color: #c8c8c8; border-radius: 4px 4px 0 0; padding: 4px 6px; }
.admin-home-page .ql-container.ql-snow { border-color: #c8c8c8; border-radius: 0 0 4px 4px; font: inherit; }
.admin-home-page .ql-editor { min-height: 70px; font-size: 14px; }

/* Orphans */
.admin-home-page .ahp-orphans ul { list-style: none; padding: 0; margin: 0; }
.admin-home-page .ahp-orphans li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid #ececea; }
.admin-home-page .ahp-orphans li:first-child { border-top: 0; }
.admin-home-page .ahp-dims { font-size: 12px; color: #5c5c5c; }

/* Narrow screens: the preview drops below the form. */
@media (max-width: 991px) {
    .admin-home-page .ahp-cols { flex-direction: column; }
    .admin-home-page .ahp-form, .admin-home-page .ahp-preview-col { flex-basis: auto; width: 100%; }
    .admin-home-page .ahp-preview-col { position: static; max-height: none; }
}
