/* 
  Times of Nursing - Modern SPA Stylesheet 
  Visual Aesthetic: Vibrant, Modern E-Magazine 
*/

:root {
  --newsprint-bg: #F9F6EE;       /* Classic Newspaper Background */
  --paper-color: #FFFFFF;
  --ink-color: #1F2937;
  --border-color: #E5E7EB;
  --divider-color: #E5E7EB;
  --caption-color: #6B7280;
  --primary-color: #1D4ED8;      /* Calm Navy Blue */
  --primary-light: #EFF6FF;
  --accent-color: #22D3EE;       /* Soft Cyan */
  --teal-color: #15803D;         /* Deep Teal */
  --utility-bg: #111827;
  --utility-text: #F3F4F6;
  --shadow-color: rgba(0, 0, 0, 0.08);
  --shadow-hover: rgba(0, 0, 0, 0.15);
  --font-scale: 1;
}

body.night-mode {
  --newsprint-bg: #111827;
  --paper-color: #1F2937;
  --ink-color: #F9FAFB;
  --border-color: #374151;
  --divider-color: #374151;
  --caption-color: #9CA3AF;
  --primary-color: #3B82F6;
  --primary-light: #1E3A8A;
  --accent-color: #06B6D4;
  --teal-color: #22C55E;
  --utility-bg: #030712;
  --utility-text: #F9FAFB;
  --shadow-color: rgba(0, 0, 0, 0.4);
  --shadow-hover: rgba(0, 0, 0, 0.6);
}

/* Global Settings */
* { box-sizing: border-box; }

body {
  background-color: var(--newsprint-bg);
  color: var(--ink-color);
  font-family: 'Mukta', 'Noto Sans Devanagari', -apple-system, sans-serif;
  margin: 0;
  padding: 0;
  transition: all 0.3s ease;
  line-height: 1.65;
  font-size: calc(1rem * var(--font-scale));
  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Allow text selection inside input fields and textareas so admin can type/copy/paste */
input, textarea, select {
  -webkit-user-select: auto;
  -ms-user-select: auto;
  user-select: auto;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--accent-color);
}

/* Utilities Bar */
.top-utility-bar {
  background-color: var(--utility-bg);
  color: var(--utility-text);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 10px 20px;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.utility-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

.utility-right {
  display: flex;
  gap: 15px;
  align-items: center;
}

.font-controls button, .night-toggle-btn {
  background: transparent;
  color: var(--utility-text);
  border: 1px solid rgba(255,255,255,0.2);
  padding: 4px 8px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
}

.font-controls button:hover, .night-toggle-btn:hover {
  background: rgba(255,255,255,0.1);
}

.admin-portal-link {
  color: var(--accent-color);
  font-weight: bold;
  padding: 4px 10px;
  border-radius: 4px;
  background: rgba(34, 211, 238, 0.1);
}

.admin-portal-link:hover {
  background: var(--accent-color);
  color: #000;
}

/* Main Container */
.newspaper-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Masthead */
.masthead {
  text-align: center;
  margin: 20px 0 30px;
}

.masthead-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 4.5rem;
  font-weight: 700;
  color: var(--primary-color);
  margin: 0;
  letter-spacing: -1px;
}

.masthead-details-bar {
  border-top: 2px solid var(--primary-color);
  border-bottom: 2px solid var(--primary-color);
  padding: 10px 0;
  margin-top: 10px;
  color: var(--caption-color);
  font-weight: 600;
  font-size: 0.9rem;
}

.details-content {
  display: flex;
  justify-content: center;
  gap: 20px;
}

/* SPA Navigation Bar */
.spa-nav {
  background-color: var(--primary-color);
  border-radius: 8px;
  margin-bottom: 30px;
  box-shadow: 0 4px 6px var(--shadow-color);
}

.nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.nav-item {
  display: block;
  padding: 15px 20px;
  color: #FFFFFF;
  font-weight: 600;
  font-size: 1.05rem;
  border-bottom: 3px solid transparent;
}

.nav-item:hover, .nav-item.active {
  background-color: rgba(255,255,255,0.1);
  color: var(--accent-color);
  border-bottom: 3px solid var(--accent-color);
}

/* Hero Carousel */
.hero-slider-container {
  position: relative;
  width: 100%;
  height: 400px;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 40px;
  box-shadow: 0 10px 20px var(--shadow-color);
  background: var(--utility-bg);
}

.hero-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
  display: flex;
  align-items: flex-end;
  text-decoration: none;
}

.hero-slide.active {
  opacity: 1;
  z-index: 10;
}

.hero-slide img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.hero-slide::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60%;
  background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
  z-index: 2;
}

