/* Article Module CSS - Academic Theme
-------------------------------------- */

:root {
  /* Academic Theme Colors - Aligned with main site */
  --pure-black: #000000;
  --charcoal: #1a1a1a;
  --dark-gray: #333333;
  --medium-gray: #666666;
  --gray: #999999;
  --light-gray: #CCCCCC;
  --pale-gray: #E5E5E5;
  --off-white: #F8F8F8;
  --white: #ffffff;

  /* Academic Gold */
  --gold: #B8860B;
  --gold-dark: #9B7209;
  --gold-light: #D4A637;

  /* Legacy aliases for compatibility */
  --primary-color: var(--charcoal);
  --secondary-color: var(--medium-gray);
  --text-color: var(--charcoal);
  --light-text: var(--medium-gray);
  --bg-color: var(--white);
  --light-bg: var(--off-white);
  --border-color: var(--pale-gray);

  /* Status colors */
  --danger-color: #A65344;
  --success-color: #2A4C3A;
  --warning-color: var(--gold);
  --info-color: #3A6EA5;

  /* Layout */
  --border-radius: 8px;
  --small-radius: 4px;
  --transition: all 0.3s ease;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --hover-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  --content-width: 1200px;
}

/* Typography Variables */
:root {
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  --font-serif: Georgia, 'Times New Roman', Times, serif;
}

/* Reset and Base Typography */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  color: var(--text-color);
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 400;
  font-family: Georgia, 'Times New Roman', serif;
  line-height: 1.3;
  color: var(--charcoal);
  letter-spacing: -0.01em;
}

a {
  text-decoration: none;
  color: var(--charcoal);
  transition: var(--transition);
}

a:hover {
  color: var(--gold-dark);
}

ul {
  list-style: none;
}

/* Container */
.blog-newspaper-container {
  margin: 0 auto;
  padding: 0 20px;
}

/* Blog Header - Academic Style */
.blog-header {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 40px 0 30px;
  margin-bottom: 30px;
  border-bottom: 2px solid var(--gold);
  background: linear-gradient(to bottom, rgba(184, 134, 11, 0.03), transparent);
  position: relative;
}

.blog-header::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--gold), transparent);
}

.blog-brand-title {
  margin: 0;
  font-size: 2.5rem;
  line-height: 1.2;
  position: relative;
}

.blog-brand-title a {
  color: var(--charcoal);
  text-decoration: none;
  display: flex;
  flex-direction: column;
}

.blog-brand-name {
  letter-spacing: -0.02em;
  font-weight: 400;
  font-size: 2.8rem;
  font-family: Georgia, 'Times New Roman', serif;
  color: var(--charcoal);
  position: relative;
  display: inline-block;
  padding: 5px 30px 12px;
  margin: 0 auto;
  max-width: 90%;
  line-height: 1.1;
}

.blog-brand-name::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  transition: transform 0.3s ease;
  opacity: 0.8;
  width: 80%;
  margin: 0 auto;
}

.blog-brand-title a:hover .blog-brand-name::after {
  transform: scaleX(1);
  opacity: 1;
}

.blog-brand-subtitle {
  font-size: 1.15rem;
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 400;
  font-style: italic;
  color: var(--gold-dark);
  margin-top: 8px;
  text-align: center;
  letter-spacing: 0.05em;
  display: block;
  position: relative;
  margin-bottom: 5px;
}

.blog-brand-subtitle::before,
.blog-brand-subtitle::after {
  content: '';
  position: absolute;
  height: 1px;
  background-color: var(--gold);
  top: 50%;
  width: 60px;
  opacity: 0.5;
}

.blog-brand-subtitle::before {
  right: calc(50% + 90px);
}

.blog-brand-subtitle::after {
  left: calc(50% + 90px);
}

.blog-header-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-top: 20px;
  width: 100%;
}

.blog-date {
  font-size: 0.95rem;
  color: var(--gold-dark);
  font-weight: 400;
  font-style: italic;
  padding: 2px 15px;
  background-color: var(--off-white);
  border: 1px solid var(--pale-gray);
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Blog Navigation - Academic Style */
.blog-category-nav {
  background: var(--charcoal);
  border-radius: var(--border-radius);
  margin-bottom: 30px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 10px;
  z-index: 100;
  border: 1px solid var(--pale-gray);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
}

/* Menu toggle (mobile only) */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 15px;
  position: relative;
  z-index: 1000;
}

