/* =====================================================
   ANNONS DETAIL PAGE
   assets/css/annons-detail.css
   Version: v1.1 (stabil, utökad)
===================================================== */

/* =====================================================
   ROOT SCOPE SAFETY
   (förhindrar stil-läckage)
===================================================== */

.annons-detail-layout {
  --detail-gap-xl: 48px;
  --detail-gap-lg: 32px;
  --detail-gap-md: 24px;
  --detail-gap-sm: 14px;
}

/* =====================================================
   LAYOUT ROOT
===================================================== */

.annons-detail-layout {
  max-width: 1240px;
  margin: 0 auto;
  padding: 32px 24px 80px;

  display: flex;
  flex-direction: column;
  gap: var(--detail-gap-xl);
}

/* =====================================================
   HERO CONTAINER
===================================================== */

.annons-hero {
  background: var(--bg-panel);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

/* =====================================================
   HERO GRID
===================================================== */

.annons-hero-inner {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: var(--detail-gap-lg);
  padding: 32px;
  align-items: center;
}

/* =====================================================
   IMAGE
===================================================== */

.annons-image {
  height: 320px;
  border-radius: var(--radius-md);
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
  background-color: var(--bg-muted);
}

.annons-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.05) 60%,
    rgba(0,0,0,0.18)
  );
}

/* Badge (återanvänder cards.css) */
.annons-image .ad-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
}

/* =====================================================
   SUMMARY
===================================================== */

.annons-summary {
  display: flex;
  flex-direction: column;
  gap: var(--detail-gap-sm);
  min-width: 0;
}

.annons-title {
  font-size: 26px;
  line-height: 1.25;
  font-weight: 700;
  color: var(--text-main);
  word-break: break-word;
}

.annons-meta {
  font-size: 14.5px;
  color: var(--text-muted);
}

.annons-meta .verified,
.annons-meta .verified-badge {
  color: #059669;
  font-weight: 600;
}

.annons-meta .annons-tag {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(255, 143, 143, 0.15);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
}


.annons-actions-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
}

/* Favorite button */
.btn-favorite {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid #e5e7eb;
  background: var(--bg-muted);
  color: var(--text-main);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn-favorite:hover {
  background: #e9ecf1;
  border-color: #d1d5db;
}

.btn-favorite.is-saved {
  background: rgba(255, 143, 143, 0.15);
  border-color: var(--accent);
  color: var(--accent);
}

.btn-favorite.is-saved:hover {
  background: rgba(255, 143, 143, 0.25);
}

.btn-favorite-icon {
  font-size: 18px;
  line-height: 1;
}

.btn-favorite--guest {
  cursor: pointer;
}

.btn-favorite:disabled {
  opacity: 0.7;
  cursor: wait;
}

.annons-share {
  display: flex;
  align-items: center;
  gap: 8px;
}

.annons-share-label {
  font-size: 13px;
  color: var(--text-muted);
}

.annons-share-btn {
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(255, 143, 143, 0.1);
  transition: background 0.15s;
}

.annons-share-btn:hover {
  background: rgba(255, 143, 143, 0.2);
}

/* Relaterade annonser – förstärkt sektion */
.annons-related {
  margin-top: 48px;
  padding-top: 40px;
  border-top: 1px solid #e5e7eb;
}

.annons-related-header {
  margin-bottom: 24px;
}

.annons-related-header h2 {
  margin: 0 0 8px 0;
}

.annons-related-lead {
  font-size: 15px;
  color: var(--text-muted);
  margin: 0;
}

.annons-related-footer {
  margin-top: 28px;
  text-align: center;
}

.annons-related h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-main);
}

.annons-related-all {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.annons-related-all:hover {
  text-decoration: underline;
}

.annons-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

.annons-related-card {
  background: var(--bg-panel);
  border-radius: var(--radius-md);
  padding: 24px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.annons-related-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

.annons-related-card:hover .annons-related-cta {
  color: var(--accent);
}

.annons-related-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  color: var(--text-main);
  line-height: 1.35;
  flex-grow: 1;
}

.annons-related-tag {
  display: inline-block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  font-weight: 600;
}

.annons-related-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

.annons-related-price {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
  margin-top: 4px;
}

.annons-related-cta {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  transition: color 0.15s;
  margin-top: 4px;
}

/* Locked content CTA */
.annons-locked {
  margin-top: 20px;
  padding: 24px;
  background: var(--bg-muted);
  border-radius: var(--radius-md);
  border: 1px dashed #d1d5db;
}

.annons-locked-text {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.5;
}

.annons-locked-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.annons-locked-actions .btn-cta {
  font-size: 15px;
  padding: 14px 24px;
  font-weight: 600;
}

.annons-price {
  margin-top: 10px;
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
}

/* =====================================================
   ACTIONS
===================================================== */

.annons-actions {
  margin-top: 20px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
}

.annons-actions .btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 28px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  transition:
    background .15s ease,
    box-shadow .15s ease,
    transform .12s ease;
  box-shadow: 0 8px 20px rgba(47, 128, 237, 0.4);
}

