/**
 * COmanage Registry Responsive Style Sheet
 *
 * Portions licensed to the University Corporation for Advanced Internet
 * Development, Inc. ("UCAID") under one or more contributor license agreements.
 * See the NOTICE file distributed with this work for additional information
 * regarding copyright ownership.
 *
 * UCAID licenses this file to you under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with the
 * License. You may obtain a copy of the License at:
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * @link          https://www.internet2.edu/comanage COmanage Project
 * @package       registry
 * @since         COmanage Match v1.0.0
 * @license       Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
 */

/* Reponsive breakpoints for the COmanage theme are set to 360, 480, 600, 840, 960, 1280, 1440, and 1600dp.
   This is a mobile-first theme.  General and 320 mobile portrait styles are in co-base.css */


/* PHONE LANDSCAPE */
/**************************************************************************************************************/
/* Small phones in landscape mode  */
@media only screen and (min-width: 480px) {
  .top-filters .cm-time-picker-panel {
    right: unset;
    transform: translate(-95%,0);
  }
  .supertitle-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
}

/* SMALL */
/**************************************************************************************************************/
/* Very small devices (tablets, landscape phones 576px and up) */
@media only screen and (min-width: 576px) {
  h1 {
    font-size: 2.6em;
  }
  h2 {
    font-size: 2em;
    line-height: 1.2em;
  }
  #top-menu .top-menu-link-text {
    display: inline;
  }
  #user-panel {
    min-width: 400px;
    max-width: unset;
  }
  #user-panel-user-icon {
    display: block;
  }
  #user-panel-user-container {
    display: flex;
  }
  #user-panel-canvas-link {
    margin-left: 0.5rem;
  }
  /* FORMS */
  ul.form-list li .field {
    display: grid;
    column-gap: 1em;
    align-items: center;
    grid-template-columns: 1fr 2fr;
  }
  ul.form-list li.fields-metadata .field {
    align-items: flex-start;
  }
  ul.form-list .field-name {
    padding-left: 0.5em;
  }
  ul.form-list-admin .field-name {
    width: 50%;
    padding-right: 1em;
  }
  ul.form-list-admin .field-info {
    width: 40%;
  }
  ul.form-list .field-desc {
    padding: 0.5em 0 0 0.5em;
  }
  ul.form-list li.field-stack textarea {
    margin: 0.5em 0 0.5em 0.5em;
  }
  .cm-modal .modal-dialog {
    max-width: 90vw;
  }
  /* PETITIONS */
  ul#view_Petitions.form-list .field {
    align-items: start;
  }
  .petition-attrs > ul {
    columns: 2;
    column-rule: 1px solid var(--cmg-color-bg-005);
  }
  .petition-attrs > ul > li {
    break-inside: avoid;
  }
  /* PERSON CANVAS / CARDS */
  .co-cards .field-data-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    min-height: 2.5em;
  }
  #mvea-canvas-roles .field-data-container {
    grid-template-columns: 1fr 1fr 2fr auto;
  }
  /* PAGINATION */
  #pagination {
    text-align: left;
    min-height: 2.5em;
  }
  #pagination .paginationCounter {
    float: right;
  }
  #pagination.with-pagination-elements .paginationCounter {
    margin-top: 2px;
  }
  /* DATE / TIME PICKER */
  .duet-date__dialog {
    left: -20em;
  }
  /* DISPATCH */
  #dispatch-list-container ul.fields li.fields-accepted .field {
    justify-content: space-between;
    padding: 1em 1em 1em 1.25em;
  }
  #dispatch-list-container ul.fields li.fields-accepted .field-info {
    padding: 0;
  }
  /* DENSITY SETTINGS (from User Settings Menu; Medium is default) */
  /* Density "small" */
  html.density-small h1 {
    font-size: 2.4em;
  }
}