.nav-toggle-icon {
  display: block;
  position: relative;
  width: 22px;
  height: 2px;
  background-color: var(--gold);
  transition: var(--transition);
}

.nav-toggle-icon::before,
.nav-toggle-icon::after {
  content: '';
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--gold);
  transition: var(--transition);
}

.nav-toggle-icon::before {
  top: -6px;
}

.nav-toggle-icon::after {
  bottom: -6px;
}

/* Primary Navigation */
.primary-nav {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: block;
  padding: 15px;
  color: var(--white);
  font-weight: 400;
  text-decoration: none;
  transition: var(--transition);
}

.nav-link:hover {
  color: var(--gold);
}

.nav-item.active .nav-link {
  color: var(--gold);
  position: relative;
}

.nav-item.active .nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 15px;
  right: 15px;
  height: 3px;
  background: var(--gold);
  border-radius: 3px 3px 0 0;
}

.dropdown-indicator {
  margin-left: 5px;
  font-size: 0.8rem;
  transition: var(--transition);
}

/* CSS-only dropdown */
.nav-item.has-dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background-color: var(--dark-gray);
  border-radius: 0 0 var(--small-radius) var(--small-radius);
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
  z-index: 10;
  overflow: hidden;
  border: 1px solid var(--pale-gray);
  border-top: none;
}

.nav-item.has-dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-item.has-dropdown:hover .dropdown-indicator {
  transform: rotate(180deg);
  color: var(--gold);
}

.dropdown-item {
  display: block;
}

.dropdown-link {
  display: block;
  padding: 12px 20px;
  color: var(--white);
  text-decoration: none;
  transition: var(--transition);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.dropdown-link:hover {
  background-color: rgba(184, 134, 11, 0.1);
  color: var(--gold);
}

.dropdown-item.active .dropdown-link {
  background-color: rgba(184, 134, 11, 0.15);
  color: var(--gold);
  font-weight: 400;
}

/* Search */
.nav-search {
  position: relative;
}

.search-mini-form {
  display: flex;
  height: 36px;
}

.search-mini-input {
  width: 200px;
  height: 100%;
  padding: 0 15px;
  border: 1px solid var(--pale-gray);
  border-right: none;
  border-radius: var(--small-radius) 0 0 var(--small-radius);
  outline: none;
  background-color: var(--white);
  transition: var(--transition);
  color: var(--charcoal);
}

.search-mini-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(184, 134, 11, 0.1);
}

.search-mini-button {
  height: 100%;
  padding: 0 15px;
  background: var(--gold);
  color: var(--charcoal);
  border: 1px solid var(--gold-dark);
  border-left: none;
  border-radius: 0 var(--small-radius) var(--small-radius) 0;
  cursor: pointer;
  transition: var(--transition);
  font-weight: 400;
}

.search-mini-button:hover {
  background: var(--gold-dark);
  color: var(--white);
}

/* Contributor Dashboard Link */
.nav-item.nav-dashboard {
  margin-left: 10px;
}

.nav-item.nav-dashboard .nav-link {
  background: rgba(184, 134, 11, 0.15);
  border: 1px solid rgba(184, 134, 11, 0.25);
  border-radius: 4px;
  color: var(--gold-light) !important;
  padding: 14px 20px;
}

.nav-item.nav-dashboard .nav-link:hover {
  background: rgba(184, 134, 11, 0.25);
  border-color: rgba(184, 134, 11, 0.4);
}

.nav-item.nav-dashboard.active .nav-link {
  background: rgba(184, 134, 11, 0.3);
  border-color: var(--gold);
}

.nav-item.nav-dashboard.active .nav-link::after {
  display: none;
}

.dashboard-icon {
  margin-right: 5px;
  font-size: 1rem;
  vertical-align: middle;
}

/* Content Layout */
.blog-content-layout {
  margin-bottom: 40px;
}

/* When sidebar is present (on homepage) */
.blog-content-with-sidebar {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
}

