/*
Theme Name: Numerology 69
Theme URI: https://numero69.ru/
Author: Numerology 69
Description: Издание о нумерологии: журнальная типографика, спокойный ритм, приложение как часть сайта.
Version: 2.0.0
Requires PHP: 8.0
Text Domain: n69
*/

/* ---------- токены ---------- */
:root {
    --ink: #161c26;
    --navy: #153a63;
    --navy-soft: #2a5f91;
    --sand: #c79b62;
    --cream: #f7efe4;
    --paper: #fdfcfa;
    --line: #e6e1d8;
    --muted: #6b7280;

    --s1: 4px;
    --s2: 8px;
    --s3: 12px;
    --s4: 16px;
    --s5: 24px;
    --s6: 32px;
    --s7: 48px;
    --s8: 64px;
    --s9: 96px;

    --radius: 12px;
    --measure: 68ch;
}

/* ---------- база ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 17px/1.7 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-feature-settings: "kern" 1;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--navy); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--navy-soft); }

h1, h2, h3, h4 {
    font-family: Georgia, "Times New Roman", serif;
    color: var(--ink);
    line-height: 1.2;
    letter-spacing: -0.01em;
    margin: 0 0 var(--s3);
}

h1 { font-size: clamp(30px, 4.2vw, 46px); }
h2 { font-size: clamp(23px, 2.6vw, 30px); margin-top: var(--s7); }
h3 { font-size: 21px; margin-top: var(--s6); }
h4 { font-size: 18px; margin-top: var(--s5); }

p, ul, ol { margin: 0 0 var(--s4); }
ul, ol { padding-left: 22px; }
li { margin-bottom: 6px; }

strong { font-weight: 650; }

hr { border: 0; border-top: 1px solid var(--line); margin: var(--s6) 0; }

/* ---------- каркас ---------- */
.wrap { width: min(100% - 40px, 1120px); margin: 0 auto; }
.wrap--text { width: min(100% - 40px, 720px); margin: 0 auto; }

main { padding: var(--s6) 0 var(--s8); }

/* ---------- шапка ---------- */
.site-header {
    background: rgba(253, 252, 250, 0.94);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 30;
    backdrop-filter: saturate(1.4) blur(8px);
}
.site-header .wrap {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: var(--s5);
    min-height: 68px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: Georgia, serif;
    font-size: 19px;
    font-weight: 700;
    color: var(--navy);
    text-decoration: none;
    white-space: nowrap;
}
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.brand { flex: 0 0 auto; }
.site-nav { margin-left: auto; min-width: 0; }
.site-nav ul {
    display: flex;
    gap: var(--s5);
    margin: 0;
    padding: 0;
    list-style: none;
}
.header-cta { flex: 0 0 auto; }
.site-nav a {
    color: var(--ink);
    text-decoration: none;
    font-size: 15px;
    padding: 6px 0;
    border-bottom: 2px solid transparent;
}
.site-nav a:hover { border-color: var(--sand); }
.header-cta {
    display: inline-flex;
    align-items: center;
    padding: 9px 16px;
    border-radius: 10px;
    background: var(--navy);
    color: #fff;
    font-size: 14px;
    text-decoration: none;
    white-space: nowrap;
}
.header-cta:hover { background: var(--navy-soft); color: #fff; }

/* ---------- ссылки-крошки ---------- */
.crumbs { font-size: 13px; color: var(--muted); padding-top: var(--s5); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0; }
.crumbs li:not(:last-child)::after { content: "/"; margin-left: 6px; color: var(--line); }
.crumbs a { color: var(--muted); text-decoration: none; }

/* ---------- редакционный герой ---------- */
.lede {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: var(--s7);
    align-items: end;
    padding: var(--s6) 0 var(--s7);
    border-bottom: 1px solid var(--line);
}
.lede__kicker {
    display: block;
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--sand);
    margin-bottom: var(--s3);
}
.lede h1 { margin-bottom: var(--s4); }
.lede p { font-size: 19px; color: var(--muted); margin: 0; max-width: 46ch; }
.lede__meta { display: flex; gap: var(--s4); flex-wrap: wrap; font-size: 14px; color: var(--muted); margin-top: var(--s4); }

.lede__numeral {
    font-family: Georgia, serif;
    font-size: clamp(120px, 18vw, 220px);
    line-height: 0.8;
    color: var(--cream);
    text-align: right;
    user-select: none;
}