/* MEDIUM - Primary breakpoint */
/**************************************************************************************************************/
/* Medium devices (tablets, 768px and up) */
@media only screen and (min-width: 768px) {
  #co-hamburger {
    display: none;
  }
  /* CONTENT LAYOUT */
  #comanage-wrapper {
    display: flex;
    flex-direction: column;
    height: 100vh;
  }
  #main-wrapper {
    display: flex;
    flex-direction: row;
    flex: 1;
  }
  #main {
    flex-basis: 100%;
    padding-bottom: 66px; /* offset for footer logo height */
  }
  /* HEADER */
  #logo {
    margin-top: 8px;
  }
  #siteTitle {
    min-height: 46px;
    line-height: 1.6em;
  }
  /* GLOBAL SEARCH */
  #top-bar #global-search-toggle {
    display: none;
  }
  #global-search {
    position: static;
    display: block;
    font-size: 1em;
    background-color: transparent;
    border: none;
    border-right: 1px solid var(--cmg-color-bg-006);
    padding: 0.5em 0.2em;
  }
  #global-search form {
    padding: 0 0 0 0.5em;
    min-height: 30px;
  }
  #global-search #q {
    flex: 1;
    width: auto;
    border: none;
    background-color: transparent;
  }
  #global-search #q:focus-visible {
    outline: none;
  }
  #global-search button {
    padding: 0.25em 0.75em;
    margin-left: 0.25em;
    font-weight: 400;
    background-color: transparent;
    border-radius: 3px;
  }
  #global-search button.btn-link {
    color: var(--cmg-color-body-txt);
    text-decoration: none;
  }
  #global-search button.btn-link:hover {
    text-decoration: underline;
  }
  #global-search button.visible {
    display: inline-block;
  }
  #global-search #global-search-clear {
    padding: 0 0.75em;
    border-right: 1px dashed var(--cmg-color-bg-006);
  }
  .with-hover-button {
    justify-content: flex-start;
    position: relative;
  }
  .with-hover-button .cm-hover-button {
    display: none;
    /* The following two rules are a trade-off; remove them to make the copy button appear just to the right of the 
       value being copied; the trade-off is that long lines will wrap when the button appears causing the row to 
       jump in size which can also be distracting. */
    position: absolute;
    right: 1em;
  }
  .field-data-container:hover .with-hover-button .cm-hover-button,
  .field-data-container:active .with-hover-button .cm-hover-button,
  .field-data-container:focus .with-hover-button .cm-hover-button,
  .field-data-container:focus-within .with-hover-button .cm-hover-button {
    display: flex;
  }
  /* SEARCH RESULTS */
  body.search .page-title-container {
    justify-content: start;
    gap: 1em;
  }
  #search-results ul.search-results-group {
    column-count: 2;
    column-gap: 1.25em;
  }
  #top-menu {
    z-index: 30;
  }
  body.title-hidden #top-menu a.topMenu {
    color: var(--cmg-color-body-txt);
  }
  /* MAIN MENU */
  #navigation-drawer {
    display: block;
    position: relative;
    top: unset;
    z-index: unset;
    border-bottom: none;
  }
  #main-menu {
    text-align: center;
    font-size: 0.9em;
  }
  #main-menu > li {
    border-bottom: none;
  }
  #main-menu .material-symbols,
  #main-menu .material-symbols-outlined {
    display: block;
    font-size: 2.5rem;
    margin: 0;
  }
  #co-menu-collapse {
    display: flex;
    justify-content: center;
    width: 100%; 
    padding: 1rem;
    background-color: transparent;
    border: none;
    color: var(--cmg-color-txt-003);
  }
  #co-menu-collapse .co-menu-collapse-icon {
    transform: rotate(90deg);
  }
  /* Menu Collapsed Styles */
  #navigation-drawer.closed .menu-title,
  #navigation-drawer.closed .co-menu-collapse-text {
    display: none;
  }
  #navigation-drawer.closed #main-menu .material-symbols,
  #navigation-drawer.closed #main-menu .material-symbols-outlined {
    font-size: 1.8rem;
  }
  #navigation-drawer.closed .co-menu-collapse-icon {
    transform: rotate(-90deg);
  }
  #all-button-container {
    padding-bottom: 0;
  }
  #navigation-drawer.closed #all-button {
    padding: 0.25rem 0.4rem;
    font-size: 0.8em;
  }
  /* Menu Panels */
  .menu-panel {
    left: calc(100% + 1px);
    padding: 1rem 1.5rem;
    width: 70vw;
    min-height: 520px;
    border-right: 1px solid var(--cmg-color-bg-006);
    border-bottom: 1px solid var(--cmg-color-bg-006);
  }
  .menu-panel-content {
    display: flex;
    gap: 4em;
    justify-content: left;
    margin-top: 1.5em;
  }
  .menu-panel-links {
    flex: 1;
  }
  .menu-panel-sidepanel {
    padding: 0 2em 1em 3em;
    margin-top: 0.5em;
    border-left: 1px solid var(--cmg-color-bg-006);
    width: 30%;
  }
  .menu-panel .comanage-version {
    position: absolute;
    bottom: 2rem;
    margin: 0;
  }
  #main-menu .menu-panel .config-platform-notice {
    margin: 10em 0 4em;
  }
  /* PEOPLE PICKER */
  #cm-people-picker {
    flex-direction: row;
    align-items: flex-end;
    gap: 0.5em;
    padding: 0;
  }
  #cm-people-picker .cm-autocomplete {
    width: 300px;
    height: 30px;
  }
  #cm-people-picker #cmPersonPickerId-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5em;
  }
  #cm-people-picker .co-loading-mini-container {
    position: absolute;
    right: 0.75em;
    z-index: 1;
  }
  /* ENTITY METADATA under each Edit/View Form/List */
  #entity-metadata {
    display: flex;
    justify-content: flex-end;
    gap: 2rem;
    align-items: center;
    text-align: left;
    margin: 1rem 0 0.5rem;
  }
  /* GENERAL */
  .table-container {
    overflow: unset;
  }
  .two-col {
    -webkit-column-count: 2; /* Chrome, Safari, Opera */
    -moz-column-count: 2; /* Firefox */
    column-count: 2;
    -webkit-column-gap: 20px; /* Chrome, Safari, Opera */
    -moz-column-gap: 20px; /* Firefox */
    column-gap: 20px;
  }
  .three-col {
    -webkit-column-count: 3; /* Chrome, Safari, Opera */
    -moz-column-count: 3; /* Firefox */
    column-count: 3;
    -webkit-column-gap: 20px; /* Chrome, Safari, Opera */
    -moz-column-gap: 20px; /* Firefox */
    column-gap: 20px;
  }
  /* Call to Action Blocks */
  .call-to-action-blocks {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 2em;
  }
  .call-to-action {
    margin-bottom: 0;
  }
  /* TOP FILTERS */
  .top-filters-fields-subgroups {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 1em;
    padding: 0 0.5em;
    align-items: center;
  }
  .top-filters-checkbox-fields {
    display: flex;
  }
  .top-filters-checkboxes {
    padding: 0.5em 0 0;
  }
  #top-filters-submit {
    position: relative;
  }
  .top-filters .submit-button, 
  .top-filters .clear-button, 
  .top-filters .options-button {
    margin: 1em 0.25em;
  }
  #top-filters-submit.tss-rebalance {
    margin-top: -3.5em;
    float: right;
  }
  /* BULK EDIT */
  body.bulk-mode #bulk-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1em;
    align-items: center;
  }
  #bulk-actions legend {
    margin: 0;
  }
  #bulk-action-select {
    flex-grow: 1;
    width: auto;
    margin: 0;
  }
  .field-actions.top-links #bulk-edit-switch-container {
    padding: 0 1em;
  }
  /* CO CONFIGURATION DASHBOARD */
  .page-title-features {
    display: flex;
    align-items: baseline;
    gap: 1em;
    justify-content: space-between;
    width: 100%;
  }
  .config-menu {
    column-count: 2;
    column-fill: balance;
  }
  /* INDEX ACTION ROW MENUS */
  .field-actions .dropdown-menu {
    font-size: 0.9em;
    white-space: nowrap;
  }
  th.actions,
  td.actions {
    width: 40px; /* this is pushed wider by the nowrap on .field-actions .dropdown-menu */
  }
  /* EDIT / VIEW / INDEX ACTION TOP-LINKS MENU */
  /* Convert the dropdown menus to be visible on wider screens when .actions-expanded class exists. 
     .action-expanded is set when there are fewer than four actions exposed. Otherwise, all links remain
     in the gear dropdown menu. */
  .field-actions.top-links .actions-expanded .action-menu-toggle {
    display: none;
  }
  .field-actions.top-links .actions-expanded  .dropdown-menu {
    position: static;
    display: flex;
    align-items: flex-end;
    min-width: 0;
    font-size: 0.9em;
    border: none;
    background-color: transparent;
    white-space: nowrap;
    padding: 1.5em 0;
  }
  .field-actions.top-links .actions-expanded  .action-list-item {
    display: inline-block;
  }
  .field-actions.top-links .actions-expanded  a.dropdown-item {
    padding: 0 0.5em;
  }
  #main .field-actions.top-links .actions-expanded  a.dropdown-item:hover {
    color: var(--cmg-color-link);
    text-decoration: underline;
  }
  .field-actions.top-links .actions-expanded  a.dropdown-item:hover {
    background-color: transparent;
  }
  /* Provide two-column dropdown for enrollment attributes. 
     XXX We might generalize this for long lists. */
  body.enrollmentattributes .top-links ul.dropdown-menu {
    column-count: 2;
  }
  #view-external-identity-source-record td:first-child {
    white-space: nowrap;
  }
  /* ENROLLMENT FLOWS: ATTRIBUTE COLLECTOR */
  #dispatch-list-container .fieldset-info {
    flex-direction: row;
    padding: 0;
    border: none;
  }
  #dispatch-list-container .fieldset-subgroup {
    display: flex;
    width: 100%;
    gap: 1em;
  }
  #dispatch-list-container .fieldset-subgroup .fieldset-field {
    flex-grow: 1;
  }
  /* Attribute Specific Styles */
  /* addresses */
  #dispatch-list-container .fields-address .fieldset-info {
    /* Retain the mobile style for addresses */
    flex-direction: column;
    padding: 1em;
    border: 1px solid var(--cmg-color-bg-006);
  }
  #dispatch-list-container .fields-address .fieldset-info .fieldset-subgroup:first-child .fieldset-field.fields-room {
    flex-grow: 0;
  }
  #dispatch-list-container .fields-address .fieldset-info .fieldset-subgroup:first-child .fieldset-field.fields-room input {
    width: 12.4rem;
  }
  /* names */
  #dispatch-list-container .fields-name .fieldset-info .fieldset-field.fields-honorific, 
  #dispatch-list-container .fields-name .fieldset-info .fieldset-field.fields-suffix {
    flex-shrink: 1;
    flex-grow: 0;
  }
  #dispatch-list-container .fields-name .fieldset-info .fieldset-field.fields-honorific input,
  #dispatch-list-container .fields-name .fieldset-info .fieldset-field.fields-suffix input {
    width: 5em;
  }
  /* telephone numbers */
  #dispatch-list-container .fields-telephoneNumber .fieldset-info .fieldset-field {
    flex-shrink: 1;
    flex-grow: 0;
  }
  #dispatch-list-container .fields-telephoneNumber .fieldset-info .fieldset-field.fields-number {
    flex-grow: 1;
  }
  #dispatch-list-container .fields-telephoneNumber .fieldset-info .fieldset-field.fields-country_code input,
  #dispatch-list-container .fields-telephoneNumber .fieldset-info .fieldset-field.fields-area_code input,
  #dispatch-list-container .fields-telephoneNumber .fieldset-info .fieldset-field.fields-extension input {
    width: 7em;
  }
  /* PETITIONS */
  ul.form-list li.petition-enrollee-items .field-info {
    flex-direction: row;
    gap: 3em;
  }
  ul.petition-attrs-subset {
    display: flex;
    flex-wrap: wrap;
    border: none; 
    border-right: 1px solid var(--cmg-color-bg-005);
  }
  ul.petition-attrs-subset li {
    grid-template-columns: unset;
    grid-template-rows: 1fr 1fr;
    border-left: 1px solid var(--cmg-color-bg-005);
    gap: 0;
    padding: 0.1em 0.5em;
    border-top: 1px solid var(--cmg-color-bg-005);
    border-bottom: 1px solid var(--cmg-color-bg-005);
    border-right: none;
    flex-grow: 1;
  }
  .petition-attrs-subset-label {
    font-size: 0.8em;
  }
  /* CHANGELOG */
  #changelog .accordion-body li {
    grid-template-columns: 1fr 3fr;
  }
  #changelog .changelog-parent-link {
    display: flex;
    gap: 1rem;
    align-items: center;
  }
  #changelog .accordion-body {
    overflow-x: unset;
  }
  /* FOOTER */
  #co-footer {
    position: static;
    text-align: right;
    padding: 0;
    margin-top: -72px;
    transform: unset;
  }
  .poweredByComanage {
    display: inline-block;
    padding: 1em 2em 2em 0;
  }
  body.logged-out #co-footer {
    position: fixed;
    float: none;
    right: 0;
    bottom: 0;
    margin: 0;
    left: unset;
    transform: unset;
  }
}

