/**
 * XMF Portal Frontend Styles
 * Page layout, content areas, widget areas, and responsive grid.
 */

:root {
  --portal-bg:         #f6f8f7;
  --portal-surface:    #ffffff;
  --portal-soft:       #ecf3f1;
  --portal-primary:    #0f766e;
  --portal-primary-dk: #0b4e4b;
  --portal-accent:     #ef8354;
  --portal-text:       #1f2933;
  --portal-muted:      #6b7280;
  --portal-border:     #d6e2df;
  --portal-shadow:     0 14px 30px rgba(15, 59, 66, 0.09);
  --portal-radius:     14px;
}

/* =========================================================
   Page Wrapper
   ========================================================= */
.portal-page {
  max-width: 1200px;
  margin: 1.25rem auto;
  padding: 0.75rem;
  color: var(--portal-text);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  background: var(--portal-bg);
  border-radius: calc(var(--portal-radius) + 4px);
}

/* =========================================================
   Content Layout
   ========================================================= */
.portal-content {
  margin-top: 1rem;
}

/* Two-column layout only when sidebar is present */
.portal-content--with-sidebar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 1rem;
}

.portal-main {
  min-width: 0;
}

.portal-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* =========================================================
   Content Panel
   ========================================================= */
.portal-panel {
  background: var(--portal-surface);
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-radius);
  box-shadow: var(--portal-shadow);
  padding: 1rem;
}

.portal-panel__title {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
  color: var(--portal-text);
}

/* =========================================================
   Page Body
   ========================================================= */
.portal-body {
  line-height: 1.72;
  color: #33404a;
}

.portal-body h2 {
  font-size: 1.5rem;
  margin: 1.5rem 0 0.5rem;
}

.portal-body h3 {
  font-size: 1.2rem;
  margin: 1.25rem 0 0.4rem;
}

/* =========================================================
   Page Meta
   ========================================================= */
.portal-meta {
  color: var(--portal-muted);
  font-size: 0.84rem;
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
}

/* =========================================================
   Page Listing
   ========================================================= */
.portal-page-list {
  display: grid;
  gap: 0.75rem;
}

.portal-page-card {
  background: var(--portal-surface);
  border: 1px solid var(--portal-border);
  border-radius: 12px;
  padding: 0.85rem;
  box-shadow: var(--portal-shadow);
}

.portal-page-card h3 {
  margin: 0.35rem 0 0.4rem;
  font-size: 1.15rem;
  line-height: 1.2;
}

.portal-page-card a {
  color: var(--portal-primary-dk);
  text-decoration: none;
}

.portal-page-card a:hover {
  color: var(--portal-primary);
}

.portal-read-more {
  display: inline-flex;
  align-items: center;
  font-weight: 700;
  color: var(--portal-primary);
}

.portal-read-more::after {
  content: " \2192";
}

/* =========================================================
   Hero Section (full-width)
   ========================================================= */
.portal-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.2rem;
  border-radius: var(--portal-radius);
  background: linear-gradient(130deg, #13363b 0%, #1d5b62 50%, #2e8a7e 100%);
  color: #f5f9f8;
  box-shadow: var(--portal-shadow);
}

.portal-hero h2 {
  margin: 0;
  font-family: "Palatino Linotype", "Book Antiqua", serif;
  font-size: clamp(1.7rem, 2.8vw, 2.2rem);
  line-height: 1.15;
  color: inherit;
}

.portal-hero p {
  margin: 0.55rem 0 0;
  opacity: 0.96;
}

/* =========================================================
   Back Navigation
   ========================================================= */
.portal-nav-back {
  margin-top: 1rem;
  padding-top: 0.7rem;
  color: var(--portal-muted);
  font-size: 0.85rem;
}

.portal-nav-back a {
  color: var(--portal-primary);
  text-decoration: none;
}

.portal-nav-back a:hover {
  color: var(--portal-primary-dk);
}

/* =========================================================
   Widget Area Placeholders
   ========================================================= */