.blog-content-with-sidebar .blog-main-content-inner {
  flex: 1;
  flex-basis: 65%;
  min-width: 0;
}

.blog-sidebar {
  flex-basis: 30%;
  min-width: 300px;
}

/* Messages */
.message {
  padding: 15px 20px;
  margin-bottom: 20px;
  border-radius: var(--border-radius);
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

.message-info {
  background-color: rgba(58, 110, 165, 0.1);
  border-left: 4px solid var(--info-color);
}

.message-success {
  background-color: rgba(42, 76, 58, 0.1);
  border-left: 4px solid var(--success-color);
}

.message-warning {
  background-color: rgba(184, 134, 11, 0.1);
  border-left: 4px solid var(--warning-color);
}

.message-error {
  background-color: rgba(166, 83, 68, 0.1);
  border-left: 4px solid var(--danger-color);
}

/* Sidebar Sections */
.sidebar-section {
  background-color: var(--bg-color);
  border-radius: var(--border-radius);
  padding: 25px;
  margin-bottom: 30px;
  box-shadow: var(--shadow);
  border: 1px solid var(--pale-gray);
}

.sidebar-title {
  font-size: 1.3rem;
  margin-bottom: 20px;
  position: relative;
  padding-bottom: 10px;
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 400;
  color: var(--charcoal);
  letter-spacing: -0.01em;
}

.sidebar-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50px;
  height: 2px;
  background: var(--gold);
  border-radius: 2px;
}

