/*
 Theme Name:   ThAD Theme
 Theme URI:    https://thadapp.com
 Description:  GeneratePress child theme with ThAD branding — navy/sky-blue palette, Montserrat typography.
 Author:       ThAD Team
 Author URI:   https://thadapp.com
 Template:     generatepress
 Version:      1.2.1-beta
 License:      GPL-2.0-or-later
 Text Domain:  thad-theme
*/

/* ==========================================================================
   Custom Properties
   ========================================================================== */

:root {
    --thad-navy: #1A3E6D;
    --thad-sky: #4DA8DA;
    --thad-navy-light: #2A5A9A;
    --thad-sky-light: #7CC4E8;
    --thad-white: #FFFFFF;
    --thad-off-white: #F7F9FC;
    --thad-gray: #6B7280;
    --thad-dark: #111827;
}

/* ==========================================================================
   Typography
   ========================================================================== */

body {
    font-family: 'Montserrat', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-weight: 700;
    color: var(--thad-navy);
}

h1 { font-size: 1.8rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

.site-header {
    background-color: var(--thad-navy);
    border-bottom: 3px solid var(--thad-sky);
}

/* Custom logo sizing */
.header-image.is-logo-image {
    max-height: 80px;
    width: auto;
    height: auto;
    vertical-align: middle;
}

.main-title a,
.site-title a {
    color: var(--thad-white) !important;
    font-weight: 700;
    text-decoration: none;
}

.inside-navigation {
    background-color: var(--thad-navy);
}

.main-navigation .main-nav ul li a,
.main-navigation .menu-toggle {
    color: var(--thad-white);
    font-weight: 500;
}

.main-navigation .main-nav ul li a:hover,
.main-navigation .main-nav ul li.current-menu-item a {
    color: var(--thad-sky);
}

/* Navigation dropdown */
.main-navigation .main-nav ul ul {
    background-color: var(--thad-navy);
    border-top: 2px solid var(--thad-sky);
}

.main-navigation .main-nav ul ul li a {
    color: var(--thad-white);
}

.main-navigation .main-nav ul ul li a:hover {
    color: var(--thad-sky);
    background-color: var(--thad-navy-light);
}

/* ==========================================================================
   Links & Buttons
   ========================================================================== */

a {
    color: var(--thad-sky);
    transition: color 0.2s ease;
}

a:hover {
    color: var(--thad-navy);
}

.entry-content a {
    color: var(--thad-navy-light);
    text-decoration: underline;
    text-decoration-color: var(--thad-sky);
    text-underline-offset: 2px;
}

.entry-content a:hover {
    color: var(--thad-navy);
    text-decoration-color: var(--thad-navy);
}

button,
.button,
.wp-block-button__link,
input[type="submit"] {
    background-color: var(--thad-sky);
    color: var(--thad-white);
    border: none;
    border-radius: 4px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    padding: 10px 24px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

button:hover,
.button:hover,
.wp-block-button__link:hover,
input[type="submit"]:hover {
    background-color: var(--thad-navy);
    color: var(--thad-white);
}

/* Secondary / outline button */
.wp-block-button.is-style-outline .wp-block-button__link {
    background-color: transparent;
    color: var(--thad-navy);
    border: 2px solid var(--thad-navy);
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
    background-color: var(--thad-navy);
    color: var(--thad-white);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
    background-color: var(--thad-navy);
    color: var(--thad-white);
    border-top: 3px solid var(--thad-sky);
}

.site-footer a {
    color: var(--thad-sky-light);
}

.site-footer a:hover {
    color: var(--thad-white);
}

.site-info {
    color: rgba(255, 255, 255, 0.7);
    background-color: var(--thad-navy);
}

.site-info a {
    color: var(--thad-sky-light);
}

.inside-site-info {
    background-color: var(--thad-navy);
    color: rgba(255, 255, 255, 0.7);
}

/* ==========================================================================
   Content Area
   ========================================================================== */

.entry-title a {
    color: var(--thad-navy);
}

.entry-title a:hover {
    color: var(--thad-sky);
}

.entry-meta a {
    color: var(--thad-gray);
}

.entry-meta a:hover {
    color: var(--thad-navy);
}

/* ==========================================================================
   Sidebar & Widgets
   ========================================================================== */

.widget-title {
    color: var(--thad-navy);
    border-bottom: 2px solid var(--thad-sky);
    padding-bottom: 8px;
}

/* ==========================================================================
   Forms
   ========================================================================== */

input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
textarea {
    border: 1px solid #D1D5DB;
    border-radius: 4px;
    font-family: 'Montserrat', sans-serif;
    transition: border-color 0.2s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
textarea:focus {
    border-color: var(--thad-sky);
    outline: none;
    box-shadow: 0 0 0 2px rgba(77, 168, 218, 0.25);
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.thad-bg-navy {
    background-color: var(--thad-navy);
    color: var(--thad-white);
}

.thad-bg-sky {
    background-color: var(--thad-sky);
    color: var(--thad-white);
}

.thad-bg-light {
    background-color: var(--thad-off-white);
}

.thad-text-navy {
    color: var(--thad-navy);
}

.thad-text-sky {
    color: var(--thad-sky);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

/* ==========================================================================
   Page Templates
   ========================================================================== */

/* --- Landing Page Template --- */

.template-landing .hero {
    background-color: var(--thad-navy);
    color: var(--thad-white);
    text-align: center;
    padding: 80px 20px;
}

.template-landing .hero-inner {
    max-width: 800px;
    margin: 0 auto;
}

.template-landing .hero h1 {
    color: var(--thad-white);
    font-size: 2.8rem;
    margin-bottom: 16px;
    line-height: 1.2;
}

.template-landing .hero .subtitle {
    color: var(--thad-sky-light);
    font-size: 1.25rem;
    margin-bottom: 32px;
    line-height: 1.6;
}

.template-landing .hero .cta-button {
    display: inline-block;
    background-color: var(--thad-sky);
    color: var(--thad-white);
    padding: 14px 36px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 1.1rem;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.template-landing .hero .cta-button:hover {
    background-color: var(--thad-sky-light);
    color: var(--thad-navy);
}

.template-landing .landing-content {
    max-width: 960px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Break out of GP's containers for full-width landing.
   Body class: page-template-template-landing
   GP constraints to override:
     .grid-container         → max-width: 1200px
     .site-content .content-area → width: 70%
     .separate-containers .site-main → margin: 20px
     .separate-containers .inside-article → padding: 40px */
body.page-template-template-landing .grid-container,
body.page-template-template-landing #page {
    max-width: 100%;
}

body.page-template-template-landing .site-content .content-area {
    width: 100%;
}

body.page-template-template-landing.separate-containers .site-main {
    margin: 0;
}

body.page-template-template-landing.separate-containers .inside-article,
body.page-template-template-landing.separate-containers .landing-content {
    padding: 0;
    background: none;
    box-shadow: none;
    border: none;
    margin-bottom: 0;
}

/* Feature columns — equal height, aligned titles, links pinned to bottom */
.template-landing .wp-block-columns .wp-block-column {
    display: flex;
    flex-direction: column;
}

body.page-template-template-landing .wp-block-column h3.wp-block-heading {
    min-height: 70px !important;
    display: flex !important;
    align-items: flex-end;
    justify-content: center;
}

.template-landing .wp-block-columns .wp-block-column > p:not(.has-small-font-size) {
    flex-grow: 1;
}

.template-landing .wp-block-columns .wp-block-column > .has-small-font-size:last-child {
    margin-top: auto;
}

/* Intro paragraph — keep it readable, not hero-sized */
.template-landing .landing-content .entry-content > .has-large-font-size {
    font-size: 1.15rem;
    line-height: 1.7;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

/* Comparison table — narrow label column, top-aligned cells */
.template-landing .wp-block-table td,
.template-landing .wp-block-table th {
    vertical-align: top;
}

.template-landing .wp-block-table td:first-child,
.template-landing .wp-block-table th:first-child {
    width: 20%;
}

.template-landing .wp-block-table td:nth-child(2),
.template-landing .wp-block-table th:nth-child(2),
.template-landing .wp-block-table td:nth-child(3),
.template-landing .wp-block-table th:nth-child(3) {
    width: 40%;
}

/* --- Documentation Template --- */

.template-docs #primary {
    max-width: 760px;
    margin: 0 auto;
    padding: 40px 20px;
    width: 100%;
}

.template-docs .entry-header {
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--thad-sky);
}

.template-docs .entry-content {
    line-height: 1.8;
}

.template-docs .entry-content h2 {
    margin-top: 48px;
    margin-bottom: 16px;
}

.template-docs .entry-content h2:first-of-type {
    margin-top: 0;
}

.template-docs .entry-content h3 {
    margin-top: 32px;
    margin-bottom: 12px;
}

/* --- Release Notes Template --- */

.template-release-notes #primary {
    max-width: 760px;
    margin: 0 auto;
    padding: 40px 20px;
    width: 100%;
}

.template-release-notes .entry-header {
    margin-bottom: 32px;
}

.template-release-notes .entry-content h2 {
    border-left: 4px solid var(--thad-sky);
    padding-left: 16px;
    margin-top: 48px;
    margin-bottom: 16px;
    font-size: 1.5rem;
}

.template-release-notes .entry-content h2:first-of-type {
    margin-top: 0;
}

.template-release-notes .entry-content h3 {
    color: var(--thad-gray);
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 24px;
}

.template-release-notes .entry-content ul {
    margin-bottom: 24px;
}

/* --- Legal Template --- */

.template-legal #primary {
    max-width: 700px;
    margin: 0 auto;
    padding: 40px 20px;
    width: 100%;
}

.template-legal .entry-header {
    margin-bottom: 24px;
}

.template-legal .last-updated {
    color: var(--thad-gray);
    font-size: 0.875rem;
    font-style: italic;
    margin-top: 4px;
}

.template-legal .entry-content {
    font-size: 0.925rem;
    color: var(--thad-dark);
    line-height: 1.8;
}

.template-legal .entry-content h2 {
    font-size: 1.25rem;
    margin-top: 40px;
    margin-bottom: 12px;
}

.template-legal .entry-content h3 {
    font-size: 1.1rem;
    margin-top: 28px;
}

/* ==========================================================================
   Force hamburger menu at all screen widths
   ========================================================================== */

/* Hamburger toggle — always visible */
.main-navigation .menu-toggle,
.sidebar-nav-mobile:not(#sticky-placeholder) {
    display: block !important;
}

.main-navigation .menu-toggle {
    color: var(--thad-white) !important;
    font-size: 1rem;
    padding: 10px 20px;
    background-color: transparent !important;
}

.main-navigation .menu-toggle:hover,
.main-navigation .menu-toggle:focus {
    color: var(--thad-sky) !important;
    background-color: transparent !important;
}

/* Hide nav by default, show as compact dropdown on hover */
.main-navigation .main-nav > ul {
    display: none !important;
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    background-color: var(--thad-navy);
    min-width: 180px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border-top: 2px solid var(--thad-sky);
    padding: 8px 0 !important;
    margin: 0 !important;
}

.main-navigation .main-nav > ul > li {
    float: none !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}

.main-navigation .main-nav > ul > li > a {
    padding: 8px 20px !important;
    display: block;
    white-space: nowrap;
    font-size: 0.9rem !important;
    line-height: 1.4 !important;
}

/* Show on hover or when toggled */
.main-navigation:hover .main-nav > ul,
.main-navigation.toggled .main-nav > ul {
    display: block !important;
}

/* Position dropdown relative to the menu toggle */
.main-navigation .main-nav {
    position: relative;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .main-navigation .menu-toggle {
        color: var(--thad-white);
    }

    .main-navigation .main-nav ul li a {
        padding: 12px 20px;
    }

    /* Landing hero mobile adjustments */
    .template-landing .hero {
        padding: 48px 16px;
    }

    .template-landing .hero h1 {
        font-size: 2rem;
    }

    .template-landing .hero .subtitle {
        font-size: 1.1rem;
    }
}
