.youtube {
    color: #EE0F0F;
}

.rounded-corners {
    border-radius: 2%;
}

.md-typeset__table {
    width: 100%;
}

.md-typeset__table table:not([class]) {
    display: table
}

/* Tables wrapped in .table-fit shrink to their content instead of the page width */
.md-typeset .table-fit .md-typeset__scrollwrap,
.md-typeset .table-fit .md-typeset__table {
    width: auto;
}

.md-typeset .table-fit table:not([class]) {
    width: auto;
    min-width: 0;
}

/* Material gives every header cell min-width: 5rem, which is what stretches the table */
.md-typeset .table-fit table:not([class]) th,
.md-typeset .table-fit table:not([class]) td {
    min-width: 0;
    padding: .5em .75em;
}

/* Calendar table and its legend side by side */
.md-typeset .calendar-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: .8rem 1.6rem;
    /* same size Material uses for table text */
    font-size: .6rem;

}

.md-typeset .calendar-legend {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1em;
}

/* Grade: the individual and team boxes side by side, equal width */
.md-typeset .grade-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: .8rem 1.6rem;
}

/* framed group inside the legend */
.md-typeset .grade-box,
.md-typeset .calendar-legend-box {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    padding: .5rem .6rem;
    border: .05rem solid var(--md-typeset-table-color);
    border-radius: .2rem;
}

/* both boxes share the row at equal width */
.md-typeset .grade-box {
    flex: 1 1 0;
    min-width: 0;
}

.md-typeset .grade-box-title,
.md-typeset .calendar-legend-title {
    margin: 0;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    opacity: .65;
    /* same size Material uses for table text */
    font-size: .5rem;
}

.md-typeset .grade-box-title {
    font-size: .7rem;
}

/* the two grade tables size to their content, not to the box */
.md-typeset .grade-box .md-typeset__scrollwrap,
.md-typeset .grade-box .md-typeset__table {
    width: 100%;
    margin: 0;
    padding: 0;
}

.md-typeset .grade-box table:not([class]) {
    width: 100%;
    min-width: 0;
    border: none;
}

.md-typeset .grade-box table:not([class]) th,
.md-typeset .grade-box table:not([class]) td {
    min-width: 0;
    padding: .35em .6em;
}

.md-typeset .calendar-legend p {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .35rem;
    margin: 0;
}

.calendar-mexam, .calendar-mexamw, .calendar-fexam, .calendar-fexamw, .calendar-sexam,
.calendar-ssprint, .calendar-fsprint,
.calendar-eda, .calendar-classification, .calendar-regression {
    padding: 4px;
    border-radius: 4px;
    color: white;
}

/* Syllabus: quieter table chrome, emphasis on the lesson titles */
.md-typeset .syllabus h3 {
    margin: 1.8em 0 .4em;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--md-default-fg-color--light);
}

.md-typeset .syllabus .md-typeset__scrollwrap {
    margin-top: 0;
}

.md-typeset .syllabus table:not([class]) {
    border: none;
    border-radius: 0;
}

.md-typeset .syllabus table:not([class]) th {
    padding: .3em .8em;
    font-size: .55rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--md-default-fg-color--light);
    border-bottom: .05rem solid var(--md-typeset-table-color);
}

.md-typeset .syllabus table:not([class]) td {
    padding: .5em .8em;
}

.md-typeset .syllabus table:not([class]) th:first-child,
.md-typeset .syllabus table:not([class]) td:first-child {
    width: 2rem;
    min-width: 0;
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: var(--md-default-fg-color--light);
}

.md-typeset .syllabus table:not([class]) td:nth-child(2) {
    font-weight: 600;
}

.md-typeset .syllabus table:not([class]) td:last-child {
    color: var(--md-default-fg-color--light);
}

.calendar-mexam { background-color: #EE0F0F; }
.calendar-mexamw { background-color: #EECFCF; }
.calendar-fexam { background-color: crimson; }
.calendar-fexamw { background-color: #F0B0B0; }
.calendar-sexam { background-color: coral; }
.calendar-ssprint { background-color: blue; }
.calendar-fsprint { background-color: darkblue; }
.calendar-eda { background-color: green; }
.calendar-classification { background-color: darkseagreen; }
.calendar-regression { background-color: yellowgreen; }
/* Today's date, circled by javascripts/calendar-today.js */
.md-typeset .calendar-today {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-width: 2.1em;
    min-height: 2.1em;
    padding: .2em .3em;
    border: 2px solid var(--md-default-fg-color);
    border-radius: 999px;
    font-weight: 700;
    line-height: 1;
}
/* Click-to-copy email links (see javascripts/copy-email.js) */
.md-typeset a.copy-email {
    position: relative;
    cursor: copy;
}

.md-typeset a.copy-email[data-copied]::after {
    content: attr(data-copied);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: .4em;
    padding: .1em .5em;
    border-radius: .2rem;
    font-size: .7em;
    white-space: nowrap;
    color: var(--md-accent-bg-color);
    background: var(--md-accent-fg-color);
}

/* Slide decks (reveal.js, static HTML next to the lesson) embedded in a page:
   a 16:9 frame that scales with the content width */
.md-typeset .slides-embed {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    margin: 1em 0 .4em;
    border: 1px solid var(--md-default-fg-color--lightest);
    border-radius: 6px;
    overflow: hidden;
    background: var(--md-default-bg-color);
}

.md-typeset .slides-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* PDF embutido (Suporte: caderno de atividades e folha de consulta) */
.pdf-embed {
    margin: 1.2em 0 0.6em;
    border: 1px solid var(--md-default-fg-color--lightest);
    border-radius: 6px;
    overflow: hidden;
    background: var(--md-code-bg-color);
}
.pdf-embed iframe {
    display: block;
    width: 100%;
    height: min(88vh, 1100px);
    border: 0;
}

/* Long formulas scroll inside their own box instead of widening the page on a
   phone: display math (div) everywhere, inline math (span) only on narrow
   screens, where an inline-block with overflow would otherwise shift the
   baseline of every formula on desktop too. */
.md-typeset div.arithmatex,
.md-typeset mjx-container[display="true"] {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
}

@media screen and (max-width: 44.9375em) {
    .md-typeset span.arithmatex {
        display: inline-block;
        max-width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        vertical-align: middle;
    }
}

/* .table-fit tables shrink to their content but must not outgrow the column */
.md-typeset .table-fit,
.md-typeset .table-fit .md-typeset__scrollwrap {
    max-width: 100%;
    min-width: 0;
}
