/*
Theme Name: GovEduCouncil
Theme URI: https://example.gov.in/theme
Author: Government Educational Council
Author URI: https://example.gov.in
Description: A modern, professional, accessible WordPress theme for Government Educational Council portals. Supports role-based navigation, custom post types for notices, circulars, recruitment, news, approved colleges, and gallery. Built for accessibility (WCAG 2.1), SEO, and responsive design.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: goveducouncil
Tags: government, education, responsive, accessibility-ready, custom-colors, custom-logo, custom-menu, featured-images, translation-ready, blog, portfolio
*/

/* ==========================================================================
   CSS Custom Properties (Design System Tokens)
   ========================================================================== */
:root {
    /* Colors */
    --color-primary:        #003366;
    --color-primary-dark:   #00244d;
    --color-primary-light:  #1565C0;
    --color-secondary:      #C8A045;
    --color-secondary-dark: #a07c2a;
    --color-accent:         #1976D2;
    --color-light-blue:     #E8F0FE;
    --color-sky:            #BBDEFB;
    --color-white:          #FFFFFF;
    --color-off-white:      #F5F7FA;
    --color-bg:             #F0F4F9;
    --color-text:           #1A1A2E;
    --color-text-muted:     #5C6070;
    --color-text-light:     #8892A0;
    --color-border:         #DDE3EE;
    --color-success:        #2E7D32;
    --color-warning:        #E65100;
    --color-danger:         #C62828;
    --color-overlay:        rgba(0, 51, 102, 0.85);

    /* Typography */
    --font-primary:   'Outfit', 'Segoe UI', Arial, sans-serif;
    --font-secondary: 'Merriweather', Georgia, serif;
    --font-mono:      'Fira Code', 'Courier New', monospace;

    --text-xs:   0.75rem;    /* 12px */
    --text-sm:   0.875rem;   /* 14px */
    --text-base: 1rem;       /* 16px */
    --text-lg:   1.125rem;   /* 18px */
    --text-xl:   1.25rem;    /* 20px */
    --text-2xl:  1.5rem;     /* 24px */
    --text-3xl:  1.875rem;   /* 30px */
    --text-4xl:  2.25rem;    /* 36px */
    --text-5xl:  3rem;       /* 48px */

    --weight-regular: 400;
    --weight-medium:  500;
    --weight-semi:    600;
    --weight-bold:    700;
    --weight-black:   800;

    --leading-tight:  1.25;
    --leading-normal: 1.6;
    --leading-loose:  1.8;

    /* Spacing */
    --space-1:  0.25rem;
    --space-2:  0.5rem;
    --space-3:  0.75rem;
    --space-4:  1rem;
    --space-5:  1.25rem;
    --space-6:  1.5rem;
    --space-8:  2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;

    /* Borders */
    --radius-sm:   4px;
    --radius-md:   8px;
    --radius-lg:   12px;
    --radius-xl:   16px;
    --radius-2xl:  24px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm:   0 1px 4px rgba(0, 51, 102, 0.06);
    --shadow-md:   0 4px 16px rgba(0, 51, 102, 0.10);
    --shadow-lg:   0 8px 32px rgba(0, 51, 102, 0.14);
    --shadow-xl:   0 16px 48px rgba(0, 51, 102, 0.18);
    --shadow-gold: 0 4px 16px rgba(200, 160, 69, 0.25);

    /* Transitions */
    --transition-fast:   150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow:   400ms ease;

    /* Layout */
    --container-max:  1280px;
    --container-wide: 1400px;
    --header-height:  80px;

    /* Z-index */
    --z-dropdown: 100;
    --z-sticky:   200;
    --z-modal:    300;
    --z-toast:    400;
}

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

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

