/**
 * Theme Name:      Rookery School
 * Theme URI:       https://www.elegantthemes.com/gallery/divi/
 * Description:     Rookery School Child Theme
 * Author:          MADEBY7
 * Author URI:      https://www.madeby7.co.uk
 * Template:         Divi
 * Version:         1.0.0
 * Text Domain:     rookery-school
 * License:         GPL2
 * License URI:     https://www.gnu.org/licenses/gpl-2.0.html
 */
  
 
/* ---------------------- Theme customization starts here ---------------------- */

/* =========================================================
   ROOKERY SCHOOL
   SCHOOL CALENDAR
   ========================================================= */

.rookery-calendar {
    --rookery-navy: #061c3b;
    --rookery-blue: #143f7a;
    --rookery-yellow: #f2bf26;
    --rookery-text: #172033;
    --rookery-muted: #687385;
    --rookery-light: #f5f7f9;
    --rookery-border: #dfe5ea;
    --rookery-white: #ffffff;

    width: 100%;
}


/* =========================================================
   SCHOOL YEAR
   ========================================================= */

.rookery-calendar-year {
    width: 100%;
    margin: 0;
    padding: 0;
}

.rookery-calendar-year + .rookery-calendar-year {
    margin-top: 60px;
}


/* =========================================================
   SCHOOL YEAR HEADING
   ========================================================= */

.rookery-calendar-year__heading {
    max-width: 760px;

    margin: 0 0 20px;
    padding: 0 0 30px;

    border-bottom: 1px solid var(--rookery-border);
}

.rookery-calendar-year__eyebrow {
    display: block;

    margin: 0 0 10px;
    padding: 0;

    color: var(--rookery-blue);

    font-size: 10px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: 1.3px;
    text-transform: uppercase;
}

.rookery-calendar-year__heading h2 {
    margin: 0;
    padding: 0;

    color: var(--rookery-navy);

    font-size: clamp(28px, 3vw, 40px);
    line-height: 1;
    font-weight: 700;
    letter-spacing: -1px;
}


/* =========================================================
   TERM GROUP
   ========================================================= */

.rookery-calendar-group {
    display: grid;
    grid-template-columns: minmax(220px, 31%) minmax(0, 1fr);
    gap: 55px;

    width: 100%;

    margin: 0;
    padding: 42px 0;

    border-top: 1px solid var(--rookery-border);

    box-sizing: border-box;
}


/* Remove border from first term */

.rookery-calendar-year > .rookery-calendar-group:first-of-type {
    border-top: 0;
}


/* =========================================================
   TERM HEADING
   ========================================================= */

.rookery-calendar-group__heading {
    display: flex;
    align-items: flex-start;
    gap: 18px;

    min-width: 0;
}

.rookery-calendar-group__heading-content {
    min-width: 0;
}

.rookery-calendar-group__number {
    display: flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 42px;

    width: 42px;
    height: 42px;

    margin: 0;

    background: var(--rookery-yellow);
    color: var(--rookery-navy);

    font-size: 12px;
    line-height: 1;
    font-weight: 800;

    border-radius: 3px;

    box-sizing: border-box;
}

.rookery-calendar-group__eyebrow {
    display: block;

    margin: 1px 0 7px;
    padding: 0;

    color: var(--rookery-blue);

    font-size: 10px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: 1.3px;
    text-transform: uppercase;
}

.rookery-calendar-group h3 {
    margin: 0;
    padding: 0;

    color: var(--rookery-navy);

    font-size: clamp(21px, 2vw, 27px);
    line-height: 1.05;
    font-weight: 700;
    letter-spacing: -0.6px;
}


/* =========================================================
   CALENDAR GRID
   ========================================================= */

.rookery-calendar-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 10px;

    width: 100%;
    min-width: 0;

    margin: 0;
    padding: 0;

    border: 0;
}


/* =========================================================
   CALENDAR CARD
   ========================================================= */

.rookery-calendar-card {
    position: relative;

    display: flex;
    align-items: stretch;

    width: 100%;
    min-width: 0;
    min-height: 96px;

    margin: 0;
    padding: 0;

    background: var(--rookery-white);
    color: var(--rookery-navy);

    border: 1px solid var(--rookery-border);
    border-radius: 3px;

    box-sizing: border-box;

    overflow: hidden;

    transition:
        background-color .2s ease,
        border-color .2s ease;
}


/* =========================================================
   DATE PANEL
   ========================================================= */

.rookery-calendar-card__date,
.rookery-calendar-card__date--range {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    flex: 0 0 92px;

    width: 92px;
    min-width: 92px;
    min-height: 94px;

    margin: 0;
    padding: 12px 7px;

    background: var(--rookery-yellow);
    color: var(--rookery-navy);

    text-align: center;

    box-sizing: border-box;
}


/* =========================================================
   STANDARD DATE
   ========================================================= */

.rookery-calendar-card__day {
    display: block;

    margin: 0 0 5px;
    padding: 0;

    color: var(--rookery-navy);

    font-size: 20px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: -0.5px;

    white-space: nowrap;
}

.rookery-calendar-card__month {
    display: block;

    margin: 0;
    padding: 0;

    color: var(--rookery-navy);

    font-size: 10px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;

    white-space: nowrap;
}


/* =========================================================
   CROSS-MONTH DATE RANGE
   ========================================================= */

/*
 * Example:
 *
 * 31 MAY
 *   –
 * 04 JUN
 *
 * Kept deliberately close in visual weight to a normal date.
 */

.rookery-calendar-card__range {
    display: block;

    margin: 1px 0;
    padding: 0;

    color: var(--rookery-navy);

    font-size: 12px;
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: 0;

    white-space: nowrap;
}


