/* ============================================================
   Post Detail Styles (Phase 6)
   Follows atomic design naming: m- molecules, o- organisms
   ============================================================ */

/* === MOLECULES === */

/* Hero image */
.m-post-hero {
  position: relative;
}

.m-post-hero-img {
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
}

/* Icon grid on cover image (gallery, video, audio, spokes) — wraps at 3 per row */
.m-post-hero-icons {
  position: absolute;
  bottom: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  column-gap: 1rem;
  row-gap: 0.5rem;
  max-width: calc(3 * 2.25rem + 2 * 1rem); /* 8.75rem — exactly 3 icons + 2 gaps */
}

/* Gallery icon — <a> element */
.m-post-hero-gallery-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background-color: var(--kon-brand-color, #cf0015);
  color: #fff;
  text-decoration: none;
  font-size: 0.875rem;
  line-height: 1;
  transition: opacity 0.2s ease;
}

.m-post-hero-gallery-link:hover {
  color: #fff;
  text-decoration: none;
  opacity: 0.85;
}

/* Video/Audio icons — <button> elements, same style as gallery */
.m-post-hero-media-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  border: none;
  background-color: var(--kon-brand-color, #cf0015);
  color: #fff;
  font-size: 0.875rem;
  line-height: 1;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.m-post-hero-media-link:hover {
  opacity: 0.85;
}

/* CEWL icon — top-right, smaller than media buttons */
.m-post-hero-cewl-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: none;
  background-color: var(--kon-brand-color, #cf0015);
  color: #fff;
  font-size: 0.75rem;
  line-height: 1;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

/* CEWL icon: top-right in both cover and placeholder */
.m-post-hero .m-post-hero-cewl-link {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
}

.m-post-hero-cewl-link:hover {
  opacity: 0.85;
}

/* Placeholder when no cover image but post has media (Flutter: 256px empty area) */
.m-post-hero--placeholder {
  background: inherit;
  min-height: 164px;
}

.m-post-hero-placeholder-icons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1.25rem;
}

.m-post-hero-gallery-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: #6c757d;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.m-post-hero-gallery-placeholder .bi-images {
  font-size: 2rem;
}

.m-post-hero-gallery-placeholder:hover {
  color: #495057;
  text-decoration: none;
}

/* Video/Audio placeholder buttons */
.m-post-hero-media-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: none;
  border: none;
  color: #6c757d;
  font-size: 0.9rem;
  cursor: pointer;
  transition: color 0.2s ease;
}

.m-post-hero-media-placeholder i {
  font-size: 2rem;
}

.m-post-hero-media-placeholder:hover {
  color: #495057;
}

/* Meta detail row */
.m-post-meta-detail {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  font-size: 0.85rem;
}

.m-post-meta-date {
  color: #888;
}

.m-post-meta-category a {
  color: #888;
  text-decoration: none;
}

