/*
Theme Name: Philosofie Theme
Description: Философия ответственного кредита.
Version: 1.0
*/

:root {
    --primary: #3D405B;
    --secondary: #81B29A;
    --accent: #E07A5F;
    --bg: #F4F1DE;
    --text: #3D405B;
    --border: rgba(61, 64, 91, 0.2);
    --section-pad: clamp(4rem, 8vw, 7rem);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Work Sans', sans-serif; color: var(--text); line-height: 1.75; overflow-x: hidden; display: flex; flex-direction: column; min-height: 100vh; background: var(--bg); }
h1, h2, h3, h4 { font-family: 'Cormorant Garamond', serif; color: var(--primary); }
img { max-width: 100%; height: auto; display: block; border-radius: 0; }
a { color: var(--accent); text-decoration: none; transition: 0.3s; }
.container { width: 100%; max-width: 900px; margin: 0 auto; padding: 0 24px; }

/* DNA: D-B — dividers */
.phl-divider { width: 100%; height: 1px; background: var(--border); margin: 0; }

/* DNA: N-D — centered header, logo top, nav below */
.phl-site-header { background: var(--bg); border-bottom: 1px solid var(--border); position: relative; z-index: 1000; padding: 2rem 0 0; text-align: center; }
.phl-header-inner { display: flex; flex-direction: column; align-items: center; gap: 1.25rem; }
.phl-logo { display: inline-block; font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 600; color: var(--primary); white-space: nowrap; font-family: 'Cormorant Garamond', serif; letter-spacing: 0.02em; }
.phl-logo span { color: var(--accent); font-style: italic; }
.phl-main-nav { width: 100%; border-top: 1px solid var(--border); padding: 0.85rem 0; }
.phl-main-nav ul { display: flex; list-style: none; gap: clamp(1.5rem, 3vw, 3.5rem); margin: 0; padding: 0; justify-content: center; }
.phl-main-nav a { font-weight: 500; font-size: 0.9rem; color: var(--text); letter-spacing: 0.08em; text-transform: uppercase; }
.phl-main-nav a:hover { color: var(--accent); }
.phl-nav-toggle { display: none; }
@media (max-width: 768px) {
    .phl-site-header { padding: 1rem 0; }
    .phl-header-inner { flex-direction: row; justify-content: space-between; padding: 0 24px; gap: 1rem; }
    .phl-logo { font-size: 1.4rem; }
    .phl-main-nav { display: block; position: fixed; top: 0; left: 0; width: 100%; height: 100vh; background: var(--bg); z-index: 2000; transform: translateY(-100%); transition: transform 0.4s ease; visibility: hidden; padding-top: 80px; border-top: none; }
    body.menu-open .phl-main-nav { transform: translateY(0); visibility: visible; }
    .phl-main-nav ul { flex-direction: column; padding: 20px; gap: 1.5rem; align-items: center; }
    .phl-nav-toggle { display: block; flex-shrink: 0; z-index: 2100; background: none; border: none; width: 26px; height: 16px; position: relative; cursor: pointer; }
    .phl-hamburger, .phl-hamburger::before, .phl-hamburger::after { content: ''; display: block; width: 100%; height: 1px; background: var(--primary); position: absolute; transition: 0.3s; }
    .phl-hamburger { top: 50%; transform: translateY(-50%); }
    .phl-hamburger::before { top: -6px; }
    .phl-hamburger::after { bottom: -6px; }
}

.phl-site-main { flex: 1; }

/* DNA: H-C — typography only, serif h1, italic subtitle */
.phl-hero-section { padding: clamp(5rem, 12vw, 9rem) 0; text-align: center; background: var(--bg); }
.phl-hero-content h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); margin-bottom: 1.25rem; word-break: break-word; line-height: 1.15; font-weight: 600; font-style: normal; }
.phl-hero-subtitle { font-family: 'Cormorant Garamond', serif; font-size: clamp(1.15rem, 2.5vw, 1.5rem); font-style: italic; color: var(--secondary); max-width: 640px; margin: 0 auto; line-height: 1.6; font-weight: 400; }

