/* Islander on the Beach 325 — House Manual styles
   Mobile-first. No frameworks, no build step. */

:root {
  --color-bg: #fbf7ef;
  --color-surface: #ffffff;
  --color-text: #1c2b39;
  --color-text-muted: #4b5b68;
  --color-border: #ddd2bd;
  --color-primary: #0b6e78;
  --color-primary-dark: #084f57;
  --color-accent: #c1502e;
  --focus-ring: #0b6e78;

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;

  --radius: 12px;
  --max-width: 720px;
  --topbar-height: 64px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #14202a;
    --color-surface: #1c2b39;
    --color-text: #f2ede1;
    --color-text-muted: #c3cdd6;
    --color-border: #344653;
    --color-primary: #5fd3d9;
    --color-primary-dark: #8fe4e8;
    --color-accent: #ff9466;
    --focus-ring: #5fd3d9;
  }
}

* {
  box-sizing: border-box;
}

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

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
}

a {
  color: var(--color-primary-dark);
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--color-surface);
  color: var(--color-text);
  padding: var(--space-2);
  z-index: 100;
}

.skip-link:focus {
  left: var(--space-2);
  top: var(--space-2);
}

/* Header */

.site-header {
  background: var(--color-primary);
  color: #fff;
  padding: var(--space-3) var(--space-2) var(--space-4);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.site-header h1 {
  margin: 0 0 var(--space-1);
  font-size: 1.6rem;
  line-height: 1.2;
}

.site-header h1 .unit {
  display: block;
  font-size: 1rem;
  font-weight: 400;
  opacity: 0.9;
}

.address {
  margin: 0 0 var(--space-2);
  font-size: 0.95rem;
}

.map-link {
  display: inline-block;
  margin-left: var(--space-1);
  color: #fff;
  text-decoration: underline;
  white-space: nowrap;
}

.welcome {
  margin: 0 0 var(--space-2);
  font-size: 1rem;
  opacity: 0.95;
}

.hero-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin-bottom: var(--space-2);
}

.quick-facts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-1) var(--space-2);
  font-size: 0.9rem;
}

.quick-facts > li {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: var(--space-1);
}

.quick-facts-wide {
  grid-column: 1 / -1;
}

.quick-facts strong {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.85;
}

.quick-facts a {
  color: #fff;
  text-decoration: underline;
}

.quick-contact-list {
  list-style: none;
  margin: 0.6em 0 0;
  padding: 0;
}

.quick-contact-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.15em 1em;
  padding: 0.6em 0;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.quick-contact-list li:first-child {
  border-top: none;
  padding-top: 0;
}

.quick-contact-list li:last-child {
  padding-bottom: 0;
}

.quick-contact-name {
  font-weight: 600;
  line-height: 1.4;
}

.quick-contact-role {
  display: block;
  font-size: 0.78rem;
  font-weight: 400;
  opacity: 0.75;
  margin-top: 0.1em;
}

.quick-contact-list a {
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Sticky top bar with dropdown menu */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--color-primary-dark);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.topbar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.6rem var(--space-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar-title {
  background: none;
  border: none;
  padding: 0.4em 0;
  margin: 0;
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  font-size: 1rem;
  text-align: left;
  cursor: pointer;
  min-height: 44px;
}

.topbar-title:hover {
  text-decoration: underline;
}

.menu-wrap {
  position: relative;
}

.menu-toggle {
  display: flex;
  align-items: center;
  gap: 0.4em;
  min-height: 44px;
  padding: 0.5em 1em;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.menu-toggle:hover {
  background: rgba(255, 255, 255, 0.25);
}

.menu-caret {
  transition: transform 0.2s ease;
}

@media (prefers-reduced-motion: reduce) {
  .menu-caret {
    transition: none;
  }
}

.menu-toggle[aria-expanded="true"] .menu-caret {
  transform: rotate(180deg);
}

.menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 60;
  list-style: none;
  margin: 0;
  padding: 0.4rem;
  width: min(84vw, 300px);
  max-height: 70vh;
  overflow-y: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}

.menu-dropdown[hidden] {
  display: none;
}

.menu-dropdown a {
  display: flex;
  align-items: center;
  gap: 0.6em;
  min-height: 44px;
  padding: 0.5em 0.7em;
  border-radius: 8px;
  text-decoration: none;
  color: var(--color-text);
  font-size: 0.95rem;
  font-weight: 600;
}

.menu-dropdown a:hover,
.menu-dropdown a:focus-visible {
  background: var(--color-bg);
}

/* Main content */

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-3) var(--space-2) var(--space-4);
}

details.topic {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  margin-bottom: var(--space-2);
  overflow: hidden;
  scroll-margin-top: calc(var(--topbar-height) + var(--space-1));
}

details.topic summary {
  list-style: none;
  cursor: pointer;
  padding: var(--space-2);
  display: flex;
  align-items: center;
  min-height: 48px;
}

details.topic summary::-webkit-details-marker {
  display: none;
}

details.topic summary h2 {
  margin: 0;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 0.6em;
  flex: 1;
}

details.topic summary::after {
  content: "▾";
  margin-left: var(--space-1);
  transition: transform 0.2s ease;
  color: var(--color-text-muted);
}

@media (prefers-reduced-motion: reduce) {
  details.topic summary::after {
    transition: none;
  }
}

details.topic[open] summary::after {
  transform: rotate(180deg);
}

.panel {
  padding: 0 var(--space-2) var(--space-2);
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-2);
}

.panel ul,
.panel ol {
  padding-left: 1.3em;
  margin: 0 0 var(--space-2);
}

.panel li {
  margin-bottom: 0.4em;
}

.panel h3 {
  font-size: 0.95rem;
  margin: var(--space-2) 0 var(--space-1);
}

.panel-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin-bottom: var(--space-2);
}

.note {
  color: var(--color-text-muted);
  font-style: italic;
}

/* Wi-Fi key/value */

.key-value {
  margin: 0 0 var(--space-2);
}

.key-value dt {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  margin-top: var(--space-2);
}

.key-value dd {
  margin: 0.2em 0 0;
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex-wrap: wrap;
}

.key-value code {
  font-size: 1.1rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 0.2em 0.5em;
}

.copy-btn {
  min-height: 40px;
  padding: 0.4em 0.9em;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.copy-btn:hover {
  background: var(--color-primary-dark);
}

.copy-status {
  min-height: 1.2em;
  font-size: 0.85rem;
  color: var(--color-primary-dark);
  margin: 0;
}

/* Contacts */

.contact-list {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-2);
}

.contact-list li {
  padding: var(--space-1) 0;
  border-bottom: 1px solid var(--color-border);
}

.contact-list li:last-child {
  border-bottom: none;
}

.contact-list a {
  font-size: 1.05rem;
  font-weight: 600;
}

.emergency {
  font-weight: 700;
  color: var(--color-accent);
}

/* Footer */

.site-footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-3) var(--space-2) var(--space-4);
  text-align: center;
  color: var(--color-text-muted);
}

.site-footer a {
  font-weight: 600;
}

/* Back to top */

.back-to-top {
  position: fixed;
  right: var(--space-2);
  bottom: var(--space-2);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--color-primary);
  color: #fff;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

@media (prefers-reduced-motion: reduce) {
  .back-to-top {
    transition: none;
  }
}

.back-to-top.visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
