/* Sjednocená vizitka — firma, spolek, zastupitel, uživatel */

.entity-profile {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  width: 100%;
  min-width: 0;
}

.entity-profile-main {
  width: 100%;
  min-width: 0;
}

/* Hero */
.entity-hero {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-3);
  overflow: hidden;
}

.entity-hero-has-nav .entity-hero-nav,
.entity-hero-nav {
  display: none;
}

.entity-hero-kicker-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2) var(--space-3);
  margin: 0 0 var(--space-1);
}

.entity-hero-kicker-row .entity-hero-kicker {
  flex: 1 1 12rem;
  margin: 0;
}

.entity-hero-kicker-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: flex-end;
  flex-shrink: 0;
}

.entity-hero-back-link {
  flex-shrink: 0;
  white-space: nowrap;
}

@media (min-width: 880px) {
  .entity-hero {
    grid-template-columns: minmax(280px, 42%) minmax(0, 1fr);
    align-items: stretch;
    gap: var(--space-4);
    padding: var(--space-4);
  }
}

.entity-hero-media {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}

.entity-hero-photo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  max-height: min(46vh, 440px);
  border-radius: var(--radius-md, 12px);
  background: linear-gradient(145deg, #f8fafc 0%, #eef2f7 100%);
  border: 1px solid var(--color-border, #e5e7eb);
  overflow: hidden;
}

.entity-hero-photo-btn.cover-lightbox-btn {
  width: 100%;
  padding: 0;
  margin: 0;
  cursor: zoom-in;
}

.entity-hero-photo-btn.cover-lightbox-btn:focus-visible {
  outline: 2px solid var(--color-primary, #9f1239);
  outline-offset: 2px;
}

.entity-hero-photo {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(46vh, 440px);
  object-fit: contain;
  object-position: center;
}

.entity-hero-photo-placeholder {
  min-height: 220px;
}

.entity-hero-photo-fallback {
  font-size: 4rem;
  opacity: 0.35;
}

.entity-hero-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.entity-hero-thumb-wrap {
  display: block;
  width: 72px;
  height: 54px;
  border-radius: var(--radius-sm, 8px);
  overflow: hidden;
  border: 1px solid var(--color-border, #e5e7eb);
  background: #f8fafc;
}

.entity-hero-thumb-btn.cover-lightbox-btn {
  padding: 0;
  margin: 0;
  cursor: zoom-in;
}

.entity-hero-thumb-btn.cover-lightbox-btn:hover,
.entity-hero-thumb-btn.cover-lightbox-btn:focus-visible {
  border-color: var(--color-primary, #9f1239);
  box-shadow: 0 0 0 2px rgba(159, 18, 57, 0.15);
}

.entity-hero-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.entity-hero-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}

.entity-hero-kicker {
  margin: 0;
  font-size: 0.88rem;
  color: var(--color-muted, #64748b);
  line-height: 1.4;
}

.entity-hero-badge {
  font-weight: 600;
  color: var(--color-text, #1e293b);
}

.entity-hero-title {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2.1rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.entity-hero-title-with-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.entity-hero-meta-line {
  margin: 0;
  font-size: 0.9rem;
  color: var(--color-muted, #64748b);
}

.entity-hero-meta-label {
  font-weight: 600;
  color: var(--color-text, #334155);
}

.entity-hero-description {
  margin: var(--space-1) 0 0;
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--color-text, #334155);
  max-width: 52ch;
}

.entity-hero-manage {
  margin: var(--space-2) 0 0;
}

.entity-hero-contact {
  margin: var(--space-2) 0 0;
}

.entity-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  margin: var(--space-2) 0 0;
}

.entity-feed-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.entity-feed-head .entity-feed-title {
  margin: 0;
}

.entity-feed-contact {
  margin: 0;
  flex-shrink: 0;
}

.entity-hero-actions > p {
  margin: 0;
}

.entity-hero .business-open-badge {
  margin: 0;
  align-self: flex-start;
}

/* Role, motto, bio — zastupitel / uživatel */
.entity-hero-role {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-primary, #7f1d1d);
}

.entity-hero-affiliation {
  margin: 0;
  font-size: 1rem;
  color: var(--color-text-muted, #64748b);
  font-weight: 500;
}

.entity-hero-mandate {
  margin: 0;
  font-size: 0.95rem;
  color: var(--color-text-muted, #64748b);
}

.entity-hero-motto {
  margin: var(--space-1) 0 0;
  padding: var(--space-3) var(--space-4);
  border-left: 3px solid var(--color-accent, #2d6a4f);
  background: var(--color-surface-muted, rgba(0, 0, 0, 0.03));
  border-radius: 0 var(--radius-md, 8px) var(--radius-md, 8px) 0;
  font-style: italic;
  font-size: 1.02rem;
  color: var(--color-text, #334155);
}

.entity-hero-bio {
  margin: var(--space-1) 0 0;
  line-height: 1.6;
  color: var(--color-text, #334155);
  max-width: 52ch;
}

.entity-hero-deleted .entity-hero-title {
  color: var(--color-text-muted, #64748b);
}

.entity-deleted-notice {
  margin: var(--space-2) 0 0;
  padding: var(--space-3);
  border-radius: var(--radius-md, 8px);
  background: var(--color-surface-muted, #f1f5f9);
  border: 1px solid var(--color-border, #e2e8f0);
}

.entity-deleted-notice-title {
  margin: 0 0 var(--space-2);
  font-weight: 600;
  color: var(--color-text-muted, #64748b);
}

/* Main grid */
.entity-profile-grid {
  display: grid;
  gap: var(--space-3);
  align-items: start;
}

@media (min-width: 880px) {
  .entity-profile-grid {
    grid-template-columns: minmax(0, 1fr) min(340px, 32%);
    gap: var(--space-4);
  }
}

.entity-feed-section {
  padding: var(--space-3);
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

@media (min-width: 880px) {
  .entity-feed-section {
    padding: var(--space-4);
  }
}

.entity-feed-title {
  margin: 0 0 var(--space-3);
  font-size: 1.15rem;
}

.entity-feed-hint {
  margin: -0.5rem 0 var(--space-3);
}

.entity-feed-count {
  font-weight: 500;
  color: var(--color-muted, #64748b);
  font-size: 0.95em;
}

.entity-profile-feed .post-card,
.entity-profile-feed .poll-card,
.entity-profile-feed .vzkaz-card {
  height: 100%;
}

.entity-profile-footer {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* Sidebar cards */
.entity-profile-aside {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  width: 100%;
  min-width: 0;
  align-self: stretch;
}

.entity-aside-card {
  padding: var(--space-3);
  border-radius: var(--radius-md, 12px);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--color-border, #e5e7eb);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.entity-aside-title {
  margin: 0 0 var(--space-2);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--color-primary, #7f1d1d);
}

.entity-aside-achievements {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.entity-aside-achievement {
  margin: 0;
  padding: 0;
}

.entity-aside-achievement-title {
  margin: 0 0 0.15rem;
  font-size: 0.95rem;
  line-height: 1.35;
  color: var(--color-text, #0f172a);
}

.entity-aside-achievement-source {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-muted, #64748b);
}

.entity-aside-achievement-blurb {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--color-muted, #475569);
}

.entity-aside-empty {
  margin: 0;
  font-size: 0.88rem;
}

.entity-aside-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.entity-aside-list li {
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(229, 231, 235, 0.85);
  font-size: 0.88rem;
  line-height: 1.45;
}

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

.entity-aside-meta-list {
  margin: 0;
  padding: 0;
}

.entity-aside-meta-row {
  display: grid;
  grid-template-columns: 4.2rem minmax(0, 1fr);
  gap: 0.35rem 0.75rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(229, 231, 235, 0.85);
  font-size: 0.88rem;
  line-height: 1.45;
}

.entity-aside-meta-row:last-child {
  border-bottom: none;
}

.entity-aside-meta-row dt {
  margin: 0;
  font-weight: 600;
  color: var(--color-muted, #64748b);
}

.entity-aside-meta-row dd {
  margin: 0;
  word-break: break-word;
}

.entity-aside-program {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

/* Firma — hodiny a kontakt (obsah sidebaru) */
.business-hours-aside .business-hours-table {
  width: 100%;
  font-size: 0.84rem;
}

.business-hours-aside .business-hours-table th,
.business-hours-aside .business-hours-table td {
  padding: 0.28rem 0;
  border-bottom: 1px solid rgba(229, 231, 235, 0.8);
  vertical-align: top;
}

.business-hours-aside .business-hours-table th {
  width: 1%;
  white-space: nowrap;
  font-weight: 600;
  color: var(--color-muted, #64748b);
  padding-right: 0.35rem;
}

.business-hours-aside .business-hours-table td {
  white-space: nowrap;
}

.business-hours-aside .business-hours-table tr:last-child th,
.business-hours-aside .business-hours-table tr:last-child td {
  border-bottom: none;
}

.business-hours-notice-compact {
  margin: 0 0 var(--space-2);
  padding: var(--space-2);
  font-size: 0.84rem;
  line-height: 1.45;
}

.business-hours-aside .business-hours-schedule-label {
  margin: 0 0 var(--space-1);
  font-size: 0.8rem;
}

/* Kontakt — ikonky + plná šířka */
.contact-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0 0 var(--space-2);
}

.contact-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(229, 231, 235, 0.85);
}

.contact-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.contact-row-icon-wrap {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: var(--radius-sm, 8px);
  background: color-mix(in srgb, var(--color-primary, #7f1d1d) 10%, #fff);
  color: var(--color-primary, #7f1d1d);
}

.contact-icon-svg {
  display: block;
  width: 1.15rem;
  height: 1.15rem;
}

.contact-row-body {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.contact-row-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--color-muted, #64748b);
}

.contact-row-value {
  font-size: 0.92rem;
  line-height: 1.45;
  word-break: break-word;
}

.contact-row-value a {
  font-weight: 600;
}

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

.business-contact-row {
  display: grid;
  grid-template-columns: 4.2rem minmax(0, 1fr);
  gap: 0.35rem 0.75rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(229, 231, 235, 0.85);
  font-size: 0.88rem;
  line-height: 1.45;
}

.business-contact-row:last-child {
  border-bottom: none;
}

.business-contact-row dt {
  margin: 0;
  font-weight: 600;
  color: var(--color-muted, #64748b);
}

.business-contact-row dd {
  margin: 0;
  word-break: break-word;
}

.business-contact-row a {
  font-weight: 500;
}

.business-contact-map-block {
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--color-border, #e5e7eb);
}

.business-contact-map-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 180px;
  object-fit: cover;
  border-radius: var(--radius-sm, 8px);
  border: 1px solid var(--color-border, #e5e7eb);
}

.business-contact-map-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.business-contact-map-links .btn {
  flex: 1 1 auto;
  justify-content: center;
  min-width: 0;
}

.council-profile-comment-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.council-profile-comment-item {
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(229, 231, 235, 0.85);
  font-size: 0.86rem;
  line-height: 1.45;
}

.council-profile-comment-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.council-profile-comment-target {
  display: block;
  font-weight: 600;
  margin-bottom: 0.2rem;
  text-decoration: none;
}

.council-profile-comment-target:hover {
  text-decoration: underline;
}

.council-profile-comment-excerpt {
  margin: 0 0 0.25rem;
  color: var(--color-text, #334155);
}

.council-profile-comment-time {
  display: block;
  font-size: 0.78rem;
  color: var(--color-muted, #64748b);
}

.council-manage-subheading {
  margin: var(--space-3) 0 var(--space-1);
  font-size: 1rem;
}

@media (max-width: 879px) {
  .entity-profile-grid {
    display: flex;
    flex-direction: column;
    width: 100%;
  }

  .entity-profile-aside {
    order: -1;
  }

  .entity-hero.panel,
  .entity-feed-section.panel,
  .entity-aside-card {
    width: 100%;
    max-width: 100%;
  }
}

@media (max-width: 640px) {
  .entity-hero-photo-wrap {
    max-height: 55vw;
  }

  .entity-hero-photo {
    max-height: 55vw;
  }
}
