/* ------------------------------
 | MODULAR TYPE SCALE
 | ------------------------------
 | Helps you create type scales that bring natural rhythm,
 | consistency, and balance to your designs.
 |
 | BASE VALUES:
 | - Font Size: 16px / 1rem
 | - Line Height: 24px / 1.5
 | - Letter Spacing: 15% / 0.15em
 |
 | SCALE:
 | - Ratio: 1.19 - Minor Third
 |
 | LINE GRID:
 | - Grid Unit: 4px / 0.25rem
 |
 |
 | Scale ratio is calculated using an equal temperament tuning system.
 | Created with Precise Type / https://precise-type.com
 | Tools & Models by Adonis Raul Raduca
 */

/* --- Font Sizes --- */

:root {
  /* below the base */
  --font-size-2b: 0.6875rem;
  --font-size-1b: 0.8125rem;

  /* the base */
  --font-size: 1rem;

  /* above the base */
  --font-size-1: 1.1875rem;
  --font-size-2: 1.4375rem;
  --font-size-3: 1.6875rem;
  --font-size-4: 2rem;
  --font-size-5: 2.375rem;
  --font-size-6: 2.8125rem;
  --font-size-7: 3.375rem;
}

/* --- Line Heights --- */

:root {
  /* below the base */
  --line-height-2b: 1.8182;
  --line-height-1b: 1.5385;

  /* the base */
  --line-height: 1.5;

  /* above the base */
  --line-height-1: 1.4737;
  --line-height-2: 1.3913;
  --line-height-3: 1.3333;
  --line-height-4: 1.25;
  --line-height-5: 1.2632;
  --line-height-6: 1.1556;
  --line-height-7: 1.1852;
}

/* --- Letter Spacings --- */

:root {
  /* below the base */
  --letter-space-2b: 0.2318em;
  --letter-space-1b: 0.1915em;

  /* the base */
  --letter-space: 0.15em;

  /* above the base */
  --letter-space-1: 0.1216em;
  --letter-space-2: 0.0952em;
  --letter-space-3: 0.0767em;
  --letter-space-4: 0.06em;
  --letter-space-5: 0.0458em;
  --letter-space-6: 0.034em;
  --letter-space-7: 0.0233em;
}

/* ------------------------------
 | Examples
 */

/* --- Default Text --- */

body {
  font-weight: 400;
  font-size: var(--font-size);
  line-height: var(--line-height);
  letter-spacing: var(--letter-space);
}

/* --- Headers --- */

:is(h1, h2, h3) {
  font-weight: 600;
}

h1 {
  font-size: var(--font-size-3);
  line-height: var(--line-height-3);
  letter-spacing: var(--letter-space-3);
}
h2 {
  font-size: var(--font-size-2);
  line-height: var(--line-height-2);
  letter-spacing: var(--letter-space-2);
}
h3 {
  font-size: var(--font-size-1);
  line-height: var(--line-height-1);
  letter-spacing: var(--letter-space-1);
}

/* --- Alternative Text Sizes --- */

:is(p, span, a, ul, ol, dl, li, dt, dd, label, blockquote, code) {
  &.small-text {
    font-size: var(--font-size-1b);
    line-height: var(--line-height-1b);
    letter-spacing: var(--letter-space-1b);
  }
  &.large-text {
    font-size: var(--font-size-1);
    line-height: var(--line-height-1);
    letter-spacing: var(--letter-space-1);
  }
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100svh;
    line-height: 1.5;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
}

input,
button,
textarea,
select {
    font: inherit;
    color: inherit;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
    overflow-wrap: break-word;
}

table {
    border-collapse: collapse;
    border-spacing: 0;
}

/* ------------------------------
 | SITE: CSD Instagram landing page
 | ------------------------------
 | Dark stage so the Instagram photos carry the page, with a Pride-flag
 | gradient as the only decorative accent.
 */

body {
    background: var(--theme-color-surface-muted, #0b0a12);
    color: var(--theme-color-ink, #e9e6f2);
    font-family: var(--theme-font-body, system-ui, sans-serif);
}

::selection {
    background: var(--ig-accent, #ff2d95);
    color: #fff;
}

:focus-visible {
    outline: 2px solid var(--ig-accent, #ff2d95);
    outline-offset: 3px;
}

/* --- Hero handle line --- */

.hero-handle {
    font-weight: 700;
    letter-spacing: 0.04em;
}

/*
 | KNOWN LIMITATION (shared Hero template, not this site):
 | below the 767px breakpoint the hero's text and actions slots do not render.
 | The eyebrow and heading do, which is why the handle sits in the eyebrow and
 | the name in the heading -- the phone hero still reads correctly. The follow
 | buttons for both profiles live in the "Wir sind hier." cards right below,
 | which render at every width. Overriding the slots' shift variables and
 | positions from here was tried and had no effect; the fix belongs in
 | system/templates/Hero. See the notes in tools/build-page.php.
 */

/* --- Profile cards (intro section) --- */

.profile-cards {
    display: grid;
    gap: clamp(0.75rem, 2vw, 1.25rem);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 21rem), 1fr));
    margin-block-start: clamp(1.25rem, 3vw, 2rem);
    text-align: start;
}

/*
 | The Article template paints link underlines with a background gradient on
 | every `a` inside .article__body. On a block-level card that gradient fills
 | the lower third of the box, so these two rules opt the card and the gallery
 | tiles out of it. Selectors are scoped to .article__body to outrank it.
 */
.article__body a.profile-card,
.article__body a.ig-grid__item {
    border: 0;
    background-image: none;
}

.article__body a.profile-card,
a.profile-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.85rem 1rem;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--theme-radius-md, 18px);
    background-color: rgba(255, 255, 255, 0.04);
    color: inherit;
    text-decoration: none;
    transition:
        transform var(--theme-transition-fast, 150ms ease),
        border-color var(--theme-transition-fast, 150ms ease),
        background-color var(--theme-transition-fast, 150ms ease);
}

