/**
 * Etchly Policy / Info Pages — Shared Stylesheet
 *
 * Used by: faq.html, shipping.html, returns.html, privacy.html, terms.html
 *
 * Inherits the variables from variables.css and global.css. Adds layout
 * scaffolding for content-heavy long-form pages (header, prose body,
 * accordion, footer).
 */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--main-bg, #f8fafc);
    color: var(--content-text, #1a1f27);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body.dark-mode {
    background: var(--dark-bg, #0b0e12);
    color: var(--dark-hi, #f7fbff);
}

/* ────────────────────────────────────────────────────────────────────────
   HEADER (matches contact.html / index.html pattern)
   ──────────────────────────────────────────────────────────────────────── */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    height: 90px;
    background: linear-gradient(180deg, var(--card-bg, #fff), var(--main-bg, #f8fafc));
    border-bottom: 1px solid var(--card-border, #e2e8f0);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,.05);
}

body.dark-mode header {
    background: linear-gradient(180deg, var(--dark-card-bg, #1a1f27), var(--dark-bg, #0b0e12));
    border-bottom-color: var(--dark-card-border, #2d3748);
    box-shadow: 0 4px 6px -1px rgba(0,0,0,.3);
}

.brand img {
    height: 60px;
    width: auto;
}

header .btns {
    display: flex;
    gap: 8px;
    align-items: center;
}

header .btn {
    padding: 9px 16px;
    border-radius: 8px;
    background: var(--card-bg, #fff);
    color: var(--content-text, #1a1f27);
    border: 1px solid var(--card-border, #e2e8f0);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

header .btn:hover {
    border-color: var(--accent, #00A9E0);
    color: var(--accent, #00A9E0);
}

body.dark-mode header .btn {
    background: var(--dark-card-bg, #1a1f27);
    color: var(--dark-hi, #f7fbff);
    border-color: var(--dark-card-border, #2d3748);
}

/* ────────────────────────────────────────────────────────────────────────
   PAGE LAYOUT
   ──────────────────────────────────────────────────────────────────────── */
.policy-page {
    flex: 1;
    max-width: 960px;
    margin: 0 auto;
    padding: 60px 24px 80px;
    width: 100%;
}

.policy-header {
    text-align: center;
    margin-bottom: 50px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--card-border, #e2e8f0);
}

body.dark-mode .policy-header {
    border-bottom-color: var(--dark-card-border, #2d3748);
}

.policy-header h1 {
    font-size: 2.6em;
    font-weight: 700;
    margin-bottom: 14px;
    color: var(--content-text, #1a1f27);
    letter-spacing: -0.02em;
}

body.dark-mode .policy-header h1 {
    color: var(--dark-hi, #f7fbff);
}

.policy-header p.lede {
    font-size: 1.1em;
    color: var(--light-muted, #6b7280);
    max-width: 640px;
    margin: 0 auto;
    line-height: 1.6;
}

body.dark-mode .policy-header p.lede {
    color: var(--dark-muted, #9aa3b2);
}

.policy-header .meta {
    margin-top: 18px;
    font-size: 13px;
    color: var(--light-muted, #6b7280);
}

/* ────────────────────────────────────────────────────────────────────────
   PROSE / CONTENT
   ──────────────────────────────────────────────────────────────────────── */
.policy-content {
    background: var(--card-bg, #fff);
    border: 1px solid var(--card-border, #e2e8f0);
    border-radius: 14px;
    padding: 48px 56px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

body.dark-mode .policy-content {
    background: var(--dark-card-bg, #1a1f27);
    border-color: var(--dark-card-border, #2d3748);
}

.policy-content h2 {
    font-size: 1.45em;
    font-weight: 700;
    margin-top: 36px;
    margin-bottom: 14px;
    color: var(--accent, #00A9E0);
    letter-spacing: -0.01em;
}

.policy-content h2:first-child { margin-top: 0; }

.policy-content h3 {
    font-size: 1.1em;
    font-weight: 600;
    margin-top: 22px;
    margin-bottom: 10px;
    color: var(--content-text, #1a1f27);
}

body.dark-mode .policy-content h3 {
    color: var(--dark-hi, #f7fbff);
}

.policy-content p {
    line-height: 1.75;
    margin-bottom: 14px;
    color: var(--content-text, #1a1f27);
}

body.dark-mode .policy-content p {
    color: var(--dark-hi, #f7fbff);
}

.policy-content ul, .policy-content ol {
    margin: 12px 0 18px 22px;
    line-height: 1.75;
}

.policy-content ul li, .policy-content ol li {
    margin-bottom: 8px;
}

.policy-content a {
    color: var(--accent, #00A9E0);
    text-decoration: none;
    font-weight: 500;
}

.policy-content a:hover {
    text-decoration: underline;
}

.policy-content strong { font-weight: 700; }
.policy-content em { font-style: italic; color: var(--light-muted, #6b7280); }

.policy-content .callout {
    margin: 22px 0;
    padding: 16px 20px;
    background: rgba(0,169,224,.06);
    border-left: 3px solid var(--accent, #00A9E0);
    border-radius: 6px;
    font-size: 0.96em;
}

body.dark-mode .policy-content .callout {
    background: rgba(0,169,224,.12);
}

.policy-content .callout strong { color: var(--accent, #00A9E0); }

.policy-content .warn-callout {
    margin: 22px 0;
    padding: 16px 20px;
    background: rgba(245,130,32,.08);
    border-left: 3px solid var(--theme-orange, #F58220);
    border-radius: 6px;
    font-size: 0.96em;
}

body.dark-mode .policy-content .warn-callout {
    background: rgba(245,130,32,.16);
}

.policy-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 18px 0;
    font-size: 0.95em;
}

.policy-content table th, .policy-content table td {
    padding: 10px 14px;
    text-align: left;
    border: 1px solid var(--card-border, #e2e8f0);
}

body.dark-mode .policy-content table th,
body.dark-mode .policy-content table td {
    border-color: var(--dark-card-border, #2d3748);
}

.policy-content table th {
    background: var(--light-panel, #f1f5f9);
    font-weight: 700;
}

body.dark-mode .policy-content table th {
    background: var(--dark-panel, #10151c);
}

/* ────────────────────────────────────────────────────────────────────────
   FAQ ACCORDION
   ──────────────────────────────────────────────────────────────────────── */
.faq-section {
    margin-top: 32px;
}

.faq-section-title {
    font-size: 1.3em;
    font-weight: 700;
    color: var(--accent, #00A9E0);
    margin: 36px 0 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent, #00A9E0);
}

.faq-section-title:first-child { margin-top: 0; }

details.faq-item {
    background: var(--main-bg, #f8fafc);
    border: 1px solid var(--card-border, #e2e8f0);
    border-radius: 10px;
    margin-bottom: 10px;
    transition: border-color 0.15s, background 0.15s;
}

body.dark-mode details.faq-item {
    background: var(--dark-bg, #0b0e12);
    border-color: var(--dark-card-border, #2d3748);
}

details.faq-item[open] {
    border-color: var(--accent, #00A9E0);
    background: var(--card-bg, #fff);
}

body.dark-mode details.faq-item[open] {
    background: var(--dark-card-bg, #1a1f27);
}

details.faq-item summary {
    padding: 16px 22px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1.02em;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--content-text, #1a1f27);
}

body.dark-mode details.faq-item summary {
    color: var(--dark-hi, #f7fbff);
}

details.faq-item summary::-webkit-details-marker { display: none; }

details.faq-item summary::after {
    content: '+';
    font-size: 1.5em;
    font-weight: 300;
    color: var(--accent, #00A9E0);
    line-height: 1;
    transition: transform 0.2s;
    margin-left: 14px;
}

details.faq-item[open] summary::after {
    content: '−';
    transform: rotate(0deg);
}

details.faq-item summary:hover {
    color: var(--accent, #00A9E0);
}

details.faq-item .faq-body {
    padding: 0 22px 18px;
    line-height: 1.75;
    color: var(--content-text, #1a1f27);
}

body.dark-mode details.faq-item .faq-body {
    color: var(--dark-hi, #f7fbff);
}

details.faq-item .faq-body p { margin-bottom: 10px; }
details.faq-item .faq-body p:last-child { margin-bottom: 0; }

/* ────────────────────────────────────────────────────────────────────────
   POLICY CROSS-LINKS (footer of each page — sibling links)
   ──────────────────────────────────────────────────────────────────────── */
.policy-crosslinks {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 36px;
    padding: 24px;
    background: var(--card-bg, #fff);
    border: 1px solid var(--card-border, #e2e8f0);
    border-radius: 12px;
}

body.dark-mode .policy-crosslinks {
    background: var(--dark-card-bg, #1a1f27);
    border-color: var(--dark-card-border, #2d3748);
}

.policy-crosslinks a {
    padding: 8px 16px;
    border-radius: 6px;
    background: transparent;
    color: var(--content-text, #1a1f27);
    border: 1px solid var(--card-border, #e2e8f0);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s;
}

body.dark-mode .policy-crosslinks a {
    color: var(--dark-hi, #f7fbff);
    border-color: var(--dark-card-border, #2d3748);
}

.policy-crosslinks a:hover {
    background: var(--accent, #00A9E0);
    border-color: var(--accent, #00A9E0);
    color: #fff;
}

.policy-crosslinks a.current {
    background: var(--accent, #00A9E0);
    border-color: var(--accent, #00A9E0);
    color: #fff;
    pointer-events: none;
}

/* ────────────────────────────────────────────────────────────────────────
   FOOTER (matches index.html pattern)
   ──────────────────────────────────────────────────────────────────────── */
.site-footer {
    background: linear-gradient(180deg, var(--dark-card-bg, #1a1f27), var(--dark-bg, #0b0e12));
    color: var(--dark-hi, #f7fbff);
    padding: 40px 30px 0;
    margin-top: auto;
}

.site-footer .footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--dark-card-border, #2d3748);
}

.site-footer .footer-section h4 {
    color: var(--accent, #00A9E0);
    font-size: 1em;
    font-weight: 700;
    margin-bottom: 14px;
    letter-spacing: 0.02em;
}

.site-footer .footer-section p,
.site-footer .footer-section li {
    color: var(--dark-muted, #9aa3b2);
    font-size: 0.92em;
    line-height: 1.7;
}

.site-footer .footer-section ul { list-style: none; padding: 0; }

.site-footer .footer-section a {
    color: var(--dark-muted, #9aa3b2);
    text-decoration: none;
    transition: color 0.15s;
}

.site-footer .footer-section a:hover { color: var(--accent, #00A9E0); }

.site-footer .footer-social {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.site-footer .social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--dark-card-border, #2d3748);
    color: var(--dark-muted, #9aa3b2);
    transition: background 0.15s, color 0.15s;
}

.site-footer .social-icon:hover {
    background: var(--accent, #00A9E0);
    color: #fff;
}

.site-footer .footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
    text-align: center;
    font-size: 0.85em;
    color: var(--dark-muted, #9aa3b2);
}

.site-footer .footer-bottom a { color: var(--accent, #00A9E0); text-decoration: none; }

/* ────────────────────────────────────────────────────────────────────────
   RESPONSIVE
   ──────────────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .policy-page { padding: 30px 16px 50px; }
    .policy-header h1 { font-size: 2em; }
    .policy-content { padding: 28px 24px; }
    .site-footer .footer-content { grid-template-columns: 1fr 1fr; gap: 28px; }
    header { padding: 0 16px; }
    header .btns { gap: 4px; }
    header .btn { padding: 7px 11px; font-size: 13px; }
}

@media (max-width: 540px) {
    .site-footer .footer-content { grid-template-columns: 1fr; }
    header .btn span,
    header .btn i { display: inline; }
    /* Hide some less-critical buttons on very narrow screens */
    header .btn#viewWishlistBtn,
    header .btn#viewContactBtn { display: none; }
}

/* Tighter responsive tier for narrow phones (≤480px) */
@media (max-width: 480px) {
    .policy-page { padding: 24px 12px 40px; }
    .policy-header h1 { font-size: 1.6em; }
    .policy-content { padding: 22px 18px; }
    .policy-content h2 { font-size: 1.15em; }
    .policy-content h3 { font-size: 1em; }
    .policy-content p,
    .policy-content li { font-size: 0.95em; }
    /* FAQ accordion summaries stay tappable */
    .faq-item summary { padding: 14px 16px; font-size: 0.98em; min-height: 44px; }
    .faq-body { padding: 14px 16px; font-size: 0.95em; }
    /* Inputs/textareas don't trigger iOS zoom on focus */
    input, select, textarea { font-size: 16px; }
}