body {
    font-family: var(--font-primary);
    font-size: var(--text-base);
    font-weight: var(--weight-regular);
    line-height: var(--leading-normal);
    color: var(--color-text);
    background-color: var(--color-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

a {
    color: var(--color-primary-light);
    text-decoration: none;
    transition: color var(--transition-fast);
}
a:hover { color: var(--color-primary); }
a:focus-visible {
    outline: 3px solid var(--color-secondary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

ul, ol { list-style: none; }

h1, h2, h3, h4, h5, h6 {
    font-weight: var(--weight-bold);
    line-height: var(--leading-tight);
    color: var(--color-primary);
    margin-bottom: var(--space-4);
}
h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

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

/* ==========================================================================
   Layout Utilities
   ========================================================================== */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--space-6);
    padding-right: var(--space-6);
}
.container--wide {
    max-width: var(--container-wide);
}

/* Main content: starts immediately below the nav — no extra gap */
.site-content {
    margin-top: 0;
    padding-top: 0;
}

/* WordPress admin bar compensation */
.admin-bar .site-header { top: 32px; }

@media screen and (max-width: 782px) {
    .admin-bar .site-header { top: 46px; }
}

.section {
    padding-top: var(--space-16);
    padding-bottom: var(--space-16);
}
.section--sm { padding-top: var(--space-10); padding-bottom: var(--space-10); }
.section--lg { padding-top: var(--space-24); padding-bottom: var(--space-24); }

.section-header {
    text-align: center;
    margin-bottom: var(--space-12);
}
.section-header__eyebrow {
    display: inline-block;
    font-size: var(--text-sm);
    font-weight: var(--weight-semi);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-secondary);
    margin-bottom: var(--space-2);
}
.section-header__title {
    font-size: var(--text-3xl);
    color: var(--color-primary);
    position: relative;
    display: inline-block;
    margin-bottom: var(--space-4);
}
.section-header__title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
    border-radius: var(--radius-full);
}
.section-header__subtitle {
    font-size: var(--text-lg);
    color: var(--color-text-muted);
    max-width: 640px;
    margin: var(--space-6) auto 0;
}

/* Grid utilities */
.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
.gap-4  { gap: var(--space-4); }
.gap-6  { gap: var(--space-6); }
.gap-8  { gap: var(--space-8); }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    font-size: var(--text-sm);
    font-weight: var(--weight-semi);
    border-radius: var(--radius-full);
    border: 2px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-normal);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.02em;
}
.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.15);
    opacity: 0;
    transition: opacity var(--transition-fast);
}
.btn:hover::before { opacity: 1; }

.btn--primary {
    background-color: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}
.btn--primary:hover {
    background-color: var(--color-primary-dark);
    color: var(--color-white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}
.btn--secondary {
    background-color: var(--color-secondary);
    color: var(--color-primary);
    border-color: var(--color-secondary);
}
.btn--secondary:hover {
    background-color: var(--color-secondary-dark);
    color: var(--color-white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-gold);
}
.btn--outline {
    background-color: transparent;
    color: var(--color-primary);
    border-color: var(--color-primary);
}
.btn--outline:hover {
    background-color: var(--color-primary);
    color: var(--color-white);
    transform: translateY(-2px);
}
.btn--outline-white {
    background-color: transparent;
    color: var(--color-white);
    border-color: var(--color-white);
}
.btn--outline-white:hover {
    background-color: var(--color-white);
    color: var(--color-primary);
}
.btn--sm { padding: var(--space-2) var(--space-4); font-size: var(--text-xs); }
.btn--lg { padding: var(--space-4) var(--space-8); font-size: var(--text-lg); }

/* ==========================================================================
   Cards
   ========================================================================== */
.card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    position: relative;
    border: 1px solid var(--color-border);
}
.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}
.card__body { padding: var(--space-6); }
.card__image { aspect-ratio: 16/9; overflow: hidden; }
.card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}
.card:hover .card__image img { transform: scale(1.05); }
.card__date {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    margin-bottom: var(--space-2);
}
.card__tag {
    display: inline-block;
    padding: var(--space-1) var(--space-3);
    background: var(--color-light-blue);
    color: var(--color-primary);
    font-size: var(--text-xs);
    font-weight: var(--weight-semi);
    border-radius: var(--radius-full);
    margin-bottom: var(--space-3);
}
.card__title {
    font-size: var(--text-lg);
    color: var(--color-primary);
    margin-bottom: var(--space-3);
    line-height: var(--leading-tight);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card__excerpt {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    line-height: var(--leading-normal);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: var(--space-4);
}
.card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--color-border);
    background: var(--color-off-white);
}

