/*
Theme Name: Agony to Grace
Theme URI: http://www.agonytograce.com/
Author: Codex
Description: A quiet, reflective WordPress theme adapted from the Agony to Grace one-page experience.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: agony-to-grace
Tags: custom-background, custom-logo, custom-menu, featured-images, one-column, threaded-comments, translation-ready
*/

:root {
  --atg-bg: #151311;
  --atg-bg-soft: #221d19;
  --atg-bg-deep: #0f0d0c;
  --atg-text: #e7dccb;
  --atg-muted: #b8a792;
  --atg-gold: #b69162;
  --atg-gold-soft: rgba(182, 145, 98, 0.18);
  --atg-light: #f1e6d2;
  --atg-card: rgba(30, 24, 20, 0.72);
  --atg-border: rgba(231, 220, 203, 0.12);
  --atg-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  --atg-max: 1100px;
  --atg-radius: 20px;
  --atg-serif: "Cinzel", "Cormorant Garamond", Georgia, serif;
  --atg-body: "Inter", "Source Sans 3", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--atg-bg);
  color: var(--atg-text);
  font-family: var(--atg-body);
  font-size: 18px;
  line-height: 1.75;
}

body.admin-bar .site-header {
  top: 32px;
}

img,
svg,
video {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--atg-light);
  text-decoration-color: rgba(182, 145, 98, 0.55);
  text-underline-offset: 0.18em;
}

a:hover,
a:focus {
  color: #fff8ea;
  text-decoration-color: var(--atg-gold);
}

button,
input,
select,
textarea {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--atg-border);
  border-radius: 14px;
  background: rgba(12, 10, 9, 0.45);
  color: var(--atg-light);
  padding: 14px 16px;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(182, 145, 98, 0.45);
  box-shadow: 0 0 0 4px rgba(182, 145, 98, 0.1);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 28px 0;
}

th,
td {
  border-bottom: 1px solid var(--atg-border);
  padding: 12px;
  text-align: left;
}

blockquote {
  border-left: 3px solid var(--atg-gold);
  margin: 30px 0;
  padding: 6px 0 6px 22px;
  color: var(--atg-light);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.45rem;
  line-height: 1.45;
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.screen-reader-text:focus {
  top: 8px;
  left: 8px;
  z-index: 100000;
  display: block;
  width: auto;
  height: auto;
  clip: auto;
  padding: 12px 16px;
  background: var(--atg-light);
  color: var(--atg-bg);
  border-radius: 6px;
}

.site-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 18px 24px;
  background: linear-gradient(180deg, rgba(15, 13, 12, 0.72), rgba(15, 13, 12, 0));
}

body:not(.home) .site-header,
body.blog .site-header,
body.archive .site-header,
body.search .site-header,
body.single .site-header,
body.page:not(.home) .site-header,
body.error404 .site-header {
  position: sticky;
  background: rgba(15, 13, 12, 0.94);
  border-bottom: 1px solid var(--atg-border);
  backdrop-filter: blur(12px);
}