.annons-actions .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(47, 128, 237, 0.45);
}

.annons-actions .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 22px;
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  transition:
    background .15s ease,
    box-shadow .15s ease,
    transform .12s ease;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 18px rgba(47,128,237,0.35);
}

.btn-primary:hover {
  background: #256bd8;
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-muted);
  color: var(--text-main);
  border: 1px solid #e5e7eb;
}

.btn-secondary:hover {
  background: #e9ecf1;
}

.btn-small {
  min-height: 40px;
  padding: 0 16px;
  font-size: 13px;
}

/* =====================================================
   CONTENT GRID
===================================================== */

.annons-content {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: var(--detail-gap-lg);
}

/* =====================================================
   DESCRIPTION
===================================================== */

.annons-description {
  background: var(--bg-panel);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  box-shadow: var(--shadow-soft);
}

.annons-description h2 {
  font-size: 18px;
  margin-bottom: 14px;
}

.annons-description p {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-main);
  white-space: pre-line;
}

.annons-section-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}

.annons-section-header p {
  font-size: 13px;
  color: var(--text-muted);
}

.annons-project-info {
  margin-top: 24px;
  background: var(--bg-panel);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  box-shadow: var(--shadow-soft);
}

.annons-project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.annons-project-card {
  background: var(--bg-muted);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.annons-project-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.annons-project-value {
  font-size: 15px;
  color: var(--text-main);
}

.annons-offer-box {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid #e5e7eb;
}

.annons-offer-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.annons-offer-form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.annons-offer-form input,
.annons-offer-form textarea {
  width: 100%;
  border: 1px solid #dbe3ef;
  border-radius: 10px;
  padding: 12px 14px;
  font: inherit;
  color: var(--text-main);
  background: #fff;
}

.annons-offer-form textarea {
  resize: vertical;
  min-height: 120px;
}

.annons-offer-form__row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.annons-offer-form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.annons-inline-message {
  margin-bottom: 16px;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
}

.annons-inline-message--success {
  background: rgba(22, 163, 74, 0.12);
  color: #166534;
}

.annons-inline-message--error {
  background: rgba(220, 38, 38, 0.12);
  color: #991b1b;
}

/* =====================================================
   SIDEBAR WIDGETS (Snabbfakta + Annonsör)
===================================================== */

.annons-profile {
  position: sticky;
  top: 24px;
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  gap: var(--detail-gap-md);
}

.annons-sidebar-widget.annons-snabbfakta {
  background: var(--bg-panel);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-soft);
}

.annons-snabbfakta h3 {
  font-size: 15px;
  margin-bottom: 12px;
}

.annons-snabbfakta-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.annons-snabbfakta-label {
  font-size: 12px;
  color: var(--text-muted);
  display: inline-block;
  min-width: 80px;
}

.annons-snabbfakta-value {
  font-size: 14px;
  color: var(--text-main);
}

.profile-stats {
  font-size: 13px;
  color: var(--text-muted);
}

.annons-report-btn {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  margin-left: auto;
}

.annons-report-btn:hover {
  color: #b91c1c;
  text-decoration: underline;
}

/* =====================================================
   PROFILE SIDEBAR
===================================================== */

.profile-card {
  background: var(--bg-panel);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-soft);

  display: flex;
  flex-direction: column;
  gap: 10px;
}

.profile-card h3 {
  font-size: 15px;
  margin-bottom: 6px;
}

.profile-name {
  font-size: 16px;
  font-weight: 600;
}

.profile-type {
  font-size: 14px;
  color: var(--text-muted);
}

.profile-verified {
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
}

.profile-contact {
  font-size: 14px;
  color: var(--text-main);
  margin-top: 6px;
  word-break: break-word;
}

/* =====================================================
   RESPONSIVE – TABLET
===================================================== */

@media (max-width: 1024px) {
  .annons-hero-inner {
    grid-template-columns: 1fr;
    gap: var(--detail-gap-md);
  }

  .annons-image {
    height: 260px;
  }

  .annons-content {
    grid-template-columns: 1fr;
  }

  .annons-profile {
    position: static;
  }

  .annons-offer-form__row {
    grid-template-columns: 1fr;
  }
}

/* =====================================================
   RESPONSIVE – MOBILE
===================================================== */

@media (max-width: 600px) {
  .annons-detail-layout {
    padding: 20px 16px 64px;
    gap: 36px;
  }

  .annons-title {
    font-size: 22px;
  }

  .annons-price {
    font-size: 20px;
  }

  .annons-description {
    padding: 22px;
  }

  .annons-actions {
    gap: 10px;
  }
}
