/* ═══════════════════════════════════════════
   RESOURCE LIBRARY STYLES
   Matches deanlaoshi / Elite Academia design
   ═══════════════════════════════════════════ */
/* ── Shared ── */
:root {
  --res-font-serif: 'Playfair Display', Georgia, serif;
  --res-dark: #1a1a1a;
  --res-text: #3a3632;
  --res-muted: #6b6560;
  --res-light: #a09890;
  --res-border: #e8e4df;
  --res-bg: #faf8f5;
  --res-white: #fff;
  --res-green: #2e7d32;
  --res-green-bg: #e8f5e9;
  --res-gold: #c9a96e;
  --res-gold-bg: #fdf8f0;
  --res-red: #8b2500;
  --res-blue: #1a5276;
  --res-blue-bg: #eaf2f8;
  --res-rust: #8b2500;
  --res-rust-bg: #fdf0ea;
}
/* ═══════════════════════════════════════════
   ARCHIVE PAGE (Listing)
   ═══════════════════════════════════════════ */
.res-archive {
  padding: 2rem 0 4rem;
}
.res-archive-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
/* Header */
.res-archive-header {
  text-align: center;
  margin-bottom: 2rem;
}
.res-archive-title {
  font-family: var(--res-font-serif);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--res-dark);
  margin: 0 0 0.4rem 0;
}
.res-archive-subtitle {
  font-size: 1rem;
  color: var(--res-muted);
  margin: 0;
  line-height: 1.6;
}
/* Search */
.res-search {
  display: flex;
  max-width: 480px;
  margin: 0 auto 1.5rem;
  border: 1px solid var(--res-border);
  background: var(--res-white);
  transition: border-color 0.2s;
}
.res-search:focus-within {
  border-color: var(--res-dark);
}
.res-search-input {
  flex: 1;
  border: none;
  padding: 0.7rem 1rem;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--res-dark);
  background: transparent;
  outline: none;
}
.res-search-input::placeholder {
  color: var(--res-light);
}
.res-search-btn {
  background: none;
  border: none;
  padding: 0.7rem 1rem;
  cursor: pointer;
  color: var(--res-muted);
  transition: color 0.2s;
}
.res-search-btn:hover {
  color: var(--res-dark);
}

/* ── Filter System (two-group) ── */
.res-filter-system {
  max-width: 720px;
  margin: 0 auto 1.5rem;
}
.res-filter-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: center;
}
.res-filter-label {
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--res-light);
  min-width: 80px;
  text-align: right;
  flex-shrink: 0;
  font-weight: 600;
}
.res-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
}
.res-filter-divider {
  height: 1px;
  background: var(--res-border);
  margin: 0.7rem 0;
  opacity: 0.6;
}

/* ── Access Level Buttons (Row 1: filled pill style) ── */
.res-tier-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 1rem;
  border: 1px solid var(--res-border);
  border-radius: 20px;
  background: transparent;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--res-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  text-decoration: none;
  font-weight: 500;
}
.res-tier-btn svg {
  opacity: 0.6;
  transition: opacity 0.2s;
}
.res-tier-btn:hover {
  border-color: var(--res-dark);
  color: var(--res-dark);
}
.res-tier-btn:hover svg {
  opacity: 1;
}
.res-tier-btn.active {
  background: var(--res-dark);
  color: var(--res-white);
  border-color: var(--res-dark);
}
.res-tier-btn.active svg {
  opacity: 1;
}
.res-tier-btn--free.active {
  background: var(--res-green);
  border-color: var(--res-green);
  color: var(--res-white);
}
.res-tier-btn--member.active {
  background: var(--res-blue);
  border-color: var(--res-blue);
  color: var(--res-white);
}
.res-tier-btn--premium.active {
  background: var(--res-dark);
  border-color: var(--res-dark);
  color: var(--res-gold);
}
.res-tier-btn--purchase.active {
  background: var(--res-rust);
  border-color: var(--res-rust);
  color: var(--res-white);
}

/* ── Subject Buttons (Row 2: outlined chip style) ── */
.res-subject-btn {
  display: inline-block;
  padding: 0.38rem 0.95rem;
  border: 1px solid var(--res-border);
  background: transparent;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--res-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  text-decoration: none;
  font-weight: 500;
}
.res-subject-btn:hover {
  border-color: var(--res-gold);
  color: var(--res-gold);
  background: var(--res-gold-bg);
}
.res-subject-btn.active {
  background: var(--res-gold-bg);
  color: #8b6914;
  border-color: var(--res-gold);
  font-weight: 600;
}

