/*
 * Diary/HUB public-site template authority.
 * Source: Diary Corporate Identity, resolved for HUB.
 * All deploy-root copies are generated by tools/sync-corporate-site-templates.mjs.
 * Reusable tokens use the --ci-* namespace required by the corporate identity.
 */

:root {
  color-scheme: light;
  --ci-font-sans: "Source Sans 3", "Segoe UI Variable", "Segoe UI", Arial, sans-serif;
  --ci-font-heading: "Source Sans 3", "Segoe UI Variable", "Segoe UI", Arial, sans-serif;
  --ci-font-document: Carlito, Calibri, Aptos, "Source Sans 3", Arial, sans-serif;
  --ci-font-accessible: "Atkinson Hyperlegible", "Source Sans 3", Arial, sans-serif;
  --ci-font-mono: "Cascadia Mono", Consolas, monospace;
  --ci-font-weight-body: 400;
  --ci-font-weight-label: 600;
  --ci-font-weight-heading: 700;
  --ci-space-1: 4px;
  --ci-space-2: 8px;
  --ci-space-3: 12px;
  --ci-space-4: 16px;
  --ci-space-5: 24px;
  --ci-space-6: 32px;
  --ci-space-7: 48px;
  --ci-radius-sm: 4px;
  --ci-radius-md: 8px;
  --ci-radius-lg: 12px;
  --ci-radius-pill: 999px;
  --ci-focus: #0b63ce;
  --ci-success: #146c43;
  --ci-warning: #7a4c00;
  --ci-danger: #b42318;
  --ci-control-height: 44px;
  --ci-content-width: 1440px;
  --ci-reading-measure: 68ch;
}

html {
  font-family: var(--ci-font-sans);
  text-size-adjust: 100%;
}

body,
button,
input,
select,
textarea {
  font-family: var(--ci-font-sans);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--ci-font-heading);
  text-wrap: balance;
}

p,
li {
  text-wrap: pretty;
}

:focus-visible {
  outline: 3px solid var(--ci-focus);
  outline-offset: 3px;
}

/* Diary system profile: preserves the established Schmallegger surface. */
html[data-ci-site-template="system"] {
  --ci-page: #f6f8fc;
  --ci-surface: #ffffff;
  --ci-surface-subtle: #eef5ff;
  --ci-border: #d7e0ee;
  --ci-text: #14213d;
  --ci-text-muted: #52627a;
  --ci-primary: #1d4f91;
  --ci-primary-active: #14213d;
  --ci-accent: #2663eb;
}

html[data-ci-site-template="system"] body {
  font-family: var(--ci-font-sans);
}

/* PoldiEstates: warm, light, editorial, and asset-focused. */
html[data-ci-site-template="estate"] {
  color-scheme: light;
  --ci-page: #f3efe6;
  --ci-surface: #fffdf8;
  --ci-surface-subtle: #e7ece5;
  --ci-border: #d3c8b5;
  --ci-text: #1d2a24;
  --ci-text-muted: #58645d;
  --ci-primary: #315e50;
  --ci-primary-active: #1d4037;
  --ci-accent: #a6782c;
  --ci-focus: #0b63ce;
  --ci-font-sans: var(--ci-font-document);
  --ci-font-heading: Carlito, Aptos, Calibri, "Source Sans 3", Arial, sans-serif;
  --ci-radius-md: 4px;
  --ci-radius-lg: 6px;
  --paper: var(--ci-page);
  --panel: var(--ci-surface);
  --line: var(--ci-border);
  --ink: var(--ci-text);
  --muted: var(--ci-text-muted);
  --blue: var(--ci-primary);
  --sage: #6f806b;
  --gold: var(--ci-accent);
  --soft: var(--ci-surface-subtle);
  --radius: var(--ci-radius-md);
}

html[data-ci-site-template="estate"] body {
  background:
    linear-gradient(90deg, rgba(49, 94, 80, .035) 1px, transparent 1px),
    var(--ci-page);
  background-size: 72px 100%;
  font-family: var(--ci-font-sans);
  letter-spacing: .005em;
}

html[data-ci-site-template="estate"] .site-header {
  background: rgba(255, 253, 248, .94);
  border-bottom-color: var(--ci-border);
  backdrop-filter: blur(14px);
}

html[data-ci-site-template="estate"] .brand-mark {
  border-radius: 2px;
  border-color: #af9e80;
  background: #233d34;
  color: #f4dfad;
  font-family: var(--ci-font-heading);
  letter-spacing: .06em;
}

html[data-ci-site-template="estate"] .site-header .brand,
html[data-ci-site-template="estate"] .site-header .brand-copy strong {
  font-family: var(--ci-font-heading);
  letter-spacing: .035em;
}