.profile-card:hover,
.profile-card:focus-visible {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.28);
    background-color: rgba(255, 255, 255, 0.08);
}

.profile-card__avatar {
    position: relative;
    flex: 0 0 auto;
    width: 4.5rem;
    height: 4.5rem;
    padding: 3px;
    border-radius: 50%;
    /* Instagram-style ring, recolored to the Pride gradient. */
    background: conic-gradient(from 200deg, #e40303, #ff8c00, #ffed00, #008026, #24408e, #732982, #e40303);
}

.profile-card__avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid var(--theme-color-surface-muted, #0b0a12);
    object-fit: cover;
}

.profile-card__body {
    display: flex;
    flex: 1 1 9rem;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.profile-card__handle {
    font-size: var(--theme-font-size-base, 1rem);
    font-weight: 700;
    line-height: 1.3;
    color: #fff;
    overflow-wrap: anywhere;
}

.profile-card__name {
    font-size: var(--theme-font-size-md, 0.95rem);
    color: var(--theme-color-slate, #c3bdd6);
}

.profile-card__tagline {
    font-size: var(--theme-font-size-sm, 0.75rem);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--theme-color-muted, #9a93b3);
}

.profile-card__cta {
    flex: 0 0 auto;
    margin-inline-start: auto;
    padding: 0.45rem 1.1rem;
    border-radius: var(--theme-radius-pill, 999px);
    background: var(--ig-accent, #ff2d95);
    color: #fff;
    font-size: var(--theme-font-size-sm, 0.75rem);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* --- Instagram post grid --- */

/*
 | Article declares --article-body-max-width on .article__body itself, so a
 | value set on the article root is shadowed and cannot widen the body. Opt the
 | gallery and card bodies out of the reading measure from here instead.
 */
.article__body:has(> .ig-grid) {
    max-width: 100%;
}

.article__body:has(> .profile-cards) {
    max-width: 52rem;
}

.ig-grid {
    display: grid;
    gap: var(--ig-grid-gap, 0.5rem);
    grid-template-columns: repeat(auto-fill, minmax(var(--ig-grid-min, 120px), 1fr));
    margin-block-start: clamp(1rem, 2.5vw, 1.75rem);
}

.ig-grid__item {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 1;
    border-radius: var(--theme-radius-sm, 12px);
    background: var(--theme-media-background, #1d1a2b);
    transition: transform var(--theme-transition-fast, 150ms ease);
}

.ig-grid__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition:
        transform var(--theme-transition-slow, 220ms ease),
        opacity var(--theme-transition-fast, 150ms ease);
}

.ig-grid__item::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 2px solid transparent;
    border-radius: inherit;
    transition: border-color var(--theme-transition-fast, 150ms ease);
}

.ig-grid__item:hover img,
.ig-grid__item:focus-visible img {
    transform: scale(1.06);
    opacity: 0.85;
}

.ig-grid__item:hover::after,
.ig-grid__item:focus-visible::after {
    border-color: var(--ig-accent, #ff2d95);
}

.ig-grid__badge {
    position: absolute;
    inset-block-start: 0.4rem;
    inset-inline-end: 0.4rem;
    padding: 0.1rem 0.45rem;
    border-radius: var(--theme-radius-pill, 999px);
    background: rgba(11, 10, 18, 0.72);
    color: #fff;
    font-size: var(--theme-font-size-2b, 0.6875rem);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.ig-grid__footer {
    margin-block-start: clamp(1rem, 2.5vw, 1.5rem);
    font-size: var(--theme-font-size-md, 0.95rem);
}

/* --- Handle list + fineprint (outro section) --- */

.handle-list {
    list-style: none;
    display: grid;
    gap: 0.6rem;
    margin: clamp(1rem, 2.5vw, 1.5rem) 0 0;
    padding: 0;
    font-size: var(--theme-font-size-lg, 1.05rem);
}

/*
 | Article's link style is a background gradient that reads as a highlighter
 | pen. On these short, prominent handles a plain thick underline is cleaner.
 */
.article__body .handle-list a {
    border: 0;
    background-image: none;
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: var(--ig-accent, #ff2d95);
    text-decoration-thickness: 2px;
    text-underline-offset: 5px;
}

.fineprint {
    margin-block-start: clamp(1.5rem, 4vw, 2.5rem);
    font-size: var(--theme-font-size-sm, 0.75rem);
    color: var(--theme-color-muted, #9a93b3);
}

/* --- Pride rule above every gallery section --- */

/*
 | Matched by content, not by profile id, so each gallery gets the identical
 | treatment and adding a profile needs no CSS change. border-image paints every
 | side that has a width, so only the top border gets one.
 */
article.article:has(.ig-grid) {
    border-block-end: 0;
    border-inline: 0;
    border-block-start: 3px solid transparent;
    border-image: var(--pride-gradient, linear-gradient(90deg, #e40303, #732982)) 1;
}

@media (prefers-reduced-motion: reduce) {
    .profile-card,
    .ig-grid__item,
    .ig-grid__item img {
        transition: none;
    }

    .profile-card:hover,
    .profile-card:focus-visible,
    .ig-grid__item:hover img,
    .ig-grid__item:focus-visible img {
        transform: none;
    }
}
