/* stocking.css - Stuff-A-Stocking styling, layered on site.css */

/*** Theme ***
 *
 * These were edits to stuffastocking's copy of toto.css. They now
 * override the shared site.css instead.
 */

:root {
    --main-page-color: white;
    --accent-color: #c04040;
    --shadow-color: #d0d0d0;
    --deleted-color: #e0e0e0;
    --text-color: black;
    --link-color: blue;
    --font-family: Roboto,Helvetica,sans-serif;
    --main-page-text-color: black;

    --second-highlight-color: green;

    --default-shadow: 3px 1px 1px rgba(0,0,0,0.2);
}

body {
    font-family: var(--font-family);

    background-color: var(--main-page-color);
    color: var(--text-color);
}

.dialog-background {
    z-index: 9;
}

dialog h4 {
    margin: 0px 0px 4px 0px;
}

dialog h4:not(:first-child) {
    margin-top: 8px;
}

.header {
    color: var(--main-page-text-color);

    background-color: var(--main-page-color);
    border-bottom: 1px solid var(--accent-color);
}

A {
    color: var(--link-color);
}

A:visited {
    color: var(--link-color);
}

/*** Global font selection and page layout ***/

.stocking-background {
    background-image: url(/resource/christmas-stocking.svg);
    background-size: 64px;
    background-position-x: -20px;
    background-position-y: -20px;
    background-blend-mode: darken;
}

@media only screen and (min-width : 640px) {
    dialog {
        width: auto;
        max-width: 60%;
    }
}

dialog form {
    padding: 0px;
}


dialog .modal-controls .length-indicator {
    flex: 1;
}

dialog p {
    padding-bottom: 12px;
}

dialog .list-owner {
    display: flex;
    padding: 0px 0px 8px 0px;
}

dialog .list-owner input {
    margin: 0px;
}

dialog .list-owner input[type=text] {
    flex: 1;
}

/* The current user has no checkbox, so a .self-owner spacer takes its
   place. Both are the same fixed width so the names line up. */
dialog .list-owner input[type=checkbox],
dialog .list-owner .self-owner {
    display: inline-block;
    flex: none;
    width: 32px;
}

dialog .stocking-select-list {
    max-height: 40vh;
    overflow-y: auto;
}

dialog .stocking-select {
    display: flex;
    align-items: baseline;
    padding: 0px 0px 8px 0px;
}

dialog .stocking-select input[type=checkbox] {
    flex: none;
    width: 32px;
    margin: 0px;
}

dialog .stocking-select .stocking-select-name {
    font-weight: bold;
}

/* Plain (non-submit) buttons in a modal, e.g. Cancel. Sized like the
   site's submit buttons, but lighter, since they're the secondary
   action. */
dialog .modal-controls input[type=button] {
    padding: 0.5em 1em;
    background: #f0f0f0;
    border: 1px solid #c0c0c0;
    border-radius: 0px;
    cursor: pointer;
}

dialog .modal-controls input[type=button]:hover {
    background: #e0e0e0;
}

.contents {
    flex: 1;

    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 0px 8px 0px 8px;

    display: flex;
    flex-direction: column;
}

@media only screen and (max-width : 640px) {
    .contents {
        margin-bottom: 30px;
    }
}

.contents::-webkit-scrollbar {
    display: none;
}


.toolbar {
    margin: 6px 0px 6px 0px;
    padding: 6px;

    right: 0px;

    text-align: center;

    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
}

.toolbar A {
    display: inline-flex;
    padding-right: 10px;
    min-height: 40px;
    align-items: center;
    border: 1px solid var(--accent-color);
    color: var(--text-color);
    background-color: var(--main-page-color);
    padding: 6px;
    margin: 4px;
}


/*** Toplevel list styling ***/

.toplevel-list {
    width: 100%;
    box-sizing: border-box;

    flex-wrap: wrap;
    display: flex;
}

.toplevel-list .list-view-section:not(:first-child) {
    border-top: 1px solid #f0f0f0;
    padding-top: 16px;
}

.toplevel-list h2 {
    margin: 0px;
    padding: 0px;
    padding-left: 12px;

    font-size: 14px;
}

.toplevel-list .list-view-section h2 .other-item-count {
    font-weight: normal;
    font-style: italic;
}

