/**
 * Roofably — assets/css/custom.css
 * Component-level styles that extend style.css:
 * tool cards, prose, animations, form states, newsletter, misc.
 */

/* ============================================================
   TOOL CARDS
   ============================================================ */
.ra-tool-card {
    background: var(--ra-white);
    border: 1.5px solid var(--ra-border);
    border-radius: var(--ra-radius-lg);
    padding: 2rem;
}
.ra-tool-card__intro {
    background: var(--ra-primary-light);
    border-radius: var(--ra-radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    font-size: 0.9375rem;
    color: var(--ra-primary-dark);
    border-left: 3px solid var(--ra-primary);
}
.ra-tool-card p { margin-bottom: 1.25rem; }

/* ============================================================
   PROSE (page.php / single.php content)
   ============================================================ */
.ra-prose { line-height: 1.75; }
.ra-prose h2 { font-size: 1.5rem; margin: 2rem 0 0.75rem; }
.ra-prose h3 { font-size: 1.25rem; margin: 1.5rem 0 0.5rem; }
.ra-prose p  { margin-bottom: 1.25rem; }
.ra-prose ul, .ra-prose ol { margin-bottom: 1.25rem; }
.ra-prose li { margin-bottom: 0.375rem; }
.ra-prose a  { color: var(--ra-primary); text-decoration: underline; }
.ra-prose a:hover { color: var(--ra-primary-dark); }
.ra-prose strong { color: var(--ra-dark); font-weight: 600; }
.ra-prose hr {
    border: none;
    border-top: 1px solid var(--ra-border);
    margin: 2rem 0;
}
.ra-prose blockquote {
    border-left: 4px solid var(--ra-primary);
    padding: 0.75rem 1.25rem;
    background: var(--ra-primary-light);
    border-radius: 0 var(--ra-radius) var(--ra-radius) 0;
    margin: 1.5rem 0;
    color: var(--ra-dark);
    font-style: italic;
}

/* ============================================================
   FORM SUCCESS STATE
   ============================================================ */
.ra-form-success { padding: 2.5rem 1rem; text-align: center; }
.ra-form-success h3 { color: var(--ra-dark); margin-bottom: 0.5rem; }
.ra-form-success p  { color: var(--ra-muted); margin-bottom: 1.5rem; }

/* ============================================================
   INPUT STATES
   ============================================================ */
.ra-form-input.error,
.ra-form-select.error {
    border-color: var(--ra-danger);
    box-shadow: 0 0 0 3px rgba(220,38,38,.10);
}
.ra-field-error {
    display: block;
    font-size: 0.75rem;
    color: var(--ra-danger);
    margin-top: 0.25rem;
}

/* ============================================================
   LOADING SPINNER
   ============================================================ */
.ra-spinner {
    display: inline-block;
    width: 18px; height: 18px;
    border: 2.5px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ra-spin .7s linear infinite;
}
@keyframes ra-spin { to { transform: rotate(360deg); } }

/* ============================================================
   CHECKLIST ITEM (tools)
   ============================================================ */
.ra-check-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem;
    border: 1.5px solid var(--ra-border);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
.ra-check-item:hover { border-color: var(--ra-primary); background: var(--ra-primary-light); }
.ra-check-item input[type="checkbox"] {
    margin-top: 3px;
    accent-color: var(--ra-primary);
    width: 18px; height: 18px;
    flex-shrink: 0;
}

/* ============================================================
   PAGE HERO (about, contact, static pages)
   ============================================================ */
.ra-page-hero {
    background: linear-gradient(135deg, #1C1917, #3a1f0e);
    padding: 3rem 0;
    text-align: center;
    color: #fff;
}
.ra-page-hero h1   { color: #fff; margin-bottom: 0.75rem; }
.ra-page-hero p    { color: rgba(255,255,255,.78); max-width: 600px; margin-inline: auto; }

/* ============================================================
   CONTACT FORM
   ============================================================ */
.ra-contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}
.ra-contact-card {
    background: var(--ra-white);
    border: 1px solid var(--ra-border);
    border-radius: var(--ra-radius-lg);
    padding: 2rem;
    box-shadow: var(--ra-shadow);
}
.ra-contact-info { display: flex; flex-direction: column; gap: 1.5rem; }
.ra-contact-info-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}
.ra-contact-info-item .ra-icon {
    color: var(--ra-primary);
    flex-shrink: 0;
    margin-top: 2px;
}
.ra-contact-info-item h4 { font-size: 0.875rem; color: var(--ra-muted); margin-bottom: 0.25rem; font-weight: 500; }
.ra-contact-info-item p  { font-size: 1rem; font-weight: 600; color: var(--ra-dark); margin: 0; }
.ra-contact-info-item a  { color: var(--ra-dark); font-weight: 600; }
.ra-contact-info-item a:hover { color: var(--ra-primary); }

@media (max-width: 768px) {
    .ra-contact-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   ABOUT PAGE
   ============================================================ */
.ra-about-intro {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}
.ra-about-intro__img {
    border-radius: var(--ra-radius-lg);
    overflow: hidden;
    background: var(--ra-section-bg);
    aspect-ratio: 4/3;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ra-muted);
}
@media (max-width: 768px) {
    .ra-about-intro { grid-template-columns: 1fr; }
}

/* ============================================================
   PRIVACY / TERMS / TCPA page
   ============================================================ */
.ra-legal-content {
    max-width: 820px;
    margin-inline: auto;
}
.ra-legal-content h2 {
    font-size: 1.25rem;
    margin: 2rem 0 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--ra-border);
}
.ra-legal-content p  { margin-bottom: 1rem; }
.ra-legal-content ul { margin-bottom: 1rem; }
.ra-legal-content li { margin-bottom: 0.375rem; }

/* ============================================================
   SKIP TO CONTENT (a11y)
   ============================================================ */
.ra-skip-link {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px; height: 1px;
    overflow: hidden;
}
.ra-skip-link:focus {
    position: fixed;
    top: 0; left: 0;
    width: auto; height: auto;
    background: var(--ra-primary);
    color: #fff;
    padding: 0.5rem 1rem;
    z-index: 9999;
    font-weight: 600;
}

/* ============================================================
   BACK TO TOP
   ============================================================ */
#ra-back-top {
    position: fixed;
    bottom: 1.5rem; right: 1.5rem;
    width: 44px; height: 44px;
    background: var(--ra-primary);
    color: #fff;
    border: none;
    border-radius: var(--ra-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.25s, transform 0.25s;
    z-index: 50;
    box-shadow: var(--ra-shadow-lg);
}
#ra-back-top.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================================
   SELECTION COLOR
   ============================================================ */
::selection { background: var(--ra-primary-light); color: var(--ra-primary-dark); }

/* ============================================================
   FOCUS RING
   ============================================================ */
:focus-visible {
    outline: 2px solid var(--ra-primary);
    outline-offset: 3px;
    border-radius: var(--ra-radius);
}

/* ============================================================
   SMOOTH IMAGE LOAD
   ============================================================ */
img { transition: opacity 0.3s; }
img[loading="lazy"] { opacity: 0; }
img[loading="lazy"].loaded { opacity: 1; }
