/* ==========================================================================
   HaGabay Template — hagabay.net
   Synagogue Information & Management Portal

   Design Direction: Warm institutional elegance with geometric motifs
   inspired by traditional Jewish architectural patterns. Deep navy and
   gold palette evokes authority and warmth.
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Custom Properties
   -------------------------------------------------------------------------- */
:root {
    /* Color Palette — Default (Deep Navy & Gold) */
    --hg-primary:        #1a2744;
    --hg-primary-light:  #2a3d66;
    --hg-primary-dark:   #0e1a30;
    --hg-accent:         #c8a45c;
    --hg-accent-light:   #dfc07e;
    --hg-accent-dark:    #a6843a;
    --hg-secondary:      #3d6b8e;
    --hg-secondary-light:#5a8fb3;

    --hg-bg:             #f7f5f0;
    --hg-bg-alt:         #edeae2;
    --hg-bg-card:        #ffffff;
    --hg-bg-dark:        #1a2744;

    --hg-text:           #2c2c2c;
    --hg-text-light:     #5a5a5a;
    --hg-text-muted:     #8a8a8a;
    --hg-text-on-dark:   #f0ece4;
    --hg-text-on-accent: #1a2744;

    --hg-border:         #d4cfc4;
    --hg-border-light:   #e8e4dc;

    --hg-success:        #2d7a4f;
    --hg-warning:        #c8a45c;
    --hg-danger:         #b54444;

    /* Typography */
    --hg-font-body:      'Heebo', 'Segoe UI', Tahoma, sans-serif;
    --hg-font-display:   'Secular One', 'Heebo', sans-serif;

    /* Spacing Scale */
    --hg-space-xs:   0.25rem;
    --hg-space-sm:   0.5rem;
    --hg-space-md:   1rem;
    --hg-space-lg:   1.5rem;
    --hg-space-xl:   2.5rem;
    --hg-space-2xl:  4rem;
    --hg-space-3xl:  6rem;

    /* Sizing */
    --hg-container:  1240px;
    --hg-header-h:   72px;
    --hg-radius:     6px;
    --hg-radius-lg:  12px;

    /* Shadows */
    --hg-shadow-sm:  0 1px 3px rgba(26, 39, 68, 0.08);
    --hg-shadow-md:  0 4px 16px rgba(26, 39, 68, 0.1);
    --hg-shadow-lg:  0 8px 32px rgba(26, 39, 68, 0.12);
    --hg-shadow-xl:  0 16px 48px rgba(26, 39, 68, 0.16);

    /* Transitions */
    --hg-ease:       cubic-bezier(0.4, 0, 0.2, 1);
    --hg-duration:   0.3s;
}

/* Warm color scheme */
.color-warm {
    --hg-primary:        #5c3a1e;
    --hg-primary-light:  #7a5234;
    --hg-primary-dark:   #3e2410;
    --hg-accent:         #c86e3a;
    --hg-accent-light:   #e08a56;
    --hg-accent-dark:    #a45828;
    --hg-secondary:      #8e6d3d;
    --hg-bg:             #faf6f0;
    --hg-bg-alt:         #f0ebe0;
    --hg-bg-dark:        #5c3a1e;
    --hg-border:         #d8cebe;
    --hg-border-light:   #e8e0d4;
}

/* Cool color scheme */
.color-cool {
    --hg-primary:        #1e3a4a;
    --hg-primary-light:  #2a5268;
    --hg-primary-dark:   #122630;
    --hg-accent:         #4a9cb8;
    --hg-accent-light:   #6cb8d2;
    --hg-accent-dark:    #357a94;
    --hg-secondary:      #3a6e8e;
    --hg-bg:             #f2f6f8;
    --hg-bg-alt:         #e4eaee;
    --hg-bg-dark:        #1e3a4a;
    --hg-border:         #c4d0d8;
    --hg-border-light:   #dce4e8;
}

/* --------------------------------------------------------------------------
   Reset & Base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--hg-font-body);
    font-weight: 400;
    line-height: 1.7;
    color: var(--hg-text);
    background-color: var(--hg-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* RTL base — already handled by dir="rtl" on <html> */
[dir="rtl"] body {
    text-align: right;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--hg-secondary);
    text-decoration: none;
    transition: color var(--hg-duration) var(--hg-ease);
}
a:hover,
a:focus {
    color: var(--hg-accent);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--hg-font-display);
    font-weight: 400;
    line-height: 1.3;
    color: var(--hg-primary);
    margin-bottom: 0.6em;
}

h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.6rem); }
h4 { font-size: 1.2rem; }
h5 { font-size: 1.05rem; }
h6 { font-size: 0.95rem; }

p {
    margin-bottom: var(--hg-space-md);
}

::selection {
    background: var(--hg-accent);
    color: var(--hg-text-on-accent);
}

/* Focus visible */
:focus-visible {
    outline: 2px solid var(--hg-accent);
    outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Skip Link
   -------------------------------------------------------------------------- */
.hg-skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    z-index: 10000;
    padding: var(--hg-space-sm) var(--hg-space-md);
    background: var(--hg-accent);
    color: var(--hg-text-on-accent);
    font-weight: 700;
}
.hg-skip-link:focus {
    top: 0;
}

/* --------------------------------------------------------------------------
   Container & Layout
   -------------------------------------------------------------------------- */
.hg-container {
    max-width: var(--hg-container);
    margin-inline: auto;
    padding-inline: var(--hg-space-lg);
}

.hg-grid {
    display: grid;
    gap: var(--hg-space-xl);
}
.hg-grid--2 { grid-template-columns: repeat(2, 1fr); }
.hg-grid--3 { grid-template-columns: repeat(3, 1fr); }
.hg-grid--4 { grid-template-columns: repeat(4, 1fr); }

.hg-content-area {
    display: flex;
    gap: var(--hg-space-xl);
    align-items: flex-start;
}

