/* First, some CSS that will be migrated to core after a trial in fixed width.
   Once migrated to core it will load first, hence placing it first here. */

/* wiki content width control
---------------------------------------------------------------------- */
* html .wiki-content .table-wrap {
    width: 100%;
    overflow-y: visible;
    overflow-x: auto;
}

* html .wiki-content .confluenceTable {
    width: auto; /* IE6 collapses table cells in the RTE without this. */
}

* html .wiki-content p {
    width: 100%;
    overflow-x: auto;
}

* html .wiki-content .panel {
    width: 95%;
    overflow-x: auto;
}

*+ html .panel .codeContent {
    min-height: 2em;  /* otherwise IE7 puts the scrollbar on top of long single line code */
    width: 100%; overflow-x: auto;  /* trying to get IE7 to handle code more gracefully */
}

* html .panel pre {
    overflow: visible;
    height: 2em;
}

.image-wrap {
    *padding-bottom: 1.5em; /* otherwise IE6-7 puts the scrollbar on top of the image */
}

.has-sidebar.active-wikimarkup #conflict-diffs {
    *margin-right: 17em;
}

/* Undo width settings inside the RTE. Do this to avoid weird resize handles appearing in IE.
   Very rare occasion where !important is appropriate. */
.mceContentBody p,
.mceContentBody .image-wrap,
.mceContentBody .panel .codeContent,
.mceContentBody .panel .codeContent pre,
*+ html .mceContentBody .panel .codeContent {
    width: auto !important;
    height: auto !important;
    min-width: none !important;
    min-height: none !important;
}

/* IE6 needs its own copy. Can't mix * and *+ hacks. */
* html .mceContentBody p,
* html .mceContentBody .table-wrap,
* html .mceContentBody .panel,
* html .mceContentBody .panel pre {
    width: auto !important;
    height: auto !important;
    min-width: none !important;
    min-height: none !important;
}

/* Undo width settings inside the RTE. Do this to avoid weird resize handles appearing in IE.
   Very rare occasion where !important is appropriate. */
.mceContentBody p,
.mceContentBody .image-wrap,
.mceContentBody .panel .codeContent,
.mceContentBody .panel .codeContent pre,
*+ html .mceContentBody .panel .codeContent {
    width: auto !important;
    height: auto !important;
    min-width: none !important;
    min-height: none !important;
}

/* IE6 needs its own copy. Can't mix * and *+ hacks. */
* html .mceContentBody p,
* html .mceContentBody .table-wrap,
* html .mceContentBody .panel,
* html .mceContentBody .panel pre {
    width: auto !important;
    height: auto !important;
    min-width: none !important;
    min-height: none !important;
}

/* comments RTE - force toolbar to collapse instead of being truncated
---------------------------------------------------------------------- */
#comments-section #wysiwyg {
    *position:relative;
    *overflow-x: auto; /* IE6-7 */
    *overflow-y: hidden; /* IE6-7 - it will scroll from the next element down */
    *padding-bottom: 1.5em; /* to give enough room for the scrollbar */
    *margin-bottom: -1em; /* to avoid making too big a space for scrollbar */
    _display: block; /* IE6 */
}
/* ...end of CSS that will be migrated to core. CSS from here on is theme-specific */

/* layout
---------------------------------------------------------------------- */

/* IE6 needs the stronger selector */
* html #full-height-container {
    background-color: #fff;
}

*+ html #full-height-container {
    width: 980px;
    overflow: hidden; /* prevents annoying problems with collapsed sidebar on short pages. */
}

*+ html #content {
    height: expression( this.scrollHeight < 499 ? "500px" : "auto" ); /* sets min-height for IE */
}

#header {
    height /*\**/ : auto\9; /* overriding holly hack in core (IE8 and below) */
    zoom: 1;
}

* html #quick-search-query {
    margin-top: 6px;
}

/* Makes sure that the long page titles wrap properly in IE7 */
*+ html #navigation {
    float: right;
    display: block;
    width: 35%;
}

#breadcrumbs li span {
    *white-space: nowrap; /* IE6 and 7 suck at this. */
}

*+ html #content {
    height: expression( this.scrollHeight < 499 ? "500px" : "auto" ); /* sets min-height for IE */
    width: 100%;
}

.has-personal-sidebar #content {
    height: expression( this.scrollHeight < 699 ? "700px" : "auto" ); /* sets min-height for IE */
}

*+ html #main {
    width: auto;
}

*+ html .pageSection {
    zoom: 1;
}

