.writings-category-page {
  background: #f6fafc;
}

.writings-category-page .page-hero {
  padding: 170px 0 78px;
  text-align: start;
  border-bottom: 4px solid #76bddb;
  background: linear-gradient(115deg, #064b92, #087fba 58%, #009b9d);
}

.writings-category-page .page-hero::before {
  background: url("body-contours.svg?v=2") center / 640px 480px repeat;
  opacity: 0.16;
  pointer-events: none;
}

.writings-category-page .page-hero h1 {
  max-width: 900px;
  margin: 0;
  font-size: clamp(2.5rem, 6vw, 4.8rem);
  line-height: 1.35;
  text-shadow: none;
}

.writings-category-page .page-hero p {
  margin: 12px 0 0;
}

.writings-category-page .mashvaraa-main {
  padding: 42px 0 88px;
  background: #f6fafc;
}

.writings-category-page .mashvaraa-layout {
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 30px;
}

.writings-category-page .topics-section {
  min-width: 0;
}

.writings-category-page .topics-section > h2 {
  color: #153d57;
}

.writings-category-page .search-box {
  margin-bottom: 28px;
}

.writings-category-page .search-box input {
  min-height: 58px;
  border: 1px solid #c8e4ef;
  border-radius: 16px;
  padding-inline: 18px 48px;
  box-shadow: 0 6px 20px #064b9208;
}

.writings-category-page .search-icon {
  color: #007f9a;
}

.writings-category-page .topic-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
}

.writings-category-page .topic-item {
  border-color: #dfedf3;
  border-radius: 18px;
  box-shadow: 0 6px 24px #064b9208;
}

.writings-category-page .topic-item:hover {
  border-color: #96d2e5;
  box-shadow: 0 16px 36px #064b9218;
}

.writings-category-page .topic-card-link {
  height: 100%;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  grid-template-rows: auto;
  min-height: 280px;
}

.writings-category-page :is(.topic-photo, .topic-icon, .topic-photo img) {
  min-height: 0;
  height: 100%;
}

.writings-category-page .topic-photo img {
  transition: transform 0.4s;
}

.writings-category-page .topic-photo {
  overflow: hidden;
}

.writings-category-page .topic-item:hover .topic-photo img {
  transform: scale(1.04);
}

.writings-category-page .topic-icon {
  color: #078ba4;
  background: linear-gradient(135deg, #eaf7fc, #e1f7f2);
  font-size: 3rem;
}

.writings-category-page .topic-info {
  padding: 22px;
  align-content: start;
  gap: 14px;
}

.writings-category-page .topic-category {
  color: #08798c;
  background: #e9f8f8;
  font-size: 0.78rem;
}

.writings-category-page .topic-title {
  color: #153d57;
  font-family: "DAM Kathivalhi", Faruma, "Noto Sans Thaana", sans-serif;
  font-weight: 400;
  font-synthesis: none;
  letter-spacing: normal;
  font-size: 1.35rem;
  line-height: 1.6;
}

.writings-category-page .topic-description {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  color: #5d788a;
  font-size: 0.95rem;
}

.writings-category-page .topic-meta {
  justify-content: space-between;
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid #edf4f7;
  font-size: 0.8rem;
}

.writings-category-page .mashvaraa-layout > aside {
  position: sticky;
  top: 110px;
}

.writings-category-page .sidebar-card {
  padding: 24px 20px;
  border-color: #dfedf3;
  border-radius: 18px;
  box-shadow: 0 6px 24px #064b9208;
}

.writings-category-page .sidebar-card h3 {
  color: #153d57;
  border-bottom-color: #e7f2f7;
  font-size: 1.2rem;
}

.writings-category-page .category-filter a {
  border-color: transparent;
  background: #f5fafc;
  color: #31566e;
}

.writings-category-page .category-filter a:hover {
  background: #e6f5fa;
  color: #0066cc;
}

.writings-category-page .category-filter a.active {
  color: #fff;
  background: linear-gradient(110deg, #0066cc, #008d9e);
  box-shadow: 0 4px 12px #0066cc20;
}

.writings-category-page .submission-item {
  border-inline-start: 3px solid #76bddb;
  background: #f5fafc;
}

.writings-category-page .sub-category {
  color: #08798c;
  background: #e9f8f8;
}

.writings-category-page .pagination-nav a {
  border: 1px solid #c8e4ef;
  background: #fff;
  color: #0066cc;
}

.writings-category-page .pagination-nav a.active {
  color: #fff;
  background: linear-gradient(110deg, #0066cc, #008d9e);
}

.writings-category-page .no-results {
  grid-column: 1 / -1;
  border: 1px dashed #c8e4ef;
  border-radius: 18px;
  background: #fff;
}

.writings-category-page [hidden] {
  display: none !important;
}

.writing-detail-page .page-hero .eyebrow {
  display: inline-block;
  margin: 0 0 18px;
  padding: 5px 14px;
  border: 1px solid #ffffff40;
  border-radius: 999px;
  color: #fff;
  background: #ffffff14;
  font-family: inherit;
  font-size: 0.9rem;
}

.writing-detail-page .writing-detail-card {
  min-width: 0;
  border-color: #dfedf3;
  border-radius: 20px;
  box-shadow: 0 8px 28px #064b920a;
}

.writing-detail-page .writing-detail-photo {
  max-height: 560px;
  object-fit: contain;
  background: #edf6fa;
}

.writing-detail-page .writing-detail-meta {
  justify-content: space-between;
  gap: 16px;
}

.writing-detail-page .writing-detail-meta time {
  color: #5d788a;
  font-weight: 500;
  font-size: 0.85rem;
}

.writing-detail-page .writing-detail-card h2 {
  margin-top: 22px;
  color: #153d57;
  line-height: 1.6;
}

.writing-detail-page .writing-detail-summary {
  color: #5d788a;
  line-height: 2;
}

.writing-detail-page .writing-detail-body {
  line-height: 2.1;
  overflow-wrap: anywhere;
}

.writing-detail-page .writing-detail-body table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
}

.writing-detail-page .writing-file-item {
  border-color: #d9eaf1;
  background: #f5fafc;
}

.writing-detail-page .writing-file-item > div {
  min-width: 0;
  overflow-wrap: anywhere;
}

.writing-detail-page .writing-file-item nav a {
  min-height: 44px;
  color: #0066cc;
  background: #eaf7fc;
}

.writing-detail-page .writing-file-item nav a:hover {
  color: #fff;
  background: #0066cc;
}

.writing-detail-page .feedback-card {
  border-color: #c8e4ef;
}

.writing-detail-page .feedback-login-btn {
  background: linear-gradient(110deg, #0066cc, #008d9e);
}

@media (max-width: 1000px) {
  .writings-category-page .mashvaraa-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .writings-category-page .mashvaraa-layout > aside {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
  }
}

@media (max-width: 600px) {
  .writings-category-page .page-hero {
    padding: 140px 0 56px;
  }

  .writings-category-page .mashvaraa-main {
    padding-top: 30px;
  }

  .writings-category-page .topic-list,
  .writings-category-page .mashvaraa-layout > aside {
    grid-template-columns: minmax(0, 1fr);
  }

  .writings-category-page .topic-card-link {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 210px 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .writings-category-page .topic-item,
  .writings-category-page .topic-photo img {
    transition: none;
    transform: none !important;
  }
}
