/* ============================================================
   MyStash — apppage.css v2.0.2
   Styles for app variation article pages
   ============================================================ */

/* ── Hook text ────────────────────────────────────────────── */
.ap-hook { margin-bottom: 2rem; }

.ap-hook p,
.ap-hook-text {
    font-size: clamp(1.05rem, 2vw, 1.35rem);
    font-weight: 300;
    color: var(--ink-mid);
    line-height: 1.8;
    max-width: 720px;
}

/* ── Store badges (module position ap-store-badges) ──────── */
#ap-store-badges {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2.5rem;
}

.ap-store-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1.5rem;
    border-radius: 10px;
    text-decoration: none;
    font-family: var(--font);
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.2;
    min-width: 180px;
    transition: transform 0.2s, box-shadow 0.2s;
}
.ap-store-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.ap-store-btn svg   { width: 28px; height: 28px; flex-shrink: 0; }
.ap-store-btn small {
    display: block; font-size: 0.65rem; font-weight: 400;
    letter-spacing: 0.05em; text-transform: uppercase; opacity: 0.8;
}
.ap-store-apple { background: var(--ink); color: #fff; }
.ap-store-apple:hover { color: #fff; }
.ap-store-google { background: var(--teal); color: #fff; }
.ap-store-google:hover { color: #fff; }

/* ── Article section headings ─────────────────────────────── */
.ap-section { margin: 2.5rem 0; }

.ap-section-heading,
#ms-component h2 {
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 1.2rem;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid var(--teal-pale);
}

/* ── Screenshots grid ─────────────────────────────────────── */
.ap-screenshots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}
.ap-screenshots-grid img {
    width: 100%;
    height: auto;
    border-radius: 14px;
    box-shadow: var(--shadow-md);
    transition: transform 0.25s;
    display: block;
}
.ap-screenshots-grid img:hover { transform: scale(1.04); }

/* ── Videos grid ──────────────────────────────────────────── */
.ap-videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

/* Responsive 16:9 YouTube embed */
.ap-video-wrap {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    background: var(--ink);
}
.ap-video-wrap iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: none;
}

/* ── Forms (module positions form-app-question, form-app-fields) */
#ap-forms {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.ap-forms-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
    background: var(--border);
}

.ap-form-panel { background: #fff; padding: 2rem; }

.ap-form-panel h2,
.ap-form-heading {
    font-size: 1rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 0.35rem;
    border-bottom: none;
    padding-bottom: 0;
}

.ap-form-sub {
    font-size: 0.85rem;
    color: var(--ink-soft);
    margin-bottom: 1.2rem;
    font-weight: 300;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
    #ap-store-badges { flex-direction: column; }
    .ap-store-btn    { min-width: unset; width: 100%; max-width: 260px; justify-content: center; }
    .ap-screenshots-grid { grid-template-columns: repeat(2, 1fr); }
    .ap-videos-grid  { grid-template-columns: 1fr; }
    .ap-forms-grid   { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .ap-screenshots-grid { grid-template-columns: 1fr; }
}


/* ── Legal pages (Privacy Policy, Terms of Service) ──────── */
.legal-page {
    max-width: 760px;
    margin: 0 auto;
    padding: 1rem 0 3rem;
}

.legal-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.legal-effective {
    font-size: 0.85rem;
    color: var(--ink-soft);
    margin: 0;
}

.legal-intro {
    margin-bottom: 2.5rem;
}

.legal-intro p {
    font-size: 1rem;
    color: var(--ink-mid);
    line-height: 1.8;
}

.legal-section {
    margin-bottom: 2.5rem;
}

.legal-section h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--teal);
    margin-bottom: 0.8rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--teal-pale);
}

.legal-section h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--ink);
    margin: 1rem 0 0.5rem;
}

.legal-section p {
    font-size: 0.95rem;
    color: var(--ink-mid);
    line-height: 1.8;
    font-weight: 300;
    margin-bottom: 0.8rem;
}

.legal-section ul {
    margin: 0.5rem 0 0.8rem 1.5rem;
}

.legal-section ul li {
    font-size: 0.95rem;
    color: var(--ink-mid);
    line-height: 1.7;
    font-weight: 300;
    margin-bottom: 0.3rem;
}

.legal-section a {
    color: var(--teal);
    text-decoration: underline;
}

.legal-contact {
    font-style: normal;
    font-size: 0.95rem;
    color: var(--ink-mid);
    line-height: 1.9;
    background: var(--teal-pale);
    border-left: 3px solid var(--teal);
    padding: 1rem 1.2rem;
    border-radius: 0 6px 6px 0;
    margin-top: 0.8rem;
    display: inline-block;
}