.site-header-inner,
.site-footer-inner,
.content-area,
.atg-section-inner {
  width: min(100%, var(--atg-max));
  margin: 0 auto;
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-branding {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.custom-logo-link {
  display: inline-flex;
  flex: 0 0 auto;
}

.custom-logo {
  max-height: 54px;
  width: auto;
}

.site-title {
  margin: 0;
  font-family: var(--atg-serif);
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  line-height: 1.1;
  text-transform: uppercase;
}

.site-title a {
  text-decoration: none;
}

.site-description {
  margin: 4px 0 0;
  color: var(--atg-muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  min-height: 42px;
  border: 1px solid var(--atg-border);
  border-radius: 999px;
  background: rgba(18, 15, 13, 0.72);
  color: var(--atg-light);
  cursor: pointer;
}

.primary-navigation ul,
.footer-navigation ul {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.primary-navigation a,
.footer-navigation a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 12px;
  color: var(--atg-text);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
}

.primary-navigation a:hover,
.primary-navigation a:focus,
.footer-navigation a:hover,
.footer-navigation a:focus {
  color: var(--atg-light);
}

.site-main {
  overflow-x: hidden;
}

.content-area {
  padding: 86px 24px 96px;
}

.content-area.narrow {
  width: min(100%, 820px);
}

.atg-hero,
.atg-invitation,
.atg-clearing,
.atg-anchor,
.atg-vault,
.atg-channel,
.atg-beginning,
.atg-soundtrack,
.atg-benediction,
.atg-page-content-section {
  position: relative;
  overflow: hidden;
  padding: 112px 24px;
}

.atg-section-inner {
  position: relative;
  z-index: 2;
}

.atg-hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background:
    linear-gradient(rgba(18, 15, 13, 0.72), rgba(18, 15, 13, 0.84)),
    url("assets/hero-image.jpg") center center / cover no-repeat;
}

.atg-invitation {
  background:
    linear-gradient(rgba(21, 19, 17, 0.94), rgba(28, 23, 19, 0.96)),
    url("assets/invitation-texture.jpg") center / cover no-repeat;
}

.atg-clearing {
  background:
    linear-gradient(rgba(20, 17, 15, 0.92), rgba(16, 14, 12, 0.96)),
    url("assets/clearing-texture.jpg") center / cover no-repeat;
}

.atg-anchor {
  background:
    linear-gradient(rgba(24, 20, 18, 0.9), rgba(28, 24, 21, 0.95)),
    url("assets/anchor-texture.jpg") center / cover no-repeat;
}

.atg-vault {
  background:
    radial-gradient(circle at center, rgba(182, 145, 98, 0.1) 0%, rgba(20, 17, 15, 0) 28%),
    linear-gradient(rgba(18, 16, 14, 0.95), rgba(15, 13, 11, 0.98)),
    url("assets/vault-texture.jpg") center / cover no-repeat;
}

.atg-channel {
  background:
    linear-gradient(rgba(26, 22, 19, 0.9), rgba(31, 26, 22, 0.94)),
    url("assets/channel-texture.jpg") center / cover no-repeat;
}

.atg-beginning {
  background:
    linear-gradient(rgba(20, 17, 15, 0.84), rgba(17, 14, 12, 0.9)),
    url("assets/beginning-texture.jpg") center / cover no-repeat;
}

.atg-soundtrack {
  background:
    linear-gradient(rgba(18, 16, 14, 0.9), rgba(21, 18, 16, 0.94)),
    url("assets/soundtrack-texture.jpg") center / cover no-repeat;
}

.atg-benediction {
  text-align: center;
  background:
    linear-gradient(rgba(18, 16, 14, 0.88), rgba(18, 16, 14, 0.94)),
    url("assets/benediction-texture.jpg") center / cover no-repeat;
}

.atg-page-content-section {
  background: linear-gradient(180deg, var(--atg-bg), var(--atg-bg-soft));
}

.atg-hero::before,
.atg-clearing::before,
.atg-vault::before,
.atg-beginning::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background:
    radial-gradient(circle at 70% 20%, rgba(241, 230, 210, 0.16), transparent 35%),
    radial-gradient(circle at 30% 70%, rgba(182, 145, 98, 0.1), transparent 30%);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 18px;
  color: var(--atg-light);
  font-family: var(--atg-serif);
  line-height: 1.08;
  letter-spacing: 0.04em;
}

h1 {
  font-size: 5.75rem;
}

h2 {
  font-size: 3.25rem;
}

h3 {
  font-size: 1.75rem;
}

h4 {
  font-size: 1.35rem;
}

p,
li {
  color: var(--atg-text);
}

p {
  margin: 0 0 20px;
}

ul,
ol {
  padding-left: 1.2rem;
}

.hero-sub {
  margin-bottom: 10px;
}

.atg-hero-copy {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.atg-quote {
  max-width: 900px;
  color: var(--atg-light);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-style: italic;
  font-size: 2rem;
  line-height: 1.45;
}

.atg-subheading {
  margin-bottom: 14px;
  color: var(--atg-gold);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.4;
  text-transform: uppercase;
}

.atg-grid {
  display: grid;
  gap: 24px;
}

.atg-two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.atg-three-col {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.atg-soundtrack-grid {
  grid-template-columns: 42% 58%;
}

.atg-song-devotional-columns {
  grid-template-columns: 56% 44%;
}

.atg-scripture-panel,
.atg-reflection-card,
.atg-textarea,
.atg-post-card,
.comment-respond,
.comments-area,
.widget {
  border: 1px solid var(--atg-border);
  border-radius: var(--atg-radius);
  background: var(--atg-card);
  box-shadow: var(--atg-shadow);
  backdrop-filter: blur(6px);
}

.atg-scripture-panel,
.atg-reflection-card,
.atg-textarea,
.atg-post-card,
.comment-respond,
.comments-area,
.widget {
  padding: 24px;
}

.atg-song-scripture-panel {
  position: sticky;
  top: 24px;
}

.atg-button-row,
.atg-inline-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.atg-button,
.button,
button,
input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 22px;
  border: 1px solid rgba(182, 145, 98, 0.45);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(182, 145, 98, 0.18), rgba(182, 145, 98, 0.06));
  color: var(--atg-light);
  text-decoration: none;
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
  cursor: pointer;
}

.atg-button-outline {
  background: rgba(0, 0, 0, 0.08);
}

.atg-button:hover,
.atg-button:focus,
.button:hover,
.button:focus,
button:hover,
button:focus,
input[type="submit"]:hover,
input[type="submit"]:focus {
  transform: translateY(-1px);
  border-color: rgba(241, 230, 210, 0.45);
  box-shadow: 0 8px 30px rgba(182, 145, 98, 0.14);
}

.menu-toggle {
  width: auto;
  padding: 0 14px;
}

.atg-textarea textarea {
  min-height: 180px;
  line-height: 1.7;
}

.atg-helper {
  color: var(--atg-muted);
  font-size: 0.86rem;
}

.atg-reveal {
  opacity: 0;
  transform: translateY(34px);
  filter: blur(6px);
  transition: opacity 1.1s ease, transform 1.1s ease, filter 1.1s ease;
}

.atg-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

.atg-scripture-panel {
  margin-top: 24px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.atg-scripture-panel.is-open,
.atg-song-scripture-panel {
  opacity: 1;
  transform: translateY(0);
}

.atg-response-message {
  margin-top: 14px;
  color: var(--atg-gold);
  opacity: 0;
  transition: opacity 0.6s ease;
}

.atg-response-message.is-visible {
  opacity: 1;
}

.atg-textarea textarea.is-releasing {
  animation: atgDustFade 1.4s ease forwards;
}

@keyframes atgDustFade {
  0% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }

  100% {
    opacity: 0;
    filter: blur(8px);
    transform: translateY(-6px);
  }
}

.atg-reveal.is-visible .atg-anchor-right {
  animation: atgSoftReveal 1.2s ease 0.25s both;
}

@keyframes atgSoftReveal {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.atg-vault-card {
  opacity: 0;
  transform: translateY(18px);
}

.atg-reveal.is-visible .atg-vault-card:nth-child(1) {
  animation: atgCardRise 0.8s ease 0.1s forwards;
}

.atg-reveal.is-visible .atg-vault-card:nth-child(2) {
  animation: atgCardRise 0.8s ease 0.3s forwards;
}

.atg-reveal.is-visible .atg-vault-card:nth-child(3) {
  animation: atgCardRise 0.8s ease 0.5s forwards;
}

@keyframes atgCardRise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.atg-channel::after {
  content: "";
  position: absolute;
  left: -20%;
  top: 50%;
  width: 40%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(241, 230, 210, 0.75), transparent);
  opacity: 0;
  pointer-events: none;
}

.atg-channel.atg-flow-active::after {
  animation: atgFlowLine 1.5s ease;
}

@keyframes atgFlowLine {
  0% {
    left: -20%;
    opacity: 0;
  }

  20% {
    opacity: 1;
  }

  100% {
    left: 100%;
    opacity: 0;
  }
}

.atg-audio-wrap {
  margin: 28px 0 30px;
}

.atg-audio-player {
  width: 100%;
  filter: sepia(20%) saturate(80%) brightness(0.95);
}

.atg-lyrics-card {
  max-height: 720px;
}

.atg-lyrics-scroll {
  max-height: 620px;
  overflow-y: auto;
  padding-right: 10px;
}

.atg-lyrics-scroll p {
  margin-bottom: 18px;
}

.atg-lyrics-scroll em {
  color: var(--atg-gold);
}

.atg-lyrics-scroll::-webkit-scrollbar {
  width: 8px;
}

.atg-lyrics-scroll::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(182, 145, 98, 0.35);
}

