/*
Theme Name: Типографъ.рф
Theme URI: https://tipograf.rf
Author: Типографъ
Author URI: https://tipograf.rf
Description: Тема WordPress для типографии в стилистике газеты середины XIX века. Потёртая газетная бумага, типографские шрифты, сепия.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tipograf
Tags: one-page, custom-logo, custom-background, theme-options
*/

/* ========================================
   CSS RESET & BASE
   ======================================== */

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

html {
    scroll-behavior: smooth;
}

/* ========================================
   CSS VARIABLES — DARK WORN PAPER PALETTE
   ======================================== */

:root {
    --paper:        #C4AD82;
    --paper-mid:    #B8A070;
    --paper-dark:   #A89060;
    --paper-light:  #D4BD92;
    --ink:          #120800;
    --ink-soft:     #2A1A0A;
    --sepia:        #5A3E1E;
    --sepia-lt:     #8A6A3E;
    --border:       #6A4E2A;
    --card-bg:      #B49A6C;
    --card-dark:    #A48A5C;
    --accent:       #7A5028;

    --font-blackletter: 'UnifrakturMaguntia', cursive;
    --font-display:     'Playfair Display', serif;
    --font-body:        'IM Fell English', serif;
    --font-secondary:   'Libre Baskerville', serif;
}

/* ========================================
   BODY & PAGE WRAPPER
   ======================================== */

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--paper-dark);
    -webkit-font-smoothing: antialiased;
}

.site-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--paper);
    position: relative;
    overflow: hidden;
    border-left: 2px solid var(--border);
    border-right: 2px solid var(--border);
    min-height: 100vh;
}

/* ========================================
   TEXTURE OVERLAYS
   ======================================== */

.texture-noise,
.texture-foxing,
.texture-water,
.texture-edges {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
}

.texture-noise {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='5' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.1'/%3E%3C/svg%3E");
    opacity: 0.55;
    mix-blend-mode: multiply;
}

.texture-foxing {
    background:
        radial-gradient(ellipse 80px 50px at 12% 8%, rgba(100,60,20,0.16) 0%, transparent 70%),
        radial-gradient(ellipse 120px 60px at 85% 15%, rgba(80,40,10,0.12) 0%, transparent 70%),
        radial-gradient(ellipse 60px 90px at 5% 55%, rgba(90,50,15,0.14) 0%, transparent 70%),
        radial-gradient(ellipse 100px 70px at 92% 45%, rgba(70,35,10,0.10) 0%, transparent 70%),
        radial-gradient(ellipse 70px 40px at 30% 75%, rgba(100,55,15,0.13) 0%, transparent 70%),
        radial-gradient(ellipse 50px 80px at 75% 85%, rgba(85,45,12,0.11) 0%, transparent 70%);
    mix-blend-mode: multiply;
}

.texture-water {
    background:
        radial-gradient(ellipse 200px 300px at 0% 30%, rgba(140,100,50,0.18) 0%, transparent 60%),
        radial-gradient(ellipse 250px 180px at 100% 70%, rgba(120,80,30,0.13) 0%, transparent 55%),
        radial-gradient(ellipse 300px 200px at 50% 100%, rgba(100,70,25,0.15) 0%, transparent 50%);
    mix-blend-mode: multiply;
}

.texture-edges {
    box-shadow:
        inset 0 0 60px rgba(80,50,20,0.3),
        inset 0 0 120px rgba(60,30,10,0.12),
        inset 0 0 200px rgba(40,20,5,0.06);
}

/* ========================================
   HEADER / MASTHEAD
   ======================================== */

.site-header {
    text-align: center;
    border-bottom: 4px double var(--ink);
    padding: 20px 30px 0;
    position: relative;
    z-index: 10;
}

.masthead-date {
    font-family: var(--font-body);
    font-size: 18px;
    color: var(--sepia);
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.masthead-rule {
    border: none;
    border-top: 2px solid var(--ink);
    margin: 0 0 8px;
}

.site-title {
    font-family: var(--font-blackletter);
    font-size: 72px;
    line-height: 1;
    color: var(--ink);
    margin: 0;
    letter-spacing: 3px;
    text-shadow:
        2px 2px 0 rgba(18,8,0,0.25),
        -1px -1px 0 rgba(18,8,0,0.1),
        3px 1px 2px rgba(18,8,0,0.15),
        0 0 8px rgba(18,8,0,0.06);
}

.site-title a {
    color: inherit;
    text-decoration: none;
}

.masthead-subtitle {
    font-family: var(--font-body);
    font-style: italic;
    font-size: 18px;
    color: var(--sepia);
    letter-spacing: 2px;
    margin: 6px 0 10px;
}

.masthead-ornament {
    color: var(--sepia);
    font-size: 20px;
    letter-spacing: 10px;
    margin: 6px 0 8px;
}

/* Custom logo */
.custom-logo-link {
    display: inline-block;
    margin-bottom: 8px;
}

.custom-logo {
    max-height: 120px;
    width: auto;
    filter: sepia(0.4) contrast(1.1);
}

img.custom-logo {
	height: auto;
	width: auto;
	max-width: 100%;
}

/* ========================================
   NAVIGATION
   ======================================== */

.main-navigation {
    border-top: 1px solid var(--ink-soft);
    border-bottom: 2px solid var(--ink-soft);
    padding: 8px 0;
}

.main-navigation ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 0;
    flex-wrap: wrap;
}