/* LARGE */
/**************************************************************************************************************/
/* Medium devices (desktops, 992px and up) */
@media only screen and (min-width: 992px) {
  /* FORMS */
  ul.form-list li .field {
    column-gap: 2em;
  }
  /* TOP FILTERS */
  .top-filters .submit-button,
  .top-filters .clear-button,
  .top-filters .options-button {
    margin: 1em 0.5em;
  }
  /* DATE / TIME PICKER */
  .cm-time-picker-panel {
    right: -250px;
    display: flex;
  }
  .cm-time-picker-vals ul {
    grid-template-columns: repeat(12, 40px);
    grid-template-rows: repeat(2, 40px);
  }
  .cm-time-picker-minutes .cm-time-picker-vals ul {
    grid-template-columns: repeat(2,40px);
    grid-template-rows: repeat(2,40px);
  }
  /* SEARCH RESULTS */
  #search-results ul.search-results-group {
    column-count: 3;
  }
  /* CO CONFIGURATION DASHBOARD */
  .config-menu {
    column-count: 3;
  }
  /* ENROLLMENT FLOWS */
  .page-title h2.flow-step-description {
    font-size: 1.7em;
    margin: 0.5em 0 0.25em;
  }
  body.dispatch #main-wrapper,
  body.start #main-wrapper {
    background-color: var(--cmg-color-bg-003);
  }
  body.dispatch #main,
  body.start #main {
    background-color: var(--cmg-color-body-bg);
    margin: 4em auto;
    padding: 0 2em;
    border: 1px solid var(--cmg-color-bg-006);
    border-radius: 1em;
  }
  /* PETITIONS */
  .petition-key-value {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

/* EXTRA LARGE */
/**************************************************************************************************************/
/* Extra large devices (desktops, 1200px and up) */
@media only screen and (min-width: 1200px) {
  /* FORMS */
  ul.form-list li .field {
    grid-template-columns: 1fr 3fr;
  }
  /* SEARCH RESULTS */
  #search-results ul.search-results-group {
    column-count: 4;
  }
  /* CO CONFIGURATION DASHBOARD */
  .config-menu {
    column-count: 4;
  }
}

/* SPECIAL */
@media only screen and (min-height: 556px) and (min-width: 768px) {
  #navigation-drawer.closed #navigation-bottom {
    position: fixed;
    bottom: 0;
    left: 2px;
    width: auto;
    margin-top: 0;
  }
}
@media only screen and (min-height: 728px) and (min-width: 768px){
  #navigation-bottom {
    position: fixed;
    bottom: 0;
    left: 8px;
    width: auto;
    margin-top: 0;
  }
}