/*
    This file is part of m.css.

    Copyright © 2017, 2018, 2019, 2020, 2021, 2022, 2023
              Vladimír Vondruš <mosra@centrum.cz>

    Permission is hereby granted, free of charge, to any person obtaining a
    copy of this software and associated documentation files (the "Software"),
    to deal in the Software without restriction, including without limitation
    the rights to use, copy, modify, merge, publish, distribute, sublicense,
    and/or sell copies of the Software, and to permit persons to whom the
    Software is furnished to do so, subject to the following conditions:

    The above copyright notice and this permission notice shall be included
    in all copies or substantial portions of the Software.

    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
    THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
    FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
    DEALINGS IN THE SOFTWARE.
*/

/* Grid container should always contain rows */
.m-container > * {
  background-color: #ff0000;
}
.m-container > .m-row {
  background-color: transparent;
}
/* Grid row should always contain columns or a clearfix */
.m-row > * {
  background-color: #ff0000;
}
.m-row > [class*='m-col-'], .m-row > [class*='m-clearfix-'] {
  background-color: transparent;
}

/* Grid container can't contain another container */
.m-container .m-container,

/* Grid column can't contain a column directly (unless it has some alignment in
   the same level) */
[class*='m-col-'] > [class*='m-col-t-']:not(.m-left-t):not(.m-right-t):not(.m-center-t),
[class*='m-col-'] > [class*='m-col-s-']:not(.m-left-t):not(.m-right-t):not(.m-center-t):not(.m-left-s):not(.m-right-s):not(.m-center-s),
[class*='m-col-'] > [class*='m-col-m-']:not(.m-left-t):not(.m-right-t):not(.m-center-t):not(.m-left-s):not(.m-right-s):not(.m-center-s):not(.m-left-m):not(.m-right-m):not(.m-center-m),
[class*='m-col-'] > [class*='m-col-l-']:not([class*='m-left-'):not([class*='m-right-'):not([class*='m-center-']),

/* m-center and m-fullwidth together is most probably a mistake */
.m-center.m-fullwidth,

/* m-scroll can't be applied to tables, as it doesn't go well with m-fullwidth */
table.m-scroll, table.m-scroll *,

/* Grid column can't be also m-note, m-block or m-frame ... as the margin would
   break things */
[class*='m-col-'].m-note, [class*='m-col-'].m-block, [class*='m-col-'].m-frame,
[class*='m-col-'].m-image, [class*='m-col-'].m-imagegrid, pre[class*='m-col-'],
[class*='m-col-'].m-code, [class*='m-col-'].m-figure, [class*='m-col-'].m-code-figure,

/* It's ugly to have something styled as two different things so it's illegal */
.m-block.m-note, .m-block.m-text, .m-note.m-frame, .m-note.m-text, .m-frame.m-text,

/* It's ugly to have notes, blocks, frames or colored text in (colored) notes
   so it's illegal */
.m-note .m-note, .m-note .m-block, .m-note .m-frame, .m-note .m-text,

/* Links shouldn't contain links */
a a
  { background-color: #ff0000; }