/* DNA: F-C — accordion, V-C thin lines */
.phl-features-section { padding: var(--section-pad) 0; background: #fff; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.phl-section-title { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: 2.5rem; text-align: center; font-weight: 600; }
.phl-accordion { max-width: 720px; margin: 0 auto; border-top: 1px solid var(--border); }
.phl-accordion-item { border-bottom: 1px solid var(--border); }
.phl-accordion-header { width: 100%; text-align: left; padding: 1.5rem 0; background: none; border: none; font-size: 1.15rem; font-family: 'Cormorant Garamond', serif; font-weight: 600; color: var(--primary); cursor: pointer; display: flex; justify-content: space-between; align-items: center; transition: 0.3s; }
.phl-accordion-header:hover { color: var(--accent); }
.phl-accordion-header::after { content: '+'; font-size: 1.4rem; color: var(--secondary); font-family: 'Work Sans', sans-serif; font-weight: 300; transition: transform 0.3s; }
.phl-accordion-item.active .phl-accordion-header::after { transform: rotate(45deg); color: var(--accent); }
.phl-accordion-content { max-height: 0; overflow: hidden; transition: max-height 0.3s ease-out; }
.phl-accordion-item.active .phl-accordion-content { max-height: 400px; }
.phl-accordion-content p { padding-bottom: 1.5rem; font-size: 1rem; color: var(--text); opacity: 0.9; line-height: 1.75; }

/* DNA: U-B — methodology 3 questions */
.phl-method-section { padding: var(--section-pad) 0; background: var(--bg); }
.phl-method-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; }
.phl-method-item { padding: 2rem 0; border-top: 1px solid var(--border); }
.phl-method-num { display: block; font-family: 'Cormorant Garamond', serif; font-size: 2rem; color: var(--accent); margin-bottom: 0.75rem; font-style: italic; }
.phl-method-item h3 { font-size: 1.2rem; margin-bottom: 0.75rem; font-weight: 600; }
.phl-method-item p { font-size: 0.95rem; opacity: 0.88; line-height: 1.7; }
@media (max-width: 768px) { .phl-method-grid { grid-template-columns: 1fr; } }

/* DNA: C-D — editorial post cards with thumb */
.phl-posts-section { padding: var(--section-pad) 0; background: #fff; border-top: 1px solid var(--border); }
.phl-posts-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-left: 1px solid var(--border); }
.phl-post-card { display: flex; flex-direction: column; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); transition: background 0.3s; overflow: hidden; }
.phl-post-card:hover { background: var(--bg); }
.phl-post-thumb { overflow: hidden; line-height: 0; background: var(--bg); border-bottom: 1px solid var(--border); }
.phl-post-thumb a { display: block; line-height: 0; }
.phl-post-thumb img { width: 100%; height: clamp(160px, 22vw, 210px); max-width: none; object-fit: cover; object-position: center center; border-radius: 0; transition: transform 0.45s ease; }
.phl-post-card:hover .phl-post-thumb img { transform: scale(1.04); }
.phl-post-card-content { padding: 1.5rem 1.5rem 2rem; display: flex; flex-direction: column; flex-grow: 1; min-height: 0; }
.phl-post-meta { font-size: 0.75rem; color: var(--secondary); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.75rem; font-family: 'Work Sans', sans-serif; }
.phl-post-category { font-size: 0.75rem; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.5rem; display: block; }
.phl-post-card-content h3 { font-size: 1.15rem; margin-bottom: 1.25rem; flex-grow: 1; line-height: 1.4; word-break: break-word; }
.phl-btn-read { font-size: 0.85rem; font-weight: 600; color: var(--accent); letter-spacing: 0.05em; text-transform: uppercase; }
@media (max-width: 1024px) { .phl-posts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 768px) { .phl-posts-grid { grid-template-columns: 1fr; border-left: none; } .phl-post-card { border-left: 1px solid var(--border); } }

