{{!
    This file is part of Moodle - http://moodle.org/

    Moodle is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Moodle is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
}}
{{!
    @template theme_thinkera/core/email_html

    Every HTML message the platform sends is wrapped in this (lib/moodlelib.php: email_to_user). Written the way
    email clients still need it in 2026: tables for the layout, styles on the elements themselves, one 600px
    column, and a logo loaded over http(s) — Gmail draws neither SVG nor a data: URI.

    The <style> block is a bonus for the clients that read it (Apple Mail, Outlook.com, Gmail's web app): it
    styles the links and headings in the body, which arrives as ready-made HTML and cannot be styled inline.

    Context variables required for this template: sitefullname, siteshortname, sitewwwroot, subject, prefix,
    to, toname, from, fromname, body.
}}
<!DOCTYPE html>
<html dir="auto">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{subject}}</title>
<style>
  .tk-body a { color: #113972; }
  .tk-body h1, .tk-body h2, .tk-body h3 { color: #0F1B2D; font-size: 19px; margin: 0 0 10px; }
  .tk-body p { margin: 0 0 14px; }
  .tk-body ul, .tk-body ol { margin: 0 0 14px; padding-inline-start: 22px; }
  @media (prefers-color-scheme: dark) {
    .tk-card { background: #101826 !important; }
    .tk-body, .tk-body p, .tk-body li { color: #E6ECF5 !important; }
    .tk-body a { color: #8FB3E6 !important; }
  }
</style>
</head>
<body style="margin:0; padding:0; background:#EEF2F8;">
<span style="display:none; font-size:1px; color:#EEF2F8; max-height:0; overflow:hidden;">{{subject}}</span>
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="background:#EEF2F8; padding:24px 12px;">
  <tr>
    <td align="center">
      <table role="presentation" width="600" cellpadding="0" cellspacing="0" border="0" style="width:100%; max-width:600px;">

        <tr>
          <td style="background:#113972; border-radius:18px 18px 0 0; padding:22px 28px;" align="center">
            <a href="{{sitewwwroot}}"
               style="text-decoration:none; color:#ffffff; font-family:'Segoe UI',Tahoma,Arial,sans-serif;
                      font-size:20px; font-weight:700;">
              {{! the alt text is styled too: a mail client that blocks images (or cannot reach the site, as
                  Gmail cannot reach localhost) then shows the academy's name in white instead of a broken icon }}
              <img src="{{sitewwwroot}}/theme/thinkera/pix/logo-email.png" alt="{{sitefullname}}"
                   width="150"
                   style="display:inline-block; width:150px; max-width:150px; height:auto; border:0; outline:none;
                          color:#ffffff; font-family:'Segoe UI',Tahoma,Arial,sans-serif; font-size:20px;
                          font-weight:700; text-decoration:none;">
            </a>
          </td>
        </tr>

        <tr>
          <td class="tk-card tk-body" dir="auto"
              style="background:#FFFFFF; padding:28px; font-family:'Segoe UI',Tahoma,Arial,sans-serif;
                     font-size:16px; line-height:1.9; color:#0F1B2D;">
            {{{body}}}
          </td>
        </tr>

        <tr>
          <td style="background:#FFFFFF; border-radius:0 0 18px 18px; border-top:1px solid #E6EBF2; padding:18px 28px;
                     font-family:'Segoe UI',Tahoma,Arial,sans-serif; font-size:13px; line-height:1.8; color:#5B6B82;"
              dir="auto">
            {{#str}}email_footer, theme_thinkera{{/str}}<br>
            <a href="{{sitewwwroot}}" style="color:#113972; text-decoration:none;">{{sitefullname}}</a>
          </td>
        </tr>

      </table>
    </td>
  </tr>
</table>
</body>
</html>
