/* Malìa legal pages — shared styles, landing-aligned */
@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,600;1,600&family=Nunito:wght@400;600;700&display=swap');

:root {
  --cream: #F8F6F2;
  --sand: #E8E2DA;
  --sage: #7C8C6C;
  --sagedeep: #5C6B54;
  --sagelight: #B8C4A9;
  --ink: #1F2633;
  --gold: #C8A04A;
  --golddeep: #A8832F;
  --white: #FFFFFF;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 5rem; }

body {
  margin: 0;
  font-family: 'Nunito', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.7;
  font-size: 16px;
}

h1, h2, h3 {
  font-family: 'Lora', Georgia, serif;
  font-weight: 600;
  line-height: 1.3;
}

h1 { font-size: clamp(1.7rem, 4vw, 2.2rem); margin: 0; }

h2 {
  font-size: 1.25rem;
  color: var(--sagedeep);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-bottom: .45rem;
  border-bottom: 1px solid var(--sand);
}

h3 { font-size: 1.05rem; margin-top: 1.8rem; margin-bottom: .6rem; }

p, li { margin: .65rem 0; }

ul, ol { padding-left: 1.4rem; }

li { margin: .5rem 0; }

a { color: var(--sagedeep); text-decoration: underline; text-underline-offset: .15em; }
a:hover { color: var(--sage); }

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

.container { max-width: 780px; margin: 0 auto; padding: 0 1.25rem; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(248, 246, 242, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--sand);
}

.site-header .inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: .75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-header .brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); }
.site-header .brand img { height: 36px; width: auto; }
.site-header .brand span { font-family: 'Lora', serif; font-style: italic; font-size: 1.1rem; }

.site-header nav {
  display: none;
  align-items: center;
  gap: 1.25rem;
  font-size: .9rem;
  font-weight: 600;
}

@media (min-width: 720px) {
  .site-header nav { display: flex; }
}

.site-header nav a {
  color: var(--ink);
  text-decoration: none;
  opacity: .85;
}
.site-header nav a:hover { opacity: 1; color: var(--sagedeep); }

.lang-switcher {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--sand);
  border-radius: 999px;
  overflow: hidden;
  background: var(--white);
  font-size: .8rem;
  font-weight: 700;
}

.lang-switcher button {
  border: none;
  background: none;
  padding: .35rem .75rem;
  cursor: pointer;
  color: var(--ink);
}

.lang-switcher button.active { background: var(--sage); color: var(--cream); }
.lang-switcher button:hover:not(.active) { background: var(--cream); }

/* Main content */
main { padding: 2.5rem 0 5rem; }

.updated {
  color: var(--sage);
  font-size: .9rem;
  margin-bottom: 1.5rem;
}

.note {
  background: var(--white);
  border-left: 4px solid var(--sage);
  padding: 1rem 1.1rem;
  margin: 1rem 0;
  border-radius: 0 .5rem .5rem 0;
}

.note p:first-child { margin-top: 0; }
.note p:last-child { margin-bottom: 0; }

/* Footer */
.site-footer {
  position: relative;
  background: var(--sagedeep);
  color: var(--cream);
  padding: 2.5rem 0 1.5rem;
  margin-top: 2rem;
}

.site-footer::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  height: 12px;
  background: radial-gradient(circle at 50% 100%, var(--sagedeep) 10px, transparent 11px);
  background-size: 24px 12px;
}

.site-footer .inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.footer-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
  padding-bottom: 1.5rem;
}

@media (min-width: 720px) {
  .footer-top {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

.footer-brand { display: flex; align-items: center; gap: .6rem; }
.footer-brand img { height: 32px; width: auto; }
.footer-brand span { font-family: 'Lora', serif; font-style: italic; opacity: .9; }

.footer-social { display: flex; gap: 1rem; align-items: center; }
.footer-social a { color: var(--cream); opacity: .85; text-decoration: none; display: inline-flex; }
.footer-social a:hover { opacity: 1; color: var(--gold); }
.footer-social svg { width: 20px; height: 20px; display: block; }

.footer-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(248, 246, 242, 0.15);
  font-size: .85rem;
  opacity: .8;
}

@media (min-width: 720px) {
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
  }
}

.footer-bottom a { color: var(--cream); text-decoration: none; }
.footer-bottom a:hover { text-decoration: underline; }

.footer-legal { display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; justify-content: center; }

/* Cookie banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--white);
  border-top: 1px solid var(--sand);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.06);
  z-index: 1000;
  display: none;
}
.cookie-banner.visible { display: block; }

.cookie-banner .inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  align-items: center;
  text-align: center;
  font-size: .9rem;
}

@media (min-width: 720px) {
  .cookie-banner .inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

.cookie-banner p { margin: 0; color: var(--ink); opacity: .85; }
.cookie-banner a { color: var(--sagedeep); }

.cookie-banner .actions { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center; }
.cookie-banner button {
  border: none;
  border-radius: 999px;
  padding: .55rem 1.1rem;
  font-weight: 700;
  cursor: pointer;
  font-size: .85rem;
}
.cookie-banner button.ok { background: var(--sage); color: var(--cream); }
.cookie-banner button.ok:hover { background: var(--sagedeep); }
.cookie-banner button.naked { background: transparent; color: var(--ink); }
.cookie-banner button.naked:hover { background: var(--cream); }

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: .9rem;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

thead {
  display: none;
}

tbody tr {
  display: block;
  padding: 1rem 0;
  border-bottom: 1px solid var(--sand);
}

tbody td {
  display: block;
  padding: .15rem 0;
}

tbody td::before {
  content: attr(data-label) ": ";
  font-weight: 700;
  color: var(--sagedeep);
}

@media (min-width: 720px) {
  table { display: table; }

  thead { display: table-header-group; }

  tbody tr { display: table-row; padding: 0; border-bottom: none; }

  tbody td {
    display: table-cell;
    padding: .75rem .6rem;
    border-bottom: 1px solid var(--sand);
    vertical-align: top;
  }

  tbody td::before { content: none; }

  th, td { text-align: left; }

  th {
    padding: .75rem .6rem;
    border-bottom: 2px solid var(--sage);
    font-weight: 700;
    color: var(--sagedeep);
  }
}

.hidden { display: none !important; }

/* WebView mode: hide navigational chrome */
body.webview .site-header nav,
body.webview .site-footer .footer-social,
body.webview .site-footer .footer-legal {
  display: none !important;
}

body.webview .site-header .brand span {
  display: none;
}

@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .cookie-banner { padding-bottom: env(safe-area-inset-bottom); }
  body { padding-bottom: env(safe-area-inset-bottom); }
}
