/* Residence Miramonti — light flexbox redesign */
:root {
  --bordeaux: #5a0e0e;
  --bordeaux-mid: #7a1818;
  --link: #ac0000;
  --link-hover: #900;
  --text: #2a2222;
  --muted: #5c5252;
  --bg: #f7f3f1;
  --surface: #ffffff;
  --border: #e4d8d6;
  --max: 1100px;
  --nav-w: 200px;
  --font: "Lucida Grande", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  max-width: 100%;
  overflow-x: hidden;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background:
    linear-gradient(180deg, #fff 0, var(--bg) 220px),
    radial-gradient(ellipse at top, rgba(90, 14, 14, 0.06), transparent 55%);
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

.site-wrap {
  width: min(100% - 2rem, var(--max));
  margin: 0 auto;
}

/* —— Header —— */
.site-header {
  background: var(--surface);
  border-bottom: 3px solid var(--bordeaux);
}

.site-header__inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0 0.75rem;
}

.site-logo img {
  width: 180px;
  height: auto;
}

.lang-switch {
  display: flex;
  gap: 1.25rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding-bottom: 0.35rem;
}

.lang-switch a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.lang-switch a:hover,
.lang-switch a.is-active {
  color: var(--link);
}

/* —— Hero band —— */
.hero-band {
  display: flex;
  gap: 0;
  border-bottom: 12px solid var(--bordeaux);
  background: var(--bordeaux);
  overflow: hidden;
}

.hero-band__media {
  flex: 1 1 auto;
  min-height: 180px;
  background: var(--bordeaux-mid) center / cover no-repeat;
}

.hero-band__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 180px;
  max-height: 260px;
}

/* —— Layout —— */
.page-shell {
  display: flex;
  gap: 1.75rem;
  padding: 1.5rem 0 2.5rem;
  align-items: flex-start;
  max-width: 100%;
  min-width: 0;
}

.site-nav {
  flex: 0 0 var(--nav-w);
  position: sticky;
  top: 0.75rem;
}

.site-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: linear-gradient(180deg, #6b1414, var(--bordeaux));
  border: 1px solid #3d0808;
}

.site-nav__list > li {
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  position: relative;
}

.site-nav__list > li:last-child {
  border-bottom: none;
}

.site-nav__list > li > a {
  display: block;
  padding: 0.7rem 0.9rem;
  color: #fff;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  transition: background 0.2s ease, padding-left 0.2s ease;
}

.site-nav__list > li > a:hover,
.site-nav__list > li > a.is-active {
  background: rgba(0, 0, 0, 0.25);
  padding-left: 1.1rem;
  text-decoration: none;
  color: #fff;
}

.site-nav__list > li > a.is-special {
  background: rgba(255, 255, 255, 0.08);
}

.site-nav__sub {
  list-style: none;
  margin: 0;
  padding: 0;
  background: #3f0a0a;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}

.site-nav__list > li:hover > .site-nav__sub,
.site-nav__list > li:focus-within > .site-nav__sub,
.site-nav__list > li.has-open > .site-nav__sub {
  max-height: 120px;
}

.site-nav__sub a {
  display: block;
  padding: 0.55rem 0.9rem 0.55rem 1.2rem;
  color: #f3e8e8;
  font-size: 0.85rem;
  text-decoration: none;
}

.site-nav__sub a:hover,
.site-nav__sub a.is-active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  text-decoration: none;
}

.nav-toggle {
  display: none;
  width: 100%;
  margin-bottom: 0.5rem;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--bordeaux);
  background: var(--bordeaux);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.page-main {
  flex: 1 1 auto;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1.25rem 1.5rem 1.75rem;
}

.page-header {
  margin: 0 0 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}

.page-header h1 {
  margin: 0;
  font-size: 1.55rem;
  line-height: 1.25;
  color: var(--bordeaux);
  font-weight: 700;
}

.sidebar-address {
  margin-top: 1.25rem;
  padding: 0.9rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--muted);
  background: #faf6f5;
  border: 1px solid var(--border);
}

.sidebar-address a {
  font-weight: 600;
}