.hg-col-3  { flex: 0 0 25%; max-width: 25%; }
.hg-col-8  { flex: 0 0 calc(100% / 12 * 8); max-width: calc(100% / 12 * 8); }
.hg-col-9  { flex: 0 0 75%; max-width: 75%; }
.hg-col-12 { flex: 0 0 100%; max-width: 100%; }

.hg-section {
    padding-block: var(--hg-space-2xl);
}

/* --------------------------------------------------------------------------
   Top Bar
   -------------------------------------------------------------------------- */
.hg-topbar {
    background: var(--hg-primary-dark);
    color: var(--hg-text-on-dark);
    font-size: 0.85rem;
    padding-block: var(--hg-space-xs);
    border-bottom: 2px solid var(--hg-accent);
}

.hg-topbar a {
    color: var(--hg-accent-light);
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.hg-header {
    background: var(--hg-bg-card);
    box-shadow: var(--hg-shadow-sm);
    position: relative;
    z-index: 1000;
    transition: box-shadow var(--hg-duration) var(--hg-ease),
                transform var(--hg-duration) var(--hg-ease);
}

.hg-header.is-stuck {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    box-shadow: var(--hg-shadow-lg);
    animation: hg-slideDown 0.35s var(--hg-ease);
}

@keyframes hg-slideDown {
    from { transform: translateY(-100%); }
    to   { transform: translateY(0); }
}

.has-sticky-header .hg-header.is-stuck ~ * {
    /* spacer handled by JS */
}

.hg-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--hg-header-h);
    gap: var(--hg-space-md);
}

/* Logo */
.hg-logo {
    display: flex;
    align-items: center;
    gap: var(--hg-space-sm);
    text-decoration: none;
    color: var(--hg-primary);
    flex-shrink: 0;
}
.hg-logo:hover { color: var(--hg-accent-dark); }

.hg-logo__img {
    height: 52px;
    width: auto;
}

.hg-logo__text {
    display: flex;
    flex-direction: column;
}

.hg-logo__title {
    font-family: var(--hg-font-display);
    font-size: 1.4rem;
    line-height: 1.2;
    color: var(--hg-primary);
}

.hg-logo__desc {
    font-size: 0.78rem;
    color: var(--hg-text-muted);
    line-height: 1.3;
}

/* Header search */
.hg-header__search {
    flex: 0 1 280px;
}

.hg-header__search input[type="text"],
.hg-header__search input[type="search"] {
    width: 100%;
    padding: 0.5rem 1rem;
    border: 1px solid var(--hg-border);
    border-radius: 50px;
    font-family: var(--hg-font-body);
    font-size: 0.9rem;
    background: var(--hg-bg);
    transition: border-color var(--hg-duration) var(--hg-ease),
                box-shadow var(--hg-duration) var(--hg-ease);
}
.hg-header__search input:focus {
    border-color: var(--hg-accent);
    box-shadow: 0 0 0 3px rgba(200, 164, 92, 0.15);
    outline: none;
}

/* --------------------------------------------------------------------------
   Hamburger / Mobile Toggle
   -------------------------------------------------------------------------- */
.hg-header__toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--hg-space-sm);
    z-index: 1010;
}

.hg-hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 26px;
}
.hg-hamburger span {
    display: block;
    height: 2.5px;
    background: var(--hg-primary);
    border-radius: 2px;
    transition: all var(--hg-duration) var(--hg-ease);
    transform-origin: center;
}

/* Active hamburger */
.hg-header__toggle[aria-expanded="true"] .hg-hamburger span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.hg-header__toggle[aria-expanded="true"] .hg-hamburger span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.hg-header__toggle[aria-expanded="true"] .hg-hamburger span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* --------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */
.hg-nav {
    background: var(--hg-primary);
    position: relative;
}

/* Geometric accent line under nav */
.hg-nav::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: repeating-linear-gradient(
        90deg,
        var(--hg-accent) 0px,
        var(--hg-accent) 20px,
        transparent 20px,
        transparent 24px
    );
}

.hg-nav .nav,
.hg-nav ul {
    list-style: none;
    display: flex;
    align-items: stretch;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}

.hg-nav .nav > li,
.hg-nav ul > li {
    position: relative;
}

.hg-nav .nav > li > a,
.hg-nav ul > li > a {
    display: flex;
    align-items: center;
    padding: 0.85rem 1.15rem;
    color: var(--hg-text-on-dark);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all var(--hg-duration) var(--hg-ease);
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    text-decoration: none;
}

.hg-nav .nav > li > a:hover,
.hg-nav .nav > li > a:focus,
.hg-nav ul > li > a:hover,
.hg-nav ul > li > a:focus {
    background: var(--hg-primary-light);
    border-bottom-color: var(--hg-accent);
    color: var(--hg-accent-light);
}

.hg-nav .nav > li.active > a,
.hg-nav .nav > li.current > a,
.hg-nav ul > li.active > a,
.hg-nav ul > li.current > a {
    background: var(--hg-primary-light);
    border-bottom-color: var(--hg-accent);
}

/* Dropdown */
.hg-nav .nav > li > ul,
.hg-nav ul > li > ul {
    position: absolute;
    top: 100%;
    inset-inline-start: 0;
    min-width: 220px;
    background: var(--hg-bg-card);
    box-shadow: var(--hg-shadow-lg);
    border-radius: 0 0 var(--hg-radius) var(--hg-radius);
    border-top: 3px solid var(--hg-accent);
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all var(--hg-duration) var(--hg-ease);
    z-index: 1000;
}

