/*
 * SPDX-FileCopyrightText: 2026 fsmhj <fsmhj@mailfence.com>
 *
 * SPDX-License-Identifier: AGPL-3.0-or-later
 */

@import "reset.css";
@import "components.css";
@import "utilities.css";

@custom-media --mobile-screen (width < 480px);
@custom-media --tablet-screen (width < 768px);
@custom-media --laptop-screen (width < 1024px);
@custom-media --desktop-screen (width < 1440px);
@custom-media --widescreen (width > 1441px);

:root {
  --pdx-flag-green: #046a38;
  --pdx-flag-white: #ffffff;
  --pdx-flag-yellow: #ffb81c;
  --pdx-flag-blue: #418fde;
  --pdx-flag-vertical: linear-gradient(
    var(--pdx-flag-green) 00% 32.96%,
    var(--pdx-flag-white) 32.96% 37.5%,
    var(--pdx-flag-yellow) 37.5% 46.59%,
    var(--pdx-flag-white) 46.59% 51.13%,
    var(--pdx-flag-blue) 51.13% 60.22%,
    var(--pdx-flag-white) 60.22% 64.77%,
    var(--pdx-flag-yellow) 64.77% 73.86%,
    var(--pdx-flag-white) 73.86% 78.40%,
    var(--pdx-flag-green) 78.40% 100%
  );
  --pdx-rose-city-red: #a33f3f;
  --soft-white: #f5f7f6;

  --color-grey-20: #2d3034;
  --color-grey-80: #edeef0;

  --color-background-secondary: light-dark(var(--color-grey-80), var(--color-grey-20));
  --radius-normal: 0.25rem;

  --font-family-code: monospace;
}

html {
  font-family: Inter, system-ui, Roboto, "Helvetica", "Arial", sans-serif;
  line-height: 1.5;
}

body {
  background: var(--soft-white);
}

:not(pre) code {
  background-color: var(--color-background-secondary);
  border-radius: var(--radius-normal);
  font-family: var(--font-family-code);
  padding: 0.125rem 0.25rem;
}

header,
main,
nav {
  padding: 0 2rem;

  @media(min-width: 1100px) {
    padding: initial;
  }
}

details > summary {
  cursor: pointer;
}

footer.footer-container {
  padding: 1rem 2rem;
}

p {
  margin-top: 1rem;
  margin-bottom: 1rem;
}

table {
  border: 1px solid #000;
  border-collapse: collapse;
  table-layout: fixed;

  & th,
  & td {
    border: 1px solid #000;
  }

  &.tile-suits-table,
  &.tile-honours-table,
  &.scoring-sticks-table {
    border: none;

    & th,
    & td {
      border: none;
    }

    & th[scope="row"] {
      padding-right: 1rem;
    }

    & td {
      padding: 0.25rem;
    }
  }

  &.tile-suits-table,
  &.tile-honours-table {
    & td {
      text-align: center;
    }
  }
}

dl {
  & dt {
    font-weight: bold;
  }

  &.card-group {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }

  &.game-rules {
    & dd {
      margin-bottom: 1em;

      & > img {
        display: inline-block;
        height: 1rem;
      }
    }
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.content {
  max-width: 1100px;
  margin: 0 auto;
}

/* This is not nested in the .card-group class because there are other sections that do not need to be in a grid */
& .card {
  background: #fff;
  padding: 1rem;
  border-radius: 12px;
  box-shadow: 0 8px 4px rgba(9, 24, 18, 0.1);
  transition: box-shadow 0.15s;

  &:hover {
    outline: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 8px 4px rgba(9, 24, 18, 0.2);
  }
}

.hero-title {
  font-size: 1.6rem;
  color: var(--pdx-rose-city-red);
}

.location {
  margin: 1rem 0;

  & .location-summary {
    display: grid;
    grid-template-columns: 1fr;
    margin-top: 1rem;
    margin-bottom: 1rem;

    @media(min-width: 640px) {
      grid-template-columns: 1fr 2fr;
    }
  }
}

nav.nav-main {
  background: var(--pdx-flag-green);

  & .content {
    display: flex;
    align-items: center;
    flex-flow: column;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding: 1rem 0;

    & ul.nav-items  {
      display: flex;
      gap: 0.5rem;
      list-style: none;
      margin-top: 1rem;
      padding: 0;

      & a {
        color: #fff;
        font-weight: 700;
        padding: 0.5rem 0.6rem;
        border-radius: 6px;

        &:hover {
          background: rgba(255, 255, 255, 0.1);
        }
      }
    }

    @media(min-width: 640px) {
      flex-flow: row;

      & ul.nav-items  {
        gap: 1 rem;
        margin: 0;
      }
    }
  }
}

.pictures-container {
  color: #fff;

  &.bg-color-rose-city-red {
    background: color-mix(in srgb, var(--pdx-rose-city-red));
  }

  & ul {
    border-radius: 5px;
    padding: 2rem 1rem 1rem; /* The bottom padding accounts for the 0.75rem caption font size. */
    list-style: none;
    display: grid;
    gap: 0.5rem;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }

  & figure {
    & figcaption {
      font-size: 0.75rem;
      font-style: italic;
      text-align: center;
    }

    & img {
      border-radius: 10px;
    }
  }
}

.quick-details-grid {
  margin-top: 1rem;
  margin-bottom: 1rem;

  & .location-title {
    text-decoration: underline;
  }
}

.site-title,
.site-subtitle {
  color: #fff;

  & a {
    text-decoration: none;
  }
}

.site-title {
  font-weight: 800;
  font-size: 1rem;
}

.site-subtitle {
  display: block;
  font-size: 0.75rem;
}

.tiles-example {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 1rem;

  & .tile-group {
    display: flex;
    align-content: center;

    & .tile-claim {
      transform: rotateZ(-90deg) translateX(3px) translateY(100%);
      transform-origin: bottom left;
      margin-right: 1.4rem;
      margin-left: -0.2rem;

      &.upgraded-quad {
        display: flex;
        flex-flow: row;
        margin-left: 0.25rem;
      }
    }

    &.upgraded-quad-container {
      margin-top: 3rem;
    }
  }
}

.tiles-unicode {
  font-size: 5rem;
  height: 5rem;
  transform: translateY(-8px);
  padding: 0;
  line-height: 1;
}

/* Red five tiles (akadora). */
[data-mpsz="0m"],
[data-mpsz="0p"],
[data-mpsz="0s"] {
  color: #a50b01;
}

.pdx-flag {
  aspect-ratio: 600 / 360;
  background: var(--pdx-flag-vertical);
  display: inline-grid;
  height: 1em;
  position: relative;
  overflow: hidden;
}
