/*
Theme Name:     Planeteria Base
Description:    A modern block theme for government and municipal websites with full site editing support. Features clean design, accessibility, and performance optimization.
Author:         Planeteria
Author URI:     https://planeteria.com/
Version:        2.3.4
Requires at least: 7.1
Tested up to: 7.1
Requires PHP: 8.0
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: planeteria-media
Domain Path: /languages
Tags: block-styles, custom-colors, custom-logo, custom-menu, featured-images, full-site-editing, full-width-template, one-column, two-columns, three-columns, left-sidebar, right-sidebar, responsive-design, accessibility-ready, translation-ready, rtl-language-support, style-variations, wide-blocks, blog, news, portfolio, sticky-post, threaded-comments
*/

/* Reset and base styles */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
}

/* Typography */
a {
    text-decoration: none;
    transition: color 0.2s ease;
}

/* Block styles */

.wp-block-group {
    margin-bottom: 0;
}

.wp-block-button__link {
    display: inline-block;
    text-decoration: none;
    transition: all 0.2s ease;
}

/* GTranslate language selector
   ---------------------------------------------------------------------------
   PORTED from both child themes, where this CSS was byte-for-byte identical —
   the strongest possible signal it belongs here. The parent already hard-codes
   the [gtranslate] shortcode into parts/header.html and parts/header-topbar.html,
   so the markup it styles is the parent's responsibility too.

   Pairs with initTranslateSelects() in assets/js/frontend.js, which wraps the
   plugin's bare <select> in .gt-translate-wrap with a visible label and icon.

   HOW IT WORKS: the real <select> is stretched over the wrapper and made fully
   transparent, so the visible label and globe icon become the apparent control
   while the native select still handles all interaction — keyboard, screen
   readers, and the platform picker on mobile. Because the real control is
   invisible, its focus ring would be too, so :focus-within puts the ring on the
   wrapper instead. Do not swap opacity for visibility/display: that would take
   the select out of the accessibility tree entirely.

   Brand-neutralized on promotion: both children forced their own font family
   (work-sans) and hover color (steel-blue). Those are gone — this inherits the
   surrounding type and uses the theme's focus preset. */
.gt-translate-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: var(--wp--preset--spacing--2);
    color: inherit;
    line-height: 1.6;
    font-size: var(--wp--preset--font-size--small);
}

.gt-translate-wrap:hover {
    text-decoration: underline;
}

.gt-translate-wrap .gt-translate-icon img {
    display: block;
    width: 16px;
    height: 16px;
}

.gt-translate-wrap .gt-translate-chevron {
    font-size: 0.75em;
}

.gt-translate-wrap select.gt_selector {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* Visible keyboard-focus ring, since the real select is invisible. */
.gt-translate-wrap:focus-within {
    outline: 2px solid var(--wp--preset--color--focus);
    outline-offset: 2px;
}

/* Accessibility */
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
}

.screen-reader-text:focus {
    background-color: var(--wp--preset--color--primary);
    border-radius: 3px;
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
    clip: auto !important;
    color: var(--wp--preset--color--background);
    display: block;
    font-size: 14px;
    font-weight: bold;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: var(--wp--preset--spacing--2) var(--wp--preset--spacing--4);
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

/* Skip Links */
.skip-links {
    position: absolute;
    top: -100px;
    left: 0;
    right: 0;
    z-index: 100000;
}

.skip-link {
    position: absolute;
    top: -100px;
    left: 6px;
    background-color: var(--wp--preset--color--primary);
    color: var(--wp--preset--color--background);
    padding: var(--wp--preset--spacing--2) var(--wp--preset--spacing--4);
    text-decoration: none;
    border-radius: 0 0 4px 4px;
    font-weight: 600;
    font-size: 14px;
    z-index: 100000;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 0;
    outline: 2px solid var(--wp--preset--color--focus, var(--wp--preset--color--secondary));
    outline-offset: 2px;
}

.skip-link + .skip-link {
    left: 120px;
}

.skip-link + .skip-link + .skip-link {
    left: 240px;
}

/* Focus styles — uses `focus` preset when present (e.g. Wireframe Focus Purple) */
*:focus-visible {
    outline: 2px solid var(--wp--preset--color--focus, var(--wp--preset--color--secondary));
    outline-offset: 2px;
}

/* RTL Support */
[dir="rtl"] {
    text-align: right;
}

[dir="rtl"] .wp-block-columns {
    direction: rtl;
}

[dir="rtl"] .wp-block-columns > * {
    direction: ltr;
}

/* Header Shrink on Scroll */
header {
    transition: all 0.3s ease;
}

header.shrink {
    transform: scale(0.95);
    opacity: 0.9;
}

.bodyshrink {
    padding-top: 60px; /* Adjust based on your header height */
}

/* Alert System */
.alert-area {
    position: relative;
    z-index: 1001;
    display: block;
    margin-bottom: 0; /* Remove margin between stacked alerts */
}

.alert-area.alert-dismissed {
    display: none !important;
}

/* Alert container for stacking multiple alerts */
.alert-container {
    position: relative;
    z-index: 1001;
}

.alert-container .alert-area {
    margin-bottom: 0;
}

.alert-bar {
    margin: 0;
    border-radius: 0;
    border: none;
    padding: 0;
    font-size: 0.875rem;
    line-height: 1.4;
    background-color: var(--wp--preset--color--primary);
    color: var(--wp--preset--color--background);
    width: 100%; /* Full width background */
    position: relative;
}

/* Alert content wrapper to constrain content to wide width */
.alert-content {
    max-width: var(--wp--style--global--wide-size, 1200px); /* Theme's wide width */
    margin: 0 auto;
    padding: var(--wp--preset--spacing--3) var(--wp--preset--spacing--4);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Alert text */
.alert-text {
    flex: 1;
    margin-right: var(--wp--preset--spacing--4);
}

.alert-bar a {
    color: var(--wp--preset--color--background);
    text-decoration: underline;
}

.alert-bar a:hover {
    color: var(--wp--preset--color--light-gray);
}

.alert-bar .close {
    background: none;
    border: none;
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--wp--preset--color--background);
    opacity: 0.8;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: opacity 0.3s ease;
    flex-shrink: 0;
}

.alert-bar .close:hover {
    opacity: 1;
}

.alert-bar .close span {
    display: block;
    width: 20px;
    height: 20px;
    line-height: 1;
    text-align: center;
    transition: background-color 0.3s ease;
}

.alert-bar .close span:hover {
    background-color: transparent;
    color: var(--wp--preset--color--secondary);
}

/* Alert positioning containers */
#alert-container-before {
    position: sticky;
    top: var(--wp-admin--admin-bar--height, 0px);
    left: 0;
    right: 0;
    z-index: 9999;
    width: 100%;
    margin: 0 !important;
}

/* Ensure theme/core "block gap" rules do not create alert gaps */
:where(.wp-site-blocks) > .planeteria-alerts,
:where(.wp-site-blocks) > #planeteria-alerts-before,
:root :where(.is-layout-constrained) > .planeteria-alerts,
:root :where(.is-layout-constrained) > #planeteria-alerts-before,
:root :where(.is-layout-constrained) > #alert-container-before {
    margin-block-start: 0 !important;
    margin-block-end: 0 !important;
}
