/*  The userSelect property sets or returns whether the text of an element can be selected or not.*/

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-user-select: none; /* Safari */
    -ms-user-select: none; /* IE 10 and IE 11 */
    user-select: none; /* Standard syntax *//* CSS user-select Property */
    outline: none;
    outline-color: transparent;
    border: none;
    border-color: transparent;
}

*::-moz-focus-inner {
    border-style: none; /* Remove the inner border in Firefox. */
}

/*  :root pseufo-class | var() function used to insert the value of a CSS variable.*/
/*  Custom properties let you create and define custom variables that can be reused, 
    simplifying complex or repetitive rules and making them easier to read and maintain.*/

/*  This is an idea of MDN web docs | https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_cascading_variables. */
/*  HSL stands for Hue, Saturation, and Lightness. */
/*  Hue is a degree on the color wheel from 0 to 360. 
    0 (or 360) is red, 120 is green, 240 is blue.*/
    
/* Global scope */
:root {
    --hue: 25;
    --color0: hsl(calc(var(--hue) + 5), 100%, 40%);
    --color1: hsl(calc(var(--hue) + 10), 100%, 50%);
    --color2: hsl(calc(var(--hue) + 20), 50%, 40%);
    --color3: hsl(48, 100% ,93%);
    --color4: hsl(calc(var(--hue) + 40), 20%, 40%);
    --color5: hsl(calc(var(--hue) + 50), 70%, 40%);
    --colorHead: #332900;
    --border-bottom-hidden-cell: none;
    --solid-border: 4px solid hsl(60, 27%, 50%);
    --solid-border-small-screen: 2px solid hsl(60, 27%, 50%);
    --dashed-border: 1px dashed #332900;
    --backgroundColor: hsl(62, 87%, 25%);
    --Beige: Beige;
    --Black:  hsl(0, 0%, 20%);
    --Chocolate: Chocolate;
    --DarkBlue: DarkBlue;
    --DarkCian: DarkCyan;
    --Gainsboro: Gainsboro;
    --Green: Green;
    --Gray: Gray;
    --IndianRed: IndianRed;
    --Ivory: Ivory;
    --Olive: Olive;
    --Maroon: Maroon;
    --SaddleBrown:SaddleBrown;
    --SeaGreen: SeaGreen;
    --White: White;
    --WhiteSmoke: WhiteSmoke;
}

html {
    font-size: 16px;
    height: auto; /* It will automatically adjust the height to allow the content to be displayed correctly. */
    text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%; /* -webkit- vendor prefix for Safari*/
    -moz-text-size-adjust: 100%;  /* -moz- vendor prefix for Firefox */
    scroll-behavior: smooth; /* To add a smooth scrolling effect to the page. */
    overscroll-behavior: none;
    overflow-x: hidden;
    overflow-y: scroll; /* Add vertical scrollbar */
}

.flexBox {
    display: flex;
    display: -webkit-flex;
    align-items: center; /* Position the flex items in the center, inside the same container.*/
    justify-content: center;
    flex-flow: column nowrap; /* The "flex-direction: column;" stacks the flex items vertically (from top to bottom) */
}

.rowGap {
    row-gap: 2rem;
}

.comments {
    width: 100%;
    max-width: 960px;
    margin: 2rem 0 0 0;
    text-align: left;
}

[class*="paragraph"] {
    font: 400 1.2rem/1.5 "Verdana", sans-serif;
    text-indent: 20px;
    text-align: left;
    letter-spacing: -0.022em;
}

.note {
    font: 400 1rem/1.5 "Verdana", sans-serif;
    letter-spacing: -0.022rem;
    width: 100%;
    text-align: center;
}

code {
  font-family: Consolas,"courier new";
  color: var(--DarkBlue);
  background-color: #f1f1f1; /* special effect */
  padding: 2px 4px;
  font-size: 105%;
}

.variable-scope {/* flex item */
    flex: 100%;
    border: 5px groove white;
    width: 100%;
    max-width: 475px;
}

/*  For specific use on certain pages. */
/*  blockquote tag 
============================*/
/*  blocquote | with author */
#quote-author {
    font: 600 2rem  "Helvetica Neue", sans-serif;
    text-align: center;
    padding: 1rem;
    margin: 2rem 0 0 0;
}

#quote-author h2 {
    font: 400 1.4rem/1.5  "Helvetica Neue", sans-serif;
    text-align: right;
    padding: 0.5rem 0 0 0;
}

body {
    font-family: Verdana, sans-serif;
    background-color: hsl(60, 28%, 84%);
    text-align: center;
}

#containerTable {/* flex box*/
    padding: 64px 16px 128px 16px;
    margin-inline: auto;
    width: 100%;
    max-width: 960px;
}

