/* Member login, zone navigation and editorial dashboard. */

.member-main {
  min-height: 65vh;
}

.member-zone-logo {
  position: relative;
  width: min(100%, 180px);
  aspect-ratio: 7 / 5;
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.member-zone-logo img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  max-width: none;
  height: auto;
  transform: translate(-50%, -50%);
}

.member-login {
  max-width: 520px;
  padding-block: clamp(2rem, 5vw, 4rem);
}

.member-message h2 {
  margin-bottom: 2rem;
  font-size: clamp(2.6rem, 5.5vw, 5rem);
}

.member-message > p {
  max-width: 540px;
  color: var(--muted);
}

.member-login-panel {
  padding: clamp(1.5rem, 3.5vw, 3rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  background: white;
}

.member-login-panel h2 {
  font-size: 2rem;
}

.member-login-panel label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.member-login-panel .input {
  width: 100%;
}

.member-login-panel .login-remember label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 400;
}

.member-login-panel input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

.member-login-panel input[type="submit"] {
  width: 100%;
  cursor: pointer;
}

.member-toolbar {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  font-size: 0.78rem;
}

.member-toolbar-inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  min-height: 52px;
  padding-block: 0.4rem;
}

.member-toolbar-home {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  font-weight: 600;
  text-decoration: none;
}

.member-toolbar-home:hover {
  text-decoration: underline;
}

.member-toolbar-name {
  overflow: hidden;
  color: var(--muted);
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-logout {
  min-height: 36px;
  padding: 0.45rem 0.9rem;
  gap: 0.5rem;
  font-size: 0.75rem;
  white-space: nowrap;
  box-shadow: none;
}

.member-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--line);
}

.member-tabs a {
  padding-block: 0.8rem;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 0.9rem;
  text-decoration: none;
}

.member-tabs a[aria-current="page"],
.member-tabs a:hover {
  border-color: var(--accent);
  color: var(--ink);
}

.member-zone-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.member-zone-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 1rem;
  align-items: center;
  gap: 0.85rem;
  min-height: 112px;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  text-decoration: none;
  transition: border-color 180ms ease, background-color 180ms ease;
}

.member-zone-card:is(:hover, :focus-visible) {
  border-color: var(--accent);
  background: var(--accent-surface);
}

.member-zone-card .eyebrow {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--muted);
  font-size: 0.55rem;
  letter-spacing: 0.08em;
}

.member-zone-card h2 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.35;
}

.member-zone-card .member-zone-logo {
  width: 64px;
  height: 56px;
  margin: 0;
  aspect-ratio: auto;
}

.member-zone-card .member-zone-logo img {
  inset: 0;
  height: 100%;
  object-fit: contain;
  transform: none;
}

.member-message {
  max-width: 850px;
  padding-block: 2rem;
}

