/*
Theme Name: Action Prayers
Description: A warm, handwritten-style theme for Action Prayers — prayers for the moment you're in.
Version: 1.0
Author: Action Prayers
*/

:root{
  --ap-paper: #F7EFDF;
  --ap-card: #FFFBF2;
  --ap-ink: #4A3B2E;
  --ap-ink-soft: #8A7A66;
  --ap-accent: #C97A5C;
  --ap-sage: #7C9473;
  --ap-line: #E5D9C0;
  --ap-dark: #2E241A;
}

html[data-ap-mode="dark"]{
  --ap-paper: #201810;
  --ap-card: #2A2118;
  --ap-ink: #EFE4D2;
  --ap-ink-soft: #B3A387;
  --ap-sage: #9BB693;
  --ap-line: #473A2A;
  --ap-dark: #17110B;
}
html[data-ap-mode="dark"] body{ background: var(--ap-paper); }

*{ box-sizing: border-box; }
body{
  background: var(--ap-paper);
  color: var(--ap-ink);
  font-family: 'Nunito', sans-serif;
  line-height: 1.6;
  margin: 0;
  transition: background .25s ease, color .25s ease;
}
a{ color: inherit; }
img{ max-width: 100%; }

.ap-wrap{ max-width: 980px; margin: 0 auto; padding: 0 32px; }

/* Header */
.ap-site-header{
  display:flex; justify-content:space-between; align-items:center;
  padding: 28px 0; border-bottom: 1px solid var(--ap-line);
}
.ap-logo{
  font-family:'Caveat', cursive; font-weight: 600; font-size: 30px; color: var(--ap-ink);
  text-decoration:none;
}
.ap-nav ul{ list-style:none; display:flex; gap:28px; margin:0; padding:0; }
.ap-nav a{ font-size:14px; font-weight:600; color: var(--ap-ink-soft); text-decoration:none; }
.ap-nav a:hover{ color: var(--ap-accent); }
.ap-menu-toggle{ display:none; background:none; border:none; font-size:24px; color: var(--ap-ink); cursor:pointer; }

/* Hero */
.ap-hero{ padding: 46px 0 20px; }
.ap-hero-inner{ max-width: 560px; }
.ap-greeting{ font-family:'Caveat', cursive; font-size: 30px; color: var(--ap-accent); margin-bottom: 6px; }
.ap-h1{ font-family:'Caveat', cursive; font-weight:600; font-size: 46px; line-height:1.3; margin: 0 0 18px; }
.ap-hero p{ color: var(--ap-ink-soft); font-size:16px; margin-bottom: 24px; max-width: 460px; }
.ap-signoff{ font-family:'Caveat', cursive; font-size: 22px; color: var(--ap-ink-soft); }

/* Moments */
.ap-section-label{ font-family:'Caveat', cursive; font-weight:600; font-size:30px; margin-top: 60px; margin-bottom: 4px; }
.ap-section-sub{ color: var(--ap-ink-soft); font-size:14px; margin-bottom:28px; }
.ap-moments{ display:grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap:14px; padding-bottom: 10px; }
.ap-moment{ background: var(--ap-card); border: 1px solid var(--ap-line); border-radius: 10px; padding: 22px 24px; box-shadow: 2px 3px 0 var(--ap-line); text-decoration:none; display:block; }
.ap-moment h3{ font-family:'Caveat', cursive; font-weight:600; font-size:22px; margin: 0 0 4px; color: var(--ap-accent); }
.ap-moment p{ font-size:13.5px; color: var(--ap-ink-soft); margin:0; }

