/* ==========================================================================
   1. BASE STYLES & LAYOUT WRAPPER
   ========================================================================== */
:root {
  --primary-color: #20a25f;
  --primary-hover: #1f9c5c;
  --bg-light: #f8f9fa;
  --text-dark: #212121;
  --border-color: #e0e0e0;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  line-height: 1.6;
}

.page-wrapper {
  max-width: 1140px;
  margin: 0 auto;
  padding: 16px;
}

.note-title {
  font-size: 1.6rem;
  margin-bottom: 16px;
}

/* ==========================================================================
   2. DISPLAY CONTROLS (MOBILE VS DESKTOP)
   ========================================================================== */
.mobile-only {
  display: block;
}

.desktop-only {
  display: none;
}

/* ==========================================================================
   3. MOBILE LAYOUT (DEFAULT SINGLE COLUMN)
   ========================================================================== */
.layout-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.preview-img {
  width: 80%;
  height: auto;
  display: block;        /* Enables block-level margin auto centering */
  margin: 0 auto 16px;   /* 0 top, AUTO left/right (centers it), 16px bottom spacing */
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
}

.action-buttons {
  display: flex;
  gap: 12px;
  margin: 12px 0;
}

.btn {
  flex: 1;
  text-align: center;
  padding: 14px;
  font-weight: 600;
  text-decoration: none;
}

.action-buttons {
    flex-direction: column; /* Stacks Preview and Download vertically */
  }

.action-buttons .btn {
    width: 100%; /* Stretches each button horizontally across the full card */
    padding: 16px 20px; /* Gives a taller, tap-friendly target for mobile thumbs */
  }

/* Container flex layout */
.action-buttons {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Common Button Base (Flex alignment) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
  user-select: none;
}

/* Button Icon Styling */
.btn .btn-icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  transform: translateY(-1.5px);
}

/* Primary Button */
.btn-primary { 
  background: rgb(75, 11, 11); 
  color: white; 
  border: 1px solid black; 
}
.btn-primary:hover { 
  background: rgb(62, 9, 9); 
  color: white; 
}

/* Secondary Button */
.btn-secondary { 
  background: var(--bg-light); 
  color: var(--text-dark); 
  border: 1px solid var(--border-color); 
}
.btn-secondary:hover { 
  background: #f6f6f6; 
}

.quick-details-box {
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  padding: 16px;
}

.quick-details-box ul {
  list-style: none;
  margin-top: 8px;
}

.quick-details-box li {
  padding: 4px 0;
  font-size: 0.9rem;
  border-bottom: 1px dashed #e0e0e0;
}

.description-section {
  margin-top: 30px;
}

.ad-slot {
  display: none; /* <--- REMOVE THIS TO ADD ADVERTISEMENTS */
  background: var(--bg-light);
  border: 1px dashed #ccc;
  text-align: center;
  padding: 12px;
  margin: 16px 0;
}

.ad-label {
  display: block;
  font-size: 0.7rem;
  color: #888;
  text-transform: uppercase;
  margin-bottom: 4px;
}

/* ==========================================================================
   SHARE BUTTONS SUITE
   ========================================================================== */

.share-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.5rem 0;
  flex-wrap: wrap;
}

.share-label {
  font-family: 'Josefin Sans SemiBold', Helvetica, Arial, sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: #475569;
}

.share-buttons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Base Button Style */
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
  background-color: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  user-select: none;
}

.share-btn .share-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* Hover States (Brand Tinting) */
.share-whatsapp:hover {
  background-color: #25d366;
  border-color: #25d366;
  color: #ffffff;
}

.share-telegram:hover {
  background-color: #229ed9;
  border-color: #229ed9;
  color: #ffffff;
}

.share-x:hover {
  background-color: #0f172a;
  border-color: #0f172a;
  color: #ffffff;
}

.share-copy:hover {
  background-color: #059669;
  border-color: #059669;
  color: #ffffff;
}

#copy-btn-text {
  font-family: 'Josefin Sans SemiBold', Helvetica, Arial, sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
}

/* ==========================================================================
   RELATED NOTES SECTION STYLES
   ========================================================================== */

.related-link h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dark, #0f172a);
  margin-bottom: 0.5rem;
}

/* Related Link Item */
.related-link { margin-bottom: 10%;}

.related-note-item {
  display: inline;
  color: #0284c7;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
}

.related-note-item:hover {
  color: #0369a1;
  text-decoration: underline;
}

/* Inline icon styling */
.related-note-item .external-arrow-icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.15em; /* Aligns smoothly with font baseline */
  margin-left: 0.2em;      /* Space between last word and arrow */
  transition: transform 0.2s ease;
}

/* Hover effect */
.related-note-item:hover .external-arrow-icon {
  transform: translate(2px, -2px);
}
/* ==========================================================================
   4. DESKTOP MEDIA QUERY (Screen Width >= 992px)
   ========================================================================== */
@media (min-width: 992px) {
  
  /* Toggle Visibility */
  .mobile-only {
    display: none;
  }
  
  .desktop-only {
    display: block;
  }

  .note-title {
    font-size: 2.2rem;
  }

  /* Two-column flexbox layout */
  .layout-container {
    flex-direction: row;
    align-items: flex-start;
    gap: 32px;
  }

  .main-content {
    flex: 1; /* Takes remaining width (~70%) */
    min-width: 0; /* Prevents overflow issues */
  }

  .preview-img {
    width: 50%;
}

  .sidebar {
    width: 320px; /* Fixed sidebar width */
    position: sticky;
    top: 20px;
  }

  .related-link { margin-bottom: 5%;}
}