/* —— Content —— */
.content-body h2,
.content-body h3 {
  color: var(--bordeaux);
  line-height: 1.3;
}

.content-body h2 {
  font-size: 1.25rem;
  margin: 0 0 0.75rem;
}

.content-body h3 {
  font-size: 1.05rem;
}

.content-body p {
  margin: 0 0 0.85rem;
}

.content-body ul,
.content-body ol {
  margin: 0 0 1rem 1.2rem;
  padding: 0;
}

.content-body li {
  margin-bottom: 0.35rem;
}

.content-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.9rem;
}

.content-body th,
.content-body td {
  border: 1px solid var(--border);
  padding: 0.45rem 0.6rem;
  text-align: left;
  vertical-align: top;
}

.content-body th {
  background: #f5ecec;
}

/* Legacy TYPO3 textpic ? flex */
.csc-textpic {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
  align-items: flex-start;
}

.csc-textpic-imagewrap {
  flex: 0 0 auto;
  max-width: 100% !important;
  width: auto !important;
}

.csc-textpic-imagewrap dl {
  max-width: 100%;
}

.csc-textpic-intext-left-nowrap {
  flex-wrap: wrap;
}

.csc-textpic-imagewrap dl {
  margin: 0;
}

.csc-textpic-text,
.csc-textpic > div[style*="margin-left"] {
  flex: 1 1 220px;
  min-width: 0;
  margin-left: 0 !important;
}

.csc-textpic-center .csc-textpic-imagewrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  width: 100% !important;
}

.csc-textpic-center .csc-textpic-imagewrap dl {
  flex: 0 1 auto;
}

.csc-textpic-clear,
.spacer-gif {
  display: none !important;
}

.csc-textpicHeader h2 {
  margin-top: 0;
}

/* Blog list */
.blog-container {
  width: 100%;
}

.blog-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.blog-card {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.blog-card:last-child {
  border-bottom: none;
}

.blog-title {
  margin: 0 0 0.4rem;
  font-size: 1.1rem;
}

.blog-title a {
  color: var(--bordeaux);
}

.blog-preview p {
  margin: 0;
  color: var(--muted);
}

/* —— Footer —— */
.site-footer {
  border-top: 2px solid var(--bordeaux);
  background: var(--surface);
  padding: 1.25rem 0 1.75rem;
  margin-top: auto;
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: flex-start;
  font-size: 0.85rem;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
  color: var(--muted);
}

.site-footer__links a {
  color: var(--muted);
}

.site-footer__links a:hover {
  color: var(--link);
}

.site-footer__copy {
  color: var(--muted);
}

/* —— Responsive —— */
@media (max-width: 800px) {
  .content-body {
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  .content-body .table-scroll,
  .content-body div[style*="overflow-x"] {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: scroll;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    touch-action: pan-x;
    scrollbar-width: thin;
  }

  .content-body .table-scroll > table,
  .content-body .table-scroll table,
  .content-body div.table-scroll table,
  .content-body div[style*="overflow-x"] > table {
    width: max-content !important;
    max-width: none !important;
    min-width: 100%;
    display: table;
    table-layout: auto;
  }

  .content-body .table-scroll th,
  .content-body .table-scroll td,
  .content-body div[style*="overflow-x"] th,
  .content-body div[style*="overflow-x"] td {
    white-space: nowrap;
  }

  .page-shell {
    flex-direction: column;
  }

  .site-nav {
    flex: 1 1 auto;
    width: 100%;
    position: static;
  }

  .nav-toggle {
    display: block;
  }

  .site-nav__list {
    display: none;
  }

  .site-nav.is-open .site-nav__list {
    display: block;
  }

  .site-nav__sub {
    max-height: none;
  }

  .site-nav__list > li > .site-nav__sub {
    display: block;
  }

  .hero-band__media img {
    max-height: 180px;
  }

  .site-header__inner {
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  .site-wrap {
    width: min(100% - 1.25rem, var(--max));
  }

  .page-main {
    padding: 1rem;
  }

  .site-logo img {
    width: 140px;
  }
}
