:root {
    --brand-color: var(--gray);
    --brand-color-dark: var(--gray-dark);

    --sidebar-width: calc(var(--global-fr) * 3 + var(--grid-gap) * 2);
    --field-width: calc(50vw - var(--site-max-width)/2);
}

html, 
.main-body {
  height: 100%;
  margin: 0;
}

.main-main {
    padding: var(--header-height) var(--space-md) var(--space-md);
}

.main-content {
    grid-template-rows: 1fr 1fr auto;
    height: 100%;
}

.main-hero {
    grid-column: 4/span 6;
    grid-row: 1/span 2;
    display: flex;
    align-items:flex-start;
}

.sidenote-wrapper .sidenote {
    font-weight: var(--font-weight-light);
    padding-top: var(--space-xs);
}

blockquote {
    background-image: url('/assets/img/common/app/mark-quote.svg');
}

.highlight {
    margin-bottom: var(--space-md);
}

.main-footnote {
    grid-column: 4/span 4;
    grid-row: 3/span 1;
    align-self: end;
    font-size: var(--font-size-sm);
    line-height: 1.2em;
    color: var(--text-color-light);
    border-top: 2px solid var(--border-color);
}

.main-footnote a {
    color: var(--text-color-light);
}

.the-story article {
    h1, h2, h3, h4, h5 {
        font-family: "PT Serif", serif;
        font-optical-sizing: auto;
        max-width: var(--text-content-width);
        text-align: center;
        text-transform: none;
    }
    h2 {
        font-size: 2.2em;
        line-height: 1em;
        margin-bottom: var(--space-lg);
    }
    h3 {
        font-size: 1.8em;
        line-height: 1.4em;
        margin: var(--space-lg) 0;
    }
    h4 {
        font-size: 1.5em;
        margin: var(--space-lg) 0;
    }
    h5 {
        font-size: 1.2em;
        margin: var(--space-md) 0;
    }
    p {
        margin: var(--space-sm) 0;
    }
    p, ul, ol, blockquote {
        font-family: "PT Serif", serif;
        font-optical-sizing: auto;
        font-size: var(--font-size-lg);
        line-height: 1.5em;
    }
    cite {
        font-family: "PT Serif", serif;
        color: var(--text-color-light);
    }

    .sidenote p,
    .footnote-inside-text p, 
    .note p {
        font-family: var(--primary-font);
        font-size: var(--font-size-sm);
        line-height: 1.3em;
    }

    .teaser-bottom h3 {
        text-align: left;
        margin: var(--space-xs) 0;
    }
}

header {
    font-family: 'Cousine', monospace;
    font-weight: var(--font-weight-bold);
    height: var(--header-height);
}

.header-logo-wrapper {
    padding: 0;
}

.nav-global ul,
.sidebar-header {
    text-transform: lowercase;
}

h1, h2, h3, h4 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    text-transform: lowercase;
}

.nav-hamburger {
    height: 90vh;
}

.nav-hamburger.active {
    box-shadow: var(--shadow-lg);
}

.page-title {
    text-transform: lowercase;
}

.tags {
    width: 75%;
}

.sidebar-meta .sidebar-header {
    color: var(--primary-color);
}

.sidebar select {
    width: 100%;
    margin-left: calc(-1 * var(--space-sm));
    padding: var(--space-xs) var(--space-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

.sidebar img {
    width: 60%;
    @media (max-width: 768px) {
        & {
            display: none;
        }
    }
}

nav a.link,
.sidebar a.link,
a.link {
    text-decoration: underline;
    display: inline;
}

.img-scale {
    cursor: pointer;
    transition: transform 0.3s ease;
}

.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    object-fit: contain;
    background: rgba(255,255,255,0.95);
    z-index: 9999;
    margin: auto;
    padding: 20px;
    box-sizing: border-box;
}

.wide-background {
    position: relative;
    width: 100vw;
    margin-left: calc(-1 * var(--sidebar-width) - var(--grid-gap-global) - var(--field-width));

    @media (769px <= width <= 1116px) {
        & {
            margin-left: calc(-1 * var(--sidebar-width) - var(--grid-gap-global) - var(--base-unit));
        }
    }

    @media (max-width: 768px)  {
        & {
            margin-left: calc(-1 * var(--base-unit));
        }
    }
}

.wide-background img {
    width: 100%;
    height: auto;
    display: block;
}

.wide-background-wrapper {
    padding-left:  calc(var(--field-width) + var(--sidebar-width) + var(--grid-gap-global));
}

.wide-background-content {
    padding: var(--space-lg) var(--space-lg) var(--space-lg) 0;
}

.wide-background-lead-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 90%;
    margin: 0 auto;
    text-align: center;
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--gray-light);
    -webkit-text-stroke: 1.5px var(--gray-dark);
    transform: translateY(0rem);
    font-size: 72px;
    line-height: 75px;
    text-transform: uppercase;
}

