/*
 * Theme Name: Ontario Pergola
 * Author: Hunter Lovering
 * Description: Custom theme for Ontario Pergola (mobile-optimized + unified Lora styling)
 * Version: 1.3
 * License: GNU General Public License v2 or later
 * Text Domain: ontario-pergola
 */

/* Import Google Font */
@import url('https://fonts.googleapis.com/css2?family=Lora:wght@400;500;600;700&display=swap');

/* -----------------------------
 * Global Styles
 * ----------------------------- */
*,
*::before,
*::after {
    font-family: 'Lora', serif !important;
    box-sizing: border-box;
}

body {
    font-size: 16px;
    line-height: 1.6;
    color: #222;
    margin: 0;
    padding: 0;
    background-color: #fff;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    margin: 0 0 1em;
}

p, a, li, span {
    word-wrap: break-word;
}

/* Links */
a {
    color: #f06804;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #ff7a2d;
}

/* -----------------------------
 * Header & Navigation
 * ----------------------------- */
.site-header {
    width: 100%;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 20px;
    flex-wrap: wrap;
    background-color: #fff;
}

.logo img {
    display: block;
    margin: 0;
    width: 207px;
    max-width: 100%;
    height: auto;
}

.social-links {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.social-links .follow-us {
    color: #f06804;
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
}

.social-links ul {
    display: flex;
    gap: 10px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.social-links ul li a {
    width: 32px;
    height: 32px;
}

/* Navigation */
.header-nav {
    background-color: #ffaa6c;
    padding: 20px;
}

.main-navigation .main-menu {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}

.main-navigation .main-menu li a {
    color: #ffffff;
    font-size: 1.4rem;
    font-weight: 600;
    transition: color 0.2s ease;
}

.main-navigation .main-menu li a:hover {
    color: #fff5ee;
}

.main-navigation .main-menu li.current-menu-item a {
    font-weight: 700;
}

/* -----------------------------
 * Footer
 * ----------------------------- */
footer.wp-block-group.alignfull.has-background.has-global-padding.is-layout-constrained {
    padding: 60px 20px;
    background-color: #ffffff;
    text-align: center;
}

.wp-block-social-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5em;
}

.wp-social-link a {
    color: #f06804;
}

.wp-social-link svg {
    width: 24px;
    height: 24px;
    vertical-align: middle;
}

/* -----------------------------
 * General Styles
 * ----------------------------- */
strong {
    color: #FF6422 !important;
}

.has-link-color a {
    color: #f06804;
}

/* -----------------------------
 * Heading Sizes
 * ----------------------------- */
.wp-block-heading.has-xx-large-font-size {
    font-size: 100px;
}

.wp-block-heading.has-x-large-font-size {
    font-size: 64px;
}

.wp-block-heading.has-gfs-didot-font-family {
    color: #FFAA6C;
}

/* -----------------------------
 * Pergola Section Styles
 * ----------------------------- */
section h3.wp-block-heading {
    font-size: 4rem !important;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.wp-block-columns.alignwide {
    max-width: 2200px;
    margin: 0 auto;
    padding: 0 40px;
}

.hover-tile:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.hover-tile img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
}

/* -----------------------------
 * Pergola Page Layout
 * ----------------------------- */
.pergola-page {
    display: flex;
    flex-direction: column;
    gap: 100px;
    padding: 50px 20px;
}

.pergola-link {
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.pergola-link:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 25px rgba(0,0,0,0.2);
}

.pergola-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

.pergola-section {
    display: flex;
    align-items: center;
    gap: 40px;
}

.pergola-section.reverse {
    flex-direction: row-reverse;
}

.pergola-text {
    max-width: 500px;
}

.pergola-text h2 {
    font-size: 56px;
    color: #FFAA6C;
    margin-bottom: 15px;
}

.pergola-text p {
    font-size: 22px;
    color: #000;
    line-height: 1.6;
}

.pergola-image img {
    width: 80%;
    max-width: 400px;
    border-radius: 10px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.pergola-calculator-wrapper {
    display: flex;
    gap: 40px;
    max-width: 1200px;
    margin: 50px auto;
    padding: 0 20px;
}

/* Tiles for calculator & bullets */
.tile {
    background-color: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* Left/Right width */
.why-choose {
    flex: 1;
    min-width: 280px;
}

.pergola-calculator-container {
    flex: 1;
    min-width: 280px;
}

/* Bullets styling */
.why-choose ul {
    list-style: disc inside;
    padding-left: 0;
    margin-top: 15px;
}

.why-choose ul li {
    margin-bottom: 10px;
    font-size: 18px;
}

/* Calculator specific styling inside tile */
.pergola-calculator-container h2 {
    color: #FFAA6C;
    margin-bottom: 25px;
    font-size: 28px;
}

.pergola-calculator-container label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.pergola-calculator-container select,
.pergola-calculator-container input {
    margin-bottom: 15px;
    padding: 10px;
    width: 100%;
    max-width: 300px;
}

.pergola-calculator-container .price-output {
    font-weight: bold;
    font-size: 1.2em;
    margin: 20px 0;
}

.pergola-calculator-container button {
    background-color: #FFAA6C;
    border: none;
    padding: 12px 25px;
    color: #fff;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
}

/* -----------------------------
 * Responsive Adjustments
 * ----------------------------- */

/* Tablets */
@media (max-width: 1024px) {
    .main-menu a {
        font-size: 1.2rem;
    }
    section h3.wp-block-heading {
        font-size: 3rem !important;
    }
    .pergola-text h2 {
        font-size: 46px;
    }
}

/* Mobile phones */
@media (max-width: 768px) {
    .header-top {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .main-navigation .main-menu {
        flex-direction: column;
        gap: 15px;
    }

    .main-navigation .main-menu li a {
        font-size: 1.2rem;
    }

    .pergola-calculator-wrapper {
        flex-direction: column;
        gap: 30px;
    }

    .why-choose {
        margin-top: 30px;
    }

    .pergola-text h2 {
        font-size: 38px;
    }

    footer.wp-block-group.alignfull.has-background.has-global-padding.is-layout-constrained {
        padding: 40px 20px;
        font-size: 14px;
    }

    .footer-top {
        flex-direction: column !important;
        gap: 30px !important;
    }
    .footer-links {
        flex-direction: column !important;
        margin-left: 0 !important;
        gap: 30px !important;
    }
    .footer-bottom {
        text-align: center !important;
        justify-content: center !important;
    }
}

/* Extra-small devices */
@media (max-width: 480px) {
    .main-menu a {
        font-size: 1rem;
    }
    .pergola-text h2 {
        font-size: 32px;
    }
    .hover-tile img {
        height: 140px;
    }
    section h3.wp-block-heading {
        font-size: 2rem !important;
    }
    .logo img {
        width: 160px;
    }
}

/* -----------------------------
 * Modal Styles (Updated for Centering)
 * ----------------------------- */
.form-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background-color: rgba(0,0,0,0.6);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    overflow-y: auto;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.form-modal.active {
    opacity: 1;
    visibility: visible;
}

.form-modal-content {
    background-color: #fff;
    padding: 30px 40px;
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    text-align: center;
    animation: modalFadeIn 0.35s ease;
}

.form-modal-content h2 {
    color: #FFAA6C;
    margin-bottom: 15px;
}

.form-modal-content p {
    font-size: 16px;
    color: #333;
    margin-bottom: 25px;
}

.modal-close-btn {
    background-color: #FFAA6C;
    border: none;
    color: #fff;
    font-weight: bold;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
}

@keyframes modalFadeIn {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}
