/* Containers */
.dm-container, .dm-app-container, .dm-reading-container {
  width: 100%;
  margin-inline: auto;
  padding-inline: var(--dm-space-6);
}

.dm-container {
  max-width: calc(var(--dm-width-public) + (2 * var(--dm-space-6)));
}

.dm-app-container {
  max-width: calc(var(--dm-width-app) + (2 * var(--dm-space-6)));
}

.dm-reading-container {
  max-width: calc(var(--dm-width-reading) + (2 * var(--dm-space-6)));
}

/* Public Header (Mockup Image 1) */
.dm-site-header {
  position: relative;
  z-index: 9999;
  width: 100%;
  background: var(--dm-color-white);
  border-bottom: 1px solid var(--dm-color-border);
}

.dm-site-header--public {
  box-shadow: var(--dm-shadow-sm);
}

.dm-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--dm-space-5);
  min-height: 80px;
  padding-block: var(--dm-space-3);
  max-width: 1750px;
  width: 100%;
}

.dm-brand {
  display: flex;
  align-items: center;
  gap: var(--dm-space-3);
  text-decoration: none;
}

.dm-brand-logo {
  display: flex;
  align-items: center;
  gap: var(--dm-space-3);
  text-decoration: none;
  color: var(--dm-color-secondary);
}

.dm-brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--dm-color-primary);
}

.dm-brand-text {
  display: flex;
  flex-direction: column;
}

.dm-site-name {
  color: var(--dm-color-secondary);
  font-family: var(--dm-font-serif);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.dm-site-tagline {
  color: var(--dm-color-text-secondary);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
}

/* Mobile Hamburger Toggle */
.dm-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--dm-color-border-strong);
  border-radius: var(--dm-radius-medium);
  background: var(--dm-color-white);
  color: var(--dm-color-secondary);
  cursor: pointer;
  transition: all 0.15s ease-in-out;
}

.dm-menu-toggle:hover {
  background: var(--dm-color-surface-soft);
  color: var(--dm-color-primary);
  border-color: var(--dm-color-primary);
}

.dm-primary-navigation {
  display: flex;
  align-items: center;
}

.dm-primary-navigation__list {
  display: flex;
  align-items: center;
  gap: var(--dm-space-6);
  padding: 0;
  margin: 0;
  list-style: none;
}

.dm-primary-navigation__list a {
  color: var(--dm-color-text);
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  padding: var(--dm-space-2) var(--dm-space-3);
  border-radius: var(--dm-radius-small);
  transition: all 0.15s ease-in-out;
}

.dm-primary-navigation__list a:hover {
  color: var(--dm-color-primary);
  background: var(--dm-color-surface-soft);
}

.dm-header-actions {
  display: flex;
  align-items: center;
  gap: var(--dm-space-3);
  margin-left: auto;
}

.dm-header-nav-divider-item {
  display: flex;
  align-items: center;
}

.dm-header-divider {
  display: inline-block;
  width: 1px;
  height: 24px;
  background-color: #D7E4DF;
  margin-inline: 4px;
  flex-shrink: 0;
}

.dm-header-share-link {
  color: var(--dm-color-text, #0E362E);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  transition: color 0.18s ease-in-out;
  padding: 4px 6px;
}

.dm-header-share-link:hover,
.dm-header-share-link:focus-visible {
  color: var(--dm-color-primary-hover, #C86D51);
}

.dm-header-share-link.is-active {
  color: #C86D51;
  font-weight: 700;
}

.dm-mobile-nav-share-item {
  display: none;
}

/* Logged-in App Shell Framework (Mockup Image 2) */
.dm-app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: var(--dm-color-app-bg);
}

/* Top Navigation Bar */
.dm-app-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--dm-color-white);
  border-bottom: 1px solid var(--dm-color-border);
  box-shadow: var(--dm-shadow-sm);
}

.dm-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--dm-space-6);
  height: 72px;
  padding-inline: 28px;
  max-width: var(--dm-width-app);
  margin-inline: auto;
}

.dm-topbar-search {
  position: relative;
  flex: 1;
  max-width: 480px;
}

.dm-topbar-search__input {
  width: 100%;
  height: 44px;
  padding: 10px 16px 10px 42px;
  background: var(--dm-color-app-bg);
  border: 1px solid var(--dm-color-border);
  border-radius: var(--dm-radius-pill);
  font-size: 14px;
  color: var(--dm-color-text);
  transition: all 0.15s ease-in-out;
}

.dm-topbar-search__input:focus {
  background: var(--dm-color-white);
  border-color: var(--dm-color-primary);
  box-shadow: 0 0 0 3px var(--dm-color-focus);
  outline: none;
}

.dm-topbar-search__icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--dm-color-text-muted);
  pointer-events: none;
}

.dm-topbar-user {
  display: flex;
  align-items: center;
  gap: var(--dm-space-4);
}