.hg-nav .nav > li:hover > ul,
.hg-nav ul > li:hover > ul {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.hg-nav .nav > li > ul > li > a,
.hg-nav ul > li > ul > li > a {
    color: var(--hg-text);
    padding: 0.65rem 1.15rem;
    border-bottom: none;
    border-inline-start: 3px solid transparent;
}

.hg-nav .nav > li > ul > li > a:hover,
.hg-nav ul > li > ul > li > a:hover {
    background: var(--hg-bg-alt);
    border-inline-start-color: var(--hg-accent);
    color: var(--hg-primary);
}

/* Caret for dropdowns */
.hg-nav li.deeper > a::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    border-inline-start: 4px solid transparent;
    border-inline-end: 4px solid transparent;
    border-top: 4px solid currentColor;
    margin-inline-start: 6px;
    opacity: 0.6;
    vertical-align: middle;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hg-hero {
    background: linear-gradient(135deg, var(--hg-primary) 0%, var(--hg-primary-light) 100%);
    color: var(--hg-text-on-dark);
    padding: var(--hg-space-3xl) 0 var(--hg-space-2xl);
    position: relative;
    overflow: hidden;
}

/* Geometric pattern overlay */
.hg-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.04;
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 40px,
            rgba(255,255,255,0.5) 40px,
            rgba(255,255,255,0.5) 41px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 40px,
            rgba(255,255,255,0.5) 40px,
            rgba(255,255,255,0.5) 41px
        );
    pointer-events: none;
}

/* Ornamental arch shape */
.hg-hero__ornament {
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 50px;
    background: var(--hg-bg);
    clip-path: ellipse(52% 100% at 50% 100%);
}

.hg-hero h1,
.hg-hero h2 {
    color: var(--hg-text-on-dark);
}

.hg-hero h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    margin-bottom: var(--hg-space-sm);
    text-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.hg-hero p {
    font-size: 1.15rem;
    opacity: 0.9;
    max-width: 640px;
}

.hg-hero a {
    color: var(--hg-accent-light);
}

/* Hero animation on load */
.hg-hero .hg-container {
    animation: hg-fadeUp 0.8s var(--hg-ease) both;
}

@keyframes hg-fadeUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --------------------------------------------------------------------------
   Breadcrumbs
   -------------------------------------------------------------------------- */
.hg-breadcrumbs {
    background: var(--hg-bg-alt);
    padding-block: var(--hg-space-sm);
    border-bottom: 1px solid var(--hg-border-light);
    font-size: 0.85rem;
}

.hg-breadcrumbs ol,
.hg-breadcrumbs ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
}

.hg-breadcrumbs li + li::before {
    content: '/';
    color: var(--hg-text-muted);
    margin-inline-end: 0.35rem;
}

[dir="rtl"] .hg-breadcrumbs li + li::before {
    content: '\\';
}

.hg-breadcrumbs a {
    color: var(--hg-text-light);
}

.hg-breadcrumbs .active {
    color: var(--hg-primary);
    font-weight: 500;
}

/* --------------------------------------------------------------------------
   Main Content
   -------------------------------------------------------------------------- */
.hg-main {
    padding-block: var(--hg-space-2xl);
    min-height: 50vh;
}

.hg-content {
    min-width: 0;
}

/* --------------------------------------------------------------------------
   Sidebar
   -------------------------------------------------------------------------- */
.hg-sidebar {
    min-width: 0;
}

.hg-sidebar .moduletable,
.hg-sidebar .module {
    background: var(--hg-bg-card);
    border-radius: var(--hg-radius-lg);
    box-shadow: var(--hg-shadow-sm);
    padding: var(--hg-space-lg);
    margin-bottom: var(--hg-space-lg);
    border: 1px solid var(--hg-border-light);
    transition: box-shadow var(--hg-duration) var(--hg-ease);
}

.hg-sidebar .moduletable:hover,
.hg-sidebar .module:hover {
    box-shadow: var(--hg-shadow-md);
}

.hg-sidebar h3 {
    font-size: 1.05rem;
    color: var(--hg-primary);
    padding-bottom: var(--hg-space-sm);
    margin-bottom: var(--hg-space-md);
    border-bottom: 2px solid var(--hg-accent);
    position: relative;
}

/* Sidebar nav lists */
.hg-sidebar .nav,
.hg-sidebar ul.menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.hg-sidebar .nav > li > a,
.hg-sidebar ul.menu > li > a {
    display: block;
    padding: 0.5rem 0.75rem;
    color: var(--hg-text);
    border-radius: var(--hg-radius);
    transition: all var(--hg-duration) var(--hg-ease);
    border-inline-start: 3px solid transparent;
    font-size: 0.95rem;
}

.hg-sidebar .nav > li > a:hover,
.hg-sidebar ul.menu > li > a:hover {
    background: var(--hg-bg-alt);
    border-inline-start-color: var(--hg-accent);
    color: var(--hg-primary);
}

.hg-sidebar .nav > li.active > a,
.hg-sidebar ul.menu > li.active > a,
.hg-sidebar ul.menu > li.current > a {
    background: var(--hg-bg-alt);
    border-inline-start-color: var(--hg-accent);
    color: var(--hg-primary);
    font-weight: 500;
}

/* --------------------------------------------------------------------------
   Showcase & Bottom Sections
   -------------------------------------------------------------------------- */
.hg-showcase {
    background: var(--hg-bg-alt);
    position: relative;
}

.hg-showcase::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(
        90deg,
        var(--hg-accent) 0%,
        var(--hg-primary) 50%,
        var(--hg-accent) 100%
    );
}

.hg-showcase .moduletable,
.hg-showcase .module {
    background: var(--hg-bg-card);
    padding: var(--hg-space-xl);
    border-radius: var(--hg-radius-lg);
    box-shadow: var(--hg-shadow-sm);
    border: 1px solid var(--hg-border-light);
    text-align: center;
    transition: transform var(--hg-duration) var(--hg-ease),
                box-shadow var(--hg-duration) var(--hg-ease);
}

.hg-showcase .moduletable:hover,
.hg-showcase .module:hover {
    transform: translateY(-4px);
    box-shadow: var(--hg-shadow-lg);
}

