/*
 * Galera — default page template
 *
 * Text pages written in Gutenberg: the policy, the offer, delivery and
 * returns. Everything here styles core block output, so an editor only needs
 * headings, lists and tables — no custom classes.
 */

/* The .page section carries no padding of its own. Scoped to the element:
   WordPress puts the same class on <body>. */
section.page { padding: 28px 0 64px; }

.page .breadcrumbs { margin-bottom: 10px; }

.page__title { margin: 0 0 24px; }

/* Full width: the theme caps prose at 78ch, these pages opt out. */
.page__content {
    max-width: none;
    font-size: 17px;
    line-height: 1.75;
}

.page__title { text-align: center; }

.page__content > *:first-child { margin-top: 0; }
.page__content > *:last-child  { margin-bottom: 0; }

/* ── Headings ───────────────────────────────────────────────────────────── */
.page__content h2 {
    margin: 40px 0 14px;
    font-size: 24px;
}

.page__content h3 {
    margin: 28px 0 10px;
    font-size: 19px;
}

.page__content h4 {
    margin: 24px 0 8px;
    font-size: 17px;
}

/* ── Text ───────────────────────────────────────────────────────────────── */
.page__content p { margin: 0 0 18px; }

/* reset.css sets "b, strong { font-weight: inherit }" for components that
   style their own weights; in running text bold has to be bold. */
.page__content strong,
.page__content b {
    font-weight: 700;
    color: var(--color-navy);
}

.page__content a:not([class]) {
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.page__content a:not([class]):hover { color: var(--color-primary-dark); }

/* A pasted URL or an IBAN has nothing to break at and would push the page
   sideways on a 360px screen. */
.page__content a,
.page__content code { overflow-wrap: anywhere; }

/* ── Lists ──────────────────────────────────────────────────────────────── */
.page__content ul,
.page__content ol {
    margin: 0 0 20px;
    padding: 0;
    list-style: none;
}

.page__content li {
    position: relative;
    padding-left: 26px;
    margin-bottom: 10px;
}

.page__content li:last-child { margin-bottom: 0; }

.page__content ul > li::before {
    content: '';
    position: absolute;
    top: 12px;
    left: 6px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--color-primary);
}

.page__content ol { counter-reset: item; }

.page__content ol > li { counter-increment: item; }

.page__content ol > li::before {
    content: counter(item) '.';
    position: absolute;
    left: 0;
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--color-primary);
}

.page__content li > ul,
.page__content li > ol { margin: 10px 0 0; }

/* ── Tables ─────────────────────────────────────────────────────────────── */
.page__content table {
    width: 100%;
    margin: 0 0 24px;
    border-collapse: collapse;
    font-size: 16px;
}

.page__content th,
.page__content td {
    padding: 12px 14px;
    border: 1px solid var(--color-border);
    text-align: left;
    vertical-align: top;
}

.page__content thead th {
    background: var(--color-bg-alt);
    font-family: var(--font-heading);
    color: var(--color-navy);
}

/* A table of several columns cannot shrink below its content; let it scroll
   inside the page instead of pushing the page sideways. */
.page__content .wp-block-table { overflow-x: auto; }

/* ── Quote, separator, image ────────────────────────────────────────────── */
.page__content blockquote {
    margin: 0 0 24px;
    padding: 4px 0 4px 20px;
    border-left: 3px solid var(--color-primary);
    color: var(--color-muted);
}

.page__content blockquote p:last-child { margin-bottom: 0; }

.page__content hr,
.page__content .wp-block-separator {
    height: 0;
    margin: 32px 0;
    border: 0;
    border-top: 1px solid var(--color-border);
}

.page__content img,
.page__content .wp-block-image img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
}

/* ── Details block: long chapters an editor can fold ────────────────────── */
.page__content .wp-block-details {
    margin: 0 0 14px;
    padding: 16px 18px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.page__content .wp-block-details summary {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--color-navy);
    cursor: pointer;
}

.page__content .wp-block-details[open] summary { margin-bottom: 12px; }

/* ── Buttons an editor may add ──────────────────────────────────────────── */
.page__content .wp-block-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0 0 24px;
}

.page__content .wp-block-button__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 13px 28px;
    border-radius: var(--radius-pill);
    background: var(--color-primary);
    color: #FFF;
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    transition: background-color var(--transition);
}

.page__content .wp-block-button__link:hover { background: var(--color-primary-dark); }

.page__content .is-style-outline .wp-block-button__link {
    border: 1px solid var(--color-primary);
    background: transparent;
    color: var(--color-primary);
}

.page__content .is-style-outline .wp-block-button__link:hover {
    background: var(--color-primary);
    color: #FFF;
}