.m-post-meta-category a:hover {
  color: var(--bs-primary, #0d6efd);
}

/* Author */
.m-post-author-avatar {
  object-fit: cover;
}

.m-post-author-avatar-placeholder {
  width: 32px;
  height: 32px;
  background: var(--bs-secondary-bg, #e9ecef);
  color: var(--bs-secondary, #6c757d);
  font-size: 0.75rem;
  font-weight: 600;
}

.m-post-author-name {
  font-size: 0.9rem;
  color: #555;
}

/* === ORGANISMS === */

/* Branded header zone (Flutter alignment) */
.o-post-header-zone {
  background-color: var(--kon-brand-color, #cf0015);
  color: #fff;
  margin-bottom: 1.5rem;
  overflow: visible;
  position: relative;
}


/* Inside header zone: move media buttons above the author overlap area */
.o-post-header-zone .m-post-hero-icons {
  bottom: 4rem;
}

/* Author circle overlapping cover image bottom */
.o-post-header-author-wrap {
  display: flex;
  justify-content: center;
  margin-top: -48px;
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 3;
}

.o-post-header-author-img {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255,255,255,0.3);
}

.o-post-header-author-placeholder {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 600;
  background: rgba(255,255,255,0.2);
  color: inherit;
  border: 3px solid rgba(255,255,255,0.3);
}


/* Top buffer when no hero renders at all */
.o-post-header-zone > .o-post-header-author-wrap:first-child {
  margin-top: 0;
  padding-top: 1.5rem;
}

.o-post-header-zone > .o-post-header-meta:first-child {
  padding-top: 1.5rem;
}

/* Header metadata (byline, location, date) */
.o-post-header-meta {
  text-align: center;
  padding: 0 1rem;
}

.o-post-header-byline {
  font-family: 'BasicGothicWebPro', sans-serif;
  font-size: 11px;
  font-weight: 500;
  padding: 0.5rem 0;
  color: inherit;
}

.o-post-header-location {
  font-family: 'BasicGothicWebPro', sans-serif;
  font-size: 11px;
  font-weight: 500;
  padding: 0.0625rem 0;
  color: inherit;
}

.o-post-header-date {
  font-family: 'BasicGothicWebPro', sans-serif;
  font-size: 11px;
  font-weight: 500;
  padding: 0.5rem 0;
  color: inherit;
}

/* Likes/views stats line (Flutter: ArticleLikesViewsArea — 12px w200) */
.o-post-header-stats {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 48px;
  gap: 1rem;
  padding: 0 1rem;
}

.o-post-header-stat {
  font-family: 'BasicGothicWebPro', sans-serif;
  font-size: 12px;
  font-weight: 200;
  color: inherit;
}

/* Like button (Flutter: ArticleLikeIconBloc — 48x48 centered) */
.o-post-header-like {
  display: flex;
  justify-content: center;
  padding-bottom: 0.75rem;
}

.o-post-header-like-btn {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: inherit;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  transition: opacity 0.2s ease;
}

.o-post-header-like-btn:hover {
  opacity: 0.7;
}

/* Header title — 35px w200 centered */
.o-post-header-title {
  font-family: 'BasicGothicWebPro', sans-serif;
  font-size: 35px;
  font-weight: 200;
  line-height: 1.3;
  text-align: center;
  padding: 0.5rem 1rem 1.5rem;
  margin: 0;
  color: inherit;
}

/* Title (legacy, kept for other views) */
.o-post-detail-title {
  font-family: 'BasicGothicWebPro', sans-serif;
  font-size: 2rem;
  font-weight: 200;
  line-height: 1.3;
  margin-bottom: 0.75rem;
}

/* Excerpt */
.o-post-detail-excerpt {
  font-size: 1.05rem;
  color: #555;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--bs-border-color, #dee2e6);
}

/* Content blocks container */
.o-post-detail-blocks {
  margin-top: 1rem;
}

/* Block divider */
.o-block-divider {
  margin: 2rem 0;
  border-color: var(--bs-border-color, #dee2e6);
  opacity: 0.5;
}

/* Block heading */
.o-block-heading {
  font-size: 1.35rem;
  font-weight: 400;
  margin-bottom: 1rem;
  color: #333;
}

/* --- Text block --- */
.o-block-text-content {
  font-size: 1rem;
  line-height: 1.8;
  color: #333;
}

.o-block-text-content h1 {
  font-size: 1.75rem;
  font-weight: 300;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.o-block-text-content h2 {
  font-size: 1.4rem;
  font-weight: 400;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

.o-block-text-content h3 {
  font-size: 1.2rem;
  font-weight: 500;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.o-block-text-content h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.o-block-text-content p {
  margin-bottom: 1rem;
}

.o-block-text-content blockquote {
  border-left: 3px solid var(--bs-border-color, #dee2e6);
  padding-left: 1rem;
  margin: 1rem 0;
  color: #555;
  font-style: italic;
}

.o-block-text-content img {
  max-width: 100%;
  height: auto;
  border-radius: 0.375rem;
  margin: 0.5rem 0;
}

.o-block-text-content a {
  color: var(--bs-primary, #0d6efd);
}

.o-block-text-content a:hover {
  color: var(--bs-primary, #0d6efd);
  text-decoration: underline;
}

.o-block-text-content ul,
.o-block-text-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.o-block-text-content li {
  margin-bottom: 0.25rem;
}

/* --- Media block --- */
.o-block-media-img {
  display: block;
}

.o-block-media-video {
  background: #000;
}

.o-block-media-audio-thumb {
  max-height: 200px;
  object-fit: cover;
}

.o-block-media-doc {
  background: var(--bs-light, #f8f9fa);
}

.o-block-media-doc a {
  color: var(--bs-body-color, #212529);
  text-decoration: none;
}

.o-block-media-doc a:hover {
  color: var(--bs-primary, #0d6efd);
}

/* --- Media collection --- */
.o-block-mc-thumb {
  aspect-ratio: 1;
  object-fit: cover;
  width: 100%;
  display: block;
}

/* Placeholder styles now in kon_media.css */

/* --- Accordion block --- */
.o-block-accordion .accordion-item {
  border: none;
  border-bottom: 1px solid var(--bs-border-color, #dee2e6);
}

.o-block-accordion .accordion-item:last-child {
  border-bottom: none;
}

.o-block-accordion .accordion-button {
  background: transparent;
  padding: 0.75rem 0;
  font-size: 0.9rem;
  color: #333;
  box-shadow: none;
}

.o-block-accordion .accordion-button:not(.collapsed) {
  background: transparent;
  color: #333;
  box-shadow: none;
}

.o-block-accordion .accordion-button:focus {
  box-shadow: none;
  border-color: transparent;
}

/* Plus/minus icons (konversed red #cf0015) — same pattern as Studio */
.o-block-accordion .accordion-button::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23cf0015' viewBox='0 0 16 16'%3E%3Cpath d='M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4z'/%3E%3C/svg%3E");
  transition: all 0.3s ease;
}

.o-block-accordion .accordion-button:not(.collapsed)::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23cf0015' viewBox='0 0 16 16'%3E%3Cpath d='M4 8a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7A.5.5 0 0 1 4 8z'/%3E%3C/svg%3E");
  transform: rotate(0deg);
}

.o-block-accordion .accordion-body {
  padding: 0 0 0.75rem 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #555;
}

/* --- Contact block --- */
.o-block-contact-photo {
  object-fit: cover;
}

.o-block-contact-photo-placeholder {
  width: 50px;
  height: 50px;
  background: var(--bs-secondary-bg, #e9ecef);
  color: var(--bs-secondary, #6c757d);
  font-size: 0.85rem;
  font-weight: 600;
}

.o-block-contact-card {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--bs-border-color-translucent, rgba(0,0,0,0.05));
}

.o-block-contact-card:last-child {
  border-bottom: none;
}

.o-block-contact-email a {
  color: var(--bs-primary, #0d6efd);
  text-decoration: none;
}

.o-block-contact-email a:hover {
  text-decoration: underline;
}

/* --- Weblink block --- */
.o-block-weblink-thumb {
  object-fit: cover;
}

.o-block-weblink-card {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--bs-border-color-translucent, rgba(0,0,0,0.05));
}

.o-block-weblink-card:last-child {
  border-bottom: none;
}

.o-block-weblink-title {
  text-decoration: none;
  color: var(--bs-body-color, #212529);
}

.o-block-weblink-title:hover {
  color: var(--bs-primary, #0d6efd);
}

/* --- Event block --- */
.o-block-event-cover {
  object-fit: cover;
}

.o-block-event-card {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--bs-border-color-translucent, rgba(0,0,0,0.05));
}

.o-block-event-card:last-child {
  border-bottom: none;
}

/* --- Location block --- */
.o-block-location-img {
  object-fit: cover;
}

.o-block-location-card {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--bs-border-color-translucent, rgba(0,0,0,0.05));
}

.o-block-location-card:last-child {
  border-bottom: none;
}

/* === FOOTER === */
.o-post-detail-footer {
  padding-top: 1.5rem;
  margin-top: 1rem;
  border-top: 1px solid var(--bs-border-color, #dee2e6);
}

.o-post-detail-back {
  color: var(--bs-secondary, #6c757d);
  text-decoration: none;
  font-size: 0.9rem;
}

.o-post-detail-back:hover {
  color: var(--bs-primary, #0d6efd);
}

/* === RESPONSIVE === */

/* Mobile: < 768px */
@media (max-width: 767.98px) {
  .o-post-header-zone {
    margin-left: -0.75rem;
    margin-right: -0.75rem;
  }

  .o-post-header-title {
    font-size: 1.5rem;
  }

  .o-post-detail-excerpt {
    font-size: 0.95rem;
  }
}

/* Tablet: 768px – 1199px */
@media (min-width: 768px) and (max-width: 1199.98px) {
  .o-post-header-title {
    font-size: 28px;
  }
}