.hg-showcase h3 {
    color: var(--hg-primary);
    font-size: 1.15rem;
    margin-bottom: var(--hg-space-sm);
}

.hg-bottom {
    background: var(--hg-bg);
}

.hg-bottom .moduletable,
.hg-bottom .module {
    padding: var(--hg-space-lg);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.hg-footer {
    background: var(--hg-bg-dark);
    color: var(--hg-text-on-dark);
    position: relative;
    overflow: hidden;
}

/* Geometric pattern in footer */
.hg-footer__ornament {
    position: absolute;
    top: -2px;
    left: 0;
    right: 0;
    height: 40px;
    background: var(--hg-bg);
    clip-path: ellipse(52% 100% at 50% 0%);
}

.hg-footer__main {
    padding: var(--hg-space-2xl) 0 var(--hg-space-xl);
}

.hg-footer h3,
.hg-footer h4 {
    color: var(--hg-accent);
    font-size: 1.05rem;
    margin-bottom: var(--hg-space-md);
    padding-bottom: var(--hg-space-sm);
    border-bottom: 1px solid rgba(200, 164, 92, 0.25);
}

.hg-footer a {
    color: var(--hg-text-on-dark);
    opacity: 0.8;
    transition: opacity var(--hg-duration) var(--hg-ease),
                color var(--hg-duration) var(--hg-ease);
}
.hg-footer a:hover {
    color: var(--hg-accent-light);
    opacity: 1;
}

.hg-footer .nav,
.hg-footer ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.hg-footer .nav li,
.hg-footer ul li {
    margin-bottom: 0.4rem;
}

.hg-footer .nav li a,
.hg-footer ul li a {
    font-size: 0.9rem;
    padding-inline-start: 0.75rem;
    position: relative;
}

.hg-footer .nav li a::before,
.hg-footer ul li a::before {
    content: '';
    position: absolute;
    inset-inline-start: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    background: var(--hg-accent);
    border-radius: 50%;
    opacity: 0;
    transition: opacity var(--hg-duration) var(--hg-ease);
}

.hg-footer .nav li a:hover::before,
.hg-footer ul li a:hover::before {
    opacity: 1;
}

.hg-footer p {
    opacity: 0.8;
    font-size: 0.9rem;
}

.hg-footer__bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-block: var(--hg-space-md);
    font-size: 0.82rem;
}

.hg-footer__bottom-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--hg-space-sm);
}

.hg-footer__copyright {
    opacity: 0.6;
}

.hg-footer__copyright p {
    margin: 0;
    font-size: 0.82rem;
}

/* --------------------------------------------------------------------------
   Back to Top
   -------------------------------------------------------------------------- */
.hg-back-to-top {
    position: fixed;
    bottom: 2rem;
    inset-inline-end: 2rem;
    width: 44px;
    height: 44px;
    background: var(--hg-primary);
    color: var(--hg-accent);
    border: 2px solid var(--hg-accent);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    z-index: 900;
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px);
    transition: all var(--hg-duration) var(--hg-ease);
    box-shadow: var(--hg-shadow-md);
}

.hg-back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.hg-back-to-top:hover {
    background: var(--hg-accent);
    color: var(--hg-primary);
    transform: translateY(-3px);
    box-shadow: var(--hg-shadow-lg);
}

/* --------------------------------------------------------------------------
   Overlay (Mobile)
   -------------------------------------------------------------------------- */
.hg-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all var(--hg-duration) var(--hg-ease);
    backdrop-filter: blur(2px);
}

.hg-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

/* --------------------------------------------------------------------------
   Module Styling (xhtml chrome)
   -------------------------------------------------------------------------- */
.moduletable,
div.module {
    margin-bottom: var(--hg-space-lg);
}

.moduletable > h3,
div.module > h3 {
    font-family: var(--hg-font-display);
    font-size: 1.15rem;
    color: var(--hg-primary);
    margin-bottom: var(--hg-space-md);
}

/* --------------------------------------------------------------------------
   Joomla Component Overrides
   -------------------------------------------------------------------------- */

/* System Messages */
#system-message-container {
    margin-bottom: var(--hg-space-lg);
}

.alert {
    padding: var(--hg-space-md) var(--hg-space-lg);
    border-radius: var(--hg-radius);
    border: 1px solid var(--hg-border);
    margin-bottom: var(--hg-space-md);
    font-size: 0.95rem;
}

.alert-message,
.alert-success {
    background: #ecf7f0;
    border-color: #b8e0c7;
    color: #1a6b3a;
}

.alert-warning {
    background: #fdf6e7;
    border-color: #f0daa5;
    color: #8a6d20;
}

.alert-error,
.alert-danger {
    background: #fbeaea;
    border-color: #e8b4b4;
    color: #8a2020;
}

/* Category list */
.category-list h2 {
    border-bottom: 2px solid var(--hg-accent);
    padding-bottom: var(--hg-space-sm);
}

/* Articles */
.item-page,
.blog .items-row {
    background: var(--hg-bg-card);
    padding: var(--hg-space-xl);
    border-radius: var(--hg-radius-lg);
    box-shadow: var(--hg-shadow-sm);
    margin-bottom: var(--hg-space-xl);
    border: 1px solid var(--hg-border-light);
}

.item-page .page-header h2,
.items-leading .page-header h2 {
    color: var(--hg-primary);
    font-size: 1.6rem;
    position: relative;
    padding-bottom: var(--hg-space-sm);
}

.item-page .page-header h2::after,
.items-leading .page-header h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    inset-inline-start: 0;
    width: 60px;
    height: 3px;
    background: var(--hg-accent);
    border-radius: 2px;
}

.article-info {
    font-size: 0.85rem;
    color: var(--hg-text-muted);
    margin-bottom: var(--hg-space-md);
    padding-bottom: var(--hg-space-sm);
    border-bottom: 1px solid var(--hg-border-light);
    display: flex;
    flex-wrap: wrap;
    gap: var(--hg-space-md);
}