/* ── Adaptive ───────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    section.page { padding: 20px 0 48px; }

    .page__content {
        font-size: 16px;
        line-height: 1.7;
    }

    .page__content h2 { margin-top: 32px; font-size: 21px; }
    .page__content h3 { font-size: 18px; }

    .page__content th,
    .page__content td { padding: 10px 12px; }
}

/* ══ Content components ═════════════════════════════════════════════════════
 * Blocks an editor turns on with a class in Gutenberg (Блок → Додатково →
 * Класи CSS). The markup stays a plain list or paragraph, so the text is
 * still readable without these styles.
 *
 *   info-cards  — список способів доставки чи оплати картками
 *   check-list  — перелік умов із галочками
 *   steps       — послідовність дій пронумерованими картками
 *   req-panel   — реквізити чи будь-який набір «ключ: значення»
 *   note        — виноска; note--warn для попередження
 * ═══════════════════════════════════════════════════════════════════════════ */

/* ── Cards ──────────────────────────────────────────────────────────────── */
.page__content .info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 16px;
    margin: 0 0 24px;
}

.page__content .info-cards > li {
    margin: 0;
    padding: 20px 20px 20px 66px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.page__content .info-cards > li:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-soft);
}

/* The card carries an icon instead of the bullet the list would show. */
.page__content .info-cards > li::before {
    content: '';
    top: 20px;
    left: 18px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--color-primary-soft) no-repeat center / 19px 19px;
}

.page__content .info-cards strong,
.page__content .steps strong {
    display: block;
    margin-bottom: 4px;
    font-family: var(--font-heading);
    font-size: 17px;
}

.page__content .info-cards > li.icon-truck::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23662C8D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h11v9H3z'/%3E%3Cpath d='M14 9h4l3 3v3h-7z'/%3E%3Ccircle cx='7' cy='18' r='2'/%3E%3Ccircle cx='17' cy='18' r='2'/%3E%3C/svg%3E");
}

.page__content .info-cards > li.icon-pin::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23662C8D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E");
}

.page__content .info-cards > li.icon-box::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23662C8D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 7 9-4 9 4-9 4-9-4Z'/%3E%3Cpath d='M3 7v10l9 4 9-4V7'/%3E%3Cpath d='M12 11v10'/%3E%3C/svg%3E");
}

.page__content .info-cards > li.icon-cash::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23662C8D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='6' width='20' height='12' rx='2'/%3E%3Ccircle cx='12' cy='12' r='2.5'/%3E%3C/svg%3E");
}

.page__content .info-cards > li.icon-card::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23662C8D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='5' width='20' height='14' rx='2'/%3E%3Cpath d='M2 10h20'/%3E%3C/svg%3E");
}

.page__content .info-cards > li.icon-percent::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23662C8D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m19 5-14 14'/%3E%3Ccircle cx='7.5' cy='7.5' r='2.5'/%3E%3Ccircle cx='16.5' cy='16.5' r='2.5'/%3E%3C/svg%3E");
}

.page__content .info-cards > li.icon-bank::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23662C8D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 9 9-5 9 5'/%3E%3Cpath d='M5 9v9m5-9v9m4-9v9m5-9v9'/%3E%3Cpath d='M3 20h18'/%3E%3C/svg%3E");
}

/* ── Check list ─────────────────────────────────────────────────────────── */
.page__content .check-list { margin: 0 0 24px; }

.page__content .check-list > li { padding-left: 34px; }

.page__content .check-list > li::before {
    content: '';
    top: 4px;
    left: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--color-primary-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23662C8D' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") no-repeat center / 13px 13px;
}

/* ── Steps ──────────────────────────────────────────────────────────────── */
.page__content .steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 16px;
    margin: 0 0 24px;
    counter-reset: step;
}

.page__content .steps > li {
    margin: 0;
    padding: 20px 20px 20px 62px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    counter-increment: step;
}

.page__content .steps > li::before {
    content: counter(step);
    display: flex;
    align-items: center;
    justify-content: center;
    top: 20px;
    left: 18px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #FFF;
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
}

/* ── Key-value panel ────────────────────────────────────────────────────── */
.page__content .req-panel {
    margin: 0 0 24px;
    padding: 20px 22px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-bg-alt);
}

.page__content .req-panel > li {
    padding-left: 0;
    margin-bottom: 8px;
    overflow-wrap: anywhere;
}

.page__content .req-panel > li::before { content: none; }

/* ── Note ───────────────────────────────────────────────────────────────── */
.page__content .note {
    margin: 0 0 24px;
    padding: 16px 20px;
    border-left: 3px solid var(--color-primary);
    border-radius: var(--radius-sm);
    background: var(--color-primary-soft);
}

.page__content .note--warn {
    border-left-color: var(--color-sale);
    background: #FCEBEA;
}

/* ── Adaptive ───────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    .page__content .info-cards,
    .page__content .steps { grid-template-columns: 1fr; gap: 12px; }

    .page__content .info-cards > li,
    .page__content .steps > li { padding: 16px 16px 16px 58px; }

    .page__content .info-cards > li::before,
    .page__content .steps > li::before { top: 16px; left: 14px; }

    .page__content .req-panel { padding: 16px 18px; }
}