/* attachment page table */
table.attachments td.comment {
    *width: 15%;
}

table.attachments td.attachment-actions {
    *width: 13%;
}

table.attachments td.attachment-actions ul li {
    *float: left;
}

/* attachments macro width control for IE7 */
*+ html .plugin_attachments_container {
    width: 100%;
    height: auto;
    overflow-y: visible;
    overflow-x: auto;
    zoom: 1;
}

*+ html .plugin_attachments_table_container {
    zoom: 1;
}

*+ html #page .plugin_attachments_table_container th,
*+ html #page .plugin_attachments_table_container td {
    white-space: normal;
}

*+ html #page .sidebar-collapsed .plugin_attachments_table_container th,
*+ html #page .sidebar-collapsed .plugin_attachments_table_container td {
    white-space: nowrap;
}

*+ html #page .plugin_attachments_table_container td.comment {
    white-space: normal !important;
}

/* sidebar
---------------------------------------------------------------------- */

#personal-info-sidebar {
    *width: 370px;
    *margin-top: 48px;
}

.view-blog-post #personal-info-sidebar {
    *margin-top: 48px;
}

* html #personal-info-sidebar .sidebar-content {
    padding-right: 0;
}

/* IE7 chokes on the sidebar. Commence Heimlich Maneuver. */
*+ html .has-sidebar #content,
*+ html #page .has-sidebar .blogpost {
    float: left;
    width: 660px;
}

*+ html .has-blog-sidebar #content{
    width: 600px;
    float: left;
    margin-top: 2em;
}

*+ html .has-sidebar .edit #wiki-editor {
    height: 800px;    
}

*+ html .has-personal-sidebar #content {
    float: left;
    width: 550px;
}

/* need to fix this selector for actual edit page, but not comments
*+ html #page .active-richtext #content,*/
*+ html .has-personal-sidebar #comments-section .wiki-content,
*+ html #comments-section .comment-body,
*+ html #page .has-sidebar .sidebar-collapsed,
*+ html #page .has-personal-sidebar .sidebar-collapsed,
*+ html .sidebar-collapsed #wysiwygTextarea_ifr,
*+ html #page .has-sidebar .edit {
    width: 100% !important;
}

/* force comments to full width/push below*/
*+ html .has-personal-sidebar #comments-section {
    clear: both !important;
    width: 912px !important;
    margin-bottom: 6em;
}
/* End IE7 Heimlich Maneuver. */

/* Throw heavy things at IE until it puts the wiki markup guide in the right place */
.active-wikimarkup #comments-section form.markup {
    *padding: 0 17em 0 0;
}

.active-wikimarkup #comments-section #addcomment,
.active-wikimarkup #comments-section .reply {
    *display: inline-block;
}

.active-wikimarkup #comments-section #addcomment .comment-body,
.active-wikimarkup #comments-section .reply .comment-body {
    *margin: 0 -17em 0 0;
    *float: left;
}

.active-wikimarkup #comments-section #addcomment-sidebar {
    *margin-top: 55px;
}

.active-wikimarkup #comments-section #addcomment-sidebar dl {
    *margin-left: 0;
}
/* end Throw heavy things at IE */

/* TODO: this is a bit hardcore, would be nice to take this back off */
* html #main {
    width: 912px;
    overflow-x: hidden;
}

/* wiki content
---------------------------------------------------------------------- */
.wiki-content .table-wrap {
    width: 100%;
}

.wiki-content .table-wrap table {
    width: auto;
}

.wiki-content ul,
.wiki-content ol {
    margin-left: 0;
}

*+ html #page .recently-updated ul {
    padding-left: 0;
}

/* space admin
---------------------------------------------------------------------- */

#content.space-administration {
    margin-left: -10px; /* keep admin content from dropping under sidebar */
}

#space-admin-body table {
    width: expression( document.body.clientWidth > 729 ? "730px" : "auto" ); /* sets max-width for IE */
}

.has-sidebar #space-admin-body {
    width: expression( document.body.clientWidth > 479 ? "480px" : "auto" ); /* sets max-width for IE */
}

.has-sidebar #space-admin-body table {
    width: expression( document.body.clientWidth > 469 ? "470px" : "auto" ); /* sets max-width for IE */
}

#uPermissionsTable td {
    width: expression( document.body.clientWidth > 99 ? "100px" : "auto" ); /* sets max-width for IE */
    height: 30px;
}

#uPermissionsTable td.permissionCell {
    height: 40px;
}

.space textarea.monospaceInput {
    width: 640px
}
