/* House style — cream/navy, very large type, very high contrast.
   Designed for an 86-year-old user on a Windows desktop with reading glasses.
   No drop shadows, no motion, no greys-on-greys. */

:root {
  --cream: #FAF6EE;
  --navy: #1A2540;
  --navy-darker: #131B30;
  --amber: #D88A2D;
  --warning: #8A1F1F;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--cream);
  color: var(--navy);
  font-family: Georgia, "Source Serif Pro", "Times New Roman", serif;
  font-size: 28px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Layout containers */
.page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 48px 64px;
  width: 100%;
  flex: 1;
}

.page-header {
  text-align: center;
  padding: 32px 0 16px;
}

.page-title {
  font-size: 56px;
  font-weight: 700;
  margin: 0 0 8px;
  letter-spacing: -0.5px;
}

.page-greeting {
  font-size: 48px;
  font-weight: 400;
  margin: 24px 0 8px;
}

.page-subtitle {
  font-size: 28px;
  font-weight: 400;
  margin: 0 0 32px;
}

/* Buttons — minimum 220x220 for primary, 220x80 for secondary */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--navy);
  color: var(--cream);
  border: 2px solid var(--navy);
  border-radius: 12px;
  font-family: inherit;
  font-size: 32px;
  font-weight: 700;
  padding: 24px 36px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  min-width: 220px;
  min-height: 80px;
  line-height: 1.25;
}
.btn:hover { background: var(--navy-darker); border-color: var(--navy-darker); }
.btn:focus-visible { outline: 4px solid var(--amber); outline-offset: 4px; }
.btn:active { background: var(--navy-darker); }
.btn[disabled],
.btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-disabled-note {
  display: block;
  font-size: 22px;
  margin-top: 8px;
  color: var(--navy);
}

.btn-giant {
  min-width: 360px;
  min-height: 220px;
  font-size: 48px;
  flex-direction: column;
  padding: 36px 32px;
  border-radius: 16px;
}
.btn-giant .btn-subtitle {
  display: block;
  font-size: 26px;
  font-weight: 400;
  margin-top: 16px;
  line-height: 1.4;
  max-width: 600px;
}

.btn-card-cta {
  width: 100%;
  min-height: 80px;
  margin-top: 16px;
}

.btn-back {
  font-size: 28px;
  padding: 16px 28px;
  min-height: 64px;
  min-width: 200px;
}

/* Home — two giant buttons */
.home-buttons {
  display: flex;
  flex-direction: column;
  gap: 32px;
  align-items: center;
  margin: 48px 0;
}
@media (min-width: 1100px) {
  .home-buttons {
    flex-direction: row;
    justify-content: center;
    gap: 48px;
  }
}

.home-footnote {
  text-align: center;
  font-size: 22px;
  margin-top: 48px;
  color: var(--navy);
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

/* Card grids — 2 columns on wide, 1 on narrow */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  margin-top: 32px;
}
@media (min-width: 900px) {
  .card-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.card {
  background: var(--cream);
  border: 3px solid var(--navy);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
}
.card-image {
  width: 100%;
  height: 280px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--navy);
  background: #E8E2D2;
  display: block;
}
.card-image-placeholder {
  width: 100%;
  height: 280px;
  border-radius: 8px;
  border: 1px solid var(--navy);
  background: linear-gradient(135deg, #E8E2D2, #C8BD9A);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--navy);
  font-size: 24px;
  text-align: center;
  padding: 20px;
}
.card-title {
  font-size: 36px;
  font-weight: 700;
  margin: 20px 0 8px;
  line-height: 1.2;
}
.card-summary {
  font-size: 24px;
  margin: 0 0 16px;
  line-height: 1.5;
  flex: 1;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0 24px;
  border-bottom: 2px solid var(--navy);
}
.top-bar-title {
  font-size: 36px;
  font-weight: 700;
  margin: 0;
}

/* Story narrative page */
.story-hero {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--navy);
  margin: 24px 0;
}
.story-narrative {
  font-size: 28px;
  line-height: 1.7;
  max-width: 900px;
}
.story-narrative p { margin: 0 0 24px; }
.story-controls {
  margin: 32px 0;
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.story-sources {
  margin-top: 48px;
  padding: 24px;
  border: 2px solid var(--navy);
  border-radius: 12px;
  background: #F2EBD8;
}
.story-sources h3 {
  font-size: 28px;
  margin: 0 0 16px;
}
.story-sources ul {
  margin: 0;
  padding-left: 24px;
  font-size: 22px;
  line-height: 1.5;
}
.story-sources a {
  color: var(--navy);
  text-decoration: underline;
}

/* Content warning panel */
.warning-panel {
  background: #F2EBD8;
  border: 3px solid var(--warning);
  border-radius: 12px;
  padding: 32px;
  margin: 32px 0;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}
.warning-panel-title {
  font-size: 36px;
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--warning);
}
.warning-panel-text {
  font-size: 26px;
  margin: 0 0 24px;
}