.mainTitle {/* flex item */
    font: normal small-caps 400 45px Georgia, serif; /* font: font-style | font-variant | font-weight | font-size/line height | font-family */
    text-transform: capitalize;
    width: 100%;
}

/*  container table tag */
.container-table {
    width: 100%;
    max-width: 960px;
    padding: 2rem 1rem;
    border: 10px groove var(--WhiteSmoke); /* Required for border-image,in case the border image fails to load. Although the specification doesn't strictly require it, some browsers don't render the border image if border-style is none or border-width is 0. */
    border-image: repeating-linear-gradient(30deg,var(--color0),var(--color1),var(--color2), var(--color3), var(--color4), var(--color5));
    border-image-slice: 15%;
    border-image-width: 20px;
    border-image-repeat: stretch;
}

/*  Styling table */
table {/* flex item */
    width: 100%;
    border-collapse: collapse; /* This will make the borders collapse into a single border. */
    margin-inline: auto;
    table-layout: fixed; /* The table and column widths are set by the widths of table and col or by the width of the first row of cells.*/
}

caption,
th,
time {
    color: var(--colorHead);
}

caption {
    font-size: 20px;
    padding-bottom: 20px;
}

/*======= only by design =========*/
.time-hidden {
    font-weight: 300;
    border: none;
    visibility: hidden;
}

/*================================*/
th:not(.time-hidden) {
    height: 32px;
    border: var(--solid-border);
}

th {
    width: 15%;
}

td {
    width: 15%;
    height: 64px;
    border-right: var(--solid-border);
    border-left: var(--solid-border);
    background-origin: border-box;
    -webkit-background-origin: border-box;
    background-clip: padding-box;
    -webkit-background-clip: padding-box;
}

/*  CSS Child (>) Combinator | 
    Select elements that are direct children of a specific parent.*/

/*  The CSS :not() pseudo-class matches any element that is NOT the specified element/selector.*/
.sharp td:not(.time) {
    border-bottom: var(--solid-border);
}

.half td:not(.hidden-cell) {
    border-bottom: var(--dashed-border);
}

.sharp td.last-cell-row {
    border-bottom: var(--border-bottom-hidden-cell);
}

.half td.last-cell-row {
    border-bottom: var(--border-bottom-hidden-cell);
}

.time {
    font-weight: 300;
    font-size: 1rem;
    text-align: right;
    border: none;
    border-style: none;
    padding: 0 1rem 0 0;
}

.verticalAlignTop {
    vertical-align: top;
}

.verticalAlignBottom {
    vertical-align: bottom;
}

/*  To create an white space */
.hidden-cell {
    height: 10px;;
    border: none;
}

/*  background colors */
.available-0 {
    background-color: var(--color0);
}

.available-1 {
    background-color: var(--color1);
}

.available-2 {
    background-color: var(--color2);
}

.available-3 {
    background-color: var(--color3);
}

.available-4 {
    background-color: var(--color4);
}

.available-5 {
    background-color: var(--color5);
}

/*  tfoot */
#legend {
    text-align: center;
    color: var(--colorHead);
    font-size: 20px;
    font-weight: 300;
    border: none;
    padding-left: 15%;
    height: 64px;
}

#legend-gradient {
    border: none;
    height: 30px;
    width: 300px;
    /*  Linear Gradient - two-position color stops. */
    background-image: linear-gradient(to right, 
  var(--color0) 0% 17%,
  white,
  var(--color1) 18% 34%,
  white,
  var(--color2) 35% 51%,
  white,
  var(--color3) 52% 68%,
  white,
  var(--color4) 69% 84%,
  white,
  var(--color5) 85% 100%);
    background-origin: border-box;
    -webkit-background-origin: border-box;
    background-clip: border-box;
    -webkit-background-clip: border-box;
    background-color: antiquewhite;
}

.range-control {
    width: 100%;
    max-width: 960px;
    margin-inline: auto;
    border: 0;
}

.specialHeight {
    height: 32px;
}

.range-control #changeHueValue {
    display: block;
    margin-inline: auto;
    border: 0;
    cursor: pointer;
}

/*  empty span */
.whiteSpace {
    display: inline-block;
    width: .5rem;
    height: .5rem;
    font-size: 1rem;
}

/*  footer 
    =====*/
#information {grid-area: info;}
#signature {grid-area: signature;}

[class="authorship"] {
    font: 400 16px/1.5 Helvetica, sans-serif; /* Web Safe Fonts. */
    display: grid;
    column-gap: 1.7rem;
    grid-template-areas:'info   signature';
    grid-template-columns:  1fr auto;
    grid-template-rows: auto;
    padding: 2rem 1rem;
    color: var(--White);
    background-color: hsl(209, 12%, 35%);
    text-align: right;
    position: relative;
}