@media (max-width: 1000px) {
  .member-zone-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .member-zone-grid {
    grid-template-columns: 1fr;
  }

  .member-toolbar-inner {
    gap: 0.65rem;
  }

  .member-toolbar-home,
  .member-logout {
    min-height: 44px;
  }

  .member-tabs {
    gap: 0.25rem 1.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .member-zone-card {
    transition: none;
  }
}


@media print {
  .member-toolbar {
    display: none;
  }
}

/* Member and editorial workspaces share the same cards and spacing. */
.portal-workspace {
  padding-block: 1.25rem clamp(2rem, 4vw, 4rem);
}

.member-main-zone {
  min-height: calc(100svh - var(--header-height, 105px) - var(--admin-offset, 0px));
}

.member-main-zone .portal-workspace {
  width: calc(100% - var(--gutter) * 2);
}

.portal-identity {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding: clamp(1.25rem, 2.5vw, 2rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
}

.portal-identity > img {
  width: 112px;
  height: 80px;
  object-fit: contain;
  flex-shrink: 0;
}

.portal-identity > div {
  min-width: 0;
  flex: 1;
}

.portal-identity h1 {
  margin-block: 0.7rem 0.5rem;
  font-size: clamp(1.5rem, 2.8vw, 2.5rem);
}

.portal-identity p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.portal-badge {
  display: inline-block;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  color: var(--accent);
  background: var(--mint);
  font-size: 0.68rem;
  font-weight: 650;
  line-height: 1.5;
}

.portal-badge-neutral {
  color: var(--muted);
  background: var(--surface);
}

.portal-small-button {
  min-height: 44px;
  gap: 0.65rem;
  padding: 0.7rem 1rem;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.portal-workspace .member-tabs {
  gap: 0.5rem;
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

.portal-workspace .member-tabs a {
  min-height: 44px;
  padding: 0.65rem 1rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.85rem;
}

.portal-workspace .member-tabs a[aria-current="page"] {
  color: white;
  background: var(--charcoal);
}

.portal-workspace .member-tabs a:hover {
  border-color: var(--line);
}

.portal-columns {
  display: grid;
  grid-template-columns: minmax(0, 2.35fr) minmax(250px, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.portal-stack {
  display: grid;
  gap: 1.5rem;
  min-width: 0;
}

.portal-panel,
.portal-welcome {
  min-width: 0;
  padding: clamp(1.25rem, 2.5vw, 2rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
}

.portal-panel h3 {
  margin-bottom: 0.65rem;
  font-size: 1.25rem;
}

.portal-panel p {
  color: var(--muted);
  font-size: 0.85rem;
}

.portal-panel > :last-child {
  margin-bottom: 0;
}

.portal-panel-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.portal-panel-heading p {
  margin: 0;
}

.portal-welcome {
  background: radial-gradient(ellipse at 100% 0%, var(--accent-soft), transparent 70%), var(--mint);
}

.portal-welcome .eyebrow,
.portal-panel .eyebrow {
  margin-bottom: 1rem;
  color: var(--accent);
}

.portal-welcome h3 {
  margin-bottom: 1rem;
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  line-height: 1.12;
}

.portal-welcome > p:not(.eyebrow) {
  max-width: 500px;
  color: var(--muted);
  font-size: 0.9rem;
}

.portal-shortcuts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.portal-shortcut {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: white;
  text-decoration: none;
  transition: border-color 180ms ease, background-color 180ms ease;
}

.portal-shortcut:is(:hover, :focus-visible) {
  border-color: var(--accent);
  background: var(--accent-surface);
}

.portal-symbol {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 1rem;
  border-radius: 12px;
  background: var(--mint);
  color: var(--accent);
  font-size: 20px;
  flex-shrink: 0;
}

.portal-shortcut:nth-child(2) .portal-symbol {
  background: var(--peach);
  color: var(--charcoal);
}

.portal-shortcut h3 {
  margin-bottom: 0.65rem;
  font-size: 1.1rem;
}

.portal-shortcut p {
  color: var(--muted);
  font-size: 0.8rem;
}

.portal-shortcut-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-top: auto;
  font-size: 0.78rem;
  font-weight: 600;
}

.portal-empty-state {
  padding: 2rem 1rem;
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: var(--paper);
  text-align: center;
}

.portal-empty-state h4 {
  margin: 0 0 0.65rem;
  font-size: 1rem;
  font-weight: 600;
}

.portal-empty-state p {
  max-width: 380px;
  margin: 0 auto;
}

.portal-contact {
  background: var(--surface);
}

.portal-phone {
  display: block;
  width: fit-content;
  margin-top: 1rem;
  font-size: 0.95rem;
  text-underline-offset: 0.2em;
}

.portal-access h3 {
  margin-top: 1rem;
}

.portal-target-panel {
  position: sticky;
  top: calc(var(--header-height, 105px) + var(--admin-offset, 0px) + 1rem);
  max-height: calc(100dvh - var(--header-height, 105px) - var(--admin-offset, 0px) - 2rem);
  overflow-y: auto;
  padding: 1.25rem;
}

.portal-target-panel h2 {
  margin: 0;
  font-size: 1.15rem;
}

.portal-editor-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  align-items: start;
  gap: 1.5rem;
}

.portal-recent {
  margin-top: 1.5rem;
}

.portal-recent h2 {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
}

.portal-recent-list {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.portal-recent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
}

.portal-recent-copy {
  min-width: 0;
}

.portal-recent-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  color: var(--muted);
  font-size: 0.72rem;
}

.portal-recent-item h3 {
  margin: 0.6rem 0 0;
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.portal-recent-item h3 a {
  text-decoration: none;
}

.portal-recent-item h3 a:hover {
  text-decoration: underline;
}

.portal-item-actions {
  display: flex;
  flex-shrink: 0;
  gap: 0.4rem;
}

.portal-item-action {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  color: var(--muted);
  font-size: 18px;
}

.portal-item-action:disabled {
  opacity: 1;
  cursor: not-allowed;
}

.portal-icon-pen {
  --icon-source: url("../../svg/pen.svg");
}

.portal-icon-delete {
  --icon-source: url("../../svg/delete.svg");
}

.portal-recent .portal-recent-note {
  margin: 1rem 0 0;
  font-size: 0.75rem;
}

.portal-target-menu {
  display: grid;
  gap: 0.4rem;
}

.portal-target-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 44px;
  padding: 0.75rem;
  border-radius: 10px;
  font-size: 0.85rem;
  text-decoration: none;
}

.portal-target-menu a:is(:hover, :focus-visible) {
  background: var(--mint);
}

.portal-target-menu a[aria-current="page"] {
  background: var(--charcoal);
  color: white;
}

/* Composer fields and local previews of selected attachments. */
.portal-editor-sections {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.portal-editor-sections a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 64px;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 0.9rem;
  text-decoration: none;
}

.portal-editor-sections a:is(:hover, :focus-visible) {
  background: var(--mint);
}

.portal-editor-sections a[aria-current="page"] {
  border-color: var(--charcoal);
  background: var(--charcoal);
  color: white;
}

.portal-section-hint {
  margin: 0;
}

.portal-document input {
  width: 100%;
  font-size: 0.85rem;
}

.portal-document p {
  margin: 0.75rem 0 0;
}

.portal-composer > h3 {
  margin: 0;
}

.portal-editor-content h2 {
  margin-bottom: 0;
  font-size: clamp(1.35rem, 2vw, 1.8rem);
}

.portal-editor-content .eyebrow {
  margin-bottom: 0.65rem;
}

.portal-editor-empty {
  padding-block: 2rem;
}

.portal-editor-empty p {
  max-width: 440px;
  margin: 1rem 0 0;
}

.portal-composer {
  display: grid;
  gap: 1.5rem;
}

.portal-composer label,
.portal-photos legend {
  display: block;
  margin-bottom: 0.65rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.portal-compose-field input[type="text"] {
  width: 100%;
  font-size: 1rem;
}

.portal-compose-field textarea {
  display: block;
  width: 100%;
  min-height: 200px;
  resize: vertical;
  font-size: 1rem;
  line-height: 1.6;
}

.portal-photos {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.portal-photos legend span {
  display: inline-block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 400;
}

.portal-photo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.portal-photo {
  min-width: 0;
  padding: 1rem;
  border: 1px dashed var(--input-border);
  border-radius: 16px;
  background: var(--paper);
}

.portal-photo input[type="file"] {
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 0.75rem;
}

.portal-photo input::file-selector-button {
  min-height: 44px;
  margin-right: 0.6rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.portal-photo-preview {
  width: 100%;
  height: 180px;
  margin-top: 1rem;
  border-radius: 10px;
  object-fit: contain;
}

.portal-photo-status {
  margin: 0.65rem 0 0;
  overflow-wrap: anywhere;
}

.portal-photo-status:empty {
  margin: 0;
}

.portal-photo-remove {
  min-height: 44px;
  margin-top: 0.25rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 0.8rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.portal-compose-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.portal-compose-footer p {
  max-width: 340px;
  margin: 0;
  font-size: 0.75rem;
}

.portal-compose-footer button:disabled {
  background: var(--surface);
  border-color: var(--line);
  color: var(--muted);
  box-shadow: none;
  cursor: not-allowed;
}

@media (max-width: 1000px) {
  .portal-columns,
  .portal-editor-layout {
    grid-template-columns: 1fr;
  }

  .portal-target-panel {
    position: static;
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 760px) {
  .portal-recent-item {
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.75rem;
  }

  .portal-item-actions {
    flex-direction: column;
  }

  .portal-identity {
    flex-direction: column;
    align-items: flex-start;
  }

  .portal-shortcuts,
  .portal-editor-sections,
  .portal-photo-grid {
    grid-template-columns: 1fr;
  }

  .portal-shortcut {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    column-gap: 1rem;
  }

  .portal-shortcut .portal-symbol {
    grid-row: span 3;
    margin: 0;
  }

  .portal-shortcut p {
    margin-bottom: 0.75rem;
  }

  .portal-shortcut-link {
    grid-column: 2;
  }
}

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

@media print {
  .portal-composer,
  .portal-target-panel,
  .portal-workspace .member-tabs {
    display: none;
  }

  .portal-columns,
  .portal-editor-layout {
    display: block;
  }
}

.portal-view-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.portal-view-button {
  min-height: 44px;
  padding: 0.6rem 1rem;
  border-color: var(--line);
  background: white;
  color: var(--ink);
  font-size: 0.8rem;
  box-shadow: none;
}

.portal-view-button[aria-current="page"] {
  background: var(--charcoal);
  border-color: var(--charcoal);
  color: white;
}

.portal-view-button:is(:hover, :focus-visible) {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

@media print {
  .portal-view-switch {
    display: none;
  }
}

/* Publishing, saved attachments and the authorized member feed. */
.portal-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--mint);
}

.portal-notice p {
  margin: 0;
}

.portal-notice-error {
  background: var(--peach);
}

.portal-saved-file {
  margin-top: 1rem;
}

.portal-saved-file img {
  display: block;
  width: 100%;
  max-height: 180px;
  margin-bottom: 0.75rem;
  object-fit: contain;
}

.portal-saved-file label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  font-size: 0.8rem;
}

.portal-feed {
  display: grid;
  gap: 2rem;
}

.portal-feed-item {
  min-width: 0;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}

.portal-feed-item h4 {
  margin: 0 0 1rem;
  font-size: 1.15rem;
  line-height: 1.4;
}

.portal-feed-item .portal-feed-meta {
  font-size: 0.75rem;
}

.portal-feed-body p {
  overflow-wrap: anywhere;
}

.portal-feed-files {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 1rem;
}

.portal-feed-files img {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  border-radius: 12px;
}

.portal-feed-pagination {
  display: flex;
  justify-content: space-between;
  margin-top: 1.5rem;
}

.portal-item-action:is(:hover, :focus-visible) {
  color: var(--accent);
  background: var(--mint);
}
