/* Styles for page.php, moved out of the template's inline <style> block unchanged (2026-11-10).
   Enqueued from page.php after every other stylesheet, so the cascade order is the same as before. */

/* Default Page Template Styles */
.default-page-wrapper {
    background: white;
}

/* Hero Section */
.default-page-hero {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #0f1f35 100%);
    padding: var(--spacing-xxl) 0;
    position: relative;
    overflow: hidden;
}

.default-page-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M0 0h40v40H0V0zm40 40h40v40H40V40z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.default-page-hero .container {
    position: relative;
    z-index: 1;
}

.default-hero-content {
    max-width: 900px;
}

.default-page-title {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.2;
    color: white;
    margin-bottom: var(--spacing-md);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.default-page-excerpt {
    font-size: 1.25rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: var(--spacing-lg);
}

/* Author Byline with Hover Tooltips */
.page-byline {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: var(--spacing-md);
    line-height: 1.8;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.page-byline .separator {
    color: rgba(255, 255, 255, 0.5);
    margin: 0 4px;
}

.author-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: border-color 0.2s ease;
    flex-shrink: 0;
}

.author-name-hover {
    position: relative;
    font-weight: 700;
    color: white;
    cursor: pointer;
    border-bottom: 2px dotted rgba(255, 255, 255, 0.5);
    transition: border-color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 2px;
}

.author-name-hover:hover {
    border-bottom-color: white;
}

.author-tooltip {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    background: white;
    color: var(--primary-dark);
    padding: var(--spacing-md);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    width: 320px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 100;
    font-size: 0.875rem;
    line-height: 1.6;
    pointer-events: none;
    font-weight: 400;
}

.author-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: white;
}

.author-tooltip strong {
    color: var(--primary-dark);
    font-size: 1rem;
}

.author-tooltip em {
    color: var(--primary-blue);
    font-size: 0.85rem;
}

.author-name-hover:hover .author-tooltip {
    opacity: 1;
    visibility: visible; /* appears in place: no transform on hover (CLAUDE.md design rules) */
}

/* Page Meta */
.page-meta-info {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.9);
}

.page-meta-info > * {
    display: flex;
    align-items: center;
    gap: 6px;
}

.page-meta-info svg {
    opacity: 0.8;
}

/* Content Section */
.default-page-content {
    padding: var(--spacing-xxl) 0;
}

.default-content-grid {
    display: grid;
    /* A readable text column (about 70 characters a line at 18px) beside the sidebar, centred.
       minmax(0, ...) lets the article shrink below a wide child instead of widening the page (2026-11-10). */
    grid-template-columns: minmax(0, 720px) 350px;
    justify-content: center;
    align-items: start;
    gap: var(--spacing-xl);
}

.default-content-grid > * {
    min-width: 0;
}

/* Main Content Gutenberg Support */
.default-main-content {
    max-width: 100%;
    overflow-wrap: break-word;
}

.default-main-content video,
.default-main-content iframe,
.default-main-content embed,
.default-main-content figure {
    max-width: 100%;
}

.default-main-content table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
}

.default-main-content .wp-block-table {
    max-width: 100%;
    overflow-x: auto;
}

.default-main-content .wp-block-table table {
    display: table;
}

.default-main-content pre {
    max-width: 100%;
    overflow-x: auto;
}

/* Table cells keep words whole and a minimum width; a table wider than the column scrolls. */
.default-main-content th,
.default-main-content td {
    min-width: 6.5rem;
    overflow-wrap: normal;
    word-break: normal;
}

.default-main-content > * {
    margin-bottom: var(--spacing-lg);
}

.default-main-content h1,
.default-main-content h2,
.default-main-content h3,
.default-main-content h4,
.default-main-content h5,
.default-main-content h6 {
    margin-top: var(--spacing-xl);
    margin-bottom: var(--spacing-md);
    color: var(--primary-dark);
}

.default-main-content h2 {
    font-size: 2rem;
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--light-gray);
}

.default-main-content h3 {
    font-size: 1.5rem;
}

.default-main-content p {
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--dark-gray);
}

.default-main-content ul,
.default-main-content ol {
    padding-left: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    font-size: 1.125rem;
}

.default-main-content li {
    margin-bottom: var(--spacing-sm);
    line-height: 1.7;
}