html[data-ci-site-template="estate"] .site-shell-nav a {
  border-radius: 2px;
}

html[data-ci-site-template="estate"] .site-shell-nav a:hover,
html[data-ci-site-template="estate"] .site-shell-nav a:focus-visible,
html[data-ci-site-template="estate"] .site-shell-nav a[aria-current="page"] {
  background: #e2e7df;
  color: var(--ci-primary-active);
}

html[data-ci-site-template="estate"] .estate-hero,
html[data-ci-site-template="estate"] .imported-hero {
  background:
    linear-gradient(90deg, rgba(255, 253, 248, .98), rgba(243, 239, 230, .86) 56%, rgba(49, 94, 80, .12)),
    repeating-linear-gradient(90deg, rgba(49, 94, 80, .08) 0 1px, transparent 1px 72px),
    var(--ci-page);
}

html[data-ci-site-template="estate"] h1 {
  max-width: 13ch;
  font-weight: 600;
  letter-spacing: -.025em;
}

html[data-ci-site-template="estate"] h2,
html[data-ci-site-template="estate"] h3 {
  font-weight: 600;
}

html[data-ci-site-template="estate"] .eyebrow,
html[data-ci-site-template="estate"] .section-kicker {
  color: var(--ci-primary);
  letter-spacing: .16em;
}

html[data-ci-site-template="estate"] .property-card,
html[data-ci-site-template="estate"] .metric-strip,
html[data-ci-site-template="estate"] .timeline-list article,
html[data-ci-site-template="estate"] .region-grid article,
html[data-ci-site-template="estate"] .route-ledger article,
html[data-ci-site-template="estate"] .gallery-card {
  background: rgba(255, 253, 248, .96);
  border-color: var(--ci-border);
  border-radius: var(--ci-radius-md);
  box-shadow: 0 16px 44px rgba(41, 54, 46, .055);
}

html[data-ci-site-template="estate"] .property-card {
  border-top: 3px solid var(--ci-primary);
}

html[data-ci-site-template="estate"] .hero-photo,
html[data-ci-site-template="estate"] .profile-photo {
  border-radius: 4px;
  background: #fffdf8;
  box-shadow: 20px 24px 0 rgba(49, 94, 80, .11);
}

html[data-ci-site-template="estate"] .hero-photo img,
html[data-ci-site-template="estate"] .profile-photo,
html[data-ci-site-template="estate"] .gallery-card img {
  border-radius: 2px;
}

html[data-ci-site-template="estate"] .site-footer {
  background: #20372f;
  border-top-color: #20372f;
  color: #f2eadc;
}

html[data-ci-site-template="estate"] .site-footer a,
html[data-ci-site-template="estate"] .site-footer small {
  color: #ddd2bf;
}

/* SchmallWorld: dark, cinematic, place-aware, and highly readable. */
html[data-ci-site-template="journey"] {
  color-scheme: dark;
  --ci-page: #091521;
  --ci-surface: #122536;
  --ci-surface-subtle: #1b3447;
  --ci-border: #365469;
  --ci-text: #f3f7f8;
  --ci-text-muted: #c2d0d9;
  --ci-primary: #7bd1ef;
  --ci-primary-active: #b9eaff;
  --ci-accent: #f29a78;
  --ci-focus: #9fdfff;
  --ci-font-sans: var(--ci-font-accessible);
  --ci-font-heading: "Source Sans 3", "Segoe UI Variable", "Segoe UI", Arial, sans-serif;
  --paper: var(--ci-page);
  --panel: var(--ci-surface);
  --line: var(--ci-border);
  --ink: var(--ci-text);
  --muted: var(--ci-text-muted);
  --blue: var(--ci-primary);
  --sky: #7bd1ef;
  --green: #acd59d;
  --coral: var(--ci-accent);
  --soft: var(--ci-surface-subtle);
  --radius: 20px;
}

html[data-ci-site-template="journey"] body {
  background:
    radial-gradient(circle at 12% 12%, rgba(39, 116, 148, .18), transparent 30rem),
    radial-gradient(circle at 88% 30%, rgba(242, 154, 120, .12), transparent 28rem),
    var(--ci-page);
  color: var(--ci-text);
  font-family: var(--ci-font-sans);
}

html[data-ci-site-template="journey"] a {
  color: var(--ci-primary);
}

html[data-ci-site-template="journey"] p,
html[data-ci-site-template="journey"] .timeline-list span,
html[data-ci-site-template="journey"] .route-ledger span,
html[data-ci-site-template="journey"] .site-shell-version {
  color: var(--ci-text-muted);
}

html[data-ci-site-template="journey"] .site-header {
  background: rgba(9, 21, 33, .9);
  border-bottom-color: var(--ci-border);
  backdrop-filter: blur(16px);
}