#information {
    font-style: normal;
}

#information time {
    color: var(--White);
}

#signature {
    max-width: 100px;
    align-self: center;
    margin: 0 0.7rem 0 0;
}

/*  image */
.responsive {
    display: block;
    width: 100%;
    height: auto;
    margin-inline: auto;
    background-color: var(--White);
    pointer-events: none; /* The pointer-events property defines whether or not an element reacts to pointer events. | Do not allow copying or downloading an image. */
    object-fit: cover;
}

/*  Links with
=======================================================*/
/*  To select elements with a specified attribute and value.
    class= .externalLink for more infformation */
.externalLink,
.externaLink:visited {
    display: inline-block;
    text-indent: 0;
    padding: 0 6px;
    transition: 0.3s;
    -webkit-transition: 0.3s;
}
.externalLink,
.externalLink:visited {
    color: var(--Black);
}

.externalLink:hover {
    text-decoration: none;
    text-decoration-thickness: 0;
    text-underline-offset: 0;
    color: var(--Ivory);
    background-color: var(--Maroon); 
    border-radius: 7px;
}

.line {
    text-decoration: underline;
    text-decoration-thickness: 2px; /* To set the thickness of the decoration line. */
    text-underline-offset: 5px; /* To improve readability, I use CSS properties like text-underline-offset to separate the text from the line. */
}

/* button tag to open tab preview */
#open-tab-preview {
    font-size: 16px;
    padding: 6px;
    border-radius: 10px;
    text-indent: 0;
    text-align: center;
    color: black;
    background-color: aliceblue;
    background-image: linear-gradient(180deg, aliceblue, hsl(209, 12%, 35%));
    cursor: pointer;
}

#open-tab-preview:hover {
    background-color: hsl(209, 12%, 20%);
    background-image: linear-gradient(180deg, hsl(209, 12%, 45%), hsl(209, 12%, 20%));
    color: white;
}

/*  Responsive layout - when the screen is less than 768px wide. */
@media screen and (max-width: 768px) {
    #containerTable {
        padding: 32px 16px 64px 16px;
        row-gap: 32px;
    }

    .mainTitle {
        font: normal small-caps 400 35px Georgia, serif; /* font: font-style | font-variant | font-weight | font-size/line height | font-family */
        text-transform: capitalize;
        padding-left: 0;
    }

    th:not(.time-hidden) {
        height: 32px;
        border: var(--solid-border);
        font-weight: normal;
    }

    .sharp td.last-cell-row {
        border-bottom: var(--border-bottom-hidden-cell);
    }

    [class*="paragraph"] {
        font: 400 1.2rem/1.5 "Verdana", sans-serif;
        letter-spacing: -0.022em;
        text-align: left;
    }

    #quote-author {
        font: 600 2rem  "Helvetica Neue", sans-serif;
        text-align: left;
        padding: 1rem 0;
        margin: 2rem 0 0 0;
    }
}

/* A common breakpoint used for media queries: mobile devices. */
@media (min-width: 300px) and (max-width: 480px) {
    body {
        background-color: hsl(209, 12%, 65%);
    }

    #containerTable {
        background-color: hsl(60, 28%, 84%);
    }

    .container-table {
        border: none;
        padding: 2rem 0;
    }

    /*  Styling table */
    table {
        width: 100%;
        border-collapse: collapse; 
        margin-inline: auto;
        table-layout: fixed; 
    }

    th:not(.time-hidden) {
        height: 32px;
        border: var(--solid-border-small-screen);
        font-weight: normal;
        font-size: 15px;
    }

    .sharp td:not(.time){
        border-bottom: var(--solid-border-small-screen);
    }

    td {
        height: 64px;
        border-right: var(--solid-border-small-screen);
        border-left: var(--solid-border-small-screen);
        background-origin: border-box;
        -webkit-background-origin: border-box;
        background-clip: padding-box;
        -webkit-background-clip: padding-box;
    }

    .time {
        font-weight: 300;
        font-size: 13px;
        text-align: right;
        border: none;
        border-style: none;
        padding: 0 .1rem 0 0;
    }

    .sharp td.last-cell-row {
        border-bottom: var(--border-bottom-hidden-cell);
    }

    .paragraph {
        text-indent: 0;
    }

    #quote-author {
        padding: 0;
    }

    /*  footer 
        =====*/
    [class="authorship"] {
        column-gap: 1rem;
    }
    
    #signature {
        margin: 0;
    }
}