.portal-widget-area {
  margin-bottom: 1rem;
}

.portal-widget-area--header {
  margin-bottom: 1rem;
}

.portal-widget-area--footer {
  margin-top: 1rem;
}

/* =========================================================
   Pagination
   ========================================================= */
.portal-pagination {
  margin-top: 0.95rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.portal-pagination a,
.portal-page-info {
  border: 1px solid var(--portal-border);
  border-radius: 999px;
  padding: 0.42rem 0.72rem;
  background: var(--portal-surface);
  color: var(--portal-primary-dk);
  font-size: 0.84rem;
}

/* =========================================================
   Testimonial Widget
   ========================================================= */
.testimonial {
  background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
  border-left: 4px solid #0f766e;
  border-radius: 0 12px 12px 0;
  padding: 1.25rem 1.5rem;
  margin: 1.2rem 0;
}

.testimonial-text {
  font-style: italic;
  font-size: 1.1rem;
  line-height: 1.6;
  color: #1f2933;
  margin: 0 0 0.75rem;
  padding: 0;
  border: none;
  quotes: "\201C" "\201D";
}

.testimonial-text::before {
  content: open-quote;
  font-size: 1.5rem;
  color: #0f766e;
  font-weight: 700;
}

.testimonial-text::after {
  content: close-quote;
  font-size: 1.5rem;
  color: #0f766e;
  font-weight: 700;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.testimonial-name {
  font-weight: 700;
  color: #0b4e4b;
}

.testimonial-role {
  color: #6b7280;
}

.testimonial-role::before {
  content: "— ";
}

.testimonial-image {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid #d1fae5;
}

.testimonial-image--placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #d1fae5;
  color: #6b9e94;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid #a7f3d0;
}

.testimonial-image--placeholder svg {
  width: 28px;
  height: 28px;
}

/* =========================================================
   Alert Widget
   ========================================================= */
.alert {
  padding: 0.85rem 1rem;
  border-radius: 10px;
  margin: 1rem 0;
  font-size: 0.95rem;
}

.alert-info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}

.alert-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.alert-warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.alert-danger {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

/* =========================================================
   Hero Banner Widget
   ========================================================= */
.hero-banner {
  background: linear-gradient(130deg, #13363b 0%, #1d5b62 50%, #2e8a7e 100%);
  color: #f5f9f8;
  padding: 2.5rem 2rem;
  border-radius: 14px;
  margin: 1rem 0;
  text-align: center;
}

.hero-banner h2 {
  font-family: "Palatino Linotype", "Book Antiqua", serif;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  margin: 0 0 0.5rem;
  color: inherit;
}

.hero-banner p {
  font-size: 1.1rem;
  opacity: 0.9;
  margin: 0 0 1.2rem;
}

.hero-banner .cta-btn {
  display: inline-block;
  background: #ef8354;
  color: #fff;
  padding: 0.6rem 1.5rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  transition: background 0.15s;
}

.hero-banner .cta-btn:hover {
  background: #e06b3a;
}

/* =========================================================
   CTA Widget
   ========================================================= */
.cta-banner {
  background: linear-gradient(135deg, #0f766e, #0b4e4b);
  color: #fff;
  padding: 2rem;
  border-radius: 14px;
  text-align: center;
  margin: 1.5rem 0;
}

.cta-banner h3 {
  font-size: 1.4rem;
  margin: 0 0 0.75rem;
  color: inherit;
}

.cta-banner .cta-btn {
  display: inline-block;
  background: #ef8354;
  color: #fff;
  padding: 0.6rem 1.5rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
}

/* =========================================================
   No Pages Message
   ========================================================= */
.portal-no-pages {
  text-align: center;
  color: var(--portal-muted);
  background: var(--portal-surface);
  border: 1px dashed var(--portal-border);
  border-radius: 12px;
  padding: 1.15rem;
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 900px) {
  .portal-content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .portal-hero {
    flex-direction: column;
    align-items: flex-start;
  }
}