.article-info dd {
    margin: 0;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
    list-style: none;
    padding: 0;
    margin: var(--hg-space-xl) 0;
}

.pagination li a,
.pagination li span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.5rem;
    border: 1px solid var(--hg-border);
    border-radius: var(--hg-radius);
    color: var(--hg-text);
    font-size: 0.9rem;
    transition: all var(--hg-duration) var(--hg-ease);
}

.pagination li a:hover {
    background: var(--hg-accent);
    border-color: var(--hg-accent);
    color: var(--hg-text-on-accent);
}

.pagination li.active span {
    background: var(--hg-primary);
    border-color: var(--hg-primary);
    color: #fff;
}

/* Buttons */
.btn,
button[type="submit"],
input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 1.5rem;
    font-family: var(--hg-font-body);
    font-weight: 500;
    font-size: 0.95rem;
    border: 2px solid transparent;
    border-radius: var(--hg-radius);
    cursor: pointer;
    transition: all var(--hg-duration) var(--hg-ease);
    text-decoration: none;
    line-height: 1.4;
}

.btn-primary,
button[type="submit"],
input[type="submit"] {
    background: var(--hg-accent);
    color: var(--hg-text-on-accent);
    border-color: var(--hg-accent);
}

.btn-primary:hover,
button[type="submit"]:hover,
input[type="submit"]:hover {
    background: var(--hg-accent-dark);
    border-color: var(--hg-accent-dark);
    transform: translateY(-1px);
    box-shadow: var(--hg-shadow-sm);
}

.btn-default,
.btn-secondary {
    background: transparent;
    color: var(--hg-primary);
    border-color: var(--hg-border);
}

.btn-default:hover,
.btn-secondary:hover {
    border-color: var(--hg-primary);
    background: var(--hg-primary);
    color: #fff;
}

/* Forms */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="tel"],
input[type="number"],
input[type="date"],
textarea,
select {
    width: 100%;
    padding: 0.6rem 0.85rem;
    font-family: var(--hg-font-body);
    font-size: 0.95rem;
    color: var(--hg-text);
    background: var(--hg-bg-card);
    border: 1px solid var(--hg-border);
    border-radius: var(--hg-radius);
    transition: border-color var(--hg-duration) var(--hg-ease),
                box-shadow var(--hg-duration) var(--hg-ease);
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--hg-accent);
    box-shadow: 0 0 0 3px rgba(200, 164, 92, 0.15);
    outline: none;
}

label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--hg-text);
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--hg-space-lg);
    font-size: 0.95rem;
}

th {
    background: var(--hg-primary);
    color: #fff;
    padding: 0.7rem 1rem;
    font-family: var(--hg-font-display);
    font-weight: 400;
    text-align: inherit;
}

td {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--hg-border-light);
}

tr:hover td {
    background: var(--hg-bg-alt);
}

/* --------------------------------------------------------------------------
   Animation — Scroll reveal
   -------------------------------------------------------------------------- */
.hg-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s var(--hg-ease), transform 0.6s var(--hg-ease);
}

.hg-reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered reveals */
.hg-grid__item:nth-child(1) .hg-reveal { transition-delay: 0s; }
.hg-grid__item:nth-child(2) .hg-reveal { transition-delay: 0.1s; }
.hg-grid__item:nth-child(3) .hg-reveal { transition-delay: 0.2s; }
.hg-grid__item:nth-child(4) .hg-reveal { transition-delay: 0.3s; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

/* Tablet */
@media (max-width: 991px) {
    :root {
        --hg-header-h: 64px;
    }

    .hg-grid--4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .hg-content-area {
        flex-wrap: wrap;
    }

    .hg-col-3,
    .hg-col-8,
    .hg-col-9 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .hg-sidebar {
        order: 2;
    }

    .hg-content {
        order: 1;
    }

    .hg-sidebar .moduletable,
    .hg-sidebar .module {
        display: inline-block;
        vertical-align: top;
        width: calc(50% - var(--hg-space-md));
    }
}

/* Mobile */
@media (max-width: 767px) {
    :root {
        --hg-header-h: 56px;
        --hg-space-2xl: 2.5rem;
        --hg-space-3xl: 3.5rem;
    }

    .hg-header__toggle {
        display: block;
    }

    .hg-header__search {
        display: none;
    }

    /* Mobile Nav */
    .hg-nav {
        position: fixed;
        top: 0;
        inset-inline-end: 0;
        width: min(300px, 80vw);
        height: 100vh;
        z-index: 1001;
        transform: translateX(100%);
        transition: transform var(--hg-duration) var(--hg-ease);
        overflow-y: auto;
        padding-top: var(--hg-space-2xl);
    }

    [dir="rtl"] .hg-nav {
        transform: translateX(-100%);
    }

    .hg-nav.is-open {
        transform: translateX(0);
    }

    .hg-nav::after {
        display: none;
    }

    .hg-nav .nav,
    .hg-nav ul {
        flex-direction: column;
    }

    .hg-nav .nav > li > a,
    .hg-nav ul > li > a {
        padding: 0.75rem 1.25rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        border-inline-start: 3px solid transparent;
    }

    .hg-nav .nav > li > a:hover,
    .hg-nav ul > li > a:hover {
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        border-inline-start-color: var(--hg-accent);
    }

    /* Mobile dropdowns always visible */
    .hg-nav .nav > li > ul,
    .hg-nav ul > li > ul {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border-top: none;
        border-radius: 0;
        background: rgba(0, 0, 0, 0.15);
    }

    .hg-nav .nav > li > ul > li > a,
    .hg-nav ul > li > ul > li > a {
        color: var(--hg-text-on-dark);
        padding-inline-start: 2rem;
    }

    .hg-grid--3,
    .hg-grid--4 {
        grid-template-columns: 1fr;
    }

    .hg-grid--2 {
        grid-template-columns: 1fr;
    }

    .item-page,
    .blog .items-row {
        padding: var(--hg-space-lg);
    }

    .hg-sidebar .moduletable,
    .hg-sidebar .module {
        width: 100%;
    }

    .hg-hero {
        padding: var(--hg-space-2xl) 0 var(--hg-space-xl);
    }

    .hg-footer__main {
        padding: var(--hg-space-xl) 0;
    }

    .hg-footer .hg-grid--4 {
        grid-template-columns: 1fr 1fr;
        gap: var(--hg-space-lg);
    }
}

@media (max-width: 480px) {
    .hg-footer .hg-grid--4 {
        grid-template-columns: 1fr;
    }

    .hg-logo__img {
        height: 40px;
    }

    .hg-logo__title {
        font-size: 1.15rem;
    }
}

/* --------------------------------------------------------------------------
   Print
   -------------------------------------------------------------------------- */
@media print {
    .hg-topbar,
    .hg-header__toggle,
    .hg-nav,
    .hg-hero,
    .hg-breadcrumbs,
    .hg-sidebar,
    .hg-back-to-top,
    .hg-footer__ornament,
    .hg-hero__ornament,
    .hg-overlay {
        display: none !important;
    }

    body {
        color: #000;
        background: #fff;
        font-size: 12pt;
    }

    .hg-content {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }

    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.85em;
        color: #666;
    }
}

