
/* =========================================
   1. RESET & VARIABLES
   ========================================= */
:root {
  /* Colors */
  --primary-color: #fa5300;
  --primary-hover: #ff6b26;
  --secondary-color: #0f172a;
  --text-main: #334155;
  --text-light: #64748b;
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
  --success-color: #10b981;
  --accent-blue: #0ea5e9;

  /* Typography */
  --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-size-base: 16px;
  --line-height-base: 1.6;

  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.3s ease-in-out;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: var(--font-size-base);
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: var(--line-height-base);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent-blue);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* =========================================
   2. LAYOUT & CONTAINERS
   ========================================= */
.container,
.grid-container {
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--spacing-md);
  padding-right: var(--spacing-md);
}

.site {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* =========================================
   3. HEADER AREA
   ========================================= */
.site-header {
  background-color: var(--bg-card);
  box-shadow: var(--shadow-sm);
  padding: var(--spacing-md) 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.inside-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-md);
}

.site-logo {
  flex-shrink: 0;
}

.header-image {
  max-height: 60px;
  width: auto;
  transition: transform var(--transition-base);
}

.site-logo:hover .header-image {
  transform: scale(1.05);
}

.header-widget {
  display: flex;
  align-items: center;
}

/* Header Buttons */
.wp-block-buttons {
  display: flex;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
}

.wp-block-button__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75em 1.5em;
  font-weight: 600;
  font-size: 1rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-base);
  border: 1px solid transparent;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Specific button styles from HTML inline overrides */
.wp-block-button__link.has-background {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  color: #fff;
  border: none;
}

.wp-block-button__link:not(.has-background) {
  background-color: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

.wp-block-button__link:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.wp-block-button__link:active {
  transform: translateY(0);
}

/* =========================================
   4. CONTENT AREA
   ========================================= */
.site-content {
  padding-top: var(--spacing-xl);
  padding-bottom: var(--spacing-xl);
}

.inside-article {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 5vw, 3rem);
  box-shadow: var(--shadow-sm);
}

/* Article Typography */
.entry-title {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 800;
  color: var(--secondary-color);
  margin-bottom: var(--spacing-lg);
  line-height: 1.2;
}

.entry-content p {
  margin-bottom: var(--spacing-md);
  color: var(--text-main);
  font-size: 1.1rem;
}

.entry-content h2,
.wp-block-heading {
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--secondary-color);
  margin-top: var(--spacing-xl);
  margin-bottom: var(--spacing-md);
  font-weight: 700;
  position: relative;
  padding-left: var(--spacing-md);
}

.entry-content h2::before,
.wp-block-heading::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10%;
  bottom: 10%;
  width: 4px;
  background: var(--primary-color);
  border-radius: var(--radius-full);
}

/* Lists */
.entry-content ul {
  list-style: none;
  margin-bottom: var(--spacing-lg);
  padding-left: 0;
}

.entry-content ul li {
  position: relative;
  padding-left: 2rem;
  margin-bottom: var(--spacing-sm);
}

.entry-content ul li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--success-color);
  font-weight: bold;
  font-size: 1.2em;
}

/* Tables */
.wp-block-table {
  width: 100%;
  margin-bottom: var(--spacing-lg);
  overflow-x: auto;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.wp-block-table table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
}

.wp-block-table td, 
.wp-block-table th {
  padding: var(--spacing-md);
  border: 1px solid var(--border-color);
  text-align: left;
}

.wp-block-table tr:nth-child(even) {
  background-color: #f1f5f9;
}

.wp-block-table tr:hover {
  background-color: #e2e8f0;
}

/* Images within content */
.wp-block-image {
  margin: var(--spacing-lg) 0;
}

.wp-block-image img {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  transition: transform var(--transition-base);
}

.wp-block-image img:hover {
  transform: scale(1.02);
}

/* Special text block (verse) */
.wp-block-verse {
  background-color: #fff7ed;
  border-left: 4px solid var(--primary-color);
  padding: var(--spacing-md);
  border-radius: var(--radius-sm);
  font-style: italic;
  margin: var(--spacing-lg) 0;
  color: var(--secondary-color);
}

/* =========================================
   5. INTERACTIVE ELEMENTS (FAQ)
   ========================================= */
details {
  background: var(--bg-body);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-sm);
  overflow: hidden;
  transition: all var(--transition-base);
}

details[open] {
  background: var(--bg-card);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-color);
}

summary {
  padding: var(--spacing-md);
  font-weight: 600;
  cursor: pointer;
  position: relative;
  list-style: none; /* Hide default arrow */
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--secondary-color);
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: '+';
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--primary-color);
  transition: transform var(--transition-base);
}

details[open] summary::after {
  transform: rotate(45deg);
}

details > div {
  padding: 0 var(--spacing-md) var(--spacing-md);
  color: var(--text-light);
  line-height: 1.6;
  border-top: 1px solid transparent;
}

details[open] > div {
  border-top-color: var(--border-color);
  padding-top: var(--spacing-md);
  animation: fadeIn 0.3s ease-out;
}

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

/* =========================================
   6. BACK TO TOP BUTTON
   ========================================= */
.generate-back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: var(--secondary-color);
  color: #fff;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-base);
  opacity: 0.8;
  z-index: 99;
  box-shadow: var(--shadow-lg);
}

.generate-back-to-top:hover {
  background: var(--primary-color);
  transform: translateY(-5px);
  opacity: 1;
}

.gp-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* =========================================
   7. UTILITIES & ACCESSIBILITY
   ========================================= */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

.screen-reader-text:focus {
  background-color: #f1f1f1;
  border-radius: 3px;
  box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
  clip: auto !important;
  clip-path: none;
  color: #21759b;
  display: block;
  font-size: 14px;
  font-weight: bold;
  height: auto;
  left: 5px;
  line-height: normal;
  padding: 15px 23px 14px;
  text-decoration: none;
  top: 5px;
  width: auto;
  z-index: 100000;
}

/* Footer text */
center div {
  padding: var(--spacing-lg);
  color: var(--text-light);
  font-size: 0.9rem;
}

/* =========================================
   8. MEDIA QUERIES (RESPONSIVE)
   ========================================= */
@media (max-width: 768px) {
  .inside-header {
    flex-direction: column;
    text-align: center;
  }
  
  .header-widget {
    margin-top: var(--spacing-md);
    width: 100%;
    justify-content: center;
  }

  .wp-block-buttons {
    justify-content: center;
    width: 100%;
  }

  .wp-block-button__link {
    width: 100%;
    margin-bottom: var(--spacing-xs);
  }

  .inside-article {
    padding: var(--spacing-md);
  }
  
  /* Make tables scrollable horizontally on mobile */
  .wp-block-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  /* Reset details summary flex for mobile if content is long */
  summary {
    font-size: 0.95rem;
  }
}

/* Note: The Modal styles are handled inline in the HTML as requested by structure, 
   but we ensure global styles don't conflict by scoping properly above. 
   The following ensures any modal overlay sits correctly. */
body.has-modal-open {
  overflow: hidden;
}