.hero-content {
  position: relative;
  z-index: 3;
  padding: 40px;
  color: #FFFFFF;
  width: 100%;
}

.hero-category {
  display: inline-block;
  background: var(--accent-color);
  color: #000;
  padding: 4px 12px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.hero-title {
  font-size: 2.2rem;
  font-weight: 700;
  margin: 0 0 10px 0;
  line-height: 1.2;
  color: #FFFFFF;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.hero-subtitle {
  font-size: 1.1rem;
  opacity: 0.9;
  margin: 0;
  max-width: 800px;
}

/* Slider Controls */
.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  background: rgba(0,0,0,0.5);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  transition: background 0.3s;
}

.slider-btn:hover { background: var(--primary-color); }
.slider-prev { left: 20px; }
.slider-next { right: 20px; }

.slider-dots {
  position: absolute;
  bottom: 20px;
  right: 40px;
  z-index: 20;
  display: flex;
  gap: 8px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  cursor: pointer;
  transition: all 0.3s;
}

.dot.active {
  background: var(--accent-color);
  transform: scale(1.2);
}

/* Category Grid Layout */
.category-page-header {
  border-bottom: 3px solid var(--primary-color);
  padding-bottom: 15px;
  margin-bottom: 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.category-page-header h2 {
  font-size: 2rem;
  color: var(--primary-color);
  margin: 0;
}

.btn-back {
  background: var(--primary-light);
  color: var(--primary-color);
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 600;
  transition: all 0.2s;
}
.btn-back:hover {
  background: var(--primary-color);
  color: white;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
}

.news-card {
  background: var(--paper-color);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 6px var(--shadow-color);
  transition: transform 0.3s, box-shadow 0.3s;
  display: flex;
  flex-direction: column;
}

.news-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px var(--shadow-hover);
  border-color: var(--primary-color);
}

.card-image-wrap {
  width: 100%;
  height: 200px;
  overflow: hidden;
}

.card-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.news-card:hover .card-image-wrap img {
  transform: scale(1.05);
}

.card-content {
  padding: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.card-meta {
  font-size: 0.8rem;
  color: var(--caption-color);
  margin-bottom: 8px;
  font-weight: 600;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 10px 0;
  color: var(--ink-color);
  line-height: 1.4;
}

.news-card:hover .card-title {
  color: var(--primary-color);
}

.card-excerpt {
  font-size: 0.95rem;
  color: var(--caption-color);
  margin: 0 0 15px 0;
  flex-grow: 1;
}

.card-read-more {
  font-weight: 700;
  color: var(--accent-color);
  display: flex;
  align-items: center;
  gap: 5px;
}

.card-read-more::after {
  content: '→';
  transition: transform 0.2s;
}

.news-card:hover .card-read-more::after {
  transform: translateX(5px);
}


/* Broadsheet Grid (Cover Story Style) */
.broadsheet-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 40px;
}

.cover-story-col {
  border-right: 1px solid var(--divider-color);
  padding-right: 40px;
}

.cover-headline {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 10px;
  color: var(--primary-color);
}

.cover-lead {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--teal-color);
  margin-bottom: 20px;
  line-height: 1.5;
}

.article-meta {
  font-size: 0.9rem;
  color: var(--caption-color);
  border-top: 1px solid var(--divider-color);
  border-bottom: 1px solid var(--divider-color);
  padding: 8px 0;
  margin-bottom: 25px;
  display: flex;
  gap: 20px;
  font-weight: bold;
}

/* DTP Body Typography & Columns */
.dtp-article-body {
  font-size: 1.1rem;
  text-align: justify;
}

.drop-cap-paragraph::first-letter {
  float: left;
  font-size: 4rem;
  line-height: 0.8;
  padding-top: 4px;
  padding-right: 8px;
  padding-left: 3px;
  font-family: 'Playfair Display', Georgia, serif;
  color: var(--primary-color);
}

/* Layout Columns */
.dtp-columns-1 { column-count: 1; }
.dtp-columns-2 { column-count: 2; column-gap: 30px; column-rule: 1px solid var(--divider-color); }
.dtp-columns-3 { column-count: 3; column-gap: 30px; column-rule: 1px solid var(--divider-color); }
.dtp-columns-4 { column-count: 4; column-gap: 20px; column-rule: 1px solid var(--divider-color); }
.dtp-columns-5 { column-count: 5; column-gap: 15px; column-rule: 1px solid var(--divider-color); }
.dtp-columns-6 { column-count: 6; column-gap: 15px; column-rule: 1px solid var(--divider-color); }

