/****************************************************
 * DIGITAL COLLECTION OF GRACE
 * style.css
 *
 * Main job of this file:
 * - Control fonts, spacing, colors, cards, and list pages
 * - Keep the visual style centralized
 ****************************************************/


/****************************************************
 * 1. DESIGN SETTINGS
 ****************************************************/

:root {
  --bg: #ffffff;
  --text: #111111;
  --muted: #666666;
  --border: #dddddd;
  --soft-border: #eeeeee;
  --card: #ffffff;
  --soft-card: #f7f7f7;

  --title-font: "Satisfy", cursive;
  --heading-font: "Bitter", Georgia, serif;
  --body-font: Calibri, Arial, sans-serif;
}


/****************************************************
 * 2. BASIC PAGE SETUP
 ****************************************************/

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body-font);
}

.app {
  max-width: 520px;
  margin: 0 auto;
  padding: 18px 18px 90px;
}


/****************************************************
 * 3. TOP TITLE + SEARCH
 ****************************************************/

.hero {
  text-align: center;
  margin-bottom: 22px;
}

.hero h1 {
  font-family: var(--title-font);
  font-size: 48px;
  line-height: 1.05;
  font-weight: 400;
  margin: 0;
}

.search {
  width: 100%;
  font-size: 20px;
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 26px;
  font-family: var(--body-font);
}

/****************************************************
 * HOME SEARCH + MY LISTS
 ****************************************************/

.home-tools {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 26px;
}

.home-tools .search {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}

.my-lists-button {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;

  padding: 0 14px;

  border: 1px solid var(--border);
  border-radius: 14px;

  background: #ffffff;
  color: var(--text);
  text-decoration: none;

  font-family: var(--heading-font);
  font-size: 17px;
  white-space: nowrap;
}

/****************************************************
 * 4. HOME CATEGORY GRID
 ****************************************************/

.category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 26px 18px;
}

.category-card {
  text-align: center;
  text-decoration: none;
  color: inherit;
}

.category-icon {
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--card);
  overflow: hidden;
  box-shadow: 0 5px 14px rgba(0,0,0,.08);
}

.category-icon img {
  width: 108%;
  height: 108%;
  object-fit: cover;
  display: block;
}

.category-title {
  margin-top: 9px;
  font-family: var(--heading-font);
  font-size: 22px;
  line-height: 1.12;
}


/****************************************************
 * 5. LIST PAGE LAYOUT
 *
 * Used for:
 * - Category pages
 * - Collection pages
 * - Search results
 ****************************************************/

.list-page {
  display: block;
  max-width: 960px;
  margin: 0 auto;
}

.page-header {
  margin-top: 24px;
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 38px;
  height: 38px;

  margin-bottom: 22px;
  margin-right: 10px;

  border: 1px solid var(--border);
  border-radius: 50%;

  font-size: 24px;
  color: var(--text);
  text-decoration: none;
}

.home-link {
  margin-left: 4px;
}

.page-header h2 {
  font-family: var(--heading-font);
  font-size: 40px;
  line-height: 1.1;
  margin: 0 0 24px;
}

.page-header h2:empty {
  display: none;
}

.section-title {
  font-family: var(--heading-font);
  font-size: 24px;
  margin: 34px 0 12px;
  color: #333333;
}


/****************************************************
 * 6. LIST ROWS
 *
 * These rows are used for both:
 * - Collections
 * - Prayers/resources
 *
 * They are intentionally card-like so users notice
 * that the whole row is tappable.
 ****************************************************/

.item-row {
  display: flex;
  align-items: center;
  gap: 16px;

  margin: 12px 0;
  padding: 14px;

  background: var(--card);
  border: 1px solid var(--soft-border);
  border-radius: 18px;

  box-shadow:
    0 2px 4px rgba(0,0,0,.05),
    0 8px 18px rgba(0,0,0,.08);

  color: var(--text);
  text-decoration: none;

  transition: transform .18s ease, box-shadow .18s ease;
}

.item-row:hover {
  transform: translateY(-2px);
  box-shadow:
    0 5px 10px rgba(0,0,0,.08),
    0 16px 30px rgba(0,0,0,.13);
}

.item-icon {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  border-radius: 14px;
  background: var(--soft-card);
  overflow: hidden;
}

.item-icon img {
  width: 108%;
  height: 108%;
  object-fit: cover;
  transform: translate(-4%, -4%);
}

.item-text {
  flex: 1;
  min-width: 0;
}

.item-title {
  font-family: var(--heading-font);
  font-size: 23px;
  line-height: 1.18;
}

.item-description {
  margin-top: 5px;
  font-family: var(--body-font);
  font-size: 18px;
  line-height: 1.32;
  color: var(--muted);
}


/****************************************************
 * 7. COLLECTION ROWS
 *
 * app.js will add the class "collection-row"
 * to collection buttons.
 *
 * These should feel like "folders" that open another list.
 ****************************************************/

/* ==========================================
   COLLECTION BUTTONS
   ========================================== */

.collection-row {
  display: flex;
  align-items: center;
  gap: 22px;

  margin: 18px 0;

  padding: 18px;

  background: #ffffff;

  border: 1px solid #d8d8d8;
  border-radius: 18px;

  box-shadow:
      0 2px 5px rgba(0,0,0,.08),
      0 10px 24px rgba(0,0,0,.08);

  transition: .18s;
}

.collection-row:hover {
  transform: translateY(-2px);
  box-shadow:
      0 6px 14px rgba(0,0,0,.10),
      0 18px 36px rgba(0,0,0,.12);
}


/* Left third */