/* =========================================================
   CARD CONTENT
   ========================================================= */

.rookery-calendar-card__content {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;

    min-width: 0;

    margin: 0;
    padding: 18px 21px;

    box-sizing: border-box;
}


/* =========================================================
   EVENT TYPE
   ========================================================= */

.rookery-calendar-card__type {
    display: block;

    margin: 0 0 6px;
    padding: 0;

    color: var(--rookery-blue);

    font-size: 10px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: 1.1px;
    text-transform: uppercase;
}


/* =========================================================
   EVENT TITLE
   ========================================================= */

.rookery-calendar-card__title {
    width: 100%;

    margin: 0;
    padding: 0;

    color: var(--rookery-navy);

    font-size: 16px;
    line-height: 1.3;
    font-weight: 700;

    overflow-wrap: break-word;
}

.rookery-calendar-card__title a {
    color: inherit;

    font-size: inherit;
    line-height: inherit;
    font-weight: inherit;

    text-decoration: none !important;
}

.rookery-calendar-card__title a:link,
.rookery-calendar-card__title a:visited,
.rookery-calendar-card__title a:hover,
.rookery-calendar-card__title a:active {
    color: inherit;
    text-decoration: none !important;
}


/* =========================================================
   DESCRIPTION
   ========================================================= */

.rookery-calendar-card__description {
    width: 100%;

    margin: 7px 0 0;
    padding: 0;

    color: var(--rookery-muted);

    font-size: 13px;
    line-height: 1.5;
    font-weight: 400;
}

.rookery-calendar-card__description p {
    margin: 0;
    padding: 0;
}


/* =========================================================
   TBC STATUS
   ========================================================= */

.rookery-calendar-card__status {
    display: inline-flex;
    align-items: center;

    margin: 10px 0 0;
    padding: 5px 7px;

    background: var(--rookery-light);
    color: var(--rookery-blue);

    font-size: 9px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: .8px;
    text-transform: uppercase;

    border-radius: 2px;
}


/* =========================================================
   HIGHLIGHT DATE
   ========================================================= */

/*
 * Keeps highlighted entries subtle and within the
 * existing Rookery visual language.
 */

.rookery-calendar-card--highlight {
    border-color: var(--rookery-yellow);
}


/* =========================================================
   HOVER
   ========================================================= */

.rookery-calendar-card:hover {
    background: var(--rookery-light);
    border-color: var(--rookery-border);
}


/* Yellow hover detail */

.rookery-calendar-card::before {
    content: "";

    position: absolute;
    top: -1px;
    left: 92px;

    width: 0;
    height: 3px;

    background: var(--rookery-yellow);

    transition: width .25s ease;
}

.rookery-calendar-card:hover::before {
    width: 45px;
}


/* =========================================================
   LINKED CARD HOVER
   ========================================================= */

.rookery-calendar-card__title a {
    transition: color .2s ease;
}

.rookery-calendar-card:hover .rookery-calendar-card__title a {
    color: var(--rookery-blue);
}


/* =========================================================
   EMPTY CALENDAR
   ========================================================= */

.rookery-calendar--empty {
    padding: 25px;

    background: var(--rookery-light);

    border: 1px solid var(--rookery-border);
    border-radius: 3px;

    box-sizing: border-box;
}

.rookery-calendar--empty p {
    margin: 0;
    padding: 0;

    color: var(--rookery-text);

    font-size: 15px;
    line-height: 1.6;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 980px) {

    .rookery-calendar-year + .rookery-calendar-year {
        margin-top: 45px;
    }

    .rookery-calendar-group {
        grid-template-columns: 1fr;

        gap: 28px;

        padding: 35px 0;
    }

}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 767px) {

    .rookery-calendar-year + .rookery-calendar-year {
        margin-top: 35px;
    }

    .rookery-calendar-year__heading {
        padding-bottom: 25px;
    }

    .rookery-calendar-year__heading h2 {
        font-size: 30px;
    }

    .rookery-calendar-group {
        gap: 24px;

        padding: 30px 0;
    }

    .rookery-calendar-grid {
        grid-template-columns: 1fr;

        gap: 10px;
    }

    .rookery-calendar-group__number {
        flex-basis: 38px;

        width: 38px;
        height: 38px;
    }

    .rookery-calendar-group h3 {
        font-size: 23px;
    }

}


/* =========================================================
   VERY SMALL MOBILE
   ========================================================= */

@media (max-width: 479px) {

    .rookery-calendar-group__heading {
        gap: 14px;
    }

    .rookery-calendar-card__date,
    .rookery-calendar-card__date--range {
        flex-basis: 82px;

        width: 82px;
        min-width: 82px;

        padding-left: 5px;
        padding-right: 5px;
    }

    .rookery-calendar-card__day {
        font-size: 18px;
        letter-spacing: -0.4px;
    }

    .rookery-calendar-card__month {
        font-size: 9px;
    }

    .rookery-calendar-card__range {
        font-size: 11px;
    }

    .rookery-calendar-card__content {
        padding: 16px;
    }

    .rookery-calendar-card__title {
        font-size: 15px;
    }

    .rookery-calendar-card::before {
        left: 82px;
    }

}


/* =========================================================
   WORDPRESS / DIVI CLEANUP
   ========================================================= */

/* Remove auto-generated empty paragraphs */

.rookery-calendar-grid > p {
    display: none !important;
}

.rookery-calendar-grid > .rookery-calendar-card:empty {
    display: none !important;
}


/* Remove unwanted Divi paragraph spacing */

.rookery-calendar p:empty {
    display: none;
}


/* Ensure Divi does not interfere with card sizing */

.rookery-calendar *,
.rookery-calendar *::before,
.rookery-calendar *::after {
    box-sizing: border-box;
}