/* Featured Posts */
.featured-posts {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.featured-post {
  display: flex;
  gap: 15px;
  transition: var(--transition);
}

.featured-post:hover {
  transform: translateY(-5px);
}

.featured-image {
  width: 80px;
  height: 80px;
  overflow: hidden;
  border-radius: var(--small-radius);
  flex-shrink: 0;
}

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

.featured-post:hover .featured-image img {
  transform: scale(1.1);
}

.featured-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.featured-title {
  font-size: 1rem;
  margin-bottom: 8px;
  line-height: 1.4;
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 400;
}

.featured-title a {
  color: var(--charcoal);
}

.featured-title a:hover {
  color: var(--gold-dark);
}

.featured-meta {
  font-size: 0.85rem;
  color: var(--light-text);
  margin-top: auto;
}

/* Recent Posts */
.recent-posts {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.recent-post {
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
}

.recent-post:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.recent-post:hover {
  transform: translateX(5px);
}

.post-title {
  font-size: 1rem;
  margin-bottom: 8px;
  line-height: 1.4;
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 400;
}

.post-title a {
  color: var(--charcoal);
  transition: var(--transition);
}

.post-title a:hover {
  color: var(--gold-dark);
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--light-text);
}

/* Categories */
.category-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.category-item {
  transition: var(--transition);
  padding-left: 3px;
}

.category-item:hover {
  transform: translateX(5px);
}

.category-link {
  color: var(--charcoal);
  font-weight: 400;
  transition: var(--transition);
}

.category-link:hover,
.category-item.active > .category-link {
  color: var(--gold-dark);
}

.subcategory-list {
  margin-top: 8px;
  margin-left: 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.subcategory-link {
  color: var(--light-text);
  font-size: 0.95rem;
}

.subcategory-link:hover,
.subcategory-item.active > .subcategory-link {
  color: var(--gold-dark);
}

/* Tags */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag-item {
  display: inline-block;
  padding: 6px 12px;
  background-color: var(--light-bg);
  color: var(--light-text);
  border-radius: 20px;
  font-size: 0.85rem;
  transition: var(--transition);
  border: 1px solid var(--pale-gray);
}

.tag-item:hover {
  background-color: var(--gold);
  color: var(--white);
  transform: translateY(-3px);
  border-color: var(--gold-dark);
}

/* Post Actions */
.action-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.action-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 15px;
  border-radius: var(--small-radius);
  background-color: var(--light-bg);
  color: var(--charcoal);
  font-weight: 400;
  transition: var(--transition);
  border: 1px solid var(--pale-gray);
}

.action-link:hover {
  background-color: var(--gold);
  color: var(--white);
  transform: translateY(-3px);
  border-color: var(--gold-dark);
}

.action-link.danger {
  color: var(--danger-color);
}

.action-link.danger:hover {
  background-color: var(--danger-color);
  color: white;
  border-color: var(--danger-color);
}

/* Default content block style */
.blog-content {
  background-color: var(--bg-color);
  border-radius: var(--border-radius);
  padding: 30px;
  box-shadow: var(--shadow);
  border: 1px solid var(--pale-gray);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.blog-main-content,
.blog-sidebar .sidebar-section,
.blog-category-nav {
  animation: fadeIn 0.6s ease;
}

.blog-sidebar .sidebar-section:nth-child(2) {
  animation-delay: 0.1s;
}

.blog-sidebar .sidebar-section:nth-child(3) {
  animation-delay: 0.2s;
}

.blog-sidebar .sidebar-section:nth-child(4) {
  animation-delay: 0.3s;
}

/* CSS-only Mobile Menu Toggle */
#nav-toggle-checkbox {
  display: none;
}

/* Responsive Styles */
@media (max-width: 992px) {
  .blog-content-with-sidebar .blog-main-content-inner,
  .blog-sidebar {
    flex-basis: 100%;
  }

  .blog-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }

  .blog-header-meta {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 768px) {
  /* Mobile Navigation */
  .blog-category-nav {
    position: relative;
    padding: 0;
  }

  .nav-container {
    flex-direction: column;
    padding: 0;
    position: relative;
  }

  .nav-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 15px 20px;
    margin: 0;
    border-radius: var(--border-radius);
    color: var(--gold);
    background: var(--charcoal);
    cursor: pointer;
    border: 1px solid var(--pale-gray);
  }

  .nav-toggle-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }

  .nav-toggle-text {
    font-weight: 400;
  }

  /* Hide menu by default on mobile */
  .primary-nav {
    display: none;
    flex-direction: column;
    width: 100%;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
  }

  #nav-toggle-checkbox:checked ~ .primary-nav {
    display: flex;
    max-height: 1000px;
  }

  /* Transform toggle icon to X when menu is open */
  #nav-toggle-checkbox:checked ~ .nav-toggle .nav-toggle-icon {
    background-color: transparent;
  }

  #nav-toggle-checkbox:checked ~ .nav-toggle .nav-toggle-icon::before {
    transform: rotate(45deg);
    top: 0;
  }

  #nav-toggle-checkbox:checked ~ .nav-toggle .nav-toggle-icon::after {
    transform: rotate(-45deg);
    bottom: 0;
  }

  .nav-item {
    width: 100%;
    border-bottom: 1px solid var(--border-color);
  }

  .nav-item:last-child {
    border-bottom: none;
  }

  .nav-link {
    padding: 15px 20px;
    width: 100%;
    text-align: left;
  }

  /* Handle dropdown menu */
  .dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    width: 100%;
    border-radius: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    display: block;
  }

  .nav-item.has-dropdown:hover .dropdown-menu {
    max-height: 500px;
  }

  .dropdown-item {
    border-top: 1px solid var(--border-color);
  }

  .dropdown-link {
    padding-left: 40px;
  }

  /* Move search to the bottom */
  .nav-search {
    width: 100%;
    padding: 15px;
    order: 2;
    border-top: 1px solid var(--border-color);
  }

  .search-mini-form {
    width: 100%;
  }

  .search-mini-input {
    flex-grow: 1;
    width: auto;
  }

  .blog-brand-name {
    font-size: 2.2rem;
    padding: 5px 15px 10px;
  }

  .blog-brand-subtitle {
    font-size: 0.9rem;
  }

  .blog-brand-subtitle::before,
  .blog-brand-subtitle::after {
    width: 30px;
  }

  .blog-brand-subtitle::before {
    right: calc(50% + 60px);
  }

  .blog-brand-subtitle::after {
    left: calc(50% + 60px);
  }
}

@media (max-width: 576px) {
  .blog-brand-name {
    font-size: 1.8rem;
    letter-spacing: -0.01em;
  }

  .blog-brand-subtitle {
    font-size: 0.8rem;
    letter-spacing: 0.05em;
  }

  .blog-brand-subtitle::before,
  .blog-brand-subtitle::after {
    display: none;
  }
}