.dm-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--dm-color-border);
  background: var(--dm-color-white);
  color: var(--dm-color-text-secondary);
  cursor: pointer;
  transition: all 0.15s ease-in-out;
}

.dm-icon-btn:hover {
  background: var(--dm-color-surface-soft);
  color: var(--dm-color-text);
}

.dm-user-pill {
  display: flex;
  align-items: center;
  gap: var(--dm-space-3);
  padding: 4px 12px 4px 4px;
  background: var(--dm-color-white);
  border: 1px solid var(--dm-color-border);
  border-radius: var(--dm-radius-pill);
  cursor: pointer;
  text-decoration: none;
  color: var(--dm-color-text);
  transition: all 0.15s ease-in-out;
}

.dm-user-pill:hover {
  background: var(--dm-color-surface-soft);
  border-color: var(--dm-color-border-strong);
}

.dm-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--dm-color-primary-soft);
  color: var(--dm-color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
}

.dm-user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.dm-user-name {
  font-weight: 600;
  font-size: 14px;
}

.dm-user-role {
  font-size: 12px;
  color: var(--dm-color-text-muted);
}

/* App Layout Grid (Sidebar + Main + Optional Aside) */
.dm-app-body {
  display: flex;
  flex: 1;
  max-width: var(--dm-width-app);
  width: 100%;
  margin-inline: auto;
  padding: 24px 28px;
  gap: 28px;
}

/* Left Sidebar Navigation */
.dm-app-sidebar {
  width: var(--dm-sidebar-width);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--dm-color-white);
  border: 1px solid var(--dm-color-border);
  border-radius: var(--dm-radius-card);
  padding: var(--dm-space-4);
  box-shadow: var(--dm-shadow-sm);
  align-self: flex-start;
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.dm-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dm-sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--dm-space-3);
  padding: 10px 16px;
  border-radius: var(--dm-radius-control);
  color: var(--dm-color-text-secondary);
  font-weight: 500;
  font-size: 15px;
  text-decoration: none;
  transition: all 0.15s ease-in-out;
}

.dm-sidebar-link:hover {
  background: var(--dm-color-surface-soft);
  color: var(--dm-color-text);
}

.dm-sidebar-link.is-active,
.dm-sidebar-link[aria-current="page"] {
  background: var(--dm-color-surface-soft);
  color: var(--dm-color-secondary);
  font-weight: 700;
  border-left: 3px solid var(--dm-color-secondary);
}

.dm-sidebar-link .dm-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.dm-sidebar-footer {
  margin-top: var(--dm-space-8);
  padding-top: var(--dm-space-4);
  border-top: 1px dashed var(--dm-color-border);
}

.dm-sidebar-footer-quote {
  font-family: var(--dm-font-handwriting);
  font-size: 18px;
  color: var(--dm-color-text-secondary);
  line-height: 1.3;
  margin-bottom: var(--dm-space-3);
}

.dm-sidebar-footer-brand {
  font-size: 12px;
  color: var(--dm-color-text-muted);
}

/* Main Content Viewport */
.dm-main, .dm-app-main {
  flex: 1;
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

/* Right Contextual Panel */
.dm-app-aside {
  width: 320px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: var(--dm-space-5);
}

/* Public Footer */
.dm-site-footer--public {
  background: var(--dm-color-footer-bg);
  color: var(--dm-color-text-light);
  padding-block: var(--dm-space-9) var(--dm-space-6);
  margin-top: auto;
}

.dm-footer-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--dm-space-8);
  padding-bottom: var(--dm-space-8);
  margin-bottom: var(--dm-space-6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.dm-footer-brand-col {
  display: flex;
  flex-direction: column;
  gap: var(--dm-space-3);
}

.dm-footer-brand-link {
  text-decoration: none;
  display: inline-block;
}

.dm-footer-brand-title {
  font-family: var(--dm-font-serif);
  font-size: 28px;
  font-weight: 700;
  color: var(--dm-color-white);
  margin-bottom: 0;
}

.dm-footer-brand-desc {
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  line-height: 1.55;
  margin: 0;
}

.dm-footer-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--dm-space-6);
}

.dm-footer-col-heading {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #C86D51;
  margin: 0 0 var(--dm-space-4) 0;
}

.dm-footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--dm-space-3);
}

.dm-footer-links a {
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
  font-weight: 400;
  text-decoration: none;
  transition: color 0.15s ease;
}

.dm-footer-links a:hover,
.dm-footer-links a:focus-visible {
  color: var(--dm-color-white);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.dm-footer-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--dm-space-4);
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}

.dm-footer-bottom-row a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  transition: color 0.15s ease;
}

.dm-footer-bottom-row a:hover,
.dm-footer-bottom-row a:focus-visible {
  color: var(--dm-color-white);
  text-decoration: underline;
}