.toplevel-list h2:not(:first-child) {
    padding-top: 18px;
}

.toplevel-list h2 A {
    color: black;
}

@media only screen and (min-width : 640px) {
    .toplevel-list {
        padding-left: 0px;
        padding-right: 0px;
    }
}

.order-drop-target.drop-hover {
    background: #d0d0d0;
}

/* Pill common component */


.stocking-editor-header {
    display: flex;
    flex-direction: column;
}

.stocking-editor-header h2 {
    margin: 0px;
}

.stocking-editor-header{
    flex: 1;
    margin-top: 16px;
    margin-bottom: 16px;
}

/* Editor header: back arrow, then the title, From and To stacked to
   its right (render-stocking-editor-title in stocking.clj). */

.stocking-title-block {
    display: flex;
    flex-direction: row;
    align-items: baseline;
}

.stocking-title-block A {
    color: var(--text-color);
}

.stocking-title-fields {
    padding: 2px 6px;
}

.stocking-title-block A .stocking-title-fields:hover {
    background-color: #f0f0f0;
}

.stocking-title-fields .stocking-title {
    font-weight: bold;
}

.stocking-list-header {
    display: flex;
    flex: 1;
    flex-direction: column;
}

.header-row {
    display: flex;
    flex: 1;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.header-row h2 a {
    color: var(--text-color);
}

.header-row h2 a .fa {
    margin-right: 4px;
}

.stocking-editor-header .header-row .name-info {
    margin-top: 8px;
}

.stocking-editor-header .header-row .name-info label {
    font-weight: bold;
    margin-right: 4px;
}

.editing .right {
    display: none;
}

/*** Page toolbar and menu (render-page-toolbar and render-page-menu
     in common.clj) ***/

.page-toolbar {
    display: flex;
    flex-direction: row;
    align-items: center;
    align-self: flex-start;
    margin: 6px 0px 6px 6px;
}

.page-toolbar > A {
    padding: 8px 10px;
    white-space: nowrap;
    color: var(--text-color);
}

.page-toolbar > A:hover {
    background-color: #e0e0e0;
}

.page-toolbar .page-menu {
    margin: 0px;
}

.page-menu {
    position: relative;
    align-self: flex-start;
    margin: 6px 0px 6px 6px;
}

.page-menu > summary {
    list-style: none;
    cursor: pointer;
    padding: 8px 10px;
    color: var(--text-color);
}

.page-menu > summary::-webkit-details-marker {
    display: none;
}

.page-menu-items {
    position: absolute;
    right: 0px;
    top: 100%;
    z-index: 5;

    display: flex;
    flex-direction: column;
    min-width: 200px;
    margin-top: 2px;

    border: 1px solid var(--accent-color);
    background-color: var(--main-page-color);
    box-shadow: var(--default-shadow);
}

.page-menu-items A {
    padding: 10px 14px;
    white-space: nowrap;
    color: var(--text-color);
}

.page-menu-items A:hover {
    background-color: #e0e0e0;
}

.page-banner {
    flex: 1;
    text-align: center;

    margin: 4px;
    padding: 8px;

    background-color: var(--deleted-color);
}

.page-banner.preview {
    background-color: #fff3c4;
}

.page-banner.opened {
    background-color: #e3f2e3;
}

.list-tile .opened-check {
    margin-left: 6px;
    color: green;
}

.list-tile {
    display: flex;
    flex-direction: row;
    align-items: center;

    border: 1px solid var(--accent-color);
    width: 160px;
    height: 120px;

    white-space: nowrap;

    padding: 0px;

    margin: 0px 15px 15px 0px;
    box-shadow: var(--default-shadow);

    display: inline-flex;
    flex-direction: column;
    white-space: pre-wrap;

    background-color: var(--main-page-color);
}

.list-tile.deleted {
    background-color: #e0e0e0;
    border-color: var(--shadow-color);
}

.list-tile.control-tile {
    border: 1px dashed var(--accent-color);
    box-shadow: none;
    background-color: white;
}

.list-tile.control-tile A {
    background-color: transparent;
    color: var(--accent-color);
    font-size: 20px;
    font-weight: bold;
    text-align: center;
}

@media only screen and (min-width : 640px) {
    .item-row {
        padding-bottom: 4px;
    }
}

.list-tile A {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-around;

    color: var(--main-page-text-color);
    margin: 1px;
    padding: 6px;

    box-sizing: border-box;
    width: 100%;
}

.list-tile .tile-contents label {
    font-weight: bold;
}

.list-tile .tile-contents h3 {
    text-align: center;
    margin: 2px;
}

.list-tile .tile-contents A {
    color: var(--main-page-color);
}

.list-tile .tile-contents:hover {
    background: #e0e0e0;
}

.list-tile .tile-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;

    padding: 6px 2px 2px 2px;

    box-sizing: border-box;
    width: 100%;
}