/* Tour viewer layout */
.tour-viewer {
  display: grid;
  grid-template-columns: 1fr 460px;
  gap: 24px;
  height: calc(100vh - 32px);
  margin: 16px;
}
.tour-viewer.no-iframe {
  grid-template-columns: 1fr;
}
.tour-iframe {
  width: 100%;
  height: 100%;
  border: 2px solid var(--navy);
  border-radius: 12px;
  background: var(--cream);
}
.docent-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  border: 3px solid var(--navy);
  border-radius: 12px;
  background: var(--cream);
  overflow-y: auto;
}
.docent-panel-title {
  font-size: 32px;
  font-weight: 700;
  margin: 0;
  line-height: 1.2;
}
.docent-where {
  font-size: 24px;
  margin: 0 0 8px;
  font-style: italic;
}
.docent-message {
  background: #F2EBD8;
  border: 1px solid var(--navy);
  border-radius: 8px;
  padding: 16px;
  font-size: 22px;
  line-height: 1.5;
  min-height: 80px;
}

/* Speak button — large, central, hold-to-talk */
.speak-button {
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--cream);
  border: 4px solid var(--navy);
  font-family: inherit;
  font-size: 32px;
  font-weight: 700;
  cursor: pointer;
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
.speak-button .speak-icon {
  font-size: 80px;
  line-height: 1;
  margin-bottom: 8px;
}
.speak-button.listening {
  background: #8A1F1F;
  border-color: #8A1F1F;
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(138, 31, 31, 0.6); }
  50% { box-shadow: 0 0 0 24px rgba(138, 31, 31, 0); }
}
.speak-button:focus-visible { outline: 4px solid var(--amber); outline-offset: 4px; }

.docent-presets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.docent-presets .btn {
  font-size: 24px;
  min-height: 80px;
  min-width: 0;
  padding: 12px 16px;
}
.docent-utility {
  display: flex;
  gap: 12px;
}
.docent-utility .btn {
  flex: 1;
  font-size: 22px;
  min-height: 64px;
  min-width: 0;
  padding: 8px 12px;
}

.signout {
  position: fixed;
  bottom: 8px;
  right: 16px;
  font-size: 16px;
  color: var(--navy);
  text-decoration: underline;
  opacity: 0.5;
}
.signout:hover { opacity: 1; }

/* Auth gate failure */
.auth-failed {
  text-align: center;
  padding: 96px 32px;
  font-size: 36px;
  line-height: 1.5;
}

/* Hidden until JS approves */
.app-hidden { display: none; }

/* Accessibility — keyboard focus everywhere */
:focus-visible { outline: 4px solid var(--amber); outline-offset: 2px; }

/* No motion preference: kill the pulse animation */
@media (prefers-reduced-motion: reduce) {
  .speak-button.listening { animation: none; }
}