/* Image Wrapping (Optimized for wrapping) */
.dtp-image-wrap {
  box-sizing: border-box;
  clear: none;
  break-inside: avoid;
}
.float-left-wrap { float: left; margin: 8px 18px 15px 0; max-width: 50%; }
.float-right-wrap { float: right; margin: 8px 0 15px 18px; max-width: 50%; }
.float-none-wrap { float: none; display: block; margin: 20px auto; max-width: 100%; clear: both; }

/* Continue Badge */
.continue-badge {
  display: inline-block;
  margin-top: 15px;
  padding: 5px 12px;
  background: var(--paper-color);
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
  font-weight: bold;
  font-size: 0.9rem;
  border-radius: 20px;
  text-decoration: none;
  clear: both;
}
.continue-badge:hover {
  background: var(--primary-color);
  color: white;
}

.shape-rect {
  width: 45%;
  min-width: 120px;
  max-width: 100%;
  border: 3px solid var(--primary-color);
  padding: 0;
  border-radius: 8px;
  overflow: hidden;
}

.shape-rect img {
  width: 100%;
  height: auto;
  display: block;
}

.shape-circle {
  width: 45%;
  min-width: 120px;
  max-width: 250px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: 3px solid var(--primary-color);
  overflow: hidden;
  shape-outside: circle(50%);
  shape-margin: 12px;
  clip-path: circle(50%);
  padding: 0;
}

.shape-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.image-caption-text {
  font-size: 0.85rem;
  font-style: italic;
  color: var(--caption-color);
  text-align: center;
  margin-top: 5px;
}

/* Sidebar */
.sidebar-box {
  background: var(--paper-color);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 30px;
  box-shadow: 0 4px 6px var(--shadow-color);
}

.box-title {
  color: var(--primary-color);
  margin: 0 0 15px 0;
  font-size: 1.3rem;
  font-weight: 700;
  border-bottom: 2px solid var(--accent-color);
  padding-bottom: 8px;
}

.box-feed article {
  padding: 12px 0;
  border-bottom: 1px solid var(--divider-color);
}

.box-feed article:last-child { border-bottom: none; }
.box-feed h4 { margin: 0 0 5px 0; font-size: 1.05rem; }
.box-feed h4 a { color: var(--ink-color); }
.box-feed h4 a:hover { color: var(--primary-color); }
.box-feed p { font-size: 0.85rem; margin: 0; color: var(--caption-color); }

/* Newsletter Form */
.newsletter-widget {
  background: var(--primary-light);
  padding: 20px;
  border-radius: 8px;
  text-align: center;
}
.newsletter-widget h5 { color: var(--primary-color); margin: 0 0 10px 0; font-size: 1.1rem; }
.widget-form { display: flex; flex-direction: column; gap: 10px; }
.widget-form input { padding: 10px; border: 1px solid var(--border-color); border-radius: 4px; }
.widget-form button { background: var(--primary-color); color: white; padding: 10px; border: none; border-radius: 4px; cursor: pointer; font-weight: bold; }
.widget-form button:hover { background: var(--teal-color); }

/* Footer */
.broadsheet-footer { margin-top: 40px; padding-bottom: 20px; }
.footer-border-double { border-top: 3px solid var(--primary-color); margin-bottom: 20px; }
.footer-grid { display: grid; grid-template-columns: repeat(3, 1fr); font-size: 0.9rem; font-weight: bold; color: var(--caption-color); }
.footer-left { text-align: left; }
.footer-center { text-align: center; }
.footer-right { text-align: right; }

/* Responsive */
@media (max-width: 1024px) {
  .masthead-title { font-size: 3.5rem; }
}
@media (max-width: 768px) {
  .broadsheet-grid { grid-template-columns: 1fr; gap: 30px; }
  .cover-story-col { border-right: none; padding-right: 0; }
  .dtp-columns-2, .dtp-columns-3 { column-count: 1; }
  .nav-links { flex-direction: column; text-align: center; }
  .hero-slider-container { height: 300px; }
  .hero-title { font-size: 1.5rem; }
  .footer-grid { grid-template-columns: 1fr; gap: 10px; text-align: center; }
  .footer-left, .footer-center, .footer-right { text-align: center; }
  .details-content { flex-direction: column; gap: 5px; }
  .masthead-divider { display: none; }
}

/* ==================================================
   Social Engagement & UI Additions
================================================== */

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
  opacity: 1;
  visibility: visible;
  transition: all 0.3s;
}

.modal-overlay.hidden {
  opacity: 0;
  visibility: hidden;
}

.modal-content {
  background: var(--paper-color);
  padding: 30px;
  border-radius: 12px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 15px 30px rgba(0,0,0,0.3);
  text-align: center;
  border: 2px solid var(--primary-color);
}

.modal-content h2 { color: var(--primary-color); margin-top: 0; }
.modal-content p { color: var(--caption-color); font-size: 0.95rem; margin-bottom: 20px; }

