/* Mobile Stylesheet - Optimized for screens below 768px */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Source+Serif+4:wght@600;700&display=swap');

:root {
  --bg: #d9d9d1;
  --bg-accent: #cfcfca;
  --surface: #e8e8e0;
  --surface-2: #e1e1da;
  --border: rgba(35, 35, 35, 0.18);
  --text: #232323;
  --muted: #575757;
  --accent: #2b53b3;
  --accent-2: #145f5d;
  --accent-3: #d95c2a;
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
  --footer-bg: #c7c7bf;
  --footer-text: #232323;
  --footer-border: #b0b0a8;
  --header-bg: #cfcfca;
  --header-text: #232323;
  --card-bg: #e3e3dc;
  --card-border: #c1c1b7;
  --card-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  background-image: url('../assets/images/backgrounds/background.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  width: 100vw;
  max-width: 100%;
}

main {
  max-width: 100%;
  margin: 0 auto;
  padding: 0.75rem 0.35rem 1rem;
}

.container {
  max-width: 100%;
  width: calc(100% - 0.6rem);
  margin: 0 auto;
  background: var(--surface);
  padding: 0.9rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
}

.container--narrow {
  max-width: 100%;
  width: calc(100% - 0.6rem);
}

h1,
h2,
h3,
.page-title,
.site-brand {
  font-family: 'Source Serif 4', Georgia, serif;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--accent-2);
}

h1,
h2,
h3 {
  margin-top: 0;
  overflow-wrap: anywhere;
}

h1 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

h2 {
  font-size: 1.2rem;
  margin-bottom: 0.4rem;
}

h3 {
  font-size: 1rem;
}

p {
  color: var(--text);
  font-size: 0.9rem;
  margin: 0.5rem 0;
  line-height: 1.5;
}

li {
  font-size: 0.9rem;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-3);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.page {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: flex-start;
  min-width: 0;
  width: 100%;
}

.content {
  flex: 0 0 auto;
  min-width: 0;
  width: 100%;
}

.right-column {
  flex: 0 0 auto;
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.right-column .text-box {
  flex: 0 0 auto;
  width: 100%;
  max-width: 100%;
  border: 2mm dotted #000000;
  box-shadow: var(--shadow);
}

.text-box,
.chat-box,
.video-box,
.page-card {
  background: rgba(236, 236, 230, 0.94);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
}

.text-box {
  flex: 0 0 auto;
  width: 100%;
  max-width: 100%;
  padding: 0.75rem 0.85rem;
  box-sizing: border-box;
  min-height: auto;
}

.text-box p:last-child {
  margin-bottom: 0;
}

.content > .text-box {
  border: 2mm dotted #000000;
}

.text-box--compact {
  max-width: 100%;
  margin-top: 1rem;
  padding: 0.75rem 0.85rem;
}

.page-image {
  width: 100%;
  max-width: 100%;
  margin: 0.75rem 0 1rem;
  max-height: 280px;
  object-fit: cover;
}

.page-image-column {
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
}

.page-image-column .page-image {
  margin-bottom: 0.75rem;
}

.page-image-text-box {
  max-width: none;
  min-height: 120px;
  border: 2mm dotted #d8b4fe;
}

.video-box {
  width: 100%;
  max-width: 100%;
  margin-top: 1rem;
  overflow: hidden;
  display: flex;
  justify-content: center;
  border: 2px solid #000000;
  padding: 0.2rem;
  box-sizing: border-box;
  background: #ffffff;
}

.video-box iframe {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 534 / 952;
  max-height: 400px;
}

.authorpage-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0.75rem 0 0;
  max-width: 100%;
  width: 100%;
}

.authorpage-gallery img {
  flex: 1;
  min-width: 0;
  height: auto;
  display: block;
  border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  max-height: 200px;
  object-fit: cover;
}

.image-column {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0;
}

.image-column img {
  width: 100%;
  height: auto;
  display: block;
  max-height: 180px;
  object-fit: cover;
}