/* ── Legacy filter button (keep for backward compat) ── */
.res-filter-btn {
  padding: 0.45rem 1.2rem;
  border: 1px solid var(--res-border);
  background: transparent;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--res-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  text-decoration: none;
  display: inline-block;
}
.res-filter-btn:hover,
.res-filter-btn.active {
  background: var(--res-dark);
  color: var(--res-white);
  border-color: var(--res-dark);
}

/* Count */
.res-count {
  text-align: center;
  font-size: 0.78rem;
  color: var(--res-light);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 2rem;
}
.res-count-sep {
  margin: 0 0.3rem;
  opacity: 0.4;
}
.res-count a {
  color: var(--res-red);
  text-decoration: none;
}
.res-count a:hover {
  text-decoration: underline;
}
/* Grid */
.res-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
}
.res-grid-card {
  background: var(--res-white);
  border: 1px solid var(--res-border);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: all 0.25s ease;
  overflow: hidden;
}
.res-grid-card:hover {
  border-color: var(--res-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0,0,0,0.06);
}
.res-grid-thumb {
  aspect-ratio: 3/4;
  overflow: hidden;
  background: var(--res-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}
.res-grid-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.res-grid-thumb--placeholder {
  aspect-ratio: 3/4;
}
.res-grid-info {
  padding: 1rem 1.2rem 1.2rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.res-grid-info h3 {
  font-family: var(--res-font-serif);
  font-size: 1rem;
  font-weight: 700;
  color: var(--res-dark);
  margin: 0.3rem 0 0.4rem 0;
  line-height: 1.35;
}
.res-grid-meta {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--res-light);
}
.res-grid-excerpt {
  font-size: 0.82rem;
  color: var(--res-muted);
  line-height: 1.6;
  margin: 0.5rem 0 0 0;
}
/* Mini badges (used in grid + related) */
.res-mini-badge {
  display: inline-block;
  font-size: 0.55rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  font-weight: 600;
  width: fit-content;
}
.res-mini-badge--free {
  background: var(--res-green-bg);
  color: var(--res-green);
}
.res-mini-badge--member {
  background: var(--res-blue-bg);
  color: var(--res-blue);
}
.res-mini-badge--premium {
  background: var(--res-dark);
  color: var(--res-gold);
}
.res-mini-badge--purchase {
  background: var(--res-rust-bg);
  color: var(--res-rust);
}
.res-mini-badge--paid {
  background: var(--res-rust-bg);
  color: var(--res-rust);
}
/* Pagination */
.res-pagination {
  text-align: center;
  margin-top: 3rem;
}
.res-pagination a,
.res-pagination span {
  display: inline-block;
  padding: 0.5rem 0.9rem;
  margin: 0 0.15rem;
  font-size: 0.82rem;
  color: var(--res-muted);
  text-decoration: none;
  border: 1px solid var(--res-border);
  transition: all 0.2s;
}
.res-pagination a:hover {
  background: var(--res-dark);
  color: var(--res-white);
  border-color: var(--res-dark);
}
.res-pagination .current {
  background: var(--res-dark);
  color: var(--res-white);
  border-color: var(--res-dark);
}
/* Empty state */
.res-empty {
  text-align: center;
  padding: 4rem 0;
  color: var(--res-muted);
}
/* ═══════════════════════════════════════════
   SINGLE RESOURCE PAGE
   ═══════════════════════════════════════════ */
.res-single {
  padding: 2rem 0 4rem;
}
.res-single-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
/* Breadcrumb */
.res-breadcrumb {
  font-size: 0.75rem;
  color: var(--res-light);
  margin-bottom: 2rem;
  letter-spacing: 0.04em;
}
.res-breadcrumb a {
  color: var(--res-muted);
  text-decoration: none;
}
.res-breadcrumb a:hover {
  color: var(--res-dark);
}
.res-breadcrumb-sep {
  margin: 0 0.4rem;
}
/* Layout */
.res-single-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin-bottom: 4rem;
}
/* Preview (left) */
.res-single-preview {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.res-cover-img {
  border: 1px solid var(--res-border);
  overflow: hidden;
  background: var(--res-bg);
}
.res-cover-img img {
  width: 100%;
  height: auto;
  display: block;
}
.res-preview-gallery {
  margin-top: 0.5rem;
}
.res-preview-heading {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--res-light);
  margin: 0 0 0.8rem 0;
}
.res-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
}
.res-preview-thumb {
  border: 1px solid var(--res-border);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s;
}
.res-preview-thumb:hover {
  border-color: var(--res-dark);
}
.res-preview-thumb img {
  width: 100%;
  height: auto;
  display: block;
}
/* Details (right) */
.res-single-details {
  display: flex;
  flex-direction: column;
}
.res-single-badge {
  display: inline-block;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.3rem 0.7rem;
  font-weight: 600;
  width: fit-content;
  margin-bottom: 1rem;
}
.res-single-badge--free {
  background: var(--res-green-bg);
  color: var(--res-green);
}
.res-single-badge--member {
  background: var(--res-blue-bg);
  color: var(--res-blue);
}
.res-single-badge--premium {
  background: var(--res-dark);
  color: var(--res-gold);
}
.res-single-badge--purchase {
  background: var(--res-rust-bg);
  color: var(--res-rust);
}
.res-single-badge--paid {
  background: var(--res-rust-bg);
  color: var(--res-rust);
}
.res-single-title {
  font-family: var(--res-font-serif);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--res-dark);
  margin: 0 0 1rem 0;
  line-height: 1.25;
}
/* Tags */
.res-single-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
}
.res-tag {
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  background: var(--res-bg);
  color: var(--res-muted);
  border: 1px solid var(--res-border);
}
/* Description */
.res-single-desc {
  font-size: 0.95rem;
  color: var(--res-text);
  line-height: 1.8;
  margin-bottom: 2rem;
}
.res-single-desc p {
  margin: 0 0 1rem 0;
}
/* Action button */
.res-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  font-weight: 600;
  font-family: inherit;
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
  width: 100%;
  margin-bottom: 2rem;
}
.res-action-btn--free {
  background: var(--res-dark);
  color: var(--res-white);
}
.res-action-btn--free:hover {
  background: #000;
  color: var(--res-white);
}
.res-action-btn--member {
  background: var(--res-blue);
  color: var(--res-white);
}
.res-action-btn--member:hover {
  background: #143d55;
}
.res-action-btn--paid,
.res-action-btn--purchase,
.res-action-btn--premium {
  background: var(--res-red);
  color: var(--res-white);
}
.res-action-btn--paid:hover,
.res-action-btn--purchase:hover,
.res-action-btn--premium:hover {
  background: #a63000;
}
/* Details table */
.res-details-table {
  background: var(--res-bg);
  border: 1px solid var(--res-border);
  padding: 1.2rem;
}
.res-details-table table {
  width: 100%;
  border-collapse: collapse;
}
.res-details-table td {
  padding: 0.4rem 0;
  font-size: 0.85rem;
  color: var(--res-dark);
  vertical-align: top;
}
.res-details-table td:first-child {
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--res-light);
  width: 100px;
  padding-top: 0.5rem;
}
/* ── Related Resources ── */
.res-related {
  border-top: 1px solid var(--res-border);
  padding-top: 3rem;
}
.res-related-heading {
  font-family: var(--res-font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--res-dark);
  margin: 0 0 1.5rem 0;
}
.res-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.2rem;
}
.res-related-card {
  background: var(--res-white);
  border: 1px solid var(--res-border);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: all 0.25s ease;
}
.res-related-card:hover {
  border-color: var(--res-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}
.res-related-thumb {
  aspect-ratio: 3/4;
  overflow: hidden;
  background: var(--res-bg);
}
.res-related-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.res-related-info {
  padding: 0.8rem 1rem;
}
.res-related-info h4 {
  font-family: var(--res-font-serif);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--res-dark);
  margin: 0.3rem 0 0.2rem 0;
  line-height: 1.3;
}
.res-related-meta {
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--res-light);
}
/* ── Payment Modal ── */
.r-modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  z-index: 99999;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(3px);
}
.r-modal-overlay.active {
  display: flex;
}
.r-modal {
  background: var(--res-white);
  max-width: 480px;
  width: 90%;
  padding: 2.5rem;
  position: relative;
}
.r-modal-close {
  position: absolute;
  top: 1rem; right: 1.2rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #999;
}
.r-modal-close:hover {
  color: var(--res-dark);
}
.r-modal h3 {
  font-family: var(--res-font-serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--res-dark);
  margin: 0 0 0.4rem 0;
}
.r-modal .r-modal-sub {
  font-size: 0.85rem;
  color: var(--res-muted);
  margin-bottom: 1.8rem;
  line-height: 1.6;
}
.r-pay-details {
  background: var(--res-bg);
  border: 1px solid var(--res-border);
  padding: 1.4rem;
  margin-bottom: 1.5rem;
}
.r-pay-details table {
  width: 100%;
  border-collapse: collapse;
}
.r-pay-details td {
  padding: 0.45rem 0;
  font-size: 0.88rem;
  color: var(--res-dark);
  vertical-align: top;
}
.r-pay-details td:first-child {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--res-light);
  width: 120px;
  padding-top: 0.55rem;
}
.r-pay-note {
  background: #fdf6f0;
  border-left: 3px solid var(--res-red);
  padding: 1rem 1.2rem;
  font-size: 0.88rem;
  color: #5a3e2b;
  line-height: 1.7;
}
.r-pay-note a {
  color: var(--res-red);
  font-weight: 600;
  text-decoration: none;
}
.r-pay-note a:hover {
  text-decoration: underline;
}
/* ── Responsive ── */
@media (max-width: 768px) {
  .res-single-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .res-single-title {
    font-size: 1.5rem;
  }
  .res-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
  }
  .res-archive-title {
    font-size: 1.7rem;
  }
  .res-preview-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .res-related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .res-filter-group {
    flex-direction: column;
    align-items: center;
  }
  .res-filter-label {
    text-align: center;
    min-width: auto;
    margin-bottom: 0.2rem;
  }
}