.collection-row .item-icon {

  flex: 0 0 32%;

  width: auto;
  height: auto;

  aspect-ratio: 1;

  border-radius: 18px;

  overflow: hidden;

  background: #f5f5f5;
}


/* Right two thirds */

.collection-row .item-text {

  flex: 1;

  display: flex;
  flex-direction: column;
  justify-content: center;

}


.collection-row .item-title {

  font-size: 30px;

  line-height: 1.1;

  margin-bottom: 8px;

}


.collection-row .item-description {

  font-size: 19px;

  color: #666;

  line-height: 1.35;

}


/****************************************************
 * 8. RESOURCE ROWS
 *
 * app.js will add the class "resource-row"
 * to document/resource buttons.
 *
 * These should still be tappable, but a little quieter
 * than collection rows.
 ****************************************************/

.resource-row {
  min-height: 86px;
}

.resource-row .item-icon {
  width: 52px;
  height: 52px;
  flex-basis: 52px;
}


/****************************************************
 * 9. EMPTY MESSAGES
 ****************************************************/

.empty-message {
  font-family: var(--body-font);
  font-size: 20px;
  color: var(--muted);
  margin-top: 20px;
}

/****************************************************
 * 10. READER / PDF VIEWER
 ****************************************************/

.reader-page {
  display: block;
  max-width: 960px;
  margin: 0 auto;
}

.doc-frame {
  width: 100%;
  height: 75vh;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: white;
}

.graphic-image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
}

.collection-row .item-icon {
  flex: 0 0 33% !important;
  width: 33% !important;
  max-width: 180px;
  aspect-ratio: 1 / 1;
  height: auto !important;
}

.collection-row .item-text {
  flex: 1 1 67%;
}

/****************************************************
 * 11. FOOTER
 ****************************************************/

footer {
  margin-top: 100px;
  padding: 70px 20px;
  text-align: center;
  font-family: var(--body-font);
  color: var(--muted);
  font-size: 16px;
}

.footer-title {
  font-family: var(--heading-font);
  font-size: 22px;
  margin-bottom: 20px;
}

.footer-search {
  margin-bottom: 30px;
}


/****************************************************
 * 12. MY LISTS
 ****************************************************/

.list-action-button {
  appearance: none;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #ffffff;
  color: var(--text);

  padding: 11px 15px;

  font-family: var(--heading-font);
  font-size: 17px;

  cursor: pointer;
}

.list-page-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
}

.danger-button {
  color: #7a1f1f;
}

.saved-list-row {
  display: flex;
  align-items: stretch;

  margin: 12px 0;

  background: var(--card);
  border: 1px solid var(--soft-border);
  border-radius: 18px;

  box-shadow:
    0 2px 4px rgba(0,0,0,.05),
    0 8px 18px rgba(0,0,0,.08);

  overflow: hidden;
}

.saved-list-main {
  display: flex;
  align-items: center;
  gap: 16px;

  flex: 1;
  min-width: 0;

  padding: 14px;

  color: var(--text);
  text-decoration: none;
}

.remove-list-item {
  width: 48px;

  border: 0;
  border-left: 1px solid var(--soft-border);

  background: #ffffff;
  color: var(--muted);

  font-size: 28px;
  cursor: pointer;
}

/****************************************************
 * 13. RESOURCE STAR BUTTON
 ****************************************************/

.resource-row-with-star {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
}

.resource-row-with-star .item-row {
  flex: 1;
  min-width: 0;
  margin: 0;
}

.resource-star-button {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;

  display: flex;
  align-items: center;
  justify-content: center;

  border: 1px solid var(--border);
  border-radius: 50%;

  background: #ffffff;
  color: var(--text);

  font-size: 27px;
  line-height: 1;

  cursor: pointer;
}

.page-nav-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}

.page-nav-row .nav-icon {
  margin: 0;
}

.header-lists-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  height: 38px;
  padding: 0 14px;

  border: 1px solid var(--border);
  border-radius: 19px;

  background: #ffffff;
  color: var(--text);
  text-decoration: none;

  font-family: var(--heading-font);
  font-size: 16px;
  white-space: nowrap;
}

/****************************************************
 * 14. CONTENT VIEW STAR
 ****************************************************/

.content-star-button {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 100%;
  margin: 0 0 18px;
  padding: 11px 16px;

  border: 1px solid var(--border);
  border-radius: 14px;

  background: #ffffff;
  color: var(--text);

  font-family: var(--heading-font);
  font-size: 17px;

  cursor: pointer;
}

/****************************************************
 * 15. SAVED LIST REORDER CONTROLS
 ****************************************************/

.saved-list-controls {
  display: flex;
  flex-direction: column;
  flex: 0 0 42px;

  border-left: 1px solid var(--soft-border);
}

.move-list-item,
.saved-list-controls .remove-list-item {
  flex: 1;
  width: 42px;
  min-height: 32px;

  border: 0;
  background: #ffffff;
  color: var(--text);

  font-size: 18px;
  line-height: 1;

  cursor: pointer;
}

.move-list-item {
  border-bottom: 1px solid var(--soft-border);
}

.saved-list-controls .remove-list-item {
  border-left: 0;
  color: var(--muted);
  font-size: 22px;
}

.move-list-item:disabled {
  opacity: 0.25;
  cursor: default;
}

.saved-list-row.dragging {
  opacity: 0.5;
}

.heart-link {
  font-size: 27px;
}

.content-add-button {
  margin: 0;
  padding: 0;
  font-family: var(--body-font);
  cursor: pointer;
}

.page-nav-row .header-lists-button {
  margin: 0;
}
