/* ==========================================================================
   Page-Specific: BasicEdit.aspx & ContentBlockEdit_Image.aspx
   Clean, focused content editor
   ========================================================================== */

/* --- Page Title --- */
div.formPlaceHolder > b {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

/* --- Instruction text --- */
div.formPlaceHolder > b + br + span.instructionText {
    display: block;
    margin-bottom: 0;
    font-size: 13px;
}

/* --- Action Buttons Bar (Add New / Delete) --- */
div.formPlaceHolder > div.formElement > div[style*="width: 700px"] {
    width: 100% !important;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* --- Collapsible Section Header --- */
div.formPlaceHolder > div.formElement[onclick] {
    cursor: pointer;
    padding: 12px 16px;
    margin: -20px -24px;
    margin-bottom: 0;
    background-color: var(--body-bg);
    border-bottom: 1px solid var(--border);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    transition: background-color var(--transition);
    display: flex;
    align-items: center;
}

div.formPlaceHolder > div.formElement[onclick]:hover {
    background-color: var(--primary-light);
}

/* Plus/Minus container */
div.formPlaceHolder > div.formElement[onclick] div.plusminus {
    width: 26px;
    height: 26px;
    border-radius: var(--radius);
    background-color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
}

div.formPlaceHolder > div.formElement[onclick] div.plusminus img {
    display: none;
}

/* Section heading text */
div.formPlaceHolder > div.formElement[onclick] div.blue_heading {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.4px;
    color: var(--text-primary);
}

/* --- Form Fields (Content Details section) --- */
div#ContentDetailsBlock div.formElement {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

div#ContentDetailsBlock div.formElement:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

/* Form labels */
div#ContentDetailsBlock div.formElementLabel,
div#ArtPageFilesBlock div.formElementLabel {
    min-width: 130px;
    width: 130px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    padding-top: 8px;
}

/* Files section: allow labels + fields to wrap on new lines */
div#ArtPageFilesBlock div.formElement {
    display: block;
}

/* --- TinyMCE Editor Container --- */
div#TextContent {
    padding: 8px 0 16px 0 !important;
    width: 100%;
}

div#TextContent > div[style*="width: 700px"] {
    width: 100% !important;
}

div#TextContent textarea {
    width: 100% !important;
    border: 1px solid var(--border-input) !important;
    border-radius: var(--radius-md) !important;
}

/* --- File/Embed content sections --- */
div#FileContent,
div#EmbedContent {
    padding: 14px;
    background-color: var(--body-bg);
    border-radius: var(--radius-md);
    border: 1px dashed var(--border-input);
    margin-top: 8px;
}

/* ==========================================================================
   File Repeater Items (FILES section) — table-based aligned layout
   Row 1: File Name header
   Row 2: Upload: [Choose File]   Author: [input]
   Row 3: Caption: [textarea spanning wide]
   ========================================================================== */
/* Each file block is a clean, subtle card — soft border, light fill,
   gentle alternating tint (consistent with the rest of the admin) */
div#ArtPageFilesBlock .file-card {
    width: 100% !important;
    box-sizing: border-box;
    padding: 16px 18px !important;
    margin: 0 0 10px 0 !important;
    /* Normal block: white card */
    background-color: var(--card-bg) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: none !important;
    display: block;
    transition: background-color var(--transition), border-color var(--transition);
}

div#ArtPageFilesBlock .file-card:hover {
    border-color: #cbd5e1 !important;
}

/* Alternating block: very light gray fill for a subtle distinction */
div#ArtPageFilesBlock .file-card.file-card-alt {
    background-color: var(--body-bg) !important;
}

div#ArtPageFilesBlock .file-card.file-card-alt:hover {
    border-color: #cbd5e1 !important;
}

/* File Name header */
div#ArtPageFilesBlock .file-card-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 10px;
}

div#ArtPageFilesBlock .file-card-title a {
    color: var(--primary);
    font-weight: 500;
    text-decoration: none;
    word-break: break-all;
}

div#ArtPageFilesBlock .file-card-title a:hover {
    text-decoration: underline;
}

/* --- Field table (label | field | label | field) --- */
div#ArtPageFilesBlock table.file-fields {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: transparent;
    box-shadow: none;
    border: none;
    table-layout: auto;
}

div#ArtPageFilesBlock table.file-fields td {
    padding: 4px 8px 4px 0;
    border: none;
    background: transparent;
    vertical-align: middle;
    white-space: normal;
}

/* Label cells */
div#ArtPageFilesBlock table.file-fields td.ff-label {
    width: 1%;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
}

div#ArtPageFilesBlock table.file-fields td.ff-label-top {
    vertical-align: top;
    padding-top: 8px;
}

/* Add a little breathing room before the Author label */
div#ArtPageFilesBlock table.file-fields td.ff-label + td + td.ff-label {
    padding-left: 24px;
}

/* Upload cell shrinks to content */
div#ArtPageFilesBlock table.file-fields td.ff-upload {
    width: 1%;
    white-space: nowrap;
}

/* Author input */
div#ArtPageFilesBlock table.file-fields td.ff-author input[type="text"] {
    width: 220px !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    background-color: #ffffff !important;
}

/* File upload input keeps native size */
div#ArtPageFilesBlock table.file-fields td.ff-upload input[type="file"] {
    width: auto !important;
    min-width: 0 !important;
}

/* Caption textarea spans the remaining width */
div#ArtPageFilesBlock table.file-fields td.ff-caption textarea {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 90px;
    resize: vertical;
    box-sizing: border-box !important;
    line-height: 1.5;
    padding: 8px 10px;
    vertical-align: top;
    background-color: #ffffff !important;
}

/* --- Dual ListBox Areas (Categories, Map to Product/Campaign) --- */
div#ArtPageCategory1Block,
div#ArtPageCategory2Block,
div#ArtPageCategory3Block,
div#ArtPageMapProductBlock,
div#ArtPageMapCampaignBlock {
    padding: 16px 20px;
}

div#ArtPageCategory1Block div.formElement,
div#ArtPageCategory2Block div.formElement,
div#ArtPageCategory3Block div.formElement,
div#ArtPageMapProductBlock div.formElement,
div#ArtPageMapCampaignBlock div.formElement {
    background-color: var(--body-bg);
    border-radius: var(--radius-md);
    padding: 14px;
    border: 1px solid var(--border);
}

/* Transfer buttons */
div#ArtPageCategory1Block input[type="button"],
div#ArtPageCategory2Block input[type="button"],
div#ArtPageCategory3Block input[type="button"],
div#ArtPageMapProductBlock input[type="button"],
div#ArtPageMapCampaignBlock input[type="button"] {
    font-size: 11px !important;
    padding: 5px 8px !important;
    border-radius: var(--radius-sm) !important;
    min-width: 70px;
    margin-bottom: 4px;
}

/* Edit button - make more visible */
div#ArtPageCategory1Block input[type="button"][value="Edit..."],
div#ArtPageCategory2Block input[type="button"][value="Edit..."],
div#ArtPageCategory3Block input[type="button"][value="Edit..."] {
    background-color: var(--primary) !important;
    color: #ffffff !important;
    border-color: var(--primary) !important;
    font-size: 12px !important;
    padding: 6px 14px !important;
    min-width: auto;
}

/* --- Content Type Radio Buttons --- */
div.formElement input[type="radio"][name="ContentType"] {
    margin-right: 3px;
}

/* --- Fixed widths → 100% --- */
div[style*="width: 625px"] {
    width: 100% !important;
}