.scroll-container {
    overflow: auto;
}

.list-columns {
    display: grid;
    grid-template-columns: 50% 50%;
    gap: var(--grid-gap);
    width: 100%;
    list-style: none;
    padding: 0;
    margin: 0;
}

.rare-square {
    display: inline-block;
    aspect-ratio: 1/1;
    background-image: url('/assets/img/common/app/rare-stripe.svg');
    background-repeat: no-repeat;
    background-size: auto 200%;
    background-position: 0 0%;
    height: calc(var(--font-size) * 1.3);
    vertical-align: middle;
}

.rare-footer-sign:has(a:hover) .rare-square {
  background-position: 0 100%;
}

.carousel {
  position: relative;
  width: 100%;
  margin: 0 auto;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-track {
  width: 100%;
  display: flex;
  transition: transform 0.3s;
}

.carousel-img {
  min-width: 100%;
  object-fit: cover;
  display: none;
}

.carousel-img.active {
  display: block;
}

.carousel-arrow {
  background: rgba(0,0,0,0.5);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 2.5rem;
  width: 40px;
  height: 40px;
  cursor: pointer;
  z-index: 2;
  position: absolute;
}

.carousel-arrow .material-icons {
    top: 0;
}

.carousel-arrow.left {
  left: 10px;
}

.carousel-arrow.right {
  right: 10px;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background-color: rgba(255, 255, 255, 0.5);
  transition: all 0.3s ease;
}

.carousel-dot.active {
  width: 24px;
  background-color: white;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-xs);
}

.gallery-item {
    grid-column: span 1;
    background-size: cover;
    aspect-ratio: 1/1;
    display: flex;
    align-items: self-end;
    padding: var(--space-sm);
}

.rare-sign-large {
    display: block;
    width: 75px;
    height: 75px;
    background-image: url('/assets/img/common/app/rare-stripe-large.svg');
    background-repeat: no-repeat;
    background-size: auto 200%;
    background-position: 0 0%;
}

.rare-sign-large:hover {
  background-position: 0 100%;
}

.pub-sign-large {
    display: block;
    width: 75px;
    height: 75px;
    background-image: url('/assets/img/common/app/pub-stripe-large.svg');
    background-repeat: no-repeat;
    background-size: auto 200%;
    background-position: 0 0%;
}

.pub-sign-large:hover {
  background-position: 0 100%;
}

.lead {
    margin-left: calc(-1 * var(--space-lg));
}

@media (max-width: 768px) {
    .gallery {
        grid-template-columns: repeat(1, 1fr);
    }

    .page-title {
        padding: 0;
    }

    h1 {
        font-size: var(--font-size-xxl);
        margin-bottom: var(--space-md);
    }

    .tags {
        width: 100%;
    }

    .sidebar select {
        width: unset;
    }

    .footnote-inside-text {
        float: none;
        width: 100%;
    }

    .main-body .header-logo-wrapper {
        grid-column: 1 / span 2;
    }

    .main-body .nav-global {
        grid-column: 3 / span 2;
    }

    .main-intro {
        grid-column: 3/span 4;
        padding-left: var(--space-md);
        overflow-x: auto;
    }
    .main-hero {
        grid-column: 1/span 6;
        grid-row: 2/span 2;
    }
    .main-footnote {
        grid-column: 3/span 4;
    }
}