/* ── App page sections ────────────────────────────────────── */
#ap-hero-text {
    margin-bottom: 1.5rem;
}
#ap-hero-text p {
    font-size: clamp(1.05rem, 1.2vw, 1.1rem);
    font-weight: 500;
    color: var(--ink-mid);
    line-height: 1.8;
}

#ap-store-badges {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2.5rem;
}

.ap-section-heading {
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 1.2rem;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid var(--teal-pale);
}

/* ── Screenshot carousel ──────────────────────────────────── */
#ap-screenshots {
    margin-bottom: 2.5rem;
}

.ap-carousel {
    position: relative;
    background: #2D6A5F;
    border-radius: 16px;
    border: 1px solid #2D6A5F;
    overflow: hidden;
}

/* Track — fixed height, centered */
.ap-carousel-track {
    position: relative;
    width: 100%;
    height: 520px;
    overflow: hidden;
}

/* Each slide — stacked absolutely, fades in/out */
.ap-carousel-slide {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    opacity: 0;
    transition: opacity 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.ap-carousel-slide.active {
    opacity: 1;
    pointer-events: auto;
}

/* Image — fixed pixel height, width scales proportionally */
.ap-carousel-slide img {
    display: block !important;
    height: 460px !important;
    width: auto !important;
    max-width: calc(100% - 2rem) !important;
    object-fit: contain !important;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    margin: 0 auto !important;
    padding: 0 !important;
    position: relative !important;
    inset: auto !important;
}

/* Prev / Next buttons */
.ap-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.9);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: var(--ink);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 10;
}
.ap-carousel-btn:hover { background: #fff; box-shadow: var(--shadow-md); }
.ap-carousel-prev { left: 0.75rem; }
.ap-carousel-next { right: 0.75rem; }

/* Dots */
.ap-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 0;
}
.ap-carousel-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    border: none;
    background: var(--border);
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    padding: 0;
}
.ap-carousel-dot.active {
    background: var(--teal);
    transform: scale(1.3);
}

@media (max-width: 768px) {
    .ap-carousel-track { height: 380px; }
    .ap-carousel-slide img { height: 340px !important; }
    .ap-carousel-btn { width: 36px; height: 36px; font-size: 1.2rem; }
}
@media (max-width: 480px) {
    .ap-carousel-track { height: 280px; }
    .ap-carousel-slide img { height: 240px !important; }
}

/* ── Videos grid ──────────────────────────────────────────── */
#ap-videos {
    margin-bottom: 2.5rem;
}

.ap-videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.ap-video-wrap {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    background: var(--ink);
}
.ap-video-wrap iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: none;
}

/* ── Forms ────────────────────────────────────────────────── */
#ap-forms {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.ap-forms-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
    background: var(--border);
}

.ap-form-panel {
    background: #fff;
    padding: 2rem;
}

@media (max-width: 768px) {
    .ap-carousel-btn { width: 36px; height: 36px; font-size: 1.2rem; }
    .ap-videos-grid  { grid-template-columns: 1fr; }
    .ap-forms-grid   { grid-template-columns: 1fr; }
}


/* ── Hide Joomla article metadata on app pages ───────────── */
.ap-page .article-info,
.ap-page .article-info-term,
.ap-page .item-page .article-info,
#ms-component .article-info,
#ms-component .article-info-term,
#ms-component .com-content-article__header .article-info,
#ms-component .pager,
#ms-component nav.pagination,
#ms-component .pagination { display: none !important; }

/* Fix store badges side by side, centred */
#ap-store-badges {
    display: flex !important;
    flex-direction: row !important;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    align-items: center;
    justify-content: center;
}
#ap-store-badges img {
    height: 50px;
    width: auto;
}


/* ── App hero — logo + title + hook text ─────────────────── */
.ap-hero-inner {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.ap-hero-logo {
    width: 320px;
    flex-shrink: 0;
}

.ap-hero-logo img {
    width: 320px !important;
    height: auto !important;
    object-fit: contain;
    display: block;
}

.ap-hero-right {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Title inside the right column */
.ap-hero-right .page-header h1,
.ap-hero-right h1 {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    margin-bottom: 1rem;
}

/* Hide the article metadata inside the right column */
.ap-hero-right .article-info,
.ap-hero-right .article-info-term { display: none !important; }

.ap-hero-inner p {
    flex: 1;
    margin: 0;
}

@media (max-width: 600px) {
    .ap-hero-inner {
        flex-direction: column;
        text-align: center;
    }
    .ap-hero-logo { width: 200px !important; }
    .ap-hero-logo img { width: 200px !important; }
}