.main-navigation li {
    border-right: 1px solid var(--border);
}

.main-navigation li:last-child {
    border-right: none;
}

.main-navigation a {
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--ink);
    text-decoration: none;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 4px 18px;
    display: block;
    text-shadow: 0.5px 0.5px 0 rgba(18,8,0,0.2);
    transition: color 0.3s ease;
}

.main-navigation a:hover {
    color: var(--sepia);
}

/* ========================================
   CONTACTS BAR
   ======================================== */

.contacts-bar {
    background: var(--ink);
    color: var(--paper);
    display: flex;
    justify-content: center;
    gap: 30px;
    padding: 8px 20px;
    flex-wrap: wrap;
    position: relative;
    z-index: 10;
}

.contacts-bar .contact-item {
    font-family: var(--font-body);
    font-size: 18px;
	font-weight: 400;
    letter-spacing: 1.5px;
    color: var(--paper);
}

.contacts-bar a {
	font-family: serif;
    color: var(--paper-light);
    text-decoration: none;
}

.contacts-bar a:hover {
    color: #fff;
}

/* ========================================
   SECTION HEADERS
   ======================================== */

.section-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 30px 8px;
    position: relative;
    z-index: 10;
}

.section-rule {
    flex: 1;
    height: 1px;
    background: var(--border);
}

.section-title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--sepia);
    white-space: nowrap;
}

/* ========================================
   HERO SECTION
   ======================================== */

.hero-section {
    padding: 40px 50px 35px;
    text-align: center;
    border-bottom: 4px double var(--border);
    position: relative;
    z-index: 10;
}

.hero-section::before,
.hero-section::after {
    content: '\2767';
    color: var(--sepia-lt);
    font-size: 20px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.hero-section::before { left: 16px; }
.hero-section::after { right: 16px; transform: translateY(-50%) scaleX(-1); }

.hero-headline {
    font-family: var(--font-display);
    font-size: 42px;
    font-weight: 900;
    line-height: 1.2;
    color: var(--ink);
    margin: 0 0 16px;
    text-shadow:
        1.5px 1.5px 0 rgba(18,8,0,0.2),
        -0.5px 0 0 rgba(18,8,0,0.12),
        0 0 6px rgba(18,8,0,0.06);
}

.hero-text {
    font-family: var(--font-body);
    font-style: italic;
    font-size: 18px;
    color: var(--sepia);
    line-height: 1.8;
    max-width: 800px;
    margin: 0 auto;
}

/* ========================================
   SERVICES GRID
   ======================================== */

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    padding: 16px 30px 30px;
    position: relative;
    z-index: 10;
}

.service-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    text-align: center;
    overflow: hidden;
    position: relative;
    transition: transform 0.2s ease;
}

.service-card:hover {
    transform: translateY(-2px);
}

.service-card::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 50px 35px at 20% 20%, rgba(90,50,10,0.12) 0%, transparent 70%),
        radial-gradient(ellipse 35px 45px at 80% 70%, rgba(70,40,10,0.08) 0%, transparent 70%);
    mix-blend-mode: multiply;
}

.service-card-image {
    height: 180px;
    background: var(--card-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.service-card-image::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 2px,
        rgba(18,8,0,0.05) 2px,
        rgba(18,8,0,0.05) 3px
    );
    z-index: 1;
}

.service-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: sepia(0.7) contrast(1.05) brightness(0.9);
}

.service-card-image .placeholder-icon {
    font-size: 48px;
    color: var(--sepia);
    opacity: 0.4;
    z-index: 2;
}

.service-card-body {
    padding: 12px 14px;
}

.service-card-title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    color: var(--ink);
    margin: 0 0 6px;
    line-height: 1.3;
    text-shadow: 0.5px 0.5px 0 rgba(18,8,0,0.15);
}

.service-card-desc {
    font-family: var(--font-body);
    font-style: italic;
    font-size: 13px;
    color: var(--sepia);
    margin: 0 0 10px;
    line-height: 1.5;
}

.service-card-price {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 900;
    color: var(--ink-soft);
    border-top: 1px solid var(--border);
    padding-top: 8px;
    margin-top: 4px;
}