/* ---------- секции ---------- */
.section { padding-top: var(--s7); }
.section__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--s4);
    margin-bottom: var(--s5);
    border-bottom: 1px solid var(--line);
    padding-bottom: var(--s3);
}
.section__head h2 { margin: 0; font-size: 22px; }
.section__head a { font-size: 14px; text-decoration: none; color: var(--muted); }
.section__head a:hover { color: var(--navy); }

/* ---------- карточки статей ---------- */
.grid { display: grid; gap: var(--s5) var(--s6); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    gap: var(--s2);
}
.card__cat {
    font-size: 12px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--sand);
}
.card__title {
    font-family: Georgia, serif;
    font-size: 21px;
    line-height: 1.28;
    color: var(--ink);
    margin: 0;
}
.card:hover .card__title { color: var(--navy); }
.card__text { font-size: 15px; color: var(--muted); margin: 0; }
.card__meta { font-size: 13px; color: var(--muted); margin-top: var(--s1); }

.card--feature .card__title { font-size: 27px; }
.card--feature .card__text { font-size: 16px; }

/* ---------- список ссылок ---------- */
.pill-list { display: flex; flex-wrap: wrap; gap: var(--s2); list-style: none; padding: 0; margin: var(--s4) 0; }
.pill-list a {
    display: inline-block;
    padding: 7px 13px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid var(--line);
    text-decoration: none;
    font-size: 14px;
    color: var(--ink);
}
.pill-list a:hover { border-color: var(--sand); }

/* ---------- статья ---------- */
.article-head { padding-top: var(--s5); margin-bottom: var(--s5); }
.article-head h1 { margin-bottom: var(--s3); }
.article-head .lead { font-size: 19px; color: var(--muted); max-width: var(--measure); }
.article-meta {
    display: flex;
    gap: var(--s4);
    flex-wrap: wrap;
    font-size: 14px;
    color: var(--muted);
    padding-bottom: var(--s4);
    border-bottom: 1px solid var(--line);
}

.article-body { max-width: var(--measure); }
.article-body p { font-size: 18px; }
.article-body h2 { font-size: 27px; }
.article-body h3 { font-family: inherit; font-size: 19px; font-weight: 650; }
.article-body ul, .article-body ol { font-size: 18px; }
.article-body img { margin: var(--s5) 0; border-radius: var(--radius); }

