# Styling contract

The core has a neutral base. Optional stylesheets are independently importable:
`themes/base.css`, `traditional.css`, `minimal.css`, `terminal.css`, `retro.css`,
`industrial.css`. Select an imported theme using `theme="terminal"` on a calendar
or a single door. A door can override its calendar's theme. Themes do not select
layouts or animations.

```css
advent-calendar {
  --advent-gap: 1rem;
  --advent-columns: 6;
  --advent-background: transparent;
  --advent-door-background: #173e36;
  --advent-door-color: #f5e6c8;
  --advent-door-radius: 4px;
  --advent-reveal-duration: 500ms;
  --advent-perspective: 1000px;
}
advent-door::part(front) {
  font-family: monospace;
}
advent-door::part(content) {
  padding: 1rem;
}
advent-door[locked]::part(front) {
  opacity: 0.6;
}
```

## Stable parts and slots

Calendar parts: `header`, `layout`, `progress`. Door parts: `frame`, `front` (native
button), `content` (region), `label` (fallback front text), `status`, `indicator`
(same availability element), `toggle` (close button). Do not reach into private
Shadow DOM class names. Consumer slotted content stays in light DOM and is styled
with ordinary selectors, e.g. `advent-door [slot="content"] a`.

Calendar slots: `heading`, `description`, `empty`, default direct-door slot.
Door slots: `front`, `content`. Do not put buttons/links into `front`; it is inside
a native button. Interactive experiences belong in `content`.

## Properties

| Area                | Custom properties (defaults)                                                                                                                                                              |
| ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Calendar            | `--advent-background` (transparent), `--advent-color` (inherit), `--advent-padding` (0)                                                                                                   |
| Layout              | `--advent-gap` (1rem), `--advent-columns` (4; masonry 3), `--advent-mobile-columns` (2), `--advent-min-width` (160px), `--advent-timeline-width` (44rem), `--advent-line-color` (#9caeb8) |
| Door                | `--advent-door-height` (150px minimum), `--advent-door-background` (#e8eef2), `--advent-door-color` (#17242c), `--advent-door-border` (1px solid #c1ccd2), `--advent-door-radius` (10px)  |
| Front               | `--advent-front-padding` (1.2rem), `--advent-label-size` (1.6rem)                                                                                                                         |
| Content             | `--advent-content-padding` (1rem), `--advent-content-background` (#fff), `--advent-content-color` (#17242c)                                                                               |
| Status/focus        | `--advent-status-color` (#425466), `--advent-focus-color` (#006bdb), `--advent-locked-filter` (saturate(.4))                                                                              |
| Motion              | `--advent-reveal-duration` (450ms), `--advent-easing` (ease), `--advent-perspective` (1000px)                                                                                             |
| Individual position | `--advent-column`, `--advent-row` (auto), `--advent-column-span`, `--advent-row-span` (1)                                                                                                 |

Host attributes `[open]`, `[locked]`, `[disabled]`, `[once]` and `[reveal]` are
available to selectors. Color contrasts in custom themes are the author's
responsibility. Do not remove focus outlines or override inert/hidden behavior.

## Layouts and independent positioning

`grid` is sequential; `shuffle` deterministically reorders the actual door nodes
using the seed; `responsive` uses auto-fit columns; `masonry` uses stable CSS
columns with column-major reading order; `timeline` is one column; `custom` uses
the same grid with consumer positions. Mobile layouts reset explicit spans and
positions below 640px to avoid overflowing tiny screens. Override `::part(layout)`
and door styles when you need a different breakpoint or fully custom strategy.

```css
advent-calendar[layout='custom'] {
  --advent-columns: 4;
}
advent-door[entry-id='feature'] {
  --advent-column: 1;
  --advent-column-span: 2;
  --advent-row-span: 2;
  --advent-door-height: 340px;
}
```

Programmatic entries accept `{ layout: { column, row, columnSpan, rowSpan } }`;
positive integers up to 100 become these CSS properties. Layout hints never
reach the scheduling engine's decisions. For another strategy, set `layout="custom"`
and style `::part(layout)`, or reorder direct doors in JavaScript. Avoid CSS-only
visual ordering that makes keyboard order unexpectedly different. The standalone
`seededShuffle` and `orderEntries` utilities work without a DOM.

## Custom motion

```css
advent-door[reveal='tilt'][open]::part(front) {
  transform: rotate(-8deg) scale(0.85);
}
@media (prefers-reduced-motion: reduce) {
  advent-door::part(front),
  advent-door::part(content) {
    transition: none;
    animation: none;
  }
}
```

Built-in reduced-motion rules disable transitions and animations. If you supply
new animations through parts, preserve this preference explicitly. Reveal mechanics
remain independent of the theme; use `instant` when no motion is wanted at all.