.phl-all-posts-action { text-align: center; margin-top: 3rem; }
.phl-btn-primary { display: inline-block; padding: 0.85rem 2rem; background: transparent; color: var(--primary); font-weight: 600; border: 1px solid var(--primary); letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.85rem; transition: 0.3s; }
.phl-btn-primary:hover { background: var(--primary); color: #fff; }

.pagination { display: flex; justify-content: center; gap: 0.5rem; margin: 3rem 0; flex-wrap: wrap; }
.pagination .page-numbers { display: flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; padding: 0 6px; font-weight: 500; border: 1px solid var(--border); color: var(--primary); transition: 0.3s; font-size: 0.9rem; }
.pagination .page-numbers.current { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination .page-numbers.dots { border: none; cursor: default; }
.pagination .page-numbers:hover:not(.current):not(.dots) { border-color: var(--accent); color: var(--accent); }

.phl-single-container { max-width: 720px; padding: var(--section-pad) 24px; margin: 0 auto; }
.phl-single-thumb { margin-bottom: 2rem; border: 1px solid var(--border); }
.phl-single-header { margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); text-align: center; }
.phl-single-header h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 0.75rem; word-break: break-word; line-height: 1.2; }
.phl-post-meta { color: var(--secondary); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.phl-post-content { line-height: 1.85; font-size: 1.05rem; }
.phl-post-content h2, .phl-post-content h3 { margin-top: 2.5rem; margin-bottom: 1rem; }
.phl-post-content p { margin-bottom: 1.25rem; }
.phl-post-content ul, .phl-post-content ol { margin-bottom: 1.25rem; padding-left: 1.75rem; }
.phl-post-content table { width: 100%; border-collapse: collapse; margin-bottom: 1.25rem; border: 1px solid var(--border); }
.phl-post-content th, .phl-post-content td { border: 1px solid var(--border); padding: 0.85rem; }
.phl-post-content th { background: var(--bg); font-family: 'Cormorant Garamond', serif; font-weight: 600; }

.phl-error-page { text-align: center; min-height: 50vh; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.phl-error-code { font-size: clamp(3rem, 10vw, 5rem); color: var(--primary); margin-bottom: 0.5rem; font-family: 'Cormorant Garamond', serif; font-style: italic; }
.phl-error-page h2 { margin-bottom: 1rem; }
.phl-error-page p { margin-bottom: 2rem; }

/* DNA: FT-D — CTA footer */
.phl-site-footer { margin-top: auto; border-top: 1px solid var(--border); }
.phl-footer-cta { background: var(--primary); color: #fff; padding: 3.5rem 24px; text-align: center; }
.phl-footer-cta h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); margin-bottom: 0.75rem; color: #fff; }
.phl-footer-cta p { font-size: 0.95rem; margin-bottom: 1.5rem; opacity: 0.85; max-width: 520px; margin-left: auto; margin-right: auto; }
.phl-footer-cta .phl-btn-primary { border-color: #fff; color: #fff; }
.phl-footer-cta .phl-btn-primary:hover { background: #fff; color: var(--primary); }
.phl-footer-bottom { background: var(--bg); padding: 2.5rem 0; border-top: 1px solid var(--border); }
.phl-footer-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 2.5rem; }
.phl-footer-logo { font-size: clamp(1.2rem, 7vw, 2rem); font-weight: 600; margin-bottom: 0.75rem; font-family: 'Cormorant Garamond', serif; overflow-wrap: anywhere; }
.phl-footer-desc { font-size: 0.85rem; opacity: 0.75; overflow-wrap: break-word; }
.phl-footer-col h4 { font-size: 0.8rem; margin-bottom: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; font-family: 'Work Sans', sans-serif; font-weight: 600; }
.phl-footer-col ul { list-style: none; padding: 0; margin: 0; }
.phl-footer-col li { margin-bottom: 0.5rem; }
.phl-footer-col a { color: var(--text); font-size: 0.85rem; opacity: 0.8; }
.phl-footer-col a:hover { color: var(--accent); opacity: 1; }
@media (max-width: 768px) { .phl-footer-grid { grid-template-columns: 1fr; } }
