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

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 1rem;
    font-family: system-ui, -apple-system, BlinkMacSystemFont,
                 "Segoe UI", Roboto, Ubuntu, sans-serif;
    line-height: 1.6;
    color: #111827;
    background: #ffffff;
}

/* -------------------------------------------------
   Typography
------------------------------------------------- */
h1, h2, h3 {
    line-height: 1.25;
    margin: 0 0 0.5rem;
}

h1 {
    font-size: 1.8rem;
}

h2 {
    font-size: 1.25rem;
}

p {
    margin: 0.4rem 0 0;
    color: #374151;
}

/* -------------------------------------------------
   Links
------------------------------------------------- */
a {
    color: #2563eb;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* -------------------------------------------------
   Layout Containers
------------------------------------------------- */
.container {
    max-width: 1100px;
    margin: 0 auto;
}

.container h2 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

header {
    margin-bottom: 1.8rem;
}

footer {
    margin-top: 3rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
    font-size: 0.9rem;
    color: #6b7280;
}

/* -------------------------------------------------
   Breadcrumbs
------------------------------------------------- */
.breadcrumbs {
    font-size: 0.85rem;
    margin-bottom: 0.8rem;
    color: #6b7280;
}

.breadcrumbs a {
    color: #6b7280;
}

.breadcrumbs span {
    margin: 0 0.25rem;
}

.breadcrumbs span[aria-current="page"] {
    color: #444;
    font-weight: 500;
}

/* -------------------------------------------------
   Grid & Cards
------------------------------------------------- */
.grid {
    display: grid;
    gap: 1.2rem;
}

@media (min-width: 700px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1000px) {
    .grid.three {
        grid-template-columns: repeat(3, 1fr);
    }
}

.card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    background: #fafafa;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.card:hover {
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
    transform: translateY(-1px);
}

.card h2 {
    font-size: 1.1rem;
    margin-top: 0;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    @margin-top: 1rem;
}
/* -------------------------------------------------
   Buttons & CTA
------------------------------------------------- */
.button {
    display: inline-block;
    margin-top: 0.8rem;
    padding: 0.45rem 0.9rem;
    background: #2563eb;
    color: #ffffff;
    border-radius: 5px;
    font-size: 0.9rem;
}

.button:hover {
    background: #1e40af;
    text-decoration: none;
}

/* Highlighted / featured card */
.highlight-card {
    position: relative;
    display: block;

    padding: 1rem 1.25rem;
    border-radius: 14px;

    background: linear-gradient(
        180deg,
        rgba(34, 139, 230, 0.08),
        rgba(34, 139, 230, 0.04)
    );

    border: 1px solid rgba(34, 139, 230, 0.25);

    color: #0f2a44;
    text-decoration: none;

    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease;
}

/* Hover / focus */
.highlight-card:hover,
.highlight-card:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.1);
    border-color: rgba(34, 139, 230, 0.45);
}

/* Title */
.highlight-card strong {
    display: block;
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

/* Supporting text */
.highlight-card .meta {
    font-size: 0.85rem;
    color: #4b647a;
}

/* Optional badge */
.highlight-card .badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;

    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;

    padding: 0.2rem 0.5rem;
    border-radius: 999px;

    background: rgba(34, 139, 230, 0.15);
    color: #1b4f8a;
}

/* -------------------------------------------------
   Lists
------------------------------------------------- */
.list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.list li {
    padding: 0.4rem 0;
    border-bottom: 1px dashed #e5e7eb;
}

/* -------------------------------------------------
   Tables (month view / decision info)
------------------------------------------------- */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 0.95rem;
}

th, td {
    text-align: left;
    padding: 0.5rem 0.4rem;
    border-bottom: 1px solid #e5e7eb;
}

th {
    background: #f9fafb;
    font-weight: 600;
}

/* -------------------------------------------------
   Notices & Meta
------------------------------------------------- */
.notice {
    padding: 0.75rem 1rem;
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    border-radius: 4px;
    margin: 1rem 0;
    font-size: 0.9rem;
}

.meta {
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: 0.4rem;
}

/* -------------------------------------------------
   404 / Empty states
------------------------------------------------- */
.empty {
    padding: 2rem 1rem;
    text-align: center;
    color: #6b7280;
}

/* ------------------------------------------------
    Calendar Days
------------------------------------------------ */


.authority {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.authority img {
  height: 40px;
  width: auto;
}

.calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border: 1px solid #ddd;
  margin-top: 1rem;
}

.calendar > div {
  border: 1px solid #eee;
  padding: .4rem;
  min-height: 64px;
  font-size: .85rem;
}

.weekday {
    background: #f3f3f3;
    font-weight: bold;
    text-align: center;
    font-size: 0.85rem;
    padding: .4rem;
}

.hijri-day {
  font-size: 2.4em;
}

.today {
    background: #e7f3ff;
    border: 2px solid #0077cc;
}