/* --------------------------------------------------------------------------
   Utility Classes
   -------------------------------------------------------------------------- */
.hg-text-center { text-align: center; }
.hg-text-start  { text-align: start; }
.hg-text-end    { text-align: end; }
.hg-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ==========================================================================
   Module Chrome Styles
   ========================================================================== */

/* --------------------------------------------------------------------------
   hgcard Chrome — Card with accent header
   -------------------------------------------------------------------------- */
.hg-card {
    background: var(--hg-bg-card);
    border-radius: var(--hg-radius-lg);
    box-shadow: var(--hg-shadow-sm);
    border: 1px solid var(--hg-border-light);
    overflow: hidden;
    margin-bottom: var(--hg-space-lg);
    transition: box-shadow var(--hg-duration) var(--hg-ease);
}

.hg-card:hover {
    box-shadow: var(--hg-shadow-md);
}

.hg-card__header {
    padding: var(--hg-space-md) var(--hg-space-lg);
    border-bottom: 1px solid var(--hg-border-light);
    background: linear-gradient(135deg, var(--hg-bg-alt) 0%, var(--hg-bg-card) 100%);
    position: relative;
}

.hg-card__header::before {
    content: '';
    position: absolute;
    top: 0;
    inset-inline-start: 0;
    bottom: 0;
    width: 4px;
    background: var(--hg-accent);
}

.hg-card__header h3,
.hg-card__header h4 {
    margin: 0;
    font-size: 1.05rem;
    color: var(--hg-primary);
}

.hg-card__body {
    padding: var(--hg-space-lg);
}

/* --------------------------------------------------------------------------
   hgpanel Chrome — Sidebar panels
   -------------------------------------------------------------------------- */
.hg-panel {
    background: var(--hg-bg-card);
    border-radius: var(--hg-radius-lg);
    box-shadow: var(--hg-shadow-sm);
    border: 1px solid var(--hg-border-light);
    overflow: hidden;
    margin-bottom: var(--hg-space-lg);
    transition: box-shadow var(--hg-duration) var(--hg-ease);
}

.hg-panel:hover {
    box-shadow: var(--hg-shadow-md);
}

.hg-panel__header {
    padding: var(--hg-space-sm) var(--hg-space-md);
    background: var(--hg-primary);
    position: relative;
}

.hg-panel__header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--hg-accent);
}

.hg-panel__header h3,
.hg-panel__header h4 {
    margin: 0;
    font-size: 0.95rem;
    color: var(--hg-text-on-dark);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.hg-panel__icon {
    font-size: 0.7em;
    color: var(--hg-accent);
}

[dir="rtl"] .hg-panel__icon {
    transform: scaleX(-1);
}

.hg-panel__body {
    padding: var(--hg-space-md);
}

/* Panel navigation lists */
.hg-panel__body .nav,
.hg-panel__body ul.menu,
.hg-panel__body ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.hg-panel__body .nav > li,
.hg-panel__body ul.menu > li,
.hg-panel__body ul > li {
    border-bottom: 1px solid var(--hg-border-light);
}

.hg-panel__body .nav > li:last-child,
.hg-panel__body ul.menu > li:last-child,
.hg-panel__body ul > li:last-child {
    border-bottom: none;
}

.hg-panel__body .nav > li > a,
.hg-panel__body ul.menu > li > a,
.hg-panel__body ul > li > a {
    display: block;
    padding: 0.55rem 0.75rem;
    color: var(--hg-text);
    border-inline-start: 3px solid transparent;
    transition: all var(--hg-duration) var(--hg-ease);
    font-size: 0.92rem;
    text-decoration: none;
}

.hg-panel__body .nav > li > a:hover,
.hg-panel__body ul.menu > li > a:hover,
.hg-panel__body ul > li > a:hover {
    background: var(--hg-bg-alt);
    border-inline-start-color: var(--hg-accent);
    color: var(--hg-primary);
    padding-inline-start: 1rem;
}

.hg-panel__body .nav > li.active > a,
.hg-panel__body .nav > li.current > a,
.hg-panel__body ul.menu > li.active > a,
.hg-panel__body ul.menu > li.current > a {
    background: var(--hg-bg-alt);
    border-inline-start-color: var(--hg-accent);
    color: var(--hg-primary);
    font-weight: 500;
}

/* --------------------------------------------------------------------------
   hgfeature Chrome — Showcase feature cards
   -------------------------------------------------------------------------- */
.hg-feature {
    background: var(--hg-bg-card);
    border-radius: var(--hg-radius-lg);
    padding: var(--hg-space-xl) var(--hg-space-lg);
    box-shadow: var(--hg-shadow-sm);
    border: 1px solid var(--hg-border-light);
    text-align: center;
    transition: transform var(--hg-duration) var(--hg-ease),
                box-shadow var(--hg-duration) var(--hg-ease);
    position: relative;
    overflow: hidden;
}

.hg-feature::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--hg-accent), var(--hg-primary));
}