.default-main-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.default-main-content blockquote {
    border: 1px solid #dfe6ef; /* card, not a left accent bar (2026-11-10) */
    padding-left: var(--spacing-lg);
    margin: var(--spacing-xl) 0;
    font-style: italic;
    color: var(--secondary-blue);
    border-radius: 12px;
    background: #f5f8fc;
}

/* Gutenberg Block Styles */
.default-main-content .wp-block-image {
    margin: var(--spacing-xl) 0;
}

.default-main-content .wp-block-quote {
    border: 1px solid #dfe6ef; /* card, not a left accent bar (2026-11-10) */
    padding-left: var(--spacing-lg);
    margin: var(--spacing-xl) 0;
    border-radius: 12px;
    background: #f5f8fc;
}

.default-main-content .wp-block-button__link {
    background: var(--primary-blue);
    color: white;
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: 6px;
    text-decoration: none;
    display: inline-block;
    font-weight: 600;
}

/* Sidebar Widgets */
.default-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.sidebar-widget {
    background: white;
    padding: var(--spacing-lg);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.sidebar-widget h3 {
    color: var(--primary-dark);
    font-size: 1.25rem;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--light-gray);
}

.sidebar-widget p {
    color: var(--dark-gray);
    line-height: 1.6;
    margin-bottom: var(--spacing-md);
}

/* Guide CTA Widget */
.guide-cta-widget {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-dark));
    color: white;
}

.guide-cta-widget h3 {
    color: white;
    border-bottom-color: rgba(255, 255, 255, 0.2);
}

.guide-cta-widget p {
    color: rgba(255, 255, 255, 0.95);
}

/* Contact Widget */
.contact-cta-widget {
    text-align: center;
}

.contact-icon {
    width: 64px;
    height: 64px;
    background: var(--light-gray);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--spacing-md);
    color: var(--primary-blue);
}

.sidebar-phone-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    font-size: 1.5rem;
    color: var(--primary-blue);
    text-decoration: none;
    margin-top: var(--spacing-sm);
}

.sidebar-phone-link:hover {
    color: var(--primary-dark);
}

/* Contact Form Widget */
.contact-form-widget {
    text-align: center;
}

.contact-form-icon {
    width: 64px;
    height: 64px;
    background: var(--light-gray);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--spacing-md);
    color: var(--accent-coral);
}

/* Quick Links Widget */
.quick-links-widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.quick-links-widget li {
    border-bottom: 1px solid var(--light-gray);
}

.quick-links-widget li:last-child {
    border-bottom: none;
}

.quick-links-widget a {
    display: block;
    padding: var(--spacing-sm) 0;
    color: var(--primary-dark);
    text-decoration: none;
    transition: color 0.2s ease;
}

.quick-links-widget a:hover {
    color: var(--primary-blue);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .default-content-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: var(--spacing-lg);
    }

    /* Article first on phones and tablets; the sidebar (case review, phone, contact) follows it.
       It used to come first and pushed the article one to two and a half screens down (2026-11-10).
       The table of contents only helps above the article, so it is hidden once it would sit below. */
    .default-sidebar .toc-widget {
        display: none;
    }

    .default-page-title {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    .default-page-hero {
        padding: var(--spacing-xl) 0;
    }

    .default-page-title {
        font-size: 2rem;
    }

    .default-page-excerpt {
        font-size: 1.125rem;
    }

    .page-byline {
        font-size: 0.95rem;
        flex-direction: column;
        align-items: flex-start;
    }

    .author-tooltip {
        width: 280px;
        font-size: 0.8rem;
        left: 0;
        transform: none;
    }

    .author-tooltip::after {
        left: 20px;
        transform: none;
    }

    .page-meta-info {
        flex-direction: column;
        gap: var(--spacing-xs);
    }

    .default-page-content {
        padding: var(--spacing-lg) 0;
    }

    .default-main-content p {
        font-size: 1rem;
    }

    .default-main-content h2 {
        font-size: 1.75rem;
    }

    .default-main-content h3 {
        font-size: 1.375rem;
    }
}

/* Phones and tablets: sidebar card copy at 16px (2026-11-10). */
@media (max-width: 768px) {
    .sidebar-widget p {
        font-size: 1rem;
    }
}