/* ========================================
   MAP SECTION
   ======================================== */

.map-section {
    padding: 16px 30px 30px;
    border-top: 4px double var(--border);
    position: relative;
    z-index: 10;
}

.map-container {
    border: 2px solid var(--border);
    height: 400px;
    position: relative;
    overflow: hidden;
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: 0;
    filter: sepia(0.5) contrast(1.05) brightness(0.9);
}

/* ========================================
   CONTACT FORM
   ======================================== */

.feedback-section {
    padding: 16px 30px 30px;
    border-top: 1px solid var(--border);
    position: relative;
    z-index: 10;
}

.feedback-section .wpcf7 {
    max-width: 700px;
    margin: 0 auto;
}

.feedback-form {
    max-width: 700px;
    margin: 0 auto;
}

.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
}

.form-field {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-field.full-width {
    width: 100%;
}

.form-label,
.feedback-section label {
    font-family: var(--font-body);
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--sepia);
}

.form-input,
.feedback-section input[type="text"],
.feedback-section input[type="email"],
.feedback-section input[type="tel"],
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"] {
    background: var(--paper-mid) !important;
    border: 1px solid var(--border) !important;
    padding: 8px 12px !important;
    font-family: var(--font-body) !important;
    font-size: 14px !important;
    color: var(--ink) !important;
    outline: none !important;
    border-radius: 0 !important;
    width: 100%;
}

.form-textarea,
.feedback-section textarea,
.wpcf7 textarea {
    background: var(--paper-mid) !important;
    border: 1px solid var(--border) !important;
    padding: 8px 12px !important;
    font-family: var(--font-body) !important;
    font-size: 14px !important;
    color: var(--ink) !important;
    width: 100% !important;
    resize: vertical;
    min-height: 120px;
    outline: none !important;
    border-radius: 0 !important;
}

.form-input:focus,
.form-textarea:focus,
.feedback-section input:focus,
.feedback-section textarea:focus,
.wpcf7 input:focus,
.wpcf7 textarea:focus {
    border-color: var(--ink-soft) !important;
    box-shadow: 0 0 0 1px var(--sepia-lt);
}

.form-submit,
.feedback-section input[type="submit"],
.wpcf7 input[type="submit"] {
    background: var(--ink) !important;
    color: var(--paper) !important;
    border: none !important;
    padding: 10px 32px !important;
    font-family: var(--font-display) !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    letter-spacing: 3px !important;
    text-transform: uppercase !important;
    cursor: pointer;
    margin-top: 8px;
    border-radius: 0 !important;
    transition: background 0.3s ease;
}

.form-submit:hover,
.feedback-section input[type="submit"]:hover,
.wpcf7 input[type="submit"]:hover {
    background: var(--ink-soft) !important;
}

/* CF7 overrides */
.wpcf7-form p {
    margin-bottom: 12px;
}

.wpcf7-response-output {
    font-family: var(--font-body) !important;
    font-style: italic;
    border-color: var(--border) !important;
    color: var(--sepia) !important;
}

/* ========================================
   FOOTER
   ======================================== */

.site-footer {
    background: var(--ink);
    color: var(--sepia-lt);
    text-align: center;
    padding: 14px 20px;
    font-family: var(--font-body);
    font-style: italic;
    font-size: 13px;
    letter-spacing: 2px;
    position: relative;
    z-index: 10;
}

.site-footer a {
    color: var(--paper-light);
    text-decoration: none;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .site-title {
        font-size: 42px;
    }

    .hero-headline {
        font-size: 28px;
    }

    .hero-section {
        padding: 24px 20px;
    }

    .hero-section::before,
    .hero-section::after {
        display: none;
    }

    .services-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 10px;
        padding: 12px 16px 20px;
    }

    .service-card-image {
        height: 120px;
    }

    .contacts-bar {
        flex-direction: column;
        align-items: center;
        gap: 6px;
    }

    .form-row {
        flex-direction: column;
        gap: 8px;
    }

    .section-header {
        padding: 16px 16px 6px;
    }

    .map-container {
        height: 280px;
    }

    .main-navigation ul {
        flex-wrap: wrap;
        justify-content: center;
    }

    .main-navigation li {
        border-right: none;
    }

    .masthead-date {
        font-size: 10px;
        letter-spacing: 2px;
    }
}

@media (max-width: 480px) {
    .site-title {
        font-size: 32px;
    }

    .hero-headline {
        font-size: 22px;
    }

    .services-grid {
        grid-template-columns: 1fr 1fr;
    }

    .service-card-title {
        font-size: 13px;
    }

    .service-card-desc {
        font-size: 11px;
    }

    .service-card-price {
        font-size: 14px;
    }
}
