/* ================================================
   Apartments an der Uniklinik — Design System v1.0
   Modern, urban, warm — Freiburg im Breisgau
   ================================================ */

:root {
  /* Palette — urban warm (differs from Tannenhof forest) */
  --brand: #1f3a5f;              /* deep navy — Freiburg lake water */
  --brand-dark: #142744;
  --brand-light: #3a5a8a;
  --accent: #d97706;             /* warm amber — Freiburg sunshine */
  --accent-light: #f59e0b;
  --cream: #faf7f2;
  --sand: #ede4d3;
  --charcoal: #1f2937;
  --grey: #6b7280;
  --grey-light: #d1d5db;
  --ok: #16a34a;
  --error: #dc2626;
  --info: #0891b2;

  --radius: 12px;
  --radius-sm: 6px;
  --radius-lg: 20px;
  --gap: clamp(16px, 3vw, 32px);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 20px 40px rgba(0,0,0,0.12);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--charcoal);
  background: var(--cream);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; cursor: pointer; }

/* ======================= TYPOGRAPHY ======================= */

h1, h2, h3, h4 {
  font-family: 'Merriweather', Georgia, serif;
  color: var(--brand-dark);
  line-height: 1.2;
}
h1 { font-size: clamp(2rem, 5vw, 3.75rem); font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); margin-bottom: 0.5em; letter-spacing: -0.01em; }
h3 { font-size: clamp(1.15rem, 2.5vw, 1.5rem); margin-bottom: 0.4em; }
h4 { font-size: clamp(1rem, 2vw, 1.15rem); margin-bottom: 0.3em; }

p { margin-bottom: 1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--brand); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--brand-light); text-decoration: underline; }

.eyebrow {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
  display: block;
}

.lead {
  font-size: 1.15rem;
  color: var(--grey);
  max-width: 720px;
  margin: 8px 0 24px;
  line-height: 1.65;
}

/* ======================= HEADER / NAV ======================= */