/* Prayer / letter */
.ap-letter{ background: var(--ap-card); border: 1px solid var(--ap-line); border-radius: 4px; padding: 46px 52px; margin: 50px 0; box-shadow: 4px 6px 0 var(--ap-line); background-image: repeating-linear-gradient(to bottom, transparent, transparent 34px, var(--ap-line) 35px); background-position: 0 96px; }
.ap-letter-head{ display:flex; justify-content:space-between; align-items:baseline; margin-bottom: 26px; flex-wrap:wrap; gap:6px; }
.ap-letter-tag{ font-size:12px; letter-spacing:1px; text-transform:uppercase; color: var(--ap-sage); font-weight:600; }
.ap-letter-date{ font-size:13px; color: var(--ap-ink-soft); }
.ap-letter h1, .ap-letter h2{ font-family: 'Caveat', cursive; font-weight:600; font-size: 36px; margin: 0 0 20px; }
.ap-body{ font-family: 'Caveat', cursive; font-size: 24px; line-height:1.45; max-width: 600px; }
.ap-body p{ margin: 0 0 6px; }
.ap-verse{ margin-top: 26px; padding-top: 22px; border-top: 1px dashed var(--ap-line); font-style: italic; font-size: 15px; color: var(--ap-sage); max-width: 480px; }
.ap-verse-mark{ font-family:'Caveat', cursive; font-size: 22px; color: var(--ap-accent); margin-right: 2px; font-style: normal; }
.ap-verse-ref{ display:block; margin-top: 6px; font-style: normal; font-weight: 600; font-size: 12px; letter-spacing: 0.5px; text-transform: uppercase; color: var(--ap-ink-soft); }
.ap-letter-footer{ display:flex; justify-content:space-between; align-items:center; margin-top: 30px; padding-top:18px; flex-wrap:wrap; gap:12px; }
.ap-used-by{ font-size:13px; color: var(--ap-ink-soft); }
.ap-share-btn{ background: var(--ap-accent); border:none; color:#FFFBF2; font-family:'Nunito', sans-serif; font-size:13px; font-weight:600; padding:11px 20px; border-radius:999px; cursor:pointer; }

/* Browse grid */
.ap-browse{ padding: 10px 0 40px; }
.ap-head h1{ font-family:'Caveat', cursive; font-weight:600; font-size: 38px; margin: 0 0 6px; }
.ap-head p{ color: var(--ap-ink-soft); font-size:15px; margin:0; }
.ap-filters{ display:flex; gap:10px; margin: 24px 0 30px; overflow-x:auto; padding-bottom: 6px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.ap-filters::-webkit-scrollbar{ display:none; }
.ap-filter{ font-size:13px; font-weight:600; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--ap-line); background: var(--ap-card); color: var(--ap-ink-soft); cursor:pointer; white-space:nowrap; flex-shrink:0; transition: background .15s ease, color .15s ease, border-color .15s ease; }
.ap-filter.active{ background: var(--ap-accent); color:#FFFBF2; border-color: var(--ap-accent); }
.ap-grid{ display:grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.ap-card{
  position: relative;
  perspective: 1200px;
  min-height: 220px;
  text-decoration: none;
  display: block;
  cursor: pointer;
}
.ap-card.ap-hidden{ display:none; }
.ap-card-flip{
  position: relative;
  width: 100%; height: 100%;
  transform-style: preserve-3d;
  transition: transform .55s cubic-bezier(.4,.2,.2,1);
}
.ap-card:hover .ap-card-flip,
.ap-card:focus-within .ap-card-flip{ transform: translateY(-5px) rotateY(180deg); }
.ap-card.ap-flipped .ap-card-flip{ transform: rotateY(180deg); }
.ap-card-face{
  position: absolute; inset: 0;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  background: var(--ap-card);
  border-radius: 14px;
  padding: 28px 24px 24px;
  display:flex; flex-direction:column;
  color: var(--ap-ink);
  box-shadow:
    0 1px 0 var(--ap-line),
    0 3px 0 var(--ap-line),
    0 4px 10px rgba(0,0,0,0.10),
    0 10px 18px rgba(0,0,0,0.06);
  border: 1px solid var(--ap-line);
}
.ap-card-face::before{
  content: '';
  position: absolute; inset: 7px;
  border: 1px solid var(--ap-line);
  border-radius: 9px;
  pointer-events: none;
  opacity: 0.65;
}
.ap-card-front{ border-top: 4px solid var(--ap-accent); }
.ap-card-front .ap-quote-mark{
  font-family: 'Caveat', cursive;
  font-size: 46px;
  line-height: 1;
  color: var(--ap-line);
  position: absolute;
  top: 12px;
  right: 20px;
}
.ap-card-front .ap-tag{ font-size:11px; letter-spacing:0.6px; text-transform:uppercase; color: var(--ap-sage); font-weight:600; margin-bottom:12px; }
.ap-card-front h3{ font-family:'Caveat', cursive; font-weight:600; font-size:23px; margin:0 0 8px; line-height:1.2; max-width: 85%; }
.ap-card-front p{ font-size:13.5px; color: var(--ap-ink-soft); margin:0 0 14px; flex-grow:1; }
.ap-card .ap-card-foot{ display:flex; justify-content:space-between; align-items:center; font-size:12px; color: var(--ap-ink-soft); border-top: 1px dashed var(--ap-line); padding-top: 12px; }
.ap-card .ap-card-arrow{ font-family:'Caveat', cursive; font-size:18px; color: var(--ap-accent); font-weight:600; }
.ap-card-back{
  transform: rotateY(180deg);
  justify-content:center; align-items:center; text-align:center;
  border-top: 4px solid var(--ap-sage);
  background-image: radial-gradient(var(--ap-line) 0.6px, transparent 0.6px);
  background-size: 14px 14px;
  background-position: center;
}
.ap-card-back .ap-tag{ font-size:11px; letter-spacing:0.6px; text-transform:uppercase; color: var(--ap-sage); font-weight:600; margin-bottom:10px; }
.ap-card-back .ap-back-verse{ font-family:'Caveat', cursive; font-size:19px; line-height:1.35; color: var(--ap-ink); margin-bottom: 10px; background: var(--ap-card); padding: 6px 10px; border-radius: 6px; }
.ap-card-back .ap-back-ref{ font-size:11px; letter-spacing:0.5px; text-transform:uppercase; color: var(--ap-ink-soft); font-weight:600; margin-bottom: 14px; }
.ap-card-back .ap-back-cta{ font-family:'Caveat', cursive; font-size:16px; color: var(--ap-accent); font-weight:600; }
.ap-empty{ text-align:center; padding: 40px 0; color: var(--ap-ink-soft); font-family:'Caveat', cursive; font-size:22px; }

/* Reader: mode switcher + shuffle */
.ap-reader-controls{ display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:14px; margin: 24px 0 30px; }
.ap-mode-toggle{ display:flex; gap:4px; background: var(--ap-card); border: 1px solid var(--ap-line); border-radius: 999px; padding: 3px; }
.ap-mode-btn{ font-size:13px; font-weight:600; padding: 7px 16px; border-radius: 999px; border:none; background:transparent; color: var(--ap-ink-soft); cursor:pointer; }
.ap-mode-btn.ap-active{ background: var(--ap-accent); color:#FFFBF2; }
.ap-shuffle-btn{ display:flex; align-items:center; gap:6px; font-family:'Caveat', cursive; font-size:18px; font-weight:600; color: var(--ap-accent); background:transparent; border: 1px dashed var(--ap-accent); border-radius: 999px; padding: 7px 18px; cursor:pointer; }
.ap-shuffle-btn:hover{ background: var(--ap-accent); color:#FFFBF2; border-style:solid; }
.ap-reader-view{ display:none; }
.ap-reader-view.ap-shown{ display:block; }

/* Flip-card deck */
.ap-deck{ margin: 50px 0; }
.ap-deck-head{ margin-bottom: 22px; }
.ap-deck-head h2{ font-family:'Caveat', cursive; font-weight:600; font-size: 30px; margin: 0 0 4px; }
.ap-deck-head p{ color: var(--ap-ink-soft); font-size:14px; margin:0; }

.ap-deck-stage{ position:relative; height: 360px; perspective: 1400px; cursor: grab; }
.ap-deck-stage.ap-dragging{ cursor: grabbing; }
.ap-deck-stage.ap-dragging .ap-flipcard{ transition: none; }
.ap-flipcard{
  position:absolute; inset:0;
  opacity:0; pointer-events:none;
  transform: translateX(24px) scale(.96);
  transition: opacity .35s ease, transform .35s ease;
}
.ap-flipcard.ap-active{ opacity:1; pointer-events:auto; transform: translateX(0) scale(1); }
.ap-flipcard.ap-leaving{ transform: translateX(-24px) scale(.96); }

.ap-flip-inner{
  position:relative; width:100%; height:100%;
  transition: transform .6s cubic-bezier(.4,.2,.2,1);
  transform-style: preserve-3d;
  cursor:pointer;
}
.ap-flipcard.ap-flipped .ap-flip-inner{ transform: rotateY(180deg); }

.ap-flip-front, .ap-flip-back{
  position:absolute; inset:0;
  backface-visibility:hidden; -webkit-backface-visibility:hidden;
  border-radius:12px;
  border: 1px solid var(--ap-line);
  border-top: 3px solid var(--ap-accent);
  background: var(--ap-card);
  box-shadow: 4px 6px 0 var(--ap-line);
  padding: 34px 34px 26px;
  display:flex; flex-direction:column;
}
.ap-flip-front{ align-items:flex-start; justify-content:center; text-align:left; }
.ap-flip-front .ap-quote-mark{ position:absolute; top:14px; right:20px; font-family:'Caveat', cursive; font-size:52px; color: var(--ap-line); }
.ap-flip-front .ap-tag{ font-size:12px; letter-spacing:1px; text-transform:uppercase; color: var(--ap-sage); font-weight:600; margin-bottom:14px; }
.ap-flip-front h3{ font-family:'Caveat', cursive; font-weight:600; font-size: 32px; margin:0 0 14px; line-height:1.2; max-width: 85%; }
.ap-flip-front p{ font-size:14.5px; color: var(--ap-ink-soft); margin: 0 0 20px; max-width: 420px; }
.ap-flip-hint{ font-family:'Caveat', cursive; font-size:19px; color: var(--ap-accent); }

.ap-flip-back{ transform: rotateY(180deg); overflow-y:auto; }
.ap-flip-back .ap-tag{ font-size:11px; letter-spacing:1px; text-transform:uppercase; color: var(--ap-sage); font-weight:600; margin-bottom:12px; }
.ap-flip-back .ap-body{ font-family: 'Caveat', cursive; font-size: 22px; line-height:1.4; flex-grow:1; }
.ap-flip-back .ap-verse{ margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--ap-line); font-style: italic; font-size: 13.5px; color: var(--ap-sage); }
.ap-flip-back .ap-verse-ref{ display:block; margin-top: 4px; font-style: normal; font-weight: 600; font-size: 11px; letter-spacing: 0.5px; text-transform: uppercase; color: var(--ap-ink-soft); }

.ap-deck-nav{ display:flex; align-items:center; justify-content:center; gap: 18px; margin-top: 22px; }
.ap-deck-arrow{
  width:38px; height:38px; border-radius:50%;
  background: var(--ap-card); border: 1px solid var(--ap-line);
  color: var(--ap-ink); font-family:'Caveat', cursive; font-size:20px;
  display:flex; align-items:center; justify-content:center;
  cursor:pointer;
}
.ap-deck-arrow:hover{ border-color: var(--ap-accent); color: var(--ap-accent); }
.ap-deck-dots{ display:flex; gap:8px; }
.ap-deck-dot{ width:8px; height:8px; border-radius:50%; background: var(--ap-line); cursor:pointer; transition: background .15s ease, transform .15s ease; }
.ap-deck-dot.ap-active{ background: var(--ap-accent); transform: scale(1.3); }
.ap-deck-swipe-hint{ text-align:center; font-family:'Caveat', cursive; font-size:16px; color: var(--ap-ink-soft); margin-top: 10px; }

/* Footer */
.ap-site-footer{ background: var(--ap-dark); color: #E9DFC9; margin-top: 80px; padding: 56px 0 30px; }
.ap-footer-grid{ display:grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 30px; margin-bottom: 36px; }
.ap-footer-col h4{ font-family:'Caveat', cursive; font-size: 22px; font-weight:600; margin: 0 0 14px; color: #F2E9D8; }
.ap-footer-col ul{ list-style:none; margin:0; padding:0; }
.ap-footer-col li{ margin-bottom: 8px; }
.ap-footer-col a{ color: #C9BC9F; text-decoration:none; font-size: 14px; }
.ap-footer-col a:hover{ color: #FFFBF2; }
.ap-social-row{ display:flex; gap: 12px; margin-top: 6px; }
.ap-social-row a{ width:32px; height:32px; border-radius:50%; background: rgba(255,255,255,0.08); display:flex; align-items:center; justify-content:center; }
.ap-newsletter input[type=email]{ width:100%; padding: 10px 12px; border-radius: 6px; border: 1px solid #55483A; background: #3A2E22; color: #F2E9D8; margin-bottom: 10px; font-family:'Nunito', sans-serif; }
.ap-newsletter button{ background: var(--ap-accent); color:#FFFBF2; border:none; padding: 10px 18px; border-radius: 999px; font-weight:600; cursor:pointer; width:100%; }
.ap-footer-bottom{ border-top: 1px solid #45392B; padding-top: 20px; text-align:center; font-size: 13px; color: #8C7E67; }

/* Candle + ambient audio toggle */
.ap-candle-wrap{
  position: fixed; top: 92px; right: 22px; z-index: 999;
  display:flex; flex-direction:column; align-items:flex-end; gap:6px;
}
.ap-candle-btn{
  width:52px; height:52px; border-radius:50%;
  background: var(--ap-card); border: 1px solid var(--ap-line);
  box-shadow: 3px 4px 0 var(--ap-line);
  display:flex; align-items:center; justify-content:center;
  cursor:pointer; position:relative;
}
.ap-candle-btn svg{ display:block; }
.ap-flame{ opacity:0; transform-origin: 50% 100%; transform: scaleY(0.6); transition: opacity .3s ease, transform .3s ease; }
.ap-candle-wrap.ap-lit .ap-flame{ opacity:1; transform: scaleY(1); animation: ap-flicker 1.6s ease-in-out infinite; }
@keyframes ap-flicker{
  0%, 100% { transform: scaleY(1) rotate(0deg); }
  25% { transform: scaleY(1.08) rotate(-1.5deg); }
  50% { transform: scaleY(0.95) rotate(1deg); }
  75% { transform: scaleY(1.05) rotate(-0.5deg); }
}
.ap-candle-label{ font-family:'Caveat', cursive; font-size:14px; color: var(--ap-ink-soft); background: var(--ap-card); padding: 2px 10px; border-radius: 999px; border: 1px solid var(--ap-line); white-space:nowrap; }

@media (max-width: 720px){
  .ap-candle-wrap{ top: 76px; right: 16px; }
  .ap-candle-btn{ width:46px; height:46px; }
}

/* Settings panel: dark mode + accent color */
.ap-settings-btn{
  width:44px; height:44px; border-radius:50%;
  background: var(--ap-card); border: 1px solid var(--ap-line);
  box-shadow: 3px 4px 0 var(--ap-line);
  display:flex; align-items:center; justify-content:center;
  cursor:pointer; color: var(--ap-ink-soft);
}
.ap-settings-panel{
  position:absolute; top: 52px; right: 0;
  background: var(--ap-card); border: 1px solid var(--ap-line);
  border-radius: 12px; box-shadow: 4px 6px 0 var(--ap-line);
  padding: 18px; width: 220px;
  display:none;
}
.ap-settings-panel.ap-open{ display:block; }
.ap-settings-row{ display:flex; align-items:center; justify-content:space-between; margin-bottom: 14px; }
.ap-settings-row span{ font-family:'Caveat', cursive; font-size:18px; color: var(--ap-ink); }
.ap-dark-switch{
  width:40px; height:22px; border-radius:999px; background: var(--ap-line);
  position:relative; cursor:pointer; border:none; padding:0;
}
.ap-dark-switch::after{
  content:''; position:absolute; top:2px; left:2px; width:18px; height:18px;
  border-radius:50%; background: var(--ap-card); transition: transform .2s ease;
}
.ap-dark-switch.ap-on{ background: var(--ap-accent); }
.ap-dark-switch.ap-on::after{ transform: translateX(18px); }
.ap-swatch-row{ display:flex; gap:8px; flex-wrap:wrap; }
.ap-swatch{
  width:26px; height:26px; border-radius:50%; cursor:pointer;
  border: 2px solid transparent;
}
.ap-swatch.ap-selected{ border-color: var(--ap-ink); }

/* Ambient player / playlist */
.ap-player{
  display:none;
  background: var(--ap-card); border: 1px solid var(--ap-line);
  border-radius: 12px; box-shadow: 4px 6px 0 var(--ap-line);
  padding: 12px 14px; width: 220px;
  position:absolute; top: 52px; right: 60px;
}
.ap-player.ap-open{ display:block; }
.ap-player-track{ font-family:'Caveat', cursive; font-size:17px; color: var(--ap-ink); margin-bottom:10px; text-align:center; line-height:1.2; min-height: 22px; }
.ap-player-controls{ display:flex; align-items:center; justify-content:center; gap:16px; }
.ap-player-btn{ background:none; border:none; color: var(--ap-ink-soft); cursor:pointer; display:flex; align-items:center; justify-content:center; padding:4px; }
.ap-player-btn:hover{ color: var(--ap-accent); }
.ap-player-btn.ap-play-pause{ width:34px; height:34px; border-radius:50%; background: var(--ap-accent); color:#FFFBF2; }
.ap-player-btn.ap-play-pause:hover{ color:#FFFBF2; opacity:.9; }

@media (max-width: 720px){
  .ap-nav{ display:none; }
  .ap-menu-toggle{ display:block; }
  .ap-h1{ font-size: 34px; }
  .ap-moments{ grid-template-columns: 1fr; }
  .ap-letter{ padding: 30px 22px; }
  .ap-body{ font-size:21px; }
  .ap-grid{ grid-template-columns: 1fr; gap: 14px; }
  .ap-card{ min-height: 190px; }
  .ap-card-face{ padding: 22px 18px 18px; }
  .ap-card .ap-quote-mark{ font-size:38px; top:6px; right:14px; }
  .ap-head h1{ font-size: 30px; }
  .ap-footer-grid{ grid-template-columns: 1fr; gap: 30px; }
  .ap-deck-stage{ height: 420px; }
  .ap-flip-front, .ap-flip-back{ padding: 26px 22px 20px; }
  .ap-flip-front h3{ font-size: 26px; max-width:100%; }
  .ap-flip-back .ap-body{ font-size: 19px; }
}
