/* Shared styles for Postle graphic templates. Rendered at 1080 px wide in
   three sizes: square (1080×1080), portrait (1080×1350), story (1080×1920). */

:root {
  --red: #8c0b0b;
  --red-tint: #f6d9d9;
  --black: #0d0d0d;
  --white: #ffffff;
  --ash: #e4e4e4;
  --ash-light: #f4f4f4;
  --brass: #b08d57;
  --gray: #3a3a3a;

  /* Outer margin and safe areas. Stories keep clear of the top bar and reply box. */
  --pad: 96px;
  --safe-top: 0px;
  --safe-bottom: 0px;
}

html[data-size="story"] {
  --pad: 104px;
  --safe-top: 200px;
  --safe-bottom: 300px;
}

* {
  box-sizing: border-box;
  margin: 0;
}

html,
body {
  width: 1080px;
  height: var(--h, 1080px);
  overflow: hidden;
}

html[data-size="square"] { --h: 1080px; }
html[data-size="portrait"] { --h: 1350px; }
html[data-size="story"] { --h: 1920px; }

body {
  font-family: var(--font-body, "Archivo"), sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

.card {
  position: relative;
  width: 100%;
  height: 100%;
  padding: calc(var(--pad) + var(--safe-top)) var(--pad) calc(var(--pad) + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* Themes. Each sets four colors; a church brand kit overrides them inline. */
[data-theme="black"] { --bg: var(--black); --fg: var(--white); --accent: var(--brass); --mark: var(--red-tint); }
[data-theme="red"] { --bg: var(--red); --fg: var(--white); --accent: var(--red-tint); --mark: var(--red-tint); }
[data-theme="ash"] { --bg: var(--ash-light); --fg: var(--black); --accent: var(--red); --mark: var(--red); }
[data-theme="brass"] { --bg: var(--brass); --fg: var(--black); --accent: var(--black); --mark: var(--white); }

.card {
  background: var(--bg);
  color: var(--fg);
}

/* Church logo, top right. The eyebrow row keeps clear of it. */
.brand-logo {
  position: absolute;
  top: calc(var(--pad) + var(--safe-top) - 8px);
  right: var(--pad);
  max-width: 300px;
  max-height: 88px;
  object-fit: contain;
  object-position: right top;
}
.card[data-logo] .eyebrow {
  padding-right: 330px;
  min-height: 80px;
}
.card[data-logo] .eyebrow[data-empty] {
  display: block !important;
  visibility: hidden;
}

.eyebrow {
  font-weight: 800;
  font-size: 34px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  line-height: 1.2;
}

.display {
  font-family: var(--font-heading, "Archivo Black"), sans-serif;
  font-weight: var(--font-heading-weight, 400);
  letter-spacing: -0.02em;
  line-height: 0.95;
  text-transform: uppercase;
}

.scripture {
  font-family: var(--font-scripture, "Cormorant Garamond"), serif;
  font-style: italic;
  font-weight: 500;
  line-height: 1.12;
}

.body-text {
  font-size: 40px;
  line-height: 1.35;
  font-weight: 500;
}

.details {
  font-size: 38px;
  font-weight: 700;
  line-height: 1.3;
}

/* Words wrapped in *asterisks* in the content file. */
.mark { color: var(--mark); }

/* The area text is auto-sized to fill. */
.fit {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: var(--fit-align, flex-end);
  overflow: hidden;
}

.rule {
  width: 120px;
  height: 8px;
  background: var(--accent);
  border-radius: 4px;
}

[data-empty] { display: none !important; }