#auth-name-input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  margin-bottom: 20px;
  font-size: 1rem;
}

.btn-primary, .btn-secondary, .btn-share {
  display: inline-block;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  margin-bottom: 10px;
}

.btn-primary { background: var(--primary-color); color: white; }
.btn-primary:hover { background: var(--primary-light); color: var(--primary-color); }
.btn-secondary { background: var(--border-color); color: var(--ink-color); }
.btn-secondary:hover { background: #d1d5db; }
.mt-10 { margin-top: 10px; }

/* Engagement Bar */
.engagement-bar {
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 15px 0;
  border-top: 2px solid var(--border-color);
  border-bottom: 2px solid var(--border-color);
  margin: 30px 0;
}

.btn-engage {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-weight: bold;
  color: var(--caption-color);
  transition: all 0.2s;
}

.btn-engage:hover { background: var(--primary-light); color: var(--primary-color); border-color: var(--primary-color); }
.btn-engage.liked { color: #E11D48; border-color: #E11D48; background: #FFE4E6; }

/* Comments Section */
.comments-section {
  margin-top: 30px;
  background: var(--paper-color);
  padding: 20px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}
.comments-header { font-size: 1.25rem; font-weight: bold; color: var(--primary-color); margin-bottom: 15px; border-bottom: 1px solid var(--border-color); padding-bottom: 5px; }

.comment-list { margin-bottom: 20px; }
.comment-item {
  padding: 10px;
  border-bottom: 1px dashed var(--border-color);
}
.comment-item:last-child { border-bottom: none; }
.comment-user { font-weight: bold; color: var(--ink-color); }
.comment-date { font-size: 0.8rem; color: var(--caption-color); margin-left: 10px; }
.comment-text { margin: 5px 0 0 0; }

.comment-form { display: flex; flex-direction: column; gap: 10px; }
.comment-form textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
}
.comment-form button { align-self: flex-end; width: auto; }

/* Share Card Template (Lokmat Style) */
.share-card {
  width: 800px;
  background: var(--newsprint-bg);
  padding: 30px;
  box-sizing: border-box;
  font-family: 'Mukta', sans-serif;
  border: 4px solid var(--primary-color);
  color: #111;
  border-radius: 4px;
}

.sc-header {
  border-bottom: 3px double var(--primary-color);
  margin-bottom: 20px;
  text-align: center;
  padding-bottom: 15px;
}
.sc-header h1 {
  font-family: 'Playfair Display', serif;
  color: var(--primary-color);
  margin: 0 0 10px 0;
  font-size: 4rem;
  line-height: 1;
}
.sc-meta-bar {
  font-size: 1rem;
  color: #444;
  font-weight: bold;
  border-top: 1px solid #ccc;
  padding-top: 8px;
}

.sc-body h2 {
  font-size: 2.2rem;
  line-height: 1.2;
  margin: 0 0 20px 0;
  color: var(--primary-color);
  text-align: center;
}

#sc-image-wrapper {
  width: 100%;
  margin-bottom: 20px;
  border-radius: 4px;
  overflow: hidden;
  text-align: center;
}

#sc-image-wrapper img {
  max-width: 100%;
  max-height: 400px;
  object-fit: cover;
  display: inline-block;
  border: 2px solid #ddd;
}

#sc-content {
  text-align: justify;
  line-height: 1.6;
}

.sc-footer {
  border-top: 2px dashed #aaa;
  margin-top: 20px;
  padding-top: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sc-footer-left {
  font-size: 1.1rem;
  color: #333;
}

.sc-footer-right {
  text-align: right;
  font-size: 0.95rem;
  color: #555;
}

/* ==================================================
   Admin, AI Layout & Archive Additions
================================================== */

.flash-news-widget {
  background: #FEF3C7;
  border-left: 5px solid #D97706;
  padding: 15px;
  font-weight: bold;
  font-size: 1.1rem;
  color: #92400E;
  margin: 10px 0;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
  background: white;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
  font-size: 0.95rem;
}
.admin-table th {
  background: var(--primary-color);
  color: white;
  padding: 12px;
  text-align: left;
}
.admin-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
}

.archive-card {
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  background: var(--paper-color);
  transition: transform 0.2s, box-shadow 0.2s;
}
.archive-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.1);
  border-color: var(--primary-color);
}

/* Fallback Modal specific */
#share-preview-container img {
  max-width: 100%;
  border: 1px solid #ccc;
  margin-bottom: 15px;
}
.share-buttons { display: flex; flex-direction: column; gap: 10px; }
.btn-wa { background: #25D366; color: white; }
.btn-fb { background: #1877F2; color: white; }
.btn-li { background: #0A66C2; color: white; }
