/*
Theme Name: Rooted Way Assembly
Author: Rooted Way Assembly
Description: Independent block theme preserving the Assembly's existing site design and content.
Version: 0.1.10
Requires at least: 6.6
Requires PHP: 8.0
License: GNU General Public License v3 or later
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Text Domain: rooted-way-assembly
Tags: full-site-editing, block-patterns, custom-colors, custom-logo, editor-style
*/

/* Print Styles for Study Guides and Web Pages */
@media print {
  /* Hide site navigation, headers, footers, and interactive UI */
  header,
  footer,
  nav,
  .site-header,
  .site-footer,
  .wp-block-navigation,
  .rooted-study-library__filters,
  .rooted-level-switcher,
  .no-print,
  button,
  .wp-block-button {
    display: none !important;
  }

  /* Optimize page layout for standard paper */
  body,
  main,
  .wp-site-blocks,
  .entry-content {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    color: #000000 !important;
    background: #ffffff !important;
    font-size: 11pt !important;
    line-height: 1.5 !important;
  }

  /* Dignified typography and headings */
  h1 {
    font-size: 18pt !important;
    margin-top: 0 !important;
    margin-bottom: 8pt !important;
    page-break-after: avoid;
  }

  h2 {
    font-size: 14pt !important;
    margin-top: 14pt !important;
    margin-bottom: 6pt !important;
    page-break-after: avoid;
  }

  h3 {
    font-size: 12pt !important;
    margin-top: 10pt !important;
    margin-bottom: 4pt !important;
    page-break-after: avoid;
  }

  /* Table formatting for scripture comparisons */
  table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin: 12pt 0 !important;
    page-break-inside: avoid;
  }

  th, td {
    border: 1px solid #999999 !important;
    padding: 6pt 8pt !important;
    font-size: 10pt !important;
    text-align: left !important;
  }

  th {
    background-color: #f2f2f2 !important;
    font-weight: bold !important;
  }

  /* Scripture quotes and blockquotes */
  blockquote {
    border-left: 3px solid #333333 !important;
    margin: 10pt 0 !important;
    padding-left: 10pt !important;
    font-style: italic !important;
    page-break-inside: avoid;
  }

  /* Links */
  a {
    color: #000000 !important;
    text-decoration: underline !important;
  }

  /* Prevent awkward splits */
  p, li {
    orphans: 3;
    widows: 3;
  }
}

/* ==========================================================================
   Rooted Way Study Guides & Curriculum Styles
   ========================================================================== */

.rooted-study-subtitle {
  font-size: 1.25rem;
  font-style: italic;
  color: #555047;
  line-height: 1.45;
  margin: 0.25rem 0 1.25rem 0;
}

.rooted-level-switcher {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: #fbfaf8;
  border: 1px solid #e6e2d8;
  border-radius: 8px;
  padding: 10px 16px;
  margin: 1rem 0 1.5rem 0;
}

.rooted-level-label {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #735238;
}

.rooted-level-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.rooted-level-btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none !important;
  color: #4a453e !important;
  background: #ffffff;
  border: 1px solid #dcd7cc;
  transition: all 0.15s ease-in-out;
}

.rooted-level-btn:hover {
  background: #f0ece1;
  color: #2b2823 !important;
  border-color: #c2bcb0;
}

.rooted-level-btn.is-active {
  background: #1f3a2b !important;
  color: #ffffff !important;
  border-color: #1f3a2b !important;
  cursor: default;
  box-shadow: 0 1px 3px rgba(31, 58, 43, 0.25);
}

.rooted-study-meta-box {
  background: #fcfbf9;
  border: 1px solid #e9e5dc;
  border-left: 4px solid #735238;
  border-radius: 6px;
  padding: 14px 18px;
  margin: 0 0 2rem 0;
  font-size: 0.95rem;
  line-height: 1.6;
}

.rooted-study-meta-box .meta-row {
  margin-bottom: 8px;
  color: #3d3935;
}

.rooted-study-meta-box .meta-row:last-child {
  margin-bottom: 0;
}