html[data-ci-site-template="journey"] .site-header .brand,
html[data-ci-site-template="journey"] .site-header .brand-copy strong,
html[data-ci-site-template="journey"] .site-shell-nav a {
  color: var(--ci-text);
}

html[data-ci-site-template="journey"] .brand-mark {
  border-color: #5e8198;
  border-radius: 50%;
  background: linear-gradient(145deg, #75c8e6, #f29a78);
  color: #08141f;
  box-shadow: 0 0 0 5px rgba(123, 209, 239, .08);
}

html[data-ci-site-template="journey"] .site-shell-nav a:hover,
html[data-ci-site-template="journey"] .site-shell-nav a:focus-visible,
html[data-ci-site-template="journey"] .site-shell-nav a[aria-current="page"] {
  background: var(--ci-surface-subtle);
  color: var(--ci-primary-active);
}

html[data-ci-site-template="journey"] .travel-hero,
html[data-ci-site-template="journey"] .imported-hero {
  background:
    linear-gradient(90deg, rgba(9, 21, 33, .97), rgba(12, 31, 45, .78)),
    radial-gradient(circle at 78% 18%, rgba(242, 154, 120, .34), transparent 30%),
    radial-gradient(circle at 62% 74%, rgba(123, 209, 239, .26), transparent 28%);
  border-bottom-color: var(--ci-border);
}

html[data-ci-site-template="journey"] .hero p {
  color: #d8e4e9;
}

html[data-ci-site-template="journey"] h1 {
  max-width: 12ch;
  color: #fff;
  font-weight: 700;
  letter-spacing: -.035em;
}

html[data-ci-site-template="journey"] h2,
html[data-ci-site-template="journey"] h3,
html[data-ci-site-template="journey"] .timeline-list strong,
html[data-ci-site-template="journey"] .route-ledger strong {
  color: var(--ci-text);
}

html[data-ci-site-template="journey"] .eyebrow,
html[data-ci-site-template="journey"] .section-kicker {
  color: #acd59d;
  letter-spacing: .14em;
}

html[data-ci-site-template="journey"] .route-visual,
html[data-ci-site-template="journey"] .timeline-list article,
html[data-ci-site-template="journey"] .region-grid article,
html[data-ci-site-template="journey"] .route-ledger article,
html[data-ci-site-template="journey"] .gallery-card,
html[data-ci-site-template="journey"] .story-card,
html[data-ci-site-template="journey"] .archive-card {
  background: rgba(18, 37, 54, .9);
  border-color: var(--ci-border);
  box-shadow: 0 22px 60px rgba(0, 0, 0, .18);
}

html[data-ci-site-template="journey"] .hero-photo {
  background: linear-gradient(145deg, rgba(123, 209, 239, .18), rgba(242, 154, 120, .16));
  border-color: #55768b;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .36);
  transform: rotate(1deg);
}

html[data-ci-site-template="journey"] .hero-photo img,
html[data-ci-site-template="journey"] .gallery-card img {
  border-color: #45657b;
}

html[data-ci-site-template="journey"] .site-footer {
  background: #06101a;
  border-top-color: var(--ci-border);
  color: var(--ci-text-muted);
}

html[data-ci-site-template="journey"] .site-footer a,
html[data-ci-site-template="journey"] .site-footer small {
  color: #b9dae7;
}

/* Heritage: quiet editorial storytelling for family and archival material. */
html[data-ci-site-template="heritage"] {
  color-scheme: light;
  --ci-page: #f7f4ed;
  --ci-surface: #fffefa;
  --ci-surface-subtle: #ede6d8;
  --ci-border: #d5c9b5;
  --ci-text: #302c26;
  --ci-text-muted: #6b6257;
  --ci-primary: #72533c;
  --ci-primary-active: #493425;
  --ci-accent: #315f68;
  --ci-focus: #075ecf;
}

html[data-ci-site-template="heritage"] body {
  background: var(--ci-page);
  font-family: var(--ci-font-document);
}

html[data-ci-site-template="heritage"] .site-header {
  background: rgba(255, 254, 250, .97);
  border-bottom-color: var(--ci-border);
}

html[data-ci-site-template="heritage"] .brand-mark {
  background: var(--ci-primary);
  border-color: var(--ci-primary-active);
  border-radius: 50%;
}

html[data-ci-site-template="heritage"] .hero,
html[data-ci-site-template="heritage"] .imported-hero,
html[data-ci-site-template="heritage"] .card,
html[data-ci-site-template="heritage"] article {
  background: var(--ci-surface);
  border-color: var(--ci-border);
  box-shadow: 0 8px 24px rgba(48, 44, 38, .06);
}

html[data-ci-site-template="heritage"] .site-footer {
  background: #302c26;
  color: #f4eee3;
}

/* Place: calm civic information with strong wayfinding and no decorative backdrop. */
html[data-ci-site-template="place"] {
  color-scheme: light;
  --ci-page: #f5f7f4;
  --ci-surface: #ffffff;
  --ci-surface-subtle: #e8f0ea;
  --ci-border: #cad7ce;
  --ci-text: #183126;
  --ci-text-muted: #52665b;
  --ci-primary: #286044;
  --ci-primary-active: #173f2d;
  --ci-accent: #b45a2a;
  --ci-focus: #005fcc;
}

html[data-ci-site-template="place"] body {
  background: var(--ci-page);
}

html[data-ci-site-template="place"] .site-header {
  background: rgba(255, 255, 255, .96);
  border-bottom: 4px solid var(--ci-primary);
}

html[data-ci-site-template="place"] .brand-mark {
  background: var(--ci-primary);
  border-color: var(--ci-primary-active);
  border-radius: var(--ci-radius-sm);
}

html[data-ci-site-template="place"] .hero,
html[data-ci-site-template="place"] .imported-hero {
  background: var(--ci-surface-subtle);
  border-block: 1px solid var(--ci-border);
}

html[data-ci-site-template="place"] .card,
html[data-ci-site-template="place"] article {
  background: var(--ci-surface);
  border-color: var(--ci-border);
  box-shadow: 0 8px 24px rgba(24, 49, 38, .06);
}

html[data-ci-site-template="place"] .site-footer {
  background: #183126;
  color: #edf4ef;
}

/* Residential: warm, practical housing information with document-like clarity. */
html[data-ci-site-template="residential"] {
  color-scheme: light;
  --ci-page: #faf8f3;
  --ci-surface: #ffffff;
  --ci-surface-subtle: #f0eadf;
  --ci-border: #d9cfbe;
  --ci-text: #2c2a27;
  --ci-text-muted: #696159;
  --ci-primary: #7a4b2f;
  --ci-primary-active: #52301e;
  --ci-accent: #2f6f70;
  --ci-focus: #075ecf;
}

html[data-ci-site-template="residential"] body {
  background: var(--ci-page);
  font-family: var(--ci-font-document);
}

html[data-ci-site-template="residential"] .site-header {
  background: rgba(255, 255, 255, .96);
  border-bottom-color: var(--ci-border);
}

html[data-ci-site-template="residential"] .brand-mark {
  background: var(--ci-primary);
  border-color: var(--ci-primary-active);
  border-radius: 2px;
}

html[data-ci-site-template="residential"] .hero,
html[data-ci-site-template="residential"] .imported-hero {
  background: var(--ci-surface-subtle);
}

html[data-ci-site-template="residential"] .card,
html[data-ci-site-template="residential"] article {
  background: var(--ci-surface);
  border-color: var(--ci-border);
  border-radius: var(--ci-radius-sm);
  box-shadow: 0 10px 30px rgba(70, 52, 39, .07);
}

html[data-ci-site-template="residential"] .site-footer {
  background: #2c2a27;
  color: #f8f2e8;
}

/* Urban: crisp city information with charismatic but restrained colour. */
html[data-ci-site-template="urban"] {
  color-scheme: light;
  --ci-page: #f4f6f8;
  --ci-surface: #ffffff;
  --ci-surface-subtle: #e8eef4;
  --ci-border: #cbd5df;
  --ci-text: #162330;
  --ci-text-muted: #536474;
  --ci-primary: #1e5278;
  --ci-primary-active: #123650;
  --ci-accent: #c24b3a;
  --ci-focus: #005fcc;
}

html[data-ci-site-template="urban"] body {
  background: var(--ci-page);
  font-family: var(--ci-font-accessible);
}

html[data-ci-site-template="urban"] .site-header {
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--ci-border);
  box-shadow: 0 2px 14px rgba(22, 35, 48, .06);
}

html[data-ci-site-template="urban"] .brand-mark {
  background: var(--ci-primary);
  border-color: var(--ci-primary-active);
  border-radius: 50%;
}

html[data-ci-site-template="urban"] .hero,
html[data-ci-site-template="urban"] .imported-hero {
  background: var(--ci-surface);
  border-left: 6px solid var(--ci-accent);
}

html[data-ci-site-template="urban"] .card,
html[data-ci-site-template="urban"] article {
  background: var(--ci-surface);
  border-color: var(--ci-border);
  box-shadow: 0 12px 28px rgba(30, 82, 120, .07);
}

html[data-ci-site-template="urban"] .site-footer {
  background: #162330;
  color: #eef3f7;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (forced-colors: active) {
  .brand-mark,
  .property-card,
  .gallery-card,
  .card,
  .timeline-list article,
  .route-ledger article {
    border: 1px solid CanvasText;
  }
}
