/*!
 * Copyright 2022 youngmonkeys.org
 *
 * Licensed under the ezyplatform, Version 1.0.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://youngmonkeys.org/licenses/ezyplatform-1.0.0.txt
 *
 * 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.
*/

/*** code ***/
div.block-wrapper[type="code"] {
    background-color: #1e1e1e;
    border-radius: 6px;
    padding: 1rem;
    margin: 1.5rem 0;
    overflow-x: auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
}

div.block-wrapper[type="code"] pre {
    margin: 0;
    font-family: 'Fira Code', 'Courier New', monospace;
    color: #f8f8f2;
    white-space: pre;
}

/*** iframe ***/
div.block-wrapper[type="embed"] {
    margin: 2rem 0;
    text-align: center;
    font-size: 90%;
}

div.block-wrapper[type="embed"] .iframe-container {
    position: relative;
    max-width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

div.block-wrapper[type="embed"] .iframe-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 8px;
}

div.block-wrapper[type="embed"] .iframe-caption {
    font-size: 0.95rem;
}

/*** image ***/
div.block-wrapper[type="image"] {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

div.block-wrapper[type="image"] .image-caption {
    font-size: 90%;
    text-align: center;
}

div.block-wrapper[type="image"] img[stretched="true"] {
    width: 120% !important;
    max-width: 120% !important;
}

/*** link tool ***/
div.block-wrapper[type="linkTool"] .link-content {
    background: #fff;
    border: 1px solid rgba(201, 201, 204, 0.48);
    box-shadow: 0 1px 3px #0000001a;
    border-radius: 6px;
    will-change: filter;
    animation: link-in 0.45s 1 cubic-bezier(0.215, 0.61, 0.355, 1);
    overflow: hidden;
    max-width: 800px;
    display: block;
    padding: 25px;
    color: initial !important;
    text-decoration: none !important;
}

div.block-wrapper[type="linkTool"] .link-image {
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
    margin: 0 0 0 30px;
    width: 65px;
    height: 65px;
    border-radius: 6px;
    float: right;
}

div.block-wrapper[type="linkTool"] .link-title {
    font-size: 110%;
    font-weight: 600;
    line-height: 1.5em;
    margin: 0 0 10px;
}

div.block-wrapper[type="linkTool"] .link-description {
    margin: 0 0 20px;
    line-height: 1.55em;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

div.block-wrapper[type="linkTool"] .link-anchor {
    display: block;
    font-size: 90%;
    line-height: 1em;
    color: #888 !important;
    border: 0 !important;
    padding: 0 !important;
}

/*** list ***/
div.block-wrapper[type="list"] ul[list-style="checklist"],
div.block-wrapper[type="list"] li.list-item-checkbox ul {
    list-style: none;
}

div.block-wrapper[type="list"] li.list-item-checkbox .item-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

div.block-wrapper[type="list"]  ol[list-style="ordered"] {
    margin: 0;
    outline: none;
    display: grid;
    gap: 8px;
    padding: 6px;
    counter-reset: item;
}

div.block-wrapper[type="list"]  ol[list-style="ordered"] li {
    line-height: 1.45em;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    grid-template-areas:
        "checkbox content"
        ". child";
}

div.block-wrapper[type="list"]  ol[list-style="ordered"] li:before {
    counter-increment: item;
    white-space: nowrap;
    content: counters(item, ".", var(--list-counter-type)) ".";
}

div.block-wrapper[type="list"]  ol[list-style="ordered"] li div.item-content {
    word-break: break-word;
    white-space: pre-wrap;
    grid-area: content;
    padding-left: 8px;
}

div.block-wrapper[type="list"]  ol[list-style="ordered"] li {
    content: counters(item, ".", var(--list-counter-type)) ".";
}

div.block-wrapper[type="list"]  ol[list-style="ordered"] li ol {
    display: grid;
    grid-area: child;
    gap: 8px;
    padding-top: 8px;
    counter-reset: item;
}

/*** quote ***/
div.block-wrapper[type="quote"] {
    border-left: 4px solid #007acc;
    background: #f9f9f9;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    border-radius: 6px;
    position: relative;
}

div.block-wrapper[type="quote"] blockquote {
    margin: 0;
    padding: 0;
    border: none;
    background: none;
}

div.block-wrapper[type="quote"] .quote-body {
    font-size: 110%;
    line-height: 1.6;
    color: #333;
}

div.block-wrapper[type="quote"] .quote-caption {
    display: block;
    margin-top: 0.75rem;
    font-size: 90%;
    font-style: normal;
    color: #666;
    text-align: right;
}

/*** table ***/
div.block-wrapper[type="table"] {
  overflow-x: auto;
  margin: 2rem 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

div.block-wrapper[type="table"] table {
  width: 100%;
  border-collapse: collapse;
  background-color: #fff;
}

div.block-wrapper[type="table"] thead td {
  background-color: #f0f4f8;
  font-weight: 700;
  text-align: left;
  padding: 4px 8px;
  border: 1px solid #ced4da;
}

div.block-wrapper[type="table"] tbody td {
  padding: 4px 8px;
  border: 1px solid #ced4da;
}

div.block-wrapper[type="table"] tbody tr:hover {
  background-color: #f9fbfc;
}