.atg-song-devotional {
  margin-top: 28px;
}

.entry-header,
.page-header,
.atg-archive-header {
  margin-bottom: 32px;
}

.entry-title,
.page-title {
  overflow-wrap: anywhere;
}

.entry-title a {
  text-decoration: none;
}

.entry-meta,
.entry-footer,
.nav-links,
.comment-metadata,
.logged-in-as {
  color: var(--atg-muted);
  font-size: 0.9rem;
}

.entry-meta a,
.entry-footer a,
.nav-links a,
.comment-metadata a {
  color: var(--atg-muted);
}

.post-thumbnail {
  display: block;
  margin: 0 0 24px;
  overflow: hidden;
  border-radius: var(--atg-radius);
}

.post-thumbnail img {
  display: block;
  width: 100%;
}

.atg-post-card {
  margin-bottom: 28px;
}

.atg-post-card.sticky {
  border-color: rgba(182, 145, 98, 0.42);
}

.page-links {
  clear: both;
  margin: 28px 0;
}

.nav-links {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 32px;
}

.comments-area {
  margin-top: 34px;
}

.comment-list {
  list-style: none;
  padding-left: 0;
}

.comment-list .children {
  list-style: none;
  padding-left: 24px;
}

.comment-body {
  padding: 18px 0;
  border-bottom: 1px solid var(--atg-border);
}