.list-tile .drag-handle,
.list-tile .drag-handle-placeholder {
    width: 25px;
    min-width: 25px;
}

@media only screen and (min-width : 640px) {
    .list-tile .drag-handle,
    .list-tile .drag-handle-placeholder {
        padding: 3px 6px 3px 3px;
        font-size: inherit;
    }
}


.item-description-editor {
    display: flex;
    flex-direction: row;
}

.item-description-editor textarea {
    flex: 1;
}

.item-description-editor .item-preview {
    width: 50%;
    flex: 1;
    margin: 2px;
    padding: 2px;

    overflow-x: hidden;
}

.item-description-editor .item-preview img {
    max-width: 80%;
    display: block;
    margin: auto;
}

@media only screen and (max-device-width : 640px) {
    .item-description-editor .item-preview {
        display: none;
    }
}

.item-description-editor .item-preview p:first-child {
    margin-top: 0px;
}

/*** List Configuration Controls ***/

.stocking-item .description {
    padding: 20px;
    border: 1px solid gren
}

.stocking-item .controls .nav-link {
    width: 200px;
    display: inline-block;
    padding: 20px;
}

.stocking-item .gift-block {
    display: flex;
    flex-direction: column;

    margin: 20px 60px 20px 60px;
    background-color: white;
    height: 70vh;
    color: var(--main-page-text-color);

    border: 8px solid var(--second-highlight-color);

    box-shadow: 3px 2px 2px var(--shadow-color);
}

.stocking-item .gift-block img {
    max-width: 80%;
    display: block;
    margin: auto;
}

.config-panel .scroll-column {
    max-height: 40vh;
}

.stocking-item .stocking-names {
    display: flex;
    flex-direction: row;
}

.stocking-item .stocking-names label {
    font-weight: bold;
    margin-right: 4px;
}

.stocking-item .stocking-names {
    justify-content: center;
    font-size: 16px;
}

.stocking-item .stocking-names .name-info:not(:first-child) {
    margin-left: 20px;
}

.gift-block A {
    color: var(--main-page-text-color);
}

@media only screen and (max-device-width : 640px) {
    .stocking-item .gift-block {
        margin: 20px 20px 20px 20px;
    }
}

.stocking-item .gift-block .details {
    display: flex;
    flex-direction: column;
    flex: 1;

    height: 60vh;
    max-height: 60vh;

    border: 1px solid purple;
    overflow: auto;
    word-break: break-word;
}

.stocking-item .gift-block .details A {
    color: blue;
}

.stocking-item .gift-block .details A:visited {
    color: purple;
}

.stocking-item .gift-block .details.hidden {
    font-size: 120px;

    justify-content: center;
    align-items: center;
}

.stocking-item .gift-block .details.hidden img {
    max-width: 30vw;
}

.stocking-item .gift-block .details .description {
    flex: 1;
    padding: 20px;
}

.stocking-item .gift-block .details h2 {
    text-align: center;
}

.stocking-item .controls {
    flex: 0;
    display: flex;
    justify-content: space-evenly;
    color: var(--main-page-color);

    border-top: 4px solid var(--second-highlight-color);
}

.stocking-item .controls .nav-link {
    width: 200px;
    display: inline-block;
    padding: 20px;
    text-align: center;
    color: var(--text-color);
}

.stocking-item h1 {
    text-align: center;
}

.list-heading {
    padding: 12px;
    width: 100%;
    background: white;
}

.list-heading h1 {
    text-align: center;
    margin: 0px;
    width: 100%;
    padding-bottom: 20px;
}