header.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 247, 242, 0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--sand);
}
.nav {
  max-width: 1240px; margin: 0 auto; padding: 14px var(--gap);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand {
  font-family: 'Merriweather', serif; font-weight: 700; font-size: 1.15rem;
  color: var(--brand-dark);
}
.brand small { display: block; font-size: 0.7rem; color: var(--grey); font-weight: 400; font-family: 'Inter', sans-serif; letter-spacing: 0.02em; }
.nav-links { display: flex; gap: 22px; font-size: 0.95rem; }
.nav-links a { color: var(--charcoal); font-weight: 500; }
.nav-links a:hover { color: var(--brand); text-decoration: none; }
.nav-right { display: flex; align-items: center; gap: 12px; }
.lang-switch { display: flex; gap: 2px; font-size: 0.85rem; }
.lang-switch a {
  padding: 4px 8px; border-radius: var(--radius-sm);
  color: var(--grey); font-weight: 500;
}
.lang-switch a.active { background: var(--brand); color: white; }
.lang-switch a:hover:not(.active) { background: var(--sand); color: var(--brand-dark); text-decoration: none; }

@media (max-width: 900px) {
  .nav-links { display: none; }
}

/* ======================= BUTTONS ======================= */

.btn {
  display: inline-block; padding: 12px 24px; border-radius: var(--radius);
  font-weight: 600; text-align: center; border: 0;
  transition: transform 0.1s ease, background 0.2s, box-shadow 0.2s;
  text-decoration: none !important;
  font-size: 1rem;
}
.btn-primary { background: var(--brand); color: white; box-shadow: var(--shadow-md); }
.btn-primary:hover { background: var(--brand-dark); transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.btn-accent { background: var(--accent); color: white; box-shadow: var(--shadow-md); }
.btn-accent:hover { background: #b8600a; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--brand-dark); border: 1.5px solid var(--brand); }
.btn-ghost:hover { background: var(--brand); color: white; }
.btn-lg { padding: 16px 32px; font-size: 1.05rem; }

/* ======================= HERO ======================= */

.hero {
  position: relative; min-height: 82vh;
  display: flex; align-items: flex-end;
  background: linear-gradient(180deg, rgba(20, 39, 68, 0.2) 0%, rgba(20, 39, 68, 0.7) 100%), var(--brand-dark);
  color: white; padding: var(--gap);
}
.hero.has-bg { background-image: linear-gradient(180deg, rgba(20, 39, 68, 0.35) 0%, rgba(20, 39, 68, 0.75) 100%), var(--hero-img); background-size: cover; background-position: center; }
.hero-inner { max-width: 1240px; width: 100%; margin: 0 auto; padding: 60px 0 80px; }
.hero .eyebrow { color: var(--accent-light); }
.hero h1 { color: white; text-shadow: 0 2px 30px rgba(0,0,0,0.4); max-width: 780px; }
.hero-tag { font-size: 1.25rem; margin: 16px 0 32px; max-width: 620px; opacity: 0.95; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-cta .btn { font-size: 1.05rem; padding: 16px 30px; }

/* ======================= SECTIONS ======================= */

section { padding: clamp(56px, 9vw, 112px) var(--gap); }
.container { max-width: 1240px; margin: 0 auto; }
section.alt { background: white; }
section.dark { background: var(--brand-dark); color: white; }
section.dark h1, section.dark h2, section.dark h3 { color: white; }
section.dark .lead { color: rgba(255,255,255,0.85); }

/* ======================= USP GRID ======================= */

.usp-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 32px;
}
.usp-col h3 {
  border-bottom: 2px solid var(--sand); padding-bottom: 10px; margin-bottom: 16px;
  font-size: 1.15rem;
}
.usp-col ul { list-style: none; }
.usp-col li { padding: 12px 0; border-bottom: 1px dashed var(--sand); display: flex; gap: 12px; align-items: baseline; }
.usp-col li:last-child { border-bottom: 0; }
.usp-col .yes::before { content: '✓'; color: var(--ok); font-weight: 700; font-size: 1.1rem; margin-right: 4px; }
.usp-col .no::before { content: '×'; color: var(--grey); font-weight: 700; font-size: 1.1rem; margin-right: 4px; }
@media (max-width: 800px) { .usp-grid { grid-template-columns: 1fr; gap: 32px; } }

/* ======================= DIRECT BOOKING BANNER ======================= */

.direct-banner {
  background: linear-gradient(135deg, var(--accent) 0%, #b8600a 100%);
  color: white; border-radius: var(--radius-lg);
  padding: 40px clamp(24px, 5vw, 48px); margin-top: 24px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
  box-shadow: var(--shadow-lg);
}
.direct-banner h3 { color: white; font-size: 1.5rem; }
.direct-banner p { opacity: 0.95; margin: 4px 0 0; }
.direct-banner .btn { background: white; color: var(--brand-dark); }
.direct-banner .btn:hover { background: var(--cream); color: var(--brand-dark); }

/* ======================= APARTMENTS CARDS ======================= */

.card-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px; margin-top: 40px;
}
.card {
  background: white; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm); transition: transform 0.15s ease, box-shadow 0.2s;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card-img { aspect-ratio: 4/3; background: var(--sand); background-size: cover; background-position: center; position: relative; }
.card-img.placeholder::after {
  content: '🏠'; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem; color: rgba(31, 58, 95, 0.15);
}
.card-body { padding: 20px 24px; flex: 1; display: flex; flex-direction: column; }
.card-body h3 { margin-bottom: 6px; }
.card-body .meta { font-size: 0.9rem; color: var(--grey); margin-bottom: 12px; }
.card-body .desc { flex: 1; font-size: 0.95rem; }
.card-body .card-cta { margin-top: 16px; }

/* ======================= CHECK-IN FEATURE ======================= */

.checkin-feature {
  background: var(--brand-dark); color: white;
  border-radius: var(--radius-lg); padding: clamp(32px, 6vw, 64px);
  display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center;
  margin-top: 24px;
}
.checkin-feature h3 { color: white; font-size: 1.75rem; margin-bottom: 20px; }
.checkin-feature .checkin-list { list-style: none; }
.checkin-feature .checkin-list li {
  padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,0.15);
  display: flex; gap: 12px; align-items: flex-start;
}
.checkin-feature .checkin-list li:last-child { border-bottom: 0; }
.checkin-feature .checkin-list .emoji { font-size: 1.5rem; }
@media (max-width: 800px) { .checkin-feature { grid-template-columns: 1fr; } }

/* ======================= DISTANCE TABLE ======================= */

.dist-table {
  width: 100%; margin-top: 32px; border-collapse: separate; border-spacing: 0;
  background: white; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm);
}
.dist-table th, .dist-table td { padding: 14px 20px; text-align: left; border-bottom: 1px solid var(--sand); }
.dist-table th { background: var(--sand); font-weight: 600; color: var(--brand-dark); font-size: 0.9rem; }
.dist-table td:last-child { color: var(--grey); font-weight: 500; }
.dist-table tr:last-child td { border-bottom: 0; }

/* ======================= REVIEWS ======================= */

.reviews-badges {
  display: flex; gap: 16px; flex-wrap: wrap; margin: 24px 0 40px;
}
.review-badge {
  background: white; padding: 20px 28px; border-radius: var(--radius);
  box-shadow: var(--shadow-sm); display: flex; align-items: center; gap: 14px;
}
.review-badge .score { font-size: 2rem; font-weight: 700; color: var(--brand); font-family: 'Merriweather', serif; }
.review-badge .platform { font-size: 0.9rem; color: var(--grey); }
.review-badge .platform strong { color: var(--charcoal); font-size: 1rem; display: block; }

.review-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.review-card {
  background: white; padding: 24px; border-radius: var(--radius);
  box-shadow: var(--shadow-sm); position: relative;
}
.review-card::before { content: '"'; position: absolute; top: 0; left: 20px; font-family: 'Merriweather', serif; font-size: 4rem; color: var(--sand); line-height: 0.8; }
.review-card blockquote { font-style: italic; margin: 24px 0 16px; color: var(--charcoal); position: relative; z-index: 1; }
.review-card .author { font-size: 0.9rem; color: var(--grey); }
.review-card .author strong { color: var(--brand-dark); }

/* ======================= LONG-STAY CTA ======================= */

.longstay-cta {
  background: white; border: 2px dashed var(--brand); border-radius: var(--radius-lg);
  padding: clamp(32px, 6vw, 56px); text-align: center; margin-top: 32px;
}
.longstay-cta h3 { font-size: 1.5rem; margin-bottom: 12px; }
.longstay-cta .btn { margin-top: 20px; }

/* ======================= FOOTER ======================= */

footer.site-footer {
  background: var(--brand-dark); color: white;
  padding: 56px var(--gap) 24px;
}
.footer-grid {
  max-width: 1240px; margin: 0 auto;
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px;
}
.footer-grid h4 { color: white; font-family: 'Inter', sans-serif; font-size: 0.9rem; letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 16px; }
.footer-grid a { color: rgba(255,255,255,0.75); font-size: 0.95rem; display: block; padding: 4px 0; }
.footer-grid a:hover { color: white; text-decoration: none; }
.footer-brand { font-family: 'Merriweather', serif; font-size: 1.25rem; font-weight: 700; margin-bottom: 10px; }
.footer-brand + p { color: rgba(255,255,255,0.7); font-size: 0.95rem; }
.footer-bottom {
  max-width: 1240px; margin: 40px auto 0;
  padding-top: 24px; border-top: 1px solid rgba(255,255,255,0.15);
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px;
  font-size: 0.85rem; color: rgba(255,255,255,0.6);
}
.footer-bottom .lang-switch a { color: rgba(255,255,255,0.75); }
.footer-bottom .lang-switch a.active { background: var(--accent); color: white; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 500px) { .footer-grid { grid-template-columns: 1fr; } }

/* ======================= UTILITIES ======================= */

.text-center { text-align: center; }
.mt-lg { margin-top: 48px; }
.mb-lg { margin-bottom: 48px; }
.hidden { display: none !important; }

/* ======================= RTL SUPPORT (Arabic) ======================= */

html[dir="rtl"] body { direction: rtl; }
html[dir="rtl"] .nav-links, html[dir="rtl"] .hero-cta { flex-direction: row-reverse; }
html[dir="rtl"] .card-body { text-align: right; }

/* ======================= PHOTOS & GALLERY ======================= */
img.card-img { display: block; width: 100%; height: auto; object-fit: cover; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 16px; }
.gallery a { position: relative; display: block; border-radius: var(--radius-sm, 6px); overflow: hidden; background: var(--sand); }
.gallery img { display: block; width: 100%; aspect-ratio: 4/3; height: auto; object-fit: cover; transition: transform 0.2s ease, opacity 0.2s; }
.gallery a:hover img, .gallery a:focus-visible img { transform: scale(1.04); opacity: 0.92; }
.gallery a.g-plan { background: white; border: 1px solid var(--sand); }
.gallery a.g-plan img { object-fit: contain; }
.gallery .g-label { position: absolute; left: 6px; bottom: 6px; background: rgba(20, 39, 68, 0.82); color: white; font-size: 0.78rem; font-weight: 600; padding: 2px 8px; border-radius: 4px; }
.lightbox { position: fixed; inset: 0; z-index: 1000; background: rgba(10, 18, 32, 0.92); display: none; align-items: center; justify-content: center; padding: 48px 56px; }
.lightbox.open { display: flex; }
.lightbox figure { margin: 0; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 140px); object-fit: contain; border-radius: 4px; background: white; }
.lightbox figcaption { color: #e8edf3; font-size: 0.95rem; margin-top: 12px; text-align: center; }
.lightbox button { position: absolute; background: rgba(255,255,255,0.12); color: white; border: 0; border-radius: 50%; width: 48px; height: 48px; font-size: 1.6rem; line-height: 1; cursor: pointer; }
.lightbox button:hover, .lightbox button:focus-visible { background: rgba(255,255,255,0.28); }
.lightbox .lb-close { top: 12px; right: 12px; }
.lightbox .lb-prev { left: 8px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 8px; top: 50%; transform: translateY(-50%); }
@media (max-width: 600px) { .lightbox { padding: 56px 8px; } .lightbox .lb-prev, .lightbox .lb-next { top: auto; bottom: 8px; transform: none; } }

/* ---------- Cookie consent banner (assets/js/consent.js) ---------- */
.cc-banner {
  position: fixed; inset-inline: 16px; bottom: 16px; z-index: 900;
  display: flex; justify-content: center; pointer-events: none;
}
.cc-banner[hidden] { display: none; }
.cc-inner {
  pointer-events: auto; width: 100%; max-width: 760px;
  background: white; color: var(--charcoal); border: 1px solid var(--sand);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 20px 24px; text-align: start;
}
.cc-title { font-weight: 700; color: var(--brand-dark); margin-bottom: 6px; font-size: 1.02rem; }
.cc-text { font-size: 0.92rem; line-height: 1.55; margin-bottom: 16px; }
.cc-text a { color: var(--brand); text-decoration: underline; white-space: nowrap; }
.cc-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-end; }
/* Both choices deliberately look identical (equal prominence, GDPR) */
.cc-btn {
  flex: 1 1 200px; max-width: 280px; cursor: pointer; font: inherit; font-weight: 600; font-size: 0.95rem;
  padding: 12px 20px; border-radius: var(--radius-sm); border: 1.5px solid var(--brand);
  background: var(--brand); color: white; transition: background .15s;
}
.cc-btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.cc-btn:focus-visible, .cc-text a:focus-visible { outline: 3px solid var(--accent-light); outline-offset: 2px; }
@media (max-width: 600px) {
  .cc-banner { inset-inline: 8px; bottom: 8px; }
  .cc-inner { padding: 16px; }
  .cc-btn { max-width: none; }
}
html[dir="rtl"] .cc-inner { font-family: 'Noto Sans Arabic', 'Inter', Tahoma, sans-serif; }
@media print { .cc-banner { display: none !important; } }

/* ---------- Google Maps 2-click placeholder (map-consent.js) ----------
   Takes the size of .map-embed (420px high, full width); the iframe is only
   injected after a click on [data-map-load]. Logical properties -> RTL-safe. */
.map-embed.map-consent {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--cream) 0%, var(--sand) 100%);
  border: 2px dashed var(--brand-light); color: var(--charcoal);
  padding: 24px; text-align: center;
}
.map-consent-inner { max-width: 420px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.map-consent-ico { font-size: 2.2rem; line-height: 1; }
.map-consent p { font-size: 0.95rem; line-height: 1.55; margin: 0; }
.map-consent p a { color: var(--brand); text-decoration: underline; }
.map-consent .btn { margin: 0; }
.map-consent-link { color: var(--brand); font-weight: 600; font-size: 0.92rem; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.map-consent-link:hover { color: var(--accent); }
.map-consent .btn:focus-visible, .map-consent a:focus-visible { outline: 3px solid var(--accent-light); outline-offset: 2px; }
html[dir="rtl"] .map-consent-link { unicode-bidi: plaintext; }