.chat-box {
  padding: 0.85rem;
  margin-top: 1rem;
}

.chat-input {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  padding: 0.6rem;
  width: 100%;
  font-size: 0.9rem;
}

.send-btn {
  background: var(--accent-2);
  color: #ffffff;
  border: 0;
  border-radius: 999px;
  padding: 0.6rem 1rem;
  font-weight: 600;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.bottom-images {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin-top: 1rem;
  justify-content: stretch;
}

.bottom-images img {
  width: 100%;
  height: auto;
  max-height: 160px;
  object-fit: cover;
}

.additional-images {
  max-width: 100%;
  margin: 1.25rem auto;
  padding: 0 0.35rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.additional-images img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  flex: 1;
  max-width: calc(50% - 0.25rem);
  min-width: 0;
  max-height: 220px;
  object-fit: cover;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}

.form-input {
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 480px) {
  main {
    padding-inline: 0.25rem;
  }

  .container {
    width: calc(100% - 0.25rem);
    padding: 0.75rem;
    border-radius: 8px;
  }

  .image-column,
  .bottom-images {
    grid-template-columns: 1fr;
  }

  .page-image {
    max-height: none;
  }
}

/* Header Styles */
.site-header {
  position: relative;
  overflow: hidden;
  max-width: 100%;
  margin: 0 auto 1rem;
  display: flex;
  flex-direction: column;
  background-color: transparent;
  border: 1px solid rgba(47, 47, 47, 0.12);
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
}

.site-banner {
  display: block;
  width: 100%;
  height: auto;
  max-height: 120px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid rgba(47, 47, 47, 0.12);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  background-color: rgba(229, 229, 223, 0.75);
  border-radius: 14px 14px 0 0;
  border: 1px solid rgba(47, 47, 47, 0.12);
  border-bottom: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
}

.site-header > * {
  position: relative;
  z-index: 1;
}

.site-brand {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #1f8f8e;
  overflow-wrap: anywhere;
}

.site-nav {
  display: none;
  flex-direction: column;
  width: 100%;
  gap: 0.5rem;
  padding: 0.65rem 1rem 1rem;
  background-color: rgba(229, 229, 223, 0.75);
  border-radius: 0 0 14px 14px;
  border: 1px solid rgba(47, 47, 47, 0.12);
  border-top: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
}

.site-nav.open {
  display: flex;
}

.nav-links,
.nav-tools {
  display: flex;
  gap: 0.5rem;
  flex-direction: column;
  align-items: stretch;
}

.nav-tools {
  margin-left: 0;
}

.site-nav a {
  color: #3a3a3a;
  text-decoration: none;
  font-weight: 600;
  padding: 0.55rem 0.35rem;
  border-radius: 6px;
  transition: background-color 0.2s ease, color 0.2s ease;
  display: block;
  width: 100%;
}

.site-nav a:hover {
  color: #3f6fe3;
  background-color: rgba(255, 255, 255, 0.45);
}

.sitemap-link {
  margin-left: 0;
}

.menu-toggle {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(255, 255, 255, 0.45);
  border: 0;
  padding: 0.25rem;
  cursor: pointer;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  align-items: center;
  justify-content: center;
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: #3a3a3a;
}

/* Footer Styles */
.site-footer {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.6rem;
  background-color: var(--footer-bg);
  color: var(--footer-text);
  padding: 0.85rem;
  border: 1px solid var(--footer-border);
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
  margin: 1.25rem auto 0;
  width: calc(100% - 0.6rem);
  box-sizing: border-box;
}

.site-footer .footer-branding {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.site-footer .footer-image {
  display: block;
  max-width: 120px;
  height: auto;
}

.site-footer .footer-content {
  flex: 1 1 0;
  display: flex;
  align-items: stretch;
  min-width: 0;
}

.site-footer .footer-text-box {
  flex: 1 1 auto;
  width: 100%;
  min-height: auto;
  padding: 0.75rem 0.9rem;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid var(--footer-border);
  border-radius: 10px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
}

.site-footer .footer-text-box p {
  margin: 0;
  line-height: 1.4;
  font-size: 1.15rem;
  font-weight: 600;
  font-style: italic;
  overflow-wrap: anywhere;
  text-align: center;
}

.site-footer a {
  color: var(--footer-text);
  text-decoration: none;
}

.site-footer a:hover {
  color: #2b53b3;
  text-decoration: underline;
}

/* Page Card Styles */
.page-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  box-shadow: var(--card-shadow);
  padding: 1rem;
  margin-bottom: 1rem;
}

.page-grid {
  display: grid;
  gap: 1rem;
}

.page-title {
  margin-top: 0;
  margin-bottom: 0.5rem;
  color: #1f8f8e;
  font-size: 1.2rem;
}

.page-meta {
  color: #6b6b6b;
  font-size: 0.85rem;
}

/* Mobile-specific refinements */
@media (max-width: 480px) {
  body {
    padding: 0;
  }

  main {
    padding: 0.6rem 0.3rem 1rem;
  }

  .container {
    width: calc(100% - 0.5rem);
    padding: 0.8rem;
    margin: 0 0.25rem;
  }

  .page {
    flex-direction: column;
    gap: 0.6rem;
  }

  .content {
    flex: 1;
    width: 100%;
  }

  .right-column {
    flex: 1;
    width: 100%;
  }

  .image-column {
    width: 100%;
    flex-direction: row;
    gap: 0.5rem;
  }

  .image-column img {
    flex: 1;
    max-height: 150px;
  }

  h1 {
    font-size: 1.3rem;
    margin-bottom: 0.35rem;
  }

  h2 {
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
  }

  p {
    font-size: 0.85rem;
    margin: 0.4rem 0;
  }

  .text-box {
    padding: 0.65rem 0.75rem;
  }

  .page-image {
    max-height: 240px;
    margin: 0.5rem 0 0.8rem;
  }

  .video-box {
    padding: 0.15rem;
  }

  .video-box iframe {
    max-height: 350px;
  }

  .authorpage-gallery {
    gap: 0.5rem;
    margin: 0.5rem 0 0;
  }

  .authorpage-gallery img {
    max-height: 160px;
  }

  .bottom-images {
    gap: 0.4rem;
    margin-top: 0.8rem;
  }

  .bottom-images img {
    max-height: 130px;
  }

  .additional-images img {
    max-width: calc(50% - 0.25rem);
    max-height: 180px;
  }

  .site-footer {
    width: calc(100% - 0.5rem);
    margin: 1rem auto 0;
    padding: 0.7rem;
    gap: 0.5rem;
  }

  .site-footer .footer-image {
    max-width: 80px;
  }

  .site-footer .footer-text-box {
    padding: 0.6rem 0.65rem;
  }

  .site-footer .footer-text-box p {
    font-size: 0.9rem;
    line-height: 1.2;
  }

  .site-nav {
    padding: 0.5rem 0.75rem 0.8rem;
    gap: 0.4rem;
  }

  .site-nav a {
    padding: 0.45rem 0.3rem;
  }

  .header-row {
    padding: 0.65rem 0.75rem;
    gap: 0.6rem;
  }

  .site-brand {
    font-size: 0.85rem;
    letter-spacing: 0.03em;
  }
}

/* Tablet adjustments (481px - 767px) */
@media (min-width: 481px) and (max-width: 767px) {
  .page {
    gap: 0.8rem;
  }

  .content {
    flex: 0 0 58%;
  }

  .right-column {
    flex: 0 0 38%;
  }

  .image-column {
    width: 38%;
  }

  h1 {
    font-size: 1.6rem;
  }

  h2 {
    font-size: 1.25rem;
  }

  p {
    font-size: 0.92rem;
  }

  .image-column img {
    max-height: 200px;
  }

  .authorpage-gallery img {
    max-height: 220px;
  }

  .page-image {
    max-height: 300px;
  }
}