.hg-feature:hover {
    transform: translateY(-6px);
    box-shadow: var(--hg-shadow-lg);
}

.hg-feature__title {
    color: var(--hg-primary);
    font-size: 1.1rem;
    margin-bottom: var(--hg-space-sm);
}

.hg-feature__body {
    color: var(--hg-text-light);
    font-size: 0.92rem;
}

.hg-feature__body p:last-child {
    margin-bottom: 0;
}

/* Font Awesome icons inside features */
.hg-feature .fa,
.hg-feature .fas,
.hg-feature .far,
.hg-feature .fab,
.hg-feature [class*="fa-"] {
    font-size: 2.2rem;
    color: var(--hg-accent);
    margin-bottom: var(--hg-space-md);
    display: block;
}

/* --------------------------------------------------------------------------
   hgfooter Chrome — Footer modules
   -------------------------------------------------------------------------- */
.hg-footer-module {
    margin-bottom: var(--hg-space-lg);
}

.hg-footer-module__title {
    color: var(--hg-accent);
    font-size: 1.05rem;
    font-family: var(--hg-font-display);
    margin-bottom: var(--hg-space-md);
    padding-bottom: var(--hg-space-sm);
    border-bottom: 1px solid rgba(200, 164, 92, 0.25);
    position: relative;
}

.hg-footer-module__title::after {
    content: '';
    position: absolute;
    bottom: -1px;
    inset-inline-start: 0;
    width: 40px;
    height: 2px;
    background: var(--hg-accent);
}

.hg-footer-module__body a {
    color: var(--hg-text-on-dark);
    opacity: 0.8;
}
.hg-footer-module__body a:hover {
    color: var(--hg-accent-light);
    opacity: 1;
}

.hg-footer-module__body ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.hg-footer-module__body ul li {
    padding: 0.3rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.hg-footer-module__body p {
    opacity: 0.8;
    font-size: 0.88rem;
    line-height: 1.7;
}

/* ==========================================================================
   Home Page — Specific Styles
   ========================================================================== */

/* Home body class */
.is-home .hg-main {
    padding-top: var(--hg-space-xl);
}

/* Hero — Enhanced for home page */
.hg-hero__bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    z-index: 0;
}

.hg-hero__content {
    position: relative;
    z-index: 1;
}

/* 3 Column Layout — RTL aware */
.hg-content-area {
    display: flex;
    gap: var(--hg-space-xl);
    align-items: flex-start;
}

/* In RTL, sidebar-right is visually on the right (start side) */
[dir="rtl"] .hg-content--dual-sidebar {
    flex-direction: row;
}

.hg-content--dual-sidebar .hg-sidebar--end {
    flex: 0 0 22%;
    max-width: 22%;
    order: 1;
}

.hg-content--dual-sidebar .hg-content {
    flex: 1 1 auto;
    min-width: 0;
    order: 2;
}

.hg-content--dual-sidebar .hg-sidebar--start {
    flex: 0 0 22%;
    max-width: 22%;
    order: 3;
}

/* Single sidebar override */
.hg-content--single-sidebar .hg-sidebar--end {
    flex: 0 0 25%;
    max-width: 25%;
}

.hg-content--single-sidebar .hg-sidebar--start {
    flex: 0 0 25%;
    max-width: 25%;
}

/* ==========================================================================
   Blog Layout on Home Page
   ========================================================================== */
.is-home .blog .items-leading .leading-0 {
    position: relative;
}

.blog .items-leading {
    margin-bottom: var(--hg-space-xl);
}

.blog .items-row {
    display: flex;
    gap: var(--hg-space-lg);
    margin-bottom: var(--hg-space-lg);
}

.blog .items-row .item {
    flex: 1;
    background: var(--hg-bg-card);
    padding: var(--hg-space-lg);
    border-radius: var(--hg-radius-lg);
    box-shadow: var(--hg-shadow-sm);
    border: 1px solid var(--hg-border-light);
}

/* Article titles in blog view */
.blog h2 a {
    color: var(--hg-primary);
    text-decoration: none;
    transition: color var(--hg-duration) var(--hg-ease);
}

.blog h2 a:hover {
    color: var(--hg-accent-dark);
}

/* Read more link */
.readmore a,
a.readmore {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--hg-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all var(--hg-duration) var(--hg-ease);
}

.readmore a:hover,
a.readmore:hover {
    color: var(--hg-accent);
    gap: 0.5rem;
}

.readmore a::after,
a.readmore::after {
    content: '\f053';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.7em;
}

[dir="ltr"] .readmore a::after,
[dir="ltr"] a.readmore::after {
    content: '\f054';
}

/* Article images in blog */
.blog .item-image {
    border-radius: var(--hg-radius);
    overflow: hidden;
    margin-bottom: var(--hg-space-md);
}

.blog .item-image img {
    width: 100%;
    height: auto;
    transition: transform 0.5s var(--hg-ease);
}

.blog .item-image:hover img {
    transform: scale(1.03);
}

/* ==========================================================================
   News Feed Module (sidebar)
   ========================================================================== */
.hg-panel .newsflash-horiz,
.hg-panel .latestnews,
.hg-panel .mostread {
    list-style: none;
    padding: 0;
    margin: 0;
}

.hg-panel .newsflash-horiz li,
.hg-panel .latestnews li,
.hg-panel .mostread li {
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--hg-border-light);
    font-size: 0.9rem;
    line-height: 1.5;
}

