@layer base, components, utilities, overrides;

@layer base {

    :root {
        --viewport-height: 100vh;
        --table-hover-color: #ddd;
        --table-stripe-color: #f2f2f2;
        --table-header-color: black;
        --table-header-text: white;
        --inactive-month: #bbb;
    }
    
    
    
    /*
     *  PAGE LAYOUT
     *
    */
    
    #wrapper {
        align-items: center;
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-height: var(--viewport-height);
        overflow: hidden;
        position: relative;
    }
    
    #main {
        width: 66rem;
        max-width: 100%;
        display: flex;
        flex-direction: column;
    }
    
    header {
        display: flex;
        flex-direction: column;
    }
    
    header img {
        height: 3em;
        width: 3em;
    }
    
    .home-icon {
        align-content: center;
    }
    
    header .header-top, header nav, footer nav {
        display: flex;
        flex-direction: row;
    }
    
    header nav, footer nav {
        flex-wrap: wrap;
    }
    
    footer nav div {
        padding: 1em 0.5em;
    }
    
    header nav div {
        padding: 0 0.5em;
        flex: 1;
    }
    
    footer {
        margin: 2rem 0;
    }
    
    @media (pointer: coarse), (hover: none) {
        [title] {
          position: relative;
          display: inline-flex;
          justify-content: center;
        }
        [title]:focus::after {
          content: attr(title);
          position: absolute;
          top: 90%;
          color: #000;
          background-color: #fff;
          border: 1px solid;
          width: fit-content;
          padding: 3px;
        }
      }
    
    
    
    /*
     *  CALENDAR
     *
    */
    
    .period_bar {
        width: 100px;
        height: 10px;
        background-color: lightgray;
        position: relative;
        margin-top: 5px;
    }
    
    .period_dot {
        width: 10px;
        height: 10px;
        background-color: var(--c);
        border-radius: 50%;
        position: absolute;
        left: var(--l);
        transform: translateX(-50%);
    }
    
    table.calendar {
        table-layout: fixed;
    }
    table.calendar td {
        width: calc(1/7);
    }
    
    .day {
        width: 100%;
        height: 2em;
        border: 1px blue solid;
        display: flex;
        flex-direction: row;
    }
    
    .day div {
        background-color: var(--c);
        height: 100%;
        flex: var(--l);
    }
    
    td.thismonth {
    
    }
    td.lastmonth, td.nextmonth {
        background-color: var(--inactive-month);
    }
    
    .idol-calendars {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
    }
    .idol-calendars .longform {
        flex: 1;
    }
    .idol-calendars .monthly {
        flex: 2;
    }
    
    
    /*
     *  FORMS
     *
    */
    
    form {
        display: block;
        padding: 1em;
    }
    label {
        display: inline-block;
        min-width: 90px;
        text-align: right;
    }
    input, textarea {
        width: 300px;
        box-sizing: border-box;
        border: 1px solid #999;
    }
    textarea {
        vertical-align: top;
        min-height: 6em;
    }
    input[type=submit] {
        margin-top: 3em;
    }
    
    
    
    
    /*
     *  TABLES
     *
    */
    
    table {
        width: 95%;
        margin: 10px auto;
        border-collapse: collapse;
    }
    
    table.observations {
        table-layout: fixed;
    }
    
    th, td {
        border-bottom: 1px solid #bbb;
        padding: 0.3em;
        vertical-align: top;
        word-wrap: break-word;
    }
    
    .observations tr :nth-child(1), .observations tr :nth-child(2) {
        /* ID */
        text-align: center;
        width: 5%;
    }
    .observations tr :nth-child(3) {
        /* Time */
        text-align: left;
        width: 10%;
    }
    .observations tr :nth-child(4) {
        /* Type */
        text-align: center;
        width: 15%;
    }
    .observations tr :nth-child(5) {
        /* URL */
        text-align: left;
        width: 30%;
    }
    .observations tr :nth-child(6) {
        /* Description */
        text-align: left;
        width: 40%;
    }
    
    tr:nth-child(even) {
        background-color: var(--table-stripe-color);
    }
    
    tr:hover {
        background-color: var(--table-hover-color);
    }
    
    th {
        background-color: var(--table-header-color);
        color: var(--table-header-text);
    }
    
    
    
    
    
    
    /*
     *  IDOL PREVIEW ICON
     *
    */
    
    div.idol_icon, div.agency_icon {
        position: relative;
        width: 68px;
        height: 68px;
    }
    
    img.idol_icon, img.agency_icon {
        width: 68px;
        height: 68px;
        border-radius: 50%;
    }
    
    div.idol_icon span.follower-count {
        display: inline-block;
        position: absolute;
        left: 0;
        bottom: 0;
    }
    div.idol_icon span.idol_state {
        display: inline-block;
        position: absolute;
        right: 0;
        bottom: 0;
    }
    
    
    
    /*
     *  IDOL DISPLAY
     *
    */
    
    .idol_name {
    
    }
    .idol_brief {
        
    }
    .idol_alias {
        
    }
    .idol_link {
        
    }
    
    
    
    
    
    
    /*
     *  AGENCY DISPLAY
     *
    */
    
    .group_name {
    
    }
    .group_brief {
        
    }
    .group_link {
        
    }
    .group_icon {
        
    }
    
    ul.idol-agencies {
        display:flex;
        flex-direction:row;
        flex-wrap:wrap;
        list-style-type: none;
    }
    
    ul.idol-agencies li {
        width: 68px;
        word-wrap:break-word;
        padding: 0.3em 1em;
    }    
}

@layer utilities {
    .upvote, .downvote {
        width: 1em;
        height: 1em;
        display: inline-block;
        border-radius: 50%;
    }
    .upvote {
        background-color: lightgray;
    }
    .downvote {
        background-color: lightgray;
    }
    .score_chosen.upvote {
        background-color: lightgreen;
    }
    .score_chosen.downvote {
        background-color: lightcoral;
    }
    .upvote svg, .downvote svg {
        width: 1em;
        height: 1em;
    }
}
