/* ═══════════════════════════════════════════════════════════
   IPYP Typography – CMS content styles
   Scoped under .typography (applied by SilverStripe to $Content)
   ═══════════════════════════════════════════════════════════ */


/* ── HEADINGS ── */
.typography h1,
.typography h2,
.typography h3,
.typography h4,
.typography h5,
.typography h6 {
    font-family: var(--font-family);
    font-weight: 700;
    color: var(--text-color);
    margin-top: 1.5em;
    margin-bottom: 0.6em;
    line-height: 1.25;
}

.typography h1 {
    font-size: 2.25em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.4em;
    margin-top: 0;
}

.typography h2 {
    font-size: 1.75em;
}

.typography h3 {
    font-size: 1.4em;
}

.typography h4 {
    font-size: 1.15em;
}

.typography h5 {
    font-size: 1em;
}

.typography h6 {
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}


/* ── PARAGRAPHS & INLINE ── */
.typography p,
.typography.prose p,
.typography.prose-xl p {
    font-size: 1em;
    line-height: 1.7;
    margin: 0 0 1.25em;
    color: var(--text-muted);
}

.typography.prose h1, .typography.prose-xl h1 { font-size: 2.25em; }
.typography.prose h2, .typography.prose-xl h2 { font-size: 1.75em; }
.typography.prose h3, .typography.prose-xl h3 { font-size: 1.4em; }
.typography.prose h4, .typography.prose-xl h4 { font-size: 1.15em; }
.typography.prose h5, .typography.prose-xl h5 { font-size: 1em; }
.typography.prose h6, .typography.prose-xl h6 { font-size: 0.9em; }

.typography strong {
    font-weight: 700;
    color: var(--text-color);
}

.typography em {
    font-style: italic;
}

.typography small {
    font-size: 0.85em;
}


/* ── LINKS ── */
.typography a {
    color: var(--accent-red);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.typography a:hover {
    color: #ff5555;
    border-bottom-color: var(--accent-red);
}


/* ── LISTS ── */
.typography ul,
.typography ol,
.typography dl {
    margin: 0 0 1.25em 1.5em;
    color: var(--text-muted);
}

.typography ul li {
    list-style-type: disc;
}

.typography ol li {
    list-style-type: decimal;
}

.typography li {
    margin-bottom: 0.4em;
    line-height: 1.6;
}

.typography dl dt {
    font-weight: 700;
    color: var(--text-color);
}

.typography dl dd {
    margin: 0 0 0.5em 1em;
}


/* ── TABLES ── */
.typography table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 1.5em;
    font-size: 0.9rem;
}

.typography table th,
.typography table td {
    padding: 0.6em 1em;
    border: 1px solid rgba(255, 255, 255, 0.1);
    vertical-align: top;
    text-align: left;
}

.typography table th {
    font-weight: 700;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
}

.typography table tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.03);
}


/* ── TEXT ALIGNMENT (CMS editor classes) ── */
.typography .left {
    text-align: left;
}

.typography .center {
    text-align: center;
}

.typography .right {
    text-align: right;
}


/* ── IMAGES (CMS insert image alignment) ── */
.typography img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

.typography img.left {
    float: left;
    max-width: 50%;
    margin: 0.25em 1.5em 1em 0;
}

.typography img.right {
    float: right;
    max-width: 50%;
    margin: 0.25em 0 1em 1.5em;
}

.typography img.leftAlone {
    float: left;
    margin: 0 100% 1em 0;
    clear: both;
}

.typography img.center {
    float: none;
    display: block;
    margin: 0 auto 1em;
    clear: both;
}


/* ── CAPTION IMAGES (CMS "Insert media" with caption) ── */
.typography .captionImage {
    width: 100%;
    margin-top: 0.25em;
}

.typography .captionImage img {
    margin: 0;
    border-radius: 6px;
}

.typography .captionImage.left {
    float: left;
    margin: 0.25em 1.5em 1.25em 0;
}

.typography .captionImage.right {
    float: right;
    margin: 0.25em 0 1.25em 1.5em;
}

.typography .captionImage.left[style],
.typography .captionImage.right[style] {
    max-width: 50%;
}

.typography .captionImage.left img,
.typography .captionImage.right img {
    float: none;
    max-width: none;
    width: 100%;
}

.typography .captionImage.leftAlone {
    float: none;
    margin: 0 0 1.25em;
}

.typography .captionImage.center {
    margin: 0 auto 1.25em;
}

.typography .captionImage p {
    clear: both;
    margin: 0.35em 0 0;
    font-style: italic;
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.5);
}


/* ── BLOCKQUOTES ── */
.typography blockquote {
    margin: 0 0 1.5em;
    padding: 1em 1.5em;
    border-left: 4px solid var(--accent-purple);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 0 6px 6px 0;
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
}

.typography blockquote p {
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 0.5em;
}

.typography blockquote p:last-child {
    margin-bottom: 0;
}


/* ── CODE / PRE ── */
.typography pre {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    padding: 1em 1.25em;
    margin: 0 0 1.5em;
    overflow-x: auto;
    clear: both;
}

.typography code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
    background: rgba(255, 255, 255, 0.06);
    padding: 0.15em 0.4em;
    border-radius: 4px;
}


/* ── HORIZONTAL RULE ── */
.typography hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 2em 0;
}


/* ── ADDRESS ── */
.typography address {
    display: block;
    font-style: normal;
    margin-bottom: 1.25em;
    color: var(--text-muted);
}


/* ── CLEARFIX (after floated images) ── */
.typography::after {
    content: '';
    display: table;
    clear: both;
}