.hg-panel .newsflash-horiz li:last-child,
.hg-panel .latestnews li:last-child,
.hg-panel .mostread li:last-child {
    border-bottom: none;
}

.hg-panel .newsflash-horiz li a,
.hg-panel .latestnews li a,
.hg-panel .mostread li a {
    color: var(--hg-text);
    text-decoration: none;
    display: block;
    transition: color var(--hg-duration) var(--hg-ease);
}

.hg-panel .newsflash-horiz li a:hover,
.hg-panel .latestnews li a:hover,
.hg-panel .mostread li a:hover {
    color: var(--hg-accent-dark);
}

/* Bullet indicator */
.hg-panel .latestnews li::before,
.hg-panel .mostread li::before {
    content: '';
    display: inline-block;
    width: 5px;
    height: 5px;
    background: var(--hg-accent);
    border-radius: 50%;
    margin-inline-end: 0.5rem;
    vertical-align: middle;
}

/* ==========================================================================
   Newsletter / Contact Form in sidebar
   ========================================================================== */
.hg-panel .hg-newsletter-form,
.hg-panel form {
    display: flex;
    flex-direction: column;
    gap: var(--hg-space-sm);
}

.hg-panel input[type="text"],
.hg-panel input[type="email"] {
    padding: 0.5rem 0.7rem;
    font-size: 0.88rem;
    border-radius: var(--hg-radius);
}

.hg-panel .btn,
.hg-panel button[type="submit"],
.hg-panel input[type="submit"] {
    padding: 0.5rem 1rem;
    font-size: 0.88rem;
    width: 100%;
}

/* ==========================================================================
   Menu Override Styles (hg-menu)
   ========================================================================== */
.hg-menu {
    list-style: none;
    display: flex;
    align-items: stretch;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}

.hg-menu__item {
    position: relative;
}

.hg-menu__item > a {
    display: flex;
    align-items: center;
    padding: 0.85rem 1.15rem;
    color: var(--hg-text-on-dark);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all var(--hg-duration) var(--hg-ease);
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    text-decoration: none;
}

.hg-menu__item > a:hover,
.hg-menu__item > a:focus {
    background: var(--hg-primary-light);
    border-bottom-color: var(--hg-accent);
    color: var(--hg-accent-light);
}

.hg-menu__item.active > a,
.hg-menu__item.current > a {
    background: var(--hg-primary-light);
    border-bottom-color: var(--hg-accent);
}

/* Dropdown caret */
.hg-menu__caret {
    display: inline-block;
    width: 0;
    height: 0;
    border-inline-start: 4px solid transparent;
    border-inline-end: 4px solid transparent;
    border-top: 4px solid currentColor;
    margin-inline-start: 6px;
    opacity: 0.5;
    vertical-align: middle;
    position: absolute;
    top: 50%;
    inset-inline-end: 8px;
    transform: translateY(-50%);
}

/* Submenu */
.hg-menu__sub {
    list-style: none;
    position: absolute;
    top: 100%;
    inset-inline-start: 0;
    min-width: 230px;
    background: var(--hg-bg-card);
    box-shadow: var(--hg-shadow-lg);
    border-radius: 0 0 var(--hg-radius) var(--hg-radius);
    border-top: 3px solid var(--hg-accent);
    padding: 0;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all var(--hg-duration) var(--hg-ease);
    z-index: 1000;
}

.hg-menu__item:hover > .hg-menu__sub {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.hg-menu__sub .hg-menu__item > a {
    color: var(--hg-text);
    padding: 0.6rem 1.15rem;
    border-bottom: none;
    border-inline-start: 3px solid transparent;
    font-size: 0.9rem;
    font-weight: 400;
}

.hg-menu__sub .hg-menu__item > a:hover {
    background: var(--hg-bg-alt);
    border-inline-start-color: var(--hg-accent);
    color: var(--hg-primary);
}

/* Third level sub */
.hg-menu__sub .hg-menu__sub {
    top: 0;
    inset-inline-start: 100%;
    border-top: none;
    border-inline-start: 3px solid var(--hg-accent);
    border-radius: var(--hg-radius);
}

/* ==========================================================================
   Responsive — Updated for 3-column layout
   ========================================================================== */

@media (max-width: 991px) {
    .hg-content--dual-sidebar .hg-sidebar--end,
    .hg-content--dual-sidebar .hg-sidebar--start,
    .hg-content--dual-sidebar .hg-content {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .hg-content--dual-sidebar .hg-sidebar--end {
        order: 2;
    }

    .hg-content--dual-sidebar .hg-content {
        order: 1;
    }

    .hg-content--dual-sidebar .hg-sidebar--start {
        order: 3;
    }

    .hg-content--single-sidebar .hg-sidebar--end,
    .hg-content--single-sidebar .hg-sidebar--start {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .blog .items-row {
        flex-direction: column;
    }
}

@media (max-width: 767px) {
    .hg-menu {
        flex-direction: column;
    }

    .hg-menu__item > a {
        padding: 0.75rem 1.25rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        border-inline-start: 3px solid transparent;
    }

    .hg-menu__item > a:hover {
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        border-inline-start-color: var(--hg-accent);
    }

    .hg-menu__caret {
        inset-inline-end: 16px;
    }

    .hg-menu__sub {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border-top: none;
        border-radius: 0;
        background: rgba(0, 0, 0, 0.15);
        min-width: auto;
    }

    .hg-menu__sub .hg-menu__item > a {
        color: var(--hg-text-on-dark);
        padding-inline-start: 2rem;
    }

    .hg-menu__sub .hg-menu__sub {
        inset-inline-start: 0;
        border-inline-start: none;
    }

    .hg-menu__sub .hg-menu__sub .hg-menu__item > a {
        padding-inline-start: 3rem;
    }
}