.rooted-study-meta-box strong {
  color: #1a1917;
  font-weight: 600;
}

.rooted-study-meta-box a {
  color: #735238;
  text-decoration: underline;
  font-weight: 500;
}

.rooted-study-meta-box a:hover {
  color: #1f3a2b;
}

.table-responsive {
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid #e2ded5;
  border-radius: 6px;
}

.table-responsive table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
}

.table-responsive th,
.table-responsive td {
  padding: 10px 14px;
  border-bottom: 1px solid #e2ded5;
  text-align: left;
}

.table-responsive th {
  background: #f7f6f2;
  font-weight: 600;
  color: #2c2825;
}

/* Global responsive box sizing and viewport overflow control */
html {
  box-sizing: border-box;
}

*, *::before, *::after {
  box-sizing: inherit;
}

html, body {
  max-width: 100%;
  overflow-x: clip;
}

/* Responsive tables inside post content */
.wp-block-table,
.entry-content table,
.wp-block-post-content table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Holy Day & General Action Buttons Mobile Wrapping */
.rwa-holy-day-page {
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
}

.rwa-holy-day-badge {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.rwa-holy-day-badge span {
  display: inline-block;
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
  word-break: break-word;
}

.rwa-holy-day-page p:has(> a.button) {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.rwa-holy-day-page p a.button,
a.button {
  display: inline-block;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0.25rem 0.25rem 0.25rem 0;
  white-space: normal;
  word-break: break-word;
}


/* Front-page "Today at Rooted Way" block (rendered by Rooted Publisher). */
.rwa-today { background: var(--wp--preset--color--base, #F7EADF); padding: var(--wp--preset--spacing--superbspacing-xlarge, 4rem) 16px; }
.rwa-today__inner { max-width: 1200px; margin: 0 auto; }
.rwa-today__eyebrow, .rwa-today__label { margin: 0 0 .35rem; font-size: 13px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--wp--preset--color--primary, #59615F); }
.rwa-today__heading { margin: 0 0 1.5rem; }
.rwa-today__subheading { margin: 2rem 0 1rem; font-size: 20px; }
.rwa-today__grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 600px) { .rwa-today__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .rwa-today__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.rwa-today__card { background: var(--wp--preset--color--contrast-light, #FFFFFF); border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.rwa-today__media { margin: 0; position: relative; }
.rwa-today__media img { display: block; width: 100%; height: 220px; object-fit: cover; }
.rwa-today__body { padding: 1rem 1.25rem 1.25rem; }
.rwa-today__title { margin: 0 0 .5rem; font-size: 20px; line-height: 1.3; overflow-wrap: anywhere; }
.rwa-today__title a { color: inherit; }
/* The whole card opens the card's link (its Facebook post, or the YouTube video). */
.rwa-today__card { position: relative; }
.rwa-today__title a::after { content: ""; position: absolute; inset: 0; }
.rwa-today__card:hover .rwa-today__title a, .rwa-today__title a:focus-visible { text-decoration: underline; }
.rwa-today__reference { margin: 0 0 .5rem; font-style: italic; font-size: 14px; }
.rwa-today__text { margin: 0; font-size: 15px; line-height: 1.55; }
.rwa-today__service { background: var(--wp--preset--color--contrast-light, #FFFFFF); border-left: 4px solid var(--wp--preset--color--primary, #59615F); border-radius: 8px; padding: 1.5rem; }
.rwa-today__service-title { margin: 0 0 .75rem; font-size: 26px; overflow-wrap: anywhere; }
.rwa-today__service-title a { color: inherit; }
.rwa-today__lineup { margin: 1rem 0; padding-left: 1.25rem; line-height: 1.6; }
.rwa-today__button { display: inline-block; padding: .75rem 1.5rem; border-radius: 4px; background: var(--wp--preset--color--primary, #59615F); color: #fff; text-decoration: none; font-weight: 600; }
.rwa-today__button:hover, .rwa-today__button:focus { background: var(--wp--preset--color--primary-hover, #432812); color: #fff; }