.toc {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: var(--s4) var(--s5);
    margin: 0 0 var(--s5);
    font-size: 15px;
}
.toc strong { display: block; margin-bottom: var(--s2); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.toc ol { margin: 0; padding-left: 18px; }
.toc li { margin-bottom: 4px; }

.note {
    background: var(--cream);
    border-radius: var(--radius);
    padding: var(--s4) var(--s5);
    margin: var(--s5) 0;
    font-size: 16px;
}
.note strong { color: var(--navy); }

/* ---------- блок приложения ---------- */
.app-block {
    margin: var(--s8) 0 0;
    background: var(--cream);
    border-radius: 18px;
    padding: var(--s6);
    display: grid;
    grid-template-columns: minmax(0, 1fr) 200px;
    gap: var(--s6);
    align-items: center;
}
.app-block h2 { margin-top: 0; font-size: 26px; }
.app-block p { margin-bottom: var(--s4); color: #4b5563; }
.app-block__shot img {
    width: 100%;
    max-width: 200px;
    margin: 0 auto;
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 12px 28px rgba(21, 58, 99, 0.18);
}
.app-block__links { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; }

/* ---------- кнопки ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 18px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    border: 1px solid transparent;
}
.btn--primary { background: var(--navy); color: #fff; }
.btn--primary:hover { background: var(--navy-soft); color: #fff; }
.btn--ghost { border-color: var(--navy); color: var(--navy); background: transparent; }
.btn--ghost:hover { background: rgba(21, 58, 99, 0.06); }
.btn--text { padding: 11px 0; color: var(--navy); border: 0; }

/* ---------- FAQ ---------- */
.faq { margin-top: var(--s7); }
.faq details {
    border-top: 1px solid var(--line);
    padding: var(--s4) 0;
}
.faq summary {
    cursor: pointer;
    font-family: Georgia, serif;
    font-size: 19px;
    color: var(--ink);
    list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; color: var(--sand); }
.faq details[open] summary::after { content: "−"; }
.faq p { margin: var(--s3) 0 0; color: var(--muted); }

/* ---------- подвал ---------- */
.site-footer {
    border-top: 1px solid var(--line);
    padding: var(--s7) 0;
    font-size: 14px;
    color: var(--muted);
}
.site-footer .wrap { display: grid; gap: var(--s5); }
.site-footer .cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--s5);
}
.site-footer h3 {
    font-family: inherit;
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0 0 var(--s2);
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer a { color: var(--ink); text-decoration: none; }
.site-footer a:hover { color: var(--navy); }
.site-footer .bottom { border-top: 1px solid var(--line); padding-top: var(--s4); display: flex; gap: var(--s4); flex-wrap: wrap; justify-content: space-between; }

/* ---------- магазин ---------- */
.woocommerce .button,
.woocommerce button.button.alt {
    background: var(--navy) !important;
    color: #fff !important;
    border-radius: 10px !important;
}

/* ---------- адаптив ---------- */
@media (max-width: 900px) {
    .lede { grid-template-columns: 1fr; gap: var(--s5); }
    .lede__numeral { display: none; }
    .app-block { grid-template-columns: 1fr; }
    .app-block__shot { order: -1; }
    .app-block__shot img { max-width: 160px; }
}

@media (max-width: 720px) {
    body { font-size: 16px; }
    main { padding-top: var(--s4); }
    .site-header .wrap { min-height: 58px; gap: var(--s3); }
    .site-nav { order: 3; width: 100%; margin: 0 0 var(--s3); overflow-x: auto; }
    .site-nav ul { gap: var(--s4); padding-bottom: 6px; }
    .site-nav a { font-size: 14px; white-space: nowrap; }
    .header-cta { padding: 8px 12px; font-size: 13px; }
    h1 { font-size: 30px; }
    .lede { padding-top: var(--s4); }
    .article-body p, .article-body ul, .article-body ol { font-size: 17px; }
    .app-block { padding: var(--s5); margin-top: var(--s7); }
}

/* ---------- магазин ---------- */
.shop-wrap { padding-top: var(--s5); padding-bottom: var(--s8); }
.shop-wrap h1 { font-family: Georgia, serif; font-size: clamp(26px, 3vw, 34px); }
.shop-wrap .woocommerce-result-count { font-size: 14px; color: var(--muted); }
.shop-wrap ul.products {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 28px;
    list-style: none;
    margin: 24px 0 0;
    padding: 0;
}
.shop-wrap ul.products li.product {
    margin: 0;
    text-align: left;
}
.shop-wrap ul.products li.product img {
    width: 100%;
    max-width: 220px;
    height: auto;
    border-radius: 12px;
    border: 1px solid var(--line);
}
.shop-wrap ul.products li.product .woocommerce-loop-product__title {
    font-family: Georgia, serif;
    font-size: 18px;
    padding: 10px 0 4px;
    color: var(--ink);
}
.shop-wrap .price { color: var(--ink); font-size: 15px; }
.shop-wrap .price ins, .shop-wrap .price bdi { text-decoration: none; }
.shop-wrap .button,
.shop-wrap button.button.alt {
    background: var(--navy) !important;
    color: #fff !important;
    border-radius: 10px !important;
    padding: 10px 16px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
}
.shop-wrap .woocommerce-breadcrumb { font-size: 13px; color: var(--muted); }
.shop-wrap .woocommerce-message,
.shop-wrap .woocommerce-info {
    border-top-color: var(--sand);
    background: var(--cream);
    color: var(--ink);
    border-radius: 10px;
}
.shop-wrap table.shop_table { border-collapse: collapse; width: 100%; font-size: 15px; }
.shop-wrap table.shop_table th,
.shop-wrap table.shop_table td { border: 1px solid var(--line); padding: 10px; }

/* сетка товаров без конфликтов с WC */
.shop-wrap ul.products li.product {
    width: auto !important;
    float: none !important;
    clear: none !important;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.shop-wrap ul.products li.product a img { margin: 0 0 8px; }
.shop-wrap ul.products li.product .onsale {
    position: static;
    align-self: flex-start;
    background: var(--sand);
    color: #fff;
    border-radius: 8px;
    padding: 2px 8px;
    font-size: 12px;
    margin-bottom: 6px;
}
.shop-wrap .woocommerce-ordering select {
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
}

/* карточка товара */
.shop-wrap div.product {
    display: grid;
    grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
    gap: 32px;
    align-items: start;
    margin-top: 8px;
}
.shop-wrap div.product .woocommerce-product-gallery {
    width: 100% !important;
    max-width: 360px;
    float: none !important;
}
.shop-wrap div.product .woocommerce-product-gallery img {
    width: 100%;
    border-radius: 14px;
    border: 1px solid var(--line);
}
.shop-wrap div.product .summary {
    float: none !important;
    width: 100% !important;
    margin: 0 !important;
}
.shop-wrap div.product .product_title {
    font-family: Georgia, serif;
    font-size: clamp(24px, 2.6vw, 30px);
    margin: 0 0 8px;
}
.shop-wrap div.product .price {
    font-size: 20px;
    color: var(--navy);
    margin-bottom: 12px;
}
.shop-wrap div.product form.cart {
    display: flex;
    gap: 12px;
    align-items: center;
    margin: 16px 0;
}
.shop-wrap div.product .quantity input.qty {
    width: 72px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 15px;
}
.shop-wrap div.product .single_add_to_cart_button {
    background: var(--navy) !important;
    color: #fff !important;
    border-radius: 10px !important;
    padding: 12px 22px !important;
    font-weight: 600 !important;
}
.shop-wrap .woocommerce-tabs { grid-column: 1 / -1; margin-top: 24px; }

@media (max-width: 760px) {
    .shop-wrap div.product { grid-template-columns: 1fr; gap: 18px; }
    .shop-wrap div.product .woocommerce-product-gallery { max-width: 100%; }
}

/* оформление заказа */
.shop-wrap form.checkout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 380px);
    gap: 32px;
    align-items: start;
}
.shop-wrap form.checkout #customer_details { width: 100% !important; float: none !important; }
.shop-wrap form.checkout #order_review_heading,
.shop-wrap form.checkout #order_review { width: 100% !important; float: none !important; }
.shop-wrap form.checkout #order_review {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 18px;
}
.shop-wrap .woocommerce-billing-fields h3,
.shop-wrap .woocommerce-additional-fields h3,
.shop-wrap #order_review_heading {
    font-family: Georgia, serif;
    font-size: 20px;
    margin: 18px 0 10px;
}
.shop-wrap .form-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0 0 14px !important;
    padding: 0 !important;
    width: 100% !important;
    float: none !important;
}
.shop-wrap .form-row label { font-size: 14px; color: var(--muted); }
.shop-wrap .form-row .required { color: #b3261e; text-decoration: none; }
.shop-wrap .form-row input.input-text,
.shop-wrap .form-row select,
.shop-wrap .form-row textarea,
.shop-wrap .select2-container .select2-selection--single {
    width: 100% !important;
    padding: 11px 12px !important;
    border: 1px solid var(--line) !important;
    border-radius: 8px !important;
    font-size: 15px !important;
    background: #fff !important;
    height: auto !important;
    line-height: 1.3 !important;
}
.shop-wrap .select2-container { width: 100% !important; }
.shop-wrap .select2-selection__rendered { line-height: 1.4 !important; padding: 2px 0 !important; }
.shop-wrap .select2-selection__arrow { top: 8px !important; }
.shop-wrap #place_order,
.shop-wrap .checkout-button,
.shop-wrap .wc-forward {
    width: 100%;
    background: var(--navy) !important;
    color: #fff !important;
    border-radius: 10px !important;
    padding: 14px 18px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
}
.shop-wrap table.shop_table td,
.shop-wrap table.shop_table th { border-color: var(--line); }
.shop-wrap .woocommerce-info { margin-bottom: 16px; }

@media (max-width: 900px) {
    .shop-wrap form.checkout { grid-template-columns: 1fr; }
}

/* колонки оформления заказа */
.shop-wrap form.checkout #customer_details { grid-column: 1; grid-row: 1 / span 2; }
.shop-wrap form.checkout #order_review_heading { grid-column: 2; grid-row: 1; margin-top: 0; }
.shop-wrap form.checkout #order_review { grid-column: 2; grid-row: 2; }
.shop-wrap form.checkout .woocommerce-checkout-payment { margin-top: 10px; }
.shop-wrap #order_review table.shop_table { width: 100%; margin-bottom: 12px; }
.shop-wrap #order_review table.shop_table th,
.shop-wrap #order_review table.shop_table td { padding: 8px 10px; font-size: 14px; }
@media (max-width: 900px) {
    .shop-wrap form.checkout #customer_details,
    .shop-wrap form.checkout #order_review_heading,
    .shop-wrap form.checkout #order_review { grid-column: 1; grid-row: auto; }
}