.comment-form-cookies-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.comment-form-cookies-consent input {
  width: auto;
  margin-top: 8px;
}

.site-footer {
  padding: 48px 24px;
  border-top: 1px solid var(--atg-border);
  background: var(--atg-bg-deep);
}

.site-footer-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: start;
}

.footer-widgets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 32px;
}

.widget {
  list-style: none;
}

.widget ul {
  list-style: none;
  padding-left: 0;
}

.widget li + li {
  margin-top: 8px;
}

@media (max-width: 900px) {
  body {
    font-size: 17px;
  }

  h1 {
    font-size: 4rem;
  }

  h2 {
    font-size: 2.55rem;
  }

  .atg-two-col,
  .atg-three-col,
  .atg-soundtrack-grid,
  .atg-song-devotional-columns,
  .footer-widgets {
    grid-template-columns: 1fr;
  }

  .atg-song-scripture-panel {
    position: relative;
    top: auto;
  }

  .atg-lyrics-card,
  .atg-lyrics-scroll {
    max-height: none;
  }
}

@media (max-width: 767px) {
  body.admin-bar .site-header {
    top: 46px;
  }

  .site-header {
    position: sticky;
    top: 0;
    padding: 14px 18px;
    background: rgba(15, 13, 12, 0.94);
    border-bottom: 1px solid var(--atg-border);
    backdrop-filter: blur(12px);
  }

  .site-header-inner {
    align-items: flex-start;
  }

  .site-description {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .primary-navigation {
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    right: 0;
    display: none;
    padding: 12px 18px 18px;
    background: rgba(15, 13, 12, 0.97);
    border-bottom: 1px solid var(--atg-border);
  }

  .primary-navigation.is-open {
    display: block;
  }

  .primary-navigation ul {
    display: grid;
    justify-content: stretch;
    gap: 2px;
  }

  .primary-navigation a {
    min-height: 44px;
    padding-left: 0;
  }

  .atg-hero,
  .atg-invitation,
  .atg-clearing,
  .atg-anchor,
  .atg-vault,
  .atg-channel,
  .atg-beginning,
  .atg-soundtrack,
  .atg-benediction,
  .atg-page-content-section {
    padding: 64px 18px;
  }

  .atg-hero {
    min-height: 86vh;
    background-position: 58% center;
  }

  h1 {
    font-size: 2.75rem;
    line-height: 1.04;
  }

  h2 {
    font-size: 2.15rem;
  }

  h3 {
    font-size: 1.45rem;
  }

  p,
  li {
    line-height: 1.75;
  }

  .atg-quote {
    font-size: 1.55rem;
    line-height: 1.4;
  }

  .atg-reflection-card,
  .atg-scripture-panel,
  .atg-textarea,
  .atg-post-card,
  .comment-respond,
  .comments-area,
  .widget {
    padding: 18px;
    border-radius: 16px;
  }

  .atg-button,
  .button,
  button,
  input[type="submit"] {
    width: 100%;
    justify-content: center;
    padding: 12px 18px;
  }

  .menu-toggle {
    width: auto;
    padding: 0 14px;
  }

  .atg-textarea textarea {
    min-height: 150px;
  }

  .atg-helper {
    display: block;
    width: 100%;
    line-height: 1.5;
  }

  .atg-reveal {
    transform: translateY(20px);
    filter: blur(3px);
    transition: opacity 0.8s ease, transform 0.8s ease, filter 0.8s ease;
  }

  .atg-hero::before,
  .atg-clearing::before,
  .atg-vault::before,
  .atg-beginning::before {
    opacity: 0.12;
  }

  .nav-links,
  .site-footer-inner,
  .footer-navigation ul {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
  }
}