/* ==========================================================================
   Badges & Labels
   ========================================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-xs);
    font-weight: var(--weight-semi);
    border-radius: var(--radius-full);
}
.badge--primary { background: var(--color-primary); color: var(--color-white); }
.badge--secondary { background: var(--color-secondary); color: var(--color-primary-dark); }
.badge--new { background: #E8F5E9; color: var(--color-success); }
.badge--warning { background: #FFF3E0; color: var(--color-warning); }

/* ==========================================================================
   Accessibility
   ========================================================================== */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}
.screen-reader-text:focus {
    background-color: var(--color-white);
    border-radius: 3px;
    box-shadow: 0 0 2px 2px rgba(0,0,0,.6);
    clip: auto !important;
    clip-path: none;
    color: var(--color-primary);
    display: block;
    font-size: var(--text-sm);
    font-weight: var(--weight-bold);
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

/* Skip link */
.skip-link {
    position: absolute;
    top: -999px;
    left: 0;
    padding: var(--space-3) var(--space-6);
    background: var(--color-secondary);
    color: var(--color-primary);
    font-weight: var(--weight-bold);
    z-index: 9999;
    border-radius: 0 0 var(--radius-md) 0;
}
.skip-link:focus { top: 0; }

/* ==========================================================================
   PDF Icon
   ========================================================================== */
.pdf-icon {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: #FFEBEE;
    color: #C62828;
    font-size: var(--text-xs);
    font-weight: var(--weight-semi);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    text-decoration: none;
}
.pdf-icon:hover {
    background: #C62828;
    color: var(--color-white);
}
.pdf-icon svg { width: 14px; height: 14px; }

/* ==========================================================================
   Pagination
   ========================================================================== */
.pagination {
    display: flex;
    gap: var(--space-2);
    justify-content: center;
    margin-top: var(--space-10);
    flex-wrap: wrap;
}
.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: var(--weight-semi);
    border: 2px solid var(--color-border);
    color: var(--color-primary);
    transition: all var(--transition-fast);
}
.pagination a:hover,
.pagination .current {
    background: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}

/* ==========================================================================
   Breadcrumbs
   ========================================================================== */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    padding: var(--space-4) 0;
}
.breadcrumbs a { color: var(--color-primary-light); }
.breadcrumbs a:hover { color: var(--color-primary); }
.breadcrumbs .sep { color: var(--color-text-light); }
.breadcrumbs .current { color: var(--color-text-muted); }

/* ==========================================================================
   Tables
   ========================================================================== */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}
thead { background: var(--color-primary); color: var(--color-white); }
thead th {
    padding: var(--space-4) var(--space-5);
    text-align: left;
    font-weight: var(--weight-semi);
}
tbody tr { border-bottom: 1px solid var(--color-border); }
tbody tr:last-child { border-bottom: none; }
tbody tr:nth-child(even) { background: var(--color-off-white); }
tbody td { padding: var(--space-4) var(--space-5); }

/* ==========================================================================
   Forms
   ========================================================================== */
.form-group { margin-bottom: var(--space-5); }
.form-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    color: var(--color-text);
    margin-bottom: var(--space-2);
}
.form-control {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-base);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-white);
    color: var(--color-text);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(0, 51, 102, 0.1);
}
textarea.form-control { resize: vertical; min-height: 120px; }

/* ==========================================================================
   Alerts
   ========================================================================== */
.alert {
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-md);
    border-left: 4px solid;
    font-size: var(--text-sm);
    margin-bottom: var(--space-4);
}
.alert--info { background: var(--color-light-blue); border-color: var(--color-primary); color: var(--color-primary); }
.alert--success { background: #E8F5E9; border-color: var(--color-success); color: var(--color-success); }
.alert--warning { background: #FFF3E0; border-color: var(--color-warning); color: var(--color-warning); }
.alert--danger { background: #FFEBEE; border-color: var(--color-danger); color: var(--color-danger); }