.today .hijri-day::after {
    content: "•";
    color: #0077cc;
    display: block;
    font-size: 1.2rem;
    line-height: 1;
}

.gregorian {
  font-size: .75em;
  color: #555;
}

.friday {
  background: #faf6e8;
}

.start-day {
  color: #0077cc;
}

.subtitle {
    color: #555;
    margin-top: .25rem;
    font-size: 0.95rem;
}

@media (min-width: 640px) {
  .calendar > div {
    padding: .6rem;
    min-height: 80px;
    font-size: .95rem;
  }
}
/* Mobile: rotate weekday names */
@media (max-width: 600px) {
    .weekday {
        writing-mode: vertical-rl;
        text-orientation: mixed;
        transform: rotate(180deg); /* makes text readable top-down */
        padding: .2rem 0;
        font-size: 0.75rem;
    }
}

/* ===== Home page ===== */

.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 1.9rem;
    margin-bottom: 0.6rem;
}

.page-header .intro {
    color: #555;
    margin: 0.4rem 0;
}

.hero {
  display: grid;
  gap: 1.5rem;
  align-items: center;
  margin-bottom: 2rem;
}

.hero-image img {
  width: 100%;
  height: auto;
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(0,0,0,.08);
}

@media (min-width: 900px) {
  .hero {
    grid-template-columns: 1.1fr 0.9fr;
  }
}

/* Country grid */

.country-grid {
    display: grid;
    gap: 1rem;
}

@media (min-width: 640px) {
    .country-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 960px) {
    .country-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.country-card {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    padding: 0.9rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fafafa;
    text-decoration: none;
    transition: border-color 0.15s, background 0.15s;
}

.country-card:hover {
    background: #fff;
    border-color: #0066cc;
}

.flag-wrap img {
    display: block;
    border-radius: 2px;
}

.country-meta h2 {
    font-size: 1.1rem;
    margin: 0;
}

.country-code {
    font-size: 0.75rem;
    color: #777;
    letter-spacing: 0.04em;
}

.authority-name {
    font-size: 0.85rem;
    margin-top: 0.25rem;
    color: #444;
}

.muted {
    color: #888;
}

/* Authority box */
.authority-box {
    margin: 2rem 0;
    padding: 1.25rem;
    border-radius: 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
}

.authority-box h2 {
    margin-bottom: 1rem;
    margin-top: auto;
}

/* Flex container */
.authority-media {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

/* Logo container — fixed width */
.authority-logo {
    flex: 0 0 144px;           /* SAME WIDTH FOR ALL */
    height: 144px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #999999;
    border-radius: 10%;
}

/* Logo image */
.authority-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;     /* no distortion */
}

/* Text block */
.authority-content {
    flex: 1;
}

.authority-name {
    margin: 0 0 0.25rem;
    font-size: 1rem;
}

.authority-native {
    font-weight: normal;
    color: #6b7280;
    font-size: 0.95em;
}

.authority-desc {
    margin: 0;
    color: #374151;
    line-height: 1.5;
}

/* Mobile stacking */
@media (max-width: 480px) {
    .authority-media {
        flex-direction: column;
        align-items: flex-start;
    }

    .authority-logo {
        width: 144px;
        height: 144px;
    }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.today-hijri {
    margin-top: 3rem;
}

.today-hijri-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0;
}

.today-hijri-list li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0;
    font-size: 0.95rem;
}

.today-hijri-list img {
    flex-shrink: 0;
    border-radius: 2px;
}

.today-hijri-list a {
    color: inherit;
    text-decoration: none;
}

.today-hijri-list a:hover {
    text-decoration: underline;
}
.today-hijri {
    margin: 3rem 0;
}

.today-hijri h2 {
    margin-bottom: .5rem;
}

.today-hijri-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
    margin-top: 1.25rem;
}

.today-hijri-card {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 1rem;
    background: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.today-hijri-card header {
    margin-bottom: .75rem;
}

.today-hijri-card .country {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .95rem;
}

.today-hijri-card .authority {
    font-size: .8rem;
    margin-top: .25rem;
}

.today-hijri-card .hijri-date {
    margin: .75rem 0;
}

.today-hijri-card .hijri {
    display: block;
    font-weight: 600;
    font-size: 1.05rem;
}

.today-hijri-card .gregorian {
    font-size: .85rem;
}

.today-hijri-card .view-link {
    margin-top: .5rem;
    font-size: .85rem;
    text-decoration: none;
    color: #2563eb;
}

.today-hijri-card .view-link:hover {
    text-decoration: underline;
}

.month-hero {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
}

.month-hero img {
    flex: 0 0 320px;
    max-width: 320px;
    border-radius: 10px;
    border: 0.5px solid #f9fafb;
}

.month-meta h1 {
    margin: 0 0 .4rem;
}

@media (max-width: 640px) {
    .month-hero {
        flex-direction: column;
        text-align: center;
    }

    .month-hero img {
        max-width: 240px;
    }
}