/* ═══════════════════════════════════════════
   NAV DROPDOWN & SWPM STYLES
   ═══════════════════════════════════════════ */
.main-nav .menu-item-270 {
  position: relative;
}
.main-nav .menu-item-270 .sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  z-index: 9999;
  min-width: 220px;
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
  list-style: none;
  padding: 8px 0;
  margin: 0;
}
.main-nav .menu-item-270:hover .sub-menu {
  display: block;
}
.main-nav .sub-menu .menu-item {
  display: block;
}
.main-nav .sub-menu .menu-item a {
  display: block;
  padding: 8px 20px;
  color: #1a1a1a;
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;
}
.main-nav .sub-menu .menu-item a:hover {
  background: #f5f5f5;
}
.swpm-registration-widget input[type="text"],
.swpm-registration-widget input[type="email"],
.swpm-registration-widget input[type="password"],
#swpm-registration-form input[type="text"],
#swpm-registration-form input[type="email"],
#swpm-registration-form input[type="password"],
.swpm_registration_widget input[type="text"],
.swpm_registration_widget input[type="email"],
.swpm_registration_widget input[type="password"] {
    padding: 14px 15px !important;
    font-size: 16px !important;
    border: 1px solid #ccc !important;
    border-radius: 4px !important;
    height: auto !important;
}
.swpm-registration-widget input[type="submit"],
#swpm-registration-form input[type="submit"],
.swpm_registration_widget input[type="submit"] {
    padding: 14px 30px !important;
    font-size: 16px !important;
    background-color: #333 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 4px !important;
    cursor: pointer !important;
}
.swpm-login-widget input[type="text"],
.swpm-login-widget input[type="password"],
#swpm-login-form input[type="text"],
#swpm-login-form input[type="password"] {
    padding: 14px 15px !important;
    font-size: 16px !important;
    border: 1px solid #ccc !important;
    border-radius: 4px !important;
    height: auto !important;
    width: 100% !important;
    max-width: 500px !important;
}
.swpm-login-widget input[type="submit"],
#swpm-login-form input[type="submit"] {
    padding: 14px 30px !important;
    font-size: 16px !important;
    background-color: #333 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 4px !important;
    cursor: pointer !important;
}
.entry-content, .post-content, article .content, .single-post .content, .wp-block-post-content {
  padding-left: 20px !important;
  padding-right: 20px !important;
}
.res-single-title {
  text-align: center;
}